fragmentinstanceframe.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.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. <!--[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. //片段实例
  39. //区域绑定片段
  40. $("#jqGridInstance").jqGrid({
  41. url : '${ctx}/myconsole/fragmentInstance/getByPage?fragmentKeyID=${fragment.keyid}',
  42. editurl:"${ctx}/myconsole/fragmentInstance/saveOrUpdate2",
  43. mtype : "POST",
  44. datatype : "json",
  45. prmNames:{id:"keyid"},
  46. caption:'片段实例',
  47. colModel : [ {
  48. label : '任务编号',
  49. name : 'keyid',
  50. hidden : true,
  51. key : true,
  52. width : 50,
  53. }, {
  54. label : '模板组编号',
  55. name : 'fragmentkeyid',
  56. hidden : true,
  57. editable : true,
  58. edittype :"select",
  59. editoptions:{value:"${fragment.keyid}:a"}
  60. }, {
  61. label : '模板组编号',
  62. name : 'fragmentid',
  63. hidden : true,
  64. editable : true,
  65. edittype :"select",
  66. editoptions:{value:"${fragment.fragmentid}:a"}
  67. }, {
  68. label : '站点编号',
  69. name : 'siteid',
  70. hidden : true,
  71. editable : true,
  72. edittype :"select",
  73. editoptions:{value:"${fragment.siteid}:a"}
  74. }, {
  75. label : '实例名称',
  76. name : 'instancename',
  77. editable: true,
  78. formoptions:{
  79. elmsuffix:'*'
  80. },
  81. editoptions: {
  82. maxlength: 15
  83. },
  84. editrules:{required:true},
  85. width : 80
  86. }, {
  87. label : '实例描述',
  88. name : 'instancedesc',
  89. editable: true,
  90. width : 80,
  91. edittype : "textarea",
  92. editoptions: {
  93. size:50,
  94. maxlength: 500,
  95. rows:5,
  96. cols:40
  97. }
  98. }${instanceParam}],
  99. rownumbers : true,//添加左侧行号
  100. viewrecords : true,//是否在浏览导航栏显示记录总数
  101. rowNum : 10,//每页显示记录数
  102. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  103. autowidth : true,
  104. height : 'auto',
  105. pager : "#jqGridPagerInstance"
  106. });
  107. $('#jqGridInstance').navGrid('#jqGridPagerInstance',
  108. //the buttons to appear on the toolbar of the grid
  109. {
  110. edit : true,
  111. add : true,
  112. del : true,
  113. search : true,
  114. refresh : true,
  115. view : true,
  116. position : "left",
  117. cloneToTop : true
  118. },
  119. //options for the Edit Dialog
  120. {
  121. recreateForm : true,
  122. checkOnUpdate : true,
  123. checkOnSubmit : true,
  124. closeAfterEdit : true,
  125. onInitializeForm:function(formid) {
  126. },
  127. serializeEditData: function(postdata) {
  128. //myconsole.log(postdata);
  129. $.each(postdata,function (index, value) {
  130. //myconsole.log(index);
  131. if(index!="jqGrid_id" && index!="oper" && index!="keyid"){
  132. modifyJosnKey(postdata,index,"fragmentInstance."+index);
  133. }
  134. if(index=="keyid"){
  135. postdata["fragmentInstance."+index]=value
  136. }
  137. })
  138. //myconsole.log(postdata);
  139. return postdata;
  140. },
  141. afterSubmit: function (response, postdata) {
  142. // console.log(response);
  143. var res=eval('(' + response.responseText + ')');
  144. layer.msg(res.msg);
  145. return [res.state,res.msg,''];
  146. },
  147. errorTextFormat : function(data) {
  148. return 'Error: ' + data.responseText
  149. }
  150. },
  151. //options for the Add Dialog
  152. {
  153. closeAfterAdd : true,
  154. recreateForm : true,
  155. beforeSubmit: function(postdata, formid){
  156. $.each(postdata,function (index, value) {
  157. if(index!="jqGrid_id" && index!="oper"){
  158. modifyJosnKey(postdata,index,"fragmentInstance."+index);
  159. }
  160. })
  161. return[true,''];
  162. },
  163. afterSubmit: function (response, postdata) {
  164. // console.log(response);
  165. var res=eval('(' + response.responseText + ')');
  166. layer.msg(res.msg);
  167. return [res.state,res.msg,''];
  168. },
  169. errorTextFormat : function(data) {
  170. return 'Error: ' + data.responseText
  171. }
  172. },
  173. //options for the Delete Dailog
  174. {
  175. errorTextFormat : function(data) {
  176. return 'Error: ' + data.responseText
  177. }
  178. },{
  179. // search options 这里支持多条件查询
  180. multipleSearch: true,
  181. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  182. afterSubmit: function(r, data) {
  183. var messageString = r.responseText;
  184. var mesObj = eval('(' + messageString + ')');
  185. return [mesObj.state, mesObj.message];
  186. }
  187. }
  188. );
  189. })
  190. </script>
  191. <title>我的桌面</title>
  192. </head>
  193. <body>
  194. <div class="page-container">
  195. <table id="jqGridInstance"></table>
  196. <div id="jqGridPagerInstance"></div>
  197. </div>
  198. </body>
  199. </html>