U.Word.Panel.js 30 KB

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