lsc преди 1 година
родител
ревизия
fd8d8ec0f0

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.2adc60e088eb7cb9f6c46d1428173545.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.a82b79982b082928b294.js></script><script type=text/javascript src=./static/js/app.d6959ac14deba8189d21.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.306a767a598be37872629376c1d2783e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.a82b79982b082928b294.js></script><script type=text/javascript src=./static/js/app.35ccebfe4da710210b6b.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/app.306a767a598be37872629376c1d2783e.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/app.306a767a598be37872629376c1d2783e.css.map


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.35ccebfe4da710210b6b.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.35ccebfe4da710210b6b.js.map


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 160 - 32
src/components/pages/aiAddCourse/addCourse.vue

@@ -907,7 +907,7 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-if="(!yiKeTemplateArray.includes(templateid))">
+            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-if="(!yiKeTemplateArray.includes(templateid)) && infoData2.length">
               <div style="position: relative;
                             background: #fff;
                             box-sizing: border-box;
@@ -1806,7 +1806,7 @@
                         v-model="item.task" />
                     </div>
                     <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>
+                      <div div class="c_pub_button_confirm stopBtn" v-if="taskDetailLoading5.indexOf('task-' + index) !== -1" @click="cancelAjax('teacherDetail2', index)">停止</div>
                       <textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入教案"
                         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>
@@ -1853,6 +1853,9 @@
               <button class="c_pub_button_confirm" v-else-if="isuseT === true && !isOutline && !courseTextBool && (!yiKeTemplateArray.includes(templateid))" @click="clickGenTT2">
                 {{isuseT === true ? "重新生成概况" : "生成概况"}}
               </button>
+              <button class="c_pub_button_confirm" v-if="isOutline2" @click="exportTeachPlan">
+                  {{ "导出教案" }}
+                </button>
               <!-- ((isuseT || courseTextBool) && (!yiKeTemplateArray.includes(templateid))) &&  -->
               <el-tooltip effect="light" content="右键单击可配置提示词" placement="top"  v-if="steps < 4">
                 <button class="c_pub_button_confirm" @click="nextSteps(2)"
@@ -1872,9 +1875,6 @@
                   : "下一步" }}
                 </button>
               </el-tooltip>
-              <button class="c_pub_button_confirm" v-if="isOutline2" @click="exportTeachPlan">
-                {{ "导出教案" }}
-              </button>
               <!-- <el-tooltip effect="light" content="右键单击可配置提示词" placement="top"  v-if="isOutline2 && cidType == 0">
                 <button class="c_pub_button_confirm" @click="nextSteps(2, 2)" @contextmenu.prevent="nextSteps(1, 2)" :class="{
                       pub_btn_next_img: steps != 3,
@@ -7797,6 +7797,20 @@ export default {
         return count;
       };
     },
+    panTask(){
+      return function () {
+        let count = 0;
+        for(var i = 0; i < this.unitJson.length; i++){
+          let _task = this.unitJson[i].chapterInfo[0].taskJson
+          for(var j = 0; j < _task.length; j++){
+            if(_task[j].taskDetail){
+              count++
+            }
+          }
+        }
+        return count;
+      };
+    },
     dataCheckPan(){
       return function (fileid) {
         for(let i = 0; i < this.infoData.length; i++){
@@ -8610,7 +8624,7 @@ export default {
             }
             return;
           }
-          if (this.cid) {
+          if (this.cid && this.panTask() > 0) {
             this.loading = true
             functionA()
           } else {
@@ -16781,6 +16795,7 @@ export default {
             message: "教案任务"+num+"描述还未生成完,请前往查看,回答完毕后再次操作。",
             type: "warning"
           });
+          return
         }
         this.aitype = "aiTeacher2"
         this.aiText = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
@@ -17475,10 +17490,38 @@ ${(this.templateid != "4480d65a-1e48-11ef-bee5-005056b86db5") ? '## 参考上下
         })
       } else if (this.aitype == "aiTeacher2"){
         this.isOutline2 = true
+        let _this = this
         setTimeout(()=>{
-          for (var i = 0; i < this.unitJson[0].chapterInfo[0].taskJson.length; i++) {
-            this.aiDetail52(msg, i)
+          for (var i = 0; i < _this.unitJson[0].chapterInfo[0].taskJson.length; 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)
+            }
+            // this.aiDetail52(msg, i)
+          }
+          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(msg, ij, function () {
+                // 回调函数,当前任务完成后执行
+                ij++;
+                processNext(); // 处理下一个任务
+              });
+            }
           }
+
+          processNext(); // 启动处理
         }, 0)
       } else if (this.aitype == "aiTeacher3"){
         this.loading = true
@@ -18197,12 +18240,18 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
       }
       
 
-      if(this.isTeacherTaskCancelToken2 && type == 'teacherDetail2'){
+      if(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.isTeacherTaskCancelToken2 && this.isTeacherTaskCancelToken2[index]){
+          this.isTeacherTaskCancelToken2[index].cancel('Request canceled by the user.');
+          this.isTeacherTaskCancelToken2[index] = null;
+        }
+        if(this.taskDetailLoading5.indexOf('task-' + index) != -1){
+          this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf('task-' + index), 1)
+        }
+        if(this.ttaskDetailLoading5.indexOf('task-' + index) != -1){
+          this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf('task-' + index), 1)
+        }
         if(this.isTeacherTaskCancelSource[index]){
           this.isTeacherTaskCancelSource[index].close()
           this.isTeacherTaskCancelSource[index] = null
@@ -21456,8 +21505,14 @@ ${_text2}`
           _this.$message.warning(response.data.FunctionResponse.result);
         }
       }).catch(function (error) {
-        _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(_tindex), 1)
-        _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(_tindex), 1)
+        if(_this.taskDetailLoading5.indexOf(_tindex) != -1){
+          _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(_tindex), 1)
+        }
+        if(_this.ttaskDetailLoading5.indexOf(_tindex) != -1){
+          _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(_tindex), 1)
+        }
+        // _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("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
         }
@@ -21474,8 +21529,14 @@ ${_text2}`
       } 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)
+        if(this.taskDetailLoading5.indexOf(loading) != -1){
+          this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+        }
+        if(this.ttaskDetailLoading5.indexOf(loading) != -1){
+          this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
+        }
+        // this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+        // this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
         return;
       }
       
@@ -21489,8 +21550,12 @@ ${_text2}`
           _mdText = _mdText.replace("_", "").replace(/【[^】]*source[^】]*】/g, '').replaceAll("<br>", "");
           _source.close();
           this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
+          if(this.taskDetailLoading5.indexOf(loading) != -1){
           this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+        }
+        if(this.ttaskDetailLoading5.indexOf(loading) != -1){
           this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
+        }
           return;
         } else {
           _iindex++
@@ -21524,12 +21589,16 @@ ${_text2}`
           // 处理错误,可以尝试重新连接
         console.log('EventSource error:', event);
         _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
-        _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(loading), 1)
-        _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(loading), 1)
+        if(_this.taskDetailLoading5.indexOf(loading) != -1){
+          _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(loading), 1)
+        }
+        if(_this.ttaskDetailLoading5.indexOf(loading) != -1){
+          _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(loading), 1)
+        }
         _source.close();
       };
     },
-    async aiDetail52(msg, index) {
+    async aiDetail52(msg, index, callback) {
       let _this = this
       const _tindex = 'task-' + index
       const _tindex2 = index
@@ -21590,8 +21659,12 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
 // ## 补充参考资料
 // - 补充资料:${url.join(",")}
 // - 补充描述:${this.courseText2}
-      _this.taskDetailLoading5.push(_tindex)
-      _this.ttaskDetailLoading5.push(_tindex)
+      if(_this.taskDetailLoading5.indexOf(_tindex) === -1){
+        _this.taskDetailLoading5.push(_tindex)
+      }
+      if(_this.ttaskDetailLoading5.indexOf(_tindex) === -1){
+        _this.ttaskDetailLoading5.push(_tindex)
+      }
       _this.isTeacherTaskCancelToken2[index] = _this.ajax.setCancelSource();
       let _uuid = uuidv4();
       // let params = JSON.stringify({
@@ -21653,15 +21726,33 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
       }).catch(function (error) {
         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)
+          if(_this.taskDetailLoading5.indexOf(_tindex) != -1){
+            _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(_tindex), 1)
+          }
+          if(_this.ttaskDetailLoading5.indexOf(_tindex) != -1){
+            _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(_tindex), 1)
+          }
+          // _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(_tindex), 1)
+          // _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(_tindex), 1)
           _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
+          _this.$confirm("本任务的教案生成失败是否重新生成,取消则自动生成下一个任务!", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            distinguishCancelAndClose: true,
+            type: "warning"
+          })
+            .then(() => {
+            _this.aiDetail52(msg, index, callback)
+          }).catch((v) => {
+            console.log(v);
+            callback ? callback() : ''
+          })
         }
         console.log(error);
       });
-      await _this.aiDetail52getAiContent(_uuid, _tindex, _tindex2)
+      await _this.aiDetail52getAiContent(_uuid, _tindex, _tindex2, callback, msg)
     },
-    aiDetail52getAiContent(_uid, loading, _tindex2) {
+    aiDetail52getAiContent(_uid, loading, _tindex2, callback, msg) {
       try {
         // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_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/
@@ -21669,9 +21760,25 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
       } 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)
+        if(this.taskDetailLoading5.indexOf(loading) != -1){
+          this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+        }
+        if(this.ttaskDetailLoading5.indexOf(loading) != -1){
+          this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
+        }
         this.isTeacherTaskCancelToken2[_tindex2] = null
+        _this.$confirm("本任务的教案生成失败是否重新生成,取消则自动生成下一个任务!", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          distinguishCancelAndClose: true,
+          type: "warning"
+        })
+          .then(() => {
+          _this.aiDetail52(msg, _tindex2, callback)
+        }).catch((v) => {
+          console.log(v);
+          callback ? callback() : ''
+        })
         return;
       }
       
@@ -21688,9 +21795,14 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
           this.isTeacherTaskCancelSource[_tindex2].close();
           this.isTeacherTaskCancelSource[_tindex2] = null;
           this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
-          this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
-          this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
+          if(this.taskDetailLoading5.indexOf(loading) != -1){
+            this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+          }
+          if(this.ttaskDetailLoading5.indexOf(loading) != -1){
+            this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
+          }
           this.isTeacherTaskCancelToken2[_tindex2] = null
+          callback ? callback() : ''
           return;
         } else {
           _iindex++
@@ -21723,11 +21835,27 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
         // 处理错误,可以尝试重新连接
         console.log('EventSource error:', event);
         _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请稍等再重试")
-        _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(loading), 1)
-        _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(loading), 1)
+        if(_this.taskDetailLoading5.indexOf(loading) != -1){
+          _this.taskDetailLoading5.splice(_this.taskDetailLoading5.indexOf(loading), 1)
+        }
+        if(_this.ttaskDetailLoading5.indexOf(loading) != -1){
+          _this.ttaskDetailLoading5.splice(_this.ttaskDetailLoading5.indexOf(loading), 1)
+        }
         _this.isTeacherTaskCancelSource[_tindex2].close();
         _this.isTeacherTaskCancelSource[_tindex2] = null;
         _this.isTeacherTaskCancelToken2[_tindex2] = null
+        _this.$confirm("本任务的教案生成失败是否重新生成,取消则自动生成下一个任务!", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          distinguishCancelAndClose: true,
+          type: "warning"
+        })
+          .then(() => {
+          _this.aiDetail52(msg, _tindex2, callback)
+        }).catch((v) => {
+          console.log(v);
+          callback ? callback() : ''
+        })
       };
     },
     aiDetail52getAiContentText(_e, loading, _tindex2, _source){

Някои файлове не бяха показани, защото твърде много файлове са промени