|
@@ -3138,8 +3138,8 @@
|
|
|
<!-- <button class="c_pub_button_add pub_btn_add_img" @click="createTeacherAn(itemTaskIndex)">
|
|
|
AI生成教案
|
|
|
</button> -->
|
|
|
- <button class="c_pub_button_add pub_btn_add_img" @click="createTaskAn(itemTaskIndex)" v-loading="taskAnLoading[itemTaskIndex] && taskAnLoading[itemTaskIndex] == true">
|
|
|
- AI生成学历案
|
|
|
+ <button class="c_pub_button_add pub_btn_add_img" @click="createTaskAn(itemTaskIndex)">
|
|
|
+ {{ taskAnLoading[itemTaskIndex] && taskAnLoading[itemTaskIndex] == true ? '停止生成' : 'AI生成学历案'}}
|
|
|
</button>
|
|
|
<button class="c_pub_button_add pub_btn_add_img" @click="openAiCreateVideo(itemTaskIndex)">
|
|
|
智能检索视频
|
|
@@ -4889,7 +4889,7 @@
|
|
|
<div class="lineTitle clineTitle" style="width: auto">任务评价体系</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <MindTask :showBar="false" :mindData="itemTask" style="width: 100%" :jsmindId="unitIndex + '-' + itemTaskIndex + 'mindTask' "></MindTask>
|
|
|
+ <MindTask :showBar="false" :mindData="itemTask" style="width: 100%" :jsmindId="unitIndex + '-' + itemTaskIndex + 'mindTask' " :ref="unitIndex + '-' + itemTaskIndex + 'mindTask'"></MindTask>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -7418,6 +7418,7 @@ export default {
|
|
|
pjTemplateArray: [ 'cf5722a4-401b-11ef-b873-005056b86cp5', '68629cfb-e719-48e9-a03d-56f189fb9cb0' ],
|
|
|
pjIndex: [52, 48, 1, 3, 16, 45, 47, 41],
|
|
|
taskAnLoading: [],
|
|
|
+ taskAnCancelToken: [],
|
|
|
dialogTemplateArray: [ 'cf5722a4-401b-11ef-b873-005056b86cd2', '68629cfb-e719-48e9-a03d-56f189fb9cb0' ],
|
|
|
taskCancelToken1: [],
|
|
|
taskCancelToken2: [],
|
|
@@ -9036,7 +9037,8 @@ export default {
|
|
|
async createTaskAn(index){
|
|
|
// this.lineCount = index;
|
|
|
if(this.taskAnLoading[index]){
|
|
|
- this.$message.error('请等待当前学历案生成完成')
|
|
|
+ // this.$message.error('请等待当前学历案生成完成')
|
|
|
+ this.cancelAjax('taskAn', index)
|
|
|
return
|
|
|
}
|
|
|
this.taskAnLoading[index] = true
|
|
@@ -9054,6 +9056,8 @@ Language: ${this.getLang()}
|
|
|
## 任务教案
|
|
|
${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}`
|
|
|
|
|
|
+ _this.taskAnCancelToken[index] = _this.ajax.setCancelSource();
|
|
|
+
|
|
|
let parm = {
|
|
|
assistant_id: 'b19f1a1a-7586-11ef-8ce0-12e77c4cb76b',
|
|
|
message: [{"type":"text", "text":this.languageSetting == 1 ? converter2(messages.replaceAll('\n', " ").replaceAll('*', "")) : messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
@@ -9064,7 +9068,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
temperature: this.mode == 3 ? 0.5 : 0.1,
|
|
|
}
|
|
|
this.ajax
|
|
|
- .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
|
|
|
+ .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm, _this.taskAnCancelToken[index])
|
|
|
.then(async (response) => {
|
|
|
console.log(response);
|
|
|
let data = response.data.FunctionResponse
|
|
@@ -9075,14 +9079,17 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
let _html = md.render(data.message)
|
|
|
await _this.generate(name, _html, index, ()=>{
|
|
|
_this.taskAnLoading[index] = false
|
|
|
+ _this.taskAnCancelToken[index] = null
|
|
|
})
|
|
|
}else{
|
|
|
_this.taskAnLoading[index] = false
|
|
|
+ _this.taskAnCancelToken[index] = null
|
|
|
}
|
|
|
|
|
|
}).catch((error) => {
|
|
|
console.log(error);
|
|
|
_this.taskAnLoading[index] = false
|
|
|
+ _this.taskAnCancelToken[index] = null
|
|
|
});
|
|
|
},
|
|
|
async generate(a, html, index, callback) {
|
|
@@ -16419,7 +16426,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
let _task = this.unitJson[0].chapterInfo[0].taskJson[i]
|
|
|
let name = _task.task+'-教案'
|
|
|
let _html = _task.taskDetail3 ? md.render(_task.taskDetail3) : ''
|
|
|
- if(!this.cid){
|
|
|
+ if(!this.cid || !this.unitJson[0].chapterInfo[0].taskJson[i].chapterData.length){
|
|
|
await this.generate(name, _html, i)
|
|
|
}
|
|
|
let file = await this.generateExport(name, _html, i)
|
|
@@ -16437,7 +16444,8 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
if(!this.cid){
|
|
|
this.addWork(3)
|
|
|
}else{
|
|
|
- this.steps = 4;
|
|
|
+ this.updateWork();
|
|
|
+ this.steps = 4;
|
|
|
}
|
|
|
}, 2000);
|
|
|
});
|
|
@@ -18209,6 +18217,7 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
}
|
|
|
this.$forceUpdate()
|
|
|
}
|
|
|
+
|
|
|
if(type == 'aiTaskGL2'){
|
|
|
this.$message.success("已经成功停止生成任务概述")
|
|
|
if(this.taskCancelToken2 && this.taskCancelToken2[index]){
|
|
@@ -18220,6 +18229,18 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
}
|
|
|
this.$forceUpdate()
|
|
|
}
|
|
|
+
|
|
|
+ if(type == 'taskAn'){
|
|
|
+ this.$message.success("已经成功停止生成任务概述")
|
|
|
+ if(this.taskAnCancelToken && this.taskAnCancelToken[index]){
|
|
|
+ this.taskAnCancelToken[index].cancel('Request canceled by the user.');
|
|
|
+ this.taskAnCancelToken[index] = null;
|
|
|
+ }
|
|
|
+ if(this.taskAnLoading[index]){
|
|
|
+ this.taskAnLoading[index] = false
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
},
|
|
|
async aiGetTask2(messages, callback) {
|
|
|
let _this = this
|
|
@@ -18743,10 +18764,41 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
_this.$forceUpdate();
|
|
|
|
|
|
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // for (var i = 0; i < _this.unitJson[0].chapterInfo[0].taskJson.length; i++) {
|
|
|
+ // this.aiDetail52(_this.aiJson['teacherDetail2'], i)
|
|
|
+ // }
|
|
|
+ // }, 0)
|
|
|
setTimeout(()=>{
|
|
|
for (var i = 0; i < _this.unitJson[0].chapterInfo[0].taskJson.length; i++) {
|
|
|
- this.aiDetail52(_this.aiJson['teacherDetail2'], i)
|
|
|
+ const _tindex = 'task-' + i;
|
|
|
+ if(_this.taskDetailLoading5.indexOf(_tindex) === -1){
|
|
|
+ _this.taskDetailLoading5.push(_tindex)
|
|
|
+ }
|
|
|
+ if(_this.ttaskDetailLoading5.indexOf(_tindex) === -1){
|
|
|
+ _this.ttaskDetailLoading5.push(_tindex)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let ij = 0;
|
|
|
+
|
|
|
+ function processNext() {
|
|
|
+ if (ij < _this.unitJson[0].chapterInfo[0].taskJson.length) {
|
|
|
+ const _tindex = 'task-' + ij;
|
|
|
+ if(_this.taskDetailLoading5.indexOf(_tindex) === -1){
|
|
|
+ ij++;
|
|
|
+ processNext();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 处理当前任务
|
|
|
+ _this.aiDetail52(_this.aiJson['teacherDetail2'], ij, function () {
|
|
|
+ // 回调函数,当前任务完成后执行
|
|
|
+ ij++;
|
|
|
+ processNext(); // 处理下一个任务
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ processNext(); // 启动处理
|
|
|
}, 0)
|
|
|
}
|
|
|
callback ? callback() : ''
|
|
@@ -19532,8 +19584,8 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
_this.$nextTick(()=>{
|
|
|
setTimeout(() => {
|
|
|
for (var j = 0; j < _task.toolChoose.length; j++) {
|
|
|
- if(_this.pjTemplateArray.indexOf(_this.templateid) !=-1 && toolsJson[_task.toolChoose[j].tool] && _this.pjIndex.indexOf(toolsJson[_task.toolChoose[j].tool].tool) != -1){
|
|
|
- _this.$refs['evalist'+index+j][0].openAiDialog();
|
|
|
+ if(_this.pjTemplateArray.indexOf(_this.templateid) !=-1 && _this.pjIndex.indexOf(_this.unitJson[0].chapterInfo[0].taskJson[index].toolChoose[j].tool[0]) != -1){
|
|
|
+ _this.$refs['evalist'+index+j][0].openAiDialog('elist');
|
|
|
}
|
|
|
}
|
|
|
}, 2000);
|
|
@@ -23531,6 +23583,9 @@ ${msg}
|
|
|
setEvaList(task, tool, elist){
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[task].toolChoose[tool].eList = elist
|
|
|
this.$forceUpdate()
|
|
|
+ if(this.$refs[this.unitIndex + '-' + task + 'mindTask'] && this.$refs[this.unitIndex + '-' + task + 'mindTask'][0]){
|
|
|
+ this.$refs[this.unitIndex + '-' + task + 'mindTask'][0].refresh()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|