commentlist.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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" media="screen" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
  21. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  22. <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
  23. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  24. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  25. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  26. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  27. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  28. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  29. <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
  30. <!--[if IE 6]>
  31. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  32. <script>DD_belatedPNG.fix('*');</script>
  33. <![endif]-->
  34. <script type="text/javascript">
  35. $(function() {
  36. $("#jqGrid").jqGrid({
  37. url : '${ctx}/myconsole/commentlist/getByPage',
  38. editurl:"${ctx}/myconsole/commentlist/saveOrUpdate",
  39. mtype : "POST",
  40. datatype : "json",
  41. caption:'评论列表',
  42. prmNames : { //定义表单的主键 // Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
  43. id: "keyid", 
  44. oper:"oper",    
  45. addoper:"add",
  46. editoper:"edit",
  47. deloper:"del" 
  48. },
  49. colModel : [ {
  50. label : '评论编号',
  51. name : 'keyid',
  52. key : true,
  53. editable: false,
  54. hidden:true
  55. }, {
  56. label : '评论内容',
  57. name : 'content',
  58. editable: true,
  59. width : 80,
  60. }, {
  61. label : '评论状态',
  62. name : 'tstate',
  63. editable: true,
  64. width : 40
  65. }, {
  66. label : '评论时间',
  67. name : 'inserttime',
  68. editable: true,
  69. width : 40
  70. } ],
  71. rownumbers : true,//添加左侧行号
  72. viewrecords : true,//是否在浏览导航栏显示记录总数
  73. rowNum : 15,//每页显示记录数
  74. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  75. autowidth : true,
  76. height : 'auto',
  77. pager : "#jqGridPager",
  78. loadComplete: function() {
  79. if (true){
  80. $('td[title="分配权限"]').show();
  81. }
  82. }
  83. });
  84. $('#jqGrid').navGrid('#jqGridPager',
  85. {
  86. edit : false,
  87. add : false,
  88. del : true,
  89. search : true,
  90. view : true,
  91. position : "left",
  92. cloneToTop : true
  93. },
  94. //编辑按钮事件处理
  95. {
  96. recreateForm : true,
  97. checkOnUpdate : true,
  98. checkOnSubmit : true,
  99. closeAfterEdit : true,
  100. onInitializeForm:function(formid) {
  101. //makeTree("orgid","/myconsole/user/getOrgTree","radio");
  102. },
  103. serializeEditData: function(postdata) {
  104. $.each(postdata,function (index, value) {
  105. if(index!="jqGrid_id" && index!="oper" && index!="id"){
  106. modifyJosnKey(postdata,index,"dIC_accusetype."+index);
  107. }
  108. if(index=="id"){
  109. postdata["dIC_accusetype."+index]=value
  110. }
  111. })
  112. return postdata;
  113. },
  114. afterSubmit: function(response,postdata)
  115. {
  116. var res=eval('(' + response.responseText + ')');
  117. if(res.flag)
  118. {
  119. parent.layer.alert(res.message, {
  120. skin: 'layui-layer-molv' //样式类名
  121. ,closeBtn: 0
  122. });
  123. return [true,res.message,''];
  124. }
  125. else
  126. {
  127. parent.layer.alert(res.message, {
  128. skin: 'layui-layer-molv' //样式类名
  129. ,closeBtn: 0
  130. });
  131. return [false,res.message,''];
  132. }
  133. },
  134. afterComplete : function (response, postdata, formid) {
  135. //取消选择
  136. $("#tree").jqGrid("resetSelection");
  137. //关闭对话框
  138. $(".ui-icon-closethick").trigger('click');
  139. },
  140. errorTextFormat : function(data) {
  141. return 'Error: ' + data.responseText
  142. }
  143. },
  144. //添加按钮处理事件
  145. {
  146. closeAfterAdd : true,
  147. recreateForm : true,
  148. beforeSubmit: function(postdata, formid){
  149. $.each(postdata,function (index, value) {
  150. if(index!="jqGrid_id" && index!="oper"){
  151. modifyJosnKey(postdata,index,"dIC_accusetype."+index);
  152. }
  153. })
  154. postdata["dIC_accusetype.keyid"] = "";
  155. return[true,''];
  156. },
  157. afterSubmit: function(response,postdata)
  158. {
  159. var res=eval('(' + response.responseText + ')');
  160. if(res.flag)
  161. {
  162. parent.layer.alert(res.message, {
  163. skin: 'layui-layer-molv' //样式类名
  164. ,closeBtn: 0
  165. });
  166. return [true,res.message,''];
  167. }
  168. else
  169. {
  170. parent.layer.alert(res.message, {
  171. skin: 'layui-layer-molv' //样式类名
  172. ,closeBtn: 0
  173. });
  174. return [false,res.message,''];
  175. }
  176. },
  177. errorTextFormat : function(data) {
  178. return 'Error: ' + data.responseText
  179. }
  180. },
  181. {
  182. errorTextFormat : function(data) {
  183. return 'Error: ' + data.responseText
  184. }
  185. },{
  186. // search options 这里支持多条件查询
  187. multipleSearch: true,
  188. closeAfterSearch: true,
  189. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  190. afterSubmit: function(r, data) {
  191. var messageString = r.responseText;
  192. var mesObj = eval('(' + messageString + ')');
  193. return [mesObj.state, mesObj.message];
  194. }
  195. }
  196. )
  197. ;
  198. })
  199. </script>
  200. <title>评论列表</title>
  201. </head>
  202. <body>
  203. <div class="page-container">
  204. <table id="jqGrid"></table>
  205. <div id="jqGridPager"></div>
  206. </div>
  207. <footer class="footer mt-20">
  208. <div class="container">
  209. <p></p>
  210. </div>
  211. </footer>
  212. </body>
  213. </html>