SanHQin 2 kuukautta sitten
vanhempi
commit
b9ed55f8b5
1 muutettua tiedostoa jossa 46 lisäystä ja 9 poistoa
  1. 46 9
      src/components/components/choseWorksDetailDialog.vue

+ 46 - 9
src/components/components/choseWorksDetailDialog.vue

@@ -285,7 +285,7 @@
 									<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=6c56ec0e-2c74-11ef-bee5-005056b86db5"
+    								  :src="`https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=${userId}`"
     								  ref="iframeThoughtGridRef"
     								></iframe>
 									</div>
@@ -668,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,
@@ -1158,20 +1160,55 @@ export default {
 			}
 		},
 		getIframeWorksData(){
-			this.$message.info("获取工具数据")
-			console.log("+======================+")
-			console.log(this.courseType)
-			console.log(this.taskCount)
-			console.log(this.toolIndex)
-			console.log("+======================+")
 			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>