report.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  21. <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
  22. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  23. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  24. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  25. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  26. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  27. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  28. <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
  29. <!--[if IE 6]>
  30. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  31. <script>DD_belatedPNG.fix('*');</script>
  32. <![endif]-->
  33. <script type="text/javascript">
  34. $(function() {
  35. $(window).resize(function(){
  36. $("#jqGrid").setGridWidth($(window).width()-40); 
  37. });
  38. $("#jqGrid").jqGrid({
  39. url : '${ctx}/myconsole/report/getByPage',
  40. editurl:"${ctx}/myconsole/report/saveOrUpdate",
  41. mtype : "POST",
  42. datatype : "json",
  43. prmNames:{id:"keyid"},
  44. caption:'报表管理',
  45. colModel : [ {
  46. label : '报表编号',
  47. name : 'keyid',
  48. key : true,
  49. width : 60
  50. }, {
  51. label : '报表名称',
  52. name : 'reportname',
  53. editable: true,
  54. width : 80
  55. },{
  56. label : '报表描述',
  57. name : 'reportdesc',
  58. editable: true,
  59. edittype : "textarea",
  60. editoptions: {
  61. size:50,
  62. maxlength: 500,
  63. rows:"5",
  64. cols:"40"
  65. }
  66. }, {
  67. label : '更新时间',
  68. name : 'updatetime',
  69. editable: false,
  70. width : 80
  71. }],
  72. rownumbers : true,//添加左侧行号
  73. viewrecords : true,//是否在浏览导航栏显示记录总数
  74. rowNum : 10,//每页显示记录数
  75. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  76. autowidth : true,
  77. height : 'auto',
  78. pager : "#jqGridPager"
  79. });
  80. $('#jqGrid').navGrid('#jqGridPager',
  81. // the buttons to appear on the toolbar of the grid
  82. {
  83. edit : true,
  84. add : true,
  85. del : true,
  86. search : true,
  87. refresh : true,
  88. view : true,
  89. position : "left",
  90. cloneToTop : true
  91. },
  92. // options for the Edit Dialog
  93. {
  94. recreateForm : true,
  95. checkOnUpdate : true,
  96. checkOnSubmit : true,
  97. closeAfterEdit : true,
  98. onInitializeForm:function(formid) {
  99. },
  100. serializeEditData: function(postdata) {
  101. //myconsole.log(postdata);
  102. $.each(postdata,function (index, value) {
  103. //myconsole.log(index);
  104. if(index!="jqGrid_id" && index!="oper" && index!="keyid"){
  105. modifyJosnKey(postdata,index,"report."+index);
  106. }
  107. if(index=="keyid"){
  108. postdata["report."+index]=value
  109. }
  110. })
  111. //myconsole.log(postdata);
  112. return postdata;
  113. },
  114. afterSubmit: function (response, postdata) {
  115. // console.log(response);
  116. var res=eval('(' + response.responseText + ')');
  117. layer.msg(res.msg);
  118. return [res.state,res.msg,''];
  119. },
  120. errorTextFormat : function(data) {
  121. return 'Error: ' + data.responseText
  122. }
  123. },
  124. // options for the Add Dialog
  125. {
  126. closeAfterAdd : true,
  127. recreateForm : true,
  128. beforeSubmit: function(postdata, formid){
  129. $.each(postdata,function (index, value) {
  130. if(index!="jqGrid_id" && index!="oper"){
  131. modifyJosnKey(postdata,index,"report."+index);
  132. }
  133. })
  134. return[true,''];
  135. },
  136. afterSubmit: function (response, postdata) {
  137. // console.log(response);
  138. var res=eval('(' + response.responseText + ')');
  139. layer.msg(res.msg);
  140. return [res.state,res.msg,''];
  141. },
  142. errorTextFormat : function(data) {
  143. return 'Error: ' + data.responseText
  144. }
  145. },
  146. // options for the Delete Dailog
  147. {
  148. errorTextFormat : function(data) {
  149. return 'Error: ' + data.responseText
  150. }
  151. },{
  152. // search options 这里支持多条件查询
  153. multipleSearch: true,
  154. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  155. afterSubmit: function(r, data) {
  156. var messageString = r.responseText;
  157. var mesObj = eval('(' + messageString + ')');
  158. return [mesObj.state, mesObj.message];
  159. }
  160. }
  161. );
  162. })
  163. </script>
  164. <title>我的桌面</title>
  165. </head>
  166. <body>
  167. <div class="page-container">
  168. <table id="jqGrid"></table>
  169. <div id="jqGridPager"></div>
  170. </div>
  171. <footer class="footer mt-20">
  172. <div class="container">
  173. <p></p>
  174. </div>
  175. </footer>
  176. </body>
  177. </html>