lsc преди 8 месеца
родител
ревизия
c19938691d

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.a1f0dd545f6a0690b29eaff3ddf98680.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.d5f0d79dbb0d92c052d4.js></script><script type=text/javascript src=./static/js/app.e5083da6bb57e845f482.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.39b46caed406dae30a78ceb65a0983e0.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.d5f0d79dbb0d92c052d4.js></script><script type=text/javascript src=./static/js/app.d25e05f43ca18e234127.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

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


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


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


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


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


+ 105 - 35
src/components/pages/aiAddCourse/addCourse.vue

@@ -683,7 +683,7 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-show="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 0">
+            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-if="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 0">
               <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title">
                   概念群
@@ -709,7 +709,7 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-show="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 1">
+            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-if="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 1">
               <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title">
                   问题链
@@ -735,7 +735,7 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-show="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 2">
+            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-if="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 2">
               <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title">
                   目标层
@@ -761,7 +761,7 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-show="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 3">
+            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-if="templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && cpoteType > 3">
               <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title">
                   任务簇
@@ -814,9 +814,9 @@
                         <div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
                         <div style="display: flex;">
                           <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
-                            <div class="r_pub_button_op"
+                            <!-- <div class="r_pub_button_op"
                               @contextmenu.prevent="openAiDialog(1, 'teacherDetail2', item.taskDetail3, index)"
-                              @click="openAiDialog(2, 'teacherDetail2', item.taskDetail3, index)">智能优化</div>
+                              @click="openAiDialog(2, 'teacherDetail2', item.taskDetail3, index)">智能优化</div> -->
                           </el-tooltip>
                           <div class="r_pub_button_edit" style="margin-left:10px" @click="editTask3(index)">{{
                             item.isTask3 ? '确定' : '编辑'}}</div>
@@ -5729,6 +5729,7 @@ import { v4 as uuidv4 } from "uuid";
 import MarkdownIt from "markdown-it";
 import aiCreateDialog from './aiCreateDialog.vue'
 import aiCreateVideoDialog from './aiCreateVideoDialog.vue'
+
 var OpenCC = require("opencc-js");
 let converter = OpenCC.Converter({
 		from:'hk',
@@ -5754,7 +5755,7 @@ export default {
     aiTips,
     tipsDialog,
     aiCreateDialog,
-    aiCreateVideoDialog
+    aiCreateVideoDialog,
   },
   data() {
     return {
@@ -6115,6 +6116,7 @@ export default {
       templatePan: ['0e7966d6-1e49-11ef-bee5-005056b86db5','60d153e3-1e49-11ef-bee5-005056b86db5','7f3e28b7-1e66-11ef-bee5-005056b86db5','9dd4bb76-1e48-11ef-bee5-005056b86db5','ab317f23-1e66-11ef-bee5-005056b86db5'],
       courseJie:1,
       courseTime:45,
+      allTextArray: [],
     };
   },
   directives: {
@@ -6837,21 +6839,21 @@ export default {
             return;
           }
 
-          if (!this.isOutline2) {
-            this.openAiDialog(clickType, 'aiTeacher')
-            return;
-          }
-
-
-          // if (!this.isOutline2 && this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5") {
+          // if (!this.isOutline2) {
           //   this.openAiDialog(clickType, 'aiTeacher')
           //   return;
           // }
 
-          // if (!this.isOutline2 && this.templateid != "4480d65a-1e48-11ef-bee5-005056b86db5") {
-          //   this.openAiDialog(clickType, 'aiTeacher2')
-          //   return;
-          // }
+
+          if (!this.isOutline2 && this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5") {
+            this.openAiDialog(clickType, 'aiTeacher')
+            return;
+          }
+
+          if (!this.isOutline2 && this.templateid != "4480d65a-1e48-11ef-bee5-005056b86db5") {
+            this.openAiDialog(clickType, 'aiTeacher2')
+            return;
+          }
 
           const functionA = () => {
             setTimeout(() => {
@@ -9206,8 +9208,8 @@ export default {
           this.cid = res.data.courseId;
           this.courseUserid = this.userid;
           this.islogin = true;
-          this.updateCourseState(4);
-          // this.updateCourseState(5);
+          // this.updateCourseState(4);
+          this.updateCourseState(5);
           this.addtips()
         })
         .catch((err) => {
@@ -13491,9 +13493,9 @@ export default {
       this.$forceUpdate();
     },
     openAiDialog(clickType, type, callback, index, tindex) {
-      if(clickType == 1){
-        return;
-      }
+      // if(clickType == 1){
+      //   return;
+      // }
       if (this.courseName == "") {
         this.$message.error("请补充填写课程名称");
         return;
@@ -13974,6 +13976,7 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
+      let _iindex = 0
       _source.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
@@ -13985,6 +13988,7 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
           this.ttextLoading = false
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -13998,7 +14002,10 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           //转化返回的回复流数据
-          this.courseText = _mdText;
+          if(_iindex == 10){
+            this.courseText = _mdText;
+            _iindex = 0
+          }
           this.textLoading = false
           // 处理流数据
         }
@@ -14995,6 +15002,7 @@ ${msg} 及#教学任务描述 以文本格式输出任务设计和评价标准
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
+      let _iindex = 0
       _source.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
@@ -15006,6 +15014,7 @@ ${msg} 及#教学任务描述 以文本格式输出任务设计和评价标准
           this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -15018,8 +15027,11 @@ ${msg} 及#教学任务描述 以文本格式输出任务设计和评价标准
           _mdText = _mdText.replace(/\\n/g, "\n");
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
-          //转化返回的回复流数据
-          this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
+          //转化返回的回复流数据.
+          if(_iindex == 10){
+            this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
+            _iindex = 0
+          }
           this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
           // 处理流数据
         }
@@ -15132,6 +15144,7 @@ ${msg}
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
+      let _iindex = 0
       _source.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
@@ -15143,6 +15156,7 @@ ${msg}
           this.ttaskDetailLoading2.splice(this.ttaskDetailLoading2.indexOf(loading), 1)
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -15156,7 +15170,10 @@ ${msg}
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           //转化返回的回复流数据
-          this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail = _mdText;
+          if(_iindex == 10){
+            this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail = _mdText;
+            _iindex = 0
+          }
           this.taskDetailLoading2.splice(this.taskDetailLoading2.indexOf(loading), 1)
           // 处理流数据
         }
@@ -15271,6 +15288,7 @@ ${msg} 输出格式和内容要求参考#格式与要求
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
+      let _iindex = 0
       _source.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
@@ -15282,6 +15300,7 @@ ${msg} 输出格式和内容要求参考#格式与要求
           this.ttaskDetailLoading3.splice(this.ttaskDetailLoading3.indexOf(loading), 1)
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -15295,7 +15314,10 @@ ${msg} 输出格式和内容要求参考#格式与要求
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           //转化返回的回复流数据
-          this.unitJson[0].chapterInfo[0].taskJson[_tindex2].toolChoose[_tindex3].toolDetail = _mdText;
+          if(_iindex == 10){
+            this.unitJson[0].chapterInfo[0].taskJson[_tindex2].toolChoose[_tindex3].toolDetail = _mdText;
+            _iindex = 0
+          }
           this.taskDetailLoading3.splice(this.taskDetailLoading3.indexOf(loading), 1)
           // 处理流数据
         }
@@ -15559,6 +15581,7 @@ ${_text2}`
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
+      let _iindex = 0
       _source.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
@@ -15570,6 +15593,7 @@ ${_text2}`
           this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -15583,8 +15607,13 @@ ${_text2}`
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           //转化返回的回复流数据
-          this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
-          this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+          if(_iindex == 10){
+            this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
+            _iindex = 0
+          }
+          if(this.taskDetailLoading5.indexOf(loading) !== -1){
+            this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+          }
           // 处理流数据
         }
         // this.$forceUpdate();
@@ -15703,7 +15732,10 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 ? '任务描
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
-      _source.onmessage = _e => {
+      this.allTextArray[_tindex2] = ""
+      let _iindex = 0
+      _source.onmessage = async (_e) => {
+        // await _this.aiDetail52getAiContentText(_e, loading, _tindex2, _source)
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
@@ -15714,6 +15746,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 ? '任务描
           this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -15727,13 +15760,45 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 ? '任务描
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           //转化返回的回复流数据
-          this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
-          this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+          if(_iindex == 10){
+            this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText;
+            _iindex = 0
+          }
+          if(this.taskDetailLoading5.indexOf(loading) !== -1){
+            this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+          }
           // 处理流数据
         }
-        // this.$forceUpdate();
       };
     },
+    aiDetail52getAiContentText(_e, loading, _tindex2, _source){
+      let _mdText = "";
+      let _eData = JSON.parse(_e.data).content;
+      if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
+        //对话已经完成
+        this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = this.allTextArray[_tindex2].replace("_", "");
+        _source.close();
+        this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+        this.ttaskDetailLoading5.splice(this.ttaskDetailLoading5.indexOf(loading), 1)
+        return;
+      } else {
+        //对话还在继续
+        let _text = "";
+        _text = _eData.replaceAll("'", "");
+        if (this.allTextArray[_tindex2] == "") {
+          this.allTextArray[_tindex2] = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+        } else {
+          this.allTextArray[_tindex2] += _text;
+        }
+        _mdText = this.allTextArray[_tindex2] + "_";
+        _mdText = this.allTextArray[_tindex2].replace(/\\n/g, "\n");
+        _mdText = this.allTextArray[_tindex2].replace(/\\/g, "");
+        if (this.allTextArray[_tindex2].split("```").length % 2 == 0) _mdText += "\n```\n";
+        this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 = _mdText
+        this.taskDetailLoading5.splice(this.taskDetailLoading5.indexOf(loading), 1)
+        // 处理流数据
+      }
+    },
     async aiCpote(msg, callback) {
       let _this = this
       let _index = _this.aitype.replace("aiC","c")
@@ -15865,6 +15930,7 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
+      let _iindex = 0
       _source.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
@@ -15877,6 +15943,7 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
           callback ? callback() : ''
           return;
         } else {
+          _iindex++
           //对话还在继续
           let _text = "";
           _text = _eData.replaceAll("'", "");
@@ -15890,7 +15957,10 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
           _mdText = _mdText.replace(/\\/g, "");
           if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
           //转化返回的回复流数据
-          this.cpote[loading] = _mdText;
+          if(_iindex == 10){
+            this.cpote[loading] = _mdText;
+            _iindex = 0
+          }
           this.cpoteLoading[loading] = false
           // 处理流数据
         }

+ 1 - 1
src/components/pages/aiAddCourse/templateDialog.vue

@@ -10,7 +10,7 @@
                 </el-input>
             </div>
             <div class="a-d-t-right">
-                <!-- <el-button @click="open2()" type="primary" size="small" style="margin-right: 10px;">设置模板</el-button> -->
+                <el-button @click="open2()" type="primary" size="small" style="margin-right: 10px;">设置模板</el-button>
                 <span @click.stop="close">×</span>
             </div>
         </div>

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