zengyicheng hace 2 años
padre
commit
6359c0c308
Se han modificado 1 ficheros con 26 adiciones y 1 borrados
  1. 26 1
      js/Desktop/DeskTop.js

+ 26 - 1
js/Desktop/DeskTop.js

@@ -307,6 +307,29 @@ U.MD.D.isOverlap = function(el, childs, postionarray) {
 如果第一个参数为其他,则无第二个参数
 * @returns {array} 
 */
+window.addEventListener('message', function(e) { // 监听 message 事件
+    // alert(e.data.type);
+    if (e.data.type && e.data.type == "1") { //项目管理传入
+        U.MD.D.I.openInApplication("study", e.data.cid)
+    }
+});
+U.MD.D.I.openInApplication = function(str, data) {
+    switch (str) {
+        case "study":
+            _formdiv = new U.UF.UI.form(
+                "项目详情",
+                $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?userid=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5&courseId=" + data }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
+                    "id": "study",
+                    "style": { "width": "70%", "height": "90%", "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;
+    }
+
+}
 U.MD.D.I.openApplication = function(str, obj, info) {
     obj = obj || {};
     var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
@@ -320,7 +343,7 @@ U.MD.D.I.openApplication = function(str, obj, info) {
         case "project": //好友打开
             _formdiv = new U.UF.UI.form(
                 "项目管理",
-                $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course?userid=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), { //https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course
+                $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "http://localhost:8080/#/course?userid=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), { //https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course
                     "id": "project",
                     "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
                     "onresize": function() {}
@@ -498,6 +521,8 @@ U.MD.D.I.openApplication = function(str, obj, info) {
             _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 "friend": //好友打开
             U.MD.D.I.IsDrag = true;
             U.MD.F.W.viewFriend(info); //打开好友