lsc 2 år sedan
förälder
incheckning
772bcf5522
1 ändrade filer med 466 tillägg och 2 borttagningar
  1. 466 2
      js/Desktop/DeskTop.js

+ 466 - 2
js/Desktop/DeskTop.js

@@ -1183,7 +1183,9 @@ window.addEventListener('message', function (e) { // 监听 message 事件
         //3是展示全部阶段  2学生 1老师 4专家
         //3是展示全部阶段  2学生 1老师 4专家
     } else if (e.data.screenType && e.data.screenType == "3") { //课程管理传入
     } else if (e.data.screenType && e.data.screenType == "3") { //课程管理传入
         U.MD.D.I.openInApplication("studyDetail", e.data.cid, 2, 1)
         U.MD.D.I.openInApplication("studyDetail", e.data.cid, 2, 1)
-    } else if (e.data.screenType && e.data.screenType == "3s") { //课程管理传入
+    } else if (e.data.screenType && e.data.screenType == "3NT") { //课程管理传入
+        U.MD.D.I.openInApplication("studyDetailNT", e.data.cid, 2, 1)
+    }  else if (e.data.screenType && e.data.screenType == "3s") { //课程管理传入
         U.MD.D.I.openInApplication("studyDetailS", e.data.cid, 2, 1)
         U.MD.D.I.openInApplication("studyDetailS", e.data.cid, 2, 1)
     } else if (e.data.screenType && e.data.screenType == "3s2") { //课程管理传入
     } else if (e.data.screenType && e.data.screenType == "3s2") { //课程管理传入
         U.MD.D.I.openInApplication("studyDetailS5", e.data.cid, 2, 5)
         U.MD.D.I.openInApplication("studyDetailS5", e.data.cid, 2, 5)
@@ -1242,7 +1244,10 @@ window.addEventListener('message', function (e) { // 监听 message 事件
     } else if (e.data.allScreen && e.data.allScreen == "2s") {
     } else if (e.data.allScreen && e.data.allScreen == "2s") {
         var _formel = document.getElementById("studyDetailS");
         var _formel = document.getElementById("studyDetailS");
         U.UF.F.windowZooming(_formel);
         U.UF.F.windowZooming(_formel);
-    } else if (e.data.allScreen && e.data.allScreen == "2ss") {
+    } else if (e.data.allScreen && e.data.allScreen == "2NT") {
+        var _formel = document.getElementById("studyDetailNT");
+        U.UF.F.windowZooming(_formel);
+    }  else if (e.data.allScreen && e.data.allScreen == "2ss") {
         var _formel = document.getElementById("studyDetailS");
         var _formel = document.getElementById("studyDetailS");
         U.UF.F.windowZooming(_formel);
         U.UF.F.windowZooming(_formel);
     } else if (e.data.allScreen && e.data.allScreen == "4s") {
     } else if (e.data.allScreen && e.data.allScreen == "4s") {
@@ -1323,6 +1328,12 @@ window.addEventListener('message', function (e) { // 监听 message 事件
         U.MD.D.getuser2(e.data.userid, e.data.courseId)
         U.MD.D.getuser2(e.data.userid, e.data.courseId)
     } else if (e.data.tools && e.data.tools == "AIAnalyse") {
     } else if (e.data.tools && e.data.tools == "AIAnalyse") {
         U.MD.D.I.openApplication("AIAnalyse")
         U.MD.D.I.openApplication("AIAnalyse")
+    } else if (e.data.tools && e.data.tools == "1teacher") {
+        U.MD.D.I.openApplicationJieTeacher("whiteboard", e.data.cid, e.data.stage, e.data.task, e.data.tool, e.data.student)
+    }else if (e.data.tools && e.data.tools == "3teacher") {
+        U.MD.D.I.openApplicationJieTeacher("mind", e.data.cid, e.data.stage, e.data.task, e.data.tool, e.data.student)
+    }else if (e.data.tools && e.data.tools == "7teacher") {
+        U.MD.D.I.openApplicationJieTeacher("mindNetwork", e.data.cid, e.data.stage, e.data.task, e.data.tool, e.data.student)
     }
     }
 
 
 });
 });
@@ -1347,6 +1358,24 @@ U.MD.D.I.openInApplication = function (str, data, screenType, tType) {
         tType = 4
         tType = 4
     }
     }
     switch (str) {
     switch (str) {
+        case "studyDetailNT"://无终端模式
+            if (!_userinfo || Object.keys(_userinfo).length === 0) {
+                setTimeout(() => {
+                    U.MD.U.L.login();
+                }, 2000);
+            } else {
+                _formdiv = new U.UF.UI.form(
+                    "课程详情",
+                    $$("iframe", { "allow": "camera *; microphone *;display-capture", "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetailNT?userid=" + _userid + "&oid=" + _oid + "&org=" + _org + "&courseId=" + data + "&tType=" + tType + "&cid=" + _classId + "&screenType=" + screenType }), {
+                    "id": "studyDetailNT",
+                    "style": { "width": "100%", "height": "100%", "overflow": 'hidden' },
+                    "onresize": function () { }
+                }, {
+                    closecallback: function () { }
+                }, { "style": { "height": "36px" } }).form; //创建窗体
+                _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/study.png)" }, "name": "课程中心", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
+                break;
+            }
         case "studyDetail":
         case "studyDetail":
             if (!_userinfo || Object.keys(_userinfo).length === 0) {
             if (!_userinfo || Object.keys(_userinfo).length === 0) {
                 setTimeout(() => {
                 setTimeout(() => {
@@ -3549,6 +3578,441 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
 
 
 }
 }
 
 
+U.MD.D.I.openApplicationJieTeacher = function (str, cid, stage, task, tool,student) {
+    var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
+        _formdiv, //创建任务栏时同时弹出的窗体元素。
+        _userid = student.userid, //登录用户id
+        _username = student.student //用户名字
+    let _iframe;
+    let _cid = cid,
+        _stage = stage,
+        _task = task,
+        _tool = tool;
+    var _jie = $$("div", {
+        "style": {
+            "position": "absolute",
+            "bottom": "50px",
+            "right": "50px",
+            "zIndex": "9999",
+            "backgroundColor": "#2268bc",
+            "color": "#fff",
+            "padding": "12px 20px",
+            "cursor": "pointer",
+            "borderRadius": "4px",
+        },
+        "innerHTML": "提交作业"
+    })
+    let aTool = ''
+    let _loading = document.createElement('div')
+    _loading.style = "width:100%;height:100%;background:#00000000;position:absolute;top:0;left:0;z-index:99999999999999;display: none;justify-content: center;align-items: center;"
+    //  _loading.id = "";
+    let _lchild = document.createElement('div')
+    let _limg = document.createElement('img')
+    _limg.src = 'https://pbl.cocorobo.cn/pbl-student-table/dist/js/loading.gif'
+    _limg.style = "width: 26px;margin-right: 10px;"
+    _lchild.appendChild(_limg)
+    let _lspan = document.createElement('span')
+    _lspan.innerHTML = "上传中..."
+    _lchild.appendChild(_lspan)
+    _lchild.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;display:flex;align-items:center;"
+    _loading.appendChild(_lchild)
+
+    var _box = $$('div', {
+        "style": {
+            "position": "relative",
+            "width": "100%",
+            "height": "100%",
+        },
+    })
+    _box.appendChild(_loading)
+    _box.id = str + '_loadLi'
+    switch (str) {
+        case "whiteboard":
+            aTool = 1;
+            _iframe = $$("iframe", {
+                "frameborder": "no",
+                "border": "0",
+                "scrolling ": "no",
+                "style": {
+                    "cssText": "border:0;width:100%;height:100%"
+                },
+                "src": "https://iwb.cocorobo.cn/"
+            })
+            _box.appendChild(_iframe);
+            _box.appendChild(_jie);
+            _formdiv = new U.UF.UI.form(
+                "电子白板-"+_username,
+                _box, {
+                "id": "whiteboard" + cid + stage + task + tool + _userid,
+                "style": {
+                    "width": "90%",
+                    "height": "90%",
+                    "overflow": 'hidden'
+                },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, {
+                "style": {
+                    "height": "36px"
+                }
+            }).form; //创建窗体
+            _taskbar = {
+                "id": str + _formdiv.id,
+                "style": {
+                    "backgroundImage": "url(/img/icon/whiteBoard.png)"
+                },
+                "name": "电子白板",
+                "forms": _formdiv,
+                "click": function () {
+                    U.MD.D.I.openApplication(str, obj, info);
+                }
+            }
+            break;
+        case "mind":
+            aTool = 3;
+            _iframe = $$("iframe", {
+                "frameborder": "no",
+                "border": "0",
+                "scrolling ": "no",
+                "style": {
+                    "cssText": "border:0;width:100%;height:100%"
+                },
+                "src": "/kityminder-editor/dist/index.html"
+            })
+            _box.appendChild(_iframe);
+            _box.appendChild(_jie);
+            _formdiv = new U.UF.UI.form(
+                "思维导图-"+_username,
+                _box, { //"/jsmind/example/demo.html" 
+                "id": "mind" + cid + stage + task + tool + _userid,
+                "style": {
+                    "width": "90%",
+                    "height": "90%",
+                    "overflow": 'hidden'
+                },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, {
+                "style": {
+                    "height": "36px"
+                }
+            }).form; //创建窗体
+            _taskbar = {
+                "id": str + _formdiv.id,
+                "style": {
+                    "backgroundImage": "url(/img/icon/mindMapping.png)"
+                },
+                "name": "思维导图",
+                "forms": _formdiv,
+                "click": function () {
+                    U.MD.D.I.openApplication(str, obj, info);
+                }
+            }
+            break;
+        case "MindMap":
+            aTool = 3;
+            _iframe = $$("iframe", {
+                "frameborder": "no",
+                "border": "0",
+                "scrolling ": "no",
+                "style": {
+                    "cssText": "border:0;width:100%;height:100%"
+                },
+                "src": "//cloud.cocorobo.cn/mind/"
+            })
+            _box.appendChild(_iframe);
+            _box.appendChild(_jie);
+            _formdiv = new U.UF.UI.form(
+                "思维导图-"+_username,
+                _box, { //"/jsmind/example/demo.html" 
+                "id": "mind" + cid + stage + task + tool + _userid,
+                "style": {
+                    "width": "90%",
+                    "height": "90%",
+                    "overflow": 'hidden'
+                },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, {
+                "style": {
+                    "height": "36px"
+                }
+            }).form; //创建窗体
+            _taskbar = {
+                "id": str + _formdiv.id,
+                "style": {
+                    "backgroundImage": "url(/img/icon/mindMapping.png)"
+                },
+                "name": "思维导图",
+                "forms": _formdiv,
+                "click": function () {
+                    U.MD.D.I.openApplication(str, obj, info);
+                }
+            }
+            break;
+        case "doc":
+            aTool = 6;
+            _iframe = $$("iframe", {
+                "frameborder": "no",
+                "border": "0",
+                "scrolling ": "no",
+                "style": {
+                    "cssText": "border:0;width:100%;height:100%"
+                },
+                "src": "/Office/Word/WordEditArea.htm"
+            })
+            _box.appendChild(_iframe);
+            _box.appendChild(_jie);
+            _formdiv = new U.UF.UI.form(
+                "协同文档-"+_username,
+                _box, {
+                "id": "doc" + cid + stage + task + tool + _userid,
+                "style": {
+                    "width": "90%",
+                    "height": "90%",
+                    "overflow": 'hidden'
+                },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, {
+                "style": {
+                    "height": "36px"
+                }
+            }).form; //创建窗体
+
+            U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function () {
+                $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load(cid, stage, task, tool);
+            })
+            _taskbar = {
+                "id": str + _formdiv.id,
+                "style": {
+                    "backgroundImage": "url(/img/icon/doc.png)"
+                },
+                "name": "协同文档",
+                "forms": _formdiv,
+                "click": function () {
+                    U.MD.D.I.openApplication(str, obj, info);
+                }
+            }
+            break;
+        case "mindNetwork": //好友打开
+            aTool = 7;
+            _iframe = $$("iframe", {
+                "webkitallowfullscreen": "",
+                "mozallowfullscreen": "",
+                "allowfullscreen": "",
+                "frameborder": "no",
+                "border": "0",
+                "scrolling ": "no",
+                "style": {
+                    "cssText": "border:0; width:100%; height:100%;"
+                },
+                "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=" + _userid
+            })
+            _box.appendChild(_iframe);
+            _box.appendChild(_jie);
+            _formdiv = new U.UF.UI.form(
+                "思维网格-"+_username,
+                _box, {
+                "id": "mindNetwork" + cid + stage + task + tool + _userid,
+                "style": {
+                    "width": "90%",
+                    "height": "90%",
+                    "overflow": 'hidden'
+                },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, {
+                "style": {
+                    "height": "36px"
+                }
+            }).form; //创建窗体
+            _taskbar = {
+                "id": str + _formdiv.id,
+                "style": {
+                    "backgroundImage": "url(/img/icon/mindNetwork.png)"
+                },
+                "name": "思维网格",
+                "forms": _formdiv,
+                "click": function () {
+                    U.MD.D.I.openApplication(str, obj, info);
+                }
+            }
+            break;
+        case "courseDesign":
+            _iframe = $$("iframe", {
+                "webkitallowfullscreen": "",
+                "mozallowfullscreen": "",
+                "allowfullscreen": "",
+                "frameborder": "no",
+                "border": "0",
+                "scrolling ": "no",
+                "style": {
+                    "cssText": "border:0; width:100%; height:100%;"
+                },
+                "src": "/course-design-vue"
+            })
+            _box.appendChild(_iframe);
+            _box.appendChild(_jie);
+            _formdiv = new U.UF.UI.form(
+                "项目设计-"+_username,
+                _box, {
+                "id": "courseDesign" + cid + stage + task + tool + _userid,
+                "style": {
+                    "width": "90%",
+                    "height": "90%",
+                    "overflow": 'hidden'
+                },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, {
+                "style": {
+                    "height": "36px"
+                }
+            }).form; //创建窗体
+            _taskbar = {
+                "id": str + _formdiv.id,
+                "style": {
+                    "backgroundImage": "url(/img/icon/courseDesign.png)"
+                },
+                "name": "项目设计",
+                "forms": _formdiv,
+                "click": function () {
+                    U.MD.D.I.openApplication(str, obj, info);
+                }
+            }
+            break;
+    }
+    const script1 = document.createElement("script");
+    script1.type = "text/javascript";
+    // script1.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jquery-3.6.0.min.js";
+    script1.src = "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js";
+    const script2 = document.createElement("script");
+    script2.type = "text/javascript";
+    // script2.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
+    script2.src = "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js";
+    const script3 = document.createElement("script");
+    script3.type = "text/javascript";
+    script3.charset = "UTF-8";
+    script3.src = "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js";
+    const script4 = document.createElement("script");
+    script4.type = "text/javascript";
+    // script4.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jietu2.js";
+    script4.src = "https://cloud.cocorobo.cn/js/Common/jietu2.js";
+
+    if (_iframe) {
+        if (str == 'doc') {
+            U.UF.DL.iframeLoad(_iframe, function () {
+                _iframe.contentWindow.U.MD.O.W.load(cid, stage, task, tool);
+                _iframe.contentWindow.document.body.appendChild(script1);
+                _iframe.contentWindow.document.body.appendChild(script2);
+                // _iframe.contentWindow.document.body.appendChild(script3);
+                _iframe.contentWindow.document.body.appendChild(script4);
+            })
+        } else if (str == 'courseDesign') {
+            U.UF.DL.iframeLoad(_iframe, function () {
+                // _iframe.contentWindow.U.MD.O.W.load();
+                // _iframe.contentWindow.document.body.appendChild(script1);
+                _iframe.contentWindow.document.body.appendChild(script2);
+                _iframe.contentWindow.document.body.appendChild(script4);
+            })
+        } else if (str == 'mind') {
+            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 if (str == 'whiteboard') {
+            _iframe.onload = () => {
+                _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, '3', _iframe)
+            };
+        } else {
+            _iframe.onload = () => {
+                _iframe.contentWindow.document.body.appendChild(script1);
+                _iframe.contentWindow.document.body.appendChild(script2);
+                // _iframe.contentWindow.document.body.appendChild(script3);
+                _iframe.contentWindow.document.body.appendChild(script4);
+            };
+        }
+        _jie.onclick = async () => {
+            let text = ''
+            if (aTool == 1) {
+                text = JSON.stringify(_iframe.contentWindow.h.app.scene.elements)
+            } else if (aTool == 6) {
+                text = _iframe.contentWindow.$("#U_MD_O_H_wordEditor")[0].innerHTML.escapeQuotes()
+            } else if (aTool == 3) {
+                text = await U.MD.D.I.getEditorContent(_iframe);
+            }
+
+            _loading.style.display = 'flex'
+            console.log(_loading);
+            var _ajs = _iframe.contentWindow.document.createElement("script");
+            _ajs.type = "text/javascript";
+            _ajs.innerHTML =
+                // 'console.log(' + _loading + ');\n' +
+                'var _js = document.createElement("script");\n' +
+                '_js.type="text/javascript";\n' +
+                '_js.charset="UTF-8";\n' +
+                '_js.src="https://cloud.cocorobo.cn/js/Common/html2canvas.min.js";\n' +
+                "_js.onload = function(){\n" +
+                ' var a = document.getElementsByTagName("img")\n' +
+                ' for(var i = 0;i<a.length;i++){a[i].crossOrigin="anonymous"}\n' +
+                " html2canvas(document.body,{allowTaint: true,useCORS: true,height: document.body.scrollHeight,windowHeight: document.body.scrollHeight}).then(canvas => {\n" +
+                '  var base64Url = canvas.toDataURL("image/png");\n' +
+                'var base64 = "<img src=" + base64Url + " />"\n' +
+                'var file = dataURLtoFile_shishi(base64Url, "截图")\n' +
+                "beforeUpload_shishi(file," +
+                "'" +
+                _userid +
+                "'" +
+                ", " +
+                "'" +
+                _cid +
+                "'" +
+                ", " +
+                "'" +
+                _stage +
+                "'" +
+                ", " +
+                "'" +
+                _task +
+                "'" +
+                ", " +
+                "'" +
+                _tool +
+                "'" +
+                ", " +
+                "'" +
+                str + '_loadLi' +
+                "'" +
+                ", " +
+                "'" +
+                aTool +
+                "'" +
+                ", " +
+                "`" +
+                text +
+                "`" +
+                ")\n" +
+                " });\n" +
+                "}\n" +
+                "document.head.appendChild(_js);\n";
+            _iframe.contentWindow.document.head.appendChild(_ajs);
+        }
+    }
+}
+
 U.MD.D.I.getEditorContent = function (iframe) {
 U.MD.D.I.getEditorContent = function (iframe) {
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
         iframe.contentWindow.editor.minder.exportData('json').then(function (content) {
         iframe.contentWindow.editor.minder.exportData('json').then(function (content) {