gov.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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() {
  47. $(window).resize(function(){
  48. $("#jqGrid").setGridWidth($(window).width()-41); 
  49. });
  50. $("#jqGrid").jqGrid({
  51. url : '${ctx}/myconsole/gov/getByPage',
  52. editurl:"${ctx}/myconsole/gov/saveOrUpdate",
  53. mtype : "POST",
  54. datatype : "json",
  55. postData : {'columnID':'${column.columnid!}','siteID':'${currentSite.SiteID!}','TState':$('#TState').val()},
  56. multiselect: true,
  57. caption1:'政务公开',
  58. prmNames : { //定义表单的主键 // Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
  59. id: "keyid", 
  60. oper:"oper",    
  61. addoper:"add",
  62. editoper:"edit",
  63. deloper:"del" 
  64. },
  65. colModel : [ {
  66. label : '数据编号',
  67. name : 'keyid',
  68. key : true,
  69. editable: false,
  70. hidden:true
  71. },{
  72. label : '标题',
  73. name : 'title',
  74. width : 200,
  75. formatter: function (cellvalue, options, rowdata) {
  76. var html = "<a href='${ctx}/${currentSite.siteid}"+rowdata.htmlurl+"' target='_blank' title='"+cellvalue+"' ><span style='color:"+rowdata.titlecolor+"'>"+cellvalue+"</span></a>";
  77. return html;
  78. }
  79. }, {
  80. label : '信息序号',
  81. hidden : true,
  82. name : 'infoserial',
  83. width : 50,
  84. },{
  85. label : '创建人',
  86. name : 'username',
  87. width : 30,
  88. }, {
  89. label : '创建时间',
  90. name : 'recordtime',
  91. width : 50,
  92. }, {
  93. label : '发布时间',
  94. name : 'releasetime',
  95. width : 50,
  96. }, {
  97. label : '状态',
  98. name : 'tstate',
  99. width : 30,
  100. align:"center",
  101. formatter:'select',
  102. edittype:"select",
  103. editoptions: {
  104. value:"draft:草稿箱;withdraw:撤稿箱;finished:成品箱;waitrelease:待发箱;flow:流转箱"
  105. },
  106. sortable:false
  107. },{
  108. label : '操作',
  109. name:'operMod',
  110. index:'operMod',
  111. align:"center",
  112. width:"50",
  113. sortable:false,
  114. formatter: function (cellvalue, options, rowdata) {
  115. var html ="";
  116. if(rowdata.tstate=='draft'||rowdata.tstate=='withdraw') {
  117. html = "<button class='btn btn-success radius size-S' onclick=webinfo_init('修改信息','"+rowdata.keyid+"','update')>修改</button>"+
  118. "<button class='btn btn-danger radius size-S ml-5' onclick=deleteData('"+rowdata.keyid+"')>删除</button>";
  119. }else if(rowdata.tstate=='flow'){
  120. html=html+ "<button class='btn btn-success radius size-S' onclick=showFlowPic('"+rowdata.workflowinstance+"')>查看流转</button>"
  121. }
  122. return html;
  123. }
  124. }],
  125. rownumbers : true,//添加左侧行号
  126. viewrecords : true,//是否在浏览导航栏显示记录总数
  127. rowNum : 10,//每页显示记录数
  128. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  129. autowidth : true,
  130. sortname : 'sortID',
  131. sortorder : 'asc',
  132. height : 'auto',
  133. pager : "#jqGridPager",
  134. //屏蔽点击任意单元格选中checkbox的问题
  135. beforeSelectRow: function (rowid, e) {
  136. var $myGrid = $(this),
  137. i = $.jgrid.getCellIndex($(e.target).closest('td')[0]),
  138. cm = $myGrid.jqGrid('getGridParam', 'colModel');
  139. return (cm[i].name === 'cb');
  140. }
  141. });
  142. //拖动排序
  143. $('#jqGrid').jqGrid('sortableRows', {
  144. update:function(ev, ui){
  145. var item = ui.item[0], ri = item.rowIndex, itemId = item.id;
  146. var array = $('#jqGrid').jqGrid('getDataIDs');
  147. var options = 'next';//标识参照ID 是取得当前元素的后一个
  148. if(ri == array.length){//说明在列表最末尾,拿他当前一行数据作为参照物
  149. ri -=2;
  150. options = 'pre';//标识参照ID 是取得当前元素的前一个
  151. }
  152. $.post("${ctx}/myconsole/gov/sort/", {
  153. KeyID: itemId,
  154. ReferKeyID: array[ri],
  155. OptionType: options
  156. });
  157. }
  158. });
  159. //切换资源状态时,动态刷新数据;同时判断发布和撤稿按钮是否可用
  160. $('#TState').change(reload);
  161. });
  162. //选择数据状态下拉列表重新取数据
  163. function reload()
  164. {
  165. var strTState = $('#TState').val();
  166. $("#jqGrid").jqGrid('setGridParam', {
  167. datatype : "json",
  168. postData : {'columnID' : '${column.columnid!}','TState':$('#TState').val()}
  169. }).trigger('reloadGrid');
  170. }
  171. //新建或者修改信息页面调用函数
  172. function webinfo_init(title,keyid,strOper){
  173. var columnID = '${column.columnid!}',
  174. name = '${column.columnname!}',
  175. columnName = escape(name).replace(/%/g,"\\").toLowerCase();
  176. //alert('传递的主键'+id);
  177. fullOpen("${ctx}/myconsole/gov/initWebInfo?columnID="+columnID+"&keyid="+keyid+"&Oper="+strOper);
  178. }
  179. //文章撤稿 韩林平 2016-11-29
  180. function setWithdraw()
  181. {
  182. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  183. if(data.length <=0){
  184. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  185. return false;
  186. }
  187. else
  188. {
  189. var doFlag=true;
  190. $(data).each(function (index, id){  
  191. var row = $("#jqGrid").jqGrid('getRowData', id);   
  192. if(row.tstate != 'finished' )
  193. {
  194. doFlag=false;
  195. }
  196. })
  197. if(!doFlag){
  198. layer.msg('只有成品箱中的数据才能进行撤稿操作!',{icon: 5,time:1500});
  199. return false;
  200. }
  201. }
  202. $.getJSON("${ctx}/myconsole/gov/setWithdraw", {
  203. keyids : data+""
  204. }, function(json){
  205. if(json.status == 'y'){
  206. layer.alert(json.message, {
  207. skin: 'layui-layer-molv' //样式类名
  208. ,closeBtn: 0
  209. }, function(){reload();layer.closeAll('dialog');});
  210. }else{
  211. layer.alert(json.message, {
  212. skin: 'layui-layer-molv' //样式类名
  213. ,closeBtn: 0
  214. }, function(){layer.closeAll('dialog');});
  215. }
  216. });
  217. }
  218. //批量发布文章 韩林平 2016-11-29
  219. function batchRelease()
  220. {
  221. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  222. if(data.length <=0){
  223. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  224. return false;
  225. }
  226. else
  227. {
  228. var doFlag=true;
  229. $(data).each(function (index, id){  
  230. var row = $("#jqGrid").jqGrid('getRowData', id);   
  231. if(row.tstate != 'draft' && row.tstate != 'withdraw' && row.tstate != 'waitrelease' )
  232. {
  233. doFlag=false;
  234. }
  235. })
  236. if(!doFlag){
  237. layer.msg('只有草稿箱,撤稿箱和待发布箱中的数据才能进行发布操作',{icon: 5,time:1500});
  238. return false;
  239. }
  240. }
  241. $.getJSON("${ctx}/myconsole/gov/batchRelease", {
  242. keyids : data+""
  243. }, function(json){
  244. if(json.status == 'y'){
  245. layer.alert(json.message, {
  246. skin: 'layui-layer-molv' //样式类名
  247. ,closeBtn: 0
  248. }, function(){reload();layer.closeAll('dialog');});
  249. }else{
  250. layer.alert(json.message, {
  251. skin: 'layui-layer-molv' //样式类名
  252. ,closeBtn: 0
  253. }, function(){layer.closeAll('dialog');});
  254. }
  255. });
  256. }
  257. //批量删除文章 韩林平2016-11-30
  258. function batchDelete(){
  259. var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
  260. if(data.length <=0){
  261. layer.msg('请选择要操作的数据',{icon: 5,time:1500});
  262. return false;
  263. }
  264. else
  265. {
  266. var doFlag=true;
  267. $(data).each(function (index, id){  
  268. var row = $("#jqGrid").jqGrid('getRowData', id);   
  269. if(row.tstate != 'draft' && row.tstate != 'withdraw' && row.tstate != 'rejection' )
  270. {
  271. doFlag=false;
  272. }
  273. })
  274. if(!doFlag){
  275. layer.msg('只有草稿箱,撤稿箱和退稿箱中的数据才能进行删除操作',{icon: 5,time:1500});
  276. return false;
  277. }
  278. }
  279. $.getJSON("${ctx}/myconsole/gov/batchDelete", {
  280. keyids : data+""
  281. }, function(json){
  282. if(json.status == 'y'){
  283. layer.alert(json.message, {
  284. skin: 'layui-layer-molv' //样式类名
  285. ,closeBtn: 0
  286. }, function(){reload();layer.closeAll('dialog');});
  287. }else{
  288. layer.alert(json.message, {
  289. skin: 'layui-layer-molv' //样式类名
  290. ,closeBtn: 0
  291. }, function(){layer.closeAll('dialog');});
  292. }
  293. });
  294. }
  295. //删除单条数据处理 韩林平2016-11-28
  296. function deleteData(strKeyID){
  297. $.getJSON("${ctx}/myconsole/gov/deleteData", {
  298. keyid : strKeyID
  299. }, function(json){
  300. if(json.status == 'y'){
  301. //处理成功返回消息;
  302. layer.alert(json.message, {
  303. skin: 'layui-layer-molv' //样式类名
  304. ,closeBtn: 0
  305. }, function(){reload();layer.closeAll('dialog');});
  306. }else{
  307. //处理失败返回消息;
  308. layer.alert(json.message, {
  309. skin: 'layui-layer-molv' //样式类名
  310. ,closeBtn: 0
  311. }, function(){reload();layer.closeAll('dialog');});
  312. }
  313. });
  314. }
  315. //查询
  316. function query()
  317. {
  318. parent.layer.open({
  319. type: 1,
  320. title: '选择查询条件',
  321. btn: ['查询','取消'],
  322. yes:function(index, layero){
  323. var btnName = $('#TState').val();
  324. $("#jqGrid").jqGrid('setGridParam', {
  325. datatype : "json",
  326. postData : {'columnID' : '${column.columnid!}','TState':$('#TState').val(),'KeyWord':$(layero).find("#keyword").val(),'BeginDate':$(layero).find("#begindate").val(),'EndDate':$(layero).find("#enddate").val()}
  327. }).trigger('reloadGrid');
  328. parent.layer.close(index);
  329. },
  330. skin: 'layui-layer-rim', //加上边框
  331. area: ['350px', '480px'], //宽高
  332. content: '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5">&nbsp;关键字:</label>'+
  333. '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="keyword" name="keyword"></div></div>'+
  334. '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5">&nbsp;发布开始时间:</label>'+
  335. '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="begindate" name="begindate"></div></div>'+
  336. '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5">&nbsp;发布结束时间:</label>'+
  337. '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="enddate" name="enddate"></div></div>',
  338. success:function(layero, index){
  339. $(layero).find("#begindate").on("click",function(){
  340. WdatePicker();
  341. })
  342. $(layero).find("#enddate").on("click",function(){
  343. WdatePicker();
  344. })
  345. var begindateObj = $(layero).find("#begindate");
  346. begindateObj.attr('readOnly',true);
  347. begindateObj.css({'background':'#cccccc'});
  348. var enddateObj = $(layero).find("#enddate");
  349. enddateObj.attr('readOnly',true);
  350. enddateObj.css({'background':'#cccccc'});
  351. }
  352. });
  353. }
  354. </script>
  355. <title>我的桌面</title>
  356. </head>
  357. <body>
  358. <div>
  359. <nav class="breadcrumb">
  360. <span class="l" id=buttoncontent>
  361. <a id=ButtonInsert class="btn btn-primary radius" onclick=webinfo_init("添加信息","","add") href="javascript:;">
  362. <i class="Hui-iconfont">&#xe600;</i> 新建
  363. </a>
  364. <a id=ButtonRelease class="btn btn-primary radius finishedc" onclick="batchRelease()" href="javascript:;">
  365. <i class="Hui-iconfont">&#xe6dc;</i> 发布</a>
  366. <a id=ButtonWithdraw class="btn btn-primary radius withdrawc" onclick="setWithdraw()" href="javascript:;">
  367. <i class="Hui-iconfont">&#xe6de;</i> 撤稿
  368. </a>
  369. <a id=ButtonDelete class="btn btn-danger radius deletec" href="javascript:;" onclick="batchDelete()">
  370. <i class="Hui-iconfont">&#xe6e2;</i> 删除
  371. </a>
  372. <a id=ButtonSelect class="btn btn-primary radius query" onclick="query()" href="javascript:;">
  373. <i class="Hui-iconfont">&#xe665;</i> 检索
  374. </a>
  375. <span class="select-box" style="width: 120px" >
  376. <select id="TState" class="select" >
  377. <option value=''>所有文章</option>
  378. <option value='finished'>成品箱</option>
  379. <option value='draft'>草稿箱</option>
  380. <option value='waitrelease'>待发箱</option>
  381. <option value='withdraw'>撤稿箱</option>
  382. </select>
  383. </span>
  384. </span>
  385. </nav>
  386. <div class="page-container">
  387. <table id="jqGrid"></table>
  388. <div id="jqGridPager"></div>
  389. </div>
  390. </div>
  391. </body>
  392. </html>