|
@@ -1643,7 +1643,8 @@
|
|
<input type="text" placeholder="输入任务名称" class="binfo_input" style="border-radius: 4px"
|
|
<input type="text" placeholder="输入任务名称" class="binfo_input" style="border-radius: 4px"
|
|
v-model="item.task" />
|
|
v-model="item.task" />
|
|
</div>
|
|
</div>
|
|
- <div class="outline_detail" v-loading="taskDetailLoading5.indexOf('task-' + index) !== -1" element-loading-text="小可正在努力生成中,请稍等...">
|
|
|
|
|
|
+ <div class="outline_detail" :style="{ minHeight: taskDetailLoading5.indexOf('task-' + index) !== -1 ? '250px' : 'auto'}" v-loading="taskDetailLoading5.indexOf('task-' + index) !== -1" element-loading-text="小可正在努力生成中,请稍等...">
|
|
|
|
+ <div div class="c_pub_button_confirm stopBtn" v-if="taskDetailLoading5.indexOf('task-' + index) !== -1 && isTeacherTaskCancelToken2[index]" @click="cancelAjax('teacherDetail2', index)">停止</div>
|
|
<textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入教案"
|
|
<textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入教案"
|
|
v-model="item.taskDetail3" v-if="item.isTask3"></textarea>
|
|
v-model="item.taskDetail3" v-if="item.isTask3"></textarea>
|
|
<div class="markBox vditor-reset" style="white-space:pre-wrap;" v-text="item.taskDetail3" v-else-if="ttaskDetailLoading5.indexOf('task-' + index) !== -1"></div>
|
|
<div class="markBox vditor-reset" style="white-space:pre-wrap;" v-text="item.taskDetail3" v-else-if="ttaskDetailLoading5.indexOf('task-' + index) !== -1"></div>
|
|
@@ -7451,6 +7452,8 @@ export default {
|
|
isTeacherTextCancelToken: null,
|
|
isTeacherTextCancelToken: null,
|
|
isTeacherTaskCancelToken: null,
|
|
isTeacherTaskCancelToken: null,
|
|
isOutlineTaskCancelToken: [],
|
|
isOutlineTaskCancelToken: [],
|
|
|
|
+ isTeacherTaskCancelToken2: [],
|
|
|
|
+ isTeacherTaskCancelSource: [],
|
|
isTextCancelSource: null,
|
|
isTextCancelSource: null,
|
|
isOutlineTaskCancelSource: [],
|
|
isOutlineTaskCancelSource: [],
|
|
isTeacherTextCancelSource: null,
|
|
isTeacherTextCancelSource: null,
|
|
@@ -8252,18 +8255,13 @@ export default {
|
|
// if (this.cidType == 1) {
|
|
// if (this.cidType == 1) {
|
|
if (this.steps == 1) {
|
|
if (this.steps == 1) {
|
|
if (this.courseName != "") {
|
|
if (this.courseName != "") {
|
|
- if ((this.ttaskDetailLoading5.join(",").indexOf('task-') !== -1) || (this.ttaskDetailLoading.join(",").indexOf('task-') !== -1) || this.cpotetLoading.cpote1 || this.cpotetLoading.cpote2 || this.cpotetLoading.cpote3 || this.cpotetLoading.cpote4) {
|
|
|
|
|
|
+
|
|
|
|
+ if ((this.ttaskDetailLoading.join(",").indexOf('task-') !== -1) || this.cpotetLoading.cpote1 || this.cpotetLoading.cpote2 || this.cpotetLoading.cpote3 || this.cpotetLoading.cpote4) {
|
|
// this.$message({
|
|
// this.$message({
|
|
// message: "请回答完毕后再次发送",
|
|
// message: "请回答完毕后再次发送",
|
|
// type: "warning"
|
|
// type: "warning"
|
|
// });
|
|
// });
|
|
- if(this.ttaskDetailLoading5.length){
|
|
|
|
- let num = parseInt(this.ttaskDetailLoading5[0].split("task-")[1]) + 1
|
|
|
|
- this.$message({
|
|
|
|
- message: "教案任务"+num+"描述还未生成完,请前往查看,回答完毕后再次操作。",
|
|
|
|
- type: "warning"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
if(this.ttaskDetailLoading.length){
|
|
if(this.ttaskDetailLoading.length){
|
|
let num = parseInt(this.ttaskDetailLoading[0].split("task-")[1]) + 1
|
|
let num = parseInt(this.ttaskDetailLoading[0].split("task-")[1]) + 1
|
|
this.$message({
|
|
this.$message({
|
|
@@ -8363,6 +8361,7 @@ export default {
|
|
if(_pan2 == 2){
|
|
if(_pan2 == 2){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
const functionA = () => {
|
|
const functionA = () => {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -8389,7 +8388,50 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if((this.ttaskDetailLoading5.join(",").indexOf('task-') !== -1)){
|
|
|
|
+ if(this.ttaskDetailLoading5.length){
|
|
|
|
+ // let num = parseInt(this.ttaskDetailLoading5[0].split("task-")[1]) + 1
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: "教案任务"+num+"描述还未生成完,请前往查看,回答完毕后再次操作。",
|
|
|
|
+ // type: "warning"
|
|
|
|
+ // });
|
|
|
|
+ this.$confirm("还有教案描述未生成完毕,是否直接下一步?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ if(this.isTeacherTaskCancelToken2){
|
|
|
|
+ for(var i = 0; i < this.isTeacherTaskCancelToken2.length; i++){
|
|
|
|
+ if(this.isTeacherTaskCancelToken2[i]){
|
|
|
|
+ this.isTeacherTaskCancelToken2[i].cancel('Request canceled by the user.');
|
|
|
|
+ this.isTeacherTaskCancelToken2[i] = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.taskDetailLoading5 = []
|
|
|
|
+ this.ttaskDetailLoading5 = []
|
|
|
|
+ if(this.isTeacherTaskCancelSource){
|
|
|
|
+ for(var i = 0; i < this.isTeacherTaskCancelSource.length; i++){
|
|
|
|
+ if(this.isTeacherTaskCancelSource[i]){
|
|
|
|
+ this.isTeacherTaskCancelSource[i].close()
|
|
|
|
+ this.isTeacherTaskCancelSource[i] = null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (this.cid) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ functionA()
|
|
|
|
+ } else {
|
|
|
|
+ this.openAiDialog(clickType, "aiTask3", 'all', functionA)
|
|
|
|
+ }
|
|
|
|
+ }).catch((v) => {
|
|
|
|
+ console.log(v);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (this.cid) {
|
|
if (this.cid) {
|
|
this.loading = true
|
|
this.loading = true
|
|
functionA()
|
|
functionA()
|
|
@@ -10274,7 +10316,7 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
console.log(data.Location);
|
|
console.log(data.Location);
|
|
- console.log(fileid);
|
|
|
|
|
|
+ console.log(fileName,'----------',fileid);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -16382,23 +16424,56 @@ export default {
|
|
this.aiCallBack = callback
|
|
this.aiCallBack = callback
|
|
this.aiIndex = index
|
|
this.aiIndex = index
|
|
} else if (type == "teacherDetail2") {
|
|
} else if (type == "teacherDetail2") {
|
|
- if (this.ttaskDetailLoading5.indexOf('task-' + index) !== -1) {
|
|
|
|
- this.$message({
|
|
|
|
- message: "请回答完毕后再次发送",
|
|
|
|
- type: "warning"
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
if(!this.unitJson[0].chapterInfo[0].taskJson[index].task){
|
|
if(!this.unitJson[0].chapterInfo[0].taskJson[index].task){
|
|
this.$message.error('请输入任务名称')
|
|
this.$message.error('请输入任务名称')
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- this.aitype = "teacherDetail2"
|
|
|
|
- // this.aiText = `请根据${callback}\n重新设计该教案。其中包括但不仅限于该任务的教学目标,教学过程,师生研讨,拓展,学生任务单,相关知识点的练习或Qui以及答案等。`
|
|
|
|
- this.aiText = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
|
|
|
|
- this.aiCallBack = callback
|
|
|
|
- this.aiIndex = index
|
|
|
|
|
|
+ if (this.ttaskDetailLoading5.indexOf('task-' + index) !== -1) {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: "请回答完毕后再次发送",
|
|
|
|
+ // type: "warning"
|
|
|
|
+ // });
|
|
|
|
+ // return;
|
|
|
|
+ this.$confirm("还未生成完毕,是否直接重新生成?", "提示", {
|
|
|
|
+ confirmButtonText: "确定重新生成",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+
|
|
|
|
+ if(this.isTeacherTaskCancelToken2 && this.isTeacherTaskCancelToken2[index]){
|
|
|
|
+ this.isTeacherTaskCancelToken2[index].cancel('Request canceled by the user.');
|
|
|
|
+ this.isTeacherTaskCancelToken2[index] = null;
|
|
|
|
+ }
|
|
|
|
+ this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf('task-' + index), 1)
|
|
|
|
+ this.ttaskDetailLoading5.splice(this.taskDetailLoading5.indexOf('task-' + index), 1)
|
|
|
|
+ if(this.isTeacherTaskCancelSource[index]){
|
|
|
|
+ this.isTeacherTaskCancelSource[index].close()
|
|
|
|
+ this.isTeacherTaskCancelSource[index] = null
|
|
|
|
+ }
|
|
|
|
+ this.aitype = "teacherDetail2"
|
|
|
|
+ // this.aiText = `请根据${callback}\n重新设计该教案。其中包括但不仅限于该任务的教学目标,教学过程,师生研讨,拓展,学生任务单,相关知识点的练习或Qui以及答案等。`
|
|
|
|
+ this.aiText = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
|
|
|
|
+ this.aiCallBack = callback
|
|
|
|
+ this.aiIndex = index
|
|
|
|
+ this.dialogVisibleAiD = true
|
|
|
|
+ }).catch((v) => {
|
|
|
|
+ console.log(v);
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }else {
|
|
|
|
+ this.aitype = "teacherDetail2"
|
|
|
|
+ // this.aiText = `请根据${callback}\n重新设计该教案。其中包括但不仅限于该任务的教学目标,教学过程,师生研讨,拓展,学生任务单,相关知识点的练习或Qui以及答案等。`
|
|
|
|
+ this.aiText = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
|
|
|
|
+ this.aiCallBack = callback
|
|
|
|
+ this.aiIndex = index
|
|
|
|
+ this.dialogVisibleAiD = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
} else if (type == "aiCpote1") {
|
|
} else if (type == "aiCpote1") {
|
|
if (this.cpotetLoading.cpote1) {
|
|
if (this.cpotetLoading.cpote1) {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -16526,7 +16601,7 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
- if(type != 'aiRateRuleA'){
|
|
|
|
|
|
+ if(type != 'aiRateRuleA' && type != 'teacherDetail2'){
|
|
this.dialogVisibleAiD = true
|
|
this.dialogVisibleAiD = true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -17666,6 +17741,19 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
this.isOutlineTaskCancelSource[index] = null
|
|
this.isOutlineTaskCancelSource[index] = null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(this.isTeacherTaskCancelToken2 && type == 'teacherDetail2'){
|
|
|
|
+ this.$message.success("已经成功停止生成教案")
|
|
|
|
+ this.isTeacherTaskCancelToken2[index].cancel('Request canceled by the user.');
|
|
|
|
+ this.isTeacherTaskCancelToken2[index] = null;
|
|
|
|
+ this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf('task-' + index), 1)
|
|
|
|
+ this.ttaskDetailLoading5.splice(this.taskDetailLoading5.indexOf('task-' + index), 1)
|
|
|
|
+ if(this.isTeacherTaskCancelSource[index]){
|
|
|
|
+ this.isTeacherTaskCancelSource[index].close()
|
|
|
|
+ this.isTeacherTaskCancelSource[index] = null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async aiGetTask2(messages, callback) {
|
|
async aiGetTask2(messages, callback) {
|
|
let _this = this
|
|
let _this = this
|
|
@@ -19818,7 +19906,7 @@ ${msg}
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// });
|
|
// });
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
- _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isOutlineTaskCancelToken[index]).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
console.log(response);
|
|
console.log(response);
|
|
// let data = response.data.FunctionResponse
|
|
// let data = response.data.FunctionResponse
|
|
@@ -20016,7 +20104,7 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// });
|
|
// });
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
- _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isOutlineTaskCancelToken[index]).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
console.log(response);
|
|
console.log(response);
|
|
// let data = response.data.FunctionResponse
|
|
// let data = response.data.FunctionResponse
|
|
@@ -21029,6 +21117,7 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
// - 补充描述:${this.courseText2}
|
|
// - 补充描述:${this.courseText2}
|
|
_this.taskDetailLoading5.push(_tindex)
|
|
_this.taskDetailLoading5.push(_tindex)
|
|
_this.ttaskDetailLoading5.push(_tindex)
|
|
_this.ttaskDetailLoading5.push(_tindex)
|
|
|
|
+ _this.isTeacherTaskCancelToken2[index] = _this.ajax.setCancelSource();
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
// // "model": "Chat",
|
|
// // "model": "Chat",
|
|
@@ -21070,7 +21159,7 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
// });
|
|
// });
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
- _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isTeacherTaskCancelToken2[index]).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
// _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
|
|
console.log(response);
|
|
console.log(response);
|
|
// let data = response.data.FunctionResponse
|
|
// let data = response.data.FunctionResponse
|
|
@@ -21085,10 +21174,12 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
|
|
+ _this.isTeacherTaskCancelToken2[index] = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
- _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(_tindex), 1)
|
|
|
|
- _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(_tindex), 1)
|
|
|
|
if(error && error.message != 'Request canceled by the user.'){
|
|
if(error && error.message != 'Request canceled by the user.'){
|
|
|
|
+ _this.isTeacherTaskCancelToken2[index] = null
|
|
|
|
+ _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(_tindex), 1)
|
|
|
|
+ _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(_tindex), 1)
|
|
_this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
_this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
}
|
|
}
|
|
console.log(error);
|
|
console.log(error);
|
|
@@ -21096,16 +21187,16 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
await _this.aiDetail52getAiContent(_uuid, _tindex, _tindex2)
|
|
await _this.aiDetail52getAiContent(_uuid, _tindex, _tindex2)
|
|
},
|
|
},
|
|
aiDetail52getAiContent(_uid, loading, _tindex2) {
|
|
aiDetail52getAiContent(_uid, loading, _tindex2) {
|
|
- let _source;
|
|
|
|
try {
|
|
try {
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
- _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
|
|
|
+ this.isTeacherTaskCancelSource[_tindex2] = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
} catch(error) {
|
|
} catch(error) {
|
|
console.log('EventSource error:', error);
|
|
console.log('EventSource error:', error);
|
|
this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
|
+ this.isTeacherTaskCancelToken2[_tindex2] = null
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -21113,16 +21204,18 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
let _mdText = "";
|
|
let _mdText = "";
|
|
this.allTextArray[_tindex2] = ""
|
|
this.allTextArray[_tindex2] = ""
|
|
let _iindex = 0
|
|
let _iindex = 0
|
|
- _source.onmessage = async (_e) => {
|
|
|
|
|
|
+ this.isTeacherTaskCancelSource[_tindex2].onmessage = async (_e) => {
|
|
// await _this.aiDetail52getAiContentText(_e, loading, _tindex2, _source)
|
|
// await _this.aiDetail52getAiContentText(_e, loading, _tindex2, _source)
|
|
let _eData = JSON.parse(_e.data).content;
|
|
let _eData = JSON.parse(_e.data).content;
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
//对话已经完成
|
|
//对话已经完成
|
|
_mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
_mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
- _source.close();
|
|
|
|
|
|
+ this.isTeacherTaskCancelSource[_tindex2].close();
|
|
|
|
+ this.isTeacherTaskCancelSource[_tindex2] = null;
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
|
+ this.isTeacherTaskCancelToken2[_tindex2] = null
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
_iindex++
|
|
_iindex++
|
|
@@ -21151,13 +21244,15 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
};
|
|
};
|
|
|
|
|
|
let _this = this
|
|
let _this = this
|
|
- _source.onerror = function(event) {
|
|
|
|
|
|
+ _this.isTeacherTaskCancelSource.onerror = function(event) {
|
|
// 处理错误,可以尝试重新连接
|
|
// 处理错误,可以尝试重新连接
|
|
console.log('EventSource error:', event);
|
|
console.log('EventSource error:', event);
|
|
_this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
_this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
_this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(loading), 1)
|
|
_this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(loading), 1)
|
|
_this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
_this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
- _source.close();
|
|
|
|
|
|
+ _this.isTeacherTaskCancelSource[_tindex2].close();
|
|
|
|
+ _this.isTeacherTaskCancelSource[_tindex2] = null;
|
|
|
|
+ _this.isTeacherTaskCancelToken2[_tindex2] = null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
aiDetail52getAiContentText(_e, loading, _tindex2, _source){
|
|
aiDetail52getAiContentText(_e, loading, _tindex2, _source){
|
|
@@ -27244,4 +27339,5 @@ ol {
|
|
.custom-switch >>> .el-switch__label.is-active {
|
|
.custom-switch >>> .el-switch__label.is-active {
|
|
color: #0061FF;
|
|
color: #0061FF;
|
|
}
|
|
}
|
|
|
|
+
|
|
</style>
|
|
</style>
|