DeskTop.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  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.DeskIcon = [
  10. //
  11. // { "Name": "互联办公", "Url": "boomYun", "Img": { "x": "-844", "y": "-419"} },
  12. // { "Name": "Word", "Url": "word", "Img": { "x": "-462", "y": "-296"} },
  13. // { "Name": "Execl", "Url": "excel", "Img": { "x": "-523", "y": "-296"} },
  14. // { "Name": "文本文件", "Url": "txt", "Img": { "x": "-267", "y": "-413"} },
  15. // { "Name": "我的好友", "Url": "friend", "Img": { "x": "-648", "y": "-297"} },
  16. // { "Name": "查找好友", "Url": "lookupFriend", "Img": { "x": "-85", "y": "-413"} },
  17. // { "Name": "我的设置", "Url": "set", "Img": { "x": "-400", "y": "-296"} },
  18. // { "Name": "系统设置", "Url": "systemSet", "Img": { "x": "-144", "y": "-413"} },
  19. // { "Name": "云端下载", "Url": "client", "Img": { "x": "-648", "y": "-357"} },
  20. // { "Name": "云端产品", "Url": "xz", "Img": { "x": "-24", "y": "-413"} }
  21. // { "Name": "FTP", "Url": "ftp", "Img": { "x": "-24", "y": "-413"} },
  22. // { "Name": "群文档", "Url": "group", "Img": { "x": "-85", "y": "-413"} },
  23. // { "Name": "web编程", "Url": "frontEndProgramming", "Img": { "x": "-275", "y": "-297"} },
  24. // { "Name": "后端编程", "Url": "backEndProgramming", "Img": { "x": "-275", "y": "-297"} },
  25. { "Name": "项目管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  26. { "Name": "学习中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  27. { "Name": "学生管理", "Url": "student", "style": { "cssText": "background-image:url(/img/icon/student.png)" } },
  28. { "Name": "评价管理", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  29. { "Name": "班级管理", "Url": "class", "style": { "cssText": "background-image:url(/img/icon/class.png)" } },
  30. { "Name": "我的资料", "Url": "my", "style": { "cssText": "background-image:url(/img/icon/myMessage.png)" } },
  31. { "Name": "通知公告", "Url": "notice", "style": { "cssText": "background-image:url(/img/icon/news.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. ];
  40. //#region 桌面初始化a
  41. /**
  42. * 初始化桌面的起始函数
  43. *
  44. */
  45. U.MD.D.I.init = function() {
  46. if ($("#U_MD_D_K")[0]) {
  47. //初始化桌面图标
  48. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0]);
  49. // var clickUrl = ':12588/requestIp.php';
  50. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  51. // U.MD.D.I.Ip = data;
  52. // var AccessUrl = ':12588/useAccess.php?ip=' + U.MD.D.I.Ip;
  53. // U.MD.D.I.Mysqlrequest(AccessUrl,function(data){
  54. // U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
  55. // })
  56. // //初始化任务栏,因为是静态的,所以直接改变样式即可.
  57. // })
  58. }
  59. }
  60. /**
  61. * 隐藏任务栏
  62. *
  63. * @param {element} 桌面元素
  64. */
  65. U.MD.D.I.hiddenTaskbar = function(el) {
  66. //任务栏位置变小
  67. U.selectEl(el).parentElement(3).css({ "bottom": "-60px" });
  68. //桌面的位置变大
  69. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  70. }
  71. /**
  72. * 隐藏任务栏
  73. *
  74. * @param {element} 桌面元素
  75. */
  76. U.MD.D.I.hiddenTaskbarout = function(el) {
  77. //任务栏位置变小
  78. if (!U.UF.EV.stopBubbleMouseOutOrOver(el)) {
  79. //任务栏位置变化
  80. U.selectEl(el).css({ "bottom": "-60px" });
  81. //桌面的位置变大
  82. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  83. }
  84. }
  85. /**
  86. * 初始化打印桌面图标
  87. *
  88. * @param {element} 桌面元素
  89. */
  90. U.MD.D.I.initDesktopIcons = function(el) {
  91. var i, //用于循环
  92. _content, //桌面图标元素
  93. _iconcontent, //桌面图标元素
  94. _frag = $$("frag"), //定义一个碎片元素
  95. _DesktopIconInfo = U.MD.D.I.DeskIcon; //获取桌面图标
  96. //清楚桌面图标
  97. el.innerHTML = "";
  98. //循环创建桌面图标
  99. for (i = 0; i < _DesktopIconInfo.length; i++) {
  100. _content = $$("div", {
  101. className: "U_MD_D_KO",
  102. "onmousedown": U.UF.C.closure(function(obj) {
  103. //防止拖动图标即打开了桌面应用
  104. U.MD.D.click(this, obj);
  105. }, [_DesktopIconInfo[i]]),
  106. "onclick": U.UF.C.closure(function(obj) {
  107. //防止拖动图标即打开了桌面应用
  108. U.MD.D.click(this, obj);
  109. }, [_DesktopIconInfo[i]])
  110. }, _frag); //
  111. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  112. $$("div", { className: "U_MD_D_KOS U_Img", "style": _DesktopIconInfo[i].style }, _iconcontent); //{ "backgroundPosition": _DesktopIconInfo[i].Img.x + "px " + _DesktopIconInfo[i].Img.y + "px" }
  113. $$("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": _DesktopIconInfo[i].Name }, _iconcontent);
  114. }
  115. //加载好后给图标定位
  116. U.MD.D.iconPostion($(_frag).Child());
  117. //把图标加载到页面
  118. el.appendChild(_frag);
  119. }
  120. /**
  121. * 显示任务栏
  122. *
  123. * @param {element} 桌面元素
  124. */
  125. U.MD.D.I.displayTaskbar = function(el) {
  126. //判断是否需要形式任务栏,由于用了mouseover事件会冒泡响应多次,这里做了过滤
  127. if (!U.UF.EV.stopBubbleMouseOutOrOver(el) && U.selectEl(el).css("bottom") != "0px") {
  128. //任务栏位置变化
  129. U.selectEl(el).css({ "bottom": "0px" });
  130. //桌面位置变话
  131. // U.selectEl("#U_MD_D_K").css({ "left": "70px" });
  132. }
  133. }
  134. //#region 桌面图标拖动逻辑
  135. /**
  136. * 桌面排列图标
  137. *
  138. * @param {element} 桌面元素
  139. * @param {object} 上下相距的距离
  140. * @param {object} 左右相距的距离
  141. * @return {object} 命名空间
  142. */
  143. U.MD.D.iconPostion = function(childs, top, left) {
  144. var i; //用于循环处理
  145. top = top || 15; //如果没有设置元素的间距处理默认上间距为15
  146. left = left || 20; //如果没有设置元素的间距处理默认左间距为15
  147. //循环所有的图标,设置每个图标的间距,打印顺序是竖排打印的方式
  148. for (i = 0; i < childs.length; i++) {
  149. //如果竖排top超过了范围处理
  150. if (top + 95 > US.height - 10) {
  151. //left超过了页面范围处理,则向上重叠打印处理
  152. if ((left + 180) > US.width) {
  153. top -= 115;
  154. left -= 90;
  155. }
  156. //没有超过范围,那么left+90添加到下一个竖排打印
  157. else {
  158. left += 90;
  159. top = 15;
  160. };
  161. }
  162. //给图标的位置赋值
  163. U.selectEl(childs[i]).css({ top: top + "px", left: left + "px" });
  164. if (i < childs.length - 1) {
  165. //页面图标每次向下加115
  166. top += 115;
  167. }
  168. }
  169. //返回最后调用的图标的位置
  170. return [top, left];
  171. }
  172. /**
  173. * 桌面点击事件逻辑
  174. *
  175. * @param {element} 桌面元素
  176. * @param {object} 上下相距的距离
  177. * @param {object} 左右相距的距离
  178. * @return {object} 命名空间
  179. */
  180. U.MD.D.click = function(el, obj) {
  181. var _buttonnumber = event.button; //点击的按钮的事件值
  182. U.UF.EV.stopBubble(); //阻止向上冒泡
  183. //onmousedown 包含了左键和右键 这里大于2是为了兼容 所有浏览器的右键处理
  184. if (_buttonnumber < 2) {
  185. //如果是click事件的处理
  186. if (event.type == "click") {
  187. //如果元素在mousemove事件中没有移动则出发click事件
  188. if (!U.MD.D.I.IsDrag) {
  189. //打开应用处理
  190. U.MD.D.I.openApplication(obj.Url, { "userid": US.userInfo.UserId, "directoryid": US.FTPFOLDERID });
  191. }
  192. }
  193. //如果是mouse事件的处理
  194. else {
  195. //拖动处理,添加拖动和拖动结束事件
  196. U.UF.F.drag(el, U.MD.D.iconMove, U.MD.D.iconUp);
  197. }
  198. U.MD.D.I.IsDrag = false;
  199. }
  200. }
  201. /**
  202. * 拖动的处理
  203. *
  204. */
  205. U.MD.D.iconMove = function() {
  206. //如果当前位置点击初始化的位置出现了变化,则设置是否拖动的属性 U.MD.D.I.IsDrag为true
  207. U.MD.D.I.IsDrag = true;
  208. }
  209. /**
  210. * 拖动结束后,这里是定位处理,以网状的形式定位
  211. *
  212. * @param {element} 拖动的元素
  213. * @return {object} 命名空间
  214. */
  215. U.MD.D.iconUp = function(el) {
  216. var _top = 15,
  217. _left = 20,
  218. _margin,
  219. _childs = U.selectEl("#U_MD_D_K").Child(), //桌面所有的图标
  220. _positioninfo = U.UF.EL.getElementInfo(el); //获取拖动结束的元素的位置
  221. if (_positioninfo["OT"] > 15) {
  222. //网状的形式定位,如果差超过了55,那么向下定位,否则向上定位
  223. _margin = ((_positioninfo["OT"] - 15) % 115 > 55 && _positioninfo["OT"] + 115 < US.height) ? 1 : 0;
  224. _top = (Math.floor((_positioninfo["OT"] - 15) / 115) + _margin) * 115 + 15;
  225. }
  226. if (_positioninfo["OL"] > 20) {
  227. //网状的形式定位,如果差超过了90,那么向右定位,否则向左定位
  228. _margin = ((_positioninfo["OL"] - 20) % 90 > 45 && _positioninfo["OL"] + 90 < US.width) ? 1 : 0;
  229. _left = (Math.floor((_positioninfo["OL"] - 20) / 90) + _margin) * 90 + 20
  230. }
  231. //while循环判断么一个重叠的元素
  232. do {
  233. _positioninfo = U.MD.D.iconPostion([el], _top, _left); //给重叠的元素向下定位
  234. _top = _positioninfo[0] + 115; //得到定位后的top
  235. _left = _positioninfo[1]; //得到定位后的left
  236. } while (el = U.MD.D.isOverlap(el, _childs, _positioninfo))
  237. }
  238. /**
  239. * 判断拖动后图标是否重叠
  240. *
  241. * @param {element} 拖动的元素
  242. * @param {element} 桌面所有的元素
  243. * @param {array} 拖动元素的位置
  244. ----------[0] 上 top
  245. ----------[1] 左 left
  246. * @return {object} 命名空间
  247. */
  248. U.MD.D.isOverlap = function(el, childs, postionarray) {
  249. //循环所有的图标
  250. for (var i = 0; i < childs.length; i++) {
  251. //判断有没有和该图标诶子重叠的元素
  252. if (el != childs[i] && (childs[i].offsetTop == postionarray[0] && childs[i].offsetLeft == postionarray[1])) {
  253. return childs[i]; //如果有返回
  254. }
  255. }
  256. }
  257. //#endregion
  258. //#endregion
  259. //#region 桌面应用
  260. /**
  261. * 打开应用
  262. *
  263. * @param {string} 类型
  264. -----------------Disk 网盘系统
  265. -----------------PDisk 学习系统网盘
  266. -----------------Poto 图片
  267. -----------------Video 视频
  268. -----------------Music 音乐
  269. -----------------Word word
  270. -----------------Excel excel
  271. -----------------Txt 记事本
  272. -----------------PB 学习系统
  273. -----------------Blog 朋友圈系统
  274. -----------------FTP ftp系统
  275. -----------------Group 好友群
  276. -----------------SY 首页系统
  277. -----------------Set 个人设置
  278. -----------------XSet 系统设置
  279. -----------------App 我们所有的app
  280. -----------------BC c.1473.cn 平台
  281. -----------------CWeb d.1473.cn 变成平台
  282. -----------------其他的外联系统 我们统一用iframe打开
  283. * @param {array} 类型
  284. 如果第一个参数为"disk",则第二个参数为object,里面包含了用户id和目录id{userid:"",directoryid:""}
  285. 如果第一个参数为"word"或者"excel","txt",则第二个参数为文件信息fileinfo。
  286. 如果第一个参数为"blog"或者"PDisk"。建议删除。
  287. 如果第一个参数为其他,则无第二个参数
  288. * @returns {array}
  289. */
  290. window.addEventListener('message', function(e) { // 监听 message 事件
  291. // alert(e.data.type);
  292. if (e.data.type && e.data.type == "1") { //项目管理传入
  293. U.MD.D.I.openInApplication("study", e.data.cid)
  294. }
  295. });
  296. U.MD.D.I.openInApplication = function(str, data) {
  297. switch (str) {
  298. case "study":
  299. _formdiv = new U.UF.UI.form(
  300. "项目详情",
  301. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?userid=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5&courseId=" + data }), {
  302. "id": "study",
  303. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  304. "onresize": function() {}
  305. }, {
  306. closecallback: function() {}
  307. }, { "style": { "height": "36px" } }).form; //创建窗体
  308. _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); } }
  309. break;
  310. }
  311. }
  312. U.MD.D.I.openApplication = function(str, obj, info) {
  313. obj = obj || {};
  314. var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
  315. _formdiv, //创建任务栏时同时弹出的窗体元素。
  316. _userinfo = US.userInfo, //登录用户信息
  317. _userid = obj.userid || _userinfo.UserId //登录用户id
  318. ;
  319. //选择应用处理
  320. switch (str) {
  321. case "project": //好友打开
  322. _formdiv = new U.UF.UI.form(
  323. "项目管理",
  324. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course?userid=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), {
  325. "id": "project",
  326. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  327. "onresize": function() {}
  328. }, {
  329. closecallback: function() {}
  330. }, { "style": { "height": "36px" } }).form; //创建窗体
  331. _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); } }
  332. break;
  333. case "student":
  334. _formdiv = new U.UF.UI.form(
  335. "学生管理",
  336. $$("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=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), {
  337. "id": "student",
  338. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  339. "onresize": function() {}
  340. }, {
  341. closecallback: function() {}
  342. }, { "style": { "height": "36px" } }).form; //创建窗体
  343. _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); } }
  344. break;
  345. case "evaluate":
  346. _formdiv = new U.UF.UI.form(
  347. "评价管理",
  348. $$("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=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), {
  349. "id": "evaluate",
  350. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  351. "onresize": function() {}
  352. }, {
  353. closecallback: function() {}
  354. }, { "style": { "height": "36px" } }).form; //创建窗体
  355. _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); } }
  356. break;
  357. case "class":
  358. _formdiv = new U.UF.UI.form(
  359. "班级管理",
  360. $$("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=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), {
  361. "id": "class",
  362. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  363. "onresize": function() {}
  364. }, {
  365. closecallback: function() {}
  366. }, { "style": { "height": "36px" } }).form; //创建窗体
  367. _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); } }
  368. break;
  369. case "my":
  370. _formdiv = new U.UF.UI.form(
  371. "我的资料",
  372. $$("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=71160a48-11e2-11ec-80ad-005056b86db5" }), {
  373. "id": "my",
  374. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  375. "onresize": function() {}
  376. }, {
  377. closecallback: function() {}
  378. }, { "style": { "height": "36px" } }).form; //创建窗体
  379. _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); } }
  380. break;
  381. case "notice":
  382. _formdiv = new U.UF.UI.form(
  383. "通知公告",
  384. $$("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=71160a48-11e2-11ec-80ad-005056b86db5" }), {
  385. "id": "notice",
  386. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  387. "onresize": function() {}
  388. }, {
  389. closecallback: function() {}
  390. }, { "style": { "height": "36px" } }).form; //创建窗体
  391. _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); } }
  392. break;
  393. case "library":
  394. _formdiv = new U.UF.UI.form(
  395. "素材库",
  396. $$("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=71160a48-11e2-11ec-80ad-005056b86db5" }), {
  397. "id": "library",
  398. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  399. "onresize": function() {}
  400. }, {
  401. closecallback: function() {}
  402. }, { "style": { "height": "36px" } }).form; //创建窗体
  403. _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); } }
  404. break;
  405. case "whiteboard":
  406. _formdiv = new U.UF.UI.form(
  407. "电子白板",
  408. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  409. "id": "whiteboard",
  410. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  411. "onresize": function() {}
  412. }, {
  413. closecallback: function() {}
  414. }, { "style": { "height": "36px" } }).form; //创建窗体
  415. _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); } }
  416. break;
  417. case "investigation":
  418. _formdiv = new U.UF.UI.form(
  419. "问卷调查",
  420. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/ibw" }), {
  421. "id": "investigation",
  422. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  423. "onresize": function() {}
  424. }, {
  425. closecallback: function() {}
  426. }, { "style": { "height": "36px" } }).form; //创建窗体
  427. _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); } }
  428. break;
  429. case "note":
  430. _formdiv = new U.UF.UI.form(
  431. "便签分类",
  432. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/jsMemo/index.html" }), {
  433. "id": "note",
  434. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  435. "onresize": function() {}
  436. }, {
  437. closecallback: function() {}
  438. }, { "style": { "height": "36px" } }).form; //创建窗体
  439. _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); } }
  440. break;
  441. case "score":
  442. _formdiv = new U.UF.UI.form(
  443. "量规评分",
  444. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  445. "id": "score",
  446. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  447. "onresize": function() {}
  448. }, {
  449. closecallback: function() {}
  450. }, { "style": { "height": "36px" } }).form; //创建窗体
  451. _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); } }
  452. break;
  453. case "mind":
  454. _formdiv = new U.UF.UI.form(
  455. "思维导图",
  456. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/jsmind/example/demo.html" }), {
  457. "id": "mind",
  458. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  459. "onresize": function() {}
  460. }, {
  461. closecallback: function() {}
  462. }, { "style": { "height": "36px" } }).form; //创建窗体
  463. _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); } }
  464. break;
  465. case "doc":
  466. _formdiv = new U.UF.UI.form(
  467. "协同文档",
  468. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  469. "id": "doc",
  470. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  471. "onresize": function() {}
  472. }, {
  473. closecallback: function() {}
  474. }, { "style": { "height": "36px" } }).form; //创建窗体
  475. _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); } }
  476. break;
  477. case "study":
  478. _formdiv = new U.UF.UI.form(
  479. "学习中心",
  480. $$("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=71160a48-11e2-11ec-80ad-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5" }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  481. "id": "study",
  482. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  483. "onresize": function() {}
  484. }, {
  485. closecallback: function() {}
  486. }, { "style": { "height": "36px" } }).form; //创建窗体
  487. _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); } }
  488. break;
  489. case "friend": //好友打开
  490. U.MD.D.I.IsDrag = true;
  491. U.MD.F.W.viewFriend(info); //打开好友
  492. // U.MD.N.urlWrite("friend/" + obj.directoryid, "好友"); //好友的url重写
  493. break;
  494. case "domain":
  495. var _iframe = $$('iframe', { src: '//domain.1473.cn/DomainSystem.aspx/?fileId=' + info.fileId + '&type=' + info.type + '&mode=' + info.mode, frameborder: "0", style: { cssText: "width:100%;height:100%;border:0px" } });
  496. _formdiv = new U.UF.UI.form("域名管理", _iframe, { id: "U_MD_DS_DomainShare", style: { "width": "370px", "height": "390px" } }).form;
  497. if (_formdiv) {
  498. //生成任务栏的变量
  499. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-15px -296px", "name": "网盘", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  500. }
  501. break;
  502. case "disk": //个人网盘查看
  503. _formdiv = U.MD.DK.initDisk(_userid, obj.directoryid); //根据网盘数据,并加载网盘,里面包含了url重写
  504. if (_formdiv) {
  505. //生成任务栏的变量
  506. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-15px -296px", "name": "网盘", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  507. }
  508. break;
  509. case "word": //Word打开
  510. var _wordinfo = U.MD.O.word(_userinfo, obj, arguments[2]); //初始化word的处理
  511. _formdiv = _wordinfo[0];
  512. if (_formdiv) {
  513. //生成任务栏的变量
  514. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-462px -296px", "name": "文档", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, _wordinfo[1]); } }
  515. }
  516. if (obj.UrlType != 'join') {
  517. U.MD.N.urlWrite("word/" + _formdiv.id.substr(-36), "在线文档"); //word的url重写
  518. }
  519. break;
  520. case "excel": //Excel打开
  521. _formdiv = U.MD.O.excel(_userinfo, obj);
  522. if (_formdiv) {
  523. //生成任务栏的变量
  524. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-523px -296px", "name": "Excel", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  525. }
  526. U.MD.N.urlWrite("excel/" + _formdiv.id.substr(-36), "Excel");
  527. break;
  528. case "txt": //Txt打开
  529. _formdiv = U.MD.D.Txt.textCreate();
  530. if (_formdiv) {
  531. //生成任务栏的变量
  532. _taskbar = { "id": str + obj.directoryid, "backgroundPostion": "-267px -413px", "name": "文本", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  533. }
  534. U.MD.N.urlWrite("txt/" + _formdiv.id.substr(-36), "文本");
  535. break;
  536. case "lookupFriend":
  537. _formdiv = U.MD.F.S.popSearchFriendsOrGroupForm(0);
  538. //生成任务栏的变量
  539. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-85px -413px", "name": "查找好友", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  540. U.MD.N.urlWrite("lookupfriend/" + obj.directoryid.substr(-36), "查找好友"); //查找好友的url重写
  541. break;
  542. case "ftp": //Ftp
  543. _formdiv = U.MD.F.S.popupsSearchFtp();
  544. //生成任务栏的变量
  545. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-144px -413px", "name": "FTP", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  546. break;
  547. case "group": //群组
  548. _formdiv = U.MD.F.S.popupsSearchGroups(0);
  549. //生成任务栏的变量
  550. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-85px -413px", "name": "群组", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  551. break;
  552. case "set": //个人设置
  553. _formdiv = U.MD.U.P.userDataSet();
  554. if (_formdiv) {
  555. //生成任务栏的变量
  556. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-400px -296px", "name": "个人设置", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  557. }
  558. break;
  559. case "systemSet": //系统设置
  560. _formdiv = U.MD.D.B.init();
  561. //生成任务栏的变量
  562. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-400px -296px", "name": "系统设置", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  563. break;
  564. case "boomYun": //BoomYun
  565. _formdiv = U.Boom.I.onload();
  566. //生成任务栏的变量
  567. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-844px -419px", "name": "互联办公", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj); } }
  568. U.MD.N.urlWrite("boomyun", "互联办公"); //boomyun的url重写
  569. break;
  570. case "xz": //App下载
  571. window.open("http://xz.1473.cn");
  572. break;
  573. case "client": //App下载
  574. window.open("http://client.1473.cn");
  575. break;
  576. case "backEndProgramming": //在线编程平台打开
  577. window.open("http://c.1473.cn");
  578. break;
  579. case "frontEndProgramming": //在线web编程
  580. window.open("http://d.1473.cn");
  581. break;
  582. default:
  583. break;
  584. }
  585. //U.MD.D.I.openClick(str);
  586. //如果有任务栏信息
  587. if (_taskbar) {
  588. U.MD.D.T.taskbar(_taskbar); //创建任务处理
  589. }
  590. }
  591. // U.MD.D.I.openClick = function(str){
  592. // var click = '';
  593. // switch(str){
  594. // case 'friend':
  595. // click = '我的好友';
  596. // break;
  597. // case 'domain':
  598. // click = '域名管理';
  599. // break;
  600. // case 'disk':
  601. // click = '我的云盘';
  602. // break;
  603. // case 'word':
  604. // click = 'Word';
  605. // break;
  606. // case 'excel':
  607. // click = 'Execl';
  608. // break;
  609. // case 'txt':
  610. // click = '文本文件';
  611. // break;
  612. // case 'lookupFriend':
  613. // click = '查找好友';
  614. // break;
  615. // case 'ftp':
  616. // click = 'FTP';
  617. // break;
  618. // case 'group':
  619. // click = '群组';
  620. // break;
  621. // case 'set':
  622. // click = '我的设置';
  623. // break;
  624. // case 'systemSet':
  625. // click = '系统设置';
  626. // break;
  627. // case 'boomYun':
  628. // click = '互联办公';
  629. // break;
  630. // case 'xz':
  631. // click = '云端下载';
  632. // break;
  633. // case 'client':
  634. // click = '有思浏览器';
  635. // break;
  636. // case 'backEndProgramming':
  637. // click = '在线后台编程';
  638. // break;
  639. // case 'frontEndProgramming':
  640. // click = '在线前端编程';
  641. // break;
  642. // default: break;
  643. // }
  644. // if(U.MD.D.I.Ip && click){
  645. // var clickUrl = ':12588/useClick.php?name=' + click + '&ip=' + U.MD.D.I.Ip;
  646. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  647. // })
  648. // }
  649. // }
  650. /**
  651. *函数作用:ajax简易函数,使用post格式
  652. *@param url {data} 后台地址
  653. *@param data {data} 参数json
  654. *@param fn {data} 回调函数
  655. *
  656. */
  657. // U.MD.D.I.Mysqlrequest = function(url,fn){
  658. // var xhr = new XMLHttpRequest();
  659. // xhr.open("GET",url,true);
  660. // xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  661. // xhr.onreadystatechange = function(){
  662. // if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)){
  663. // fn.call(this,xhr.responseText);
  664. // }
  665. // };
  666. // xhr.send();
  667. // }
  668. /*判断是否是内网IP*/
  669. // U.MD.D.I.isInnerIPFn = function(str){
  670. // var curPageUrl = str;
  671. // var reg1 = /(http|ftp|https|www):\/\//g;//去掉前缀
  672. // curPageUrl =curPageUrl.replace(reg1,'');
  673. // // console.log('curPageUrl-1 '+curPageUrl);
  674. // var reg2 = /\:+/g;//替换冒号为一点
  675. // curPageUrl =curPageUrl.replace(reg2,'.');
  676. // // console.log('curPageUrl-2 '+curPageUrl);
  677. // curPageUrl = curPageUrl.split('.');//通过一点来划分数组
  678. // var ipAddress = curPageUrl[0]+'.'+curPageUrl[1]+'.'+curPageUrl[2]+'.'+curPageUrl[3];
  679. // if(curPageUrl[2] != '16'){
  680. // return ipAddress;
  681. // }else{
  682. // return false;
  683. // }
  684. // }
  685. // U.MD.D.I.getUserIP = function(onNewIP) { // onNewIp - your listener function for new IPs
  686. // //compatibility for firefox and chrome
  687. // var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
  688. // var pc = new myPeerConnection({
  689. // iceServers: []
  690. // }),
  691. // noop = function() {},
  692. // localIPs = {},
  693. // ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
  694. // key;
  695. // function iterateIP(ip) {
  696. // if (!localIPs[ip]) onNewIP(ip);
  697. // localIPs[ip] = true;
  698. // }
  699. // //create a bogus data channel
  700. // pc.createDataChannel("");
  701. // // create offer and set local description
  702. // pc.createOffer().then(function(sdp) {
  703. // sdp.sdp.split('\n').forEach(function(line) {
  704. // if (line.indexOf('candidate') < 0) return;
  705. // line.match(ipRegex).forEach(iterateIP);
  706. // });
  707. // pc.setLocalDescription(sdp, noop, noop);
  708. // }).catch(function(reason) {
  709. // // An error occurred, so handle the failure to connect
  710. // });
  711. // //sten for candidate events
  712. // pc.onicecandidate = function(ice) {
  713. // if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
  714. // ice.candidate.candidate.match(ipRegex).forEach(iterateIP);
  715. // };
  716. // }
  717. // U.MD.D.I.getUserIpBool = function(callback){
  718. // U.MD.D.I.getUserIP(function(ip){
  719. // alert("Got IP! :" + ip);
  720. // });
  721. //}
  722. //#endregion