cmsHome.ss.jsp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. <html>
  2. <head>
  3. <%-- 先去掉,好像没用到。Lin
  4. <wdDialog close="true"/>
  5. --%>
  6. <css.ss file="/ss/jquery-smartMenu/smartMenu.css"/>
  7. <js.ss file="/ss/jquery-smartMenu/jquery-smartMenu.js"/>
  8. <js.ss file="/ss/growHeight.js"/>
  9. <!-- 引入查阅pdf的相关文件 -->
  10. <css.ss file="/ss/pdf/base.min.css"/>
  11. <css.ss file="/ss/pdf/fancy.min.css"/>
  12. <js.ss file="/ss/pdf/compatibility.min.js"/>
  13. <js.ss file="/ss/pdf/pdf2htmlEX.min.js"/>
  14. <!-- 引入关于锚点的js-->
  15. <js.ss file="/ss/jquery-anchor/jquery.anchor.1.0.js"/>
  16. <!--拖拽js-->
  17. <js.ss file="/ss/wdDrag.js"/>
  18. <style type="text/css">
  19. .mainDiv {
  20. display: flex;
  21. justify-content: center;
  22. text-align: center;
  23. }
  24. .mainDiv.cms-background.scrollbar img {
  25. width: auto !important;
  26. height: auto !important;
  27. max-width: 100% !important;
  28. max-height: 100% !important;
  29. }
  30. .mainDiv.cms-background.scrollbar .videoparent {
  31. width: auto !important;
  32. height: 100% !important;
  33. }
  34. .mainDiv.cms-background.scrollbar .video {
  35. width: 100% !important;
  36. height: 100% !important;
  37. }
  38. .contextMenu-div .contextMenu-button {
  39. margin: 4px;
  40. }
  41. .smallScroll::-webkit-scrollbar {
  42. cursor: url(image/cur.ico), default !important;
  43. width: 3px;
  44. }
  45. .smallScroll::-webkit-scrollbar-track {
  46. background-color: none;
  47. border-radius: 5px;
  48. cursor: url(image/cur.ico), default !important;
  49. }
  50. .smallScroll::-webkit-scrollbar-thumb {
  51. background: #b7b7b7;
  52. cursor: url(image/cur.ico), default !important;
  53. border-radius: 5px;
  54. }
  55. #leftDiv .icon-checked {
  56. display: none !important;
  57. }
  58. #leftDiv .icon-unchecked {
  59. display: none !important;
  60. }
  61. .leftTab {
  62. padding: 2px !important;
  63. }
  64. .leftTab-selected {
  65. padding: 2px 6px !important;
  66. }
  67. </style>
  68. </head>
  69. <body style="overflow: hidden;">
  70. <div class="nr-system-div" ssFith="true" style="width: 100%;position: relative;display: flex;overflow: hidden;">
  71. <!--
  72. <div class="nrsx">
  73. <span>名称:${nrmc}</span>
  74. <span> 类型:${nrlb}</span>
  75. </div>
  76. -->
  77. <div id="float_menu" class="contextMenu-div">
  78. <input class="contextMenu-button" type="button" value="删除" id="delete">
  79. <input class="contextMenu-button" type="button" value="属性" id="fileProperty">
  80. </div>
  81. <div id="leftDiv" style="width: 200px;height: 100%;overflow:auto;display: inline-block;position: relative;z-index: 9;" class="smallScroll cms-background" ssDragw="{min:180,max:300,right:true}"> <%-- wdDragWidth="min:180px,max:300px,side:right"。Lin --%>
  82. <div id="container" style="width:100%;min-height: 100%;padding-bottom: 83px;box-sizing: border-box;">
  83. <div class="column dragList" id="columnSelected">
  84. </div>
  85. <drag.ss name="column" func="editOrder"/>
  86. <div class="graphButton button icon-add" id="add" style="float: right;margin-top:10px;margin-right: 5px;height: 60px;line-height: 82px;">增加</div>
  87. </div>
  88. </div>
  89. <div class="mainDiv smallScroll" unselectable="on" ondragstart="return false;" onselectstart="return false;" style="-moz-user-select:none;width: 100%;height: 100%;vertical-align: top;overflow-x: hidden;" ssDragw=""> <%-- wdDragWidth=""。先保留,搞明白再去掉???Lin --%>
  90. </div>
  91. <input type="button" style="position:absolute;right:16px;top:16px;border: none;display:none;" id="fullscreen" class="" title="全屏/还原按钮">
  92. </div>
  93. <div class='bottom-div'>
  94. <!-- 底部区域 -->
  95. <!--<input type="button" value="关闭" onclick="wd.display.closeDialog();" class="bottom-button" >-->
  96. </div>
  97. </body>
  98. <script type="text/javascript">
  99. var currSubNrid; //当前选中的子内容ID
  100. var haveButton = false;
  101. var hide = '${hide}'.split(",");
  102. var hideAdd = hide.indexOf("add");
  103. var hideList = hide.indexOf("list");
  104. if(hideAdd>-1){
  105. $("#add").hide();
  106. }
  107. /* 添加全屏等,如果是内嵌 */
  108. if ('true' == '${inner}' && window.frameElement) { //内嵌编辑器
  109. var thisIsFullFrame = window.frameElement.getAttribute("fullframe") == "true";
  110. var cms_nameField = '<wd:write value="${nameField}"/>';
  111. if (cms_nameField != '') { //自动填充表单值,如果对应表单值不为空的话
  112. window.cms_setNameField = function (name) {
  113. $("[name='" + cms_nameField + "']", window.parent.document).each(function () {
  114. console.log(this);
  115. if (this.GrowHeight) {
  116. var val = this.GrowHeight.val();
  117. if (val == null || val == '') {
  118. this.GrowHeight.val(name);
  119. }
  120. }
  121. });
  122. }
  123. }
  124. var $full = $("#fullscreen");
  125. var cms_title = '<wd:write value="${cms_title}"/>';
  126. if (!thisIsFullFrame && cms_title != '' && window.frameElement && !window.frameElement.titleIsShowed) { //鼠标进入时显示title
  127. var cms_showTitle = function (e) {
  128. var _frame = window.frameElement;
  129. var fbound = _frame.getBoundingClientRect();
  130. var windowWidth = window.top.document.documentElement.getBoundingClientRect().width;
  131. var xy = recursionIframe();
  132. var right = (windowWidth - fbound.width - xy.left);
  133. wd.topWindow.$("#flashmsgtipsId").css({
  134. "top": (xy.top - window.top.document.body.scrollTop + 5) + "px",
  135. "right": (Math.max(right, 10) + 2) + "px",
  136. "bottom": "",
  137. "left": ""
  138. });
  139. var options = {
  140. onShow: function () {
  141. wd.topWindow.$("#flashmsgtipsId").find(".flashMsg-down").hide();
  142. $full.fadeOut();
  143. },
  144. onHide: function () {
  145. wd.topWindow.$("#flashmsgtipsId").find(".flashMsg-down").show();
  146. $full.fadeIn();
  147. }
  148. };
  149. window.frameElement.titleIsShowed = true;
  150. wd.display.alert(cms_title, options);
  151. document.body.removeEventListener("mouseenter", cms_showTitle);
  152. }
  153. document.body.addEventListener("mouseenter", cms_showTitle);
  154. }
  155. $full.click(function () {
  156. if (thisIsFullFrame) {
  157. window.frameElement.srcFrame.contentWindow.location.reload();
  158. window.frameElement.parentNode.removeChild(window.frameElement);
  159. } else {
  160. var fullframe = window.parent.document.createElement("iframe");
  161. fullframe.width = "100%";
  162. fullframe.height = "100%";
  163. fullframe.setAttribute("fullframe", "true");
  164. fullframe.style.background = "white";
  165. fullframe.style.position = "absolute";
  166. fullframe.style.bottom = 0;
  167. fullframe.style.left = 0;
  168. fullframe.style.right = 0;
  169. fullframe.style.top = 0;
  170. fullframe.style.zIndex = 99999;
  171. fullframe.src = window.frameElement.src;
  172. fullframe.srcFrame = window.frameElement;
  173. window.parent.document.body.appendChild(fullframe);
  174. }
  175. }).addClass(thisIsFullFrame ? "icon-restore" : "icon-fullscreen")
  176. .attr("title", thisIsFullFrame ? "还原" : "全屏")
  177. .show();
  178. }
  179. /* 添加全屏等,如果是内嵌end */
  180. //设置弹出窗口右上角的按钮
  181. function setWindowButton() {
  182. //获取当前窗口对应的dhxWin对象
  183. var w = wd.display.getwdDialogWindows();
  184. if (!haveButton) {
  185. //添加下载按钮
  186. w.button("CMS_download").show();
  187. w.button("CMS_download").onclick = function () {
  188. if (!currSubNrid) {
  189. wd.display.alert("请选择下载文件")
  190. return;
  191. }
  192. var downloadUrl = "@service{name:'downloadNr'}@" + "&nrid=" + currSubNrid;
  193. wd.display.downloadFile(downloadUrl);
  194. //window.open(downloadUrl, '', 'height=0,width=0,left=-300,top=-300,location=no,menubar=no,directories=no,directories=no,scrollbars=no,status=no,titlebar=no,toolbar=no');
  195. }
  196. //添加全屏按钮
  197. w.button("CMS_fullscreen").show();
  198. $(w.button("CMS_fullscreen")).on("click", function () {
  199. //使参数指定的DOM元素全屏,如果不传参数则默认带个页面全屏
  200. wd.display.CmsFullScreen($('.mainDiv')[0]);
  201. //alert($('#mainDiv')[0].outerHTML);
  202. });
  203. haveButton = true;
  204. }
  205. }
  206. $("document iframe").last().attr("id", "frameid");
  207. function save() {
  208. var nrid = "${nrid}";
  209. wd.display.getwdDialogOpener().loadNrid(nrid);
  210. wd.display.closeDialog();
  211. }
  212. function loadItem() {
  213. console.info("${nrid}");
  214. var el = document.getElementById("columnSelected");
  215. el.innerHTML = "";
  216. $.ajax({
  217. type: "GET",
  218. /* 改。Lin
  219. url: "@service{name:'nrxtsy',param:{nrid:'${nrid}',sfbf:'0',jlztm:'${jlztm}'}}@",
  220. */ url: "<serv.ss name='wrCmsList' parm='{nrid:"${nrid}",sfbf:"0",jlztm:"${jlztm}"}'/>",
  221. async: false,
  222. dataType: "json",
  223. success: function (data) {
  224. if (data) {
  225. for (var i = 0; i < data.length; i++) {
  226. addItem(data[i].mswj, data[i].mc, data[i].sltwj, data[i].tbwj, data[i].nrjslbm);
  227. if (i == 0 && window.cms_setNameField) {
  228. window.cms_setNameField(data[0].mc);
  229. }
  230. }
  231. var dr = DM.getInstance("column", ["opdown"]);
  232. dr.dragend = function (even) {
  233. resetDesign(".dragList");
  234. }
  235. dr.selectedList.reload();
  236. /* 编辑不用隐藏
  237. if(data.length<=1){
  238. $("#leftDiv").hide();
  239. }
  240. */
  241. }
  242. },
  243. error: function () { }
  244. });
  245. menu();
  246. }
  247. function addItem(id, name, sltwj, tbwj, nrjslbm) {
  248. var el = document.getElementById("columnSelected");
  249. /* 改。Lin
  250. var getDataUrl = '@service{name:"getData",param:{path:"wdVal{path}",download:"1"}}@';
  251. */ var getDataUrl = "<serv.ss name='dlByHttp' parm='{path:"ssVal{path}",download:"1"}'/>";
  252. var json;
  253. var co;
  254. if (sltwj != null) {
  255. json = JSON.parse('{"path":"' + encodeURI(sltwj) + '"}');
  256. getDataUrl = wd.display.replaceDynamicParam(getDataUrl, json);
  257. //wdObjectID='" + id + "'
  258. co = "<div class=\"item leftTab hLine\" ssObjId='"+ id + <%-- wdObjectID=。是 wdObjectID,不是 wdObjectId。Lin --%>
  259. "' style=\"display:flex;align-items:center;\"><div class=\"item_slt\"><div style=\"border:1px solid #e0e0e0;width:149px;height:79px;border-box:box-sizing;display:flex;justify-content:center;align-items:center;background-color:#fff;margin-bottom:5px;margin-top:15px;\"><img class='handle' style=\"max-width:100%;max-height:100%;\" src=\"" +
  260. getDataUrl + "\"></img></div><div style=\"text-align:center; display:inline-block;max-width:100%;margin:0 auto;height:20px;margin-bottom:5px;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;\" id=\"cms_name_" + id + "\">" +
  261. name + "</div></div><span style='display:none;' class='nrid'>" + id +
  262. "</span><span style='display:none;' class='nrjslbm'>" + nrjslbm + "</span>"
  263. /*
  264. <div id=\"qbian\" style=\"width:15px;height: 55px;position: fixed;background-color: #FFF;left:158px;display:none;\"></div>
  265. */
  266. +"</div>";
  267. } else {
  268. if (tbwj == "") {
  269. tbwj = "${sessionScope.ssUser.skinDir}image/icon/nrjslb-" + nrjslbm + "-large.png";
  270. getDataUrl = tbwj;
  271. } else {
  272. json = JSON.parse('{"path":"' + encodeURI(tbwj) + '"}');
  273. getDataUrl = wd.display.replaceDynamicParam(getDataUrl, json);
  274. }
  275. co = "<div class=\"item leftTab hLine\" ssObjId='" + id + <%-- wdObjectID=。是 wdObjectID,不是 wdObjectId。Lin --%>
  276. "' style=\"display:flex;align-items:center;\" ><img class='handle' style=\"width:22px;height:28px;margin-top:13px;margin-bottom:10px;\" src=\"" +
  277. getDataUrl + "\"></img><div style=\"width:108px;margin-left:10px;height:32px;line-height:17px;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;\" id=\"cms_name_" + id + "\">" +
  278. name + "</div><span style='display:none;' class='nrid'>" + id +
  279. "</span><span style='display:none;' class='nrjslbm'>" + nrjslbm + "</span>"+
  280. /*
  281. <div id=\"qbian\" style=\"width:15px;height: 55px;position: fixed;background-color: #FFF;left:158px;display:none;\"></div>
  282. */
  283. "</div>";
  284. }
  285. $(el).append(co);
  286. wd.display.initGrowHigh("cms_name_" + id, '80px', {});
  287. }
  288. function clicked() {
  289. console.info(wd);
  290. var prevNrid = $(this).find(".nrid").text();
  291. var appendString = '';
  292. if (prevNrid != null && prevNrid.trim().length > 0) {
  293. appendString = "&prevNrid=" + prevNrid;
  294. }
  295. var objId = '${objectId}';
  296. if (objId != null && objId.trim().length > 0) {
  297. appendString += "&objectId=" + objId;
  298. }
  299. var objName = '${objectName}';
  300. if (objName != null && objName.trim().length > 0) {
  301. appendString += "&objectName=" + objName;
  302. }
  303. var objFunction = '${objectFunction}';
  304. if (objFunction != null && objFunction.trim().length > 0) {
  305. appendString += "&objectFunction=" + objFunction;
  306. }
  307. wd.display.showComponent({
  308. show: ["wdDialog"],
  309. hide: [],
  310. /* 改。Lin
  311. url: "@service{name:'allowAccess',dest:'xzym', param:{nrid:'${nrid}'}}@" + appendString,
  312. dest: "nrxt.xzym",
  313. */
  314. url: "<serv.ss name='chkCmsNrid' dest='cmsAdd' parm='{nrid:"${nrid}"}'/>" + appendString,
  315. dest: "cmsAdd",
  316. title: "增加",
  317. width: 550,
  318. high: 272,
  319. wdDialogId: 44011763,
  320. form: ""
  321. });
  322. }
  323. //加载播放器
  324. function loadPlayer(nrid, nrjslbm) {
  325. var mainNrin = $(".mainDiv").attr("nrid");
  326. console.log("mainNrin:" + mainNrin);
  327. /* 先注释掉
  328. if (mainNrin == nrid) {
  329. console.log("相同内容 不重复加载");
  330. return;
  331. }
  332. */
  333. $.ajax({
  334. type: "GET",
  335. /* 改。Lin
  336. url: "@service{name:'loadNrDesignAndPlayerData'}@",
  337. */ url: "<serv.ss name='wrCmsPlay'/>",
  338. async: true,
  339. data: {
  340. "nrid": nrid,
  341. "nrjslbm": nrjslbm
  342. },
  343. dataType: "json",
  344. success: function (data) {
  345. /// 增加,增加错误处理 -- 统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData。Lin
  346. if (data.ssCode != 0) {
  347. alert(data.ssMsg);
  348. return;
  349. }
  350. ///
  351. console.info(data);
  352. var div = document.createElement("div");
  353. var obj = {};
  354. obj.design = data.design;
  355. obj.resDesign = data.resDesign;
  356. div.setAttribute("data-init", JSON.stringify(obj));
  357. var tempData = data.data.replace(new RegExp('@dataFolder@', 'gm'), data.dataFolderPath);
  358. div.innerHTML = tempData;
  359. $(".mainDiv").html($(div));
  360. wd.display.CmsNrscroll($('.mainDiv')[0], nrid);
  361. $(".mainDiv").attr("nrid", nrid);
  362. }
  363. });
  364. }
  365. var float_menu_nrid = "";
  366. function menu() {
  367. //显示事件
  368. var showDetail = function (e) {
  369. selectItem(this);
  370. // e = (e) ? e : window.event
  371. // if (e.pageX < menu_width / 2) {
  372. // $("#float_menu").css("left", 1).css("top", e.pageY + 20).show();
  373. // } else {
  374. // $("#float_menu").css("left", e.pageX - menu_width / 2).css("top", e.pageY + 20).show();
  375. // }
  376. var nrid = $(this).find(".nrid").text();
  377. currSubNrid = nrid;
  378. var nrjslbm = $(this).find(".nrjslbm").text(); //新增
  379. console.info("nrid:" + nrid + " nrjslbm:" + nrjslbm);
  380. if (float_menu_nrid == "") {
  381. var menu_width = $("#float_menu").width();
  382. console.log($(this).width());
  383. console.log(menu_width);
  384. console.log(($(this).width() - menu_width) / 2);
  385. console.log($(this).position().left);
  386. $("#float_menu").css("left", $(this).position().left + ($(this).width() - menu_width) / 2).css("top", $(this).position().top + $(this).height() + 1).show();
  387. float_menu_nrid = nrid;
  388. } else {
  389. $("#float_menu").hide();
  390. float_menu_nrid = "";
  391. }
  392. loadPlayer(nrid, nrjslbm);
  393. setWindowButton();
  394. // $(".leftTab-selected").find("#qbian").show();
  395. };
  396. var showProperty = function () {
  397. var nrid = $(this).find(".nrid").text();
  398. var str = '&nrid=' + nrid;
  399. wd.display.showComponent({
  400. show: ['wdDialog'],
  401. hide: [],
  402. /* 改。Lin
  403. url: '@service{name:"getNrProperty",dest:"nr_sx"}@' + str,
  404. */ url: "<serv.ss name='initCcmsEdit' dest='ccmsEdit'/>"+ str,
  405. title: '修改文件属性',
  406. width: 500,
  407. high: 400,
  408. form: ''
  409. });
  410. };
  411. var downloadNr = function () {
  412. var nrid = $(this).find(".nrid").text();
  413. window.open("@service{name:'downloadNr'}@" + "&nrid=" + nrid);
  414. };
  415. var deleteNr = function () {
  416. $.ajax({
  417. type: "GET",
  418. url: "@service{name:'deleteNr'}@",
  419. async: false,
  420. data: {
  421. id: "${nrid}",
  422. nrid: $(this).find(".nrid").text()
  423. },
  424. dataType: "json",
  425. success: function (data) {
  426. if (data.result) {
  427. wd.display.alert("删除成功!")
  428. location.reload();
  429. loadItem();
  430. }
  431. },
  432. error: function () {
  433. console.info('delete fail');
  434. }
  435. });
  436. };
  437. var addNr = function () {
  438. var prevNrid = $(this).find(".nrid").text();
  439. var appendString = '';
  440. if (prevNrid != null && prevNrid.trim().length > 0) {
  441. appendString = "&prevNrid=" + prevNrid;
  442. }
  443. var objId = '${objectId}';
  444. if (objId != null && objId.trim().length > 0) {
  445. appendString += "&objectId=" + objId;
  446. }
  447. var objName = '${objectName}';
  448. if (objName != null && objName.trim().length > 0) {
  449. appendString += "&objectName=" + objectName;
  450. }
  451. var objFunction = '${objectFunction}';
  452. if (objFunction != null && objFunction.trim().length > 0) {
  453. appendString += "&objectFunction=" + objFunction;
  454. }
  455. /* 去掉,去掉变量 url。Lin
  456. var url = "@service{name:'allowAccess',dest:'xzym',param:{nrid:'${nrid}'}}@" + appendString;
  457. */
  458. wd.display.showComponent({
  459. show: ["wdDialog"],
  460. hide: [],
  461. /* 改,去掉变量 url 了。Lin
  462. url: url,
  463. dest: "nrxt.xzym",
  464. */
  465. url: "<serv.ss name='chkCmsNrid' dest='cmsAdd' parm='{nrid:"${nrid}"}'/>" + appendString,
  466. dest: "cmsAdd",
  467. title: "增加文件",
  468. width: 550,
  469. high: 240,
  470. form: ""
  471. });
  472. };
  473. var nrMenu = [[
  474. {text: "删除", func: deleteNr},
  475. {text: "内容属性", func: showProperty},
  476. {text: "下载", func: downloadNr},
  477. {text: "增加", func: addNr}
  478. ]];
  479. // $(".item").smartMenu(nrMenu, {
  480. // name: "item"
  481. // });
  482. //添加点击是事件
  483. $('.item').click(function () {
  484. $(".leftTab-selected").find("#qbian").show();
  485. $(".leftTab-selected").siblings().find("#qbian").hide();
  486. });
  487. $('.item').mouseup(showDetail);
  488. $('.item').mouseleave(function () {
  489. $("#float_menu").hide();
  490. float_menu_nrid = "";
  491. });
  492. }
  493. function resetDesign(column) {
  494. var items = $(column).find(".item");
  495. var ids = "";
  496. $(items).each(function (i, element) {
  497. ids += $(element).find(".nrid").text() + ",";
  498. })
  499. if (ids.length > 0) {
  500. ids = ids.substr(0, ids.length - 1);
  501. $.ajax({
  502. type: "GET",
  503. url: "@service{name:'resetDesign'}@",
  504. async: true,
  505. data: {
  506. id: "${nrid}",
  507. nrids: ids
  508. }
  509. });
  510. }
  511. }
  512. //为元素添加className:selected
  513. function selectItem(element) {
  514. $('.item').removeClass('leftTab-selected').addClass('hLine');
  515. $(element).addClass("leftTab-selected").removeClass('hLine');
  516. }
  517. /*隐藏右键菜单*/
  518. $("#float_menu").mouseleave(function () {
  519. $("#float_menu").hide();
  520. float_menu_nrid = "";
  521. });
  522. $("#float_menu").mouseenter(function () {
  523. $("#float_menu").show();
  524. });
  525. $('#fileProperty').on('click', function (e) {
  526. var nrid = $('.leftTab-selected').find(".nrid").text();
  527. if (nrid != null && nrid.trim().length > 0) {
  528. var str = '&nrid=' + nrid;
  529. wd.display.showComponent({
  530. show: ['wdDialog'],
  531. hide: [],
  532. /* 改。Lin
  533. url: '@service{name:"getNrProperty",dest:"nr_sx"}@' + str,
  534. */ url: "<serv.ss name='initCcmsEdit' dest='ccmsEdit'/>"+ str,
  535. title: '修改文件属性',
  536. width: 550,
  537. high: 170,
  538. form: ''
  539. });
  540. }
  541. });
  542. $('#delete').on('click', function (e) {
  543. var nrid = $('.leftTab-selected').find(".nrid").text();
  544. if (nrid != null && nrid.trim().length > 0) {
  545. $.ajax({
  546. type: "GET",
  547. /* 改。Lin
  548. url: "@service{name:'deleteNr'}@",
  549. */ url: "<serv.ss name='delCcms'/>",
  550. async: false,
  551. data: {
  552. 'id': "${nrid}",
  553. 'nrid': nrid
  554. },
  555. dataType: "json",
  556. success: function (data) {
  557. if (data.result) {
  558. wd.display.alert("删除成功!")
  559. loadItem();
  560. }
  561. },
  562. error: function () {
  563. console.info('delete fail');
  564. }
  565. });
  566. }
  567. });
  568. $('#add').on('click', function (e) {
  569. var prevNrid = $('.leftTab-selected').find(".nrid").text();
  570. var appendString = '';
  571. if (prevNrid != null && prevNrid.trim().length > 0) {
  572. appendString = "&prevNrid=" + prevNrid;
  573. }
  574. var objId = '${objectId}';
  575. if (objId != null && objId.trim().length > 0) {
  576. appendString += "&objectId=" + objId;
  577. }
  578. var objName = '${objectName}';
  579. if (objName != null && objName.trim().length > 0) {
  580. appendString += "&objectName=" + objName;
  581. }
  582. var objFunction = '${objectFunction}';
  583. if (objFunction != null && objFunction.trim().length > 0) {
  584. appendString += "&objectFunction=" + objFunction;
  585. }
  586. /* 去掉,去掉变量 url。Lin
  587. var url = "@service{name:'allowAccess',dest:'xzym',param:{nrid:'${nrid}',width:'${ifrwidth}',height:'${ifrheight}'}}@" + appendString;
  588. */
  589. wd.display.showComponent({
  590. show: ["wdDialog"],
  591. hide: [],
  592. /* 改,去掉变量 url 了。Lin
  593. url: url,
  594. dest: "nrxt.xzym",
  595. */
  596. url: "<serv.ss name='chkCmsNrid' dest='cmsAdd' parm='{nrid:"${nrid}",width:"${ifrwidth}",height:"${ifrheight}"}'/>" + appendString,
  597. dest: "cmsAdd",
  598. title: "增加",
  599. width: 550,
  600. high: 272,
  601. form: ""
  602. });
  603. });
  604. loadItem();
  605. (function () {
  606. $('.mainDiv').attr("isCmsFullScreen", 'false');
  607. $("#float_menu").hide();
  608. document.oncontextmenu = function (ev) {
  609. return false; //屏蔽右键菜单
  610. }
  611. var sftc = 1; //是否弹窗
  612. if ("${sftc}" == "0") {
  613. sftc = 0;
  614. }
  615. var w = wd.display.getwdDialogWindows();
  616. //添加内容属性按钮
  617. w.button("CMS_nrProperty").show();
  618. w.button("CMS_nrProperty").onclick = function () {
  619. var id = '${nrid}';
  620. id = id.substr(2);
  621. wd.display.showComponent({
  622. show: ["wdDialog"],
  623. hide: [],
  624. url: "@service{name:'nr_xg_jbqk',dest:'xg_nr_sx'}@" + "&nrid=" + id,
  625. dest: "nrxt.xg_nr_sx",
  626. title: "修改内容属性",
  627. width: 993,
  628. high: 537,
  629. form: ""
  630. });
  631. }
  632. if ("${nrlbm}" == "901001") {
  633. w.button("CMS_nrProperty").hide();
  634. }
  635. $('.mainDiv').attr("isCmsFullScreen", 'false');
  636. var items = $(".dragList").find(".item");
  637. if (items == undefined || items.length == 0) {
  638. if (sftc) {
  639. clicked();
  640. }
  641. } else {
  642. var nrid = $(items[0]).find(".nrid").text();
  643. var nrjslbm = $(items[0]).find(".nrjslbm").text();
  644. loadPlayer(nrid, nrjslbm);
  645. selectItem($(items[0])[0]);
  646. setWindowButton();
  647. wd.display.CmsNrscroll($('.mainDiv')[0], nrid);
  648. }
  649. })();
  650. window.onunload = function () {
  651. var callback_ = '${callback}';
  652. if (callback_ != '') {
  653. //wd.display.getwdDialogOpener().eval(callback);
  654. var w = wd.display.getwdDialogOpener();
  655. var callback = w[callback_];
  656. callback && callback();
  657. }
  658. };
  659. </script>
  660. </html>