urlrule.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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. $(window).resize(function(){
  37. $("#jqGridGroup").setGridWidth($(window).width()-40);
  38. $("#jqGrid").setGridWidth($(window).width()-40); 
  39. });
  40. $("#jqGridGroup").jqGrid({
  41. url : '${ctx}/myconsole/urlrulegroup/getByPage',
  42. editurl:"${ctx}/myconsole/urlrulegroup/saveOrUpdate2",
  43. mtype : "POST",
  44. datatype : "json",
  45. caption:'规则组管理',
  46. prmNames : {
  47. id: "keyid", 
  48. oper:"oper",    
  49. addoper:"add",
  50. editoper:"edit",
  51. deloper:"del" 
  52. },
  53. colModel : [ {
  54. label : '规则组编号',
  55. name : 'keyid',
  56. hidden : true,
  57. editable: false,
  58. key : true,
  59. width : 80
  60. },{
  61. label : '规则组编号',
  62. name : 'urlrulegroupid',
  63. editable: true,
  64. width : 80,
  65. formoptions:{
  66. elmsuffix:'* 字母'
  67. },
  68. editoptions: {
  69. maxlength: 15
  70. },
  71. editrules:{required:true}
  72. }, {
  73. label : '规则组名称',
  74. name : 'urlrulegroupname',
  75. editable: true,
  76. width : 80,
  77. formoptions:{
  78. elmsuffix:'* 汉字'
  79. },
  80. editoptions: {
  81. maxlength: 15
  82. },
  83. editrules:{required:true}
  84. }, {
  85. label : '规则组描述',
  86. name : 'urlrulegroupdesc',
  87. editable: true,
  88. width : 80,
  89. edittype : "textarea",
  90. editoptions: {
  91. size:50,
  92. maxlength: 500,
  93. rows:"5",
  94. cols:"40"
  95. }
  96. }, {
  97. label : '更新时间',
  98. name : 'updatetime',
  99. editable: false,
  100. width : 80
  101. }],
  102. rownumbers : true,//添加左侧行号
  103. viewrecords : true,//是否在浏览导航栏显示记录总数
  104. rowNum : 10,//每页显示记录数
  105. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  106. autowidth : true,
  107. height : 'auto',
  108. onSelectRow : function( rowid ) {
  109. if(rowid.length>10){
  110. var row = $(this).getRowData(rowid);
  111. $("#jqGrid").setColProp('urlrulegroupkeyid',{editoptions:{value:row.keyid+":a"}});
  112. $("#jqGrid").setCaption("规则管理--"+row.urlrulegroupname);
  113. $("#jqGrid").jqGrid('setGridParam',{url: "${ctx}/myconsole/urlrule/getByPage?urlruleGroupKeyID="+row.keyid});
  114. $("#jqGrid").trigger("reloadGrid");
  115. }
  116. },
  117. pager : "#jqGridPagerGroup"
  118. });
  119. $('#jqGridGroup').navGrid('#jqGridPagerGroup',
  120. // the buttons to appear on the toolbar of the grid
  121. {
  122. edit : true,
  123. add : true,
  124. del : true,
  125. search : true,
  126. refresh : true,
  127. view : false,
  128. position : "left",
  129. cloneToTop : true
  130. },
  131. // options for the Edit Dialog
  132. {
  133. recreateForm : true,
  134. checkOnUpdate : true,
  135. checkOnSubmit : true,
  136. closeAfterEdit : true,
  137. onInitializeForm:function(formid) {
  138. },
  139. serializeEditData: function(postdata) {
  140. //myconsole.log(postdata);
  141. $.each(postdata,function (index, value) {
  142. //myconsole.log(index);
  143. if(index!="jqGrid_id" && index!="oper" && index!="id"){
  144. modifyJosnKey(postdata,index,"urlRuleGroup."+index);
  145. }
  146. if(index=="id"){
  147. postdata["urlRuleGroup."+index]=value;
  148. }
  149. })
  150. //myconsole.log(postdata);
  151. return postdata;
  152. },
  153. afterSubmit: function(r, data) {
  154. var messageString = r.responseText;
  155. var mesObj = eval('(' + messageString + ')');
  156. return [mesObj.state, mesObj.msg];
  157. },
  158. errorTextFormat : function(data) {
  159. return 'Error: ' + data.responseText;
  160. }
  161. },
  162. // options for the Add Dialog
  163. {
  164. closeAfterAdd : true,
  165. recreateForm : true,
  166. beforeSubmit: function(postdata, formid){
  167. $.each(postdata,function (index, value) {
  168. if(index!="jqGrid_id" && index!="oper"){
  169. modifyJosnKey(postdata,index,"urlRuleGroup."+index);
  170. }
  171. })
  172. return[true,''];
  173. },
  174. afterSubmit: function(r, data) {
  175. var messageString = r.responseText;
  176. var mesObj = eval('(' + messageString + ')');
  177. return [mesObj.state, mesObj.msg];
  178. },
  179. errorTextFormat : function(data) {
  180. return 'Error: ' + data.responseText;
  181. }
  182. },
  183. // options for the Delete Dailog
  184. {
  185. errorTextFormat : function(data) {
  186. return 'Error: ' + data.responseText;
  187. }
  188. },{
  189. // search options 这里支持多条件查询
  190. multipleSearch: true,
  191. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  192. afterSubmit: function(r, data) {
  193. var messageString = r.responseText;
  194. var mesObj = eval('(' + messageString + ')');
  195. return [mesObj.state, mesObj.message];
  196. }
  197. }
  198. );
  199. ///////////////////////////////////
  200. $("#jqGrid").jqGrid({
  201. url : '${ctx}/myconsole/urlrule/getByPage',
  202. editurl:"${ctx}/myconsole/urlrule/saveOrUpdate",
  203. mtype : "POST",
  204. datatype : "json",
  205. prmNames:{id:"keyid"},
  206. caption:'规则管理',
  207. colModel : [ {
  208. label : '发布规则编号',
  209. name : 'keyid',
  210. hidden : true,
  211. key : true,
  212. width : 50,
  213. }, {
  214. label : '模板组编号',
  215. name : 'urlrulegroupkeyid',
  216. hidden : true,
  217. editable : true,
  218. edittype :"select",
  219. editoptions:{value:"a:a"}
  220. }, {
  221. label : '发布规则名称',
  222. name : 'urlrulename',
  223. edittype: "text",
  224. hidden : true,
  225. editable: false,
  226. formoptions:{
  227. elmsuffix:'*'
  228. },
  229. editrules:{required:true},
  230. width : 40
  231. } , {
  232. label : '发布规则描述',
  233. name : 'urlruledesc',
  234. editable: true,
  235. edittype: "text",
  236. width : 40,
  237. editoptions: {
  238. dataInit: function(elem){
  239. $(elem).width(350);
  240. }
  241. }
  242. }, {
  243. label : '发布规则表达式',
  244. name : 'urlruleexp',
  245. edittype: "text",
  246. editable: true,
  247. width : 80,
  248. editoptions: {
  249. dataInit: function(elem){
  250. $(elem).width(350);
  251. }
  252. }
  253. }, {
  254. label : '排序值',
  255. name : 'sortid',
  256. editable: true,
  257. edittype: "text",
  258. formoptions:{
  259. elmsuffix:'必须是数字'
  260. },
  261. width : 30
  262. } ],
  263. rownumbers : true,//添加左侧行号
  264. viewrecords : true,//是否在浏览导航栏显示记录总数
  265. rowNum : 10,//每页显示记录数
  266. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  267. autowidth : true,
  268. height : 'auto',
  269. pager : "#jqGridPager"
  270. });
  271. $('#jqGrid').navGrid('#jqGridPager',
  272. // the buttons to appear on the toolbar of the grid
  273. {
  274. edit : true,
  275. add : false,
  276. del : false,
  277. search : true,
  278. refresh : true,
  279. view : true,
  280. position : "left",
  281. cloneToTop : true
  282. },
  283. // options for the Edit Dialog
  284. {
  285. recreateForm : true,
  286. checkOnUpdate : true,
  287. checkOnSubmit : true,
  288. closeAfterEdit : true,
  289. onInitializeForm:function(formid) {
  290. makeTree("orgid","/myconsole/urlrule/getOrgTree","checkbox",true);
  291. },
  292. beforeShowForm:function(formid){
  293. show("orgid");
  294. },
  295. afterShowForm: function (formid){
  296. },
  297. serializeEditData: function(postdata) {
  298. //myconsole.log(postdata);
  299. $.each(postdata,function (index, value) {
  300. //myconsole.log(index);
  301. if(index!="jqGrid_id" && index!="oper" && index!="id"){
  302. modifyJosnKey(postdata,index,"urlRule."+index);
  303. }
  304. if(index=="id"){
  305. postdata["urlRule."+index]=value
  306. }
  307. })
  308. //myconsole.log(postdata);
  309. return postdata;
  310. },
  311. errorTextFormat : function(data) {
  312. return 'Error: ' + data.responseText
  313. }
  314. },
  315. // options for the Add Dialog
  316. {
  317. closeAfterAdd : true,
  318. recreateForm : true,
  319. onInitializeForm:function(formid) {
  320. makeTree("orgid","/myconsole/urlrule/getOrgTree","checkbox",true);
  321. show("orgid");
  322. },
  323. beforeSubmit: function(postdata, formid){
  324. $.each(postdata,function (index, value) {
  325. if(index!="jqGrid_id" && index!="oper"){
  326. modifyJosnKey(postdata,index,"urlRule."+index);
  327. }
  328. })
  329. return[true,''];
  330. },
  331. errorTextFormat : function(data) {
  332. return 'Error: ' + data.responseText
  333. }
  334. },
  335. // options for the Delete Dailog
  336. {
  337. errorTextFormat : function(data) {
  338. return 'Error: ' + data.responseText
  339. }
  340. },{
  341. // search options 这里支持多条件查询
  342. multipleSearch: true,
  343. closeAfterSearch: true,
  344. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  345. afterSubmit: function(r, data) {
  346. var messageString = r.responseText;
  347. var mesObj = eval('(' + messageString + ')');
  348. return [mesObj.state, mesObj.message];
  349. }
  350. }
  351. );
  352. })
  353. </script>
  354. <title>发布规则管理</title>
  355. <style type="text/css" >
  356. ul.ztree {
  357. background: #f0f6e4 none repeat scroll 0 0;
  358. border: 1px solid #617775;
  359. height: 360px;
  360. margin-top: 10px;
  361. overflow-x: auto;
  362. overflow-y: scroll;
  363. width: 220px;
  364. }
  365. </style>
  366. </head>
  367. <body>
  368. <div class="page-container">
  369. <table id="jqGridGroup"></table>
  370. <div id="jqGridPagerGroup"></div>
  371. <div>&nbsp;</div>
  372. <table id="jqGrid"></table>
  373. <div id="jqGridPager"></div>
  374. </div>
  375. <footer class="footer mt-20">
  376. <div class="container">
  377. <p></p>
  378. </div>
  379. </footer>
  380. </body>
  381. </html>