Przeglądaj źródła

思维导图默认模板

11wqe1 4 tygodni temu
rodzic
commit
587d20237d

+ 22 - 0
src/components/components/choseWorksDetailDialog.vue

@@ -2792,6 +2792,8 @@ export default {
           // if (res.data[0].length > 0) {
             if(_data.length > 0){
               _iframe.contentWindow.editor.minder.importData('json',_data[0].text)
+            }else{
+                this.getdefaultMind()
             }
           // }
 
@@ -2900,6 +2902,26 @@ export default {
 
 			}
 		},
+    getdefaultMind(){
+      let _iframe = this.$refs.iframeMainMapRef;
+
+      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+"selectWordsY",params).then(res=>{
+        console.log('res',res);
+        let data = res.data[0]
+
+        if(data.length > 0){
+          _iframe.contentWindow.editor.minder.importData('json',data[0].text)
+        }
+      })
+    }
   }
 };
 </script>