Browse Source

Merge branch 'beta'

lsc 3 months ago
parent
commit
9fd03e58f9

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.1039bdcf2d877af640d7d05e649be903.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.d6d47d008c180699b2a1.js></script><script type=text/javascript src=./static/js/app.9fc361454ad4ac51428e.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.a83a20167c9a34486994b55b96a72337.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.d6d47d008c180699b2a1.js></script><script type=text/javascript src=./static/js/app.6795fa93f425c69f9907.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.1039bdcf2d877af640d7d05e649be903.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.1039bdcf2d877af640d7d05e649be903.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.a83a20167c9a34486994b55b96a72337.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.a83a20167c9a34486994b55b96a72337.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.6795fa93f425c69f9907.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.6795fa93f425c69f9907.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


BIN
src/assets/icon/u_op.png


+ 2 - 2
src/components/components/choseWordCloud.vue

@@ -1,10 +1,10 @@
 <template>
-  <div style="display: flex;justify-content: center;align-items: center;">
+  <div style="display: flex;justify-content: center;align-items: center;height: 500px;">
     <div v-if="loading" style="position: relative;">
       <img style="width: 220px;" src="../../assets/icon/course/FrameXK.gif"  alt="">
       <div class="loadCss">小可正在努力加载ing</div>
     </div>
-	  <div  v-if="!loading" class="chart" id="charts_canvas" ref="chartRef"></div>
+	  <div v-if="!loading" class="chart" id="charts_canvas" ref="chartRef"></div>
   </div>
 </template>
 

+ 88 - 4
src/components/components/choseWorksDetailDialog.vue

@@ -40,7 +40,7 @@
 									<span v-else>无</span>
                 </div>
 
-                <span>题目内容</span>
+                <span v-if="![7,1,3].includes(toolType)">题目内容</span>
 
                 <div v-if="[45].includes(toolType) && testJson">
                   <div
@@ -267,8 +267,28 @@
                 </div>
                 <div v-if="[7,1,3].includes(toolType)" class="s_b_m_b_i_m_iframe">
                   <div v-if="[3].includes(toolType)">
-										<iframe></iframe>
+										<iframe
+    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
+    								  src="https://beta.cloud.cocorobo.cn/kityminder-editor/dist/index.html"
+    								  ref="iframeMainMapRef"
+    								></iframe>
                   </div>
+
+									<div v-if="[1].includes(toolType)">
+										<iframe
+    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
+    								  src="https://beta.iwb.cocorobo.cn/"
+    								  ref="iframeWhiteBoardRef"
+    								></iframe>
+									</div>
+
+									<div v-if="[7].includes(toolType)">
+										<iframe
+    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
+    								  :src="`https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=${userId}`"
+    								  ref="iframeThoughtGridRef"
+    								></iframe>
+									</div>
                 </div>
                 <div v-if="[49].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                   <div>
@@ -648,6 +668,8 @@ export default {
     return {
       show: false,
       showType: 0,
+      userId: this.$route.query.userid,
+      courseId:this.$route.query.courseId,
       wordCloudData:[], //词云数据
       dialogVisibleWordCloud:false,
 			showStatisticsType:0,
@@ -978,6 +1000,9 @@ export default {
 				this.changeShowType(this.dialogTypeList.findIndex(i=>i.showType.includes(this.toolType)))
 			}
       this.setData();
+			if([3,1,7].includes(this.toolType)){
+				this.getIframeWorksData()
+			}
     },
     openWordCloud() {
       this.dialogVisibleWordCloud = true
@@ -1133,7 +1158,57 @@ export default {
         this.$refs.studentWorkPreviewDialogRef.close();
       }
 			}
-		}
+		},
+		getIframeWorksData(){
+			if([3].includes(this.toolType)){
+        let params = {
+          uid:this.userId,
+          cid:this.courseId,
+          s:this.courseType,
+          task:this.taskCount,
+          t:this.toolIndex,
+          type:"2"
+        }
+        this.ajax.get(this.$store.state.api+"selectWord2",params).then(res=>{
+          let _data = res.data[0]
+          if(_data[0]){
+            this.$nextTick(()=>{
+              let _iframe = this.$refs.iframeMainMapRef;
+              _iframe.onload = () =>{
+                console.log("思维导图iframe加载数据👈")
+                _iframe.contentWindow.editor.minder.importData("json",_data[0].text)
+              }
+            })
+
+          }
+        })
+			}else if([1].includes(this.toolType)){
+        let params = {
+          uid:this.userId,
+          cid:this.courseId,
+          s:this.courseType,
+          task:this.taskCount,
+          t:this.toolIndex,
+          type:"3"
+        }
+
+        this.ajax.get(this.$store.state.api+"selectWord2",params).then(res=>{
+          let _data = res.data[0]
+          if(_data[0]){
+            this.$nextTick(()=>{
+              let _iframe = this.$refs.iframeWhiteBoardRef;
+              _iframe.onload = () =>{
+                console.log("电子白板iframe加载数据👈")
+                _iframe.contentWindow.h.app.updateScene({elements:JSON.parse(_data[0].text)})
+              }
+            })
+
+          }
+        })
+			}else if([7].includes(this.toolType)){
+        console.log("思维网格")
+			}
+		},
   }
 };
 </script>
@@ -2176,11 +2251,20 @@ ol {
 .s_b_m_b_i_m_iframe{
   width: 100%;
   flex: 1;
+	margin-top: 10px;
 }
 
 .s_b_m_b_i_m_iframe>div{
   width: 100%;
   height: 100%;
-  background-color: red;
+	box-sizing: border-box;
+	padding-left: 10px;
+}
+
+.s_b_m_b_i_m_iframe>div>iframe{
+	width: 100%;
+	height: 100%;
+	border: none;
+	border: solid 1px #ccc;
 }
 </style>

+ 179 - 6
src/components/courseDetail.vue

@@ -204,8 +204,11 @@
         </div>
         <div class="student_body">
           <div class="sLeft" v-if="courseDetail.brief">
-            <div class="courseT">课程详情</div>
-            <div class="courseTd vditor-reset" v-html="MarkdownT(courseDetail.brief)"></div>
+            <div class="courseT">
+              <span>课程详情</span>
+              <div class="r_pub_button_op" v-if="(courseDetail.state == 6 || courseDetail.state == 5) && courseDetail.userid == userid" @click="aiChatContent">优化</div> 
+            </div>
+            <div v-loading="elLoading" element-loading-text="小可正在努力生成中,请稍等..." ref="chatDialog" class="courseTd vditor-reset" v-html="brief"></div>
           </div>
           <div :class="courseDetail.brief != '' ? 'rightTd' : 'noBRight'">
             <div v-if="tType == 1 || tType == 4" class="checkBox">
@@ -213,13 +216,15 @@
                 >阶段选择
                 <div v-show="false">
                   {{
-                    courseDetail.state == 1
+                    courseDetail.state == 1 
                       ? "阶段模式"
                       : courseDetail.state == 2
                       ? "任务模式"
                       : courseDetail.state == 3
-                      ? "极简模式"
-                      : "AI模式"
+                      ? "极简模式" 
+                      : courseDetail.state == 4 || courseDetail.state == 5 
+                      ? "AI模式"
+                      : "上课模式"
                   }}
                 </div></span
               >
@@ -247,7 +252,7 @@
                 <div class="jdAndTask">
                   <div>第{{ index + 1 }}阶段</div>
                   <div
-                    v-if="courseDetail.state == 2 || courseDetail.state == 3 || courseDetail.state == 4 || courseDetail.state == 5"
+                    v-if="courseDetail.state == 2 || courseDetail.state == 3 || courseDetail.state == 4 || courseDetail.state == 5 || courseDetail.state == 6"
                   >
                     任务查看
                   </div>
@@ -1091,6 +1096,8 @@ import FileSaver from "file-saver";
 import scoreZong from './scoreZong/get.vue'
 
 import MarkdownIt from "markdown-it";
+import { v4 as uuidv4 } from "uuid";
+
 
 var OpenCC = require("opencc-js");
 let converter = OpenCC.Converter({
@@ -1187,6 +1194,12 @@ export default {
       dialogVisibleQR: false,
       checkStage: 0,
       tools: JSON.parse(converter(JSON.stringify(tools))),
+      brief: '',
+      sbrief: '',
+      setting: {},
+      elLoading: false,
+      eltLoading: false,
+      languageSetting: 0,
     };
   },
   computed: {
@@ -1435,6 +1448,8 @@ export default {
 								window.parent.postMessage({ tools: "openCourseEUpdate",cid:this.id }, "*");
 							}else if(this.courseDetail.state == 4 || this.courseDetail.state == 5){
 								window.parent.postMessage({ tools: "openCourseAiUpdate",cid:this.id }, "*");
+              }else if(this.courseDetail.state == 6){
+								window.parent.postMessage({ tools: "openCourseAiUpdate2",cid:this.id }, "*");
               }
 
 						})
@@ -1725,6 +1740,20 @@ export default {
       loading.close();
       // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
       this.courseDetail = res.data[0][0];
+      if(res.data[0][0].setting){
+        try {
+          this.languageSetting = (JSON.parse(res.data[0][0].setting).languageSetting || JSON.parse(res.data[0][0].setting).languageSetting == 0) ? JSON.parse(res.data[0][0].setting).languageSetting : 0;
+          this.sbrief = JSON.parse(res.data[0][0].setting).sbrief ? JSON.parse(res.data[0][0].setting).sbrief : '';
+          this.setting = JSON.parse(res.data[0][0].setting)
+        }catch(error){
+          console.error(error)
+        }
+      }
+      this.brief = this.sbrief ? this.sbrief : this.MarkdownT(this.courseDetail.brief)
+      
+      if(this.brief && !this.sbrief && (this.courseDetail.state == 6 || this.courseDetail.state == 5) && this.courseDetail.userid == this.userid){
+        this.aiChatContent()
+      }
       this.isFollow = res.data[0][0].follow;
       this.followC = res.data[0][0].followC
         ? res.data[0][0].followC.split("-")[0]
@@ -2245,6 +2274,124 @@ export default {
         });
       });
     },
+    getLang(){
+      let lang = ''
+      if(this.languageSetting == 0){
+        lang = 'Chinese.'
+      }else if(this.languageSetting == 1){
+        lang = 'Traditional Chinese.'
+      }else if(this.languageSetting == 2){
+        lang = 'English.'
+      }
+      return lang
+    },
+    updateSetting(){
+			let params = [{
+				cid: this.id,
+				setting: JSON.stringify(this.setting)
+			}]
+
+			this.ajax.post(this.$store.state.api+'updateWorksSetting',params).then(res=>{
+				if(res.data==1){
+					console.log('保存操作成功')
+				}else{
+					console.log('保存操作失败')
+				}
+			}).catch(e=>{
+				console.log('保存操作失败')
+				console.log(e)
+			})
+		},
+    aiChatContent() {
+      if(this.elLoading || this.eltLoading){
+        this.$message.error('正在优化中,请稍后')
+        return
+      }
+      this.elLoading = true
+      this.eltLoading = true
+      let _uuid = uuidv4();
+      this.brief = "";
+      let params = {
+        model: "qwen-plus",
+        temperature: 0,
+        max_tokens: 4096,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: [
+          {
+            role: "user",
+            content: `Language: ${this.getLang()} 总结以下内容为150字左右的课程简介:${this.courseDetail.brief}`
+          }
+        ],
+        uid: _uuid,
+        mind_map_question: ""
+      }
+
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/chat", params)
+        .then(res => {
+          if (
+            converter(res.data.FunctionResponse.result) ==
+            converter("发送成功")
+          ) {
+          } else {
+            this.$message.warning(res.data.FunctionResponse.result);
+          }
+        })
+        .catch(e => {
+          console.log(e);
+          this.elLoading = false
+          this.eltLoading = false
+        });
+      this.getAiContent(_uuid);
+    },
+    getAiContent(_uid) {
+      this.fasource = new EventSource(
+        `https://gpt4.cocorobo.cn/stream/${_uid}`
+      ); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      let _allText = "";
+      let _mdText = "";
+      const md = new MarkdownIt();
+      this.fasource.onmessage = _e => {
+        if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
+          //对话已经完成
+          _mdText = _mdText.replace("_", "");
+          this.fasource.close();
+          this.fasource = null;
+          this.$nextTick(() => {
+            this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+          });
+          this.brief = _mdText;
+          this.setting.sbrief = _mdText
+          this.eltLoading = false
+          this.$forceUpdate()
+          this.updateSetting();
+          return;
+        } else {
+          //对话还在继续
+          let _text = "";
+          _text = _e.data.replaceAll("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          _mdText = md.render(_mdText);
+          this.brief = _mdText;
+          this.elLoading = false
+          this.$nextTick(() => {
+            this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+          });
+          // 处理流数据
+        }
+      };
+    },
   },
   created() {
     // if(this.tType == 1 || this.tType == 4){
@@ -2703,6 +2850,9 @@ export default {
   border-left: 3px solid #3681fc;
   padding-left: 5px;
   font-weight: bold;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
 }
 
 .courseTd {
@@ -3295,4 +3445,27 @@ export default {
 	border-color: #1463eb !important;
 }
 
+
+.r_pub_button_op{
+  color: #448bff;
+  font-size: 14px;
+  cursor: pointer;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.r_pub_button_op::before {
+  content: "";
+  width: 14px;
+  height: 14px;
+  min-width: 14px;
+  min-height: 14px;
+  background-size: 100% 100%;
+  display: block;
+  margin-right: 7px;
+  background-image: url(../assets/icon/u_op.png);
+}
+
+
 </style>

+ 12 - 9
src/components/easy2/studyStudent.vue

@@ -20650,7 +20650,8 @@ export default {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
         ].isLook = true;
-        this.addCourseState(3);
+        let yym = JSON.parse(JSON.stringify(this.chapInfoList))
+        this.addCourseState(3,yym);
       }
       for (var ci = 0; ci < this.isCloseList.length; ci++) {
         this.isCloseList[ci].isClose = 0;
@@ -21853,8 +21854,9 @@ export default {
           console.error(err);
         });
     },
-    addCourseState(type) {
-      let _state = this.chapInfoList;
+    addCourseState(type,val = '') {
+      
+      let _state = val ? val : this.chapInfoList;
       // this.courseType   this.taskCount
       if (type == 1 || type == 2) {
         for (var i = 0; i < _state.length; i++) {
@@ -21883,6 +21885,7 @@ export default {
           state: JSON.stringify(_state)
         }
       ];
+      
       this.ajax
         .post(
           this.$store.state.api +
@@ -22797,10 +22800,10 @@ export default {
       } else if (t == 63) {
         window.parent.postMessage({ tools: "63" }, "*");
       } else if (t == 71) {
-        if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
-          this.$message.error("该工具不可使用");
-          return
-        }
+        // if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
+        //   this.$message.error("该工具不可使用");
+        //   return
+        // }
         window.parent.postMessage({ tools: "71" }, "*");
       } else if (t == 69) {
         if (this.worksStudent[i].length) {
@@ -25038,9 +25041,9 @@ export default {
   beforeDestroy() {
     window.onresize = null;
     clearInterval(this.timer);
-    clearInterval(this.timer2);
-
     this.timer = null;
+
+    clearInterval(this.timer2);
     this.timer2 = null;
 
     clearInterval(this.opertimer);

+ 11 - 8
src/components/easy3/studyStudent.vue

@@ -16343,7 +16343,7 @@ export default {
         // }
       }
       document.scrollingElement.scrollTop = 0;
-      this.showType = 7;
+      // this.showType = 7;
       this.navId = this.navList[this.courseType].task[this.taskCount].id;
       // if (this.vedio[this.taskCount].length > 0) {
       //   var a =
@@ -16432,7 +16432,9 @@ export default {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
         ].isLook = true;
-        this.addCourseState(3);
+
+        let yym = JSON.parse(JSON.stringify(this.chapInfoList))
+        this.addCourseState(3,yym);
       }
       for (var ci = 0; ci < this.isCloseList.length; ci++) {
         this.isCloseList[ci].isClose = 0;
@@ -17551,8 +17553,9 @@ export default {
           console.error(err);
         });
     },
-    addCourseState(type) {
-      let _state = this.chapInfoList;
+    addCourseState(type,val = '') {
+      let _state = val ? val : this.chapInfoList;
+
       // this.courseType   this.taskCount
       if (type == 1 || type == 2) {
         for (var i = 0; i < _state.length; i++) {
@@ -18478,10 +18481,10 @@ export default {
       } else if (t == 63) {
         window.parent.postMessage({ tools: "63" }, "*");
       } else if (t == 71) {
-        if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
-          this.$message.error("该工具不可使用");
-          return
-        }
+        // if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
+        //   this.$message.error("该工具不可使用");
+        //   return
+        // }
         window.parent.postMessage({ tools: "71" }, "*");
       } else if (t == 69) {
         if (this.worksStudent[i].length) {

+ 10 - 8
src/components/studyStudent.vue

@@ -16356,7 +16356,6 @@ export default {
     },
 
     openTask(s, n, i,ctype) {
-			console.log(s, n, i,ctype)
       if (this.IsFollow && this.tType == 2) {
         this.$message.error("已经开启跟随模式,请认真跟堂听讲");
         return;
@@ -16421,8 +16420,10 @@ export default {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
         ].isLook = true;
-        this.addCourseState(3);
+        let yym = JSON.parse(JSON.stringify(this.chapInfoList))
+        this.addCourseState(3,yym);
       }
+
       for (let ci = 0; ci < this.isCloseList.length; ci++) {
         this.isCloseList[ci].isClose = 0;
         this.isCloseList[ci].isCloseBoolean = false;
@@ -17543,8 +17544,9 @@ export default {
           console.error(err);
         });
     },
-    addCourseState(type) {
-      let _state = this.chapInfoList;
+    addCourseState(type,val = '') {
+      let _state = val ? val : this.chapInfoList;
+
       // this.courseType   this.taskCount
       if (type == 1 || type == 2) {
         for (var i = 0; i < _state.length; i++) {
@@ -18469,10 +18471,10 @@ export default {
       } else if (t == 63) {
         window.parent.postMessage({ tools: "63" }, "*");
       } else if (t == 71) {
-        if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
-          this.$message.error("该工具不可使用");
-          return
-        }
+        // if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
+        //   this.$message.error("该工具不可使用");
+        //   return
+        // }
         window.parent.postMessage({ tools: "71" }, "*");
       } else if (t == 69) {
         if (this.worksStudent[i].length) {

+ 10 - 8
src/components/studySutdentClass/studyStudent.vue

@@ -20002,7 +20002,7 @@ export default {
         // }
       }
       document.scrollingElement.scrollTop = 0;
-      this.showType = 7;
+      // this.showType = 7;
       this.navId = this.navList[this.courseType].task[this.taskCount].id;
       // if (this.vedio[this.taskCount].length > 0) {
       //   var a =
@@ -20092,7 +20092,8 @@ export default {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
         ].isLook = true;
-        this.addCourseState(3);
+        let yym = JSON.parse(JSON.stringify(this.chapInfoList))
+        this.addCourseState(3,yym);
       }
       for (var ci = 0; ci < this.isCloseList.length; ci++) {
         this.isCloseList[ci].isClose = 0;
@@ -21288,8 +21289,9 @@ export default {
           console.error(err);
         });
     },
-    addCourseState(type) {
-      let _state = this.chapInfoList;
+    addCourseState(type,val = '') {
+      let _state = val ? val : this.chapInfoList;
+
       // this.courseType   this.taskCount
       if (type == 1 || type == 2) {
         for (var i = 0; i < _state.length; i++) {
@@ -22215,10 +22217,10 @@ export default {
       } else if (t == 63) {
         window.parent.postMessage({ tools: "63" }, "*");
       } else if (t == 71) {
-        if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
-          this.$message.error("该工具不可使用");
-          return
-        }
+        // if(this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
+        //   this.$message.error("该工具不可使用");
+        //   return
+        // }
         window.parent.postMessage({ tools: "71" }, "*");
       } else if (t == 69) {
         if (this.worksStudent[i].length) {

Some files were not shown because too many files changed in this diff