DeskTop.js 68 KB

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