cgDynamGraphConfigHeadList.vm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script type="text/javascript" src="plug-in/mutiLang/zh-cn.js"></script>
  5. <script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.js"></script>
  6. <script type="text/javascript" src="plug-in/jquery/jquery.cookie.js"></script>
  7. <script type="text/javascript" src="plug-in/jquery-plugs/storage/jquery.storageapi.min.js"></script>
  8. <script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
  9. <link id="easyuiTheme" rel="stylesheet" href="plug-in/easyui/themes/metrole/easyui.css" type="text/css"></link>
  10. <link id="easyuiTheme" rel="stylesheet" href="plug-in/easyui/themes/metrole/main.css" type="text/css"></link>
  11. <link id="easyuiTheme" rel="stylesheet" href="plug-in/easyui/themes/metrole/icon.css" type="text/css"></link>
  12. <link rel="stylesheet" type="text/css" href="plug-in/accordion/css/accordion.css">
  13. <link rel="stylesheet" type="text/css" href="plug-in/accordion/css/icons.css">
  14. <script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
  15. <script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
  16. <script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
  17. <script type="text/javascript" src="plug-in/easyui/extends/datagrid-scrollview.js"></script>
  18. <link rel="stylesheet" href="plug-in/tools/css/metrole/common.css" type="text/css"></link>
  19. <link rel="stylesheet" href="plug-in/ace/css/font-awesome.css" type="text/css"></link>
  20. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
  21. <script type="text/javascript" src="plug-in/ace/js/bootstrap-tab.js"></script>
  22. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  23. <script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
  24. <script type="text/javascript" src="plug-in/jquery-plugs/hftable/jquery-hftable.js"></script>
  25. <script type="text/javascript" src="plug-in/tools/json2.js"></script>
  26. <script src="plug-in/clipboard/ZeroClipboard.js"></script>
  27. <link rel="stylesheet" href="plug-in/Validform/css/style.css" type="text/css">
  28. <link rel="stylesheet" href="plug-in/Validform/css/tablefrom.css" type="text/css">
  29. <script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
  30. <script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
  31. <script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
  32. <script type="text/javascript">
  33. jQuery(function() {
  34. storage = jQuery.localStorage;
  35. if (!storage) storage = jQuery.cookieStorage;
  36. jQuery('#cgDynamGraphConfigHeadList').datagrid({
  37. idField: 'id',
  38. title: '动态表头',
  39. url: 'cgDynamGraphConfigHeadController.do?datagrid&field=id,code,name,cgrSql,dbSource,createBy,createDate,updateBy,updateDate,content,',
  40. fit: true,
  41. queryParams: {},
  42. loadMsg: '数据加载中...',
  43. pageSize: 10,
  44. pagination: true,
  45. pageList: [10, 20, 30],
  46. sortName: 'createDate',
  47. sortOrder: 'desc',
  48. rownumbers: true,
  49. singleSelect: false,
  50. fitColumns: false,
  51. striped: true,
  52. showFooter: true,
  53. frozenColumns: [[{
  54. field: 'ck',
  55. checkbox: 'true'
  56. },
  57. ]],
  58. columns: [[{
  59. field: 'id',
  60. title: '',
  61. width: 120,
  62. hidden: true,
  63. sortable: true
  64. },
  65. {
  66. field: 'code',
  67. title: '编码',
  68. width: 120,
  69. sortable: true
  70. },
  71. {
  72. field: 'name',
  73. title: '名称',
  74. width: 120,
  75. sortable: true
  76. },
  77. {
  78. field: 'cgrSql',
  79. title: '查询sql',
  80. width: 120,
  81. sortable: true
  82. },
  83. {
  84. field: 'dbSource',
  85. title: '数据源',
  86. width: 120,
  87. sortable: true
  88. },
  89. {
  90. field: 'createBy',
  91. title: '创建人',
  92. sortable: true
  93. },
  94. {
  95. field: 'createDate',
  96. title: '创建时间',
  97. sortable: true,
  98. formatter: function(value, rec, index) {
  99. return new Date().format('yyyy-MM-dd', value);
  100. }
  101. },
  102. {
  103. field: 'updateBy',
  104. title: '修改人',
  105. sortable: true
  106. },
  107. {
  108. field: 'updateDate',
  109. title: '修改时间',
  110. sortable: true,
  111. formatter: function(value, rec, index) {
  112. return new Date().format('yyyy-MM-dd', value);
  113. }
  114. },
  115. {
  116. field: 'content',
  117. title: '描述',
  118. width: 120,
  119. sortable: true
  120. },
  121. {
  122. field: 'opt',
  123. title: '操作',
  124. width: 200,
  125. formatter: function(value, rec, index) {
  126. if (!rec.id) {
  127. return '';
  128. }
  129. var href = '';
  130. href += "<a href='#' class='ace_button' onclick=delObj('cgDynamGraphConfigHeadController.do?doDel&id=" + rec.id + "','cgDynamGraphConfigHeadList')> <i class=' fa fa-trash-o'></i> ";
  131. href += "删除</a>&nbsp;";
  132. href += "<a href='#' class='ace_button' onclick=popmenulink_vm('" + rec.code + "','" + rec.name + "','" + index + "')> <i class=' fa fa-cog'></i>";
  133. href += "配置地址</a>&nbsp;";
  134. href += "<a href='#' class='ace_button' onclick=addlisttab('" + rec.code + "','" + rec.name + "','" + index + "')> <i class=' fa fa-cog'></i>";
  135. href += "配置图表</a>&nbsp;";
  136. return href;
  137. }
  138. }]],
  139. onLoadSuccess: function(data) {
  140. jQuery("#cgDynamGraphConfigHeadList").datagrid("clearSelections");
  141. },
  142. onClickRow: function(rowIndex, rowData) {
  143. rowid = rowData.id;
  144. gridname = 'cgDynamGraphConfigHeadList';
  145. }
  146. });
  147. jQuery('#cgDynamGraphConfigHeadList').datagrid('getPager').pagination({
  148. beforePageText: '',
  149. afterPageText: '/{pages}',
  150. displayMsg: '{from}-{to}共 {total}条',
  151. showPageList: true,
  152. showRefresh: true
  153. });
  154. jQuery('#cgDynamGraphConfigHeadList').datagrid('getPager').pagination({
  155. onBeforeRefresh: function(pageNumber, pageSize) {
  156. jQuery(this).pagination('loading');
  157. jQuery(this).pagination('loaded');
  158. }
  159. });
  160. try {
  161. restoreheader();
  162. } catch(ex) {}
  163. });
  164. function reloadTable() {
  165. try {
  166. jQuery('#' + gridname).datagrid('reload');
  167. jQuery('#' + gridname).treegrid('reload');
  168. } catch(ex) {}
  169. }
  170. function reloadcgDynamGraphConfigHeadList() {
  171. jQuery('#cgDynamGraphConfigHeadList').datagrid('reload');
  172. }
  173. function getcgDynamGraphConfigHeadListSelected(field) {
  174. return getSelected(field);
  175. }
  176. function getSelected(field) {
  177. var row = jQuery('#' + gridname).datagrid('getSelected');
  178. if (row != null) {
  179. value = row[field];
  180. } else {
  181. value = '';
  182. }
  183. return value;
  184. }
  185. function getcgDynamGraphConfigHeadListSelections(field) {
  186. var ids = [];
  187. var rows = jQuery('#cgDynamGraphConfigHeadList').datagrid('getSelections');
  188. for (var i = 0; i < rows.length; i++) {
  189. ids.push(rows[i][field]);
  190. }
  191. ids.join(',');
  192. return ids
  193. };
  194. function getSelectRows() {
  195. return jQuery('#cgDynamGraphConfigHeadList').datagrid('getChecked');
  196. }
  197. function saveHeader() {
  198. var columnsFields = null;
  199. var easyextends = false;
  200. try {
  201. columnsFields = jQuery('#cgDynamGraphConfigHeadList').datagrid('getColumns');
  202. easyextends = true;
  203. } catch(e) {
  204. columnsFields = jQuery('#cgDynamGraphConfigHeadList').datagrid('getColumnFields');
  205. }
  206. var cols = storage.get('cgDynamGraphConfigHeadListhiddenColumns');
  207. var init = true;
  208. if (cols) {
  209. init = false;
  210. }
  211. var hiddencolumns = [];
  212. for (var i = 0; i < columnsFields.length; i++) {
  213. if (easyextends) {
  214. hiddencolumns.push({
  215. field: columnsFields[i].field,
  216. hidden: columnsFields[i].hidden
  217. });
  218. } else {
  219. var columsDetail = jQuery('#cgDynamGraphConfigHeadList').datagrid("getColumnOption", columnsFields[i]);
  220. if (init) {
  221. hiddencolumns.push({
  222. field: columsDetail.field,
  223. hidden: columsDetail.hidden,
  224. visible: (columsDetail.hidden == true ? false: true)
  225. });
  226. } else {
  227. for (var j = 0; j < cols.length; j++) {
  228. if (cols[j].field == columsDetail.field) {
  229. hiddencolumns.push({
  230. field: columsDetail.field,
  231. hidden: columsDetail.hidden,
  232. visible: cols[j].visible
  233. });
  234. }
  235. }
  236. }
  237. }
  238. }
  239. storage.set('cgDynamGraphConfigHeadListhiddenColumns', JSON.stringify(hiddencolumns));
  240. }
  241. function isShowBut() {
  242. var isShowSearchId = jQuery('#isShowSearchId').val();
  243. if (isShowSearchId == "true") {
  244. jQuery("#searchColums").hide();
  245. jQuery('#isShowSearchId').val("false");
  246. jQuery('#columsShow').remove("src");
  247. jQuery('#columsShow').attr("src", "plug-in/easyui/themes/default/images/accordion_expand.png");
  248. } else {
  249. jQuery("#searchColums").show();
  250. jQuery('#isShowSearchId').val("true");
  251. jQuery('#columsShow').remove("src");
  252. jQuery('#columsShow').attr("src", "plug-in/easyui/themes/default/images/accordion_collapse.png");
  253. }
  254. }
  255. function restoreheader() {
  256. var cols = storage.get('cgDynamGraphConfigHeadListhiddenColumns');
  257. if (!cols) return;
  258. for (var i = 0; i < cols.length; i++) {
  259. try {
  260. if (cols.visible != false) jQuery('#cgDynamGraphConfigHeadList').datagrid((cols[i].hidden == true ? 'hideColumn': 'showColumn'), cols[i].field);
  261. } catch(e) {}
  262. }
  263. }
  264. function resetheader() {
  265. var cols = storage.get('cgDynamGraphConfigHeadListhiddenColumns');
  266. if (!cols) return;
  267. for (var i = 0; i < cols.length; i++) {
  268. try {
  269. jQuery('#cgDynamGraphConfigHeadList').datagrid((cols.visible == false ? 'hideColumn': 'showColumn'), cols[i].field);
  270. } catch(e) {}
  271. }
  272. }
  273. function cgDynamGraphConfigHeadListsearch() {
  274. try {
  275. if (!jQuery("#cgDynamGraphConfigHeadListForm").Validform({
  276. tiptype: 3
  277. }).check()) {
  278. return false;
  279. }
  280. } catch(e) {}
  281. if (true) {
  282. var queryParams = jQuery('#cgDynamGraphConfigHeadList').datagrid('options').queryParams;
  283. jQuery('#cgDynamGraphConfigHeadListtb').find('*').each(function() {
  284. queryParams[jQuery(this).attr('name')] = jQuery(this).val();
  285. });
  286. jQuery('#cgDynamGraphConfigHeadList').datagrid({
  287. url: 'cgDynamGraphConfigHeadController.do?datagrid&field=id,code,name,cgrSql,dbSource,createBy,createDate,updateBy,updateDate,content,',
  288. pageNumber: 1
  289. });
  290. }
  291. }
  292. function dosearch(params) {
  293. var jsonparams = jQuery.parseJSON(params);
  294. jQuery('#cgDynamGraphConfigHeadList').datagrid({
  295. url: 'cgDynamGraphConfigHeadController.do?datagrid&field=id,code,name,cgrSql,dbSource,createBy,createDate,updateBy,updateDate,content,',
  296. queryParams: jsonparams
  297. });
  298. }
  299. function cgDynamGraphConfigHeadListsearchbox(value, name) {
  300. var queryParams = jQuery('#cgDynamGraphConfigHeadList').datagrid('options').queryParams;
  301. queryParams[name] = value;
  302. queryParams.searchfield = name;
  303. jQuery('#cgDynamGraphConfigHeadList').datagrid('reload');
  304. }
  305. jQuery('#cgDynamGraphConfigHeadListsearchbox').searchbox({
  306. searcher: function(value, name) {
  307. cgDynamGraphConfigHeadListsearchbox(value, name);
  308. },
  309. menu: '#cgDynamGraphConfigHeadListmm',
  310. prompt: '请输入查询关键字'
  311. });
  312. function EnterPress(e) {
  313. var e = e || window.event;
  314. if (e.keyCode == 13) {
  315. cgDynamGraphConfigHeadListsearch();
  316. }
  317. }
  318. function searchReset(name) {
  319. jQuery("#" + name + "tb").find(":input").val("");
  320. var queryParams = jQuery('#cgDynamGraphConfigHeadList').datagrid('options').queryParams;
  321. jQuery('#cgDynamGraphConfigHeadListtb').find('*').each(function() {
  322. queryParams[jQuery(this).attr('name')] = jQuery(this).val();
  323. });
  324. jQuery('#cgDynamGraphConfigHeadList').datagrid({
  325. url: 'cgDynamGraphConfigHeadController.do?datagrid&field=id,code,name,cgrSql,dbSource,createBy,createDate,updateBy,updateDate,content,',
  326. pageNumber: 1
  327. });
  328. }
  329. /**
  330. * 弹出菜单链接
  331. */
  332. function popMenuLink(tableName, content) {
  333. jQuery.dialog({
  334. content: "url:cgDynamGraphConfigHeadController.do?popmenulink_vm&url=cgDynamGraphController.do?design&title=" + tableName,
  335. drag: false,
  336. lock: true,
  337. title: '菜单链接[' + content + ']',
  338. opacity: 0.3,
  339. width: 400,
  340. height: 80,
  341. drag: false,
  342. min: false,
  343. max: false
  344. }).zindex();
  345. }
  346. function addlisttab(tableName, content) {
  347. addOneTab(content, "cgDynamGraphController.do?design&id=" + tableName);
  348. }
  349. </script>
  350. </head>
  351. <body>
  352. <div class="easyui-layout" fit="true">
  353. <div region="center" style="padding:0px;border:0px">
  354. <table width="100%" id="cgDynamGraphConfigHeadList" toolbar="#cgDynamGraphConfigHeadListtb"></table>
  355. <div id="cgDynamGraphConfigHeadListtb" style="padding:3px; height: auto">
  356. <div name="searchColums" id="searchColums">
  357. <input id="isShowSearchId" type="hidden" value="false" />
  358. <input id="_sqlbuilder" name="sqlbuilder" type="hidden" />
  359. <form id='cgDynamGraphConfigHeadListForm'>
  360. <span style="display:-moz-inline-box;display:inline-block;">
  361. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="编码">编码:</span>
  362. <input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text" name="code" class="inuptxt" style="width: 100px" />
  363. </span>
  364. <span style="display:-moz-inline-box;display:inline-block;">
  365. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="名称">名称:</span>
  366. <input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text" name="name" class="inuptxt" style="width: 100px" />
  367. </span>
  368. <span style="display:-moz-inline-box;display:inline-block;">
  369. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="查询sql">查询sql:</span>
  370. <input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text" name="cgrSql" class="inuptxt" style="width: 100px" />
  371. </span>
  372. <span style="display:-moz-inline-box;display:inline-block;">
  373. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="数据源">数据源:</span>
  374. <input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text" name="dbSource" class="inuptxt" style="width: 100px" />
  375. </span>
  376. <span style="display:-moz-inline-box;display:inline-block;">
  377. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="描述">描述:</span>
  378. <input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text" name="content" class="inuptxt" style="width: 100px" />
  379. </span>
  380. </form>
  381. </div>
  382. <div style="height:30px;" class="datagrid-toolbar">
  383. <span style="float:left;">
  384. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="add('录入','cgDynamGraphConfigHeadController.do?goAdd_vm','cgDynamGraphConfigHeadList',1200,450)">录入</a>
  385. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-edit" onclick="update('编辑','cgDynamGraphConfigHeadController.do?goUpdate_vm','cgDynamGraphConfigHeadList',1200,450)">编辑</a>
  386. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-remove" onclick="deleteALLSelect('批量删除','cgDynamGraphConfigHeadController.do?doBatchDel','cgDynamGraphConfigHeadList',null,null)">批量删除</a>
  387. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" onclick="detail('查询','cgDynamGraphConfigHeadController.do?goUpdate_vm','cgDynamGraphConfigHeadList',1200,450)">查询</a></span>
  388. <span style="float:right">
  389. <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="cgDynamGraphConfigHeadListsearch()">查询</a>
  390. <a href="#" class="easyui-linkbutton" iconCls="icon-reload" onclick="searchReset('cgDynamGraphConfigHeadList')">重置</a></span>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. </body>
  396. </html>