DeskTop.js 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. /*
  2. 此处为桌面系统启动应用区域
  3. */
  4. Namespace.register("U.MD.D.I"); //桌面应用处理
  5. //判断图片是否在拖拽,如果是拖拽图标的过程是不会打开图片的
  6. U.MD.D.I.IsDrag;
  7. U.MD.D.I.Ip;
  8. //教师桌面图标的全局变量
  9. U.MD.D.I.teacherDeskIcon = [
  10. { "Name": "项目管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  11. { "Name": "学习中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  12. { "Name": "学生管理", "Url": "student", "style": { "cssText": "background-image:url(/img/icon/student.png)" } },
  13. { "Name": "评价管理", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  14. { "Name": "班级管理", "Url": "class", "style": { "cssText": "background-image:url(/img/icon/class.png)" } },
  15. { "Name": "我的资料", "Url": "my", "style": { "cssText": "background-image:url(/img/icon/myMessage.png)" } },
  16. { "Name": "通知公告", "Url": "notice", "style": { "cssText": "background-image:url(/img/icon/news.png)" } },
  17. { "Name": "素材库", "Url": "library", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  18. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  19. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  20. { "Name": "便签分类", "Url": "note", "style": { "cssText": "background-image:url(/img/icon/note.png)" } },
  21. // { "Name": "量规评分", "Url": "score", "style": { "cssText": "background-image:url(/img/icon/score.png)" } },
  22. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  23. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } },
  24. { "Name": "思维网格", "Url": "mindNetwork", "style": { "cssText": "background-image:url(/img/icon/mindNetwork.png)" } },
  25. { "Name": "实时课堂", "Url": "teacherClassRoom", "style": { "cssText": "background-image:url(/img/icon/classRoom.png)" } }
  26. ];
  27. U.MD.D.I.studentDeskIcon = [
  28. { "Name": "我的项目", "Url": "studnetProject", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  29. { "Name": "学习中心", "Url": "studentStudy", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  30. { "Name": "我的评价", "Url": "studentEvaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  31. { "Name": "我的资料", "Url": "studentMy", "style": { "cssText": "background-image:url(/img/icon/myMessage.png)" } },
  32. { "Name": "素材库", "Url": "library", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  33. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  34. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  35. { "Name": "便签分类", "Url": "note", "style": { "cssText": "background-image:url(/img/icon/note.png)" } },
  36. // { "Name": "量规评分", "Url": "score", "style": { "cssText": "background-image:url(/img/icon/score.png)" } },
  37. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  38. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } },
  39. { "Name": "思维网格", "Url": "mindNetwork", "style": { "cssText": "background-image:url(/img/icon/mindNetwork.png)" } },
  40. { "Name": "实时课堂", "Url": "studentClassRoom", "style": { "cssText": "background-image:url(/img/icon/classRoom.png)" } }
  41. ];
  42. U.MD.D.I.schoolDeskIcon = [
  43. { "Name": "项目管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  44. { "Name": "学习中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  45. { "Name": "评价管理", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  46. { "Name": "通知公告", "Url": "notice", "style": { "cssText": "background-image:url(/img/icon/news.png)" } },
  47. { "Name": "素材库", "Url": "library", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  48. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  49. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  50. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  51. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } },
  52. { "Name": "思维网格", "Url": "mindNetwork", "style": { "cssText": "background-image:url(/img/icon/mindNetwork.png)" } },
  53. ];
  54. //#region 桌面初始化a
  55. /**
  56. * 初始化桌面的起始函数
  57. *
  58. */
  59. U.MD.D.I.init = function() {
  60. if ($("#U_MD_D_K")[0]) {
  61. //初始化桌面图标
  62. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0]);
  63. // var clickUrl = ':12588/requestIp.php';
  64. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  65. // U.MD.D.I.Ip = data;
  66. // var AccessUrl = ':12588/useAccess.php?ip=' + U.MD.D.I.Ip;
  67. // U.MD.D.I.Mysqlrequest(AccessUrl,function(data){
  68. // U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
  69. // })
  70. // //初始化任务栏,因为是静态的,所以直接改变样式即可.
  71. // })
  72. }
  73. }
  74. /**
  75. * 隐藏任务栏
  76. *
  77. * @param {element} 桌面元素
  78. */
  79. U.MD.D.I.hiddenTaskbar = function(el) {
  80. //任务栏位置变小
  81. U.selectEl(el).parentElement(3).css({ "bottom": "-60px" });
  82. //桌面的位置变大
  83. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  84. }
  85. /**
  86. * 隐藏任务栏
  87. *
  88. * @param {element} 桌面元素
  89. */
  90. U.MD.D.I.hiddenTaskbarout = function(el) {
  91. //任务栏位置变小
  92. if (!U.UF.EV.stopBubbleMouseOutOrOver(el)) {
  93. //任务栏位置变化
  94. U.selectEl(el).css({ "bottom": "-60px" });
  95. //桌面的位置变大
  96. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  97. }
  98. }
  99. /**
  100. * 初始化打印桌面图标
  101. *
  102. * @param {element} 桌面元素
  103. */
  104. U.MD.D.I.initDesktopIcons = function(el) {
  105. var i, //用于循环
  106. _content, //桌面图标元素
  107. _iconcontent, //桌面图标元素
  108. _frag = $$("frag"), //定义一个碎片元素
  109. _type = US.userInfo.type,
  110. _oid = US.userInfo.organizeid;
  111. _teacherDesktopIconInfo = U.MD.D.I.teacherDeskIcon, //获取教师端桌面图标
  112. _studentDesktopIconInfo = U.MD.D.I.studentDeskIcon, //获取学生端桌面图标
  113. _schoolDesktopIconInfo = U.MD.D.I.schoolDeskIcon; //获取测试学校桌面图标
  114. //清楚桌面图标
  115. el.innerHTML = "";
  116. //循环创建桌面图标
  117. if (_type == 2 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  118. for (i = 0; i < _studentDesktopIconInfo.length; i++) {
  119. _content = $$("div", {
  120. className: "U_MD_D_KO",
  121. "onmousedown": U.UF.C.closure(function(obj) {
  122. //防止拖动图标即打开了桌面应用
  123. U.MD.D.click(this, obj);
  124. }, [_studentDesktopIconInfo[i]]),
  125. "onclick": U.UF.C.closure(function(obj) {
  126. //防止拖动图标即打开了桌面应用
  127. U.MD.D.click(this, obj);
  128. }, [_studentDesktopIconInfo[i]])
  129. }, _frag); //
  130. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  131. $$("div", { className: "U_MD_D_KOS U_Img", "style": _studentDesktopIconInfo[i].style }, _iconcontent);
  132. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _studentDesktopIconInfo[i].Name }, _iconcontent);
  133. }
  134. } else if (_type == 1 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  135. for (i = 0; i < _teacherDesktopIconInfo.length; i++) {
  136. _content = $$("div", {
  137. className: "U_MD_D_KO",
  138. "onmousedown": U.UF.C.closure(function(obj) {
  139. //防止拖动图标即打开了桌面应用
  140. U.MD.D.click(this, obj);
  141. }, [_teacherDesktopIconInfo[i]]),
  142. "onclick": U.UF.C.closure(function(obj) {
  143. //防止拖动图标即打开了桌面应用
  144. U.MD.D.click(this, obj);
  145. }, [_teacherDesktopIconInfo[i]])
  146. }, _frag); //
  147. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  148. $$("div", { className: "U_MD_D_KOS U_Img", "style": _teacherDesktopIconInfo[i].style }, _iconcontent);
  149. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _teacherDesktopIconInfo[i].Name }, _iconcontent);
  150. }
  151. } else if (_type == 1 && _oid == "91305d49-01ba-11ed-8c78-005056b86db5") {
  152. for (i = 0; i < _schoolDesktopIconInfo.length; i++) {
  153. _content = $$("div", {
  154. className: "U_MD_D_KO",
  155. "onmousedown": U.UF.C.closure(function(obj) {
  156. //防止拖动图标即打开了桌面应用
  157. U.MD.D.click(this, obj);
  158. }, [_schoolDesktopIconInfo[i]]),
  159. "onclick": U.UF.C.closure(function(obj) {
  160. //防止拖动图标即打开了桌面应用
  161. U.MD.D.click(this, obj);
  162. }, [_schoolDesktopIconInfo[i]])
  163. }, _frag); //
  164. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  165. $$("div", { className: "U_MD_D_KOS U_Img", "style": _schoolDesktopIconInfo[i].style }, _iconcontent);
  166. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _schoolDesktopIconInfo[i].Name }, _iconcontent);
  167. }
  168. } else {
  169. for (i = 0; i < _teacherDesktopIconInfo.length; i++) {
  170. _content = $$("div", {
  171. className: "U_MD_D_KO",
  172. "onmousedown": U.UF.C.closure(function(obj) {
  173. //防止拖动图标即打开了桌面应用
  174. U.MD.D.click(this, obj);
  175. }, [_teacherDesktopIconInfo[i]]),
  176. "onclick": U.UF.C.closure(function(obj) {
  177. //防止拖动图标即打开了桌面应用
  178. U.MD.D.click(this, obj);
  179. }, [_teacherDesktopIconInfo[i]])
  180. }, _frag); //
  181. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  182. $$("div", { className: "U_MD_D_KOS U_Img", "style": _teacherDesktopIconInfo[i].style }, _iconcontent);
  183. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _teacherDesktopIconInfo[i].Name }, _iconcontent);
  184. }
  185. }
  186. //加载好后给图标定位
  187. U.MD.D.iconPostion($(_frag).Child());
  188. //把图标加载到页面
  189. el.appendChild(_frag);
  190. }
  191. /**
  192. * 显示任务栏
  193. *
  194. * @param {element} 桌面元素
  195. */
  196. U.MD.D.I.displayTaskbar = function(el) {
  197. //判断是否需要形式任务栏,由于用了mouseover事件会冒泡响应多次,这里做了过滤
  198. if (!U.UF.EV.stopBubbleMouseOutOrOver(el) && U.selectEl(el).css("bottom") != "0px") {
  199. //任务栏位置变化
  200. U.selectEl(el).css({ "bottom": "0px" });
  201. //桌面位置变话
  202. // U.selectEl("#U_MD_D_K").css({ "left": "70px" });
  203. }
  204. }
  205. //#region 桌面图标拖动逻辑
  206. /**
  207. * 桌面排列图标
  208. *
  209. * @param {element} 桌面元素
  210. * @param {object} 上下相距的距离
  211. * @param {object} 左右相距的距离
  212. * @return {object} 命名空间
  213. */
  214. U.MD.D.iconPostion = function(childs, top, left) {
  215. var i; //用于循环处理
  216. top = top || 15; //如果没有设置元素的间距处理默认上间距为15
  217. left = left || 20; //如果没有设置元素的间距处理默认左间距为15
  218. //循环所有的图标,设置每个图标的间距,打印顺序是竖排打印的方式
  219. for (i = 0; i < childs.length; i++) {
  220. //如果竖排top超过了范围处理
  221. if (top + 95 > US.height - 10) {
  222. //left超过了页面范围处理,则向上重叠打印处理
  223. if ((left + 180) > US.width) {
  224. top -= 115;
  225. left -= 90;
  226. }
  227. //没有超过范围,那么left+90添加到下一个竖排打印
  228. else {
  229. left += 90;
  230. top = 15;
  231. };
  232. }
  233. //给图标的位置赋值
  234. U.selectEl(childs[i]).css({ top: top + "px", left: left + "px" });
  235. if (i < childs.length - 1) {
  236. //页面图标每次向下加115
  237. top += 115;
  238. }
  239. }
  240. //返回最后调用的图标的位置
  241. return [top, left];
  242. }
  243. /**
  244. * 桌面点击事件逻辑
  245. *
  246. * @param {element} 桌面元素
  247. * @param {object} 上下相距的距离
  248. * @param {object} 左右相距的距离
  249. * @return {object} 命名空间
  250. */
  251. U.MD.D.click = function(el, obj) {
  252. var _buttonnumber = event.button; //点击的按钮的事件值
  253. var _userinfo = US.userInfo;
  254. U.UF.EV.stopBubble(); //阻止向上冒泡
  255. //onmousedown 包含了左键和右键 这里大于2是为了兼容 所有浏览器的右键处理
  256. if (_buttonnumber < 2) {
  257. //如果是click事件的处理
  258. if (event.type == "click") {
  259. //如果元素在mousemove事件中没有移动则出发click事件
  260. if (!U.MD.D.I.IsDrag) {
  261. if (!_userinfo || Object.keys(_userinfo).length === 0) {
  262. U.alert("请先登录您的账号!");
  263. setTimeout(() => {
  264. U.MD.U.L.login();
  265. }, 2000);
  266. } else {
  267. //打开应用处理
  268. U.MD.D.I.openApplication(obj.Url, { "userid": US.userInfo.userid, "directoryid": US.FTPFOLDERID });
  269. }
  270. }
  271. }
  272. //如果是mouse事件的处理
  273. else {
  274. //拖动处理,添加拖动和拖动结束事件
  275. U.UF.F.drag(el, U.MD.D.iconMove, U.MD.D.iconUp);
  276. }
  277. U.MD.D.I.IsDrag = false;
  278. }
  279. }
  280. /**
  281. * 拖动的处理
  282. *
  283. */
  284. U.MD.D.iconMove = function() {
  285. //如果当前位置点击初始化的位置出现了变化,则设置是否拖动的属性 U.MD.D.I.IsDrag为true
  286. U.MD.D.I.IsDrag = true;
  287. }
  288. /**
  289. * 拖动结束后,这里是定位处理,以网状的形式定位
  290. *
  291. * @param {element} 拖动的元素
  292. * @return {object} 命名空间
  293. */
  294. U.MD.D.iconUp = function(el) {
  295. var _top = 15,
  296. _left = 20,
  297. _margin,
  298. _childs = U.selectEl("#U_MD_D_K").Child(), //桌面所有的图标
  299. _positioninfo = U.UF.EL.getElementInfo(el); //获取拖动结束的元素的位置
  300. if (_positioninfo["OT"] > 15) {
  301. //网状的形式定位,如果差超过了55,那么向下定位,否则向上定位
  302. _margin = ((_positioninfo["OT"] - 15) % 115 > 55 && _positioninfo["OT"] + 115 < US.height) ? 1 : 0;
  303. _top = (Math.floor((_positioninfo["OT"] - 15) / 115) + _margin) * 115 + 15;
  304. }
  305. if (_positioninfo["OL"] > 20) {
  306. //网状的形式定位,如果差超过了90,那么向右定位,否则向左定位
  307. _margin = ((_positioninfo["OL"] - 20) % 90 > 45 && _positioninfo["OL"] + 90 < US.width) ? 1 : 0;
  308. _left = (Math.floor((_positioninfo["OL"] - 20) / 90) + _margin) * 90 + 20
  309. }
  310. //while循环判断么一个重叠的元素
  311. do {
  312. _positioninfo = U.MD.D.iconPostion([el], _top, _left); //给重叠的元素向下定位
  313. _top = _positioninfo[0] + 115; //得到定位后的top
  314. _left = _positioninfo[1]; //得到定位后的left
  315. } while (el = U.MD.D.isOverlap(el, _childs, _positioninfo))
  316. }
  317. /**
  318. * 判断拖动后图标是否重叠
  319. *
  320. * @param {element} 拖动的元素
  321. * @param {element} 桌面所有的元素
  322. * @param {array} 拖动元素的位置
  323. ----------[0] 上 top
  324. ----------[1] 左 left
  325. * @return {object} 命名空间
  326. */
  327. U.MD.D.isOverlap = function(el, childs, postionarray) {
  328. //循环所有的图标
  329. for (var i = 0; i < childs.length; i++) {
  330. //判断有没有和该图标诶子重叠的元素
  331. if (el != childs[i] && (childs[i].offsetTop == postionarray[0] && childs[i].offsetLeft == postionarray[1])) {
  332. return childs[i]; //如果有返回
  333. }
  334. }
  335. }
  336. //#endregion
  337. //#endregion
  338. //#region 桌面应用
  339. /**
  340. * 打开应用
  341. *
  342. * @param {string} 类型
  343. -----------------Disk 网盘系统
  344. -----------------PDisk 学习系统网盘
  345. -----------------Poto 图片
  346. -----------------Video 视频
  347. -----------------Music 音乐
  348. -----------------Word word
  349. -----------------Excel excel
  350. -----------------Txt 记事本
  351. -----------------PB 学习系统
  352. -----------------Blog 朋友圈系统
  353. -----------------FTP ftp系统
  354. -----------------Group 好友群
  355. -----------------SY 首页系统
  356. -----------------Set 个人设置
  357. -----------------XSet 系统设置
  358. -----------------App 我们所有的app
  359. -----------------BC c.1473.cn 平台
  360. -----------------CWeb d.1473.cn 变成平台
  361. -----------------其他的外联系统 我们统一用iframe打开
  362. * @param {array} 类型
  363. 如果第一个参数为"disk",则第二个参数为object,里面包含了用户id和目录id{userid:"",directoryid:""}
  364. 如果第一个参数为"word"或者"excel","txt",则第二个参数为文件信息fileinfo。
  365. 如果第一个参数为"blog"或者"PDisk"。建议删除。
  366. 如果第一个参数为其他,则无第二个参数
  367. * @returns {array}
  368. */
  369. window.addEventListener('message', function(e) { // 监听 message 事件
  370. // alert(e.data.type);
  371. if (e.data.type && e.data.type == "1") { //项目管理传入
  372. U.MD.D.I.openInApplication("study", e.data.cid)
  373. } else if (e.data.close && e.data.close == "1") { //更新用户信息
  374. U.MD.D.I.selectUser();
  375. } else if (e.data.tools && e.data.tools == "1") {
  376. U.MD.D.I.openApplication("whiteboard")
  377. } else if (e.data.tools && e.data.tools == "2") {
  378. U.MD.D.I.openApplication("note")
  379. } else if (e.data.tools && e.data.tools == "3") {
  380. U.MD.D.I.openApplication("mind")
  381. } else if (e.data.tools && e.data.tools == "4") {
  382. U.MD.D.I.openApplication("investigation")
  383. } else if (e.data.tools && e.data.tools == "6") {
  384. U.MD.D.I.openApplication("doc")
  385. } else if (e.data.tools && e.data.tools == "7") {
  386. U.MD.D.I.openApplication("mindNetwork")
  387. } else if (e.data.tools && e.data.tools == "8") {
  388. U.MD.D.I.openApplication("library")
  389. }
  390. });
  391. U.MD.D.I.selectUser = function() {
  392. U.A.Request(US.Config.pbl + "selectUser?userid=" + US.userInfo.userid, [], function(res) { //US.userInfo.userid
  393. if (res.value[0].length > 0) {
  394. US.userInfo = res.value[0][0];
  395. $(".userName")[0].innerHTML = US.userInfo.username;
  396. }
  397. }, [], { "type": "GET", "withCredentials": true });
  398. }
  399. U.MD.D.I.openInApplication = function(str, data) {
  400. var _userinfo = US.userInfo, //登录用户信息
  401. _userid = US.userInfo.userid, //登录用户id
  402. _oid = _userinfo.organizeid;
  403. switch (str) {
  404. case "study":
  405. if (!_userinfo || Object.keys(_userinfo).length === 0) {
  406. setTimeout(() => {
  407. U.MD.U.L.login();
  408. }, 2000);
  409. } else {
  410. _formdiv = new U.UF.UI.form(
  411. "项目详情",
  412. $$("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=" + _userid + "&oid=" + _oid + "&courseId=" + data }), {
  413. "id": "study",
  414. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  415. "onresize": function() {}
  416. }, {
  417. closecallback: function() {}
  418. }, { "style": { "height": "36px" } }).form; //创建窗体
  419. _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); } }
  420. break;
  421. }
  422. }
  423. }
  424. U.MD.D.I.openApplication = function(str, obj, info) {
  425. obj = obj || {};
  426. var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
  427. _formdiv, //创建任务栏时同时弹出的窗体元素。
  428. _userinfo = US.userInfo, //登录用户信息
  429. _userid = obj.userid || US.userInfo.userid, //登录用户id
  430. _oid = obj.organizeid || _userinfo.organizeid,
  431. _type = US.userInfo.type;
  432. if (_type == 2 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  433. switch (str) {
  434. case "studnetProject": //好友打开
  435. _formdiv = new U.UF.UI.form(
  436. "我的项目",
  437. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/project?userid=" + _userid + "&oid=" + _oid }), {
  438. "id": "studnetProject",
  439. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  440. "onresize": function() {}
  441. }, {
  442. closecallback: function() {}
  443. }, { "style": { "height": "36px" } }).form; //创建窗体
  444. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/project.png)" }, "name": "我的项目", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  445. break;
  446. case "studentEvaluate": //好友打开
  447. _formdiv = new U.UF.UI.form(
  448. "我的评价",
  449. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/works?userid=" + _userid + "&oid=" + _oid }), {
  450. "id": "studentEvaluate",
  451. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  452. "onresize": function() {}
  453. }, {
  454. closecallback: function() {}
  455. }, { "style": { "height": "36px" } }).form; //创建窗体
  456. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/evaluation.png)" }, "name": "我的评价", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  457. break;
  458. case "my":
  459. _formdiv = new U.UF.UI.form(
  460. "我的资料",
  461. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/data?userid=" + _userid }), {
  462. "id": "my",
  463. "style": { "width": "42%", "height": "90%", "overflow": 'hidden' },
  464. "onresize": function() {}
  465. }, {
  466. closecallback: function() {}
  467. }, { "style": { "height": "36px" } }).form; //创建窗体
  468. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/myMessage.png)" }, "name": "我的资料", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  469. break;
  470. case "library":
  471. _formdiv = new U.UF.UI.form(
  472. "素材库",
  473. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/library?userid=" + _userid }), {
  474. "id": "library",
  475. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  476. "onresize": function() {}
  477. }, {
  478. closecallback: function() {}
  479. }, { "style": { "height": "36px" } }).form; //创建窗体
  480. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/library.png)" }, "name": "素材库", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  481. break;
  482. case "whiteboard":
  483. _formdiv = new U.UF.UI.form(
  484. "电子白板",
  485. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  486. "id": "whiteboard",
  487. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  488. "onresize": function() {}
  489. }, {
  490. closecallback: function() {}
  491. }, { "style": { "height": "36px" } }).form; //创建窗体
  492. _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); } }
  493. break;
  494. case "investigation":
  495. _formdiv = new U.UF.UI.form(
  496. "问卷调查",
  497. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask?userid=" + _userid }), {
  498. "id": "investigation",
  499. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  500. "onresize": function() {}
  501. }, {
  502. closecallback: function() {}
  503. }, { "style": { "height": "36px" } }).form; //创建窗体
  504. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/ask.png)" }, "name": "问卷调查", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  505. break;
  506. case "note":
  507. _formdiv = new U.UF.UI.form(
  508. "便签分类",
  509. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/note?userid=" + _userid }), {
  510. "id": "note",
  511. "style": { "width": "20%", "height": "90%", "overflow": 'hidden' },
  512. "onresize": function() {}
  513. }, {
  514. closecallback: function() {}
  515. }, { "style": { "height": "36px" } }).form; //创建窗体
  516. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/note.png)" }, "name": "便签分类", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  517. break;
  518. // case "score":
  519. // _formdiv = new U.UF.UI.form(
  520. // "量规评分",
  521. // $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  522. // "id": "score",
  523. // "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  524. // "onresize": function() {}
  525. // }, {
  526. // closecallback: function() {}
  527. // }, { "style": { "height": "36px" } }).form; //创建窗体
  528. // _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/score.png)" }, "name": "量规评分", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  529. // break;
  530. case "mind":
  531. _formdiv = new U.UF.UI.form(
  532. "思维导图",
  533. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/kityminder-editor/dist/index.html" }), { //"/jsmind/example/demo.html"
  534. "id": "mind",
  535. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  536. "onresize": function() {}
  537. }, {
  538. closecallback: function() {}
  539. }, { "style": { "height": "36px" } }).form; //创建窗体
  540. _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); } }
  541. break;
  542. case "doc":
  543. // U.MD.D.I.isRoom();
  544. _formdiv = new U.UF.UI.form(
  545. "协同文档",
  546. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  547. "id": "doc",
  548. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  549. "onresize": function() {}
  550. }, {
  551. closecallback: function() {}
  552. }, { "style": { "height": "36px" } }).form; //创建窗体
  553. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  554. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  555. })
  556. _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); } }
  557. break;
  558. case "studentStudy":
  559. _formdiv = new U.UF.UI.form(
  560. "学习中心",
  561. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index?userid=" + _userid + "&oid=" + _oid }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  562. "id": "studentStudy",
  563. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  564. "onresize": function() {}
  565. }, {
  566. closecallback: function() {}
  567. }, { "style": { "height": "36px" } }).form; //创建窗体
  568. _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); } }
  569. break;
  570. case "mindNetwork": //好友打开
  571. _formdiv = new U.UF.UI.form(
  572. "思维网格",
  573. $$("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 }), {
  574. "id": "mindNetwork",
  575. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  576. "onresize": function() {}
  577. }, {
  578. closecallback: function() {}
  579. }, { "style": { "height": "36px" } }).form; //创建窗体
  580. _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); } }
  581. break;
  582. case "studentClassRoom": //好友打开
  583. _formdiv = new U.UF.UI.form(
  584. "实时课堂",
  585. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/liveRoom?userid=" + _userid + "&oid=" + _oid }), {
  586. "id": "studentClassRoom",
  587. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  588. "onresize": function() {}
  589. }, {
  590. closecallback: function() {}
  591. }, { "style": { "height": "36px" } }).form; //创建窗体
  592. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/classRoom.png)" }, "name": "实时课堂", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  593. setTimeout(() => {
  594. U.UF.F.windowZooming(_formdiv)
  595. }, 0);
  596. break;
  597. }
  598. } else if (_type == 1 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  599. //选择应用处理
  600. switch (str) {
  601. case "project": //好友打开
  602. _formdiv = new U.UF.UI.form(
  603. "项目管理",
  604. $$("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=" + _userid + "&oid=" + _oid }), {
  605. "id": "project",
  606. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  607. "onresize": function() {}
  608. }, {
  609. closecallback: function() {}
  610. }, { "style": { "height": "36px" } }).form; //创建窗体
  611. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/project.png)" }, "name": "项目管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  612. break;
  613. case "student":
  614. _formdiv = new U.UF.UI.form(
  615. "学生管理",
  616. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/student?userid=" + _userid + "&oid=" + _oid }), {
  617. "id": "student",
  618. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  619. "onresize": function() {}
  620. }, {
  621. closecallback: function() {}
  622. }, { "style": { "height": "36px" } }).form; //创建窗体
  623. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/student.png)" }, "name": "学生管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  624. break;
  625. case "evaluate":
  626. _formdiv = new U.UF.UI.form(
  627. "评价管理",
  628. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/works?userid=" + _userid + "&oid=" + _oid }), {
  629. "id": "evaluate",
  630. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  631. "onresize": function() {}
  632. }, {
  633. closecallback: function() {}
  634. }, { "style": { "height": "36px" } }).form; //创建窗体
  635. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/evaluation.png)" }, "name": "评价管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  636. break;
  637. case "class":
  638. _formdiv = new U.UF.UI.form(
  639. "班级管理",
  640. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/class?userid=" + _userid + "&oid=" + _oid }), {
  641. "id": "class",
  642. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  643. "onresize": function() {}
  644. }, {
  645. closecallback: function() {}
  646. }, { "style": { "height": "36px" } }).form; //创建窗体
  647. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/class.png)" }, "name": "班级管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  648. break;
  649. case "my":
  650. _formdiv = new U.UF.UI.form(
  651. "我的资料",
  652. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/data?userid=" + _userid }), {
  653. "id": "my",
  654. "style": { "width": "42%", "height": "90%", "overflow": 'hidden' },
  655. "onresize": function() {}
  656. }, {
  657. closecallback: function() {}
  658. }, { "style": { "height": "36px" } }).form; //创建窗体
  659. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/myMessage.png)" }, "name": "我的资料", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  660. break;
  661. case "notice":
  662. _formdiv = new U.UF.UI.form(
  663. "通知公告",
  664. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/notice?userid=" + _userid }), {
  665. "id": "notice",
  666. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  667. "onresize": function() {}
  668. }, {
  669. closecallback: function() {}
  670. }, { "style": { "height": "36px" } }).form; //创建窗体
  671. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/news.png)" }, "name": "通知公告", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  672. break;
  673. case "library":
  674. _formdiv = new U.UF.UI.form(
  675. "素材库",
  676. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/library?userid=" + _userid }), {
  677. "id": "library",
  678. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  679. "onresize": function() {}
  680. }, {
  681. closecallback: function() {}
  682. }, { "style": { "height": "36px" } }).form; //创建窗体
  683. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/library.png)" }, "name": "素材库", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  684. break;
  685. case "whiteboard":
  686. _formdiv = new U.UF.UI.form(
  687. "电子白板",
  688. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  689. "id": "whiteboard",
  690. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  691. "onresize": function() {}
  692. }, {
  693. closecallback: function() {}
  694. }, { "style": { "height": "36px" } }).form; //创建窗体
  695. _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); } }
  696. break;
  697. case "investigation":
  698. _formdiv = new U.UF.UI.form(
  699. "问卷调查",
  700. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask?userid=" + _userid }), {
  701. "id": "investigation",
  702. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  703. "onresize": function() {}
  704. }, {
  705. closecallback: function() {}
  706. }, { "style": { "height": "36px" } }).form; //创建窗体
  707. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/ask.png)" }, "name": "问卷调查", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  708. break;
  709. case "note":
  710. _formdiv = new U.UF.UI.form(
  711. "便签分类",
  712. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/note?userid=" + _userid }), {
  713. "id": "note",
  714. "style": { "width": "20%", "height": "90%", "overflow": 'hidden' },
  715. "onresize": function() {}
  716. }, {
  717. closecallback: function() {}
  718. }, { "style": { "height": "36px" } }).form; //创建窗体
  719. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/note.png)" }, "name": "便签分类", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  720. break;
  721. // case "score":
  722. // _formdiv = new U.UF.UI.form(
  723. // "量规评分",
  724. // $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  725. // "id": "score",
  726. // "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  727. // "onresize": function() {}
  728. // }, {
  729. // closecallback: function() {}
  730. // }, { "style": { "height": "36px" } }).form; //创建窗体
  731. // _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/score.png)" }, "name": "量规评分", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  732. // break;
  733. case "mind":
  734. _formdiv = new U.UF.UI.form(
  735. "思维导图",
  736. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/kityminder-editor/dist/index.html" }), { //"/jsmind/example/demo.html"
  737. "id": "mind",
  738. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  739. "onresize": function() {}
  740. }, {
  741. closecallback: function() {}
  742. }, { "style": { "height": "36px" } }).form; //创建窗体
  743. _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); } }
  744. break;
  745. case "doc":
  746. // U.MD.D.I.isRoom();
  747. _formdiv = new U.UF.UI.form(
  748. "协同文档",
  749. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  750. "id": "doc",
  751. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  752. "onresize": function() {}
  753. }, {
  754. closecallback: function() {}
  755. }, { "style": { "height": "36px" } }).form; //创建窗体
  756. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  757. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  758. })
  759. _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); } }
  760. break;
  761. case "study":
  762. _formdiv = new U.UF.UI.form(
  763. "学习中心",
  764. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index?userid=" + _userid + "&oid=" + _oid }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  765. "id": "study",
  766. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  767. "onresize": function() {}
  768. }, {
  769. closecallback: function() {}
  770. }, { "style": { "height": "36px" } }).form; //创建窗体
  771. _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); } }
  772. break;
  773. case "mindNetwork": //好友打开
  774. _formdiv = new U.UF.UI.form(
  775. "思维网格",
  776. $$("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 }), {
  777. "id": "mindNetwork",
  778. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  779. "onresize": function() {}
  780. }, {
  781. closecallback: function() {}
  782. }, { "style": { "height": "36px" } }).form; //创建窗体
  783. _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); } }
  784. break;
  785. case "teacherClassRoom": //好友打开
  786. _formdiv = new U.UF.UI.form(
  787. "实时课堂",
  788. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/classRoom?userid=" + _userid + "&oid=" + _oid }), {
  789. "id": "teacherClassRoom",
  790. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  791. "onresize": function() {}
  792. }, {
  793. closecallback: function() {}
  794. }, { "style": { "height": "36px" } }).form; //创建窗体
  795. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/classRoom.png)" }, "name": "实时课堂", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  796. setTimeout(() => {
  797. U.UF.F.windowZooming(_formdiv)
  798. }, 0);
  799. break;
  800. }
  801. } else if (_type == 1 && _oid == "91305d49-01ba-11ed-8c78-005056b86db5") {
  802. switch (str) {
  803. case "project": //好友打开
  804. _formdiv = new U.UF.UI.form(
  805. "项目管理",
  806. $$("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=" + _userid + "&oid=" + _oid }), {
  807. "id": "project",
  808. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  809. "onresize": function() {}
  810. }, {
  811. closecallback: function() {}
  812. }, { "style": { "height": "36px" } }).form; //创建窗体
  813. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/project.png)" }, "name": "项目管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  814. break;
  815. case "evaluate":
  816. _formdiv = new U.UF.UI.form(
  817. "评价管理",
  818. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/works?userid=" + _userid + "&oid=" + _oid }), {
  819. "id": "evaluate",
  820. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  821. "onresize": function() {}
  822. }, {
  823. closecallback: function() {}
  824. }, { "style": { "height": "36px" } }).form; //创建窗体
  825. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/evaluation.png)" }, "name": "评价管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  826. break;
  827. case "notice":
  828. _formdiv = new U.UF.UI.form(
  829. "通知公告",
  830. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/notice?userid=" + _userid }), {
  831. "id": "notice",
  832. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  833. "onresize": function() {}
  834. }, {
  835. closecallback: function() {}
  836. }, { "style": { "height": "36px" } }).form; //创建窗体
  837. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/news.png)" }, "name": "通知公告", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  838. break;
  839. case "library":
  840. _formdiv = new U.UF.UI.form(
  841. "素材库",
  842. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/library?userid=" + _userid }), {
  843. "id": "library",
  844. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  845. "onresize": function() {}
  846. }, {
  847. closecallback: function() {}
  848. }, { "style": { "height": "36px" } }).form; //创建窗体
  849. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/library.png)" }, "name": "素材库", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  850. break;
  851. case "whiteboard":
  852. _formdiv = new U.UF.UI.form(
  853. "电子白板",
  854. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  855. "id": "whiteboard",
  856. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  857. "onresize": function() {}
  858. }, {
  859. closecallback: function() {}
  860. }, { "style": { "height": "36px" } }).form; //创建窗体
  861. _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); } }
  862. break;
  863. case "investigation":
  864. _formdiv = new U.UF.UI.form(
  865. "问卷调查",
  866. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask?userid=" + _userid }), {
  867. "id": "investigation",
  868. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  869. "onresize": function() {}
  870. }, {
  871. closecallback: function() {}
  872. }, { "style": { "height": "36px" } }).form; //创建窗体
  873. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/ask.png)" }, "name": "问卷调查", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  874. break;
  875. case "mind":
  876. _formdiv = new U.UF.UI.form(
  877. "思维导图",
  878. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/kityminder-editor/dist/index.html" }), { //"/jsmind/example/demo.html"
  879. "id": "mind",
  880. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  881. "onresize": function() {}
  882. }, {
  883. closecallback: function() {}
  884. }, { "style": { "height": "36px" } }).form; //创建窗体
  885. _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); } }
  886. break;
  887. case "doc":
  888. // U.MD.D.I.isRoom();
  889. _formdiv = new U.UF.UI.form(
  890. "协同文档",
  891. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  892. "id": "doc",
  893. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  894. "onresize": function() {}
  895. }, {
  896. closecallback: function() {}
  897. }, { "style": { "height": "36px" } }).form; //创建窗体
  898. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  899. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  900. })
  901. _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); } }
  902. break;
  903. case "study":
  904. _formdiv = new U.UF.UI.form(
  905. "学习中心",
  906. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index?userid=" + _userid + "&oid=" + _oid }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  907. "id": "study",
  908. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  909. "onresize": function() {}
  910. }, {
  911. closecallback: function() {}
  912. }, { "style": { "height": "36px" } }).form; //创建窗体
  913. _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); } }
  914. break;
  915. case "mindNetwork": //好友打开
  916. _formdiv = new U.UF.UI.form(
  917. "思维网格",
  918. $$("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 }), {
  919. "id": "mindNetwork",
  920. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  921. "onresize": function() {}
  922. }, {
  923. closecallback: function() {}
  924. }, { "style": { "height": "36px" } }).form; //创建窗体
  925. _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); } }
  926. break;
  927. }
  928. }
  929. //U.MD.D.I.openClick(str);
  930. //如果有任务栏信息
  931. if (_taskbar) {
  932. U.MD.D.T.taskbar(_taskbar); //创建任务处理
  933. }
  934. }
  935. // U.MD.D.I.openClick = function(str){
  936. // var click = '';
  937. // switch(str){
  938. // case 'friend':
  939. // click = '我的好友';
  940. // break;
  941. // case 'domain':
  942. // click = '域名管理';
  943. // break;
  944. // case 'disk':
  945. // click = '我的云盘';
  946. // break;
  947. // case 'word':
  948. // click = 'Word';
  949. // break;
  950. // case 'excel':
  951. // click = 'Execl';
  952. // break;
  953. // case 'txt':
  954. // click = '文本文件';
  955. // break;
  956. // case 'lookupFriend':
  957. // click = '查找好友';
  958. // break;
  959. // case 'ftp':
  960. // click = 'FTP';
  961. // break;
  962. // case 'group':
  963. // click = '群组';
  964. // break;
  965. // case 'set':
  966. // click = '我的设置';
  967. // break;
  968. // case 'systemSet':
  969. // click = '系统设置';
  970. // break;
  971. // case 'boomYun':
  972. // click = '互联办公';
  973. // break;
  974. // case 'xz':
  975. // click = '云端下载';
  976. // break;
  977. // case 'client':
  978. // click = '有思浏览器';
  979. // break;
  980. // case 'backEndProgramming':
  981. // click = '在线后台编程';
  982. // break;
  983. // case 'frontEndProgramming':
  984. // click = '在线前端编程';
  985. // break;
  986. // default: break;
  987. // }
  988. // if(U.MD.D.I.Ip && click){
  989. // var clickUrl = ':12588/useClick.php?name=' + click + '&ip=' + U.MD.D.I.Ip;
  990. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  991. // })
  992. // }
  993. // }
  994. /**
  995. *函数作用:ajax简易函数,使用post格式
  996. *@param url {data} 后台地址
  997. *@param data {data} 参数json
  998. *@param fn {data} 回调函数
  999. *
  1000. */
  1001. // U.MD.D.I.Mysqlrequest = function(url,fn){
  1002. // var xhr = new XMLHttpRequest();
  1003. // xhr.open("GET",url,true);
  1004. // xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  1005. // xhr.onreadystatechange = function(){
  1006. // if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)){
  1007. // fn.call(this,xhr.responseText);
  1008. // }
  1009. // };
  1010. // xhr.send();
  1011. // }
  1012. /*判断是否是内网IP*/
  1013. // U.MD.D.I.isInnerIPFn = function(str){
  1014. // var curPageUrl = str;
  1015. // var reg1 = /(http|ftp|https|www):\/\//g;//去掉前缀
  1016. // curPageUrl =curPageUrl.replace(reg1,'');
  1017. // // console.log('curPageUrl-1 '+curPageUrl);
  1018. // var reg2 = /\:+/g;//替换冒号为一点
  1019. // curPageUrl =curPageUrl.replace(reg2,'.');
  1020. // // console.log('curPageUrl-2 '+curPageUrl);
  1021. // curPageUrl = curPageUrl.split('.');//通过一点来划分数组
  1022. // var ipAddress = curPageUrl[0]+'.'+curPageUrl[1]+'.'+curPageUrl[2]+'.'+curPageUrl[3];
  1023. // if(curPageUrl[2] != '16'){
  1024. // return ipAddress;
  1025. // }else{
  1026. // return false;
  1027. // }
  1028. // }
  1029. // U.MD.D.I.getUserIP = function(onNewIP) { // onNewIp - your listener function for new IPs
  1030. // //compatibility for firefox and chrome
  1031. // var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
  1032. // var pc = new myPeerConnection({
  1033. // iceServers: []
  1034. // }),
  1035. // noop = function() {},
  1036. // localIPs = {},
  1037. // ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
  1038. // key;
  1039. // function iterateIP(ip) {
  1040. // if (!localIPs[ip]) onNewIP(ip);
  1041. // localIPs[ip] = true;
  1042. // }
  1043. // //create a bogus data channel
  1044. // pc.createDataChannel("");
  1045. // // create offer and set local description
  1046. // pc.createOffer().then(function(sdp) {
  1047. // sdp.sdp.split('\n').forEach(function(line) {
  1048. // if (line.indexOf('candidate') < 0) return;
  1049. // line.match(ipRegex).forEach(iterateIP);
  1050. // });
  1051. // pc.setLocalDescription(sdp, noop, noop);
  1052. // }).catch(function(reason) {
  1053. // // An error occurred, so handle the failure to connect
  1054. // });
  1055. // //sten for candidate events
  1056. // pc.onicecandidate = function(ice) {
  1057. // if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
  1058. // ice.candidate.candidate.match(ipRegex).forEach(iterateIP);
  1059. // };
  1060. // }
  1061. // U.MD.D.I.getUserIpBool = function(callback){
  1062. // U.MD.D.I.getUserIP(function(ip){
  1063. // alert("Got IP! :" + ip);
  1064. // });
  1065. //}
  1066. //#endregion