|
@@ -379,7 +379,7 @@ export default {
|
|
|
gsprPageForm: {
|
|
|
page: 1,
|
|
|
page_size: 30,
|
|
|
- /* sort_field:'sequence',
|
|
|
+ /* sort_field:'sequence',
|
|
|
sort_order:"asc", */
|
|
|
},
|
|
|
gsprTotal: 0,
|
|
@@ -455,6 +455,32 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ /* 修改评分 */
|
|
|
+ async rateScope(value, row) {
|
|
|
+ try {
|
|
|
+ const response = await rateScope({
|
|
|
+ id: row.id,
|
|
|
+ score: value,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (response.status === 200) {
|
|
|
+ this.$message.success("评分更新成功");
|
|
|
+ // 更新本地数据
|
|
|
+ const index = this.gsprTableData.findIndex(
|
|
|
+ (item) => item.id === row.id
|
|
|
+ );
|
|
|
+ if (index !== -1) {
|
|
|
+ this.gsprTableData[index].score = value;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new Error(response.message || "评分更新失败");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error.message || "评分更新失败");
|
|
|
+ // 恢复原始评分
|
|
|
+ row.score = row.score || 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
/* 修改序号 */
|
|
|
handleEditSequence(row) {
|
|
|
this.sequenceForm.sequence = row.sequence;
|
|
@@ -854,7 +880,6 @@ export default {
|
|
|
this.$message.warning("请先选择一个项目");
|
|
|
return;
|
|
|
}
|
|
|
- console.log(this.selectedProjectId);
|
|
|
const selectedProject = this.projectOptions.find(
|
|
|
(p) => p.id === this.selectedProjectId
|
|
|
);
|
|
@@ -1063,7 +1088,7 @@ export default {
|
|
|
if (response.status === 200) {
|
|
|
this.gsprTableData = response.data.list.map((item) => ({
|
|
|
...item,
|
|
|
- score: item.score || 0,
|
|
|
+ score: typeof item.score === "number" ? item.score : 0, // 确保 score 是数字类型
|
|
|
}));
|
|
|
this.gsprTotal = response.data.total;
|
|
|
this.hasExistingData = this.gsprTotal > 0;
|