dbbak.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
  24. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  25. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  26. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  27. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  28. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  29. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  30. <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
  31. <!--[if IE 6]>
  32. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  33. <script>DD_belatedPNG.fix('*');</script>
  34. <![endif]-->
  35. <script type="text/javascript">
  36. $(function() {
  37. $(window).resize(function(){
  38. $("#jqGrid").setGridWidth($(window).width()-40); 
  39. });
  40. $("#jqGrid").jqGrid({
  41. url : '${ctx}/myconsole/dbbak/getByPage',
  42. editurl:"${ctx}/myconsole/dbbak/saveOrUpdate",
  43. mtype : "POST",
  44. datatype : "json",
  45. caption:'数据备份',
  46. prmNames:{id:"keyid"},
  47. colModel : [ {
  48. label : '备份文件',
  49. name : 'keyid',
  50. editable: false,
  51. key : true,
  52. width : 50,
  53. }, {
  54. label : '备份描述',
  55. name : 'bakdesc',
  56. edittype: "text",
  57. editable: true,
  58. formoptions:{
  59. elmsuffix:'*'
  60. },
  61. editrules:{required:true},
  62. width : 80,
  63. }, {
  64. label : '更新时间',
  65. name : 'updatetime',
  66. editable: false,
  67. edittype: "text",
  68. width : 80,
  69. },{
  70. label : '操作',
  71. name:'operMod',
  72. index:'operMod',
  73. align:"center",
  74. width:"80",
  75. formatter: function (cellvalue, options, rowdata) {
  76. var html = "<button class='btn btn-success radius size-S' onclick=imp('"+rowdata.keyid+"')>恢复</button>";
  77. return html;
  78. }
  79. }],
  80. rownumbers : true,//添加左侧行号
  81. viewrecords : true,//是否在浏览导航栏显示记录总数
  82. rowNum : 10,//每页显示记录数
  83. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  84. autowidth : true,
  85. height : 'auto',
  86. pager : "#jqGridPager"
  87. });
  88. $('#jqGrid').navGrid('#jqGridPager',
  89. // the buttons to appear on the toolbar of the grid
  90. {
  91. edit : true,
  92. add : true,
  93. del : true,
  94. search : true,
  95. refresh : true,
  96. view : true,
  97. position : "left",
  98. cloneToTop : true
  99. },
  100. // options for the Edit Dialog
  101. {
  102. recreateForm : true,
  103. checkOnUpdate : true,
  104. checkOnSubmit : true,
  105. closeAfterEdit : true,
  106. beforeShowForm:function(formid){
  107. },
  108. afterShowForm: function (formid){
  109. },
  110. serializeEditData: function(postdata) {
  111. //myconsole.log(postdata);
  112. $.each(postdata,function (index, value) {
  113. //myconsole.log(index);
  114. if(index!="jqGrid_id" && index!="oper" && index!="id"){
  115. modifyJosnKey(postdata,index,"dbBak."+index);
  116. }
  117. if(index=="id"){
  118. postdata["dbBak."+index]=value
  119. }
  120. })
  121. //myconsole.log(postdata);
  122. return postdata;
  123. },
  124. errorTextFormat : function(data) {
  125. return 'Error: ' + data.responseText
  126. }
  127. },
  128. // options for the Add Dialog
  129. {
  130. closeAfterAdd : true,
  131. recreateForm : true,
  132. beforeSubmit: function(postdata, formid){
  133. $.each(postdata,function (index, value) {
  134. if(index!="jqGrid_id" && index!="oper"){
  135. modifyJosnKey(postdata,index,"dbBak."+index);
  136. }
  137. })
  138. return[true,''];
  139. },
  140. errorTextFormat : function(data) {
  141. return 'Error: ' + data.responseText
  142. }
  143. },
  144. // options for the Delete Dailog
  145. {
  146. errorTextFormat : function(data) {
  147. return 'Error: ' + data.responseText
  148. }
  149. },{
  150. // search options 这里支持多条件查询
  151. multipleSearch: true,
  152. closeAfterSearch: true,
  153. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  154. afterSubmit: function(r, data) {
  155. var messageString = r.responseText;
  156. var mesObj = eval('(' + messageString + ')');
  157. return [mesObj.state, mesObj.message];
  158. }
  159. }
  160. );
  161. })
  162. function imp(keyID){
  163. layer.confirm('整个数据库将被恢复至此还原点,确定要恢复吗?', {
  164. btn: ['确定','取消'] //按钮
  165. }, function(){
  166. $.post("${ctx}/myconsole/dbbak/imp",{"keyID":keyID},function(data){
  167. layer.msg(data, {icon: 1});
  168. })
  169. });
  170. }
  171. </script>
  172. <title>URL规则管理</title>
  173. <style type="text/css">
  174. ul.ztree {
  175. background: #f0f6e4 none repeat scroll 0 0;
  176. border: 1px solid #617775;
  177. height: 360px;
  178. margin-top: 10px;
  179. overflow-x: auto;
  180. overflow-y: scroll;
  181. width: 220px;
  182. }
  183. </style>
  184. </head>
  185. <body>
  186. <div class="page-container">
  187. <table id="jqGrid"></table>
  188. <div id="jqGridPager"></div>
  189. </div>
  190. <footer class="footer mt-20">
  191. <div class="container">
  192. <p></p>
  193. </div>
  194. </footer>
  195. </body>
  196. </html>