lsc пре 11 месеци
родитељ
комит
f9b4bc1742
26 измењених фајлова са 1156 додато и 276 уклоњено
  1. 4 0
      dist/index.html
  2. 1 0
      dist/static/css/app.1e602bf0ee3bde0afd61f22d6f20be1d.css
  3. 1 0
      dist/static/css/app.1e602bf0ee3bde0afd61f22d6f20be1d.css.map
  4. 1 0
      dist/static/css/app.c76147f69cd84f8bf20497e63aa207d1.css
  5. 0 0
      dist/static/css/app.c76147f69cd84f8bf20497e63aa207d1.css.map
  6. BIN
      dist/static/img/bg1.e5fea9e.png
  7. BIN
      dist/static/img/bg2.dbe40e4.png
  8. 1 0
      dist/static/js/app.37c454d4b79befdd32ae.js
  9. 1 0
      dist/static/js/app.37c454d4b79befdd32ae.js.map
  10. 1 0
      dist/static/js/app.a818aaf926b8efb24844.js
  11. 0 0
      dist/static/js/app.a818aaf926b8efb24844.js.map
  12. 0 0
      dist/static/js/manifest.0ad6c5648a38a6d1fa8f.js.map
  13. 0 0
      dist/static/js/vendor.99ecd68f0ea1b548f2f6.js
  14. 0 0
      dist/static/js/vendor.99ecd68f0ea1b548f2f6.js.map
  15. BIN
      src/assets/icon/pocAiClassroom/bg2.png
  16. 219 106
      src/components/pages/aiAddCourse/addCourse.vue
  17. 525 0
      src/components/pages/aiAddCourse/aiCreateVideoDialog copy.vue
  18. 165 69
      src/components/pages/aiAddCourse/aiCreateVideoDialog.vue
  19. 1 1
      src/components/pages/pocAiClassroom/chatArea.vue
  20. 1 1
      src/components/pages/pocAiClassroom/doTask.vue
  21. 79 91
      src/components/pages/pocAiClassroom/index.vue
  22. 2 1
      src/components/pages/pocAiClassroom/pocClass.vue
  23. 11 2
      src/components/pages/test/add/addTest.vue
  24. 140 2
      src/components/pages/test/add/setInfo/index.vue
  25. 1 1
      src/components/pages/test/check/index.vue
  26. 2 2
      src/config/config.js

+ 4 - 0
dist/index.html

@@ -32,7 +32,11 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
+<<<<<<< HEAD
     }</style><link href=./static/css/app.c76147f69cd84f8bf20497e63aa207d1.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.0ad6c5648a38a6d1fa8f.js></script><script type=text/javascript src=./static/js/vendor.35dfb1d95a63059f336f.js></script><script type=text/javascript src=./static/js/app.a818aaf926b8efb24844.js></script></body></html><script>function stopSafari() {
+=======
+    }</style><link href=./static/css/app.1e602bf0ee3bde0afd61f22d6f20be1d.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.99ecd68f0ea1b548f2f6.js></script><script type=text/javascript src=./static/js/app.37c454d4b79befdd32ae.js></script></body></html><script>function stopSafari() {
+>>>>>>> beta
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/static/css/app.1e602bf0ee3bde0afd61f22d6f20be1d.css


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/static/css/app.1e602bf0ee3bde0afd61f22d6f20be1d.css.map


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/static/css/app.c76147f69cd84f8bf20497e63aa207d1.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/app.c76147f69cd84f8bf20497e63aa207d1.css.map


BIN
dist/static/img/bg1.e5fea9e.png


BIN
dist/static/img/bg2.dbe40e4.png


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/static/js/app.37c454d4b79befdd32ae.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/static/js/app.37c454d4b79befdd32ae.js.map


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/static/js/app.a818aaf926b8efb24844.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.a818aaf926b8efb24844.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/manifest.0ad6c5648a38a6d1fa8f.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/vendor.99ecd68f0ea1b548f2f6.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/vendor.99ecd68f0ea1b548f2f6.js.map


BIN
src/assets/icon/pocAiClassroom/bg2.png


+ 219 - 106
src/components/pages/aiAddCourse/addCourse.vue

@@ -5149,10 +5149,10 @@
                                     @click="addEList(unitIndex, itemTaskIndex)">
                                     添加
                                   </button>
-                                  <button class="c_pub_button_add pub_btn_eval_source_img"
+                                  <!-- <button class="c_pub_button_add pub_btn_eval_source_img"
                                     @click="openEList(unitIndex, itemTaskIndex)">
                                     资源
-                                  </button>
+                                  </button> -->
                                 </div>
                                 <button class="c_pub_button_add" @click="addCET(unitIndex, itemTaskIndex)"
                                   v-if="itemTask.eList && itemTask.eList.length">
@@ -7348,6 +7348,7 @@ export default {
       isTeacherTextCancelSource: null,
       isTargetCancelSource1: null,
       isTargetCancelSource2: null,
+      fileidArray: []
     };
   },
   directives: {
@@ -7564,7 +7565,7 @@ export default {
             this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
               this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
                 (ele) => {
-                  return ele.value != "";
+                  return ele.value != "" || ele.detail != "" || ele.target != "";
                 }
               );
           }
@@ -7641,7 +7642,7 @@ export default {
               this.unitJson[i].chapterInfo[0].taskJson[j].eList = this.unitJson[
                 i
               ].chapterInfo[0].taskJson[j].eList.filter((ele) => {
-                return ele.value != "";
+                return ele.value != "" || ele.detail != "" || ele.target != "";
               });
             }
           }
@@ -8109,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 != "") {
@@ -8421,7 +8425,7 @@ export default {
           this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
             this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
               (ele) => {
-                return ele.value != "";
+                return ele.value != "" || ele.detail != "" || ele.target != "";
               }
             );
         }
@@ -8502,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 {
@@ -11272,7 +11276,7 @@ export default {
             this.unitJson[i].chapterInfo[0].taskJson[j].eList = this.unitJson[
               i
             ].chapterInfo[0].taskJson[j].eList.filter((ele) => {
-              return ele.value != "";
+              return ele.value != "" || ele.detail != "" || ele.target != "";
             });
           }
         }
@@ -11404,7 +11408,7 @@ export default {
           this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
             this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
               (ele) => {
-                return ele.value != "";
+                return ele.value != "" || ele.detail != "" || ele.target != "";
               }
             );
         }
@@ -11475,7 +11479,7 @@ export default {
           this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
             this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
               (ele) => {
-                return ele.value != "";
+                return ele.value != "" || ele.detail != "" || ele.target != "";
               }
             );
         }
@@ -11540,7 +11544,7 @@ export default {
             this.unitJson[i].chapterInfo[0].taskJson[j].eList = this.unitJson[
               i
             ].chapterInfo[0].taskJson[j].eList.filter((ele) => {
-              return ele.value != "";
+              return ele.value != "" || ele.detail != "" || ele.target != "";
             });
           }
         }
@@ -13746,7 +13750,7 @@ export default {
             }
             
             this.isFileSearch = res.data[0][0].iresearch == 1
-            this.seleteCourseUpdate();
+            // this.seleteCourseUpdate();
             this.setMan();
             this.selectAllType();
             this.unitJson[
@@ -16927,9 +16931,18 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
       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
@@ -19515,9 +19528,19 @@ ${msg}
       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
@@ -19845,9 +19868,19 @@ ${taskArray.length ? '其他任务大纲内容' + taskArray.join(',') : ''}
       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
@@ -20015,9 +20048,19 @@ ${_this.aiCallBack.taskDetail}
       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
@@ -20176,9 +20219,19 @@ ${msg} 输出格式和内容要求参考#格式与要求
       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
@@ -20533,9 +20586,19 @@ ${_text2}`
       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
@@ -20579,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) {
@@ -20714,9 +20777,19 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
       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] = ""
@@ -20931,9 +21004,19 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
       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
@@ -21114,9 +21197,19 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
       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
@@ -21305,9 +21398,19 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
       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
@@ -21500,50 +21603,45 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
       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 = [] 
@@ -21663,9 +21761,19 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
       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
@@ -22138,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);
@@ -22150,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++){
@@ -22202,23 +22314,24 @@ ${msg}
     }
   },
   beforeDestroy() {
-    clearTimeout(this.timer);
-    this.timer = null;
-    clearInterval(this.timer2);
-    this.timer2 = null;
-    clearInterval(this.pasteTimer);
-    this.pasteTimer = null;
+    // clearTimeout(this.timer);
+    // this.timer = null;
+    // clearInterval(this.timer2);
+    // this.timer2 = null;
+    // clearInterval(this.pasteTimer);
+    // this.pasteTimer = null;
   },
   beforeRouteLeave(to, from, next) {
-    clearTimeout(this.timer);
-    this.timer = null;
-    clearInterval(this.timer2);
-    this.timer2 = null;
-    clearInterval(this.pasteTimer);
-    this.pasteTimer = null;
+    // clearTimeout(this.timer);
+    // this.timer = null;
+    // clearInterval(this.timer2);
+    // this.timer2 = null;
+    // clearInterval(this.pasteTimer);
+    // this.pasteTimer = null;
     next();
   },
   created() {
+    this.selectFileid();
     this.getStudent();
     this.getTeacher();
     this.getClass();
@@ -22245,12 +22358,12 @@ ${msg}
 
     }
     this.loading = false;
-    this.timer2 = setInterval(() => {
-      this.selectEva();
-    }, 5000);
-    this.pasteTimer = setInterval(() => {
-      this.getPaste();
-    }, 1000);
+    // this.timer2 = setInterval(() => {
+    //   this.selectEva();
+    // }, 5000);
+    // this.pasteTimer = setInterval(() => {
+    //   this.getPaste();
+    // }, 1000);
     setTimeout(() => {
       // this.selectAllType();
 

+ 525 - 0
src/components/pages/aiAddCourse/aiCreateVideoDialog copy.vue

@@ -0,0 +1,525 @@
+<template>
+    <el-dialog title="智能检索" :visible.sync="dialogVisibleAiCreateVideo" :append-to-body="true" width="700px"
+        :before-close="handleClose" class="dialog_diy">
+        <div style="height: 500px;padding:15px" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
+            <div style="position: relative; width: 100%;height: 40px;margin-bottom: 10px;">
+                <el-input class="inputC" style="height: 100%;" placeholder="搜索视频关键字(如需搜索多个可“,”隔开)" v-model="detail"
+                    @keyup.enter.native="searchA()"></el-input>
+                <div class="search_img" @click="searchA" style="right: 10px">
+                    <img src="../../../assets/icon/search.png" alt />
+                </div>
+            </div>
+            <div class="Box">
+                <!-- <div class="video_box" v-for="(item,index) in data" :key="index">
+                    <img :src="item.snippet.thumbnails.high.url" />
+                    <span class="name">{{ item.snippet.title }}</span> 
+                    <span class="detail">{{ item.snippet.description }}</span> 
+                    <div class="btn">
+                        <span @click="openUrl(item.id.videoId)">查看</span>
+                        <span @click="checkUrl(item.snippet.title,item.id.videoId)">加入</span>
+                    </div>
+                </div> -->
+                <div class="video_box video_box2" v-for="(item, index) in data" :key="index">
+                    <!-- <img :src="item.pic" /> -->
+                    <span class="name" v-html="item.title"></span>
+                    <span class="detail">{{ item.description }}</span>
+                    <div class="btn">
+                        <span @click="openUrl(item.bvid)">查看</span>
+                        <span @click="checkUrl(item.title, item.bvid)">加入</span>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+            <!-- <el-button @click="aiGet" type="primary">重新生成</el-button> -->
+            <!-- <el-button @click="confirm" type="primary">确 定</el-button> -->
+            <el-button @click="close">关 闭</el-button>
+        </span>
+    </el-dialog>
+</template>
+
+<script>
+import { v4 as uuidv4 } from "uuid";
+
+export default {
+    components: {
+    },
+    props: {
+        dialogVisibleAiCreateVideo: {
+            type: Boolean,
+            default: false
+        },
+        courseName: {
+            type: String,
+            default: ""
+        },
+        courseState: {
+            type: Number,
+        },
+        lineCount: {
+            type: Number,
+        },
+        unitJson: {
+            type: Array,
+        }
+    },
+    // 根据用户给你的参考资料
+    data() {
+        return {
+            userid: this.$route.query.userid,
+            radio: 0,
+            aiJson: {
+                ppt: ``,
+                word: '',
+                video: ''
+            },
+            aiUrl: {
+                ppt: '',
+                word: '',
+                video: ''
+            },
+            detail: "",
+            loading: false,
+            url: "",
+            data: [],
+            uJson: {}
+        }
+    },
+    watch: {
+        dialogVisibleAiCreateVideo(newValue, oldValue) {
+            if (newValue) {
+                // if (this.radio == 0) {
+                if (this.courseState == 4) {
+                    this.detail = this.courseName
+                    this.aiGet()
+                } else if (this.courseState == 5) {
+                    // this.detail = this.unitJson[0].chapterInfo[0].taskJson[this.lineCount].task.replace("任务"+(this.lineCount+1)+":","")
+                    this.againEva()
+                }
+                // }
+                // if (this.radio == 1) {
+                //     this.detail = this.aiJson.word
+                // }
+                // if (this.radio == 2) {
+                //     this.detail = this.aiJson.video
+                // }
+                // this.loading = false
+
+                // this.aiGet()
+                // this.againEva()
+            }
+        },
+    },
+    methods: {
+        handleClose(done) {
+            this.close()
+            done();
+        },
+        close() {
+            this.$emit('update:dialogVisibleAiCreateVideo', false)
+        },
+        openUrl(url) {
+            // window.open('https://www.youtube.com/embed/'+url)
+            window.open(`//www.bilibili.com/video/${url}`)
+        },
+        checkUrl(name, id) {
+            let json = {
+                name: "链接",
+                title: name.replace(/<[^>]*>?/gm, ''),
+                // url: 'https://www.youtube.com/embed/'+id,
+                url: `//player.bilibili.com/player.html?isOutside=true&bvid=${id}`,
+                type: 8,
+            }
+            this.$emit('createAiVideo', json)
+            this.$message.success('加入成功')
+        },
+        changeRadio() {
+            if (this.radio == 0) {
+                this.detail = this.aiJson.ppt
+            }
+            if (this.radio == 1) {
+                this.detail = this.aiJson.word
+            }
+            if (this.radio == 2) {
+                this.detail = this.aiJson.video
+            }
+        },
+        // async aiGet() {
+        //     let _this = this
+        //     _this.loading = true
+        //     this.ajax
+        //         .get(`https://www.googleapis.com/youtube/v3/search?key=AIzaSyBUvNQ5Wyua4PbStE2vp3t7MIY4htry-4M&part=snippet&q=${this.detail}&maxResults=10&type=video&order=relevance&regionCode=HK`)
+        //         .then((response) => {
+        //             console.log(response);
+        //             _this.data = response.data.items
+        //             _this.loading = false
+
+        //         })
+        //         .catch((error) => {
+        //             _this.loading = false
+        //             console.log(error);
+        //         });
+        // },
+        async aiGet() {
+            let _this = this
+            _this.loading = true
+            this.ajax.post(`https://gpt4.cocorobo.cn/get_network_search`, {
+                engine: "bilibili",
+                keyword: this.detail
+            }).then(response => {
+                console.log(response);
+                _this.data = response.data.FunctionResponse
+                _this.loading = false
+
+            })
+                .catch((error) => {
+                    _this.loading = false
+                    console.log(error);
+                });
+        },
+        // async aiGet2(msg) {
+        //     let _this = this
+        //     _this.loading = true
+        //     this.ajax
+        //         .get(`https://www.googleapis.com/youtube/v3/search?key=AIzaSyBUvNQ5Wyua4PbStE2vp3t7MIY4htry-4M&part=snippet&q=${msg}&maxResults=10&type=video&order=relevance&regionCode=HK`)
+        //         .then((response) => {
+        //             console.log(response);
+        //             _this.data = response.data.items
+        //             _this.loading = false
+
+        //         })
+        //         .catch((error) => {
+        //             _this.loading = false
+        //             console.log(error);
+        //         });
+        // },
+        async aiGet2(msg) {
+            let _this = this
+            return new Promise((resolve, reject) => {
+                this.ajax.post(`https://gpt4.cocorobo.cn/get_network_search`, {
+                    engine: "bilibili",
+                    keyword: msg
+                }).then(response => {
+                    console.log(response);
+                    // _this.data = [..._this.data,...response.data.FunctionResponse]
+                    resolve(response.data.FunctionResponse)
+                })
+                    .catch((error) => {
+                        resolve([])
+                        console.log(error);
+                    });
+            });
+        },
+        async searchA(){
+            let _this = this
+            if(!_this.detail){
+                _this.$message.error("请输入关键字")
+                return
+            }
+            _this.loading = true
+            let _content = ""
+            if(_this.detail.split(",").length>1){
+                _content = _this.detail.split(",")
+            }else{
+                _content = _this.detail.split(",")
+            }
+            _this.data = []
+            for (var a = 0; a < _content.length; a++) {
+                let _data = await _this.aiGet2(_content[a])
+                _this.data = [..._this.data, ..._data]
+            }
+            _this.data = _this.data.sort(
+                function (a, b) {
+                    return b.play - a.play;
+                }
+            );
+            _this.againEva2();
+            // _this.loading = false
+        },
+        againEva() {
+            let _this = this
+            _this.loading = true
+            let message = `从以下内容中识别出1~2个学科知识点关键词,用于检索知识点相关视频。注意,你仅需要返回关键词,“,”分开。教案:${_this.unitJson[0].chapterInfo[0].taskJson[_this.lineCount].taskDetail3.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}`
+            let parm = {
+                assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
+                message: [{ "type": "text", "text": message.replaceAll('\n', " ").replaceAll('*', "") }],
+                session_name: uuidv4(),
+                userId: _this.userid,
+                file_ids: [],
+                model: 'gpt-4o-2024-08-06',
+            }
+            _this.ajax
+                .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+                .then(async (response) => {
+                    console.log(response);
+                    let data = response.data.FunctionResponse
+                    if (data.message) {
+                        console.log(data.message);
+
+                        let content = data.message;
+                        _this.detail = content
+                        let _content = content.split(",")
+                        if(content.split(",").length>1){
+                            _content = content.split(",")
+                        }else{
+                            _content = content.split(",")
+                        }
+                        _this.data = []
+                        for (var a = 0; a < _content.length; a++) {
+                            let _data = await _this.aiGet2(_content[a])
+                            _this.data = [..._this.data, ..._data]
+                        }
+                        _this.data = _this.data.sort(
+                            function (a, b) {
+                                return b.play - a.play;
+                            }
+                        );
+                        _this.againEva2();
+                    }
+                    // _this.loading = false
+
+                })
+                .catch((error) => {
+                    console.log(error);
+                    _this.loading = true
+                });
+        },
+        againEva2() {
+            let _this = this
+            _this.loading = true
+            let message = `ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
+针对以下视频数组内容,删除其中不适合k12年级的学生在教室里看到的条目,返回以下视频数组不符合的视频的aid,视频数组:${JSON.stringify(_this.data)}
+
+# Format example
+[{aid:""},{aid:""}]
+`
+            let parm = {
+              model: 'gpt-4o-2024-08-06',
+              temperature: 0,
+              max_tokens: 4096,
+              top_p: 1,
+              frequency_penalty: 0,
+              presence_penalty: 0,
+              messages: [{
+                content: message.replaceAll('\n', " ").replaceAll('*', ""),
+                role: 'user'
+              }],
+              uid: uuidv4(),
+              stream: false,
+              mind_map_question: "",
+            }
+            _this.ajax
+                .post("https://gpt4.cocorobo.cn/chat", parm)
+                .then(async (response) => {
+                    console.log(response);
+                    let data = response.data.FunctionResponse
+                    if (data.choices && data.choices.length && data.choices[0].message) {
+                        console.log(data.choices[0].message.content);
+                        let dArray = []
+                        try {
+                            dArray = JSON.parse(data.choices[0].message.content.replaceAll('```json','').replaceAll('```',''))
+                        } catch (error) {
+                            console.log("error_________________" + error);
+                            try {
+                                let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
+                                let match = data.choices[0].message.content.match(regex);
+                                dArray = JSON.parse(match[0]);
+                            } catch (error) {
+                                console.log("error_________________" + error);
+                            }
+                        }
+
+                        let aid = []
+                        for(var i = 0; i < dArray.length; i++){
+                            aid.push(dArray[i].aid)
+                        }
+                        _this.data = _this.data.filter(el => {
+                            return aid.indexOf(el.aid) === -1
+                        })
+                        _this.$forceUpdate()
+                    }
+                    _this.loading = false
+                })
+                .catch((error) => {
+                    console.log(error);
+                    _this.loading = true
+                });
+        },
+    },
+}
+</script>
+
+<style scoped>
+.dialog_diy>>>.el-dialog {
+    height: auto;
+    margin: 15vh auto 0 !important;
+}
+
+.dialog_diy>>>.el-dialog__header {
+    background: #454545 !important;
+    padding: 15px 20px;
+}
+
+.dialog_diy>>>.el-dialog__body {
+    height: calc(100% - 124px);
+    box-sizing: border-box;
+    padding: 0px;
+}
+
+
+.dialog_diy>>>.el-dialog__title {
+    color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn {
+    top: 19px;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
+    color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
+    color: #fff;
+}
+
+
+.dialog_diy>>>.el-dialog__body,
+.dialog_diy>>>.el-dialog__footer {
+    background: #fafafa;
+}
+
+.binfo_input {
+    width: 100%;
+    margin: 0;
+    padding: 5px 7px;
+    display: block;
+    min-width: 0;
+    outline: none;
+    box-sizing: border-box;
+    background: none;
+    border: none;
+    border-radius: 4px;
+    background: #fff;
+    font-size: 15px;
+    resize: none;
+    font-family: "Microsoft YaHei";
+    min-height: 48px;
+    /* border: 1px solid #3682fc00; */
+    border: 1.5px solid #cad1dc;
+}
+
+.binfo_textarea {
+    border: 1.5px solid #cad1dc;
+    font-size: 15px;
+    resize: none;
+    /* background: #f6f6f6; */
+    font-family: "Microsoft YaHei";
+}
+
+.binfo_input:focus-visible {
+    border: 1.5px solid #3681fc !important;
+}
+
+
+.t_box {
+    display: flex;
+    margin-bottom: 15px;
+}
+
+.t_box>span:nth-child(1) {
+    min-width: 80px;
+    font-size: 16px;
+    color: #000;
+}
+
+.inputC>>>.el-input__inner {
+    padding: '0 35px 0 15px'
+}
+
+.search_img {
+    width: 20px;
+    height: 20px;
+    position: absolute;
+    right: 10px;
+    top: 50%;
+    transform: translateY(-50%);
+}
+
+.search_img>img {
+    width: 100%;
+    height: 100%;
+}
+
+
+.Box {
+    width: 100%;
+    height: calc(100% - 50px);
+    overflow: auto;
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+}
+
+.video_box {
+    width: calc(100% / 2 - 10px);
+    /* overflow: hidden; */
+    margin-right: 10px;
+    display: flex;
+    flex-direction: column;
+    margin-bottom: 15px;
+    cursor: pointer;
+}
+
+.video_box>img {
+    height: 200px;
+    object-fit: cover;
+}
+
+.video_box>.detail {
+    color: #cecece;
+}
+
+.video_box>.name {
+    color: #000;
+    margin: 5px 0;
+    height: 32px;
+}
+
+.btn {
+    width: 100%;
+    height: 35px;
+    display: flex;
+    align-items: center;
+    margin-top: auto;
+}
+
+.btn>span:hover {
+    background: #4087f1;
+}
+
+.btn>span {
+    width: 100%;
+    height: 100%;
+    background: #3681fc;
+    color: #fff;
+    border-radius: 5px;
+    margin-top: 10px;
+    cursor: pointer;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.btn>span+span {
+    margin-left: 10px;
+}
+
+.video_box2 {
+    box-shadow: 0px 0px 4px 2px #d2d2d282;
+    padding: 5px 10px 10px;
+    box-sizing: border-box;
+    border-radius: 5px;
+}
+</style>

+ 165 - 69
src/components/pages/aiAddCourse/aiCreateVideoDialog.vue

@@ -1,7 +1,7 @@
 <template>
-    <el-dialog title="智能检索" :visible.sync="dialogVisibleAiCreateVideo" :append-to-body="true" width="700px"
+    <el-dialog title="智能检索" :visible.sync="dialogVisibleAiCreateVideo" :append-to-body="true" width="90%"
         :before-close="handleClose" class="dialog_diy">
-        <div style="height: 500px;padding:15px" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
+        <div style="box-sizing:border-box;padding:15px" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
             <div style="position: relative; width: 100%;height: 40px;margin-bottom: 10px;">
                 <el-input class="inputC" style="height: 100%;" placeholder="搜索视频关键字(如需搜索多个可“,”隔开)" v-model="detail"
                     @keyup.enter.native="searchA()"></el-input>
@@ -9,30 +9,31 @@
                     <img src="../../../assets/icon/search.png" alt />
                 </div>
             </div>
+            <div class="nav_box">
+                <div class="nav" :class="{ active: navActive == 0 }" @click="navClick(0)">综合排序</div>
+                <div class="nav" :class="{ active: navActive == 1 }" @click="navClick(1)">最多播放</div>
+                <div class="nav" :class="{ active: navActive == 2 }" @click="navClick(2)">最新发布</div>
+                <div class="nav" :class="{ active: navActive == 3 }" @click="navClick(3)">最多弹幕</div>
+                <div class="nav" :class="{ active: navActive == 4 }" @click="navClick(4)">最多收藏</div>
+            </div>
             <div class="Box">
-                <!-- <div class="video_box" v-for="(item,index) in data" :key="index">
-                    <img :src="item.snippet.thumbnails.high.url" />
-                    <span class="name">{{ item.snippet.title }}</span> 
-                    <span class="detail">{{ item.snippet.description }}</span> 
-                    <div class="btn">
-                        <span @click="openUrl(item.id.videoId)">查看</span>
-                        <span @click="checkUrl(item.snippet.title,item.id.videoId)">加入</span>
-                    </div>
-                </div> -->
                 <div class="video_box video_box2" v-for="(item, index) in data" :key="index">
                     <!-- <img :src="item.pic" /> -->
                     <span class="name" v-html="item.title"></span>
+                    <span class="author">作者:{{ item.author }}</span>
                     <span class="detail">{{ item.description }}</span>
+                    <div class="tag" v-if="item.tag.split(',').length > 0">
+                        <span v-for="(tag, index) in item.tag.split(',')" :key="index">{{ tag }}</span>
+                    </div>
                     <div class="btn">
                         <span @click="openUrl(item.bvid)">查看</span>
                         <span @click="checkUrl(item.title, item.bvid)">加入</span>
                     </div>
                 </div>
+                <div v-if="data.length == 0" class="no_data">暂无数据</div>
             </div>
         </div>
         <span slot="footer" class="dialog-footer">
-            <!-- <el-button @click="aiGet" type="primary">重新生成</el-button> -->
-            <!-- <el-button @click="confirm" type="primary">确 定</el-button> -->
             <el-button @click="close">关 闭</el-button>
         </span>
     </el-dialog>
@@ -40,6 +41,7 @@
 
 <script>
 import { v4 as uuidv4 } from "uuid";
+import _ from "lodash";
 
 export default {
     components: {
@@ -82,31 +84,16 @@ export default {
             loading: false,
             url: "",
             data: [],
-            uJson: {}
+            uJson: {},
+            navActive: 0
         }
     },
     watch: {
         dialogVisibleAiCreateVideo(newValue, oldValue) {
             if (newValue) {
-                // if (this.radio == 0) {
-                if (this.courseState == 4) {
-                    this.detail = this.courseName
-                    this.aiGet()
-                } else if (this.courseState == 5) {
-                    // this.detail = this.unitJson[0].chapterInfo[0].taskJson[this.lineCount].task.replace("任务"+(this.lineCount+1)+":","")
-                    this.againEva()
-                }
-                // }
-                // if (this.radio == 1) {
-                //     this.detail = this.aiJson.word
-                // }
-                // if (this.radio == 2) {
-                //     this.detail = this.aiJson.video
-                // }
-                // this.loading = false
-
-                // this.aiGet()
-                // this.againEva()
+                this.searchA = ""
+                this.data = []
+                this.againEva()
             }
         },
     },
@@ -197,8 +184,12 @@ export default {
             let _this = this
             return new Promise((resolve, reject) => {
                 this.ajax.post(`https://gpt4.cocorobo.cn/get_network_search`, {
-                    engine: "bilibili",
-                    keyword: msg
+                    engine: "bilibiliNew",
+                    keyword: msg,
+                    page: 1,
+                    page_size: 20,
+                    order: this.navActive,
+                    duration: 0,
                 }).then(response => {
                     console.log(response);
                     // _this.data = [..._this.data,...response.data.FunctionResponse]
@@ -210,31 +201,46 @@ export default {
                     });
             });
         },
-        async searchA(){
-            let _this = this
-            if(!_this.detail){
-                _this.$message.error("请输入关键字")
+        navClick(item) {
+            if(this.navActive == item){
                 return
             }
-            _this.loading = true
-            let _content = ""
-            if(_this.detail.split(",").length>1){
-                _content = _this.detail.split(",")
-            }else{
-                _content = _this.detail.split(",")
-            }
-            _this.data = []
-            for (var a = 0; a < _content.length; a++) {
-                let _data = await _this.aiGet2(_content[a])
-                _this.data = [..._this.data, ..._data]
-            }
-            _this.data = _this.data.sort(
-                function (a, b) {
-                    return b.play - a.play;
+            this.navActive = item
+            this.searchA()
+        },
+        async searchA(){
+            let _this = this
+            try {
+                if(!_this.detail){
+                    _this.$message.error("请输入关键字")
+                    return
+                }
+                _this.loading = true
+                let _content = ""
+                if(_this.detail.split(",").length>1){
+                    _content = _this.detail.split(",")
+                }else{
+                    _content = _this.detail.split(",")
                 }
-            );
-            _this.againEva2();
-            // _this.loading = false
+                _this.data = []
+                let data2 = []
+                for (var a = 0; a < _content.length; a++) {
+                    let _data = await _this.aiGet2(_content[a])
+                    data2[a] = _data
+                }
+                _this.data = _.flatMap(_.zip(...data2), (pair) => pair.filter(value => value !== undefined))
+                // _this.data = _this.data.sort(
+                //     function (a, b) {
+                //         return b.play - a.play;
+                //     }
+                // );
+                _this.againEva2();
+                // _this.loading = false
+            } catch (error){
+                console.log(error);
+                _this.loading = false
+            }
+            
         },
         againEva() {
             let _this = this
@@ -265,23 +271,29 @@ export default {
                             _content = content.split(",")
                         }
                         _this.data = []
+                        let data2 = []
                         for (var a = 0; a < _content.length; a++) {
                             let _data = await _this.aiGet2(_content[a])
-                            _this.data = [..._this.data, ..._data]
+                            data2[a] = _data
                         }
-                        _this.data = _this.data.sort(
-                            function (a, b) {
-                                return b.play - a.play;
-                            }
-                        );
+                        _this.data = _.flatMap(_.zip(...data2), (pair) => pair.filter(value => value !== undefined))
+                        // _this.data = _this.data.sort(
+                        //     function (a, b) {
+                        //         return b.play - a.play;
+                        //     }
+                        // );
                         _this.againEva2();
+                    }else {
+                        _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请自行搜索关键词")
+                        _this.loading = false
                     }
                     // _this.loading = false
 
                 })
                 .catch((error) => {
                     console.log(error);
-                    _this.loading = true
+                    _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请自行搜索关键词")
+                    _this.loading = false
                 });
         },
         againEva2() {
@@ -342,17 +354,31 @@ export default {
                 })
                 .catch((error) => {
                     console.log(error);
-                    _this.loading = true
+                    // _this.$message.error("哎呀,请求太多了,服务器忙不过来了,请自行搜索关键词")
+                    _this.loading = false
                 });
         },
     },
+    mounted () {
+        
+    },
 }
 </script>
 
 <style scoped>
+@media screen and (max-width: 1080px) {
+.video_box {
+    width: calc(100% / 3 - 10px) !important;
+  }
+}
+@media screen and (max-width: 760px) {
+.video_box {
+    width: calc(100% / 2 - 10px) !important;
+  }
+}
 .dialog_diy>>>.el-dialog {
     height: auto;
-    margin: 15vh auto 0 !important;
+    margin: 50px auto 0 !important;
 }
 
 .dialog_diy>>>.el-dialog__header {
@@ -454,16 +480,18 @@ export default {
 
 .Box {
     width: 100%;
-    height: calc(100% - 50px);
+    height: 500px;
     overflow: auto;
     display: flex;
     flex-direction: row;
     justify-content: flex-start;
     flex-wrap: wrap;
+    padding: 5px;
+    box-sizing: border-box;
 }
 
 .video_box {
-    width: calc(100% / 2 - 10px);
+    width: calc(100% / 4 - 10px);
     /* overflow: hidden; */
     margin-right: 10px;
     display: flex;
@@ -479,12 +507,47 @@ export default {
 
 .video_box>.detail {
     color: #cecece;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 3; /* 显示3行文本 */
+    overflow: hidden;
+    text-overflow: ellipsis; /* 超出部分显示点点点 */
+    margin: 0 0 5px;
 }
 
 .video_box>.name {
     color: #000;
     margin: 5px 0;
     height: 32px;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 2; /* 显示3行文本 */
+    overflow: hidden;
+    text-overflow: ellipsis; /* 超出部分显示点点点 */
+}
+
+.video_box>.author{
+    margin: 0 0 5px;
+    width: 100%;
+    display: block;
+    overflow: hidden;
+    text-overflow: ellipsis; /* 超出部分显示点点点 */
+    white-space: nowrap;
+}
+
+.video_box>.tag{
+    display: flex;
+    flex-wrap: wrap;
+    margin-top: auto;
+}
+
+.video_box>.tag>span{
+    background-color: #007bff;
+    color: white;
+    padding: 5px 10px;
+    border-radius: 15px;
+    font-size: 0.9em;
+    margin: 0 0 5px 5px;
 }
 
 .btn {
@@ -492,7 +555,7 @@ export default {
     height: 35px;
     display: flex;
     align-items: center;
-    margin-top: auto;
+    /* margin-top: auto; */
 }
 
 .btn>span:hover {
@@ -522,4 +585,37 @@ export default {
     box-sizing: border-box;
     border-radius: 5px;
 }
+
+
+.nav_box {
+    display: flex;
+    margin-bottom: 10px;
+    align-content: center;
+}
+
+.nav_box .nav{
+    padding: 8px 10px;
+    color: #060e17;
+    border-radius: 5px;
+    cursor: pointer;
+}
+
+.nav_box .nav.active{
+    background: #eef3fb;
+    font-weight: bold;
+    color: #0061ff;
+}
+
+.nav_box .nav + .nav{
+    margin-left: 20px;
+}
+
+.no_data{
+    height: 500px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    height: 500px;
+}
 </style>

+ 1 - 1
src/components/pages/pocAiClassroom/chatArea.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="pocAi">
     <div class="pa_background">
-      <img :src="require('../../../assets/icon/pocAiClassroom/bg1.png')" />
+      <img :src="require('../../../assets/icon/pocAiClassroom/bg2.png')" />
     </div>
     <div class="pa_documentArea" ref="documentAreaRef" v-show="showFileArea">
       <div

+ 1 - 1
src/components/pages/pocAiClassroom/doTask.vue

@@ -704,7 +704,7 @@ export default {
       ],
       taskMessage: {
         chapter: "第一章",
-        grade: "八年级",
+        grade: "中二",
         semester: "上学期",
         edition: "人教版",
         subject: "物理",

+ 79 - 91
src/components/pages/pocAiClassroom/index.vue

@@ -279,28 +279,49 @@ export default {
 					personality:"心思细腻,能够敏锐捕捉到别人的需求,喜欢支持和鼓励他人,富有耐心6",  
         }
       ],
-      gradeList: [
-        "一年级",
-        "二年级",
-        "三年级",
-        "四年级",
-        "五年级",
-        "六年级",
-        "七年级",
-        "八年级",
-        "九年级"
-      ],
+			gradeList: ['小一', '小二', '小三', '小四', '小五', '小六', '中一', '中二', '中三','中四','中五','中六'],
       subjectList: [
-        { value: 0, label: "语文" },
-        { value: 1, label: "数学" },
-        { value: 2, label: "英语" },
-        { value: 3, label: "物理" },
-        { value: 4, label: "化学" },
-        { value: 5, label: "生物" },
-        { value: 6, label: "历史" },
-        { value: 7, label: "地理" },
-        { value: 8, label: "政治" }
+        // { value: 0, label: '语文' },
+        // { value: 1, label: '数学' },
+        // { value: 2, label: '英语' },
+        // { value: 3, label: '物理' },
+        // { value: 4, label: '化学' },
+        // { value: 5, label: '生物' },
+        // { value: 6, label: '历史' },
+        // { value: 7, label: '地理' },
+        // { value: 8, label: '政治' }
+				{ value: 0, label: '中國語文' },
+        { value: 1, label: '英國語文 ' },
+        { value: 2, label: '數學' },
+        { value: 3, label: '公民與社會發展' },
+        { value: 4, label: '科學' },
+        { value: 5, label: '物理' },
+        { value: 6, label: '化學' },
+        { value: 7, label: '生物' },
+        { value: 8, label: '中國歷史' }
       ],
+      // gradeList: [
+      //   "一年级",
+      //   "二年级",
+      //   "三年级",
+      //   "四年级",
+      //   "五年级",
+      //   "六年级",
+      //   "七年级",
+      //   "八年级",
+      //   "九年级"
+      // ],
+      // subjectList: [
+      //   { value: 0, label: "语文" },
+      //   { value: 1, label: "数学" },
+      //   { value: 2, label: "英语" },
+      //   { value: 3, label: "物理" },
+      //   { value: 4, label: "化学" },
+      //   { value: 5, label: "生物" },
+      //   { value: 6, label: "历史" },
+      //   { value: 7, label: "地理" },
+      //   { value: 8, label: "政治" }
+      // ],
       editionList: [
         { value: 0, label: "人教版" },
         { value: 1, label: "教科版" },
@@ -315,169 +336,136 @@ export default {
       ],
       classList: [
         {
-          title: "第一章",
+          title: '第一章:科學入門',
           allClass: [
             {
-              title: "长度和时间的测量",
+              title: '學習科學',
               type: 0,
               isComplete: true,
               subject: 0,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741724834676182.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741724834676182.png'
             },
             {
-              title: "运动的描述",
+              title: '科學的實踐',
               type: 0,
               subject: 0,
               isComplete: true,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731724834767532.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731724834767532.png'
             },
             {
-              title: "运动的快慢",
+              title: '實驗室安全',
               type: 0,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png'
             },
             {
-              title: "测量平均速度",
+              title: '實驗室儀器及基本實驗技巧',
               type: 0,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751724834771676.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751724834771676.png'
             },
             {
-              title: "单元测试",
+              title: '綜合練習',
               type: 1,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png'
             }
           ]
         },
         {
-          title: "第二章",
+          title: '第二章:水',
           allClass: [
             {
-              title: "长度和时间的测量",
+              title: '水的物熊變化',
               type: 0,
               subject: 0,
               isComplete: true,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8761724834777931.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8761724834777931.png'
             },
             {
-              title: "运动的描述",
+              title: '水循環',
               type: 0,
               subject: 0,
               isComplete: true,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8771724834845597.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8771724834845597.png'
             },
             {
-              title: "运动的快慢",
+              title: '溶解',
               type: 0,
               subject: 0,
               isComplete: true,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8781724834847977.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8781724834847977.png'
             },
             {
-              title: "测量平均速度",
+              title: '水的淨化',
               type: 0,
               subject: 0,
               isComplete: true,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8791724834873373.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8791724834873373.png'
             },
             {
-              title: "长度和时间的测量",
+              title: '食水的進一步處理',
               type: 0,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8761724834777931.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8761724834777931.png'
             },
             {
-              title: "运动的描述",
+              title: '節約用水和水污染',
               type: 0,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8771724834845597.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8771724834845597.png'
             },
             {
-              title: "运动的快慢",
-              type: 0,
-              subject: 0,
-              isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png"
-            },
-            {
-              title: "测量平均速度",
-              type: 0,
-              subject: 0,
-              isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%87101724834875748.png"
-            },
-            {
-              title: "单元测试",
+              title: '綜合練習',
               type: 1,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png"
-            }
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png'
+            },
           ]
         },
         {
-          title: "第三章",
+          title: '第三章:观察生物',
           allClass: [
             {
-              title: "长度和时间的测量",
+              title: '生物',
               type: 0,
               isComplete: true,
               subject: 0,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741724834676182.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741724834676182.png'
             },
             {
-              title: "运动的描述",
+              title: '生物的分類',
               type: 0,
               subject: 0,
               isComplete: true,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731724834767532.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731724834767532.png'
             },
             {
-              title: "运动的快慢",
+              title: '檢索表',
               type: 0,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png'
             },
             {
-              title: "测量平均速度",
+              title: '生物多樣性',
               type: 0,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751724834771676.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751724834771676.png'
             },
             {
-              title: "单元测试",
+              title: '綜合練習',
               type: 1,
               subject: 0,
               isComplete: false,
-              image:
-                "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png"
+              image: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png'
             }
           ]
         }

+ 2 - 1
src/components/pages/pocAiClassroom/pocClass.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="chatArea">
-		<iframe ref="iframeRef" class="ca_iframe" allow="camera *; microphone *;display-capture;midi;encrypted-media;" src="https://beta.cloud.cocorobo.cn/aigpt/#/js"></iframe>
+		<iframe ref="iframeRef" class="ca_iframe" allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="src"></iframe>
   </div>
 </template>
 
@@ -13,6 +13,7 @@ export default {
       userId: this.$route.query.userid,
       org: this.$route.query.org,
       oid: this.$route.query.oid,
+			src:"https://beta.cloud.cocorobo.cn/aigpt/#/js?active_role=0"
     };
   },
   methods: {

+ 11 - 2
src/components/pages/test/add/addTest.vue

@@ -33,7 +33,7 @@
         <el-dialog title="发布表单" :visible.sync="dialogVisible" width="550px" @close="dialogVisible = false" class="eld">
             <setInfo :oid="oid" :org="org" :steps.sync="steps" :title.sync="title" :testType.sync="testType"
                 :see.sync="see" :cJson.sync="cJson" :typeid.sync="typeid" :brief.sync="brief" :juri.sync="juri"
-                :overDate.sync="overDate" :juriList.sync="juriList" :typeInfo.sync="typeInfo">
+                :overDate.sync="overDate" :juriList.sync="juriList" :typeInfo.sync="typeInfo" :origin="origin">
             </setInfo>
             <span slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="updateWork(3)">发 布 </el-button>
@@ -72,10 +72,15 @@ export default {
             overDate: "",
             juriList: [],
             typeInfo: [],
-            dialogVisible: false
+            dialogVisible: false,
+            origin: ""
         }
     },
     watch: {
+        cid(newValue, oldValue){
+            let url = "https://beta.cloud.cocorobo.cn/#/testDetail?testid=" + newValue
+            this.origin = url
+        },
         steps(newValue, oldValue) {
             if (!this.title) {
                 this.$message.error("请补充填写课程名称");
@@ -397,6 +402,10 @@ export default {
         },
     },
     mounted() {
+        if(this.cid){
+            let url = "https://beta.cloud.cocorobo.cn/#/testDetail?testid=" + this.cid
+            this.origin = url
+        }
         this.getTypeInfo();
     },
 }

+ 140 - 2
src/components/pages/test/add/setInfo/index.vue

@@ -76,6 +76,25 @@
                                     </el-select>
                                 </div>
                             </div>
+
+                            <div class="url_box">
+                                <div class="title">
+                                    分享方式
+                                </div>
+                                <div class="url">
+                                    <el-tooltip :content="origin" placement="top" effect="dark">
+                                        <!-- content to trigger tooltip here -->
+                                        <span>{{ origin }}</span>
+                                    </el-tooltip>
+                                    <span @click="copy" :data-clipboard-text="copyText" class="tag-read">复制链接</span>
+                                </div>
+                            </div>
+                            <div class="qrcode_box">
+                                <div class="qrcode">
+                                    <span class="qrcodeUrl" ref="qrCodeUrl"></span>
+                                    <span @click="downQr">下载二维码</span>
+                                </div>
+                            </div>
                             <!-- <div class="whiteBg" style="border-radius: 0; margin-top: 0px">
                                 <div class="c_info_title" style="padding: 0 0 15px;margin: 0 auto 0 0;">表单描述</div>
                                 <div style="width: 100%;box-sizing: border-box;">
@@ -128,6 +147,8 @@
 <script>
 import manualCreate from './manualCreated.vue';
 import aiCreate from './aiCreate.vue';
+import Clipboard from "clipboard";
+import QRCode from "qrcodejs2";
 export default {
     components: {
         manualCreate,
@@ -172,6 +193,9 @@ export default {
         },
         typeInfo: {
             type: Array
+        },
+        origin: {
+            type: String
         }
     },
     data() {
@@ -203,6 +227,7 @@ export default {
             teaType: [],
             teacherArray:[],
             dialogTeacher: false,
+            copyText: "",
         }
     },
     computed: {
@@ -250,11 +275,14 @@ export default {
             immediate: true,
             deep: true,
             async handler(newValue, oldValue) {
-                if(newValue){
+                if(newValue.length){
                     await this.getTestWorkTeacherCount()
                 }
             },
         },
+        origin(){
+            this.setQr()
+        }
     },
     methods: {
         async getTestWorkTeacherCount(){
@@ -472,7 +500,43 @@ export default {
         },
         checkTeacher(){
             this.dialogTeacher = true
-        }
+        },
+        setQr() {
+            setTimeout(() => {
+                this.$refs.qrCodeUrl.innerHTML = "";
+                var qrcode = new QRCode(this.$refs.qrCodeUrl, {
+                    text: this.origin, // 需要转换为二维码的内容
+                    width: 100,
+                    height: 100,
+                    colorDark: "#000000",
+                    colorLight: "#ffffff",
+                    correctLevel: QRCode.CorrectLevel.H,
+                });
+            }, 500);
+        },
+        downQr() {
+
+            // 创建一个虚拟链接,并将 canvas 转换为图片文件
+            const link = document.createElement('a');
+            link.href = this.$refs.qrCodeUrl.querySelector('img').src;
+            link.download = 'qrcode.png';
+
+            // 模拟点击链接进行下载
+            link.click();
+        },
+        copy() {
+            this.copyText = this.origin;
+            var clipboard = new Clipboard(".tag-read");
+            clipboard.on("success", (e) => {
+                this.$message.success("复制成功");
+                console.log("复制成功");
+                clipboard.destroy(); // 释放内存
+            });
+            clipboard.on("error", (e) => {
+                console.log("不支持复制,该浏览器不支持自动复制");
+                clipboard.destroy(); // 释放内存
+            });
+        },
     },
     async mounted() {
         this.courseTypeId = this.depthCopy(this.testType)
@@ -491,6 +555,7 @@ export default {
         this.getClass2();
         await this.getTestWorkTeacherCount()
         console.log('getTestWorkTeacherCount')
+        this.setQr();
     }
 }
 </script>
@@ -810,4 +875,77 @@ export default {
 .people_name2>>>.el-checkbox__label {
     width: calc(100% - 130px);
 }
+
+
+.url_box {
+    margin-bottom: 20px;
+}
+
+.qrcode_box {
+    margin-bottom: 20px;
+}
+
+.url_box>.url {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    border: 1px solid #e7e7e7;
+    border-radius: 4px;
+    height: 35px;
+    padding: 0 7px;
+    box-sizing: border-box;
+}
+
+.url_box>.url>span {
+    font-size: 16px;
+    color: #000000;
+}
+
+.url_box>.url>span:nth-child(1) {
+    width: 100%;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+.url_box>.url>span:nth-child(2) {
+    margin-left: auto;
+    border-left: 1px solid #e7e7e7;
+    padding-left: 7px;
+    cursor: pointer;
+    min-width: fit-content;
+}
+
+.url_box>.title,
+.qrcode_box>.title {
+    font-weight: bold;
+    font-size: 14px;
+    margin-bottom: 10px;
+    color:#000;
+}
+
+.qrcode_box>.qrcode {
+    padding: 7px;
+    border: 1px solid #e7e7e7;
+    width: fit-content;
+    border-radius: 4px;
+    display: flex;
+    align-items: flex-end;
+}
+
+.qrcode_box>.qrcode>span:nth-child(1) {
+    width: 100px;
+    display: block;
+    height: 100px;
+}
+
+.qrcode_box>.qrcode>span:nth-child(2) {
+    background: #f0f2f5;
+    padding: 7px 15px;
+    font-size: 16px;
+    border-radius: 4px;
+    cursor: pointer;
+    color: #000;
+    margin-left: 7px;
+}
 </style>

+ 1 - 1
src/components/pages/test/check/index.vue

@@ -639,7 +639,7 @@
             <div v-for="(i,index) in worksArray"  :key="i.id" class="isDesktopTable_content">
               <div class="isDTitle CutCss">
                 <div style="font-size: 16px;font-weight: 600;">{{ i.name }}</div>
-                <div :style="'font-size: 14px',i.cut?'color:rgba(54, 129, 252, 1)':'color: rgba(0, 0, 0, 0.6);'">{{ i.time }}</div>
+                <div :style="'font-size: 14px'+i.cut?'color:rgba(54, 129, 252, 1)':'color: rgba(0, 0, 0, 0.6);'">{{ i.time }}</div>
                 <div @click="i.cut=!i.cut">
                   <img v-if="!i.cut" src="../../../../assets/icon/fileIcon/downImg.png" alt="">
                   <img v-else src="../../../../assets/icon/fileIcon/upImg.png" alt="">

+ 2 - 2
src/config/config.js

@@ -10,10 +10,10 @@ const store = new Vuex.Store({
         userInfo: {},
         nCount: 0,
         report:"",
-        api: 'https://pbl.cocorobo.cn/api/pbl/',
+        // api: 'https://pbl.cocorobo.cn/api/pbl/',
         socket: "https://poll.cocorobo.cn",
         // socket: "http://localhost:1473",
-        // api: 'http://localhost:7003/api/pbl/',
+        api: 'http://localhost:7003/api/pbl/',
     },
 
     mutations: {

Неке датотеке нису приказане због велике количине промена