|
@@ -1991,7 +1991,7 @@
|
|
|
<!-- <div class="rb_c_box_btn">
|
|
|
<button class="c_pub_button_add pub_btn_paste_img" @click="pasteTask" v-if="steps == 3">智能粘贴</button>
|
|
|
</div> -->
|
|
|
- <div class="basic_box" ref="unitBox">
|
|
|
+ <div class="basic_box" ref="unitBox" @scroll="taskScroll">
|
|
|
<div v-if="false" style="
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
@@ -5055,14 +5055,15 @@
|
|
|
<!-- <span>核心素养:</span> -->
|
|
|
<input type="input" v-model="itemTask.eList[eIndex].target" placeholder="填写目标" style="width: calc(100% - 280px);"/>
|
|
|
<el-switch
|
|
|
+ @change="forceUpdate"
|
|
|
class="rateSwitch"
|
|
|
style="margin-left: auto;"
|
|
|
v-model="itemTask.eList[eIndex].isai"
|
|
|
active-color="#0061FF"
|
|
|
- active-text="人工评分"
|
|
|
- inactive-text="AI评分"
|
|
|
- active-value="2"
|
|
|
- inactive-value="1">
|
|
|
+ active-text="AI评分"
|
|
|
+ inactive-text=""
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="2">
|
|
|
</el-switch>
|
|
|
</div>
|
|
|
<div class="elist_inptu_text" v-show="false">
|
|
@@ -7347,6 +7348,7 @@ export default {
|
|
|
isTeacherTextCancelSource: null,
|
|
|
isTargetCancelSource1: null,
|
|
|
isTargetCancelSource2: null,
|
|
|
+ fileidArray: []
|
|
|
};
|
|
|
},
|
|
|
directives: {
|
|
@@ -8108,6 +8110,9 @@ export default {
|
|
|
this.$refs.stepBox.scrollTop = 0;
|
|
|
},
|
|
|
nextSteps(clickType, ttype) {
|
|
|
+ if(!this.time()){
|
|
|
+ return
|
|
|
+ }
|
|
|
// if (this.cidType == 1) {
|
|
|
if (this.steps == 1) {
|
|
|
if (this.courseName != "") {
|
|
@@ -8501,7 +8506,7 @@ export default {
|
|
|
return true;
|
|
|
} else {
|
|
|
let time = new Date().getTime();
|
|
|
- if (time - this.now > 3000) {
|
|
|
+ if (time - this.now > 1000) {
|
|
|
this.now = time;
|
|
|
return true;
|
|
|
} else {
|
|
@@ -14520,9 +14525,10 @@ export default {
|
|
|
value: "",
|
|
|
detail: "",
|
|
|
score: 5,
|
|
|
+ isai: "1",
|
|
|
})
|
|
|
: (this.unitJson[index].chapterInfo[0].taskJson[tIndex].eList = [
|
|
|
- { value: "", detail: "", score: 5 },
|
|
|
+ { value: "", detail: "", score: 5,isai: "1", },
|
|
|
]);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
@@ -14605,6 +14611,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
updateEvaJson(array) {
|
|
|
+ array = array.filter((item) => {
|
|
|
+ item.isai = "1"
|
|
|
+ return item;
|
|
|
+ });
|
|
|
this.unitJson[this.evaIndex].chapterInfo[0].taskJson[
|
|
|
this.evatIndex
|
|
|
].eList = array;
|
|
@@ -14834,6 +14844,19 @@ export default {
|
|
|
// }
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
+ taskScroll(){
|
|
|
+ // document.querySelectorAll(".taskBorder")[i].offsetTop - 100
|
|
|
+ const sections = document.querySelectorAll('.taskBorder');
|
|
|
+ const scrollPosition = document.querySelector('.basic_box').scrollTop;
|
|
|
+
|
|
|
+ sections.forEach((section, index) => {
|
|
|
+ const offsetTop = section.offsetTop;
|
|
|
+ const offsetHeight = section.offsetHeight;
|
|
|
+ if (scrollPosition >= (offsetTop -100) && scrollPosition < (offsetTop -100) + offsetHeight) {
|
|
|
+ this.isClickColor = index +1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
taskOpen(i, stageIndex) {
|
|
|
if (this.unitJson[stageIndex].chapterInfo[0].taskJson[i].toolOpen) {
|
|
|
this.unitJson[stageIndex].chapterInfo[0].taskJson[i].toolOpen = false;
|
|
@@ -16900,14 +16923,26 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
|
_this.textLoading = false
|
|
|
_this.ttextLoading = false
|
|
|
_this.isTextCancelToken = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiGetgetAiContent(_uuid)
|
|
|
},
|
|
|
aiGetgetAiContent(_uid) {
|
|
|
- // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
- this.isTextCancelSource = 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/
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isTextCancelSource = 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/
|
|
|
+ } catch(error){
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.textLoading = false
|
|
|
+ this.ttextLoading = false
|
|
|
+ this.isTextCancelToken = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -16915,7 +16950,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
this.isTextCancelSource.close();
|
|
|
this.isTextCancelSource = null;
|
|
|
this.courseText = _mdText;
|
|
@@ -16952,7 +16987,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
|
this.isTextCancelSource.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.textLoading = false
|
|
|
_this.ttextLoading = false
|
|
|
_this.isTextCancelToken = null
|
|
@@ -18078,6 +18113,10 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
|
for (var i = 0; i < tArray.length; i++) {
|
|
|
let _task = tArray[i]
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
|
|
|
+ _task.elist = _task.elist.filter(el=>{
|
|
|
+ el.isai = "1"
|
|
|
+ return el
|
|
|
+ })
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
|
|
|
if (_task.toolChoose.length) {
|
|
@@ -18342,6 +18381,10 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
|
// for (var i = 0; i < tArray.length; i++) {
|
|
|
let _task = tArray
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail = _task.detail
|
|
|
+ _task.elist = _task.elist.filter(el=>{
|
|
|
+ el.isai = 1
|
|
|
+ return el
|
|
|
+ })
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[index].eList = _task.elist
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[index].chapterData = []
|
|
|
if(!_task.toolChoose || (_task.detail && _task.detail.length < 20) || !_task.detail){
|
|
@@ -18681,6 +18724,10 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
|
|
|
_this.aiGet322(messages, index)
|
|
|
return;
|
|
|
}
|
|
|
+ _task.elist = _task.elist.filter(el=>{
|
|
|
+ el.isai = "1"
|
|
|
+ return el
|
|
|
+ })
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[index].eList = _task.elist
|
|
|
// _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
|
|
|
_this.$forceUpdate();
|
|
@@ -19473,14 +19520,27 @@ ${msg}
|
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
|
_this.isOutlineTaskCancelToken[index] = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
|
},
|
|
|
aiDetailgetAiContent(_uid, loading, _tindex2) {
|
|
|
- // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
- this.isOutlineTaskCancelSource[_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/
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isOutlineTaskCancelSource[_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/
|
|
|
+ } catch(error){
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
|
+ this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
|
+ this.isOutlineTaskCancelToken[_tindex2] = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -19488,7 +19548,7 @@ ${msg}
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
this.isOutlineTaskCancelSource[_tindex2].close();
|
|
|
this.isOutlineTaskCancelSource[_tindex2] = null;
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
|
|
@@ -19525,7 +19585,7 @@ ${msg}
|
|
|
this.isOutlineTaskCancelSource[_tindex2].onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
|
_this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
|
_this.isOutlineTaskCancelToken[_tindex2] = null
|
|
@@ -19659,6 +19719,9 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
|
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
|
_this.isOutlineTaskCancelToken[index] = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
@@ -19797,14 +19860,27 @@ ${taskArray.length ? '其他任务大纲内容' + taskArray.join(',') : ''}
|
|
|
_this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
_this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
|
|
|
_this.isOutlineTaskCancelToken[index] = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
|
|
|
},
|
|
|
aiOutlineDetailgetAiContent(_uid, loading, _tindex2) {
|
|
|
- // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
- this.isOutlineTaskCancelSource[_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/
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isOutlineTaskCancelSource[_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/
|
|
|
+ } catch(error) {
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
|
+ this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
|
+ this.isOutlineTaskCancelToken[_tindex2] = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -19812,7 +19888,7 @@ ${taskArray.length ? '其他任务大纲内容' + taskArray.join(',') : ''}
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
this.isOutlineTaskCancelSource[_tindex2].close();
|
|
|
this.isOutlineTaskCancelSource[_tindex2] = null;
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
|
|
@@ -19854,7 +19930,7 @@ ${taskArray.length ? '其他任务大纲内容' + taskArray.join(',') : ''}
|
|
|
this.isOutlineTaskCancelSource[_tindex2].onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
|
|
|
_this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
|
|
|
_this.isOutlineTaskCancelToken[_tindex2] = null
|
|
@@ -19964,14 +20040,27 @@ ${_this.aiCallBack.taskDetail}
|
|
|
}).catch(function (error) {
|
|
|
_this.taskDetailLoading2.splice(_this.taskDetailLoading2.indexOf(_tindex), 1)
|
|
|
_this.ttaskDetailLoading2.splice(_this.ttaskDetailLoading2.indexOf(_tindex), 1)
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiDetail2getAiContent(_uuid, _tindex, _tindex2)
|
|
|
},
|
|
|
aiDetail2getAiContent(_uid, loading, _tindex2) {
|
|
|
- // 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/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;
|
|
|
+ try {
|
|
|
+ // 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/
|
|
|
+ // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ } catch(error) {
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.taskDetailLoading2.splice(this.taskDetailLoading2.indexOf(loading), 1)
|
|
|
+ this.ttaskDetailLoading2.splice(this.ttaskDetailLoading2.indexOf(loading), 1)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -19979,7 +20068,7 @@ ${_this.aiCallBack.taskDetail}
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
_source.close();
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail = _mdText;
|
|
|
this.taskDetailLoading2.splice(this.taskDetailLoading2.indexOf(loading), 1)
|
|
@@ -20013,7 +20102,7 @@ ${_this.aiCallBack.taskDetail}
|
|
|
_source.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.taskDetailLoading2.splice(this.taskDetailLoading2.indexOf(loading), 1)
|
|
|
_this.ttaskDetailLoading2.splice(this.ttaskDetailLoading2.indexOf(loading), 1)
|
|
|
_source.close();
|
|
@@ -20122,14 +20211,27 @@ ${msg} 输出格式和内容要求参考#格式与要求
|
|
|
}).catch(function (error) {
|
|
|
_this.taskDetailLoading3.splice(_this.taskDetailLoading3.indexOf(_tindex), 1)
|
|
|
_this.ttaskDetailLoading3.splice(_this.ttaskDetailLoading3.indexOf(_tindex), 1)
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiDetail3getAiContent(_uuid, _tindex, _tindex2, _tindex3)
|
|
|
},
|
|
|
aiDetail3getAiContent(_uid, loading, _tindex2, _tindex3) {
|
|
|
- // 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/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;
|
|
|
+ try {
|
|
|
+ // 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/
|
|
|
+ // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ } catch(error) {
|
|
|
+ console.log('EventSource error:', event);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.taskDetailLoading3.splice(this.taskDetailLoading3.indexOf(loading), 1)
|
|
|
+ this.ttaskDetailLoading3.splice(this.ttaskDetailLoading3.indexOf(loading), 1)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -20137,7 +20239,7 @@ ${msg} 输出格式和内容要求参考#格式与要求
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
_source.close();
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].toolChoose[_tindex3].toolDetail = _mdText;
|
|
|
this.taskDetailLoading3.splice(this.taskDetailLoading3.indexOf(loading), 1)
|
|
@@ -20172,7 +20274,7 @@ ${msg} 输出格式和内容要求参考#格式与要求
|
|
|
_source.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.taskDetailLoading3.splice(this.taskDetailLoading3.indexOf(loading), 1)
|
|
|
_this.ttaskDetailLoading3.splice(this.ttaskDetailLoading3.indexOf(loading), 1)
|
|
|
_source.close();
|
|
@@ -20322,7 +20424,12 @@ ${msg} 优化核心素养、目标、评价标准,输出格式和内容要求
|
|
|
try {
|
|
|
let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
let match = data.message.match(regex);
|
|
|
- _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].eList = JSON.parse(match[0]);
|
|
|
+ let elist = JSON.parse(match[0])
|
|
|
+ elist = elist.filter(el=>{
|
|
|
+ el.isai = 1
|
|
|
+ return el
|
|
|
+ })
|
|
|
+ _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].eList = elist;
|
|
|
|
|
|
// var message = data.message;
|
|
|
// var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
@@ -20347,6 +20454,9 @@ ${msg} 优化核心素养、目标、评价标准,输出格式和内容要求
|
|
|
_this.taskDetailLoading4.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
}).catch(function (error) {
|
|
|
_this.taskDetailLoading4.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
@@ -20468,14 +20578,27 @@ ${_text2}`
|
|
|
}).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.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiDetail5getAiContent(_uuid, _tindex, _tindex2)
|
|
|
},
|
|
|
aiDetail5getAiContent(_uid, loading, _tindex2) {
|
|
|
- // 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/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;
|
|
|
+ try {
|
|
|
+ // 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/
|
|
|
+ // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ } catch(error){
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
|
+ this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -20483,7 +20606,7 @@ ${_text2}`
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
_source.close();
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
|
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
@@ -20519,11 +20642,11 @@ ${_text2}`
|
|
|
let _this = this
|
|
|
_source.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
- console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
- _this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
|
- _this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
- _source.close();
|
|
|
+ console.log('EventSource error:', event);
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ _this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
|
+ _this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
+ _source.close();
|
|
|
};
|
|
|
},
|
|
|
async aiDetail52(msg, index) {
|
|
@@ -20646,14 +20769,27 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
|
}).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.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiDetail52getAiContent(_uuid, _tindex, _tindex2)
|
|
|
},
|
|
|
aiDetail52getAiContent(_uid, loading, _tindex2) {
|
|
|
- // 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/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;
|
|
|
+ try {
|
|
|
+ // 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/
|
|
|
+ // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ } catch(error) {
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
|
+ this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
this.allTextArray[_tindex2] = ""
|
|
@@ -20663,7 +20799,7 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
_source.close();
|
|
|
this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
|
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
@@ -20699,7 +20835,7 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
|
_source.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
|
_this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
|
_source.close();
|
|
@@ -20710,7 +20846,7 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = this.allTextArray[_tindex2].replace("_", "");
|
|
|
+ this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = this.allTextArray[_tindex2].replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
_source.close();
|
|
|
this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
|
|
|
this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
|
|
@@ -20860,14 +20996,27 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
|
|
|
_this.cpoteLoading[_index] = false
|
|
|
_this.cpotetLoading[_index] = false
|
|
|
callback ? callback() : ''
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiCpotegetAiContent(_uuid, _index, callback)
|
|
|
},
|
|
|
aiCpotegetAiContent(_uid, loading, callback) {
|
|
|
- // 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/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;
|
|
|
+ try {
|
|
|
+ // 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/
|
|
|
+ // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ } catch(error){
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.cpoteLoading[loading] = false
|
|
|
+ this.cpotetLoading[loading] = false
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -20875,7 +21024,7 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
_source.close();
|
|
|
this.cpote[loading] = _mdText;
|
|
|
this.cpoteLoading[loading] = false
|
|
@@ -20911,7 +21060,7 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
|
|
|
_source.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.cpoteLoading[loading] = false
|
|
|
_this.cpotetLoading[loading] = false
|
|
|
_source.close();
|
|
@@ -21040,14 +21189,27 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
_this.teacherTextLoading = false
|
|
|
_this.tteacherTextLoading = false
|
|
|
_this.isTeacherTextCancelToken = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aiteacherTextDetailgetAiContent(_uuid)
|
|
|
},
|
|
|
aiteacherTextDetailgetAiContent(_uid) {
|
|
|
- // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
- this.isTeacherTextCancelSource = 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/
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isTeacherTextCancelSource = 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/
|
|
|
+ } catch(error) {
|
|
|
+ console.log('EventSource error:', event);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.teacherTextLoading = false
|
|
|
+ this.tteacherTextLoading = false
|
|
|
+ this.isTeacherTextCancelToken = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -21055,7 +21217,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
this.isTeacherTextCancelSource.close();
|
|
|
this.isTeacherTextCancelSource = null;
|
|
|
this.teacherCourseText = _mdText;
|
|
@@ -21096,7 +21258,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
this.isTeacherTextCancelSource.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.teacherTextLoading = false
|
|
|
_this.tteacherTextLoading = false
|
|
|
_this.isTeacherTextCancelToken = null
|
|
@@ -21228,14 +21390,27 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
_this.targetTextLoading = false
|
|
|
_this.ttargetTextLoading = false
|
|
|
_this.isTargetCancelToken1 = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aitargetTextDetailgetAiContent(_uuid)
|
|
|
},
|
|
|
aitargetTextDetailgetAiContent(_uid) {
|
|
|
- // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
- this.isTargetCancelSource1 = 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/
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isTargetCancelSource1 = 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/
|
|
|
+ } catch (error) {
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.targetTextLoading = false
|
|
|
+ this.ttargetTextLoading = false
|
|
|
+ this.isTargetCancelToken1 = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -21243,7 +21418,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
this.isTargetCancelSource1.close();
|
|
|
this.isTargetCancelSource1 = null;
|
|
|
this.targetCourseText = _mdText;
|
|
@@ -21284,7 +21459,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
this.isTargetCancelSource1.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.targetTextLoading = false
|
|
|
_this.ttargetTextLoading = false
|
|
|
_this.isTargetCancelToken1 = null
|
|
@@ -21420,55 +21595,53 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
_this.targetTextLoading2 = false
|
|
|
_this.ttargetTextLoading2 = false
|
|
|
_this.isTargetCancelToken2 = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aitargetTextDetail2getAiContent(_uuid)
|
|
|
},
|
|
|
importFileid(sub){
|
|
|
- // file-SNthYVubrHGg4HjFcp3FPkZq 英语
|
|
|
- // file-QOKhi8i84T8eR6DYhb9TaTlG 科学核心素养
|
|
|
- // file-nkAUyRCEMncICGuFBC1WXnM1 科学素养内涵
|
|
|
- // file-aQmfmgrwdrHa9sCTTZkjvK7Z 语文
|
|
|
- // file-G1bRfSFnQaQtzA3c8dLshg0a 数学核心素养
|
|
|
- // file-35koyXrFO2T4FsrQe4qXm0io 数学素养内涵
|
|
|
+ // file-SNthYVubrHGg4HjFcp3FPkZq 英语核心素养(总目标+学段目标)
|
|
|
+ // file-QOKhi8i84T8eR6DYhb9TaTlG 科学核心素养学段目标
|
|
|
+ // file-nkAUyRCEMncICGuFBC1WXnM1 科学核心素养内涵目标
|
|
|
+ // file-aQmfmgrwdrHa9sCTTZkjvK7Z 语文核心素养内涵目标
|
|
|
+ // file-G1bRfSFnQaQtzA3c8dLshg0a 数学学科核心素养学段目标
|
|
|
+ // file-35koyXrFO2T4FsrQe4qXm0io 数学学科核心素养内涵和总目标
|
|
|
let _sub = converter(sub.join(","))
|
|
|
let fileid = []
|
|
|
- if(_sub.indexOf(converter('STEM')) != -1){
|
|
|
- fileid.push('file-SNthYVubrHGg4HjFcp3FPkZq')
|
|
|
- fileid.push('file-QOKhi8i84T8eR6DYhb9TaTlG')
|
|
|
- fileid.push('file-nkAUyRCEMncICGuFBC1WXnM1')
|
|
|
- fileid.push('file-aQmfmgrwdrHa9sCTTZkjvK7Z')
|
|
|
- fileid.push('file-G1bRfSFnQaQtzA3c8dLshg0a')
|
|
|
- fileid.push('file-35koyXrFO2T4FsrQe4qXm0io')
|
|
|
- }
|
|
|
- if(_sub.indexOf(converter('语文')) != -1){
|
|
|
- if(fileid.indexOf('file-aQmfmgrwdrHa9sCTTZkjvK7Z') == -1){
|
|
|
- fileid.push('file-aQmfmgrwdrHa9sCTTZkjvK7Z')
|
|
|
- }
|
|
|
- }
|
|
|
- if(_sub.indexOf(converter('数学')) != -1){
|
|
|
- if(fileid.indexOf('file-G1bRfSFnQaQtzA3c8dLshg0a') == -1){
|
|
|
- fileid.push('file-G1bRfSFnQaQtzA3c8dLshg0a')
|
|
|
- }
|
|
|
- if(fileid.indexOf('file-35koyXrFO2T4FsrQe4qXm0io') == -1){
|
|
|
- fileid.push('file-35koyXrFO2T4FsrQe4qXm0io')
|
|
|
- }
|
|
|
- }
|
|
|
- if(_sub.indexOf(converter('英语')) != -1){
|
|
|
- if(fileid.indexOf('file-SNthYVubrHGg4HjFcp3FPkZq') == -1){
|
|
|
- fileid.push('file-SNthYVubrHGg4HjFcp3FPkZq')
|
|
|
- }
|
|
|
- }
|
|
|
- if(_sub.indexOf(converter('科学')) != -1){
|
|
|
- if(fileid.indexOf('file-QOKhi8i84T8eR6DYhb9TaTlG') == -1){
|
|
|
- fileid.push('file-QOKhi8i84T8eR6DYhb9TaTlG')
|
|
|
- }
|
|
|
- if(fileid.indexOf('file-nkAUyRCEMncICGuFBC1WXnM1') == -1){
|
|
|
- fileid.push('file-nkAUyRCEMncICGuFBC1WXnM1')
|
|
|
+
|
|
|
+ for(var i = 0; i < this.fileidArray.length; i++){
|
|
|
+ if(_sub.indexOf(converter(this.fileidArray[i].name)) != -1){
|
|
|
+ if(fileid.indexOf(this.fileidArray[i].fileid) == -1){
|
|
|
+ fileid.push(this.fileidArray[i].fileid)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return fileid
|
|
|
},
|
|
|
+ selectFileid(){
|
|
|
+ let params = {
|
|
|
+ oid: this.oid,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectFileid", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.fileidArray = res.data[0]
|
|
|
+ if(res.data[1].length){
|
|
|
+ this.fileidArray = res.data[1]
|
|
|
+ }
|
|
|
+ if(res.data[2].length){
|
|
|
+ this.fileidArray = res.data[2]
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
async aitargetTextDetail22(msg,msg2) {
|
|
|
let _this = this
|
|
|
let fileid = []
|
|
@@ -21580,14 +21753,27 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
_this.targetTextLoading2 = false
|
|
|
_this.ttargetTextLoading2 = false
|
|
|
_this.isTargetCancelToken2 = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
await _this.aitargetTextDetail2getAiContent(_uuid)
|
|
|
},
|
|
|
aitargetTextDetail2getAiContent(_uid) {
|
|
|
- // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
- this.isTargetCancelSource2 = 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/
|
|
|
+ try {
|
|
|
+ // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ this.isTargetCancelSource2 = 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/
|
|
|
+ } catch(error) {
|
|
|
+ console.log('EventSource error:', error);
|
|
|
+ this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ this.targetTextLoading2 = false
|
|
|
+ this.ttargetTextLoading2 = false
|
|
|
+ this.isTargetCancelToken2 = null
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
|
let _iindex = 0
|
|
@@ -21595,7 +21781,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
let _eData = JSON.parse(_e.data).content;
|
|
|
if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
//对话已经完成
|
|
|
- _mdText = _mdText.replace("_", "");
|
|
|
+ _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
|
|
|
this.isTargetCancelSource2.close();
|
|
|
this.isTargetCancelSource2 = null;
|
|
|
this.targetCourseText2 = _mdText;
|
|
@@ -21635,7 +21821,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
this.isTargetCancelSource2.onerror = function(event) {
|
|
|
// 处理错误,可以尝试重新连接
|
|
|
console.log('EventSource error:', event);
|
|
|
- _this.$message.error("网络错误")
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
_this.targetTextLoading2 = false
|
|
|
_this.ttargetTextLoading2 = false
|
|
|
_this.isTargetCancelToken2 = null
|
|
@@ -21761,6 +21947,9 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
|
|
|
_this.targetTextLoading2 = false
|
|
|
_this.ttargetTextLoading2 = false
|
|
|
_this.isTargetCancelToken2 = null
|
|
|
+ if(error && error.message != 'Request canceled by the user.'){
|
|
|
+ _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
|
|
|
+ }
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
@@ -22057,7 +22246,9 @@ ${msg}
|
|
|
let dArray = []
|
|
|
try {
|
|
|
let regex2 = new RegExp("/([{,])(\w+):/g")
|
|
|
- dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```','').replaceAll('\'',"\"").replace(regex2, '$1"$2":'))
|
|
|
+ let regex3 = new RegExp('/(?<!")content(?!")/g')
|
|
|
+ //
|
|
|
+ dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```','').replaceAll('\'',"\"").replace(regex2, '$1"$2":').replace(regex3, '"content"'))
|
|
|
} catch (error) {
|
|
|
// callback ? callback() : ''
|
|
|
console.log("error_________________" + error);
|
|
@@ -22069,7 +22260,9 @@ ${msg}
|
|
|
// callback ? callback() : ''
|
|
|
_this.$message.error("返回的数据格式错误,小可正在为您重新获取...")
|
|
|
console.log("error_________________" + error);
|
|
|
+ _this.isFileCancelToken = null;
|
|
|
_this.aiSearchFile(messages, callback)
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
for(let i = 0; i < dArray.length; i++){
|
|
@@ -22138,6 +22331,7 @@ ${msg}
|
|
|
next();
|
|
|
},
|
|
|
created() {
|
|
|
+ this.selectFileid();
|
|
|
this.getStudent();
|
|
|
this.getTeacher();
|
|
|
this.getClass();
|
|
@@ -26498,12 +26692,11 @@ ol {
|
|
|
color: #0061FF;
|
|
|
}
|
|
|
|
|
|
-.rateSwitch >>> .el-switch__label--left{
|
|
|
+.rateSwitch >>> .el-switch__label--right{
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
-
|
|
|
-.rateSwitch >>> .el-switch__label--left::before{
|
|
|
+.rateSwitch >>> .el-switch__label--right::before{
|
|
|
content: "";
|
|
|
width: 14px;
|
|
|
height: 14px;
|
|
@@ -26512,6 +26705,9 @@ ol {
|
|
|
background-size: 100% 100%;
|
|
|
display: block;
|
|
|
margin-right: 7px;
|
|
|
+ background-image: url(../../../assets/icon/new/u_op2.png);
|
|
|
+}
|
|
|
+.rateSwitch >>> .el-switch__label--right.is-active::before{
|
|
|
background-image: url(../../../assets/icon/new/u_op.png);
|
|
|
}
|
|
|
</style>
|