lsc 2 years ago
parent
commit
70598b8998
1 changed files with 8 additions and 15 deletions
  1. 8 15
      js/Desktop/DeskTop.js

+ 8 - 15
js/Desktop/DeskTop.js

@@ -2795,16 +2795,12 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
         } else if (str == 'mind') {
-            U.UF.DL.iframeLoad(_iframe, async function () {
-                let _content = await U.MD.D.I.getContent(cid, stage, task, tool, _userid, '2')
-                if (_content) {
-                    _iframe.contentWindow.editor.minder.importData('json', _content).then(function (data) {
-                        $(fileInput).val('');
-                    });
-                }
+            U.UF.DL.iframeLoad(_iframe, function () {
+                // 
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
+                U.MD.D.I.getContent(cid, stage, task, tool, _userid, '2',_iframe)
             })
         } else {
             _iframe.onload = () => {
@@ -2895,17 +2891,14 @@ U.MD.D.I.getEditorContent = function (iframe) {
     });
 }
 
-U.MD.D.I.getContent = async function (cid, s, task, t, uid, type) {
-    return new Promise((resolve, reject) => {
+U.MD.D.I.getContent = async function (cid, s, task, t, uid, type,iframe) {
         U.A.Request(US.Config.pbl + "selectWord2?uid=" + uid + "&cid=" + cid + "&s=" + s + "&task=" + task + "&t=" + t + "&type=" + type, [], function (res) {
             reject("aaa")
             if (res.value[0].length > 0) {
-                resolve(res.value[0][0].text);
-            }else{
-                resolve("")
+                // resolve(res.value[0][0].text);
+                iframe.contentWindow.editor.minder.importData('json', res.value[0][0].text).then(function (data) {
+                    $(fileInput).val('');
+                });
             }
         }, [], { "type": "GET", "withCredentials": true });
-    }).catch(e=>{
-        console.log(e)
-    });
 }