U.Word.Panel.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. //此处放置iframe中的word中的功能面板,包括包括创建邀请协作人员,创建编辑历史,创建生成链接.创建热门模板。
  2. Namespace.register("U.Word.Panel");
  3. //#region 初始化区域
  4. //初始化区域
  5. //U.Word.Tool = function (UDE) {
  6. // //初始化页面
  7. // var _UDSD, _UDGD, _USM, _UW, _UDOD, _UDKD,
  8. // _UOFD, //邀请好友窗体
  9. // _UHD, //编辑历史窗体
  10. // _UDNSD, //生成链接窗体
  11. // _UHTD, //邀请好友窗体
  12. // _UDTD = $("#UD_SYQXR_Parent")[0];
  13. // if ($(_UDTD).Child().length == 0) {
  14. // _USM = U.M.GetElementInfo(_UDSD);
  15. // _UW = _USM["OW"] + 50;
  16. // }
  17. //}
  18. /**
  19. * 加载编辑区域
  20. *
  21. * @param {element}
  22. * @param {element}
  23. */
  24. U.Word.Panel.Loadeditor = function () {
  25. var _worddiv, _UDTD, _UDGD, _wordeditor, _UDKD;
  26. //$("#UD_SYQXR")[0] 是word的编辑区域,如果不存在,则创建一个。
  27. if (!$("#UD_SYQXR")[0]) {
  28. _worddiv = $("#UD_SYQXR_Parent")[0];//包含word编辑区域的div
  29. _wordeditor = $$("div", { "id": "UD_SYQXR" }); //创建word编辑器区域
  30. _pagediv = $$("div", { "className": "U_Boom_CO_Editor_body_main_m" }, _wordeditor); //由于是多页,所以需要另外建立一个div,包含下面的头部,内容,底部
  31. _header = $$("div", { "className": "U_Boom_CO_Editor_body_main_border" }, _pagediv); //头部信息
  32. $$("div", { "className": "U_Boom_CO_Editor_body_main_bordero" }, _header); //头部的左上角
  33. $$("div", { "className": "U_Boom_CO_Editor_body_main_bordert" }, _header); //头部的右上角
  34. $$("div", { "className": "U_Boom_CO_Editor_body_main_text", contentEditable: "true", spellcheck: "false", "innerHTML": "", "id": "Txt" + Guid.NewGuid() }, _pagediv); //编辑器区域
  35. _footer = $$("div", { "className": "U_Boom_CO_Editor_body_main_border" }, _pagediv);
  36. $$("div", { "className": "U_Boom_CO_Editor_body_main_borders" }, _footer);
  37. $$("div", { "className": "U_Boom_CO_Editor_body_main_borderf" }, _footer);
  38. //把编辑器区域放入窗体。
  39. U.UI.Form({ min: false, max: false, close: false, draw: false, className: "UD_SYF_S",
  40. SO: _worddiv, content: _wordeditor, title: false, hst: false, bst: { "style": { "overflow": "hidden"} },
  41. style: { "backgroundColor": "transparent", "border": "0", "width": "auto", "top": "15px", "left": "30px" }
  42. });
  43. }
  44. }
  45. //
  46. //#endregion
  47. //#region 团队成员
  48. /**
  49. * 创建团队成员的窗体
  50. *
  51. * @param {element}
  52. * @param {element}
  53. */
  54. U.Word.Panel.LoadPlayUser = function (fileinfo) {
  55. var _coopwindow, _frienddiv, _example, _wordsize, _marginleft;
  56. //如果不存在团队成员窗口,则创建一个团队成员窗口。
  57. if (!$("#U_Boom_CO_Editor_body_left_invite_user")[0]) {
  58. _wordsize = U.M.GetElementInfo($("#UD_SYQXR")[0]);//获取编辑器域的父亲。用于获取长度大小,用于定位
  59. _marginleft = _wordsize["OW"] + 50;//团队窗口的位置间距编辑器50像素
  60. //创建邀请协助人员窗口
  61. _coopwindow = $("#U_Boom_CO_Editor_body_left")[0];
  62. _frienddiv = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user", "id": "U_Boom_CO_Editor_body_left_invite_user" });//好友内容区域
  63. _example = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a", "onclick": [[U.Word.Panel.DisplayInsertUser, ([])]] }, _frienddiv);//默认邀请按钮
  64. $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_img" }, _example);
  65. $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_div", "innerHTML": "邀请" }, _example);
  66. U.UI.Form({ min: false, max: false, draw: false,
  67. SO: _coopwindow, content: _frienddiv, title: "<div class='UD_SYF_STI'>邀请协作人员</div>", className: "UD_SYF_S",
  68. hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
  69. style: { "border": "1px #d6dff0 solid", "position": "absolute", "width": "300px", "height": "250px", "top": "25px", "left": _marginleft + "px" }
  70. });
  71. }
  72. U.Word.Panel.DisPlayUser(fileinfo); //获取协作人员
  73. }
  74. /**
  75. * 初始化查看团队成员
  76. *
  77. * @param {element} 换页元素
  78. */
  79. U.Word.Panel.DisPlayUser = function (UDE, UDOD) {
  80. UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_invite_user")[0];
  81. var HYD = UDOD.children[0];
  82. UDOD.innerHTML = ""
  83. $(UDOD).append(HYD);
  84. if (UDE) {
  85. var UGF = _$(US.Friend[3]).Select({ "GroupManageID": UDE.UserDirectoryEncrypt || UDE.GroupID });
  86. for (i = 0; i < UGF.length; i++) {
  87. _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a" }, UDOD);
  88. _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_img", "style": { "background": ""} }, _UDOD);
  89. $$("img", { "src": U.M.GetImgU(UGF[i].UserThumbnailImageHead) }, _UDTD);
  90. $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_div", "innerHTML": UGF[i].UserNickName }, _UDOD);
  91. }
  92. }
  93. }
  94. /**
  95. * 弹出添加成员
  96. *
  97. * @param {element} Wrod信息数组
  98. */
  99. U.Word.Panel.DisplayInsertUser = function () {
  100. var _UGE = U.Word.TF, //object参数值
  101. _UID = _UGE["UID"],
  102. _UFID = _UGE["ID"],
  103. _UET = _UGE["ET"], //文件实体
  104. _UQID = _UET.UserDirectoryEncrypt || _UET.GroupID;
  105. if (_UQID == US.userinfo.UserId) { _UQID = ""; }
  106. if (_UET && _UET.UserDirectoryID) { //是否为已经新建过的uw文件
  107. top.U.F.J.ANewQZ(null, { fun: U.M.apply(this, [[top.U.F.J.CXNEWTJ,
  108. ([_UQID, _UET.UserDirectoryName || _UET.UserFilesName, "由文档" + (_UET.UserDirectoryName || _UET.UserFilesName) + "发起的互联办公群组。", _UFID, U.M.apply(null, [[U.Word.Panel.InsertUser, ([_UET])]])])]])
  109. }); //调用创建群的弹窗函数
  110. //top.U.F.J.CXNEWTJ, ([[U.Word.Panel.InsertUser, ([$("#U_Boom_CO_Editor_body_left_invite_user")[0], _UET]), _UET.UserDirectoryName
  111. }
  112. else { //未新建过的文件需要先保存到网盘
  113. U.Word.Save();
  114. }
  115. }
  116. /**
  117. * 添加团队成员
  118. *
  119. * @param {element} 换页元素
  120. */
  121. U.Word.Panel.InsertUser = function (UET, GroupID, _FriendUser, groupid, _UGN) {
  122. //找到硬盘复制粘贴的函数, 先调用复制然后调用粘贴
  123. //top.U.Dk.RE.WPFZ(UET, "Copy")
  124. //top.U.Dk.RE.UFStick(GroupID, function () { //粘贴回调
  125. //}, UET.UserId);
  126. if (!(UET.UserDirectoryEncrypt && UET.UserId != UET.UserDirectoryEncrypt)) { //如果是新创建的文件,同时文件不在群里 就把文件拷贝到群里进行处理
  127. /*
  128. //用户id 群id 文件id 群id 判断
  129. U.A.Request("UseStudioDisk.CopyFile", ([US.userinfo.UserId, GroupID.GroupManageID, UET.UserFilesID || UET.UserDirectoryID, GroupID.GroupManageID, 1]), function (r) {
  130. //重新打开
  131. U.D.Office.Word();
  132. }, ([]));
  133. */
  134. U.A.Request("UseStudioDisk.CopyFile", ([US.userinfo.UserId, GroupID.GroupManageID, UET.UserFilesID || UET.UserDirectoryID, GroupID.GroupManageID, 1]), top.U.Dk.RE.AsynUFStick, (["", GroupID.GroupManageID, [UET], [UET], U.M.apply(null, [[U.Word.Panel.AsynInsertUser, ([UET, _FriendUser, groupid, _UGN])]]), US.userinfo.UserId, GroupID.GroupManageID, "Copy", UET.UserDirectoryParentID]));
  135. }
  136. //把所有添加进来的好友打印在office窗体里
  137. // U.Word.Panel.DisPlayUser(UET)
  138. /*
  139. if (UET[1].UserDirectoryEncrypt) { //判断文件是否已经是群文件
  140. }
  141. else { //如果不是群文件,把当前uw文件复制到群里
  142. // var _UME = top.U.Dk.RE, _UCE = top.U.Dk.HP.MLWJSY(UET), _UGE = top.U.Dk.DiskOperatingSwitch(US.userinfo.UserId);
  143. // U.A.Request("UseStudioDisk.CopyFile", ([US.userinfo.UserId, UGID, UET[1]["UserDirectoryID"], US.userinfo.UserId, (_UCE[2].length ? _UME.UEI[0][0].UserDirectoryDeep : "")]), top.U.Dk.RE.AsynUFStick, (["", UGID, [UET[1]], _UCE[1], null, _UGE[1][2], UGID, "Copy", UGID]));
  144. }
  145. */
  146. }
  147. /**
  148. * 异步添加好友
  149. *
  150. * @param {element} 换页元素
  151. */
  152. U.Word.Panel.AsynInsertUser = function (UET, _FriendUser, groupid, _UGN, arr) {
  153. //弹出窗体
  154. //console.log(arr);
  155. top.U.D.Office.Word(US.userinfo, arr[0])
  156. U.A.Request(US.CD, ([US.DB, "UseStudio_Friends", "UF_D_A_AFMS", US.userinfo.UserId, _FriendUser, US.userinfo.UserNickName || US.userinfo.UserName, '' + groupid + ',' + _UGN + ',' + UET.UserDirectoryModifyTime + ',' + arr[0].UserDirectoryID + ',' + UET.UserDirectoryName + '.UW', 5, false]), U.M.apply(), ([""]));
  157. /*
  158. var i, _UDTD,
  159. context = request.context,
  160. _UDOD = context[1],
  161. _UOE = context[2],
  162. _UDE = context[3],
  163. _UDFD = $$("frag");
  164. request = request.value;
  165. if (request > -1) {
  166. for (i = 0; UDE.length; i++) {
  167. _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a" }, _UDFD);
  168. $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_img" }, _UDTD);
  169. $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user_a_div", "innerHTML": "邀请" }, _UDTD);
  170. }
  171. $(UDOD).append(_UDFD);
  172. U.Alert("添加成功");
  173. }
  174. */
  175. }
  176. //#endregion
  177. //#region 热门模板
  178. /**
  179. * 创建历史记录窗体
  180. *
  181. * @param {element} 换页元素
  182. */
  183. U.Word.Panel.LoadHotTemplates = function (fileinfo) {
  184. var _UDTD, _UDOD, _USM, _UW;
  185. if (!$("#U_Boom_CO_Editor_body_left_template_hot")[0]) {
  186. _UDTD = $("#U_Boom_CO_Editor_body_left")[0];
  187. _USM = U.M.GetElementInfo($("#UD_SYQXR")[0]);
  188. _UW = _USM["OW"] + 50;
  189. //热门模板提供
  190. _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user", id: "U_Boom_CO_Editor_body_left_template_hot" });
  191. U.UI.Form({ min: false, max: false, draw: false, SO: _UDTD,
  192. content: _UDOD, title: "<div class='UD_SYF_STI'>热门模板提供</div>", className: "UD_SYF_S",
  193. hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
  194. style: { "border": "1px #d6dff0 solid", "width": "300px", "height": "270px", "position": "absolute", "top": "840px", "left": _UW + "px" }
  195. });
  196. }
  197. U.Word.Panel.GetHotTemplates("00000000-0000-0000-0000-000000000000", 1, 10); //热门模板
  198. }
  199. /**
  200. * 初始化加载模板
  201. *
  202. * @param {element} 换页元素
  203. */
  204. U.Word.Panel.GetHotTemplates = function (UDID, S, E, UDOD) {
  205. UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_template_hot")[0];
  206. U.A.Request(US.CD, ([US.DB, "UseStudio_Office", "UD_A_SelectHotTemplate", UDID, S, E]), U.Word.Panel.AsynGetHotTemplates, ([null, UDOD]));
  207. }
  208. /**
  209. * 获取热门模板
  210. *
  211. * @param {element} 换页元素
  212. */
  213. U.Word.Panel.AsynGetHotTemplates = function (request) {
  214. var i, _UDOD,
  215. _UDFD = $$("frag"),
  216. context = request.context,
  217. request = request.value;
  218. context[1].innerHTML = "";
  219. for (i = 0; i < request.length; i++) {
  220. _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user_m", "onclick": [[U.Word.Panel.OpenHotTemplates, ([request[i].TemplateId])]] }, _UDFD);
  221. $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user_m_s", "style": { "background-image": "url(" + request[i].UseFilesServerThumbnailName + ")"} }, _UDOD);
  222. $$("div", { "className": "U_Boom_CO_Editor_body_left_template_user_m_x", "innerHTML": request[i]["UserFilesName"] }, _UDOD);
  223. }
  224. $(context[1]).append(_UDFD);
  225. }
  226. /**
  227. * 点击模板处理
  228. * @参数:模板分类id
  229. * @param {element} 换页元素
  230. */
  231. U.Word.Panel.OpenHotTemplates = function (ArrTD) {
  232. top.U.Boom.I.GetHomeTemp.particulars(ArrTD);
  233. }
  234. //#endregion
  235. //#region 链接查看
  236. /**
  237. * 查看链接
  238. *
  239. * @param {element}
  240. */
  241. U.Word.Panel.Loadlink = function (fileinfo) {
  242. var _rightwindow, _linkdiv, _wordsize, _marginleft;
  243. //如果不存在添加链接区域,则创建。
  244. if (!$("#U_Boom_CO_Editor_body_left_href_pay_a")[0]) {
  245. //右侧功能区域,链接区域要追加到这里
  246. _rightwindow = $("#U_Boom_CO_Editor_body_left")[0];
  247. _wordsize = U.M.GetElementInfo($("#UD_SYQXR")[0]);
  248. _marginleft = _wordsize["OW"] + 50;
  249. //生成链接
  250. _linkdiv = $$("div", { "className": "U_Boom_CO_Editor_body_left_href_pay_a", id: "U_Boom_CO_Editor_body_left_href_pay_a", "innerHTML": "将此站点生成链接", "onclick": [[U.Word.Panel.SetDNS]] });
  251. U.UI.Form({ min: false, max: false, draw: false, SO: _rightwindow,
  252. content: _linkdiv, title: "<div class='UD_SYF_STI'>生成链接</div>", className: "UD_SYF_S",
  253. hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
  254. style: { "border": "1px #d6dff0 solid", "position": "absolute", "width": "300px", "height": "250px", "top": "570px", "left": _marginleft + "px" }
  255. });
  256. }
  257. // U.Word.Panel.Getlink(fileinfo.UserDirectoryID);
  258. }
  259. /**
  260. * 查看链接
  261. *
  262. * @param {element} 换页元素
  263. */
  264. U.Word.Panel.Getlink = function (UDID, UDOD) {
  265. UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_href_pay_a")[0];
  266. U.A.Request(US.CD, ([US.DB, "UseStudio_Office", "UD_A_SelectHotTemplate", UDID, UOID, US, UE]), U.Word.Panel.AsynGetlink, ([null, UDOD]));
  267. }
  268. /**
  269. * 查看链接异步
  270. *
  271. * @param {element} 换页元素
  272. */
  273. U.Word.Panel.AsynGetlink = function (request) {
  274. var context = request.context;
  275. request.value;
  276. if (request) {
  277. context[1].innerHTML = request;
  278. }
  279. }
  280. U.Word.Panel.SetDNS = function () {
  281. var _UGE = U.Word.TF, //object参数值
  282. _UFID = _UGE.ID,
  283. _USID = _UGE.UID,
  284. _UFNM = _UGE.ET.UserDirectoryName;
  285. if (_UFID) {
  286. var _UDOD = $$("div", { "class": "U_Boom_CO_Popup_18" }),
  287. _UDSBD, _UDNA, _UDRT, _UDYM, _UDSD = $$("div", { "class": "U_Boom_CO_Popup_18_Set" }, _UDOD),
  288. _UDQCD, _UDUR, _UDQBD, _UDBG, _UDQD = $$("div", { "class": "U_Boom_CO_Popup_18_Que" }, _UDOD);
  289. //设置
  290. $$("div", { "class": "U_Boom_CO_Popup_18_Set_Tag", "innerHTML": "目前默认域名 <span>设置个性域名,让好友同事更快记住链接</span>" }, _UDSD),
  291. _UDNA = $$("div", { "class": "U_Boom_CO_Popup_18_Set_Name", "innerHTML": "等待域名生成" }, _UDSD),
  292. _UDSBD = $$("div", { "class": "U_Boom_CO_Popup_18_Btn" }, _UDSD),
  293. //设置成功
  294. _UDRT = $$("div", { "class": "U_Boom_CO_Popup_18_Que_Right", "style": { "display": "none"} }, _UDQD);
  295. $$("div", { "class": "U_Boom_CO_Popup_18_Que_Tag", "innerHTML": "设置成功" }, _UDRT);
  296. _UDUR = $$("input", { "type": "text", "class": "U_Boom_CO_Popup_18_Que_Url" }, _UDRT);
  297. //二维码
  298. _UDQCD = $$("div", { "class": "U_Boom_CO_Popup_18_Que_Code", "style": { "display": "none"} }, _UDQD);
  299. _UDBG = $$("div", { "class": "U_Boom_CO_Popup_18_Que_QR" }, _UDQCD);
  300. $$("div", { "class": "U_Boom_CO_Popup_18_Que_Con", "innerHTML": "扫一扫 </br> 分享此文档给好友" }, _UDQCD);
  301. //域名管理中心
  302. _UDYM = $$("div", { "class": "U_Boom_CO_Popup_18_Set_Yu" }, _UDOD);
  303. $$("div", { "class": "U_Boom_CO_Popup_18_Set_Yu_Text", "innerHTML": "对域名不满意?可以到" }, _UDYM),
  304. $$("div", { "class": "U_Boom_CO_Popup_18_Set_Yu_Ming", "innerHTML": "域名管理中心", "onclick": [[U.Word.Panel.Yuming]] }, _UDYM),
  305. _UDQBD = $$("div", { "class": "U_Boom_CO_Popup_18_Btn", "style": { "display": "none"} }, _UDQD);
  306. $$("div", { "innerHTML": "取消", "onclick": [[U.Word.Panel.Close, ([_UDOD])]] }, _UDSBD),
  307. $$("div", { "innerHTML": "设置", "onclick": [[U.Word.Panel.QDSZ, ([_UDRT, _UDSD, _UDUR, _UDNA, _UDQBD])]] }, _UDSBD),
  308. $$("div", { "innerHTML": "取消", "onclick": [[U.Word.Panel.Close, ([_UDOD])]] }, _UDQBD);
  309. $$("div", { "innerHTML": "生成二维码", "onclick": [[U.Word.Panel.CodeSet, ([_UDUR, _UDBG, _UDQCD])]] }, _UDQBD);
  310. $$("div", { "innerHTML": "复制链接分享", "onclick": [[U.Word.CopySet, ([_UDUR])]] }, _UDQBD);
  311. top.U.UI.From({ min: false, max: false, id: "U_Boom_CO_Popup_18", style: { "width": "580px", "height": "auto" }, content: _UDOD, title: "提示", hst: {}, bst: {} });
  312. U.Word.Panel.eaDomain(_UFID, _UDNA, _UDRT, _UDSD, _UDUR, _UDNA, _UDYM, _UDQBD, _USID, _UFNM);
  313. } else {
  314. U.Word.Save();
  315. }
  316. }
  317. /*
  318. * @作用:确定申请域名
  319. * @参数一:文件ID
  320. * @参数二:域名生成内容
  321. * @参数三:设置成功内容
  322. * @参数四:设置的总体盒子
  323. * @参数五:域名内容
  324. * @参数六:域名生成内容
  325. * @参数七:域名管理中心
  326. * @参数七:复制二维码按钮
  327. * @参数八:用户ID
  328. * @参数九:文件名
  329. */
  330. U.Word.Panel.eaDomain = function (UDID, UDOD, _UDRT, _UDSD, _UDUR, _UDNA, _UDYM, _UDQBD, _USID, _UFNM) {
  331. var fid = UDID; //获取文件ID
  332. var fname = _UFNM; //获取文件名
  333. var UserID = _USID; //获取用户ID
  334. var d = new Date(); //获取当前系统时间
  335. d.setMonth(d.getMonth() + 1); //月数+1
  336. var yy1 = d.getFullYear(); //获取年份
  337. var mm1 = d.getMonth() + 1; //因为getMonth()返回值是 0(一月) 到 11(十二月) 之间的一个整数。所以要给其加1
  338. var dd1 = d.getDate(); //获取哪一天
  339. if (mm1 < 10) {
  340. mm1 = '0' + mm1;
  341. }
  342. if (dd1 < 10) {
  343. dd1 = '0' + dd1;
  344. }
  345. var ExTime = yy1 + '-' + mm1 + '-' + dd1; //时间组合 年-月-日
  346. _UDUR.value = Math.ceil(Math.random() * 1000) + ".boomyun.com"; //域名生成规则
  347. //fid:文件id
  348. //查询数据库,域名表是否有这个文件,查看该文件是否存在域名
  349. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_DNS", 'GetDnsInfoByFileId', fid]), function (r) {
  350. if (r.value.length == 0) {
  351. //fid:文件id fname:文件名 .com:域名类型 ExTime:到期时间 0:类别 _UDUR.value:域名内容 UserID:用户ID 1:是否需要跳转页面展示内容
  352. //插入域名到数据库
  353. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_DNS", 'DNS_InsertDnsInformation', fid, fname, '.' + 'com', ExTime, '0', _UDUR.value, UserID, "1"]), function (r) {
  354. //fid:文件ID
  355. //查询域名是否存在
  356. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_DNS", 'GetDnsInfoByFileId', fid]), function (r) {
  357. _UDNA.innerHTML = r.value[0].Domain; //显示域名至HTML页面
  358. });
  359. });
  360. } else {
  361. _UDRT.style.display = "block"; //设置成功的页面显示
  362. _UDSD.style.display = "none"; //点击设置页面隐藏
  363. _UDQBD.style.display = "block"; //复制生成等按钮显示
  364. _UDYM.style.display = "block"; //域名管理中心显示
  365. _UDUR.value = r.value[0].Domain; //获取域名生成内容
  366. }
  367. });
  368. }
  369. //域名生成二维码
  370. U.Word.Panel.CodeSet = function (_UDUR, _UDBG, _UDQCD) {
  371. //长 - 宽 - 二维码颜色 - 背景颜色 - 输入的文字或者URL - 生成到的地方
  372. top.U.QR.Code.generate("180", "180", "black", "white", $(_UDUR)[0].value, $(_UDBG)[0]);
  373. _UDQCD.style.display = "block"; //二维码显示
  374. }
  375. //域名复制链接分享
  376. /*U.Word.CopySet = function (_UDUR) {
  377. // $(_UDUR)[0].select();
  378. //_UDUR.select();
  379. top.$(".U_Boom_CO_Popup_18_Que_Url")[0].select();
  380. return document.execCommand('copy');
  381. U.Alert("复制成功");
  382. }*/
  383. //申请域名异步
  384. /*U.Word.AsyneaDomain = function (request) {
  385. var context = request.context, _UDID = context[1], _UDOD = context[2]; request = request.value;
  386. if (request[0]) {
  387. $(_UDOD).addAttrArray({ "innerHTML": "http://" + request[0].UserDomain + ".boomyun.com", style: { cursor: "pointer" }, title: "点击跳转", "onclick": U.M.apply(null, "window.open('" + "http://" + request[0].UserDomain + ".boomyun.com" + "')") });
  388. }
  389. else { U.Alert("你建站超过指定次数请您重新建立。"); }
  390. }*/
  391. /**
  392. * 确定设置按钮
  393. *
  394. * @param {element} 换页元素
  395. * @参数一:设置成功内容
  396. * @参数二:设置的总体盒子
  397. * @参数三:域名内容
  398. * @参数四:域名生成内容
  399. * @参数五:复制二维码按钮
  400. */
  401. U.Word.Panel.QDSZ = function (_UDRT, _UDSD, _UDUR, _UDNA, _UDQBD) {
  402. _UDRT.style.display = "block";
  403. _UDSD.style.display = "none";
  404. _UDQBD.style.display = "block";
  405. _UDUR.innerHTML = _UDNA.innerHTML; //显示域名内容
  406. }
  407. /**
  408. * 创建链接分享
  409. *
  410. * @param {element} 换页元素
  411. */
  412. U.Word.Panel.Createlink = function (UDE, UDOD) {
  413. U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "UD_I_AddDns", UDE.UserFileId, US.userinfo.UserId, 1]), U.Word.Panel.AsynCreatelink, ([null, UDOD]));
  414. }
  415. /**
  416. * 创建链接分享
  417. *
  418. * @param {element} 换页元素
  419. */
  420. U.Word.Panel.AsynCreatelink = function (request) {
  421. var context = request.context;
  422. request.value;
  423. if (request) {
  424. context[1].innerHTML = request.UserDomain + ".1473.cn";
  425. }
  426. }
  427. /**
  428. * 关闭弹窗
  429. *
  430. * @param {element} 换页元素
  431. */
  432. U.Word.Panel.Close = function (UDOD) {
  433. $(UDOD)[0].parentElement.parentElement.parentElement.style.display = "none";
  434. }
  435. //点击弹出域名管理系统
  436. U.Word.Panel.Yuming = function () {
  437. if (!top.$("#U_Boom_Y_B_Manage_Pop")[0]) {
  438. top.U.Yuming.MC.StateBox(U.Word.TF["ET"].UserallDirectoryName);
  439. top.U.D.SetDTop(top.$("#U_Boom_Y_B_Manage_Pop")[0]);
  440. } else {
  441. top.$("#U_Boom_Y_B_Manage_Pop")[0].style.display = "block";
  442. top.U.D.SetDTop(top.$("#U_Boom_Y_B_Manage_Pop")[0]);
  443. }
  444. }
  445. //#endregion
  446. //#region 历史记录
  447. /**
  448. * 初始化加载模板
  449. *
  450. * @param
  451. */
  452. U.Word.Panel.LoadOfficeHistory = function (fileinfo,uid) {
  453. var _UDOD, _UDTD, _USM, _UW;
  454. if (!$("#U_Boom_CO_Editor_body_left_invite_history")[0]) {
  455. _UDTD = $("#U_Boom_CO_Editor_body_left")[0];
  456. _USM = U.M.GetElementInfo($("#UD_SYQXR")[0]);
  457. _UW = _USM["OW"] + 50;
  458. //编辑历史
  459. _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_left_invite_user", "id": "U_Boom_CO_Editor_body_left_invite_history" });
  460. U.UI.Form({ min: false, max: false, draw: false, SO: _UDTD,
  461. content: _UDOD, title: "<div class='UD_SYF_STI'>编辑历史</div>", className: "UD_SYF_S",
  462. hst: { style: { "padding": "0" }, "className": "U_Boom_CO_Editor_body_left_invite_name" },
  463. bst: {},
  464. style: { "width": "300px", "height": "250px", "position": "absolute", "top": "300px", "left": _UW + "px", "border-radius": "0px",
  465. "border": "1px #d6dff0 solid"
  466. }
  467. });
  468. }
  469. if (fileinfo) {
  470. U.Word.Panel.ViewEditHistory(uid, fileinfo.UserDirectoryID, "00000000-0000-0000-0000-000000000000", 1, 10); //历史记录
  471. }
  472. }
  473. /**
  474. * 插入历史
  475. *
  476. * @param {element} 换页元素
  477. */
  478. U.Word.Panel.InsertOfficeHistory = function (UFID, UID, UTH, UDOD) {
  479. var UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_invite_history")[0];
  480. var UHID = Guid.NewGuid();
  481. U.A.Request(US.CD, ([US.DB, "UseStudio_Office", "UD_A_InsertOfficeHistory", UHID, UID, UTH, UFID]), U.Word.Panel.AsynViewEditHistory, ([null, UDOD, UID]));
  482. }
  483. /**
  484. * 查看编辑历史
  485. *
  486. * @param {element} 换页元素
  487. */
  488. U.Word.Panel.ViewEditHistory = function (UID, UDID, UOID, S, E, UDOD) {//创始人id 文件id 空的id 选取开始 选取长度 获取编辑历史的框
  489. setInterval(function () {
  490. UDOD = UDOD || $("#U_Boom_CO_Editor_body_left_invite_history")[0];
  491. U.A.Request(US.CD, ([US.DB, "UseStudio_Office", "UD_A_SelectOfficeHistory", UDID, UOID, S, E]), U.Word.Panel.AsynViewEditHistory, ([null, UDOD, UID]));
  492. }, 1000)
  493. }
  494. /**
  495. * 查看编辑历史异步
  496. *
  497. * @param {element} 换页元素
  498. */
  499. U.Word.Panel.AsynViewEditHistory = function (request) {
  500. var i, _UDOD, _UDTD, _UDSD, _UDFDC,
  501. context = request.context,
  502. _UDE = request.value,
  503. _UDFD = $(context[1]),
  504. _UID = context[2];
  505. _UDFD[0].innerHTML = "";
  506. if (_UDE.length == 0 && !$("#U_Boom_CO_Editor_History_N")[0]) {
  507. $$("div", { "innerHTML": "暂无历史", "style": { "text-align": "center", "margin-top": "50px"} }, _UDFD[0]);
  508. }
  509. else {
  510. // $("#U_Boom_CO_Editor_History_N")[0] && $("#U_Boom_CO_Editor_History_N").remove();
  511. for (i = 0; i < _UDE.length; i++) {
  512. _UDOD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o" }, _UDFD[0]);
  513. _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_l" }, _UDOD);
  514. $$("img", { "src": U.M.GetImgU(_UDE[i].UseFilesServerThumbnailName) }, _UDTD);
  515. _UDTD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r" }, _UDOD);
  516. _UDSD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s" }, _UDTD);
  517. $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s_l", "innerHTML": _UDE[i].UserNickName || _UDE[i].UserName }, _UDSD);
  518. $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_s_r", "innerHTML": U.MT.getTDInterval(_UDE[i].CreateTime, "String") + "保存更新" }, _UDSD);
  519. _UDSD = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_x" }, _UDTD);
  520. (_UDE[i].UserId != _UID) && $$("div", { "innerHTML": "对话", "style": { "margin-right": "10px" }, "onclick": [[]] }, _UDSD);
  521. $$("div", { "innerHTML": "详情", "onclick": [[U.Word.EditHistory, ([_UDE[i]])]] }, _UDSD);
  522. }
  523. _xzqb = $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all" }, _UDFD[0]);
  524. $$("div", { "className": "U_Boom_CO_Editor_body_right_user_o_r_all_a", "innerHTML": "显示全部", "onclick": [[U.Word.EditHistoryq, ([_UDE])]] }, _xzqb);
  525. if (_UDE.length == 1 && (_UDFDC = _UDFD.Child()).length > 0) { _UDFD.append(_UDFDC[_UDFDC.length - 1], "", _UDFDC[0]); }
  526. }
  527. }
  528. /**
  529. * 编辑历史弹出
  530. *
  531. */
  532. U.Word.Panel.EditHistory = function (UDE) {
  533. var _UDOD = $$("div"),
  534. _UCT = top.U.UI.Form({ content: _UDOD, id: "EditHistor", bst: { "style": { "overflow": "hidden"} },
  535. "style": { "width": "750px", "height": "550px", "overflow": "hidden" },
  536. title: "历史记录", draw: false, max: false, min: false
  537. });
  538. U.A.Request(US.CD, ([US.DB, "Usestudio_Office", "UD_A_SelectHistoryDetails", UDE.HistoryId]), U.Word.Panel.AsynEditHistory, ([_UDOD, UDE]));
  539. }
  540. /**
  541. * 编辑历史查看全部
  542. *
  543. */
  544. U.Word.EditHistoryq = function (UDE) {
  545. var _UDOD = $$("div"),
  546. _UCT = top.U.UI.Form({ content: _UDOD, id: "EditHistorq", bst: { "style": { "overflow": "hidden"} },
  547. "style": { "width": "750px", "height": "550px", "overflow": "hidden" },
  548. title: "历史记录", draw: true, max: true, min: true
  549. });
  550. var _UDOD, _UDBD, _UDTD, _UDSD;
  551. for (g = 0; g < UDE.length; g++) {
  552. //_UDOD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory" });
  553. _UDBD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container" }, _UDOD);
  554. _UDTD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container_Head" }, _UDBD);
  555. $$("img", { "src": U.M.GetImgU(UDE[g].UserThumbnailImageHead), "onerror": U.M.ImgError, "alt": UDE[g].UserName, "title": UDE[g].UserName }, _UDTD);
  556. $$("div", { "innerHTML": UDE[g].UserNickName + " " + U.MT.getTDInterval(UDE[g].CreateTime) + " 更改了以下内容" + "<br></br>" }, _UDTD);
  557. $$("div", { "innerHTML": UDE[g].OfficeContent }, _UDTD);
  558. //U.A.Request(US.CD, ([US.DB, "Usestudio_Office", "UD_A_SelectHistoryDetails", UDE.HistoryId]), U.Word.AsynEditHistoryq, ([_UDOD, UDE[i]]));
  559. }
  560. }
  561. /**
  562. * 编辑历史弹出异步
  563. *
  564. */
  565. U.Word.Panel.AsynEditHistory = function (request) {
  566. var i, _UDOD = request.context[0], _UDBD, _UDTD, _UDSD, _UDATA = request.value, _L = _UDATA.length;
  567. for (i = 0; i < _L; i++) {
  568. _UDBD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container" }, _UDOD);
  569. _UDTD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container_Head" }, _UDBD);
  570. $$("img", { "src": U.M.GetImgU(_UDATA[i].UserThumbnailImageHead), "onerror": U.M.ImgError, "alt": request.context[1].UserName /*_UDATA[i].UserName*/, "title": request.context[1].UserName/*_UDATA[i].UserName*/ }, _UDTD);
  571. $$("div", { "innerHTML": (request.context[1].UserNickName/*_UDATA[i].UserNickName || _UDATA[i].UserName*/) + " " + U.MT.getTDInterval(_UDATA[i].CreateTime) + " 更改了以下内容" }, _UDTD);
  572. $$("div", { "innerHTML": _UDATA[i].OfficeContent }, _UDTD);
  573. }
  574. }
  575. /**
  576. * 编辑历史查看全部弹出异步
  577. *
  578. */
  579. U.Word.AsynEditHistoryq = function (request) {
  580. var i, _UDOD = request.context[0], _UDBD, _UDTD, _UDSD, _UDATA = request.value, _L = _UDATA.length;
  581. for (i = 0; i < UDE; i++) {
  582. _UDBD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container" }, _UDOD);
  583. _UDTD = $$("div", { "class": "U_Boom_Forms_Other_EditHistory_Container_Head" }, _UDBD);
  584. $$("img", { "src": U.M.GetImgU(_UDATA[i].UserThumbnailImageHead), "onerror": U.M.ImgError, "alt": request.context[1].UserName /*_UDATA[i].UserName*/, "title": request.context[1].UserName/*_UDATA[i].UserName*/ }, _UDTD);
  585. $$("div", { "innerHTML": (request.context[1].UserNickName/*_UDATA[i].UserNickName || _UDATA[i].UserName*/) + " " + U.MT.getTDInterval(request.context[1].CreateTime) + " 更改了以下内容" }, _UDTD);
  586. $$("div", { "innerHTML": request.context[1].OfficeContent }, _UDTD);
  587. }
  588. }
  589. /**
  590. * 打开历史记录
  591. *
  592. * @param {element} 换页元素
  593. */
  594. //U.Word.Openhistory = function (UDE) {
  595. // U.UI.Form({ draw: false, max: false, id: "U_Boom_CO_History", content: "", title: "历史记录", hst: { style: { "padding": "0 0 0 10px"} }, bst: { "style": { overflow: "hidden"}} }); //创建窗体
  596. // U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "UD_A_SelectHistoryDetails", UDE.HistoryId]), U.Word.AsynOpenhistory, ([]));
  597. //}
  598. /**
  599. * 打开异步
  600. *
  601. * @param {element} 换页元素
  602. */
  603. //U.Word.AsynOpenhistory = function (request) {
  604. // var context = request.context,
  605. // _UDOD = context[0];
  606. // request = request.value;
  607. // if (request != -1) {
  608. // _UDOD.inenrHTML = request.OfficeContent;
  609. // }
  610. //}
  611. //#endregion