cmsPlay.ss.jsp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. <html>
  2. <head>
  3. <%-- 先去掉,好像没用到。Lin
  4. <wdDialog collect="true" close="true"/>
  5. --%>
  6. <meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="cache-control" content="no-cache">
  8. <meta http-equiv="expires" content="0">
  9. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  10. <meta http-equiv="description" content="This is my page">
  11. <css.ss file="/ss/jquery-smartMenu/smartMenu.css"/>
  12. <js.ss file="/ss/jquery-smartMenu/jquery-smartMenu.js"/>
  13. <%--<script type="text/javascript" src="js/top.js"></script>--%>
  14. <js.ss file="/ss/growHeight.js"/>
  15. <!-- 引入查阅pdf的相关文件 -->
  16. <css.ss file="/ss/pdf/base.min.css"/>
  17. <css.ss file="/ss/pdf/fancy.min.css"/>
  18. <js.ss file="/ss/pdf/compatibility.min.js"/>
  19. <js.ss file="/ss/pdf/pdf2htmlEX.min.js"/>
  20. <!-- 引入关于锚点的js-->
  21. <js.ss file="/ss/jquery-anchor/jquery.anchor.1.0.js"/>
  22. <style>
  23. .leftTab-dim {
  24. position: relative;
  25. top: -11px;
  26. left: 31px;
  27. }
  28. .about_bt {
  29. min-height: 16px;
  30. position: relative;
  31. bottom: 12px;
  32. }
  33. #mainDiv .img {
  34. width: auto !important;
  35. height: auto !important;
  36. max-width: 100%!important;
  37. max-height: 100%!important;
  38. }
  39. #mainDiv{
  40. width: 100% !important;
  41. overflow: hidden!important;
  42. }
  43. .leftTab-selected #qbian{
  44. display:none !important;
  45. }
  46. #ascrail2000{
  47. display:none!important;
  48. }
  49. .item{
  50. /* height: 52px !important; */
  51. height: auto !important;
  52. word-break: break-all;
  53. }
  54. #dragIcon{
  55. background-color: white;
  56. }
  57. #topMsg{position: absolute;}
  58. #bottomMsg{position: absolute;}
  59. .item_slt{
  60. text-align: center;
  61. }
  62. </style>
  63. </head>
  64. <body style="overflow: hidden;">
  65. <wd:iterate name="${helplist}" id="item">
  66. <textarea style="display:none;" class="helplist" size="${item.size}" title='<wd:write value="${item.title}"/>' helpHaShCode="${item.helpMd5Code}">
  67. <wd:write value="${item.content}"/>
  68. </textarea>
  69. </wd:iterate>
  70. <div class="nr-system-div" ssFith="true" style="width: 100%;height:100%;position: relative;display: flex;overflow: hidden;position:fixed;padding:5px;">
  71. <div id="leftDiv" class="smallScrollbar cms-background" style="min-width: 191px;height: 100%;overflow: auto;display: inline-block;position: relative;z-index: 9;" class="smallScrollbar" ssDragw="{min:186,max:300,right:true}"> <%-- wdDragWidth="min:186px,max:300px,side:right"。Lin --%>
  72. <!-- <div class='container'> -->
  73. <div id="container" style="width:100%;min-height: 100%;padding-bottom: 83px;box-sizing: border-box;border-right: 1px solid #6c9ed7;">
  74. <!-- <div class="show-way">
  75. <span class="list-way" id="list-way"></span>
  76. <span class="grid-way" id="grid-way"></span>
  77. </div> -->
  78. <div class="dragList column" id="column1">
  79. </div>
  80. </div>
  81. <!-- <div class="slideL-div"><img src="wd/theme/standard/img/leftSlide.png"></div>
  82. <div class="slideR-div"><img src="wd/theme/standard/img/rightSlide.png"></div> -->
  83. <!-- <div style="clear: both;"></div> -->
  84. <!-- </div> -->
  85. </div>
  86. <div id='topMsg' style="left: 167px;top: 0px;"></div>
  87. <div id="mainDiv" unselectable="on" ondragstart="return false;" style="width:100%" style="min-height: 100%;" onselectstart="return false;" class="mainDiv scrollbar " ssDragw=""> <%-- wdDragWidth=""。先保留,搞明白再去掉???Lin --%>
  88. </div>
  89. <input type="button" style="position:absolute;right:16px;top:16px;border: none;display:none;" id="fullscreen" class="" title="全屏/还原按钮">
  90. <div id='bottomMsg' style="left: 167px;top: 0px;"></div>
  91. </div>
  92. <div class='bottom-div'>
  93. <!-- 底部区域 -->
  94. <!--<input type="button" value="关闭" onclick="wd.display.closeDialog();" class="bottom-button">-->
  95. </div>
  96. <%-- <input type="button" value="" name="" id="scale" class="scale"> --%>
  97. <%--<script type="text/javascript" src='wd/js/contentSys.js'></script>--%>
  98. </body>
  99. <script type="text/javascript">
  100. /* 添加全屏等,如果是内嵌 */
  101. if ('true' == '${inner}' && window.frameElement) { //内嵌编辑器
  102. var thisIsFullFrame = window.frameElement.getAttribute("fullframe") == "true";
  103. var $full = $("#fullscreen");
  104. var cms_title = '<wd:write value="${cms_title}"/>';
  105. if (!thisIsFullFrame && cms_title != '' && window.frameElement && !window.frameElement.titleIsShowed) { //鼠标进入时显示title
  106. var cms_showTitle = function (e) {
  107. var _frame = window.frameElement;
  108. var fbound = _frame.getBoundingClientRect();
  109. var windowWidth = window.top.document.documentElement.getBoundingClientRect().width;
  110. var xy = recursionIframe();
  111. var right = (windowWidth - fbound.width - xy.left);
  112. wd.topWindow.$("#flashmsgtipsId").css({
  113. "top": (xy.top + 5 - window.top.document.body.scrollTop) + "px",
  114. "right": (Math.max(right, 10) + 2 ) + "px",
  115. "bottom": "",
  116. "left": ""
  117. });
  118. var options = {
  119. onShow: function () {
  120. wd.topWindow.$("#flashmsgtipsId").find(".flashMsg-down").hide();
  121. $full.fadeOut();
  122. },
  123. onHide: function () {
  124. wd.topWindow.$("#flashmsgtipsId").find(".flashMsg-down").show();
  125. $full.fadeIn();
  126. }
  127. };
  128. window.frameElement.titleIsShowed = true;
  129. wd.display.alert(cms_title, options);
  130. document.body.removeEventListener("mouseenter", cms_showTitle);
  131. }
  132. document.body.addEventListener("mouseenter", cms_showTitle);
  133. }
  134. $full.click(function () {
  135. if (thisIsFullFrame) {
  136. window.frameElement.srcFrame.contentWindow.location.reload();
  137. window.frameElement.parentNode.removeChild(window.frameElement);
  138. } else {
  139. var fullframe = window.parent.document.createElement("iframe");
  140. fullframe.width = "100%";
  141. fullframe.height = "100%";
  142. fullframe.setAttribute("fullframe", "true");
  143. fullframe.style.background = "white";
  144. fullframe.style.position = "absolute";
  145. fullframe.style.bottom = 0;
  146. fullframe.style.left = 0;
  147. fullframe.style.right = 0;
  148. fullframe.style.top = 0;
  149. fullframe.style.zIndex = 99999;
  150. fullframe.src = window.frameElement.src;
  151. fullframe.srcFrame = window.frameElement;
  152. window.parent.document.body.appendChild(fullframe);
  153. }
  154. })
  155. .attr("title", thisIsFullFrame ? "还原" : "全屏").addClass(thisIsFullFrame?"icon-restore ":"icon-fullscreen")
  156. .show();
  157. }
  158. /* 添加全屏等,如果是内嵌end */
  159. var currSubNrid; //当前选中的子内容ID
  160. var haveButton = false;
  161. var isnrjson = false;
  162. var ishelp = false;
  163. var isabout = false;
  164. //设置弹出窗口右上角的按钮
  165. function setWindowButton() {
  166. //获取当前窗口对应的dhxWin对象
  167. var w = wd.display.getwdDialogWindows();
  168. if (!haveButton) {
  169. //添加下载按钮
  170. w.button("CMS_download").show();
  171. w.button("CMS_download").onclick = function() {
  172. var downloadUrl = "@service{name:'downloadNr'}@" + "&nrid=" + currSubNrid;
  173. wd.display.downloadFile(downloadUrl);
  174. //window.open(downloadUrl);
  175. }
  176. //添加全屏按钮
  177. w.button("CMS_fullscreen").show();
  178. w.button("CMS_fullscreen").onclick = function() {
  179. //使参数指定的DOM元素全屏,如果不传参数则默认带个页面全屏
  180. wd.display.CmsFullScreen($('.mainDiv')[0]);
  181. //alert($('#mainDiv')[0].outerHTML);
  182. }
  183. //如果变动状态下出现变动查看按钮
  184. if (true) {
  185. <%--
  186. w.button("change_off").show();
  187. w.button("change_off").onclick = function () {
  188. $.ajax({
  189. type: "GET",
  190. url: "@service{name:'nr_nrxtsy_all'}@",
  191. data: {
  192. nrid: "${nrid}"
  193. },
  194. async: false,
  195. dataType: "json",
  196. success: function (data) {
  197. var el = document.getElementById("column1");
  198. el.innerHTML = "";
  199. if (data) {
  200. for (var i = 0; i < data.length; i++) {
  201. var datachild = data[i].nrchild;
  202. if (data[i].change != undefined) {
  203. addItemall(datachild.mswj, datachild.mc, datachild.sltwj, datachild.tbwj, datachild.nrjslbm, data[i].change);
  204. } else {
  205. addItemall(datachild.mswj, datachild.mc, datachild.sltwj, datachild.tbwj, datachild.nrjslbm, "");
  206. }
  207. }
  208. $('.mainDiv').attr("isCmsFullScreen", 'false');
  209. var items = $(".dragList").find(".item");
  210. if (items != undefined && items.length != 0) {
  211. var nrid = $(items[0]).find(".nrid").text();
  212. var nrjslbm = $(items[0]).find(".nrjslbm").text();
  213. var topMsg = $(this).find(".topMsg").text();
  214. var bottomMsg = $(this).find(".bottomMsg").text();
  215. loadPlayer(nrid, nrjslbm, topMsg, bottomMsg);
  216. selectItem($(items[0])[0]);
  217. currSubNrid = nrid;//当前选中的子内容ID
  218. //$(items[0])[0].style.border = "2px solid #FF0000";//点击变红 20170929
  219. //设置弹出窗口右上角的按钮
  220. setWindowButton();
  221. wd.display.CmsNrscroll($('.mainDiv')[0], nrid);
  222. }
  223. }
  224. menu();
  225. w.button("change_off").hide();
  226. w.button("change_on").show();
  227. },
  228. error: function () {
  229. //alert('fail');
  230. }
  231. });
  232. }
  233. --%>
  234. w.button("change_on").onclick = function() {
  235. $.ajax({
  236. type: "GET",
  237. /* 改。Lin
  238. url: "@service{name:'nrxtsy'}@",
  239. */ url: "<serv.ss name='wrCmsList'/>",
  240. data: {
  241. nrid: "${nrid}",
  242. sfbf: "1",
  243. jlztm: "${jlztm}",
  244. sqsj: "${sqsj}"
  245. },
  246. async: false,
  247. dataType: "json",
  248. success: function(data) {
  249. var el = document.getElementById("column1");
  250. el.innerHTML = "";
  251. if (data) {
  252. for (var i = 0; i < data.length; i++) {
  253. console.info(data[i]);
  254. if (data) {
  255. for (var i = 0; i < data.length; i++) {
  256. console.info(data[i]);
  257. if (data[i].nrchild == undefined || data[i].nrchild == "") {
  258. addItem(data[i].mswj, data[i].mc, data[i].sltwj, data[i].tbwj, data[i].nrjslbm, "", "", "", i);
  259. } else {
  260. var datachild = data[i].nrchild;
  261. addItem(datachild.mswj, datachild.mc, datachild.sltwj, datachild.tbwj, datachild.nrjslbm, data[i].change, "", "", i);
  262. }
  263. }
  264. }
  265. }
  266. menu();
  267. $('.mainDiv').attr("isCmsFullScreen", 'false');
  268. var items = $(".dragList").find(".item");
  269. if (items != undefined && items.length != 0) {
  270. var nrid = $(items[0]).find(".nrid").text();
  271. var nrjslbm = $(items[0]).find(".nrjslbm").text();
  272. var topMsg = $(this).find(".topMsg").text();
  273. var bottomMsg = $(this).find(".bottomMsg").text();
  274. loadPlayer(nrid, nrjslbm, topMsg, bottomMsg);
  275. selectItem($(items[0])[0]);
  276. currSubNrid = nrid; //当前选中的子内容ID
  277. //$(items[0])[0].style.border = "2px solid #FF0000";//点击变红 20170929
  278. //设置弹出窗口右上角的按钮
  279. setWindowButton();
  280. wd.display.CmsNrscroll($('.mainDiv')[0], nrid);
  281. }
  282. w.button("change_on").hide();
  283. w.button("change_off").show();
  284. }
  285. },
  286. error: function() {
  287. //alert('fail');
  288. }
  289. });
  290. }
  291. }
  292. haveButton = true;
  293. }
  294. }
  295. function save() {
  296. var nrid = "${nrid}"
  297. wd.display.getwdDialogOpener().loadNrid(nrid);
  298. wd.display.closeDialog();
  299. }
  300. function loadItem() {
  301. var nrid_ = "${nrid}";
  302. var nrjson_ = '${jsonStr}';
  303. var ishelp_ = '${ishelp}';
  304. var isabout_ = '${isabout or not empty aboutlist}';
  305. //var nrjson_ = '[{"whid":"1008610702", "fsryid":"100861110130", "topmsg":"新春快乐", "fcsj":null, "mc":"fj1008620105061","nrid":"T-1008620105061", "nrjslbm":"150", "sltwj":null, "tbwj":null, "bottommsg":"信息中心职员" , "sltlj":"/WEB-INF/app/$@{sessionScope['XMMC']}/data/nr/000100/8620/1050/1008620105061/T/T/thumbnail"}]';
  306. console.info(nrid_);
  307. if (nrjson_ == '' && ishelp_ == '' && (isabout_ == ''||isabout_=="false")) {
  308. $("#mainDiv").css({
  309. "-moz-user-select": "none",
  310. "float": "left",
  311. "width": "730px",
  312. "height": "100%",
  313. "display": "flex",
  314. "justify-content": "center"
  315. });
  316. var el = document.getElementById("column1");
  317. el.innerHTML = "";
  318. $.ajax({
  319. type: "GET",
  320. /* 改。Lin
  321. url: "@service{name:'nrxtsy'}@",
  322. */ url: "<serv.ss name='wrCmsList'/>",
  323. data: {
  324. nrid: nrid_,
  325. sfbf: "1",
  326. jlztm: "${jlztm}",
  327. sqsj: "${sqsj}"
  328. },
  329. async: false,
  330. dataType: "json",
  331. success: function(data) {
  332. if (data) {
  333. if(data.length==1){
  334. $("#leftDiv").css("display","none");
  335. $("#dragIcon").css("display","none");
  336. }
  337. for (var i = 0; i < data.length; i++) {
  338. console.info(data[i]);
  339. if (data[i].nrchild == undefined || data[i].nrchild == "") {
  340. addItem(data[i].mswj, data[i].mc, data[i].sltwj, data[i].tbwj, data[i].nrjslbm, "", "", "", i);
  341. } else {
  342. var datachild = data[i].nrchild;
  343. addItem(datachild.mswj, datachild.mc, datachild.sltwj, datachild.tbwj, datachild.nrjslbm, data[i].change, "", "", i);
  344. }
  345. }
  346. }
  347. },
  348. error: function() {
  349. //alert('fail');
  350. }
  351. });
  352. } else if (ishelp_ == '' && nrjson_ != '' && (isabout_ == ''||isabout_=="false")) {
  353. $("#mainDiv").css({
  354. "-moz-user-select": "none",
  355. "float": "left",
  356. "width": "730px",
  357. "height": "100%",
  358. "display": "flex",
  359. "justify-content": "center"
  360. });
  361. isnrjson = true;
  362. nrjson_ = JSON.parse(nrjson_);
  363. console.info(nrjson_);
  364. console.info(nrjson_.length);
  365. for (var iii = 0; iii < nrjson_.length; iii++) {
  366. console.info(nrjson_[iii]);
  367. console.info(nrjson_[iii].nrid);
  368. $.ajax({
  369. type: "GET",
  370. url: "<serv.ss name='regCms'/>", // ='register'。Lin
  371. data: {
  372. nrid: nrjson_[iii].nrid
  373. },
  374. async: false,
  375. success: function(data) {},
  376. error: function() {
  377. //alert('fail');
  378. }
  379. });
  380. addItem(nrjson_[iii].nrid, nrjson_[iii].mc, nrjson_[iii].sltwj, nrjson_[iii].tbwj, nrjson_[iii].nrjslbm, "", nrjson_[iii].topMsg, nrjson_[iii].bottomMsg, iii);
  381. }
  382. } else if (ishelp_ == 'true') {
  383. //复制代码
  384. var copybutton=wd.display.getwdDialogWindows().button("wdHelpCopyhexcode");
  385. copybutton.show();
  386. copybutton.onclick=function(){
  387. var v= $(".leftTab-selected .help_id").html();
  388. jsCopy(v);
  389. }
  390. var dialogid = '${dialogid}';
  391. var helplist = [];
  392. if ("1" == dialogid) {
  393. $(".helplist").each(function() {
  394. helplist.push({
  395. title: $(this).attr("title"),
  396. size: $(this).attr("size"),
  397. helpHaShCode: $(this).attr("helpHaShCode"),
  398. helpContent: $(this).text()
  399. });
  400. })
  401. } else {
  402. helplist = wd.edit.findAllHelpData(dialogid);
  403. }
  404. for (var iii = 0; iii < helplist.length; iii++) {
  405. addHelp(helplist[iii].helpHaShCode, helplist[iii].title, helplist[iii].helpContent, iii);
  406. }
  407. // $("#mainDiv").css({"moz-user-select":"none","float":"right","display":"block","justify-content":"center","align-items":"center","width":"80%","box-sizing":"border-box","padding":"0px 18px","padding-top":"25px","margin-right":"4px","height":"100%"});
  408. ishelp = true;
  409. } else if (ishelp_ == '' && nrjson_ == '' && isabout_ != '') {
  410. var aboutlist;
  411. // try{
  412. aboutlist = eval(${aboutlist});
  413. // }catch{
  414. // aboutlist = [];
  415. // }
  416. //aboutlist = JSON.parse(aboutlist);
  417. console.log(aboutlist);
  418. for (var iii = 0; iii < aboutlist.length; iii++) {
  419. addAbout(aboutlist[iii].bbh, aboutlist[iii].aboutContent, aboutlist[iii].gxsj, iii);
  420. }
  421. isabout = true;
  422. }
  423. menu();
  424. }
  425. function addAbout(bbh, gxsm, gxsj, index) {
  426. var el = document.getElementById("column1");
  427. var gxsj = new Date(gxsj).format("yyyy/MM/dd");
  428. var co = "<div class=\"item leftTab hLine\"><img style=\"width:22px;height:28px;margin-top:10px;margin-bottom:-2px;\" src=\"${sessionScope.ssUser.skinDir}image/icon/nrjslb-610-large.png\"></img>" +
  429. "<div class='about_bt' style=\"width:108px;margin-left:10px;height:16px;display:inline-block;line-height:16px;vertical-align:bottom;\" id=\"cms_name_" + bbh + "_" + index + "\">" +
  430. bbh + "</div><div class='leftTab-dim' >" + gxsj + "</div><span style='display:none;' class='gxsm'>" + gxsm + "</span></div>";
  431. $(el).append(co);
  432. wd.display.initGrowHigh("cms_name_" + bbh + "_" + index, '60px', {});
  433. }
  434. function addHelp(help_id, help_name, help_html, index) {
  435. var el = document.getElementById("column1");
  436. var gethelpUrl = help_html;
  437. var co;
  438. var tbwj = "${sessionScope.ssUser.skinDir}image/icon/nrjslb-610-large.png";
  439. co = "<div class=\"item leftTab hLine\" style=\"display:table;\"><img style=\"width:22px;height:28px;margin-top:13px;margin-bottom:10px;\" src=\"" + tbwj + "\"></img>" +
  440. // "<div style=\"width:108px;margin-left:10px;height:16px;display:inline-block;line-height:16px;vertical-align:bottom;margin-bottom:10px;\" id=\"cms_name_" + help_id + "_" + index + "\">" +
  441. "<div style=\"width:108px;margin-left:10px;height:32px;line-height:17px;overflow: hidden;text-overflow: ellipsis;display: inline-block;-webkit-line-clamp: 2;-webkit-box-orient: vertical;\" id=\"cms_name_" + help_id + "_" + index + "\">" +
  442. help_name + "</div><span style='display:none;' class='help_id'>" + help_id + "</span><xmp id=\"helpcontent" + help_id + "\" style=\"display:none\">" + help_html + "</xmp></div>";
  443. $(el).append(co);
  444. wd.display.initGrowHigh("cms_name_" + help_id + "_" + index, '60px', {});
  445. }
  446. function addItem(id, name, sltwj, tbwj, nrjslbm, change, topMsg, bottomMsg, index) {
  447. var el = document.getElementById("column1");
  448. /* 改。Lin
  449. var getDataUrl = '@service{name:"getData",param:{path:"wdVal{path}",download:"1"}}@';
  450. */ var getDataUrl = "<serv.ss name='dlByHttp' parm='{path:"ssVal{path}",download:"1"}'/>";
  451. var json;
  452. var co;
  453. if (sltwj != null) {
  454. json = JSON.parse('{"path":"' + encodeURI(sltwj) + '"}');
  455. getDataUrl = wd.display.replaceDynamicParam(getDataUrl, json);
  456. co = "<div class=\"item leftTab hLine\"><div class=\"item_slt\"><div style=\"border:1px solid #e0e0e0;width:141px;height:79px;border-box:box-sizing;display:flex;justify-content:center;align-items:center;background-color:#fff;margin-bottom:5px;margin-top:15px;\"><img style=\"max-width:100%;max-height:100%;\" src=\"" + getDataUrl + "\"></img></div><div style=\"display:inline-block;max-width:100%;margin:0 auto;height:20px;margin-bottom:5px;\" id=\"cms_name_" + id + "_" + index + "\">" +
  457. name + "</div><span style='display:none;' class='nrid'>" + id + "</span><span style='display:none;' class='nrjslbm'>" + nrjslbm + "</span><span style='display:none;' class='topMsg'>" + topMsg + "</span><span style='display:none;' class='bottomMsg'>" + bottomMsg + "</span></div><p>" + change + "</p><span id='line'></span><div id=\"qbian\" class=\"qbian\" style=\"width: 1.5px;margin-top: -42px;position: absolute;background-color: #FFF;right:0px;display:none;\"></div></div>";
  458. } else {
  459. if (tbwj == "") {
  460. tbwj = wd.common.loadSkinFile("image/icon/nrjslb-" + nrjslbm + "-large.png");
  461. getDataUrl = tbwj;
  462. } else {
  463. json = JSON.parse('{"path":"' + encodeURI(tbwj) + '"}');
  464. getDataUrl = wd.display.replaceDynamicParam(getDataUrl, json);
  465. }
  466. // co = "<div class=\"item leftTab hLine\" style=\"display:table;\"><img style=\"width:22px;height:28px;margin-top:13px;margin-bottom:10px;\" src=\"" + getDataUrl + "\"></img><div style=\"width:108px;margin-left:10px;height:16px;display:inline-block;line-height:16px;vertical-align:bottom;margin-bottom:10px;\" id=\"cms_name_" + id + "_" + index + "\">" +
  467. co = "<div class=\"item leftTab hLine\"><img style=\"width:22px;height:28px;margin-top:13px;margin-bottom:10px;float:left;\" src=\"" + getDataUrl + "\"></img><div style=\"width:87px;margin-left:20px;margin-top:10px;height:32px;line-height:17px;overflow: hidden;text-overflow: ellipsis;display:inline-block;-webkit-line-clamp: 2;-webkit-box-orient: vertical;\" id=\"cms_name_" + id + "_" + index + "\">" +
  468. name + "</div><span style='display:none;' class='nrid'>" + id + "</span><span style='display:none;' class='nrjslbm'>" + nrjslbm + "</span><span style='display:none;' class='topMsg'>" + topMsg + "</span><span style='display:none;' class='bottomMsg'>" + bottomMsg + "</span><p>" + change + "</p><span id='line'></span><div id=\"qbian\" class=\"qbian\" style=\"width: 1.5px;margin-top: -42px;position: absolute;background-color: #FFF;right:0px;display:none;\"></div></div>";
  469. }
  470. $(el).append(co);
  471. wd.display.initGrowHigh("cms_name_" + id + "_" + index, '60px', {});
  472. }
  473. function addItemall(id, name, sltwj, tbwj, nrjslbm, change) {
  474. var el = document.getElementById("column1");
  475. /* 改。Lin
  476. var getDataUrl = '@service{name:"getData",param:{path:"wdVal{path}",download:"1"}}@';
  477. */ var getDataUrl = "<serv.ss name='dlByHttp' parm='{path:"ssVal{path}",download:"1"}'/>";
  478. var json;
  479. var co;
  480. if (sltwj != null) {
  481. json = JSON.parse('{"path":"' + encodeURI(sltwj) + '"}');
  482. getDataUrl = wd.display.replaceDynamicParam(getDataUrl, json);
  483. co = "<div class=\"item\"><div class=\"item_slt\"><img src=\"" + getDataUrl + "\"></img><p>" + name + "</p><span style='display:none;' class='nrid'>" + id + "</span><span style='display:none;' class='nrjslbm'>" + nrjslbm + "</span><span id='line'></span></div><table>";
  484. for (var i = 0; i < change.length; i++) {
  485. var sqsjdata = change[i].sqsj.split(" ");
  486. co += "<tr><td>" + sqsjdata[0] + "</td>";
  487. if (change[i].lbm == "1") {
  488. co += "<td>创建</td>";
  489. } else if (change[i].lbm == "51") {
  490. co += "<td>停用</td>";
  491. } else if (change[i].lbm == "55") {
  492. co += "<td>启用</td>";
  493. }
  494. if (change[i].lcztm == "1") {
  495. co += "<td>审核中</td>";
  496. } else if (change[i].lcztm == "51") {
  497. co += "<td>同意</td>";
  498. } else if (change[i].lcztm == "55") {
  499. co += "<td>退回</td>";
  500. }
  501. co += "</tr>";
  502. }
  503. co += "</table></div>";
  504. } else {
  505. if (tbwj == "") {
  506. tbwj = wd.common.loadSkinFile("image/icon/nrjslb-" + nrjslbm + "-large.png");
  507. getDataUrl = tbwj;
  508. } else {
  509. json = JSON.parse('{"path":"' + encodeURI(tbwj) + '"}');
  510. getDataUrl = wd.display.replaceDynamicParam(getDataUrl, json);
  511. }
  512. co = "<div class=\"item\"><div class=\"item_tb\"><img src=\"" + getDataUrl + "\"></img><p>" + name + "</p><span style='display:none;' class='nrid'>" + id + "</span><span style='display:none;' class='nrjslbm'>" + nrjslbm + "</span><span id='line'></span></div><table>";
  513. for (var i = 0; i < change.length; i++) {
  514. var sqsjdata = change[i].sqsj.split(" ");
  515. co += "<tr><td>" + sqsjdata[0] + "</td>";
  516. if (change[i].lbm == "1") {
  517. co += "<td>创建</td>";
  518. } else if (change[i].lbm == "51") {
  519. co += "<td>停用</td>";
  520. } else if (change[i].lbm == "55") {
  521. co += "<td>启用</td>";
  522. }
  523. if (change[i].lcztm == "1") {
  524. co += "<td>审核中</td>";
  525. } else if (change[i].lcztm == "51") {
  526. co += "<td>同意</td>";
  527. } else if (change[i].lcztm == "55") {
  528. co += "<td>退回</td>";
  529. }
  530. co += "</tr>";
  531. }
  532. co += "</table></div>";
  533. }
  534. $(el).append(co);
  535. }
  536. //加载播放器
  537. function loadPlayer(nrid, nrjslbm, topMsg, bottomMsg) {
  538. if (isnrjson == true) {
  539. $("#topMsg").show();
  540. $("#bottomMsg").show();
  541. $("#topMsg").html(topMsg);
  542. $("#bottomMsg").html(bottomMsg);
  543. } else {
  544. $("#topMsg").hide();
  545. $("#bottomMsg").hide();
  546. }
  547. //
  548. var mainNrin = $(".mainDiv").attr("nrid");
  549. console.log("mainNrin:" + mainNrin);
  550. if (mainNrin == nrid) {
  551. console.log("相同内容 不重复加载");
  552. return;
  553. }
  554. //
  555. $.ajax({
  556. type: "GET",
  557. /* 改。Lin
  558. url: "@service{name:'loadNrDesignAndPlayerData'}@",
  559. */ url: "<serv.ss name='wrCmsPlay'/>",
  560. data: {
  561. "nrid": nrid,
  562. "nrjslbm": nrjslbm
  563. },
  564. async: true,
  565. dataType: "json",
  566. success: function(data) {
  567. /// 增加,增加错误处理 -- 统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData。Lin
  568. if (data.ssCode != 0) {
  569. alert(data.ssMsg);
  570. return;
  571. }
  572. ///
  573. var div = document.createElement("div");
  574. var obj = {};
  575. obj.design = data.design;
  576. obj.resDesign = data.resDesign;
  577. div.setAttribute("data-init", JSON.stringify(obj));
  578. var tempData = data.data.replace(new RegExp('@dataFolder@', 'gm'), data.dataFolderPath);
  579. div.innerHTML = tempData;
  580. if(nrjslbm=="150"){
  581. $(div).find(".container").css("display","none");
  582. }
  583. $("#mainDiv").html($(div));
  584. $(".mainDiv").attr("nrid", nrid);
  585. }
  586. });
  587. wd.display.CmsNrscroll($('.mainDiv')[0], nrid);
  588. }
  589. function loadAbout(gxsm) {
  590. // $("#mainDiv").html($("#helpcontent" + help_id).html());
  591. $("#mainDiv").html("<div>" + gxsm + "</div>");
  592. }
  593. function loadHelpXML(help_id) {
  594. $("#mainDiv").html($("#helpcontent" + help_id).html());
  595. // $("#mainDiv").html("<iframe src=\"" + help_src + "\" style=\"width: 100%; height: 100%; overflow-y: hidden; outline: none;\"/>");
  596. }
  597. //为元素添加className:selected
  598. function selectItem(element) {
  599. $('.item').removeClass('leftTab-selected').addClass('hLine');
  600. $(element).addClass("leftTab-selected").removeClass('hLine');
  601. }
  602. function menu() {
  603. //显示事件
  604. var showDetail = function() {
  605. if (ishelp == true) {
  606. var help_src = $(this).find(".help_id").text();
  607. selectItem(this);
  608. loadHelpXML(help_src);
  609. } else if (isabout == true) {
  610. var gxsm = $(this).find(".gxsm").html();
  611. loadAbout(gxsm);
  612. selectItem(this);
  613. } else {
  614. var nrid = $(this).find(".nrid").text();
  615. var nrjslbm = $(this).find(".nrjslbm").text(); //新增
  616. var topMsg = $(this).find(".topMsg").text();
  617. var bottomMsg = $(this).find(".bottomMsg").text();
  618. // $(".dragList").find(".item").each(function () {
  619. // $(this)[0].style.border = "solid 1px #CCCCCC";//全部边框变黑 20170929
  620. // });
  621. // this.style.border = "2px solid #FF0000";//点击变红 20170929
  622. selectItem(this);
  623. console.info("nrid:" + nrid + " nrjslbm:" + nrjslbm);
  624. currSubNrid = nrid; //当前选中的子内容ID
  625. loadPlayer(nrid, nrjslbm, topMsg, bottomMsg);
  626. //设置弹出窗口右上角的按钮
  627. setWindowButton();
  628. }
  629. }
  630. //添加点击是事件
  631. $('.item').on('click', showDetail);
  632. $('.item').click(function () {
  633. // var h = $(this).height();
  634. // $('#qbian').css('height',h);
  635. $(".leftTab-selected").find(".qbian").show();
  636. $(".leftTab-selected").siblings().find(".qbian").hide();
  637. });
  638. }
  639. loadItem();
  640. (function() {
  641. $('.mainDiv').attr("isCmsFullScreen", 'false');
  642. var items = $(".dragList").find(".item");
  643. if (items != undefined && items.length != 0) {
  644. if (ishelp == true) {
  645. var help_id = $(items[0]).find(".help_id").text();
  646. loadHelpXML(help_id);
  647. selectItem($(items[0])[0]);
  648. } else if (isabout == true) {
  649. var gxsm = $(items[0]).find(".gxsm").html();
  650. loadAbout(gxsm);
  651. selectItem($(items[0])[0]);
  652. } else {
  653. var nrid = $(items[0]).find(".nrid").text();
  654. var nrjslbm = $(items[0]).find(".nrjslbm").text();
  655. var topMsg = $(items[0]).find(".topMsg").text();
  656. var bottomMsg = $(items[0]).find(".bottomMsg").text();
  657. loadPlayer(nrid, nrjslbm, topMsg, bottomMsg);
  658. selectItem($(items[0])[0]);
  659. currSubNrid = nrid; //当前选中的子内容ID
  660. //$(items[0])[0].style.border = "2px solid #FF0000";//点击变红 20170929
  661. //设置弹出窗口右上角的按钮
  662. setWindowButton();
  663. wd.display.CmsNrscroll($('.mainDiv')[0], nrid);
  664. }
  665. }
  666. })();
  667. </script>
  668. </html>