DeskTop.js 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  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. ];
  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. } else if (e.data.tools && e.data.tools == "17") {
  390. U.MD.D.I.openApplication("stuLibrary")
  391. }
  392. });
  393. U.MD.D.I.selectUser = function() {
  394. U.A.Request(US.Config.pbl + "selectUser?userid=" + US.userInfo.userid, [], function(res) { //US.userInfo.userid
  395. if (res.value[0].length > 0) {
  396. US.userInfo = res.value[0][0];
  397. $(".userName")[0].innerHTML = US.userInfo.username;
  398. }
  399. }, [], { "type": "GET", "withCredentials": true });
  400. }
  401. U.MD.D.I.openInApplication = function(str, data) {
  402. var _userinfo = US.userInfo, //登录用户信息
  403. _userid = US.userInfo.userid, //登录用户id
  404. _oid = _userinfo.organizeid;
  405. switch (str) {
  406. case "study":
  407. if (!_userinfo || Object.keys(_userinfo).length === 0) {
  408. setTimeout(() => {
  409. U.MD.U.L.login();
  410. }, 2000);
  411. } else {
  412. _formdiv = new U.UF.UI.form(
  413. "项目详情",
  414. $$("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 }), {
  415. "id": "study",
  416. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  417. "onresize": function() {}
  418. }, {
  419. closecallback: function() {}
  420. }, { "style": { "height": "36px" } }).form; //创建窗体
  421. _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); } }
  422. break;
  423. }
  424. }
  425. }
  426. U.MD.D.I.openApplication = function(str, obj, info) {
  427. obj = obj || {};
  428. var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
  429. _formdiv, //创建任务栏时同时弹出的窗体元素。
  430. _userinfo = US.userInfo, //登录用户信息
  431. _userid = obj.userid || US.userInfo.userid, //登录用户id
  432. _oid = obj.organizeid || _userinfo.organizeid,
  433. _type = US.userInfo.type;
  434. if (_type == 2 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  435. switch (str) {
  436. case "studnetProject": //好友打开
  437. _formdiv = new U.UF.UI.form(
  438. "我的项目",
  439. $$("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 }), {
  440. "id": "studnetProject",
  441. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  442. "onresize": function() {}
  443. }, {
  444. closecallback: function() {}
  445. }, { "style": { "height": "36px" } }).form; //创建窗体
  446. _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); } }
  447. break;
  448. case "studentEvaluate": //好友打开
  449. _formdiv = new U.UF.UI.form(
  450. "我的评价",
  451. $$("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 }), {
  452. "id": "studentEvaluate",
  453. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  454. "onresize": function() {}
  455. }, {
  456. closecallback: function() {}
  457. }, { "style": { "height": "36px" } }).form; //创建窗体
  458. _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); } }
  459. break;
  460. case "my":
  461. _formdiv = new U.UF.UI.form(
  462. "我的资料",
  463. $$("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 }), {
  464. "id": "my",
  465. "style": { "width": "42%", "height": "90%", "overflow": 'hidden' },
  466. "onresize": function() {}
  467. }, {
  468. closecallback: function() {}
  469. }, { "style": { "height": "36px" } }).form; //创建窗体
  470. _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); } }
  471. break;
  472. case "library":
  473. _formdiv = new U.UF.UI.form(
  474. "素材库",
  475. $$("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 }), {
  476. "id": "library",
  477. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  478. "onresize": function() {}
  479. }, {
  480. closecallback: function() {}
  481. }, { "style": { "height": "36px" } }).form; //创建窗体
  482. _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); } }
  483. break;
  484. case "whiteboard":
  485. _formdiv = new U.UF.UI.form(
  486. "电子白板",
  487. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  488. "id": "whiteboard",
  489. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  490. "onresize": function() {}
  491. }, {
  492. closecallback: function() {}
  493. }, { "style": { "height": "36px" } }).form; //创建窗体
  494. _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); } }
  495. break;
  496. case "investigation":
  497. _formdiv = new U.UF.UI.form(
  498. "问卷调查",
  499. $$("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 }), {
  500. "id": "investigation",
  501. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  502. "onresize": function() {}
  503. }, {
  504. closecallback: function() {}
  505. }, { "style": { "height": "36px" } }).form; //创建窗体
  506. _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); } }
  507. break;
  508. case "note":
  509. _formdiv = new U.UF.UI.form(
  510. "便签分类",
  511. $$("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 }), {
  512. "id": "note",
  513. "style": { "width": "20%", "height": "90%", "overflow": 'hidden' },
  514. "onresize": function() {}
  515. }, {
  516. closecallback: function() {}
  517. }, { "style": { "height": "36px" } }).form; //创建窗体
  518. _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); } }
  519. break;
  520. // case "score":
  521. // _formdiv = new U.UF.UI.form(
  522. // "量规评分",
  523. // $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  524. // "id": "score",
  525. // "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  526. // "onresize": function() {}
  527. // }, {
  528. // closecallback: function() {}
  529. // }, { "style": { "height": "36px" } }).form; //创建窗体
  530. // _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); } }
  531. // break;
  532. case "mind":
  533. _formdiv = new U.UF.UI.form(
  534. "思维导图",
  535. $$("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"
  536. "id": "mind",
  537. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  538. "onresize": function() {}
  539. }, {
  540. closecallback: function() {}
  541. }, { "style": { "height": "36px" } }).form; //创建窗体
  542. _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); } }
  543. break;
  544. case "doc":
  545. // U.MD.D.I.isRoom();
  546. _formdiv = new U.UF.UI.form(
  547. "协同文档",
  548. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  549. "id": "doc",
  550. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  551. "onresize": function() {}
  552. }, {
  553. closecallback: function() {}
  554. }, { "style": { "height": "36px" } }).form; //创建窗体
  555. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  556. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  557. })
  558. _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); } }
  559. break;
  560. case "studentStudy":
  561. _formdiv = new U.UF.UI.form(
  562. "学习中心",
  563. $$("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
  564. "id": "studentStudy",
  565. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  566. "onresize": function() {}
  567. }, {
  568. closecallback: function() {}
  569. }, { "style": { "height": "36px" } }).form; //创建窗体
  570. _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); } }
  571. break;
  572. case "mindNetwork": //好友打开
  573. _formdiv = new U.UF.UI.form(
  574. "思维网格",
  575. $$("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 }), {
  576. "id": "mindNetwork",
  577. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  578. "onresize": function() {}
  579. }, {
  580. closecallback: function() {}
  581. }, { "style": { "height": "36px" } }).form; //创建窗体
  582. _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); } }
  583. break;
  584. case "studentClassRoom": //好友打开
  585. _formdiv = new U.UF.UI.form(
  586. "实时课堂",
  587. $$("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 }), {
  588. "id": "studentClassRoom",
  589. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  590. "onresize": function() {}
  591. }, {
  592. closecallback: function() {}
  593. }, { "style": { "height": "36px" } }).form; //创建窗体
  594. _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); } }
  595. setTimeout(() => {
  596. U.UF.F.windowZooming(_formdiv)
  597. }, 0);
  598. break;
  599. }
  600. } else if (_type == 1 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  601. //选择应用处理
  602. switch (str) {
  603. case "project": //好友打开
  604. _formdiv = new U.UF.UI.form(
  605. "项目管理",
  606. $$("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 }), {
  607. "id": "project",
  608. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  609. "onresize": function() {}
  610. }, {
  611. closecallback: function() {}
  612. }, { "style": { "height": "36px" } }).form; //创建窗体
  613. _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); } }
  614. break;
  615. case "student":
  616. _formdiv = new U.UF.UI.form(
  617. "学生管理",
  618. $$("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 }), {
  619. "id": "student",
  620. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  621. "onresize": function() {}
  622. }, {
  623. closecallback: function() {}
  624. }, { "style": { "height": "36px" } }).form; //创建窗体
  625. _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); } }
  626. break;
  627. case "evaluate":
  628. _formdiv = new U.UF.UI.form(
  629. "评价管理",
  630. $$("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 }), {
  631. "id": "evaluate",
  632. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  633. "onresize": function() {}
  634. }, {
  635. closecallback: function() {}
  636. }, { "style": { "height": "36px" } }).form; //创建窗体
  637. _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); } }
  638. break;
  639. case "class":
  640. _formdiv = new U.UF.UI.form(
  641. "班级管理",
  642. $$("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 }), {
  643. "id": "class",
  644. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  645. "onresize": function() {}
  646. }, {
  647. closecallback: function() {}
  648. }, { "style": { "height": "36px" } }).form; //创建窗体
  649. _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); } }
  650. break;
  651. case "my":
  652. _formdiv = new U.UF.UI.form(
  653. "我的资料",
  654. $$("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 }), {
  655. "id": "my",
  656. "style": { "width": "42%", "height": "90%", "overflow": 'hidden' },
  657. "onresize": function() {}
  658. }, {
  659. closecallback: function() {}
  660. }, { "style": { "height": "36px" } }).form; //创建窗体
  661. _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); } }
  662. break;
  663. case "notice":
  664. _formdiv = new U.UF.UI.form(
  665. "通知公告",
  666. $$("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 }), {
  667. "id": "notice",
  668. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  669. "onresize": function() {}
  670. }, {
  671. closecallback: function() {}
  672. }, { "style": { "height": "36px" } }).form; //创建窗体
  673. _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); } }
  674. break;
  675. case "library":
  676. _formdiv = new U.UF.UI.form(
  677. "素材库",
  678. $$("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 }), {
  679. "id": "library",
  680. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  681. "onresize": function() {}
  682. }, {
  683. closecallback: function() {}
  684. }, { "style": { "height": "36px" } }).form; //创建窗体
  685. _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); } }
  686. break;
  687. case "whiteboard":
  688. _formdiv = new U.UF.UI.form(
  689. "电子白板",
  690. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  691. "id": "whiteboard",
  692. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  693. "onresize": function() {}
  694. }, {
  695. closecallback: function() {}
  696. }, { "style": { "height": "36px" } }).form; //创建窗体
  697. _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); } }
  698. break;
  699. case "investigation":
  700. _formdiv = new U.UF.UI.form(
  701. "问卷调查",
  702. $$("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 }), {
  703. "id": "investigation",
  704. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  705. "onresize": function() {}
  706. }, {
  707. closecallback: function() {}
  708. }, { "style": { "height": "36px" } }).form; //创建窗体
  709. _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); } }
  710. break;
  711. case "note":
  712. _formdiv = new U.UF.UI.form(
  713. "便签分类",
  714. $$("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 }), {
  715. "id": "note",
  716. "style": { "width": "20%", "height": "90%", "overflow": 'hidden' },
  717. "onresize": function() {}
  718. }, {
  719. closecallback: function() {}
  720. }, { "style": { "height": "36px" } }).form; //创建窗体
  721. _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); } }
  722. break;
  723. // case "score":
  724. // _formdiv = new U.UF.UI.form(
  725. // "量规评分",
  726. // $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  727. // "id": "score",
  728. // "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  729. // "onresize": function() {}
  730. // }, {
  731. // closecallback: function() {}
  732. // }, { "style": { "height": "36px" } }).form; //创建窗体
  733. // _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); } }
  734. // break;
  735. case "mind":
  736. _formdiv = new U.UF.UI.form(
  737. "思维导图",
  738. $$("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"
  739. "id": "mind",
  740. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  741. "onresize": function() {}
  742. }, {
  743. closecallback: function() {}
  744. }, { "style": { "height": "36px" } }).form; //创建窗体
  745. _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); } }
  746. break;
  747. case "doc":
  748. // U.MD.D.I.isRoom();
  749. _formdiv = new U.UF.UI.form(
  750. "协同文档",
  751. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  752. "id": "doc",
  753. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  754. "onresize": function() {}
  755. }, {
  756. closecallback: function() {}
  757. }, { "style": { "height": "36px" } }).form; //创建窗体
  758. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  759. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  760. })
  761. _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); } }
  762. break;
  763. case "study":
  764. _formdiv = new U.UF.UI.form(
  765. "学习中心",
  766. $$("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
  767. "id": "study",
  768. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  769. "onresize": function() {}
  770. }, {
  771. closecallback: function() {}
  772. }, { "style": { "height": "36px" } }).form; //创建窗体
  773. _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); } }
  774. break;
  775. case "mindNetwork": //好友打开
  776. _formdiv = new U.UF.UI.form(
  777. "思维网格",
  778. $$("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 }), {
  779. "id": "mindNetwork",
  780. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  781. "onresize": function() {}
  782. }, {
  783. closecallback: function() {}
  784. }, { "style": { "height": "36px" } }).form; //创建窗体
  785. _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); } }
  786. break;
  787. case "teacherClassRoom": //好友打开
  788. _formdiv = new U.UF.UI.form(
  789. "实时课堂",
  790. $$("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 }), {
  791. "id": "teacherClassRoom",
  792. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  793. "onresize": function() {}
  794. }, {
  795. closecallback: function() {}
  796. }, { "style": { "height": "36px" } }).form; //创建窗体
  797. _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); } }
  798. setTimeout(() => {
  799. U.UF.F.windowZooming(_formdiv)
  800. }, 0);
  801. break;
  802. }
  803. } else if (_type == 1 && _oid == "91305d49-01ba-11ed-8c78-005056b86db5") {
  804. switch (str) {
  805. case "project": //好友打开
  806. _formdiv = new U.UF.UI.form(
  807. "项目管理",
  808. $$("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 }), {
  809. "id": "project",
  810. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  811. "onresize": function() {}
  812. }, {
  813. closecallback: function() {}
  814. }, { "style": { "height": "36px" } }).form; //创建窗体
  815. _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); } }
  816. break;
  817. case "evaluate":
  818. _formdiv = new U.UF.UI.form(
  819. "评价管理",
  820. $$("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 }), {
  821. "id": "evaluate",
  822. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  823. "onresize": function() {}
  824. }, {
  825. closecallback: function() {}
  826. }, { "style": { "height": "36px" } }).form; //创建窗体
  827. _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); } }
  828. break;
  829. case "notice":
  830. _formdiv = new U.UF.UI.form(
  831. "通知公告",
  832. $$("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 }), {
  833. "id": "notice",
  834. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  835. "onresize": function() {}
  836. }, {
  837. closecallback: function() {}
  838. }, { "style": { "height": "36px" } }).form; //创建窗体
  839. _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); } }
  840. break;
  841. case "stuLibrary":
  842. _formdiv = new U.UF.UI.form(
  843. "学习资料",
  844. $$("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 }), {
  845. "id": "stuLibrary",
  846. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  847. "onresize": function() {}
  848. }, {
  849. closecallback: function() {}
  850. }, { "style": { "height": "36px" } }).form; //创建窗体
  851. _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); } }
  852. break;
  853. case "whiteboard":
  854. _formdiv = new U.UF.UI.form(
  855. "电子白板",
  856. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  857. "id": "whiteboard",
  858. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  859. "onresize": function() {}
  860. }, {
  861. closecallback: function() {}
  862. }, { "style": { "height": "36px" } }).form; //创建窗体
  863. _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); } }
  864. break;
  865. case "investigation":
  866. _formdiv = new U.UF.UI.form(
  867. "问卷调查",
  868. $$("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 }), {
  869. "id": "investigation",
  870. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  871. "onresize": function() {}
  872. }, {
  873. closecallback: function() {}
  874. }, { "style": { "height": "36px" } }).form; //创建窗体
  875. _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); } }
  876. break;
  877. case "mind":
  878. _formdiv = new U.UF.UI.form(
  879. "思维导图",
  880. $$("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"
  881. "id": "mind",
  882. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  883. "onresize": function() {}
  884. }, {
  885. closecallback: function() {}
  886. }, { "style": { "height": "36px" } }).form; //创建窗体
  887. _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); } }
  888. break;
  889. case "doc":
  890. // U.MD.D.I.isRoom();
  891. _formdiv = new U.UF.UI.form(
  892. "协同文档",
  893. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  894. "id": "doc",
  895. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  896. "onresize": function() {}
  897. }, {
  898. closecallback: function() {}
  899. }, { "style": { "height": "36px" } }).form; //创建窗体
  900. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  901. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  902. })
  903. _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); } }
  904. break;
  905. case "study":
  906. _formdiv = new U.UF.UI.form(
  907. "学习中心",
  908. $$("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
  909. "id": "study",
  910. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  911. "onresize": function() {}
  912. }, {
  913. closecallback: function() {}
  914. }, { "style": { "height": "36px" } }).form; //创建窗体
  915. _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); } }
  916. break;
  917. case "mindNetwork": //好友打开
  918. _formdiv = new U.UF.UI.form(
  919. "思维网格",
  920. $$("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 }), {
  921. "id": "mindNetwork",
  922. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  923. "onresize": function() {}
  924. }, {
  925. closecallback: function() {}
  926. }, { "style": { "height": "36px" } }).form; //创建窗体
  927. _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); } }
  928. break;
  929. }
  930. }
  931. //U.MD.D.I.openClick(str);
  932. //如果有任务栏信息
  933. if (_taskbar) {
  934. U.MD.D.T.taskbar(_taskbar); //创建任务处理
  935. }
  936. }
  937. // U.MD.D.I.openClick = function(str){
  938. // var click = '';
  939. // switch(str){
  940. // case 'friend':
  941. // click = '我的好友';
  942. // break;
  943. // case 'domain':
  944. // click = '域名管理';
  945. // break;
  946. // case 'disk':
  947. // click = '我的云盘';
  948. // break;
  949. // case 'word':
  950. // click = 'Word';
  951. // break;
  952. // case 'excel':
  953. // click = 'Execl';
  954. // break;
  955. // case 'txt':
  956. // click = '文本文件';
  957. // break;
  958. // case 'lookupFriend':
  959. // click = '查找好友';
  960. // break;
  961. // case 'ftp':
  962. // click = 'FTP';
  963. // break;
  964. // case 'group':
  965. // click = '群组';
  966. // break;
  967. // case 'set':
  968. // click = '我的设置';
  969. // break;
  970. // case 'systemSet':
  971. // click = '系统设置';
  972. // break;
  973. // case 'boomYun':
  974. // click = '互联办公';
  975. // break;
  976. // case 'xz':
  977. // click = '云端下载';
  978. // break;
  979. // case 'client':
  980. // click = '有思浏览器';
  981. // break;
  982. // case 'backEndProgramming':
  983. // click = '在线后台编程';
  984. // break;
  985. // case 'frontEndProgramming':
  986. // click = '在线前端编程';
  987. // break;
  988. // default: break;
  989. // }
  990. // if(U.MD.D.I.Ip && click){
  991. // var clickUrl = ':12588/useClick.php?name=' + click + '&ip=' + U.MD.D.I.Ip;
  992. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  993. // })
  994. // }
  995. // }
  996. /**
  997. *函数作用:ajax简易函数,使用post格式
  998. *@param url {data} 后台地址
  999. *@param data {data} 参数json
  1000. *@param fn {data} 回调函数
  1001. *
  1002. */
  1003. // U.MD.D.I.Mysqlrequest = function(url,fn){
  1004. // var xhr = new XMLHttpRequest();
  1005. // xhr.open("GET",url,true);
  1006. // xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  1007. // xhr.onreadystatechange = function(){
  1008. // if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)){
  1009. // fn.call(this,xhr.responseText);
  1010. // }
  1011. // };
  1012. // xhr.send();
  1013. // }
  1014. /*判断是否是内网IP*/
  1015. // U.MD.D.I.isInnerIPFn = function(str){
  1016. // var curPageUrl = str;
  1017. // var reg1 = /(http|ftp|https|www):\/\//g;//去掉前缀
  1018. // curPageUrl =curPageUrl.replace(reg1,'');
  1019. // // console.log('curPageUrl-1 '+curPageUrl);
  1020. // var reg2 = /\:+/g;//替换冒号为一点
  1021. // curPageUrl =curPageUrl.replace(reg2,'.');
  1022. // // console.log('curPageUrl-2 '+curPageUrl);
  1023. // curPageUrl = curPageUrl.split('.');//通过一点来划分数组
  1024. // var ipAddress = curPageUrl[0]+'.'+curPageUrl[1]+'.'+curPageUrl[2]+'.'+curPageUrl[3];
  1025. // if(curPageUrl[2] != '16'){
  1026. // return ipAddress;
  1027. // }else{
  1028. // return false;
  1029. // }
  1030. // }
  1031. // U.MD.D.I.getUserIP = function(onNewIP) { // onNewIp - your listener function for new IPs
  1032. // //compatibility for firefox and chrome
  1033. // var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
  1034. // var pc = new myPeerConnection({
  1035. // iceServers: []
  1036. // }),
  1037. // noop = function() {},
  1038. // localIPs = {},
  1039. // ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
  1040. // key;
  1041. // function iterateIP(ip) {
  1042. // if (!localIPs[ip]) onNewIP(ip);
  1043. // localIPs[ip] = true;
  1044. // }
  1045. // //create a bogus data channel
  1046. // pc.createDataChannel("");
  1047. // // create offer and set local description
  1048. // pc.createOffer().then(function(sdp) {
  1049. // sdp.sdp.split('\n').forEach(function(line) {
  1050. // if (line.indexOf('candidate') < 0) return;
  1051. // line.match(ipRegex).forEach(iterateIP);
  1052. // });
  1053. // pc.setLocalDescription(sdp, noop, noop);
  1054. // }).catch(function(reason) {
  1055. // // An error occurred, so handle the failure to connect
  1056. // });
  1057. // //sten for candidate events
  1058. // pc.onicecandidate = function(ice) {
  1059. // if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
  1060. // ice.candidate.candidate.match(ipRegex).forEach(iterateIP);
  1061. // };
  1062. // }
  1063. // U.MD.D.I.getUserIpBool = function(callback){
  1064. // U.MD.D.I.getUserIP(function(ip){
  1065. // alert("Got IP! :" + ip);
  1066. // });
  1067. //}
  1068. //#endregion