|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="pb_content" style="background: #f0f2f5" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
|
|
<div class="pb_content" style="background: #f0f2f5" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
|
|
- <div class="c_pub_button_confirm stopBtn" v-if="loading && isOutlineCancelToken" @click="cancelOutline">停止</div>
|
|
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="loading && isOutlineCancelToken" @click="cancelAjax('outline')">停止</div>
|
|
<div class="pb_content_body" style="position: relative; margin: 0">
|
|
<div class="pb_content_body" style="position: relative; margin: 0">
|
|
<div class="right" :style="{width:istemplate == 1 ? 'calc(100% - 300px)' : '100%'}">
|
|
<div class="right" :style="{width:istemplate == 1 ? 'calc(100% - 300px)' : '100%'}">
|
|
<div class="courseTop">
|
|
<div class="courseTop">
|
|
@@ -751,7 +751,8 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div v-loading="fileSLoading" element-loading-text="小可正在努力生成中,请稍等...">
|
|
|
|
|
|
+ <div v-loading="fileSLoading" element-loading-text="小可正在努力生成中,请稍等..." :style="{ minHeight: fileSLoading ? '200px' : 'auto'}">
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="fileSLoading && isFileCancelToken" @click="cancelAjax('file')">停止</div>
|
|
<div class="add_chapters_box add_c_none" v-if="
|
|
<div class="add_chapters_box add_c_none" v-if="
|
|
infoData2 &&
|
|
infoData2 &&
|
|
infoData2.length == 0
|
|
infoData2.length == 0
|
|
@@ -883,8 +884,9 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="textLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!isuseT && (!yiKeTemplateArray.includes(templateid))) || (isuseT && (!yiKeTemplateArray.includes(templateid)) && courseTextBool) || (yiKeTemplateArray.includes(templateid))">
|
|
|
|
- <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
|
|
|
|
+ <div class="whiteBg" :style="{ minHeight: textLoading ? '250px' : 'auto'}" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="textLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!isuseT && (!yiKeTemplateArray.includes(templateid))) || (isuseT && (!yiKeTemplateArray.includes(templateid)) && courseTextBool) || (yiKeTemplateArray.includes(templateid))">
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="textLoading && isTextCancelToken" @click="cancelAjax('text')">停止</div>
|
|
|
|
+ <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
<div class="c_info_title" style="margin: 0 20px 0 20px;">
|
|
<div class="c_info_title" style="margin: 0 20px 0 20px;">
|
|
课程简要描述
|
|
课程简要描述
|
|
<el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
|
|
<el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
|
|
@@ -915,8 +917,9 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="targetTextLoading2" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!isuseT && (!yiKeTemplateArray.includes(templateid))) || (isuseT && (!yiKeTemplateArray.includes(templateid)) && courseTextBool)">
|
|
|
|
- <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
|
|
|
|
+ <div class="whiteBg" :style="{ minHeight: targetTextLoading2 ? '250px' : 'auto'}" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="targetTextLoading2" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!isuseT && (!yiKeTemplateArray.includes(templateid))) || (isuseT && (!yiKeTemplateArray.includes(templateid)) && courseTextBool)">
|
|
|
|
+ <div class="c_pub_button_confirm stopBtn" v-if="targetTextLoading2 && isTargetCancelToken2" @click="cancelAjax('target2')">停止</div>
|
|
|
|
+ <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
<div class="c_info_title" style="flex-wrap: wrap; position:relative;margin:0 20px;">
|
|
<div class="c_info_title" style="flex-wrap: wrap; position:relative;margin:0 20px;">
|
|
课程目标
|
|
课程目标
|
|
<button class="c_pub_button_confirm2" @click="addImg($event)" style="margin: 0px 0px 0px 10px;">
|
|
<button class="c_pub_button_confirm2" @click="addImg($event)" style="margin: 0px 0px 0px 10px;">
|
|
@@ -7313,6 +7316,10 @@ export default {
|
|
pingjiainfoprogress: [],
|
|
pingjiainfoprogress: [],
|
|
isOutlineCancelToken: null,
|
|
isOutlineCancelToken: null,
|
|
taskGLoading: [],
|
|
taskGLoading: [],
|
|
|
|
+ isFileCancelToken: null,
|
|
|
|
+ isTargetCancelToken1: null,
|
|
|
|
+ isTargetCancelToken2: null,
|
|
|
|
+ isTextCancelToken: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
directives: {
|
|
directives: {
|
|
@@ -16797,7 +16804,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTextCancelToken = _this.ajax.setCancelSource();
|
|
|
|
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
// let params = JSON.stringify({
|
|
// let params = JSON.stringify({
|
|
@@ -16840,7 +16847,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
// 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.isTextCancelToken).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
|
|
@@ -16851,10 +16858,11 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTextCancelToken = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.textLoading = false
|
|
_this.textLoading = false
|
|
_this.ttextLoading = false
|
|
_this.ttextLoading = false
|
|
|
|
+ _this.isTextCancelToken = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aiGetgetAiContent(_uuid)
|
|
await _this.aiGetgetAiContent(_uuid)
|
|
@@ -17185,21 +17193,41 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
_this.$forceUpdate();
|
|
_this.$forceUpdate();
|
|
}
|
|
}
|
|
callback ? callback() : ''
|
|
callback ? callback() : ''
|
|
- this.isOutlineCancelToken = null
|
|
|
|
|
|
+ _this.isOutlineCancelToken = null
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
_this.loading = false
|
|
_this.loading = false
|
|
- this.isOutlineCancelToken = null
|
|
|
|
|
|
+ _this.isOutlineCancelToken = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- cancelOutline(){
|
|
|
|
- if (this.isOutlineCancelToken) {
|
|
|
|
|
|
+ cancelAjax(type){
|
|
|
|
+ if (this.isOutlineCancelToken && type == 'outline') {
|
|
this.$message.success("已经成功停止生成课程大纲")
|
|
this.$message.success("已经成功停止生成课程大纲")
|
|
this.isOutlineCancelToken.cancel('Request canceled by the user.');
|
|
this.isOutlineCancelToken.cancel('Request canceled by the user.');
|
|
this.isOutlineCancelToken = null;
|
|
this.isOutlineCancelToken = null;
|
|
this.loading = false
|
|
this.loading = false
|
|
}
|
|
}
|
|
|
|
+ if (this.isFileCancelToken && type == 'file') {
|
|
|
|
+ this.$message.success("已经成功停止智能生成检索资料")
|
|
|
|
+ this.isFileCancelToken.cancel('Request canceled by the user.');
|
|
|
|
+ this.isFileCancelToken = null;
|
|
|
|
+ this.fileSLoading = false
|
|
|
|
+ }
|
|
|
|
+ if(this.isTextCancelToken && type == 'text'){
|
|
|
|
+ this.$message.success("已经成功停止AI优化")
|
|
|
|
+ this.isTextCancelToken.cancel('Request canceled by the user.');
|
|
|
|
+ this.isTextCancelToken = null;
|
|
|
|
+ this.textLoading = false
|
|
|
|
+ this.ttextLoading = true
|
|
|
|
+ }
|
|
|
|
+ if(this.isTargetCancelToken2 && type == 'target2'){
|
|
|
|
+ this.$message.success("已经成功停止生成目标")
|
|
|
|
+ this.isTargetCancelToken2.cancel('Request canceled by the user.');
|
|
|
|
+ this.isTargetCancelToken2 = null;
|
|
|
|
+ this.targetTextLoading2 = false
|
|
|
|
+ this.ttargetTextLoading2 = false
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async aiGetTask2(messages, callback) {
|
|
async aiGetTask2(messages, callback) {
|
|
let _this = this
|
|
let _this = this
|
|
@@ -17470,9 +17498,11 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
}, 0)
|
|
}, 0)
|
|
}
|
|
}
|
|
callback ? callback() : ''
|
|
callback ? callback() : ''
|
|
|
|
+ _this.isOutlineCancelToken = null
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
_this.loading = false
|
|
_this.loading = false
|
|
|
|
+ _this.isOutlineCancelToken = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -21113,6 +21143,8 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// uid: _uuid,
|
|
// uid: _uuid,
|
|
// mind_map_question: "",
|
|
// mind_map_question: "",
|
|
// })
|
|
// })
|
|
|
|
+ _this.isTargetCancelToken2 = _this.ajax.setCancelSource();
|
|
|
|
+
|
|
let params = {
|
|
let params = {
|
|
assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
|
|
assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
|
|
message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
@@ -21138,7 +21170,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// 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.isTargetCancelToken2).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
|
|
@@ -21149,10 +21181,11 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTargetCancelToken2 = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.targetTextLoading2 = false
|
|
_this.targetTextLoading2 = false
|
|
_this.ttargetTextLoading2 = false
|
|
_this.ttargetTextLoading2 = false
|
|
|
|
+ _this.isTargetCancelToken2 = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aitargetTextDetail2getAiContent(_uuid)
|
|
await _this.aitargetTextDetail2getAiContent(_uuid)
|
|
@@ -21270,6 +21303,8 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// uid: _uuid,
|
|
// uid: _uuid,
|
|
// mind_map_question: "",
|
|
// mind_map_question: "",
|
|
// })
|
|
// })
|
|
|
|
+ _this.isTargetCancelToken2 = _this.ajax.setCancelSource();
|
|
|
|
+
|
|
let params = {
|
|
let params = {
|
|
assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
|
|
assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
|
|
message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
|
|
@@ -21295,7 +21330,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// 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.isTargetCancelToken2).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
|
|
@@ -21306,10 +21341,11 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
} else {
|
|
} else {
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
_this.$message.warning(response.data.FunctionResponse.result);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTargetCancelToken2 = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.targetTextLoading2 = false
|
|
_this.targetTextLoading2 = false
|
|
_this.ttargetTextLoading2 = false
|
|
_this.ttargetTextLoading2 = false
|
|
|
|
+ _this.isTargetCancelToken2 = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
await _this.aitargetTextDetail2getAiContent(_uuid)
|
|
await _this.aitargetTextDetail2getAiContent(_uuid)
|
|
@@ -21409,6 +21445,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
let _fileid = _this.importFileid(sub)
|
|
let _fileid = _this.importFileid(sub)
|
|
fileid = [...fileid, ..._fileid]
|
|
fileid = [...fileid, ..._fileid]
|
|
}
|
|
}
|
|
|
|
+ _this.isTargetCancelToken2 = _this.ajax.setCancelSource();
|
|
|
|
|
|
let messages = `${msg}`
|
|
let messages = `${msg}`
|
|
let _uuid = uuidv4();
|
|
let _uuid = uuidv4();
|
|
@@ -21452,7 +21489,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
// 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', params).then(function (response) {
|
|
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat', params, _this.isTargetCancelToken2).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
|
|
@@ -21471,10 +21508,11 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
_this.aitargetTextDetail22(_this.aiJson.aiTarget2, data.message.replaceAll('#', " ").replaceAll('*', "").replaceAll('\n', ""))
|
|
_this.aitargetTextDetail22(_this.aiJson.aiTarget2, data.message.replaceAll('#', " ").replaceAll('*', "").replaceAll('\n', ""))
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ _this.isTargetCancelToken2 = null
|
|
}).catch(function (error) {
|
|
}).catch(function (error) {
|
|
_this.targetTextLoading2 = false
|
|
_this.targetTextLoading2 = false
|
|
_this.ttargetTextLoading2 = false
|
|
_this.ttargetTextLoading2 = false
|
|
|
|
+ _this.isTargetCancelToken2 = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -21750,6 +21788,7 @@ ${msg}
|
|
// _this.loading = false
|
|
// _this.loading = false
|
|
// console.log(error);
|
|
// console.log(error);
|
|
// });
|
|
// });
|
|
|
|
+ this.isFileCancelToken = this.ajax.setCancelSource();
|
|
|
|
|
|
let parm = {
|
|
let parm = {
|
|
assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
|
|
assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
|
|
@@ -21761,7 +21800,7 @@ ${msg}
|
|
temperature: 0.1,
|
|
temperature: 0.1,
|
|
}
|
|
}
|
|
this.ajax
|
|
this.ajax
|
|
- .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
|
|
|
|
|
|
+ .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm, this.isFileCancelToken)
|
|
.then((response) => {
|
|
.then((response) => {
|
|
console.log(response);
|
|
console.log(response);
|
|
let data = response.data.FunctionResponse
|
|
let data = response.data.FunctionResponse
|
|
@@ -21769,7 +21808,8 @@ ${msg}
|
|
console.log(data.message);
|
|
console.log(data.message);
|
|
let dArray = []
|
|
let dArray = []
|
|
try {
|
|
try {
|
|
- dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
|
|
|
|
|
|
+ let regex2 = new RegExp("/([{,])(\w+):/g")
|
|
|
|
+ dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```','').replaceAll('\'',"\"").replace(regex2, '$1"$2":'))
|
|
} catch (error) {
|
|
} catch (error) {
|
|
// callback ? callback() : ''
|
|
// callback ? callback() : ''
|
|
console.log("error_________________" + error);
|
|
console.log("error_________________" + error);
|
|
@@ -21796,11 +21836,13 @@ ${msg}
|
|
}
|
|
}
|
|
}, 500 * i)
|
|
}, 500 * i)
|
|
}
|
|
}
|
|
|
|
+ _this.isFileCancelToken = null
|
|
_this.$forceUpdate();
|
|
_this.$forceUpdate();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
callback ? callback() : ''
|
|
callback ? callback() : ''
|
|
|
|
+ _this.isFileCancelToken = null
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|