|
@@ -820,6 +820,7 @@ export default {
|
|
|
|
|
|
const submitData = {
|
|
const submitData = {
|
|
...this.contentForm,
|
|
...this.contentForm,
|
|
|
|
+ id: this.contentForm.id,
|
|
content: this.contentForm.content // processContent(this.contentForm.content),
|
|
content: this.contentForm.content // processContent(this.contentForm.content),
|
|
}
|
|
}
|
|
await projectUpdate(submitData)
|
|
await projectUpdate(submitData)
|
|
@@ -856,7 +857,8 @@ export default {
|
|
// 只更新必要的字段
|
|
// 只更新必要的字段
|
|
const updateData = {
|
|
const updateData = {
|
|
...this.remarkForm,
|
|
...this.remarkForm,
|
|
- remarks: this.remarkForm.remarks
|
|
|
|
|
|
+ remarks: this.remarkForm.remarks,
|
|
|
|
+ id: this.remarkForm.id,
|
|
}
|
|
}
|
|
|
|
|
|
await projectUpdate(updateData)
|
|
await projectUpdate(updateData)
|
|
@@ -1367,16 +1369,16 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
try {
|
|
try {
|
|
- const res = await create_items({
|
|
|
|
|
|
+ const res = await projectListFromTemplate/* create_items */({
|
|
project_id: this.selectedProjectId,
|
|
project_id: this.selectedProjectId,
|
|
- project_name: this.projectOptions.find(
|
|
|
|
|
|
+ /* project_name: this.projectOptions.find(
|
|
(p) => p.id === this.selectedProjectId
|
|
(p) => p.id === this.selectedProjectId
|
|
- ).name
|
|
|
|
|
|
+ ).name */
|
|
})
|
|
})
|
|
|
|
|
|
if (res.status === 200) {
|
|
if (res.status === 200) {
|
|
this.$message.success(
|
|
this.$message.success(
|
|
- `成功创建 ${res.data.data.created_count} 个输入项目!`
|
|
|
|
|
|
+ `成功创建 ${res.data.total} 个输入项目!`
|
|
)
|
|
)
|
|
await this.fetchGsprData()
|
|
await this.fetchGsprData()
|
|
}
|
|
}
|
|
@@ -1416,18 +1418,18 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
try {
|
|
try {
|
|
- const res = await update_items({
|
|
|
|
|
|
+ const res = await projectListFromTemplate/* update_items */({
|
|
// 假设有一个update_items的API
|
|
// 假设有一个update_items的API
|
|
project_id: selectedProject.id,
|
|
project_id: selectedProject.id,
|
|
- project_name: selectedProject.name
|
|
|
|
|
|
+ /* project_name: selectedProject.name */
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ console.log(res);
|
|
if (res.status !== 200) {
|
|
if (res.status !== 200) {
|
|
throw new Error('更新失败')
|
|
throw new Error('更新失败')
|
|
}
|
|
}
|
|
|
|
|
|
this.$message.success(
|
|
this.$message.success(
|
|
- `成功更新 ${res.data.data.updated_count} 个输入项目!`
|
|
|
|
|
|
+ `成功更新 ${res.data.total} 个输入项目!`
|
|
)
|
|
)
|
|
await this.fetchGsprData()
|
|
await this.fetchGsprData()
|
|
} finally {
|
|
} finally {
|
|
@@ -1528,11 +1530,16 @@ export default {
|
|
page_size: this.pageSize
|
|
page_size: this.pageSize
|
|
}
|
|
}
|
|
|
|
|
|
- const response = await projectListFromTemplate(params)
|
|
|
|
|
|
+ const response = await projectList(params)
|
|
|
|
|
|
if (!response || !response.data) {
|
|
if (!response || !response.data) {
|
|
throw new Error('API响应数据格式错误')
|
|
throw new Error('API响应数据格式错误')
|
|
}
|
|
}
|
|
|
|
+ response.data.list.map(el=>{
|
|
|
|
+ if(el.score==null){
|
|
|
|
+ el.score=0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
|
|
const responseData = response.data
|
|
const responseData = response.data
|
|
|
|
|
|
@@ -1554,7 +1561,7 @@ export default {
|
|
update_time: item.update_time || '',
|
|
update_time: item.update_time || '',
|
|
score: item.score || 0
|
|
score: item.score || 0
|
|
})) */
|
|
})) */
|
|
- this.gsprTableData = responseData.items//filteredItems
|
|
|
|
|
|
+ this.gsprTableData = responseData.list//filteredItems
|
|
this.gsprTotal = responseData.total // 使用API返回的总数
|
|
this.gsprTotal = responseData.total // 使用API返回的总数
|
|
this.hasExistingData = this.gsprTableData.length > 0
|
|
this.hasExistingData = this.gsprTableData.length > 0
|
|
} catch (error) {
|
|
} catch (error) {
|