|
@@ -1549,7 +1549,7 @@
|
|
>
|
|
>
|
|
<template #header>
|
|
<template #header>
|
|
<div>
|
|
<div>
|
|
- <span>{{ cueWordCopy.openCeTit }} <span class="proBar" v-if="aiscoLoading">AI生成中{{ LoadingProgress }}%</span></span>
|
|
|
|
|
|
+ <span>{{ cueWordCopy.openCeTit }} <span class="proBar" v-if="aiscoLoading">AI生成中</span></span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -2119,7 +2119,6 @@ export default {
|
|
scoListCopy:[],
|
|
scoListCopy:[],
|
|
quoteV:false,
|
|
quoteV:false,
|
|
openCeVal:false,
|
|
openCeVal:false,
|
|
- LoadingProgress:0,
|
|
|
|
opQvisible:false,
|
|
opQvisible:false,
|
|
opQvisible2:false,
|
|
opQvisible2:false,
|
|
opcInp:'',
|
|
opcInp:'',
|
|
@@ -2208,7 +2207,7 @@ export default {
|
|
// ai评分分数
|
|
// ai评分分数
|
|
userSco(){
|
|
userSco(){
|
|
return function (val) {
|
|
return function (val) {
|
|
- const con = this.scoListCopy.find(u => u.uid === val);
|
|
|
|
|
|
+ const con = this.scoListCopy.find(u => u.id === val);
|
|
// console.log('con',con);
|
|
// console.log('con',con);
|
|
|
|
|
|
return con ? con.sco : '';
|
|
return con ? con.sco : '';
|
|
@@ -2409,68 +2408,58 @@ export default {
|
|
if (!this.cueWord.openCeTit.trim()) return this.$message.error('请输入标题')
|
|
if (!this.cueWord.openCeTit.trim()) return this.$message.error('请输入标题')
|
|
if (!this.cueWord.openCeCon.trim()) return this.$message.error('请输入指令')
|
|
if (!this.cueWord.openCeCon.trim()) return this.$message.error('请输入指令')
|
|
if (this.cueWord.fieldList.length == 0) return this.$message.error('请选择引用字段')
|
|
if (this.cueWord.fieldList.length == 0) return this.$message.error('请选择引用字段')
|
|
- this.aiscoLoading = true
|
|
|
|
|
|
+ this.aiscoLoading = true
|
|
|
|
|
|
let forAllList = [];
|
|
let forAllList = [];
|
|
this.scoList = []
|
|
this.scoList = []
|
|
- for (let index = 0; index < this.tableWorksArray.length; index++) {
|
|
|
|
- let mkAwit = this.loopSco(this.tableWorksArray[index],index)
|
|
|
|
- forAllList.push(mkAwit);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- Promise.all(forAllList)
|
|
|
|
- .then(values => {
|
|
|
|
- console.log("values", values);
|
|
|
|
|
|
+ for (let kin = 0; kin < this.tableWorksArray.length; kin++) {
|
|
|
|
+ let userWork = []
|
|
|
|
+ let _fileid = []
|
|
|
|
|
|
- this.uploadSCo()
|
|
|
|
-
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.LoadingProgress = 0
|
|
|
|
- }, 1000);
|
|
|
|
- })
|
|
|
|
- .catch(reason => {
|
|
|
|
- this.aiscoLoading = false
|
|
|
|
|
|
+ let kpl = this.tableWorksArray[kin].array
|
|
|
|
+ // console.log('kpl',this.tableWorksArray[kin]);
|
|
|
|
+
|
|
|
|
+ for (let index = 0; index < kpl.length; index++) {
|
|
|
|
+ if (kpl[index].type == 3 && this.cueWord.fieldList.includes(kpl[index].json.title)) {
|
|
|
|
+ userWork.push(kpl[index].json.title +':'+ kpl[index].json.answer2)
|
|
|
|
+ }
|
|
|
|
+ if (kpl[index].type == 5 && this.cueWord.fieldList.includes(kpl[index].json.title)) {
|
|
|
|
+ if (kpl[index].json.file && kpl[index].json.file[0].url) {
|
|
|
|
+ _fileid.push(kpl[index].json.file[0].url)
|
|
|
|
+ }
|
|
|
|
+ userWork.push(kpl[index].json.title+':' + _fileid.join('、'))
|
|
|
|
+ }
|
|
|
|
+ if (kpl[index].type == 7 && this.cueWord.fieldList.includes(kpl[index].json.title)) {
|
|
|
|
+ userWork.push(kpl[index].json.title+':'+kpl[index].json.answer2)
|
|
|
|
+ }
|
|
|
|
+ if (kpl[index].type == 1 && this.cueWord.fieldList.includes(kpl[index].json.title)) {
|
|
|
|
+ let kk = []
|
|
|
|
+ kpl[index].json.answer2.forEach((e)=>{
|
|
|
|
+ kk.push(kpl[index].json.array[e].option)
|
|
|
|
+ })
|
|
|
|
+ userWork.push(kpl[index].json.title+':' +kk.join(','))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+let info = [
|
|
|
|
+ this.cueWord.fieldList.includes('序号') ? '序号' + (kin + 1) : '',
|
|
|
|
+ this.cueWord.fieldList.includes('提交人') ? '提交人:' + this.tableWorksArray[kin].name : '',
|
|
|
|
+ this.cueWord.fieldList.includes('学段') ? '学段:' + this.getTType(this.teaType[0].id, this.tableWorksArray[kin].cclassid) : '',
|
|
|
|
+ this.cueWord.fieldList.includes('年级') ? '年级:' + this.getTType(this.teaType[1].id, this.tableWorksArray[kin].cclassid) : '',
|
|
|
|
+ this.cueWord.fieldList.includes('学科') ? '学科:' + this.getTType(this.teaType[2].id, this.tableWorksArray[kin].cclassid) : '',
|
|
|
|
+ this.cueWord.fieldList.includes('职务') ? '职务:' + this.getTType(this.teaType[3].id, this.tableWorksArray[kin].cclassid) : '',
|
|
|
|
+ this.cueWord.fieldList.includes('教龄') ? '教龄:' + this.getTType(this.teaType[4].id, this.tableWorksArray[kin].cclassid) : '',
|
|
|
|
+ this.cueWord.fieldList.includes('提交时间') ? '提交时间:' + this.tableWorksArray[kin].time : '',
|
|
|
|
+ userWork.filter(Boolean).join('\n')
|
|
|
|
+].filter(Boolean).join('\n');
|
|
|
|
+ forAllList.push({id:this.tableWorksArray[kin].id,data:info})
|
|
|
|
+ // console.log('info',info);
|
|
|
|
|
|
- this.$message({
|
|
|
|
- message: "评价失败",
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- console.error("reasonreasonreasonreasonreason", reason);
|
|
|
|
- // 输出“失败原因”
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // ai评分循环
|
|
|
|
- async loopSco(val){
|
|
|
|
- // console.log('6666',val);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- console.log('loopSco',val);
|
|
|
|
|
|
+ // console.log('forAllList',forAllList);
|
|
|
|
|
|
- let userWork =[]
|
|
|
|
- let _fileid = []
|
|
|
|
- for (let index = 0; index < val.array.length; index++) {
|
|
|
|
- if (val.array[index].type == 3 && this.cueWord.fieldList.includes(val.array[index].json.title)) {
|
|
|
|
- userWork += val.array[index].json.title +':'+ val.array[index].json.answer2+','
|
|
|
|
- }
|
|
|
|
- if (val.array[index].type == 5 && this.cueWord.fieldList.includes(val.array[index].json.title)) {
|
|
|
|
- if (val.array[index].json.file && val.array[index].json.file[0].url) {
|
|
|
|
- _fileid.push(val.array[index].json.file[0].url)
|
|
|
|
- }
|
|
|
|
|
|
|
|
- userWork += val.array[index].json.title+':' + _fileid.join('、')+','
|
|
|
|
- }
|
|
|
|
- if (val.array[index].type == 7 && this.cueWord.fieldList.includes(val.array[index].json.title)) {
|
|
|
|
- userWork += val.array[index].json.title+':'+val.array[index].json.answer2+','
|
|
|
|
- }
|
|
|
|
- if (val.array[index].type == 1 && this.cueWord.fieldList.includes(val.array[index].json.title)) {
|
|
|
|
- let kk = []
|
|
|
|
- val.array[index].json.answer2.forEach((e)=>{
|
|
|
|
- kk.push(val.array[index].json.array[e].option)
|
|
|
|
- })
|
|
|
|
- userWork += val.array[index].json.title+':' +kk.join(',')+','
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- // const result = userWork.filter(item => this.cueWord.fieldList.includes(item.tit));
|
|
|
|
|
|
|
|
let messages = `
|
|
let messages = `
|
|
NOTICE
|
|
NOTICE
|
|
@@ -2491,14 +2480,7 @@ Language: ${this.getLang()}
|
|
${this.cueWord.openCeCon}
|
|
${this.cueWord.openCeCon}
|
|
|
|
|
|
## 数据内容
|
|
## 数据内容
|
|
-${this.cueWord.fieldList.includes('提交人') ? '提交人:' + val.name : ''}
|
|
|
|
-${this.cueWord.fieldList.includes('学段') ? '学段:' + this.getTType(this.teaType[0].id, val.cclassid) : ''}
|
|
|
|
-${this.cueWord.fieldList.includes('年级') ? '年级:' + this.getTType(this.teaType[1].id, val.cclassid) : ''}
|
|
|
|
-${this.cueWord.fieldList.includes('学科') ? '学科:' + this.getTType(this.teaType[2].id, val.cclassid) : ''}
|
|
|
|
-${this.cueWord.fieldList.includes('职务') ? '职务:' + this.getTType(this.teaType[3].id, val.cclassid) : ''}
|
|
|
|
-${this.cueWord.fieldList.includes('教龄') ? '教龄:' + this.getTType(this.teaType[4].id, val.cclassid) : ''}
|
|
|
|
-${this.cueWord.fieldList.includes('作业提交时间') ? '作业提交时间:' + val.time : ''}
|
|
|
|
-${userWork}
|
|
|
|
|
|
+${JSON.stringify(forAllList)}
|
|
|
|
|
|
|
|
|
|
## 任务
|
|
## 任务
|
|
@@ -2547,8 +2529,8 @@ ${userWork}
|
|
- 考虑到可能存在的多种数据结构,保持处理方法的通用性。
|
|
- 考虑到可能存在的多种数据结构,保持处理方法的通用性。
|
|
- 针对数据处理过程中的特殊情况提供应对措施。
|
|
- 针对数据处理过程中的特殊情况提供应对措施。
|
|
- 以专业的态度对待数据,确保数据的安全性与完整性。
|
|
- 以专业的态度对待数据,确保数据的安全性与完整性。
|
|
-- 输出格式只输出数字即可,不要输出多余内容,不要有换行符,不要被‘{}’包裹。
|
|
|
|
-- 不输出分析过程,直接输出最后得分。
|
|
|
|
|
|
+- 输出格式[{id:数据id,sco:评分}]。
|
|
|
|
+- 不输出分析过程,直接输出最后计算结果。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2565,10 +2547,9 @@ ${userWork}
|
|
- 如果查询信息不是真实信息,如 xxx 等占位字符,不要采纳或使用。
|
|
- 如果查询信息不是真实信息,如 xxx 等占位字符,不要采纳或使用。
|
|
- 不要给用户提供任何虚假信息!不要给用户提供任何虚假信息!不要给用户提供任何虚假信息`;
|
|
- 不要给用户提供任何虚假信息!不要给用户提供任何虚假信息!不要给用户提供任何虚假信息`;
|
|
|
|
|
|
|
|
+ // console.log('messages',messages);
|
|
|
|
|
|
- // console.log('messages',messages);
|
|
|
|
|
|
|
|
- let _this = this;
|
|
|
|
let params = {
|
|
let params = {
|
|
assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
|
|
assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
|
|
message: [
|
|
message: [
|
|
@@ -2586,22 +2567,20 @@ ${userWork}
|
|
.post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
|
|
.post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
|
|
.then(response => {
|
|
.then(response => {
|
|
let data = response.data.FunctionResponse;
|
|
let data = response.data.FunctionResponse;
|
|
- console.log("data", data);
|
|
|
|
-
|
|
|
|
- this.scoList.push({uid: val.id ,sco: data.message})
|
|
|
|
-
|
|
|
|
- this.LoadingProgress = ((this.scoList.length / this.tableWorksArray.length) * 100).toFixed(0)
|
|
|
|
|
|
+ // console.log("data", data.message);
|
|
|
|
+ // console.log('kkkk',JSON.parse(data.message));
|
|
|
|
+
|
|
|
|
+ this.scoList = JSON.parse(data.message)
|
|
|
|
+ this.aiscoLoading = false
|
|
|
|
|
|
- return resolve(1)
|
|
|
|
|
|
+ this.uploadSCo()
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
this.aiscoLoading = false
|
|
this.aiscoLoading = false
|
|
- this.$message.error(val.name+'评分失败')
|
|
|
|
|
|
+ this.$message.error('评分失败')
|
|
reject(error)
|
|
reject(error)
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
- })
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
// 获取评分
|
|
// 获取评分
|
|
async getAiSco(){
|
|
async getAiSco(){
|
|
@@ -2635,7 +2614,7 @@ ${userWork}
|
|
}
|
|
}
|
|
this.aiscoLoading = false
|
|
this.aiscoLoading = false
|
|
|
|
|
|
- console.log('8888888888',res.data[0]);
|
|
|
|
|
|
+ // console.log('8888888888',res.data[0]);
|
|
resolve(1)
|
|
resolve(1)
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
@@ -2657,11 +2636,11 @@ ${userWork}
|
|
json:JSON.stringify(this.scoList),
|
|
json:JSON.stringify(this.scoList),
|
|
cw: JSON.stringify(this.cueWord)
|
|
cw: JSON.stringify(this.cueWord)
|
|
}]
|
|
}]
|
|
- console.log('params',params);
|
|
|
|
|
|
+ // console.log('params',params);
|
|
this.ajax
|
|
this.ajax
|
|
.post(this.$store.state.api + "addtestAiSco", params)
|
|
.post(this.$store.state.api + "addtestAiSco", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- console.log(res);
|
|
|
|
|
|
+ // console.log(res);
|
|
this.$message({
|
|
this.$message({
|
|
message: "评价成功",
|
|
message: "评价成功",
|
|
type: "success"
|
|
type: "success"
|