fragmentinstance.html 7.2 KB

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