Word.js 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880
  1. //查看指定文件,,判断是否保存或者覆盖,包括创建邀请协作人员,创建编辑历史,创建生成链接.创建热门模板。加载当前word文档的内容。创建光标,监控键盘输入等。这里是iframe中的word起始点。
  2. //监控输入输出,
  3. //添加成员,共同编辑。
  4. Namespace.register("U.MD.O.W");
  5. document.oncontextmenu = U.UF.EV.stopDefault; //禁止右键菜单
  6. //由于当前文档的js是加载在ifame里面的,获取不到外部的文档(www.1473.cn)信息。所以通过传递参数设置全局变量的形式保存当前文档信息。
  7. //id是word文档id,PID是文档归属的目录id,fileinfo是文档的实体信息fileinfo,OL初始化回调函数,userid是当前文档创建者的id。 historyid就是最新历史记录的id
  8. U.MD.O.W = {
  9. "fileinfo": null, //文档的信息
  10. "userinfo": null, //文档用户的信息
  11. "historyid": US.EMPTYGUID, //历史记录更新的id
  12. "permission": { //权限设置
  13. "edit": true,
  14. "web": true
  15. },
  16. "init": false
  17. };
  18. US = parent.US;
  19. //#region 初始化区域
  20. //------------------------------------------------------------------------------初始化Word----------------------------------------------------------------------------
  21. //查看指定文件,,判断是否保存或者覆盖,包括创建邀请协作人员,创建编辑历史,创建生成链接.创建热门模板。加载当前word文档的内容。创建光标,监控键盘输入等。这里是iframe中的word起始点。
  22. /**
  23. * word初始化的处理
  24. *
  25. * @param {object} 文档信息
  26. * @param {object} 登录用户信息
  27. * @return {object} 返回当前窗体
  28. */
  29. // U.MD.O.W.load = async function (fileid, userinfo) {
  30. U.MD.O.W.load = async function (cid, stage, task, tool, type) {
  31. //U.MD.O.W.openRoomConfirm();
  32. // var fileinfo = U.MD.O.W.getfile(),
  33. var fileinfo, userinfo;
  34. userinfo = await U.MD.O.W.getuser();
  35. if (type == '2') {
  36. if (cid && (stage || stage == 0) && (task || task == 0) && (tool || tool == 0)) {
  37. fileinfo = await U.MD.O.W.getWorkS(cid, stage, task, tool, userinfo.userid);
  38. } else {
  39. fileinfo = U.MD.O.W.getfile()
  40. }
  41. } else {
  42. if (cid && (stage || stage == 0) && (task || task == 0) && (tool || tool == 0)) {
  43. fileinfo = await U.MD.O.W.getWork(cid, stage, task, tool, userinfo.userid);
  44. } else {
  45. fileinfo = U.MD.O.W.getfile()
  46. }
  47. }
  48. U.MD.O.W.variable(fileinfo, userinfo); //初始化全局变量
  49. U.MD.O.W.setPermission(); //获取权限
  50. U.MD.O.W.setEvent(); //设置事件
  51. U.MD.O.W.E.createSelection(); //创建下拉框
  52. U.MD.O.W.E.toolsbind(); //初始化工具栏
  53. U.MD.O.W.loadContent(fileinfo); //加载内容
  54. //加载功能
  55. U.MD.O.W.Panel.loadlink(fileinfo); //加载链接窗体
  56. //U.MD.O.W.Panel.loadHotTemplates(); //加载热门模板
  57. //U.MD.O.W.Panel.loadOfficeHistory(fileinfo); //加载历史记录
  58. // U.MD.O.W.Panel.loadPlayUser(fileinfo); //加载协助人员窗体
  59. // //如果是协作文档,加载协作窗体
  60. // if (U.MD.O.W.permission.web) {
  61. // U.MD.O.W.Panel.loadPlayUser(fileinfo); //加载协助人员窗体
  62. // }
  63. // //如果不是协同文档,那么协同文档的窗体不显示,那么热门和链接窗体向上移
  64. // else {
  65. // $("#LoadOfficeHistory")[0].style.top = "140px";
  66. // $("#LoadHotTemplates")[0].style.top = "434px";
  67. // }
  68. }
  69. /**
  70. * 根据cookie获取用户
  71. *
  72. */
  73. U.MD.O.W.getuser = async function () {
  74. return new Promise((resolve, reject) => {
  75. U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
  76. if (res.value && res.value[0] && res.value[0][0]) {
  77. var _user = res.value[0][0];
  78. U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
  79. if (res.value && res.value[0] && res.value[0][0]) {
  80. US.userInfo = res.value[0][0];
  81. U.A.Request(US.Config.pbl + "selectUser?userid=" + _user.userid, [], function (res) { //US.userInfo.userid
  82. if (res.value == null || res.value[0].length == 0) {
  83. US.userInfo.userid = _user.userid;
  84. resolve(US.userInfo); //记录用户数据
  85. } else {
  86. US.userInfo = res.value[0][0];
  87. US.userInfo.userid = _user.userid;
  88. resolve(res.value[0][0]); //记录用户数据
  89. }
  90. }, [], { "type": "GET", "withCredentials": true });
  91. }
  92. }, [], { "type": "GET", "withCredentials": true });
  93. }
  94. }, [], { "type": "GET", "withCredentials": true });
  95. });
  96. }
  97. U.MD.O.W.getMyfile = function () {
  98. return {
  99. UserDirectoryExtendType: "uw", //默认导航模式
  100. UsOffice: US.data,
  101. UserDirectoryID: Guid.newGuid(),
  102. newfile: US.roomid ? false : true,
  103. };
  104. }
  105. /**
  106. * 根据文件id获取文件
  107. *
  108. */
  109. U.MD.O.W.getfile = function (fileid) {
  110. return {
  111. UserDirectoryExtendType: "uw", //默认导航模式
  112. UsOffice: '',
  113. //UsOffice: '<div id="e4c133031-1982-c72b-525a-32a2ffb5bd4c" style="text-align: center;" name="U_MD_O_W_Font_Heading1"><span style="font-family: 微软雅黑; font-size: 48px; font-weight: bold;">什么是互联办公?</span></div><div id="e3412c1ae-730c-f87e-494c-c5df81a459e0" style="line-height: 2;"><span style="font-family: 微软雅黑; font-size: 16px;">&nbsp; 为了提高办公效率,解决现有word不能多人协同办公的问题,解决在外地旅游、出差不能办公的问题,我们提出了互联办公的概念。</span></div><div id="ecf866d78-6644-f14f-74f9-c31eaa0097a0" style="line-height: 2;"><span style="font-family: 微软雅黑; font-size: 16px;">&nbsp; 互联办公云平台是一款可以多端操作、多人协同、以网页形式编辑、以网站形式展示的互联网办公平台。互联办公云平台可以在ipad、手机、电脑以及其他支持浏览器的终端设备上进行操作;可以多人共同编辑同一份文档,实现文档的自动整合以及实时更新;可以在主流浏览器上进行文档的编辑修改,也可以输入好网站内容,一键发布完成专业化的企业网站。</span></div><div id="e8901ef2d-0b82-138f-91b0-e5697edfd6ca" style="line-height: 2;"><span style="font-family: 微软雅黑; font-size: 16px;">&nbsp; 互联办公云平台前端采用html+css技术实现, 后端使用java,Net,Nodejs予以实现,web服务器采用分布式集群部署,支持多人同时在线。</span><br></div><div id="e9c0df904-ebab-1392-7364-4ccab9862a9c" style="line-height: 2;"><br></div><div id="ebdb59933-5920-b5ae-1568-27fc769aeb3b" style="font-family: 微软雅黑; font-weight: bold; font-size: 16pt;" name="U_MD_O_W_Font_Heading2"><span style=""></span><span>1.实现随时随地办公</span></div><div id="ebd1bf28a-4f62-4ec1-346a-bb388c2191cd" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;">当需要紧急修改文件时,即使你在外地,在旅游,在出差,拿出手机即可修改文件,修改好的文件会即时呈现在领导面前,解决了用户出门在外不能同步办公的难题。</span></div><div id="e9a9993df-f28c-461b-0880-2848f1c2ccdc" style="line-height: 2;"><br></div><div id="e117f341a-f3c4-3d44-9145-57b86e09765c" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;"></span></div><div id="eb878bcdc-91a8-cd5c-d7bd-0e506fc83d0b" style="font-family: 微软雅黑; font-weight: bold; font-size: 16pt; line-height: 2;" name="U_MD_O_W_Font_Heading2"><span>2.解决了现有word不能多人协同办公的问题</span></div><div id="ec9514631-09c8-8329-a9de-106f7d88594f" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;">互联办公云平台把Word互联网化,允许多人编辑同一份文件,效果即时呈现,适合收集用户资料场景,提高办公效率。</span></div><div id="ecb60e99a-6e75-0c84-8b41-f5aa6b130d05" style="line-height: 2;"><br></div><div id="e99e0c9dd-506c-3d63-07cd-ff4a46f232b5" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;"></span></div><div id="e7f202d5b-8e90-a816-1ce8-5c12fde78637" style="font-family: 微软雅黑; font-weight: bold; font-size: 16pt; line-height: 2;" name="U_MD_O_W_Font_Heading2"><span>3.提高办公效率</span></div><div id="e2fdfea7a-38fb-b8bb-7ee5-a96644677f14" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;">解决了人们需分工合作以及整合文档需耗费大量时间的难题,当你需要收集公司各成员的个人信心档案时,只需要一个链接邀请大家编辑,成百上千个人就会在一份文档里面填写资料,以此解决用户需分工合作,整合文档工作量过大的问题。</span></div><div id="ea863ad74-d055-e53b-c23d-d1c76cbc5ee4" style="line-height: 2;"><br></div><div id="edb122ca1-ec53-5040-28f7-b0e2790869ee" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;"></span></div><div id="e332557aa-d8d2-45c9-d2e5-147fb7d8bf2c" style="font-family: 微软雅黑; font-weight: bold; font-size: 16pt; line-height: 2;" name="U_MD_O_W_Font_Heading2"><span>4.Word直接生成企业网站</span></div><div id="e22923078-2bcf-06a2-566f-ab1ed876afa5" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;">互联办公云平台为企业办公人员提供导航模式,用户无需了解前后台代码,以所见即所得的方式,编辑网站内容,一键发布即可生成专业化的企业网站,为企业解决需找专业代码人员耗费大量时间及耗费大量资金的问题。</span></div><div id="e08ee9567-3e92-999b-ba7e-815db2e29477" style="line-height: 2;"><br></div><div id="e50a05822-32af-439f-85bd-186f5358a6ba" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;"></span></div><div id="e9169080d-5ce2-c385-519d-952aea83d3f2" style="font-family: 微软雅黑; font-weight: bold; font-size: 16pt; line-height: 2;" name="U_MD_O_W_Font_Heading2"><span>5.解决用户文件丢失的问题</span></div><div id="e4a9be289-9b20-9131-4986-e530367a1d04" style="line-height: 2;"><span style="font-size: 18px; font-family: 微软雅黑;">互联办公云平台为用户提供所有文件支持云端存储,可上传任何格式的文件的功能用户不需要安装应用,只需要在网页上输入网址即可找到自己的文件。云端网盘采用树目录分类,方便用户查找文件,以此解决文件容易丢失的问题。</span><span style="font-size: 18px;"></span><span style=""></span><br></div>',
  114. UserDirectoryID: Guid.newGuid(),
  115. newfile: fileid ? false : true
  116. };
  117. }
  118. /**
  119. * 初始化全局变量
  120. * @param {object} 文档信息
  121. * @param {object} 登录用户信息
  122. *
  123. */
  124. U.MD.O.W.variable = function (fileinfo, userinfo) {
  125. //如果已经有全局变量 说明该文档已经是加载过了,不需要重复设置
  126. if (!U.MD.O.W.fileinfo) {
  127. U.MD.O.W.fileinfo = fileinfo //文档信息
  128. }
  129. //设置用户信息,为什么上面的不需要重复设置下面的需要呢,因为用户可能会注销
  130. U.MD.O.W.userInfo = userinfo; //用户信息
  131. }
  132. /**
  133. * 编辑器权限函数
  134. * @return 返回用户权限json
  135. */
  136. U.MD.O.W.setPermission = function () {
  137. U.MD.O.W.permission.web = true; //互联办公的权限
  138. U.MD.O.W.permission.edit = true; //就给其编辑权限
  139. // var _iseditor, _isgroup; //是否可编辑 //群用户
  140. // //权限主要包含了是否可编辑,是否互联办公文档查看
  141. // //判断文件是否是用户的群文档 US.friend.group这个变量需要独立
  142. // if (U.MD.O.W.fileinfo.GroupID && US.friend.group) {
  143. // _isgroup = U.Json.select(US.friend.group, { "GroupManageID": U.MD.O.W.fileinfo.GroupID });
  144. // if (_isgroup) {
  145. // U.MD.O.W.permission.web = true; //互联办公的权限
  146. // U.MD.O.W.permission.edit = true; //就给其编辑权限
  147. // }
  148. // }
  149. // //如果是共享文档,那么谁都可以编辑,如果是自己的文档那么也可以编辑
  150. // else if (((U.MD.O.W.fileinfo.GroupID && U.MD.O.W.fileinfo.GroupID == U.MD.O.W.userInfo.userid) || U.MD.O.W.fileinfo.UserId == US.userInfo.userid)) {//判断是否是有编辑权限
  151. // U.MD.O.W.permission.edit = true; //就给其编辑权限
  152. // if (U.MD.O.W.fileinfo.UserId == US.userInfo.userid) {
  153. // U.MD.O.W.permission.web = true;//互联办公的权限
  154. // }
  155. // }
  156. }
  157. /**
  158. * 设置事件
  159. *
  160. */
  161. U.MD.O.W.setEvent = function () {
  162. //un文件设置事件
  163. if (U.MD.O.W.fileinfo.UserDirectoryExtendType == 'un') {
  164. //设置保存事件
  165. $('#U_MD_O_H_save')[0].onclick = function () {
  166. U.MD.O.W.T.N.saveNav(function () {
  167. U.MD.O.W.T.N.savePage(null, true);
  168. });
  169. }
  170. $('body').addClass('U_MD_O_W_Nav');
  171. }
  172. //uw文件设置事件
  173. else {
  174. //设置保存事件
  175. $('#U_MD_O_H_save')[0].onclick = function () {
  176. U.MD.O.W.save()
  177. }
  178. $('body').removeClass('U_MD_O_W_Nav');
  179. }
  180. //设置新建事件
  181. $('#U_MD_O_H_new')[0].onclick = function () {
  182. U.MD.O.W.newdocument();
  183. }
  184. //下载处理
  185. $("#U_MD_O_H_Area_Down")[0].onclick = function () {
  186. top.U.MD.C.D.downloadFileOrDir([U.MD.O.W.fileinfo], "true"); //下载文档
  187. }
  188. //添加Ctrl+S快捷保存事件
  189. $('body')[0].onkeydown = function (e) {
  190. var currKey = 0;
  191. e = e || event || window.event;
  192. currKey = e.keyCode;
  193. if (currKey == 83 && (e.ctrlKey || e.metaKey)) {
  194. $('#U_MD_O_H_save')[0].onclick();
  195. U.UF.EV.stopDefault();
  196. U.UF.EV.stopBubble();
  197. }
  198. };
  199. }
  200. /**
  201. * 加载Word编辑区域的内容
  202. * @param {string} 文档信息
  203. */
  204. U.MD.O.W.loadContent = function (fileinfo) {
  205. var _defaultnav,
  206. _permission = U.MD.O.W.permission, //获取权限
  207. _fileid = fileinfo.UserDirectoryID; //文档id
  208. //新建文件的处理
  209. if (fileinfo.newfile) {
  210. //un新建文件的处理
  211. if (U.MD.O.W.fileinfo.UserDirectoryExtendType == 'un') {
  212. //默认导航的处理
  213. try {
  214. _defaultnav = JSON.parse(U.MD.O.W.fileinfo.UsOffice);
  215. } catch (e) {
  216. _defaultnav = { logo: "", nav: [{ pageId: Guid.newGuid(), name: "初始页面" }] };
  217. }
  218. //创建默认导航文档
  219. U.MD.O.W.T.N.form(_defaultnav);
  220. }
  221. //uw文件新建处理
  222. else {
  223. //初始化编辑器
  224. U.MD.O.W.E.initEditor();
  225. }
  226. //清楚文件新建的属性,说明文件不是新建
  227. delete fileinfo.newfile;
  228. }
  229. //互联办公文档获取数据
  230. else if (_permission.web) {
  231. parent.U.A.Request(US.SCOKET, [U.MD.O.W.fileinfo.UserDirectoryExtendType == 'un' ? 'getNav' : "getWord", _fileid, US.pageId, U.MD.O.W.userInfo.userid], U.MD.O.W.asynLoad, [$("#U_MD_O_H_wordEditor")[0], fileinfo, _permission.web]); //获取office内容
  232. }
  233. //普通文档在数据库里面获取数据
  234. else {
  235. parent.U.A.Request(US.DISK, ["GetFileContent", _fileid], U.MD.O.W.asynLoad, [$("#U_MD_O_H_wordEditor")[0], fileinfo, _permission.web]);
  236. }
  237. }
  238. /**
  239. * 异步获取Word编辑区域的数据
  240. *
  241. */
  242. U.MD.O.W.asynLoad = function (r) { //object 值
  243. var _permission,
  244. _fileinfo = U.MD.O.W.fileinfo,
  245. _context = r.context, //获取array值
  246. _fileinfo = _context[1], //获取文件信息
  247. _synergy = _context[2]; //互联权限
  248. //获取后台返回的值,第一个是直接从数据库获取的,所以必须要从UsOffice获取值
  249. if (r.value && r.value.UsOffice !== undefined) {
  250. r = r.value.UsOffice;
  251. } else {
  252. r = r.value;
  253. }
  254. //un文件 导航文件处理
  255. if (U.MD.O.W.fileinfo.UserDirectoryExtendType == 'un') {
  256. //因为导航文件默认是json格式的,如果这里从后台获取的值不是json那么进行转化
  257. if (typeof r != 'object') {
  258. try {
  259. r = JSON.parse(r);
  260. } catch (e) {
  261. r = { logo: "", nav: [{ pageId: Guid.newGuid(), name: "初始页面" }] };;
  262. }
  263. }
  264. //加载导航和内容
  265. U.MD.O.W.T.N.form(r);
  266. }
  267. //word文件处理
  268. else {
  269. //如果数据库里面有内容或者不是服务器文件,直接加载内容
  270. if (r || !_fileinfo.UserFilesServerName) {
  271. _fileinfo.UsOffice = (r || "").unEscapeQuotes(); //word内容
  272. //加载编辑器和内容
  273. U.MD.O.W.E.initEditor(_synergy); //初始化编辑器
  274. }
  275. //如果是office文件第一次初始化的处理
  276. else {
  277. //微软的office上传打开的方式
  278. U.A.Request("http://office.1473.cn/Officetohtml.ashx", ["Open", _fileinfo.UserDirectoryExtendType, _fileinfo.UserFilesServerName], function (r) {
  279. if (r.value && r.value.value != undefined) {
  280. r = r.value;
  281. _fileinfo.UsOffice = r.value.getBodyHtml().replace(/src=[\'\"]?([^\'\"]*)[\'\"]?/ig, function (str1, str2) {
  282. return "src=\"http://office.1473.cn/usoffice/" + str2 + "\"";
  283. });
  284. }
  285. U.MD.O.W.E.initEditor(_synergy); //初始化编辑器
  286. }, [""]);
  287. }
  288. }
  289. }
  290. //#endregion
  291. //#region 保存区域
  292. U.MD.O.W.updateEditorLine = function (wordInfo) {
  293. $("#U_MD_O_H_wordEditor")[0].innerHTML = wordInfo.data;
  294. }
  295. /**
  296. * 判断当前文件是否保存
  297. *
  298. * @param {function} 保存回调函数
  299. */
  300. U.MD.O.W.isSave = function () {
  301. var _fileinfo = U.MD.O.W.fileinfo, //word文件
  302. _fileid = _fileinfo.UserDirectoryID; //文件id
  303. return ((_fileid && _fileinfo.UserId && _fileinfo.UserallDirectoryName) && U.MD.O.W.permission.edit); //判断文档是否是已经保存到数据库的文档(判断的依据在于这个文件除了有文件id还有文件名和创建者id)
  304. }
  305. U.MD.O.W.updateSocket = function (wordInfo) {
  306. U.A.Request(US.SCOKET, ["send", JSON.stringify(wordInfo)], function (r) {
  307. console.log(r);
  308. });
  309. }
  310. U.MD.O.W.updateFileData = function (wordInfo) {
  311. U.A.Request("http://localhost:7003/api/pbl/" + "updateFileData", [wordInfo.messageInfo.data, wordInfo.receiveId], function (res) { //US.userInfo.userid
  312. U.Alert("保存成功");
  313. setTimeout(() => {
  314. U.MD.O.W.wordDirectory();
  315. }, 100)
  316. console.log(res);
  317. }, [], { "type": "GET", "withCredentials": true });
  318. }
  319. U.MD.O.W.wordInfo = function (type, content, navid, userid, roomid) {
  320. var _data = {
  321. "us.word": [{
  322. sendId: userid, //发送人id
  323. receiveId: roomid, //文件id
  324. type: navid, //消息类型
  325. messageInfo: {
  326. type: type, //类型
  327. data: content, //内容
  328. docId: roomid, //文档id
  329. // pageId: US.pageId, //当前页面id
  330. },
  331. },],
  332. };
  333. return _data;
  334. }
  335. /**
  336. * 保存Word
  337. *
  338. * @param {function} 保存回调函数
  339. */
  340. U.MD.O.W.save = function () {
  341. // var _islogin = top.U.MD.U.L.isLogin(function (userinfo) { U.MD.O.W.userInfo = userinfo; });
  342. // //判断用户是否登录,只有登录用户才能保存信息
  343. // var _isftp,
  344. // _isgroupuser,
  345. // _r, //返回值
  346. // _uid = U.MD.O.W.userInfo.userid,
  347. // _el = $("#U_MD_O_H_wordEditor")[0], //word编辑区域
  348. // _fileinfo = U.MD.O.W.fileinfo, //文件信息
  349. // _fileid = _fileinfo.UserDirectoryID, //文件ID
  350. // _name = top.$('#UD_Word' + _fileid + ' .U_MD_O_H_head_navigation_Title')[0].value, //文件名
  351. // _html = _el.innerHTML.escapeQuotes(); //内容
  352. // if (top.window.location.href.split("/")[2] != "www.1473.cn") {
  353. // U.MD.O.W.saveFileOther();
  354. // } else {
  355. // //判断文档是否是已经保存到数据库的文档
  356. // // U.A.Request(US.CD, [US.DB, "UseStudio_Disk", _fileid, "FB1CB716-E42E-4DEA-9A66-F14F0771826F"], function (r) { _r = r.value });
  357. // //if (_fileid && _fileinfo.UserId && _fileinfo.UserallDirectoryName && U.MD.O.W.permission.edit) {
  358. // if (_fileid && _fileinfo.UserId && _fileinfo.UserallDirectoryName && U.MD.O.W.permission.edit) { //如果是已经保存到数据库的文档,那么直接保存内容
  359. // U.MD.O.W.Panel.InsertOfficeHistory(_fileinfo, _html, _name, _el); //插入历史记录
  360. //保存到数据库
  361. //保存到数据库
  362. // top.U.A.Request(US.DISK, ["SaveFileContent", US.userInfo.userid, _fileid, _html, _name, "uw"], function (r) {
  363. // U.MD.O.W.fileinfo.UsOffice = r.context[1].innerHTML;
  364. let wordInfo = U.MD.O.W.wordInfo(
  365. "update",
  366. $("#U_MD_O_H_wordEditor")[0].innerHTML.escapeQuotes(),
  367. "us.word",
  368. top.US.userInfo.userid,
  369. top.US.wordRoomInfo.id,
  370. );
  371. U.MD.O.W.updateSocket(wordInfo);
  372. U.MD.O.W.updateFileData(wordInfo['us.word'][0]);
  373. // }, (['', _el])); //保存到数据库
  374. // }
  375. // //如果文件没有保存,那么直接新建文件
  376. // else {
  377. // //调用word新建文档的处理
  378. // top.U.MD.DK.VW.chosenSaveFile('uw', _fileid, _name, function (fileinfo) {
  379. // U.MD.O.W.fileinfo = fileinfo; //文档信息
  380. // top.$('#UD_Word' + _fileid + ' .U_MD_O_H_head_navigation_Title')[0].value = fileinfo.UserDirectoryName; //文件名设置
  381. // U.MD.O.W.setPermission(); //新建的文件设置权限,根据新建的位置
  382. // //如果是互联办公文档的处理(第一次新建的文件需要从保存到redis全局变量中,第二次之后都是直接从redis初始化的)
  383. // if (U.MD.O.W.permission.web) {
  384. // top.U.A.Request(US.SCOKET, ["newWordSave", _fileid, _html, fileinfo.UserDirectoryName, US.userInfo.userid, US.pageId], function (r) {
  385. // U.MD.O.W.Panel.loadPlayUser(fileinfo); //加载协助人员窗体
  386. // U.Alert("保存成功");
  387. // U.MD.O.W.fileinfo.UsOffice = _el.innerHTML;
  388. // //设置互联办公编辑回调的事件,这样设置不合理
  389. // $('#U_MD_O_H_wordEditor')[0].editor.operaNotice = U.MD.O.W.E.operationNotice;
  390. // });
  391. // }
  392. // //如果是普通文档的处理
  393. // else {
  394. // //保存到数据库
  395. // top.U.A.Request(US.DISK, ["SaveFileContent", US.userInfo.userid, _fileid, _html, fileinfo.UserDirectoryName, "uw"], function (r) {
  396. // U.Alert("保存成功");
  397. // U.MD.O.W.fileinfo.UsOffice = r.context[1].innerHTML;
  398. // }, (['', _el])); //保存到数据库
  399. // }
  400. // });
  401. // }
  402. // }
  403. }
  404. /**
  405. * 修改文件名处理
  406. *
  407. * @param {function} 保存回调函数
  408. */
  409. U.MD.O.W.updateName = function () {
  410. var _islogin = top.U.MD.U.L.isLogin(function (userinfo) { U.MD.O.W.userInfo = userinfo; }); //判断是否登录
  411. if (!_islogin) {
  412. var _fileinfo = U.MD.O.W.fileinfo, //文件信息
  413. _userinfo = U.MD.O.W.userInfo,
  414. _type = U.MD.O.W.fileinfo.UserDirectoryExtendType == 'un' ? 'nav' : 'word',
  415. _fileid = _fileinfo.UserDirectoryID, //文件ID
  416. _name = top.$('#UD_Word' + _fileid + ' .U_MD_O_H_head_navigation_Title')[0].value;
  417. //文件名必须本人才能修改
  418. if (_userinfo.UserId == _fileinfo.UserId) {
  419. //判断文档是否是已经保存到数据库的文档(判断的依据在于这个文件除了有文件id还有文件名和创建者id)
  420. if ((_fileid && _fileinfo.UserId && _fileinfo.UserallDirectoryName) && U.MD.O.W.permission.edit) { //如果是已经保存到数据库的文档,那么直接保存内容
  421. //如果是互联办公文档的操作
  422. if (U.MD.O.W.permission.web) {
  423. top.U.A.Request(US.SCOKET, ["updateName", _type, _fileid, _name, US.userInfo.userid, US.pageId], function (r) {
  424. if (r.value == "updateNameSuccess") {
  425. _fileinfo.UserallDirectoryName = _name; //文件全写的名字
  426. _fileinfo.UserDirectoryName = _name.addEllipsis(20); //文件的缩略名
  427. }
  428. });
  429. }
  430. //普通文档修改信息
  431. else {
  432. top.U.A.Request(US.DISK, ["UpdateFileInfo", _fileid, _name], function (r) {
  433. if (r.value) {
  434. _fileinfo.UserallDirectoryName = _name; //文件全写的名字
  435. _fileinfo.UserDirectoryName = _name.addEllipsis(20); //文件的缩略名
  436. }
  437. });
  438. }
  439. }
  440. }
  441. //其他用户不允许修改文件名
  442. else {
  443. top.$('#UD_Word' + _fileid + ' .U_MD_O_H_head_navigation_Title')[0].value = _fileinfo.UserallDirectoryName;
  444. U.alert('非本人操作,修改失败!');
  445. }
  446. }
  447. }
  448. //#endregion
  449. //#region 新建文档
  450. /**
  451. * 新建文档的处理
  452. *
  453. */
  454. U.MD.O.W.newdocument = function () {
  455. var _divel = $$("div", { "className": "U_MD_O_newBtn" });
  456. $$("button", {
  457. "className": "U_MD_O_newDoc",
  458. "innerHTML": "普通word",
  459. "onclick": function () {
  460. parent.U.MD.O.W.openApplication("word", { "userid": US.userInfo.userid, "directoryid": US.FTPFOLDERID }); //打开文档处理
  461. $('#U_MD_O_Set')[0].style.display = "none";
  462. }
  463. }, _divel);
  464. $$("button", {
  465. "className": "U_MD_O_newNav",
  466. "innerHTML": "导航模板",
  467. "onclick": function () {
  468. parent.U.MD.O.W.openApplication("word", { UserDirectoryExtendType: "un" }); //新建导航文档
  469. $('#U_MD_O_Set')[0].style.display = "none";
  470. }
  471. }, _divel);
  472. new U.UF.UI.form("新建", _divel, { "id": "U_MD_O_Set", "style": { "width": "300px", "height": "150px" } }, { isenlarge: false, isstretching: false }).form;
  473. }
  474. //#endregion
  475. //#region 文档转化
  476. /**
  477. * 导航文件转化成普通文件
  478. */
  479. U.MD.O.W.newDocSwitch = function () {
  480. var _fileinfo = U.MD.O.W.fileinfo,
  481. _fileid = _fileinfo.UserDirectoryID;
  482. if (_fileinfo.UserDirectoryExtendType == "un") {
  483. $("#U_MD_O_H_Nav")[0].style.display = "none";
  484. $("#U_MD_O_W_N").Parent({ usform: "true" }).style.display = "none";
  485. }
  486. //获取文件内容异步
  487. U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileContent", "d17a2910-11ba-df39-cd8a-5cac851c2148"]), function (r) {
  488. _fileinfo.UserDirectoryExtendType = 'uw'; //设置格式为uw
  489. _fileinfo.UsOffice = r.value[0].UsOffice.unEscapeQuotes(); //获取值
  490. _fileinfo.newfile = true; //设置为新建文件
  491. U.MD.O.W.load(_fileinfo, U.MD.O.W.userInfo); //初始化
  492. });
  493. }
  494. /** * 普通文件转化成导航文件
  495. */
  496. U.MD.O.W.newNavSwitch = function () {
  497. var _fileinfo = U.MD.O.W.fileinfo,
  498. _fileid = _fileinfo.UserDirectoryID;
  499. //获取文件内容异步,此为获取默认的宣传文档
  500. U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileContent", "6a8a235a-41c4-c3d2-8dd5-b6ee851e1967"]), function (r) {
  501. _fileinfo.UserDirectoryExtendType = 'un'; //设置格式为un
  502. _fileinfo.UsOffice = r.value[0].UsOffice.unEscapeQuotes(); //获取值
  503. _fileinfo.newfile = true; //设置为新建文件
  504. U.MD.O.W.load(_fileinfo, U.MD.O.W.userInfo); //初始化
  505. });
  506. }
  507. window.addEventListener('message', function (e) { // 监听 message 事件
  508. // alert(e.data.type);
  509. if (e.data.num && e.data.num != "0") { //项目管理传入
  510. U.MD.O.W.goRoom(e.data.num);
  511. } else if (e.data.num && e.data.num == "0") {
  512. U.MD.O.W.checkNum(e.data.num);
  513. }
  514. });
  515. U.MD.O.W.isRoom = function () {
  516. U.A.Request(US.Config.pbl + "selectRoomByFile?uid=" + US.userInfo.userid, [], function (res) {
  517. if (res.value == null || res.value[0].length == 0) {
  518. U.MD.O.W.openRoomConfirm();
  519. } else {
  520. US.numNum = res.value[0][0].num;
  521. U.MD.O.W.getWork(res.value[0][0].id);
  522. U.MD.O.W.isOpenRoomConfirm();
  523. }
  524. }, [], { "type": "GET", "withCredentials": true });
  525. }
  526. U.MD.O.W.MathRand = function () {
  527. var Num = "";
  528. for (var i = 0; i < 6; i++) {
  529. Num += Math.floor(Math.random() * 10);
  530. }
  531. return Num;
  532. }
  533. U.MD.O.W.checkNum = function () {
  534. var numNum = U.MD.O.W.MathRand();
  535. U.A.Request(US.Config.pbl + "checkRoomNumByFile?num=" + numNum, [], function (res) {
  536. if (res.value == null || res.value[0].length == 0) {
  537. U.MD.O.W.addRoom(numNum);
  538. } else {
  539. U.MD.O.W.checkNum();
  540. }
  541. }, [], { "type": "GET", "withCredentials": true });
  542. }
  543. U.MD.O.W.addRoom = function (numNum) {
  544. U.MD.O.W.fileinfo.UsOffice = "";
  545. U.MD.O.W.E.initEditor(true); //初始化编辑器
  546. var data = $("#U_MD_O_H_wordEditor")[0].innerHTML.escapeQuotes();
  547. U.A.Request(US.Config.pbl + "insertRoomByFile", [US.userInfo.userid, numNum, data], function (res) {
  548. if (res.value == 1) {
  549. U.alert("创建成功");
  550. if ($("#add_room")[0]) {
  551. $("#add_room")[0].close(); //关闭登陆
  552. }
  553. U.MD.O.W.isRoom();
  554. } else {
  555. U.alert("创建失败");
  556. }
  557. }, [], { "type": "GET", "withCredentials": true });
  558. }
  559. U.MD.O.W.goRoom = function (number) {
  560. U.A.Request(US.Config.pbl + "selectRoomByFile?uid=" + number, [], function (res) {
  561. if (res.value[0].length > 0) {
  562. U.alert("加入成功");
  563. if ($("#add_room")[0]) {
  564. $("#add_room")[0].close();
  565. }
  566. U.MD.O.W.getWork(res.value[0][0].id);
  567. } else {
  568. U.alert("此房间不存在或已被解散");
  569. }
  570. }, [], { "type": "GET", "withCredentials": true });
  571. }
  572. U.MD.O.W.copyText = function (target) {
  573. var div = $(".form_delete-main-room")[0].innerText;
  574. var clipboard = new ClipboardJS('.copy-message', {
  575. text: function () {
  576. return div;
  577. }
  578. });
  579. clipboard.on('success', function (e) {
  580. console.log(e);
  581. e.clearSelection();
  582. U.alert("复制成功");
  583. });
  584. clipboard.on('error', function (e) {
  585. console.log(e);
  586. U.alert("复制失败");
  587. });
  588. }
  589. U.MD.O.W.getWork = async function (cid, s, task, t, uid) {
  590. return new Promise((resolve, reject) => {
  591. U.A.Request(US.Config.pbl + "selectWord?uid=" + uid + "&cid=" + cid + "&s=" + s + "&task=" + task + "&t=" + t, [], function (res) {
  592. if (res.value[0].length > 0) {
  593. US.wordRoomInfo = res.value[0][0];
  594. // U.A.Request(US.SCOKET, ["getWord", rid, US.pageId, US.userInfo.userid], function(r) {
  595. // U.MD.O.W.fileinfo.UsOffice = US.wordRoomInfo.text;
  596. // U.MD.O.W.fileinfo.UserDirectoryID = rid;
  597. // });
  598. // return res.value[0][0].text
  599. let a = {
  600. UserDirectoryExtendType: "uw", //默认导航模式
  601. UsOffice: res.value[0][0].text,
  602. UserDirectoryID: Guid.newGuid(),
  603. newfile: true
  604. }
  605. resolve(a);
  606. // setTimeout(() => {
  607. // U.MD.O.W.wordDirectory();
  608. // }, 100)
  609. } else {
  610. resolve(U.MD.O.W.getfile())
  611. }
  612. }, [], { "type": "GET", "withCredentials": true });
  613. });
  614. }
  615. U.MD.O.W.getWorkS = async function (cid, s, task, t, uid) {
  616. return new Promise((resolve, reject) => {
  617. U.A.Request(US.Config.pbl + "selectWords?uid=" + uid + "&cid=" + cid + "&s=" + s + "&task=" + task + "&t=" + t + "&type=1", [], function (res) {
  618. if (res.value[0].length > 0) {
  619. US.wordRoomInfo = res.value[0][0];
  620. let a = {
  621. UserDirectoryExtendType: "uw", //默认导航模式
  622. UsOffice: res.value[0][0].text,
  623. UserDirectoryID: Guid.newGuid(),
  624. newfile: true
  625. }
  626. resolve(a);
  627. } else {
  628. resolve(U.MD.O.W.getfile())
  629. }
  630. }, [], { "type": "GET", "withCredentials": true });
  631. });
  632. }
  633. /**
  634. * 创建目录的窗体
  635. *
  636. * @param fileinfo {object} 文件信息
  637. */
  638. U.MD.O.W.wordDirectory = function (fileinfo) {
  639. var _coopwindow, _frienddiv, _example, _shareLink, _cBox;
  640. //如果不存在团队成员窗口,则创建一个团队成员窗口。
  641. if (!$("#U_MD_O_H_body_left_book")[0]) {
  642. //创建邀请协助人员窗口
  643. _coopwindow = $("#U_MD_O_H_body_left")[0];
  644. _cBox = $$("div");
  645. // _shareLink = $$("div", {
  646. // className: 'U_MD_O_H_body_left_invite_linkTxt', "onclick": function () {
  647. // U.MD.O.W.Panel.isSynergy(U.MD.O.W.Panel.shareLink);
  648. // }, "innerText": "第三方链接邀请"
  649. // }, _cBox);
  650. _frienddiv = $$("div", { "className": "U_MD_O_H_body_left_book", "id": "U_MD_O_H_body_left_book" }, _cBox); //目录内容
  651. _example = $$("div", {
  652. "className": "U_MD_O_H_body_left_book_a",
  653. }, _frienddiv); //默认邀请按钮
  654. var span = $("div[name=U_MD_O_W_Font_Heading1]");
  655. if (span.length > 0) {
  656. for (var i = 0; i < span.length; i++) {
  657. var a = $$("div", { "className": "isMulu" }, _example)
  658. a.innerHTML = span[i].children[0].innerHTML;
  659. }
  660. } else {
  661. var b = $$("div", { "className": "noMulu" }, _example)
  662. b.innerHTML = "暂无目录"
  663. }
  664. // $$("div", { "innerHTML": "一、项目概述" }, _example);
  665. // $$("div", { "innerHTML": "二、业务流程" }, _example);
  666. // $$("div", { "innerHTML": "三、系统角色" }, _example);
  667. // $$("div", { "innerHTML": "四、产品功能场景描述" }, _example);
  668. // $$("div", { "innerHTML": "五、功能模块" }, _example);
  669. // $$("div", { "className": "U_MD_O_H_body_left_book_a_img" }, _example);
  670. // $$("div", { "className": "U_MD_O_H_body_left_book_a_div", "innerHTML": "邀请" }, _example);
  671. new U.UF.UI.form("目录", _cBox, { id: "wordDirectory", style: { border: "none", position: "absolute", width: "300px", "min-width": "200px", height: "250px", top: "50px", left: "auto", "box-shadow": "none" } }, { isenlarge: false, isnarrow: false }, { style: { height: "40px", "border-bottom": "1px solid #d6def0", color: "#000", background: "#f1f1f1" } }, null, null, _coopwindow);
  672. }
  673. }
  674. U.MD.O.W.addPerson = function () {
  675. var BOX = $$("div", {});
  676. var form_main = $$('div', { "className": "form-main" }, BOX);
  677. var form_content = $$('div', { "className": "form-content" }, form_main);
  678. var form_delete_main = $$('div', { "className": "form_delete-main-room" }, form_content);
  679. var form_delete_main_body = $$('div', { "className": "form_delete-main-body" }, form_delete_main);
  680. var searchPerson = $$('div', { "className": "searchPerson" }, form_delete_main_body);
  681. $$("input", { "className": "inputSearch", "type": "text", "placeholder": "搜索成员" }, searchPerson);
  682. $$("div", { "className": "searchImg", }, searchPerson);
  683. var a = [];
  684. var r = [{ "userid": "1", "title": "李华" }, { "userid": "2", "title": "李雷" }, { "userid": "3", "title": "莉莉" }, { "userid": "4", "title": "李磊" }, { "userid": "5", "title": "李莉" }]
  685. var checkboxPerson = $$('div', { "className": "checkboxPerson" }, form_delete_main_body);
  686. for (let i = 0; i < r.length; i++) {
  687. var person = $$("div", { "className": "person", }, checkboxPerson);
  688. let abc = $$('input', { "type": "checkbox", "id": r[i].userid }, person);
  689. $$('div', { "className": "personAvatar", }, person);
  690. $$('span', { "className": "thirdSpan", "innerHTML": r[i].title }, person);
  691. if (a.indexOf(r[i].userid) != -1) {
  692. abc.checked = true
  693. }
  694. person.onclick = function (e) {
  695. var el = e.currentTarget
  696. el.getElementsByTagName("input")[0].click();
  697. }
  698. abc.onclick = function (e) {
  699. e.stopPropagation();
  700. if (a.indexOf(e.target.id) !== -1) {
  701. a.splice(a.indexOf(e.target.id), 1);
  702. } else {
  703. a.push(e.target.id);
  704. }
  705. }
  706. }
  707. var btnBox = $$('div', { "className": "copy-btn" }, form_main);
  708. var confirm = $$('button', { "className": "copy-message", "innerHTML": `${"移出成员"}` }, btnBox);
  709. new U.UF.UI.form(`${"管理成员"}`, BOX, {
  710. id: 'invite_members',
  711. style: {
  712. "background": "#fffefe",
  713. "width": "350px",
  714. "height": "500px",
  715. "z-index": "99",
  716. }
  717. }, {
  718. isenlarge: false,
  719. isnarrow: false
  720. }, {
  721. style: {
  722. "height": "40px",
  723. "text-align": "center",
  724. "line-height": "40px",
  725. "text-indent": "25px",
  726. "background-repeat": "no-repeat",
  727. "font-size": "14px",
  728. "background-color": "#494949",
  729. "display": "flex",
  730. }
  731. });
  732. // confirm.onclick = function () {
  733. // U.MD.O.W.copyText();
  734. // }
  735. }
  736. U.MD.O.W.isOpenRoomConfirm = function () {
  737. var BOX = $$("div", {});
  738. var form_main = $$('div', { "className": "form-main" }, BOX);
  739. var form_content = $$('div', { "className": "form-content" }, form_main);
  740. var form_delete_main = $$('div', { "className": "form_delete-main-room" }, form_content);
  741. var form_delete_main_body = $$('div', { "className": "form_delete-main-body" }, form_delete_main);
  742. $$("div", { "className": "remark", "innerHTML": US.userInfo.username + "邀请您参与协同文档", }, form_delete_main_body)
  743. $$("div", {
  744. "class": "clickNav",
  745. "innerHTML": "点击链接加入房间",
  746. }, form_delete_main_body)
  747. $$("div", { "class": "link", "innerHTML": "http://cocorobo.wg.com/dm/EOGyBbFiCwam", }, form_delete_main_body)
  748. var room_number = $$('div', { "className": "room_number" }, form_delete_main_body);
  749. $$("div", { "class": "link", "innerHTML": "房间号:", }, room_number)
  750. $$("div", { "class": "roomNumber", "innerHTML": US.numNum, }, room_number)
  751. $$("div", { "className": "link", "innerHTML": "复制房间号信息,打开协同文档输入即可加入。", }, form_delete_main_body)
  752. // $$("input", { "className": "text", "type": "text" }, form_delete_main_body);
  753. var btnBox = $$('div', { "className": "copy-btn" }, form_main);
  754. var confirm = $$('button', { "className": "copy-message", "innerHTML": `${"一键复制信息"}` }, btnBox);
  755. new U.UF.UI.form(`${"邀请成员"}`, BOX, {
  756. id: 'invite_members',
  757. style: {
  758. "background": "#fffefe",
  759. "width": "350px",
  760. "height": "500px",
  761. "z-index": "99",
  762. }
  763. }, {
  764. isenlarge: false,
  765. isnarrow: false
  766. }, {
  767. style: {
  768. "height": "40px",
  769. "text-align": "center",
  770. "line-height": "40px",
  771. "text-indent": "25px",
  772. "background-repeat": "no-repeat",
  773. "font-size": "14px",
  774. "background-color": "#494949",
  775. "display": "flex",
  776. }
  777. });
  778. confirm.onclick = function () {
  779. U.MD.O.W.copyText();
  780. }
  781. }
  782. U.MD.O.W.openRoomConfirm = function () {
  783. var BOX = $$("div", {});
  784. var form_main = $$('div', { "className": "form-main" }, BOX);
  785. var form_content = $$('div', { "className": "form-content" }, form_main);
  786. var form_delete_main = $$('div', { "className": "form_delete-main" }, form_content);
  787. $$("input", { "className": "form_delete-main_box", "placeholder": `${"请输入要加入的房间号"}` }, form_delete_main);
  788. $$("div", { "className": "remark", "innerHTML": "备注:输入房间号点击加入房间或点击创建房间直接创建房间", }, form_delete_main)
  789. var btnBox = $$('div', { "className": "form-btn" }, form_delete_main);
  790. var cencal = $$('button', { "className": "form-cencal", "innerHTML": `${"加入房间"}` }, btnBox);
  791. var confirm = $$('button', { "className": "form-confirm", "innerHTML": `${"创建房间"}` }, btnBox);
  792. new U.UF.UI.form(`${"创建/加入房间"}`, BOX, {
  793. id: 'add_room',
  794. style: {
  795. "background": "#fffefe",
  796. "width": "400px",
  797. "height": "281px",
  798. "z-index": "99 !important",
  799. }
  800. }, {
  801. isenlarge: false,
  802. isnarrow: false
  803. }, {
  804. style: {
  805. "height": "40px",
  806. "text-align": "center",
  807. "line-height": "40px",
  808. "text-indent": "25px",
  809. "background-repeat": "no-repeat",
  810. "font-size": "16px",
  811. "background-color": "#32455B",
  812. "display": "flex",
  813. }
  814. });
  815. confirm.onclick = function () {
  816. U.MD.O.W.checkNum();
  817. }
  818. cencal.onclick = function () {
  819. U.MD.O.W.goRoom($(".form_delete-main_box")[0].value);
  820. }
  821. }
  822. //#endregion