|
@@ -65,17 +65,32 @@ export default {
|
|
computed: {
|
|
computed: {
|
|
totalScore() {
|
|
totalScore() {
|
|
let a = 0;
|
|
let a = 0;
|
|
|
|
+
|
|
|
|
+ let isPing = 0;
|
|
this.scoTitList.forEach(e => {
|
|
this.scoTitList.forEach(e => {
|
|
- a += e.cog;
|
|
|
|
|
|
+ console.log(e.cog);
|
|
|
|
+ if (!e.cog && e.cog != 0) {
|
|
|
|
+ isPing += 1;
|
|
|
|
+ } else {
|
|
|
|
+ a += e.cog;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
let data = 0;
|
|
let data = 0;
|
|
- data = (a / this.scoTit.length).toFixed(1);
|
|
|
|
- this.$emit("updateDocSco", {
|
|
|
|
- val: this.toolIndex,
|
|
|
|
- val2: this.wIndex,
|
|
|
|
- val3: data
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
|
|
+ if (isPing != 0) {
|
|
|
|
+ this.$emit("updateDocSco", {
|
|
|
|
+ val: this.toolIndex,
|
|
|
|
+ val2: this.wIndex,
|
|
|
|
+ val3: null
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ data = (a / this.scoTit.length).toFixed(1);
|
|
|
|
+ this.$emit("updateDocSco", {
|
|
|
|
+ val: this.toolIndex,
|
|
|
|
+ val2: this.wIndex,
|
|
|
|
+ val3: data
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -95,27 +110,32 @@ export default {
|
|
this.ajax
|
|
this.ajax
|
|
.get(this.$store.state.api + "selectWorksEvaScore", params)
|
|
.get(this.$store.state.api + "selectWorksEvaScore", params)
|
|
.then(res => {
|
|
.then(res => {
|
|
- // console.log(res);
|
|
|
|
if (res.data[0].length > 0) {
|
|
if (res.data[0].length > 0) {
|
|
- let data2 = [];
|
|
|
|
|
|
+ var data2 = [];
|
|
res.data[0].forEach((val, index) => {
|
|
res.data[0].forEach((val, index) => {
|
|
if (val.task == this.task) {
|
|
if (val.task == this.task) {
|
|
data2 = res.data[0][index];
|
|
data2 = res.data[0][index];
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
- let data = JSON.parse(data2.rate);
|
|
|
|
-
|
|
|
|
- this.scoTitList.forEach((e, index) => {
|
|
|
|
- e.cog = 0;
|
|
|
|
- for (const key in data) {
|
|
|
|
- if (e.value == key) {
|
|
|
|
- e.cog = data[key] * 1;
|
|
|
|
|
|
+ if (data2.length == 0) {
|
|
|
|
+ this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
|
|
|
|
+ // this.$emit("updateDocSco", {
|
|
|
|
+ // val: this.toolIndex,
|
|
|
|
+ // val2: this.wIndex,
|
|
|
|
+ // val3: ''
|
|
|
|
+ // });
|
|
|
|
+ } else {
|
|
|
|
+ let data = JSON.parse(data2.rate);
|
|
|
|
+ this.scoTitList.forEach((e, index) => {
|
|
|
|
+ e.cog = 0;
|
|
|
|
+ for (const key in data) {
|
|
|
|
+ if (e.value == key) {
|
|
|
|
+ e.cog = data[key] * 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // console.log("this.scoTitList", this.scoTitList);
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ // console.log('this.scoTitList',this.scoTitList);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(err => {
|
|
.catch(err => {
|
|
@@ -124,40 +144,10 @@ export default {
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
reset() {
|
|
reset() {
|
|
- console.log("this.scoTitList", this.scoTitList);
|
|
|
|
|
|
+ // console.log("this.scoTitList", this.scoTitList);
|
|
this.scoTitList.forEach(e => {
|
|
this.scoTitList.forEach(e => {
|
|
e.cog = 0;
|
|
e.cog = 0;
|
|
});
|
|
});
|
|
- // let data = this.scoTitList.map(e => {
|
|
|
|
- // return e.value + ":" + e.cog;
|
|
|
|
- // });
|
|
|
|
- // // console.log("data", data);
|
|
|
|
- // const processedData = {};
|
|
|
|
-
|
|
|
|
- // data.forEach(item => {
|
|
|
|
- // const [key, value] = item.split(":");
|
|
|
|
- // processedData[key] = 0;
|
|
|
|
- // });
|
|
|
|
- // processedData.content = "";
|
|
|
|
- // this.scoTitList = processedData
|
|
|
|
- // // return console.log(processedData);
|
|
|
|
- // let params = {
|
|
|
|
- // cid: this.id,
|
|
|
|
- // s: this.stage,
|
|
|
|
- // t: this.task,
|
|
|
|
- // rate: JSON.stringify(processedData),
|
|
|
|
- // uid: this.stUid
|
|
|
|
- // };
|
|
|
|
- // // return console.log(params);
|
|
|
|
- // this.ajax
|
|
|
|
- // .get(this.$store.state.api + "updateWorksEva", params)
|
|
|
|
- // .then(res => {
|
|
|
|
- // this.getData();
|
|
|
|
- // })
|
|
|
|
- // .catch(err => {
|
|
|
|
- // this.$message.error("重置失败");
|
|
|
|
- // console.error(err);
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
// 老师提交评分
|
|
// 老师提交评分
|
|
submit() {
|
|
submit() {
|
|
@@ -239,7 +229,7 @@ export default {
|
|
},
|
|
},
|
|
// ai打分
|
|
// ai打分
|
|
aiGet2(messages, callback) {
|
|
aiGet2(messages, callback) {
|
|
- console.log(this.toolIndex,this.wIndex);
|
|
|
|
|
|
+ console.log(this.toolIndex, this.wIndex);
|
|
let _this = this;
|
|
let _this = this;
|
|
// let parm = {
|
|
// let parm = {
|
|
// assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
|
|
// assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
|
|
@@ -331,8 +321,8 @@ export default {
|
|
});
|
|
});
|
|
|
|
|
|
for (const key in processedData) {
|
|
for (const key in processedData) {
|
|
- if (!Number.isFinite(processedData[key]*1)) {
|
|
|
|
- processedData[key] = 0
|
|
|
|
|
|
+ if (!Number.isFinite(processedData[key] * 1)) {
|
|
|
|
+ processedData[key] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -473,16 +463,13 @@ export default {
|
|
});
|
|
});
|
|
|
|
|
|
for (const key in processedData) {
|
|
for (const key in processedData) {
|
|
- if (!Number.isFinite(processedData[key]*1)) {
|
|
|
|
- processedData[key] = 0
|
|
|
|
|
|
+ if (!Number.isFinite(processedData[key] * 1)) {
|
|
|
|
+ processedData[key] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
processedData.content = "";
|
|
processedData.content = "";
|
|
|
|
|
|
-
|
|
|
|
let params = {
|
|
let params = {
|
|
cid: _this.id,
|
|
cid: _this.id,
|
|
s: stage,
|
|
s: stage,
|