lsc 1 rok temu
rodzic
commit
a693081e39

+ 115 - 33
src/components/pages/aiAddCourse/addCourse.vue

@@ -919,11 +919,11 @@
                 <div class="c_info_title">
                   课程目标
                   <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
-                    <button class="c_pub_button_confirm" style="margin: 0px 5px 0px auto;"
+                    <button class="c_pub_button_confirm" style="margin: 0px 20px 0px auto;"
                       @contextmenu.prevent="openAiDialog(1, 'aitargetTextDetail2',1)"
                       @click="openAiDialog(2, 'aitargetTextDetail2',1)">生成目标</button>
                   </el-tooltip>
-                  <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
+                  <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-show="false">
                     <button class="c_pub_button_confirm" style="margin: 0 20px 0 0;"
                       @contextmenu.prevent="openAiDialog(1, 'aitargetTextDetail3',1)"
                       @click="openAiDialog(2, 'aitargetTextDetail3',1)">生成目标2</button>
@@ -15814,6 +15814,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -16032,6 +16033,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -16064,6 +16066,8 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
                     dArray = JSON.parse(match[0].replace(/\n/g, '').replace(/\s{2,}/g, ' '));
 
                 } catch (error) {
+                  _this.$message.error('哎呀,网络波动了...小可正在为您重新生成中...')
+                  _this.aiGet2(messages, callback);
                   console.log("error_________________" + error);
                 }
                 console.log("error_________________" + error);
@@ -16296,6 +16300,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -16551,6 +16556,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         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)
@@ -16843,6 +16849,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -17103,6 +17110,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -17308,6 +17316,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[task].taskDetail3.replaceAll('#','')
           session_name: uuidv4(),
           userId: this.userid,
           file_ids: fileid.length ? [...fileid] : '',
+          model: 'gpt-4o-2024-08-06',
         }
         this.ajax
           .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -17466,6 +17475,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[_this.taskCount].taskDetail3.replace
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -17702,6 +17712,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[_this.taskCount].taskDetail3.replace
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
@@ -17935,6 +17946,7 @@ ${msg}
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18095,6 +18107,7 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18222,6 +18235,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18374,6 +18388,7 @@ ${_this.aiCallBack.taskDetail}
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18519,6 +18534,7 @@ ${msg} 输出格式和内容要求参考#格式与要求
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18669,6 +18685,7 @@ ${msg} 优化评价维度和维度描述,输出格式和内容要求参考# 
         session_name: uuidv4(),
         userId: _this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18812,6 +18829,7 @@ ${_text2}`
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -18966,6 +18984,7 @@ ${(_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || _this.templatei
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19166,6 +19185,7 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19331,6 +19351,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19495,6 +19516,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19645,6 +19667,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19751,6 +19774,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19884,6 +19908,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         userId: _this.userid,
         uid: _uuid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       // let params = JSON.stringify({
       //     message: {
@@ -19938,7 +19963,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         this.ruleLoading[i][k] = true
       }
       let message = `NOTICE
-Role: 你是一个专业的项目式学习导师,你要根据<评价维度>和<维度描述>制定具体的评价细则。
+Role: 你是一个专业的项目式学习导师,你要根据制定标准资料中的评价维度和维度描述制定具体的评价细则。
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content.
@@ -19952,40 +19977,94 @@ ${msg}
 维度描述:${this.unitJson[0].chapterInfo[0].taskJson[i].eList[k].detail}
 
 # Format example
-== 0 星,作业内容与作业要求无关;
+== 
+0 星,作业内容与作业要求无关;
 1 星,没有识别问题和需求;
 2 星,问题或需求没有被清晰理解或准确识别;
 3 星,问题或需求的一部分被识别;
 4 星,问题或需求的大部分被识别;
-5 星,问题或需求都被识别。 ==
+5 星,问题或需求都被识别。 
+==
 
  `
-      let params = {
-        // "model": "Chat",
-        model: "gpt-4o",
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [
-          {
-            content: message.replaceAll("\n", " ").replaceAll("*", ""),
-            role: "user"
-          }
-        ],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: ""
-      };
+      // let params = {
+      //   // "model": "Chat",
+      //   model: 'gpt-4o-2024-08-06',
+      //   // model: "gpt-4o",
+      //   temperature: 0,
+      //   max_tokens: 4096,
+      //   top_p: 1,
+      //   frequency_penalty: 0,
+      //   presence_penalty: 0,
+      //   messages: [
+      //     {
+      //       content: message.replaceAll("\n", " ").replaceAll("*", ""),
+      //       role: "user"
+      //     }
+      //   ],
+      //   stream: false,
+      //   uid: this.userid,
+      //   mind_map_question: ""
+      // };
+
+      // this.ajax
+      //   .post("https://gpt4.cocorobo.cn/chat", params)
+      //   .then(response => {
+      //     let data = response.data.FunctionResponse;
+      //     console.log("data", data);
+      //     if (data.choices && data.choices.length && data.choices[0].message) {
+      //       let content = data.choices[0].message.content;
+
+      //       var regex = new RegExp('==([^=]+)==');
+      //       let match = content.match(regex);
+      //       if (match) {
+      //         content = match[1].trim().replaceAll(' ', '');
+      //         // 获取匹配到的内容并去除两端空格 
+      //         console.log('contentInsideDoubleEquals', content);
+      //         if (content.indexOf('0星') == -1 || content.indexOf('2星') == -1 || content.indexOf('3星') == -1 || content.indexOf('4星') == -1 || content.indexOf('5星') == -1) {
+      //           console.log("未有星级。");
+      //           this.againEva(msg, i, k)
+      //           return
+      //         }
+      //         //  return 
+      //       } else {
+      //         console.log("未找到匹配的内容。");
+      //         this.againEva(msg, i, k)
+      //         return
+      //       }
 
+      //       let elist = JSON.parse(JSON.stringify(this.unitJson[0].chapterInfo[0].taskJson[i].eList[k]))
+      //       // this.unitJson[0].chapterInfo[0].taskJson[i].eList[k].rule=JSON.parse(JSON.stringify(content.replaceAll("#", "")))
+      //       elist.rule = JSON.parse(JSON.stringify(content.replaceAll("#", "")))
+      //       this.$set(this.unitJson[0].chapterInfo[0].taskJson[i].eList, k, elist)
+      //       this.$forceUpdate();
+      //       this.ruleLoading[i][k] = false
+
+      //     }else{
+      //       this.ruleLoading[i][k] = false
+      //     }
+      //   })
+      //   .catch(error => {
+      //     console.log(error);
+      //     this.ruleLoading[i][k] = false
+      //   });
+      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/chat", params)
-        .then(response => {
-          let data = response.data.FunctionResponse;
-          console.log("data", data);
-          if (data.choices && data.choices.length && data.choices[0].message) {
-            let content = data.choices[0].message.content;
+        .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;
 
             var regex = new RegExp('==([^=]+)==');
             let match = content.match(regex);
@@ -20011,14 +20090,16 @@ ${msg}
             this.$set(this.unitJson[0].chapterInfo[0].taskJson[i].eList, k, elist)
             this.$forceUpdate();
             this.ruleLoading[i][k] = false
-
-          }else{
+            this.$message.success(`任务${i+1}评价${k+1}细则生成成功`)
+          }else {
             this.ruleLoading[i][k] = false
+
           }
+          
         })
-        .catch(error => {
-          console.log(error);
+        .catch((error) => {
           this.ruleLoading[i][k] = false
+          console.log(error);
         });
     },
     async aiSearchFile(messages, callback) {
@@ -20148,6 +20229,7 @@ ${msg}
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: fileid.length ? [...fileid] : '',
+        model: 'gpt-4o-2024-08-06',
       }
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)

+ 27 - 26
src/components/pages/aiAddCourse/aiBox.vue

@@ -387,35 +387,36 @@ export default {
         this.$nextTick(() => {
           this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
         });
-        // let params = JSON.stringify({
-        //   model: "gpt-3.5-turbo",
-        //   temperature: 0,
-        //   max_tokens: 4096,
-        //   top_p: 1,
-        //   frequency_penalty: 0,
-        //   presence_penalty: 0,
-        //   messages: [{ role: "user", content: message }],
-        //   uid: _uuid,
-        //   mind_map_question: ""
-        // });
         let params = JSON.stringify({
-          message: {
-              anthropic_version: "bedrock-2023-05-31",
-              max_tokens: 4096,
-              temperature: 0,
-              top_p: 1,
-              messages:  [{
-                  "role": "user",
-                  "content": message
-              }] , 
-          },
+          // model: "gpt-3.5-turbo",
+          model: 'gpt-4o-2024-08-06',
+          temperature: 0,
+          max_tokens: 4096,
+          top_p: 1,
+          frequency_penalty: 0,
+          presence_penalty: 0,
+          messages: [{ role: "user", content: message }],
           uid: _uuid,
-          model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+          mind_map_question: ""
         });
+        // let params = JSON.stringify({
+        //   message: {
+        //       anthropic_version: "bedrock-2023-05-31",
+        //       max_tokens: 4096,
+        //       temperature: 0,
+        //       top_p: 1,
+        //       messages:  [{
+        //           "role": "user",
+        //           "content": message
+        //       }] , 
+        //   },
+        //   uid: _uuid,
+        //   model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+        // });
         this.courseText = "";
 
-        // this.ajax.post("https://gpt4.cocorobo.cn/chat", params).then(res => {
-        this.ajax.post("https://claude3.cocorobo.cn/chat", params).then(res => {
+        this.ajax.post("https://gpt4.cocorobo.cn/chat", params).then(res => {
+        // this.ajax.post("https://claude3.cocorobo.cn/chat", params).then(res => {
             if (res.data.FunctionResponse.result == "发送成功") {
             } else {
               this.$message.warning(res.data.FunctionResponse.result);
@@ -428,8 +429,8 @@ export default {
       }
     },
     getAiContent(_uid) {
-      // 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://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      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://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       const md = new MarkdownIt();

+ 1 - 0
src/components/pages/aiAddCourse/aiCreateDialog.vue

@@ -1037,6 +1037,7 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
                 session_name: uuidv4(),
                 userId: this.userid,
                 file_ids: fileid.length ? [...fileid] : "",
+                model: 'gpt-4o-2024-08-06',
             };
             _this.loading = true;
             this.ajax

+ 152 - 39
src/components/pages/aiAddCourse/aiCreateVideoDialog.vue

@@ -3,10 +3,10 @@
         :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="aiGet()"></el-input>
-                <div class="search_img" @click="aiGet" style="right: 10px">
-                <img src="../../../assets/icon/search.png" alt />
+                <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">
@@ -19,13 +19,13 @@
                         <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">
+                <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> 
+                    <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>
+                        <span @click="checkUrl(item.title, item.bvid)">加入</span>
                     </div>
                 </div>
             </div>
@@ -39,6 +39,7 @@
 </template>
 
 <script>
+import { v4 as uuidv4 } from "uuid";
 
 export default {
     components: {
@@ -88,10 +89,12 @@ export default {
         dialogVisibleAiCreateVideo(newValue, oldValue) {
             if (newValue) {
                 // if (this.radio == 0) {
-                if(this.courseState == 4){
+                if (this.courseState == 4) {
                     this.detail = this.courseName
-                }else if(this.courseState == 5){
-                    this.detail = this.unitJson[0].chapterInfo[0].taskJson[this.lineCount].task.replace("任务"+(this.lineCount+1)+":","")
+                    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) {
@@ -101,7 +104,9 @@ export default {
                 //     this.detail = this.aiJson.video
                 // }
                 // this.loading = false
-                this.aiGet()
+
+                // this.aiGet()
+                // this.againEva()
             }
         },
     },
@@ -113,11 +118,11 @@ export default {
         close() {
             this.$emit('update:dialogVisibleAiCreateVideo', false)
         },
-        openUrl(url){
+        openUrl(url) {
             // window.open('https://www.youtube.com/embed/'+url)
             window.open(`//www.bilibili.com/video/${url}`)
         },
-        checkUrl(name,id) {
+        checkUrl(name, id) {
             let json = {
                 name: "链接",
                 title: name.replace(/<[^>]*>?/gm, ''),
@@ -158,21 +163,125 @@ export default {
         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=>{
+            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.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);
-                    _this.data = response.data.FunctionResponse
+                    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.loading = false
 
                 })
                 .catch((error) => {
-                    _this.loading = false
                     console.log(error);
+                    _this.loading = true
                 });
         },
-
     },
 }
 </script>
@@ -261,25 +370,26 @@ export default {
     color: #000;
 }
 
-.inputC >>> .el-input__inner{
+.inputC>>>.el-input__inner {
     padding: '0 35px 0 15px'
 }
+
 .search_img {
-  width: 20px;
-  height: 20px;
-  position: absolute;
-  right: 10px;
-  top: 50%;
-  transform: translateY(-50%);
+    width: 20px;
+    height: 20px;
+    position: absolute;
+    right: 10px;
+    top: 50%;
+    transform: translateY(-50%);
 }
 
 .search_img>img {
-  width: 100%;
-  height: 100%;
+    width: 100%;
+    height: 100%;
 }
 
 
-.Box{
+.Box {
     width: 100%;
     height: calc(100% - 50px);
     overflow: auto;
@@ -288,6 +398,7 @@ export default {
     justify-content: flex-start;
     flex-wrap: wrap;
 }
+
 .video_box {
     width: calc(100% / 2 - 10px);
     /* overflow: hidden; */
@@ -297,21 +408,23 @@ export default {
     margin-bottom: 15px;
     cursor: pointer;
 }
-.video_box > img{
+
+.video_box>img {
     height: 200px;
     object-fit: cover;
 }
 
-.video_box > .detail{
+.video_box>.detail {
     color: #cecece;
 }
-.video_box > .name{
+
+.video_box>.name {
     color: #000;
     margin: 5px 0;
     height: 32px;
 }
 
-.btn{
+.btn {
     width: 100%;
     height: 35px;
     display: flex;
@@ -319,11 +432,11 @@ export default {
     margin-top: auto;
 }
 
-.btn > span:hover{
+.btn>span:hover {
     background: #4087f1;
 }
 
-.btn > span{
+.btn>span {
     width: 100%;
     height: 100%;
     background: #3681fc;
@@ -336,11 +449,11 @@ export default {
     justify-content: center;
 }
 
-.btn > span + span{
+.btn>span+span {
     margin-left: 10px;
 }
 
-.video_box2{
+.video_box2 {
     box-shadow: 0px 0px 4px 2px #d2d2d282;
     padding: 5px 10px 10px;
     box-sizing: border-box;

+ 97 - 19
src/components/pages/teacherOffice/index.vue

@@ -7,9 +7,21 @@
                 border-radius: 5px;
               ">
       <div class="pb_head top">
-        <span>教研室管理</span>
+        <div style="display: flex;align-items: center;">
+          <span class="sub_head">教研室管理</span>
+          <span class="subClick" @click="
+            goTo(
+              '/teacherType?userid=' +
+              userid +
+              '&oid=' +
+              oid +
+              '&org=' +
+              org
+            )
+            ">教研室类型管理</span>
+        </div>
         <div class="student_button" style="border-radius: 4px;">
-          <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加教研室</el-button>
+          <el-button type="primary" class="bgColor" @click="openAddTeacher">添加教研室</el-button>
         </div>
       </div>
       <div class="student_head">
@@ -41,7 +53,7 @@
             <template slot-scope="scope">
               <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看老师</el-button>
               <!-- <el-button type="primary" size="small" @Sclick="updateG(scope.row.pid, scope.row.id)">修改年级</el-button> -->
-              <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
+              <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name, scope.row.parentid)">修改</el-button>
               <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
             </template>
           </el-table-column>
@@ -232,7 +244,7 @@
         </el-form-item>
         <el-form-item label="教研室类型" :label-width="formLabelWidth">
           <el-select v-model="typeId" placeholder="类型">
-            <el-option v-for="item in options" :key="item.typeId" :label="item.label" :value="item.value"></el-option>
+            <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
           </el-select>
         </el-form-item>
       </el-form>
@@ -261,6 +273,11 @@
         <el-form-item label="教研室名称" :label-width="formLabelWidth">
           <el-input v-model="className1" auto-complete="off" placeholder="请输入教研室..."></el-input>
         </el-form-item>
+        <el-form-item label="教研室类型" :label-width="formLabelWidth">
+          <el-select v-model="typeId2" placeholder="类型">
+            <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible1 = false">取 消</el-button>
@@ -366,13 +383,13 @@ export default {
       gid: "",
       dialogVisibleGrade: false,
       options: [
-        {
-          typeId: 6,
-          label: '教研室'
-        }
+        // {
+        //   typeId: 6,
+        //   label: '教研室'
+        // }
       ],
-      typeId: ""
-
+      typeId: "",
+      typeId2: ""
     };
   },
   created() {
@@ -381,6 +398,7 @@ export default {
     this.getClass2();
     this.selectGrage()
     this.getSchoolName();
+    this.getTeacherType();
   },
   computed: {
     getGrade() {
@@ -414,6 +432,9 @@ export default {
     });
   },
   methods: {
+    goTo(path) {
+      this.$router.push(path);
+    },
     //获取教研室列表
     selectGrage() {
       let params = {
@@ -425,7 +446,29 @@ export default {
           this.grade = res.data[0];
         })
         .catch((err) => {
-          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    //获取教研室分类列表
+    getTeacherType() {
+      let params = {
+        cu: '',
+        oid: this.oid,
+        cn: '',
+        pid: '10'
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacherOfficeType", params)
+        .then((res) => {
+          this.options = res.data[0];
+          this.options.push(
+            {
+              id: '6',
+              name:'教研室'
+            }
+          )
+        })
+        .catch((err) => {
           console.error(err);
         });
     },
@@ -496,9 +539,11 @@ export default {
         })
         .catch(() => { });
     },
-    openUpdate(id, n) {
+    openUpdate(id, n, t) {
       this.classid = id;
       this.className1 = n;
+      this.typeId2 = t;
+      this.getTeacherType();
       this.dialogVisible1 = true;
     },
     //新增教研室
@@ -511,13 +556,14 @@ export default {
         });
         return; // 停止继续执行
       }
-      let params = {
+      let params = [{
         name: this.className,
         oid: this.oid,
         uid: this.userid,
-      };
+        pid: this.typeId,
+      }];
       this.ajax
-        .get(this.$store.state.api + "insertTeacherOffice", params)
+        .post(this.$store.state.api + "insertTeacherOfficeCopy", params)
         .then((res) => {
           if (res.data[0] && res.data[0][0].classname == 1) {
             this.$message({
@@ -543,15 +589,21 @@ export default {
           console.error(err);
         });
     },
+    openAddTeacher(){
+      this.typeId = '6'
+      this.getTeacherType();
+      this.dialogVisible = true
+    },
     //修改教研室
     updateClass() {
       let params = {
         id: this.classid,
         n: this.className1,
         oid: this.oid,
+        pid: this.typeId2,
       };
       this.ajax
-        .get(this.$store.state.api + "updateTeacherOffice", params)
+        .get(this.$store.state.api + "updateTeacherOffice2", params)
         .then((res) => {
           if (res.data[0] && res.data[0][0].classname == 1) {
             this.$message({
@@ -836,18 +888,15 @@ export default {
     },
     //获取教研室列表
     getClass2() {
-      this.isLoading = true;
       let params = {
         oid: this.oid,
       };
       this.ajax
         .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
         .then((res) => {
-          this.isLoading = false;
           this.classJuri = res.data[0];
         })
         .catch((err) => {
-          this.isLoading = false;
           console.error(err);
         });
     },
@@ -1322,4 +1371,33 @@ export default {
   text-overflow: ellipsis;
   white-space: nowrap;
 }
+
+
+.sub_head {
+  position: relative;
+}
+
+.sub_head::after {
+  content: "";
+  width: 100%;
+  background: #5a9cea;
+  height: 2px;
+  position: absolute;
+  left: 0;
+  bottom: -10px;
+}
+
+.subClick {
+  /* font-size: 16px; */
+  font-size: 26px;
+  cursor: pointer;
+  margin-left: 17.5px;
+  /* color: #ab582f; */
+  /* color: #409eff; */
+  color: #999;
+}
+
+.subClick:hover {
+  color: #000;
+}
 </style>

+ 55 - 9
src/components/pages/teacherOffice/teacherType.vue

@@ -7,7 +7,19 @@
                 border-radius: 5px;
               ">
         <div class="pb_head top">
-          <span>教研室类型管理</span>
+          <div style="display: flex;align-items: center;">
+            <span class="subClick" @click="
+              goTo(
+                '/teacherOffice?userid=' +
+                userid +
+                '&oid=' +
+                oid +
+                '&org=' +
+                org
+              )
+              ">教研室管理</span>
+            <span class="sub_head">教研室类型管理</span>
+          </div>
           <div class="student_button" style="border-radius: 4px;">
             <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加教研室类型</el-button>
           </div>
@@ -396,6 +408,9 @@
       });
     },
     methods: {
+      goTo(path) {
+        this.$router.push(path);
+      },
       //获取教研室列表
       selectGrage() {
         let params = {
@@ -407,7 +422,6 @@
             this.grade = res.data[0];
           })
           .catch((err) => {
-            this.isLoading = false;
             console.error(err);
           });
       },
@@ -441,7 +455,7 @@
       },
       searchClass() {
         this.page = 1;
-        this.getType();
+        this.getClass();
       },
       updateG(gid, id) {
         this.gid = gid;
@@ -480,17 +494,18 @@
       },
       //新增教研室
       insertClass() {
-        let params = {
+        let params = [{
           name: this.className,
           oid: this.oid,
           uid: this.userid,
-        };
+          pid: '10',
+        }];
         this.ajax
-          .get(this.$store.state.api + "insertTeacherOffice", params)
+          .post(this.$store.state.api + "insertTeacherOfficeCopy", params)
           .then((res) => {
             if (res.data[0] && res.data[0][0].classname == 1) {
               this.$message({
-                message: "不能与其他教研室名称相同!",
+                message: "不能与其他教研室类型名称相同!",
                 type: "error",
               });
             } else {
@@ -557,7 +572,6 @@
         this.ajax
           .get(this.$store.state.api + "selectTeacherOfficeType",params)
           .then((res) => {
-            this.isLoading = false;
             this.tableData = res.data[0];
             console.log(this.tableData,"tableData在此");
           })
@@ -573,11 +587,12 @@
           cu: "",
           oid: this.oid,
           cn: this.sClassName,
+          pid: '10',
           page: this.page
 
         };
         this.ajax
-          .get(this.$store.state.api + "selectTeacherOffice", params)
+          .get(this.$store.state.api + "selectTeacherofficeTypeLim", params)
           .then((res) => {
             this.isLoading = false;
             this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
@@ -1310,4 +1325,35 @@
     text-overflow: ellipsis;
     white-space: nowrap;
   }
+
+
+  .sub_head {
+  position: relative;
+}
+
+.sub_head::after {
+  content: "";
+  width: 100%;
+  background: #5a9cea;
+  height: 2px;
+  position: absolute;
+  left: 0;
+  bottom: -10px;
+
+}
+
+.subClick {
+  /* font-size: 16px; */
+  font-size: 26px;
+  cursor: pointer;
+  /* color: #ab582f; */
+  /* color: #409eff; */
+  color: #999;
+  margin-right: 17.5px;
+
+}
+
+.subClick:hover {
+  color: #000;
+}
   </style>