webinfo.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <!--[if lt IE 9]>
  10. <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
  11. <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
  12. <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
  13. <![endif]-->
  14. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
  15. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
  16. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
  17. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
  18. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
  19. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
  20. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
  21. <script type="text/javascript" src="${ctx}/assets/lib/My97DatePicker/WdatePicker.js"></script>
  22. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  23. <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
  24. <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
  25. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  26. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  27. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  28. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  29. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  30. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  31. <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
  32. <!--[if IE 6]>
  33. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  34. <script>DD_belatedPNG.fix('*');</script>
  35. <![endif]-->
  36. <script type="text/javascript">
  37. function showFlowPic(executionId){
  38. layer.open({
  39. title:"查看流转",
  40. type: 1,
  41. anim: 2,
  42. area: ['600px', '400px'],
  43. content: "<div style='margin:5px;'><img style='width:100%' src='${ctx}/myconsole/myflow/show?executionId="+executionId+"'></div>"
  44. });
  45. }
  46. function readperm(infoID){
  47. layer.open({
  48. type: 2,
  49. title: '阅读权限',
  50. shadeClose: true,
  51. shade: 0.8,
  52. area: ['570px', '460px'],
  53. content: '${ctx}/myconsole/readperm?resourceID='+infoID+'&resourceType=info'
  54. });
  55. }
  56. $(function() {
  57. $(window).resize(function(){
  58. $("#jqGrid").setGridWidth($(window).width()-41); 
  59. });
  60. $("#jqGrid").jqGrid({
  61. url : '${ctx}/myconsole/webinfo/getByPage',
  62. editurl:"${ctx}/myconsole/webinfo/saveOrUpdate",
  63. mtype : "POST",
  64. datatype : "json",
  65. postData : {'columnID':'${column.columnid!}','siteID':'${currentSite.SiteID!}','TState':$('#TState').val()},
  66. multiselect: true,
  67. caption1:'信息管理',
  68. prmNames : { //定义表单的主键 // Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
  69. id: "keyid", 
  70. oper:"oper",    
  71. addoper:"add",
  72. editoper:"edit",
  73. deloper:"del" 
  74. },
  75. colModel : [ {
  76. label : '数据编号',
  77. name : 'keyid',
  78. key : true,
  79. editable: false,
  80. hidden:true
  81. },{
  82. label : '标题',
  83. name : 'fulltitle',
  84. width : 200,
  85. formatter: function (cellvalue, options, rowdata) {
  86. var html = "<a href='${ctx}/myconsole/complaint/repository/browseDetil?strContentId="+rowdata.contentid+"' title='"+cellvalue+"' ><span style='color:"+rowdata.listtitlecolor+";font-weight:"+rowdata.listtitlewidth+";'>"+cellvalue+"</span></a>";
  87. if(!rowdata.verifyhashkey){
  88. html = html+"<span style='color:red'>【数据被篡改】</span>";
  89. }
  90. return html;
  91. }
  92. }, {
  93. label : '栏目',
  94. name : 'columnname',
  95. width : 50
  96. }, {
  97. label : '信息序号',
  98. hidden : true,
  99. name : 'infoserial',
  100. width : 50
  101. },{
  102. label : '创建人',
  103. name : 'username',
  104. width : 30
  105. }, {
  106. label : '创建时间',
  107. name : 'recordtime',
  108. width : 50
  109. }, {
  110. label : '发布时间',
  111. name : 'releasetime',
  112. width : 50
  113. }, {
  114. label : '状态',
  115. name : 'tstate',
  116. width : 30,
  117. align:"center",
  118. formatter:'select',
  119. edittype:"select",
  120. editoptions: {
  121. value:"draft:草稿箱;withdraw:撤稿箱;finished:成品箱;waitrelease:待发箱;flow:流转箱;rejection:退稿箱;compound:合成箱"
  122. },
  123. sortable:false
  124. },{
  125. label : '操作',
  126. name:'operMod',
  127. index:'operMod',
  128. align:"center",
  129. width:"50",
  130. sortable:false,
  131. formatter: function (cellvalue, options, rowdata) {
  132. var html ="";
  133. if(rowdata.tstate=='draft'||rowdata.tstate=='withdraw') {
  134. <#if selfbuttonflag.delete>
  135. html = "<button class='btn btn-success radius size-S' onclick=webinfo_init('修改信息','"+rowdata.keyid+"','update')>修改</button>";
  136. </#if>
  137. /* <#if selfbuttonflag.update>
  138. html =html+"<button class='btn btn-danger radius size-S ml-5' onclick=deleteData('"+rowdata.keyid+"')>删除</button>";
  139. </#if> */
  140. }else if(rowdata.tstate=='flow'){
  141. html=html+ "<button class='btn btn-success radius size-S' onclick=showFlowPic('"+rowdata.workflowinstance+"')>查看流转</button>"
  142. }else if(rowdata.tstate=='finished'){
  143. <#if selfbuttonflag.update>
  144. html = "<button class='btn btn-success radius size-S' onclick=webinfo_init('修改信息','"+rowdata.keyid+"','update')>修改</button>";
  145. </#if>
  146. }
  147. <#if readPerm>
  148. html = html+" <button class='btn btn-success radius size-S' onclick=readperm('"+rowdata.keyid+"')>阅读权限</button>";
  149. </#if>
  150. /* html = html+" <a href='"+rowdata.weburl+"' target='_blank'><button class='btn btn-success radius size-S'>预览外网</button></a>"; */
  151. return html;
  152. }
  153. }],
  154. rownumbers : true,//添加左侧行号
  155. viewrecords : true,//是否在浏览导航栏显示记录总数
  156. rowNum : 10,//每页显示记录数
  157. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  158. autowidth : true,
  159. height : 'auto',
  160. pager : "#jqGridPager",
  161. //屏蔽点击任意单元格选中checkbox的问题
  162. beforeSelectRow: function (rowid, e) {
  163. var $myGrid = $(this),
  164. i = $.jgrid.getCellIndex($(e.target).closest('td')[0]),
  165. cm = $myGrid.jqGrid('getGridParam', 'colModel');
  166. return (cm[i].name === 'cb');
  167. }
  168. });
  169. //拖动排序
  170. $('#jqGrid').jqGrid('sortableRows', {
  171. update:function(ev, ui){
  172. var item = ui.item[0], ri = item.rowIndex, itemId = item.id;
  173. var array = $('#jqGrid').jqGrid('getDataIDs');
  174. var options = 'next';//标识参照ID 是取得当前元素的后一个
  175. if(ri == array.length){//说明在列表最末尾,拿他当前一行数据作为参照物
  176. ri -=2;
  177. options = 'pre';//标识参照ID 是取得当前元素的前一个
  178. }
  179. $.post("${ctx}/myconsole/webinfo/sort/", {
  180. KeyID: itemId,
  181. ReferKeyID: array[ri],
  182. OptionType: options
  183. });
  184. }
  185. });
  186. //切换资源状态时,动态刷新数据;同时判断发布和撤稿按钮是否可用
  187. $('#TState').change(reload);
  188. $('#ButtonInsert').show();
  189. $('#ButtonRelease').show();
  190. $('#ButtonTimeRelease').show();
  191. $('#ButtonWithdraw').show();
  192. $('#ButtonSetTop').show();
  193. $('#ButtonCancelTop').show();
  194. $('#ButtonBatchCopy').show();
  195. $('#ButtonBatchMove').show();
  196. $('#ButtonBatchQuote').show();
  197. $('#ButtonDelete').show();
  198. $('#ButtonSelect').show();
  199. });
  200. //选择数据状态下拉列表重新取数据
  201. function reload()
  202. {
  203. var strTState = $('#TState').val();
  204. if(strTState == '')
  205. {
  206. $('#ButtonInsert').show();
  207. $('#ButtonRelease').show();
  208. $('#ButtonTimeRelease').show();
  209. $('#ButtonWithdraw').show();
  210. $('#ButtonSetTop').show();
  211. $('#ButtonCancelTop').show();
  212. $('#ButtonBatchCopy').show();
  213. $('#ButtonBatchMove').hide();
  214. $('#ButtonBatchQuote').show();
  215. $('#ButtonDelete').show();
  216. $('#ButtonSelect').show();
  217. }
  218. if(strTState == 'finished')
  219. {
  220. $('#ButtonInsert').show();
  221. $('#ButtonRelease').hide();
  222. $('#ButtonTimeRelease').hide();
  223. $('#ButtonWithdraw').show();
  224. $('#ButtonSetTop').show();
  225. $('#ButtonCancelTop').show();
  226. $('#ButtonBatchCopy').show();
  227. $('#ButtonBatchMove').hide();
  228. $('#ButtonBatchQuote').show();
  229. $('#ButtonDelete').hide();
  230. $('#ButtonSelect').show();
  231. }
  232. if(strTState == 'draft')
  233. {
  234. $('#ButtonInsert').show();
  235. $('#ButtonRelease').show();
  236. $('#ButtonTimeRelease').show();
  237. $('#ButtonWithdraw').hide();
  238. $('#ButtonSetTop').hide();
  239. $('#ButtonCancelTop').hide();
  240. $('#ButtonBatchCopy').show();
  241. $('#ButtonBatchMove').show();
  242. $('#ButtonBatchQuote').hide();
  243. $('#ButtonDelete').show();
  244. $('#ButtonSelect').show();
  245. }
  246. if(strTState == 'waitrelease')
  247. {
  248. $('#ButtonInsert').show();
  249. $('#ButtonRelease').show();
  250. $('#ButtonTimeRelease').show();
  251. $('#ButtonWithdraw').show();
  252. $('#ButtonSetTop').show();
  253. $('#ButtonCancelTop').show();
  254. $('#ButtonBatchCopy').show();
  255. $('#ButtonBatchMove').hide();
  256. $('#ButtonBatchQuote').hide();
  257. $('#ButtonDelete').show();
  258. $('#ButtonSelect').show();
  259. }
  260. if(strTState == 'withdraw')
  261. {
  262. $('#ButtonInsert').show();
  263. $('#ButtonRelease').show();
  264. $('#ButtonTimeRelease').show();
  265. $('#ButtonWithdraw').hide();
  266. $('#ButtonSetTop').hide();
  267. $('#ButtonCancelTop').hide();
  268. $('#ButtonBatchCopy').hide();
  269. $('#ButtonBatchMove').hide();
  270. $('#ButtonBatchQuote').hide();
  271. $('#ButtonDelete').show();
  272. $('#ButtonSelect').show();
  273. }
  274. if(strTState == 'flow')
  275. {
  276. $('#ButtonInsert').show();
  277. $('#ButtonRelease').hide();
  278. $('#ButtonTimeRelease').hide();
  279. $('#ButtonWithdraw').hide();
  280. $('#ButtonSetTop').hide();
  281. $('#ButtonCancelTop').hide();
  282. $('#ButtonBatchCopy').hide();
  283. $('#ButtonBatchMove').hide();
  284. $('#ButtonBatchQuote').hide();
  285. $('#ButtonDelete').hide();
  286. $('#ButtonSelect').show();
  287. }
  288. if(strTState == 'rejection')
  289. {
  290. $('#ButtonInsert').show();
  291. $('#ButtonRelease').hide();
  292. $('#ButtonTimeRelease').hide();
  293. $('#ButtonWithdraw').hide();
  294. $('#ButtonSetTop').hide();
  295. $('#ButtonCancelTop').hide();
  296. $('#ButtonBatchCopy').hide();
  297. $('#ButtonBatchMove').hide();
  298. $('#ButtonBatchQuote').hide();
  299. $('#ButtonDelete').show();
  300. $('#ButtonSelect').show();
  301. }
  302. $("#jqGrid").jqGrid('setGridParam', {
  303. datatype : "json",
  304. postData : {'columnID' : '${column.columnid!}','TState':$('#TState').val()}
  305. }).trigger('reloadGrid');
  306. }
  307. //新建或者修改信息页面调用函数
  308. function webinfo_init(title,keyid,strOper){
  309. var columnID = '${column.columnid!}',
  310. name = '${column.columnname!}',
  311. columnName = escape(name).replace(/%/g,"\\").toLowerCase();
  312. //alert('传递的主键'+id);
  313. fullOpen("${ctx}/myconsole/webinfo/initWebInfo?columnID="+columnID+"&keyid="+keyid+"&Oper="+strOper);
  314. }
  315. //把文章设置到待发布箱中韩林平 2016-12-20
  316. function timeRelease()
  317. {
  318. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  319. if(data.length <=0){
  320. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  321. return false;
  322. }
  323. else
  324. {
  325. var doFlag=true;
  326. $(data).each(function (index, id){  
  327. var row = $("#jqGrid").jqGrid('getRowData', id);   
  328. if(row.tstate != 'draft' )
  329. {
  330. doFlag=false;
  331. }
  332. })
  333. if(!doFlag){
  334. layer.msg('只有草稿箱中的数据才能设置到待发箱进行定时发布操作!',{icon: 5,time:1500});
  335. return false;
  336. }
  337. }
  338. $.getJSON("${ctx}/myconsole/webinfo/timeRelease", {
  339. keyids : data+""
  340. }, function(json){
  341. if(json.status == 'y'){
  342. layer.alert(json.message, {
  343. skin: 'layui-layer-molv' //样式类名
  344. ,closeBtn: 0
  345. }, function(){reload();layer.closeAll('dialog');});
  346. }else{
  347. layer.alert(json.message, {
  348. skin: 'layui-layer-molv' //样式类名
  349. ,closeBtn: 0
  350. }, function(){layer.closeAll('dialog');});
  351. }
  352. });
  353. }
  354. //文章撤稿 韩林平 2016-11-29
  355. function setWithdraw()
  356. {
  357. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  358. if(data.length <=0){
  359. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  360. return false;
  361. }
  362. else
  363. {
  364. var doFlag=true;
  365. $(data).each(function (index, id){  
  366. var row = $("#jqGrid").jqGrid('getRowData', id);   
  367. if(row.tstate != 'finished' )
  368. {
  369. doFlag=false;
  370. }
  371. })
  372. if(!doFlag){
  373. layer.msg('只有成品箱中的数据才能进行撤稿操作!',{icon: 5,time:1500});
  374. return false;
  375. }
  376. }
  377. $.getJSON("${ctx}/myconsole/webinfo/setWithdraw", {
  378. keyids : data+""
  379. }, function(json){
  380. if(json.status == 'y'){
  381. layer.alert(json.message, {
  382. skin: 'layui-layer-molv' //样式类名
  383. ,closeBtn: 0
  384. }, function(){reload();layer.closeAll('dialog');});
  385. }else{
  386. layer.alert(json.message, {
  387. skin: 'layui-layer-molv' //样式类名
  388. ,closeBtn: 0
  389. }, function(){layer.closeAll('dialog');});
  390. }
  391. });
  392. }
  393. //批量发布文章 韩林平 2016-11-29
  394. function batchRelease()
  395. {
  396. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  397. if(data.length <=0){
  398. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  399. return false;
  400. }
  401. else
  402. {
  403. var doFlag=true;
  404. $(data).each(function (index, id){  
  405. var row = $("#jqGrid").jqGrid('getRowData', id);   
  406. if(row.tstate != 'draft' && row.tstate != 'withdraw' && row.tstate != 'waitrelease' )
  407. {
  408. doFlag=false;
  409. }
  410. })
  411. if(!doFlag){
  412. layer.msg('只有草稿箱,撤稿箱和待发布箱中的数据才能进行发布操作',{icon: 5,time:1500});
  413. return false;
  414. }
  415. }
  416. $.getJSON("${ctx}/myconsole/webinfo/batchRelease", {
  417. keyids : data+""
  418. }, function(json){
  419. if(json.status == 'y'){
  420. layer.alert(json.message, {
  421. skin: 'layui-layer-molv' //样式类名
  422. ,closeBtn: 0
  423. }, function(){reload();layer.closeAll('dialog');});
  424. }else{
  425. layer.alert(json.message, {
  426. skin: 'layui-layer-molv' //样式类名
  427. ,closeBtn: 0
  428. }, function(){layer.closeAll('dialog');});
  429. }
  430. });
  431. }
  432. //批量删除文章 韩林平2016-11-30
  433. function batchDelete(){
  434. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  435. if(data.length <=0){
  436. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  437. return false;
  438. }
  439. else
  440. {
  441. var doFlag=true;
  442. $(data).each(function (index, id){  
  443. var row = $("#jqGrid").jqGrid('getRowData', id);   
  444. if(row.tstate != 'draft' && row.tstate != 'withdraw' && row.tstate != 'rejection' )
  445. {
  446. doFlag=false;
  447. }
  448. })
  449. if(!doFlag){
  450. layer.msg('只有草稿箱,撤稿箱和退稿箱中的数据才能进行删除操作',{icon: 5,time:1500});
  451. return false;
  452. }
  453. }
  454. $.getJSON("${ctx}/myconsole/webinfo/batchDelete", {
  455. keyids : data+""
  456. }, function(json){
  457. if(json.status == 'y'){
  458. layer.alert(json.message, {
  459. skin: 'layui-layer-molv' //样式类名
  460. ,closeBtn: 0
  461. }, function(){reload();layer.closeAll('dialog');});
  462. }else{
  463. layer.alert(json.message, {
  464. skin: 'layui-layer-molv' //样式类名
  465. ,closeBtn: 0
  466. }, function(){layer.closeAll('dialog');});
  467. }
  468. });
  469. }
  470. //删除单条数据处理 韩林平2016-11-28
  471. function deleteData(strKeyID){
  472. $.getJSON("${ctx}/myconsole/webinfo/deleteData", {
  473. keyid : strKeyID
  474. }, function(json){
  475. if(json.status == 'y'){
  476. //处理成功返回消息;
  477. layer.alert(json.message, {
  478. skin: 'layui-layer-molv' //样式类名
  479. ,closeBtn: 0
  480. }, function(){reload();layer.closeAll('dialog');});
  481. }else{
  482. //处理失败返回消息;
  483. layer.alert(json.message, {
  484. skin: 'layui-layer-molv' //样式类名
  485. ,closeBtn: 0
  486. }, function(){reload();layer.closeAll('dialog');});
  487. }
  488. });
  489. }
  490. //置顶数据处理,韩林平2016-11-29
  491. function setTop()
  492. {
  493. var strColumnID = '${column.columnid!}';
  494. var data = $('#jqGrid').jqGrid('getGridParam','selarrrow');
  495. if(data.length <=0){
  496. layer.msg('请选择要操作的数据!',{icon: 5,time:1500});
  497. return false;
  498. }
  499. else
  500. {
  501. if(data.length >1){
  502. layer.msg('只能选择一条数据进行置顶!',{icon: 5,time:1500});
  503. return false;
  504. }
  505. }
  506. $.getJSON("${ctx}/myconsole/webinfo/setTop", {
  507. keyid : data+"",
  508. columnid : strColumnID
  509. }, function(json){
  510. if(json.status == 'y'){
  511. layer.alert(json.message, {
  512. skin: 'layui-layer-molv' //样式类名
  513. ,closeBtn: 0
  514. }, function(){reload();layer.closeAll('dialog');});
  515. }else{
  516. layer.alert(json.message, {
  517. skin: 'layui-layer-molv' //样式类名
  518. ,closeBtn: 0
  519. }, function(){layer.closeAll('dialog');});
  520. }
  521. });
  522. }
  523. //取消置顶数据处理,韩林平2016-11-29
  524. function cancelTop(){
  525. var data = $('#jqGrid').jqGrid('getGridParam','selarrrow');
  526. if(data.length <=0){
  527. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  528. return false;
  529. }
  530. $.getJSON("${ctx}/myconsole/webinfo/cancelTop", {
  531. keyids : data+""
  532. }, function(json){
  533. if(json.status == 'y'){
  534. layer.alert(json.message, {
  535. skin: 'layui-layer-molv' //样式类名
  536. ,closeBtn: 0
  537. }, function(){reload();layer.closeAll('dialog');});
  538. }else{
  539. layer.alert(json.message, {
  540. skin: 'layui-layer-molv' //样式类名
  541. ,closeBtn: 0
  542. }, function(){layer.closeAll('dialog');});
  543. }
  544. });
  545. }
  546. //批量复制文章
  547. function batchCopy()
  548. {
  549. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  550. if(data.length <=0){
  551. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  552. return false;
  553. }
  554. var setting = {
  555. check: {
  556. enable: true,
  557. chkStyle: "checkbox",
  558. chkboxType: {'Y':'','N':''},
  559. radioType: "all"
  560. },
  561. view: {
  562. dblClickExpand: true,
  563. showLine: false,
  564. selectedMulti: true
  565. },
  566. async: {
  567. enable: true,
  568. url: '${ctx}/myconsole/column/getColumnBySiteAndType/',
  569. dataFilter:function(treeId, parentNode, childNodes){
  570. if (childNodes)
  571. {
  572. for(var i =0; i < childNodes.length; i++)
  573. {
  574. if(childNodes[i].columnid == '${column.columnid!}')
  575. {
  576. childNodes[i].chkDisabled = childNodes[i].chkdisabled;
  577. }
  578. }
  579. }
  580. return childNodes;
  581. }
  582. },
  583. data: {
  584. simpleData: {
  585. enable: true,
  586. idKey: "columnid",
  587. pIdKey: "parentid",
  588. rootPId: ""
  589. }
  590. },
  591. callback: {
  592. onClick: function (event, treeId, treeNode) {
  593. var zTree = $.fn.zTree.getZTreeObj("columnTree");
  594. zTree.expandNode(treeNode);
  595. }
  596. }
  597. };
  598. parent.layer.open({
  599. type: 1,
  600. title: '目标栏目选择',
  601. btn: ['确定','取消'],
  602. yes:function(index, layero){
  603. var treeObj = $.fn.zTree.getZTreeObj("columnTree");
  604. var nodes = treeObj.getCheckedNodes(true);
  605. if(nodes.length <= 0){
  606. parent.layer.msg('请选择目标栏目',{icon: 5,time:1500});
  607. return;
  608. }
  609. var columnIDs = "";
  610. $.each(nodes,function(i,n){
  611. columnIDs += n.columnid+",";
  612. });
  613. columnIDs = columnIDs.substring(0,columnIDs.length-1);
  614. $.post("${ctx}/myconsole/webinfo/batchCopy",{
  615. keyid:data+"",
  616. columnid:columnIDs
  617. },function(json){
  618. if(json.status == 'y'){
  619. layer.alert(json.message, {
  620. skin: 'layui-layer-molv' //样式类名
  621. ,closeBtn: 0
  622. }, function(){reload();layer.closeAll('dialog');});
  623. }else{
  624. layer.alert(json.message, {
  625. skin: 'layui-layer-molv' //样式类名
  626. ,closeBtn: 0
  627. }, function(){layer.closeAll('dialog');});
  628. }
  629. });
  630. parent.layer.close(index);
  631. },
  632. // skin: 'layui-layer-rim', //加上边框
  633. area: ['350px', '480px'], //宽高
  634. content: "<ul id='columnTree' class='ztree'></ul>",
  635. success:function(layero, index){
  636. $.fn.zTree.init($(layero).find("#columnTree"), setting);
  637. }
  638. });
  639. }//批量复制文章结束
  640. //批量移动文章
  641. function batchMove()
  642. {
  643. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  644. if(data.length <=0){
  645. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  646. return false;
  647. }
  648. var setting = {
  649. check: {
  650. enable: true,
  651. chkStyle: "radio",
  652. chkboxType: {'Y':'','N':''},
  653. radioType: "all"
  654. },
  655. view: {
  656. dblClickExpand: false,
  657. showLine: false,
  658. selectedMulti: false
  659. },
  660. async: {
  661. enable: true,
  662. url: '${ctx}/myconsole/column/getColumnBySiteAndType/',
  663. dataFilter:function(treeId, parentNode, childNodes){
  664. if (childNodes)
  665. {
  666. for(var i =0; i < childNodes.length; i++)
  667. {
  668. if(childNodes[i].columnid == '${column.columnid!}')
  669. {
  670. childNodes[i].chkDisabled = childNodes[i].chkdisabled;
  671. }
  672. }
  673. }
  674. return childNodes;
  675. }
  676. },
  677. data: {
  678. simpleData: {
  679. enable: true,
  680. idKey: "columnid",
  681. pIdKey: "parentid",
  682. rootPId: 0
  683. }
  684. },
  685. callback: {
  686. onClick: function (event, treeId, treeNode) {
  687. var zTree = $.fn.zTree.getZTreeObj("columnTree");
  688. zTree.expandNode(treeNode);
  689. }
  690. }
  691. };
  692. parent.layer.open({
  693. type: 1,
  694. title: '目标栏目选择',
  695. btn: ['确定','取消'],
  696. yes:function(index, layero){
  697. var treeObj = $.fn.zTree.getZTreeObj("columnTree");
  698. var nodes = treeObj.getCheckedNodes(true);
  699. if(nodes.length <= 0){
  700. parent.layer.msg('请选择目标栏目',{icon: 5,time:1500});
  701. return;
  702. }
  703. //myconsole.log("选择的栏目nodes:"+nodes);
  704. var columnIDs = "";
  705. $.each(nodes,function(i,n){
  706. columnIDs += n.columnid+",";
  707. });
  708. columnIDs = columnIDs.substring(0,columnIDs.length-1);
  709. $.post("${ctx}/myconsole/webinfo/batchMove",{
  710. keyid:data+"",
  711. columnid:columnIDs
  712. },function(json){
  713. if(json.status == 'y'){
  714. layer.alert(json.message, {
  715. skin: 'layui-layer-molv' //样式类名
  716. ,closeBtn: 0
  717. }, function(){reload();layer.closeAll('dialog');});
  718. }else{
  719. layer.alert(json.message, {
  720. skin: 'layui-layer-molv' //样式类名
  721. ,closeBtn: 0
  722. }, function(){layer.closeAll('dialog');});
  723. }
  724. });
  725. parent.layer.close(index);
  726. },
  727. // skin: 'layui-layer-rim', //加上边框
  728. area: ['350px', '480px'], //宽高
  729. content: "<ul id='columnTree' class='ztree'></ul>",
  730. success:function(layero, index){
  731. $.fn.zTree.init($(layero).find("#columnTree"), setting);
  732. }
  733. });
  734. }//批量移动文章结束
  735. //批量引用文章
  736. function batchQuote()
  737. {
  738. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  739. if(data.length <=0){
  740. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  741. return false;
  742. }
  743. var setting = {
  744. check: {
  745. enable: true,
  746. chkStyle: "checkbox",
  747. chkboxType: {'Y':'','N':''},
  748. radioType: "all"
  749. },
  750. view: {
  751. dblClickExpand: false,
  752. showLine: false,
  753. selectedMulti: false
  754. },
  755. async: {
  756. enable: true,
  757. url: '${ctx}/myconsole/column/getColumnBySiteAndType/',
  758. dataFilter:function(treeId, parentNode, childNodes){
  759. if (childNodes)
  760. {
  761. for(var i =0; i < childNodes.length; i++)
  762. {
  763. if(childNodes[i].columnid == '${column.columnid!}')
  764. {
  765. childNodes[i].chkDisabled = childNodes[i].chkdisabled;
  766. }
  767. }
  768. }
  769. return childNodes;
  770. }
  771. },
  772. data: {
  773. simpleData: {
  774. enable: true,
  775. idKey: "columnid",
  776. pIdKey: "parentid",
  777. rootPId: ""
  778. }
  779. },
  780. callback: {
  781. onClick: function (event, treeId, treeNode) {
  782. var zTree = $.fn.zTree.getZTreeObj("columnTree");
  783. zTree.expandNode(treeNode);
  784. }
  785. }
  786. };
  787. parent.layer.open({
  788. type: 1,
  789. title: '目标栏目选择',
  790. btn: ['确定','取消'],
  791. yes:function(index, layero){
  792. var treeObj = $.fn.zTree.getZTreeObj("columnTree");
  793. var nodes = treeObj.getCheckedNodes(true);
  794. if(nodes.length <= 0){
  795. parent.layer.msg('请选择目标栏目',{icon: 5,time:1500});
  796. return;
  797. }
  798. var columnIDs = "";
  799. $.each(nodes,function(i,n){
  800. columnIDs += n.columnid+",";
  801. });
  802. columnIDs = columnIDs.substring(0,columnIDs.length-1);
  803. $.post("${ctx}/myconsole/webinfo/batchQuote",{
  804. keyid:data+"",
  805. columnid:columnIDs
  806. },function(json){
  807. if(json.status == 'y'){
  808. layer.alert(json.message, {
  809. skin: 'layui-layer-molv' //样式类名
  810. ,closeBtn: 0
  811. }, function(){reload();layer.closeAll('dialog');});
  812. }else{
  813. layer.alert(json.message, {
  814. skin: 'layui-layer-molv' //样式类名
  815. ,closeBtn: 0
  816. }, function(){layer.closeAll('dialog');});
  817. }
  818. });
  819. parent.layer.close(index);
  820. },
  821. // skin: 'layui-layer-rim', //加上边框
  822. area: ['350px', '480px'], //宽高
  823. content: "<ul id='columnTree' class='ztree'></ul>",
  824. success:function(layero, index){
  825. $.fn.zTree.init($(layero).find("#columnTree"), setting);
  826. }
  827. });
  828. }//批量引用文章结束
  829. //查询
  830. function query(){
  831. parent.layer.open({
  832. type: 1,
  833. title: '选择查询条件',
  834. btn: ['查询','取消'],
  835. yes:function(index, layero){
  836. var btnName = $('#TState').val();
  837. $("#jqGrid").jqGrid('setGridParam', {
  838. datatype : "json",
  839. postData : {'columnID' : $(layero).find("#querycolumnid").val(),'TState':$('#TState').val(),'KeyWord':$(layero).find("#keyword").val(),'BeginDate':$(layero).find("#begindate").val(),'EndDate':$(layero).find("#enddate").val()}
  840. }).trigger('reloadGrid');
  841. parent.layer.close(index);
  842. },
  843. skin: 'layui-layer-rim', //加上边框
  844. area: ['400px', '380px'], //宽高
  845. content: '<br><div class="row cl"><div>选择栏目:<select id="querycolumnid">${columnOption}<option value="">所有栏目</option></select><div><label class="form-label col-xs-1 col-sm-5">&nbsp;关键字:</label>'+
  846. '<input type="text" class="input-text" id="keyword" name="keyword"></div>'+
  847. '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5">&nbsp;发布开始时间:</label>'+
  848. '<input type="text" class="input-text" id="begindate" name="begindate"></div>'+
  849. '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5">&nbsp;发布结束时间:</label>'+
  850. '<input type="text" class="input-text" id="enddate" name="enddate"></div>',
  851. success:function(layero, index){
  852. $(layero).find("#begindate").on("click",function(){
  853. WdatePicker();
  854. })
  855. $(layero).find("#enddate").on("click",function(){
  856. WdatePicker();
  857. })
  858. var begindateObj = $(layero).find("#begindate");
  859. begindateObj.attr('readOnly',true);
  860. begindateObj.css({'background':'#cccccc'});
  861. var enddateObj = $(layero).find("#enddate");
  862. enddateObj.attr('readOnly',true);
  863. enddateObj.css({'background':'#cccccc'});
  864. $(layero).find("#querycolumnid").val('${column.columnid}');
  865. }
  866. });
  867. }
  868. function compoundTitle(){
  869. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  870. console.log(data);
  871. if(data.length <=0){
  872. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  873. return false;
  874. }else{
  875. var keyIDs=data.join(",");
  876. layer.open({
  877. type: 2,
  878. title: '合成标题',
  879. shadeClose: true,
  880. shade: 0.8,
  881. area: ['570px', '330px'],
  882. content: '${ctx}/myconsole/webinfo/compound?keyIDs='+keyIDs
  883. });
  884. }
  885. }
  886. </script>
  887. <title>我的桌面</title>
  888. </head>
  889. <body>
  890. <div>
  891. <nav class="breadcrumb" style="height:100%">
  892. <span class="l" id=buttoncontent>
  893. <#if selfbuttonflag.insert><a id=ButtonInsert class="btn btn-primary radius" onclick=webinfo_init("添加信息","","add") href="javascript:;">
  894. <i class="Hui-iconfont">&#xe600;</i> 新建
  895. </a></#if>
  896. <#if selfbuttonflag.release><a id=ButtonRelease class="btn btn-primary radius finishedc" onclick="batchRelease()" href="javascript:;">
  897. <i class="Hui-iconfont">&#xe6dc;</i> 发布</a></#if>
  898. <!-- <#if selfbuttonflag.timerelease><a id=ButtonTimeRelease class="btn btn-primary radius finishedc" onclick="timeRelease()" href="javascript:;">
  899. <i class="Hui-iconfont">&#xe606;</i> 定时发布
  900. </a></#if> -->
  901. <!-- <#if selfbuttonflag.withdraw><a id=ButtonWithdraw class="btn btn-primary radius withdrawc" onclick="setWithdraw()" href="javascript:;">
  902. <i class="Hui-iconfont">&#xe6de;</i> 撤稿
  903. </a></#if> -->
  904. <!-- <#if selfbuttonflag.settop><a id=ButtonSetTop class="btn btn-primary radius setTopc" onclick="setTop()" href="javascript:;" >
  905. <i class="Hui-iconfont">&#xe684;</i> 置顶
  906. </a></#if>
  907. <#if selfbuttonflag.canceltop><a id=ButtonCancelTop class="btn btn-primary radius cancelTopc" onclick="cancelTop()" href="javascript:;" >
  908. <i class="Hui-iconfont">&#xe640;</i> 取消置顶
  909. </a></#if>
  910. <#if selfbuttonflag.batchcopy><a id=ButtonBatchCopy class="btn btn-primary radius copyc" onclick="batchCopy()" href="javascript:;">
  911. <i class="Hui-iconfont">&#xe6ea;</i> 复制
  912. </a></#if>
  913. <#if selfbuttonflag.batchmove><a id=ButtonBatchMove class="btn btn-primary radius movec" onclick="batchMove()" href="javascript:;">
  914. <i class="Hui-iconfont">&#xe6ef;</i> 移动
  915. </a></#if>
  916. <#if selfbuttonflag.batchquote><a id=ButtonBatchQuote class="btn btn-primary radius quotec" onclick="batchQuote()" href="javascript:;">
  917. <i class="Hui-iconfont">&#xe6f1;</i> 引用
  918. </a></#if> -->
  919. <#if selfbuttonflag.delete><a id=ButtonDelete class="btn btn-danger radius deletec" href="javascript:;" onclick="batchDelete()">
  920. <i class="Hui-iconfont">&#xe6e2;</i> 删除
  921. </a></#if>
  922. <a id=ButtonSelect class="btn btn-primary radius query" onclick="query()" href="javascript:;">
  923. <i class="Hui-iconfont">&#xe665;</i> 检索
  924. </a>
  925. <!-- <a id=ButtonInsert class="btn btn-primary radius" href="${columnUrl}" target="_blank">
  926. <i class="Hui-iconfont">&#xe695;</i> 预览栏目
  927. </a>
  928. <a id=ButtonInsert class="btn btn-primary radius" href="${columnStaticURL}" target="_blank">
  929. <i class="Hui-iconfont">&#xe695;</i> 预览外网栏目
  930. </a> -->
  931. <!-- <a id=ButtonInsert class="btn btn-primary radius" href="javascript:;" onclick="compoundTitle()">
  932. <i class="Hui-iconfont">&#xe636;</i> 合成标题
  933. </a> -->
  934. <span class="select-box" style="width: 120px" >
  935. <select id="TState" class="select" >
  936. <option value=''>所有文章</option>
  937. <!-- <option value='finished'>成品箱</option>
  938. <option value='draft'>草稿箱</option>
  939. <option value='waitrelease'>待发箱</option>
  940. <option value='withdraw'>撤稿箱</option>
  941. <option value='flow'>流转箱</option>
  942. <option value='rejection'>退稿箱</option>
  943. <option value='compound'>合成箱</option> -->
  944. </select>
  945. </span>
  946. </span>
  947. </nav>
  948. <div class="page-container">
  949. <table id="jqGrid"></table>
  950. <div id="jqGridPager"></div>
  951. </div>
  952. </div>
  953. </body>
  954. </html>