autoFormStyleList.vm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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. <script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
  19. <link rel="stylesheet" href="plug-in/tools/css/metrole/common.css" type="text/css"></link>
  20. <link rel="stylesheet" href="plug-in/ace/css/font-awesome.css" type="text/css"></link>
  21. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
  22. <script type="text/javascript" src="plug-in/ace/js/bootstrap-tab.js"></script>
  23. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  24. <script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
  25. <script type="text/javascript" src="plug-in/jquery-plugs/hftable/jquery-hftable.js"></script>
  26. <script type="text/javascript" src="plug-in/tools/json2.js"></script>
  27. <script type="text/javascript">
  28. jQuery(function() {
  29. storage = jQuery.localStorage;
  30. if (!storage) storage = jQuery.cookieStorage;
  31. jQuery('#autoFormStyleList').datagrid({
  32. idField: 'id',
  33. title: '自定义表单模板',
  34. url: 'autoFormStyleController.do?datagrid&field=id,styleDesc,createName,createBy,createDate,updateName,updateBy,updateDate,sysOrgCode,sysCompanyCode,',
  35. fit: true,
  36. loadMsg: '数据加载中...',
  37. pageSize: 10,
  38. pagination: true,
  39. pageList: [10, 20, 30],
  40. sortOrder: 'asc',
  41. rownumbers: true,
  42. singleSelect: false,
  43. fitColumns: false,
  44. striped: true,
  45. showFooter: true,
  46. frozenColumns: [[{
  47. field: 'ck',
  48. checkbox: 'true'
  49. },
  50. ]],
  51. columns: [[{
  52. field: 'id',
  53. title: '',
  54. width: 120,
  55. hidden: true,
  56. sortable: true
  57. },
  58. {
  59. field: 'styleDesc',
  60. title: '自定义表单模板名',
  61. width: 120,
  62. sortable: true
  63. },
  64. {
  65. field: 'createName',
  66. title: '创建人名称',
  67. width: 120,
  68. hidden: true,
  69. sortable: true
  70. },
  71. {
  72. field: 'createBy',
  73. title: '创建人',
  74. width: 120,
  75. hidden: true,
  76. sortable: true
  77. },
  78. {
  79. field: 'createDate',
  80. title: '创建日期',
  81. width: 120,
  82. hidden: true,
  83. sortable: true,
  84. formatter: function(value, rec, index) {
  85. return new Date().format('yyyy-MM-dd', value);
  86. }
  87. },
  88. {
  89. field: 'updateName',
  90. title: '更新人名称',
  91. width: 120,
  92. hidden: true,
  93. sortable: true
  94. },
  95. {
  96. field: 'updateBy',
  97. title: 'common.updateBy',
  98. width: 120,
  99. hidden: true,
  100. sortable: true
  101. },
  102. {
  103. field: 'updateDate',
  104. title: '更新日期',
  105. width: 120,
  106. hidden: true,
  107. sortable: true,
  108. formatter: function(value, rec, index) {
  109. return new Date().format('yyyy-MM-dd', value);
  110. }
  111. },
  112. {
  113. field: 'sysOrgCode',
  114. title: 'common.depart.code',
  115. width: 120,
  116. hidden: true,
  117. sortable: true
  118. },
  119. {
  120. field: 'sysCompanyCode',
  121. title: '所属公司',
  122. width: 120,
  123. hidden: true,
  124. sortable: true
  125. },
  126. {
  127. field: 'opt',
  128. title: '操作',
  129. width: 100,
  130. formatter: function(value, rec, index) {
  131. if (!rec.id) {
  132. return '';
  133. }
  134. var href = '';
  135. href += "<a href='#' class='ace_button' onclick=delObj('autoFormStyleController.do?doDel&id=" + rec.id + "','autoFormStyleList')> <i class=' fa fa-trash-o'></i> ";
  136. href += "删除</a>&nbsp;";
  137. return href;
  138. }
  139. }]],
  140. onLoadSuccess: function(data) {
  141. jQuery("#autoFormStyleList").datagrid("clearSelections");
  142. },
  143. onClickRow: function(rowIndex, rowData) {
  144. rowid = rowData.id;
  145. gridname = 'autoFormStyleList';
  146. }
  147. });
  148. jQuery('#autoFormStyleList').datagrid('getPager').pagination({
  149. beforePageText: '',
  150. afterPageText: '/{pages}',
  151. displayMsg: '{from}-{to}共 {total}条',
  152. showPageList: true,
  153. showRefresh: true
  154. });
  155. jQuery('#autoFormStyleList').datagrid('getPager').pagination({
  156. onBeforeRefresh: function(pageNumber, pageSize) {
  157. jQuery(this).pagination('loading');
  158. jQuery(this).pagination('loaded');
  159. }
  160. });
  161. try {
  162. restoreheader();
  163. } catch(ex) {}
  164. });
  165. function reloadTable() {
  166. try {
  167. jQuery('#' + gridname).datagrid('reload');
  168. jQuery('#' + gridname).treegrid('reload');
  169. } catch(ex) {}
  170. }
  171. function reloadautoFormStyleList() {
  172. jQuery('#autoFormStyleList').datagrid('reload');
  173. }
  174. function getautoFormStyleListSelected(field) {
  175. return getSelected(field);
  176. }
  177. function getSelected(field) {
  178. var row = jQuery('#' + gridname).datagrid('getSelected');
  179. if (row != null) {
  180. value = row[field];
  181. } else {
  182. value = '';
  183. }
  184. return value;
  185. }
  186. function getautoFormStyleListSelections(field) {
  187. var ids = [];
  188. var rows = jQuery('#autoFormStyleList').datagrid('getSelections');
  189. for (var i = 0; i < rows.length; i++) {
  190. ids.push(rows[i][field]);
  191. }
  192. ids.join(',');
  193. return ids
  194. };
  195. function getSelectRows() {
  196. return jQuery('#autoFormStyleList').datagrid('getChecked');
  197. }
  198. function saveHeader() {
  199. var columnsFields = null;
  200. var easyextends = false;
  201. try {
  202. columnsFields = jQuery('#autoFormStyleList').datagrid('getColumns');
  203. easyextends = true;
  204. } catch(e) {
  205. columnsFields = jQuery('#autoFormStyleList').datagrid('getColumnFields');
  206. }
  207. var cols = storage.get('autoFormStyleListhiddenColumns');
  208. var init = true;
  209. if (cols) {
  210. init = false;
  211. }
  212. var hiddencolumns = [];
  213. for (var i = 0; i < columnsFields.length; i++) {
  214. if (easyextends) {
  215. hiddencolumns.push({
  216. field: columnsFields[i].field,
  217. hidden: columnsFields[i].hidden
  218. });
  219. } else {
  220. var columsDetail = jQuery('#autoFormStyleList').datagrid("getColumnOption", columnsFields[i]);
  221. if (init) {
  222. hiddencolumns.push({
  223. field: columsDetail.field,
  224. hidden: columsDetail.hidden,
  225. visible: (columsDetail.hidden == true ? false: true)
  226. });
  227. } else {
  228. for (var j = 0; j < cols.length; j++) {
  229. if (cols[j].field == columsDetail.field) {
  230. hiddencolumns.push({
  231. field: columsDetail.field,
  232. hidden: columsDetail.hidden,
  233. visible: cols[j].visible
  234. });
  235. }
  236. }
  237. }
  238. }
  239. }
  240. storage.set('autoFormStyleListhiddenColumns', JSON.stringify(hiddencolumns));
  241. }
  242. function isShowBut() {
  243. var isShowSearchId = jQuery('#isShowSearchId').val();
  244. if (isShowSearchId == "true") {
  245. jQuery("#searchColums").hide();
  246. jQuery('#isShowSearchId').val("false");
  247. jQuery('#columsShow').remove("src");
  248. jQuery('#columsShow').attr("src", "plug-in/easyui/themes/default/images/accordion_expand.png");
  249. } else {
  250. jQuery("#searchColums").show();
  251. jQuery('#isShowSearchId').val("true");
  252. jQuery('#columsShow').remove("src");
  253. jQuery('#columsShow').attr("src", "plug-in/easyui/themes/default/images/accordion_collapse.png");
  254. }
  255. }
  256. function restoreheader() {
  257. var cols = storage.get('autoFormStyleListhiddenColumns');
  258. if (!cols) return;
  259. for (var i = 0; i < cols.length; i++) {
  260. try {
  261. if (cols.visible != false) jQuery('#autoFormStyleList').datagrid((cols[i].hidden == true ? 'hideColumn': 'showColumn'), cols[i].field);
  262. } catch(e) {}
  263. }
  264. }
  265. function resetheader() {
  266. var cols = storage.get('autoFormStyleListhiddenColumns');
  267. if (!cols) return;
  268. for (var i = 0; i < cols.length; i++) {
  269. try {
  270. jQuery('#autoFormStyleList').datagrid((cols.visible == false ? 'hideColumn': 'showColumn'), cols[i].field);
  271. } catch(e) {}
  272. }
  273. }
  274. function autoFormStyleListsearch() {
  275. try {
  276. if (!jQuery("#autoFormStyleListForm").Validform({
  277. tiptype: 3
  278. }).check()) {
  279. return false;
  280. }
  281. } catch(e) {}
  282. if (true) {
  283. var queryParams = jQuery('#autoFormStyleList').datagrid('options').queryParams;
  284. jQuery('#autoFormStyleListtb').find('*').each(function() {
  285. queryParams[jQuery(this).attr('name')] = jQuery(this).val();
  286. });
  287. jQuery('#autoFormStyleList').datagrid({
  288. url: 'autoFormStyleController.do?datagrid&field=id,styleDesc,createName,createBy,createDate,updateName,updateBy,updateDate,sysOrgCode,sysCompanyCode,',
  289. pageNumber: 1
  290. });
  291. }
  292. }
  293. function dosearch(params) {
  294. var jsonparams = jQuery.parseJSON(params);
  295. jQuery('#autoFormStyleList').datagrid({
  296. url: 'autoFormStyleController.do?datagrid&field=id,styleDesc,createName,createBy,createDate,updateName,updateBy,updateDate,sysOrgCode,sysCompanyCode,',
  297. queryParams: jsonparams
  298. });
  299. }
  300. function autoFormStyleListsearchbox(value, name) {
  301. var queryParams = jQuery('#autoFormStyleList').datagrid('options').queryParams;
  302. queryParams[name] = value;
  303. queryParams.searchfield = name;
  304. jQuery('#autoFormStyleList').datagrid('reload');
  305. }
  306. jQuery('#autoFormStyleListsearchbox').searchbox({
  307. searcher: function(value, name) {
  308. autoFormStyleListsearchbox(value, name);
  309. },
  310. menu: '#autoFormStyleListmm',
  311. prompt: '请输入查询关键字'
  312. });
  313. function EnterPress(e) {
  314. var e = e || window.event;
  315. if (e.keyCode == 13) {
  316. autoFormStyleListsearch();
  317. }
  318. }
  319. function searchReset(name) {
  320. jQuery("#" + name + "tb").find(":input").val("");
  321. var queryParams = jQuery('#autoFormStyleList').datagrid('options').queryParams;
  322. jQuery('#autoFormStyleListtb').find('*').each(function() {
  323. queryParams[jQuery(this).attr('name')] = jQuery(this).val();
  324. });
  325. jQuery('#autoFormStyleList').datagrid({
  326. url: 'autoFormStyleController.do?datagrid&field=id,styleDesc,createName,createBy,createDate,updateName,updateBy,updateDate,sysOrgCode,sysCompanyCode,',
  327. pageNumber: 1
  328. });
  329. }
  330. jQuery(document).ready(function(){
  331. //给时间控件加上样式
  332. jQuery("#autoFormStyleListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
  333. jQuery("#autoFormStyleListtb").find("input[name='updateDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
  334. });
  335. </script>
  336. </head>
  337. <body>
  338. <div class="easyui-layout" fit="true">
  339. <div region="center" style="padding:0px;border:0px">
  340. <table width="100%" id="autoFormStyleList" toolbar="#autoFormStyleListtb"></table>
  341. <div id="autoFormStyleListtb" style="padding:3px; height: auto">
  342. <div style="height:30px;" class="datagrid-toolbar">
  343. <span style="float:left;">
  344. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="add('录入','autoFormStyleController.do?goAdd_vm','autoFormStyleList','100%','100%')">录入</a>
  345. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-edit" onclick="update('编辑','autoFormStyleController.do?goUpdate_vm','autoFormStyleList','100%','100%')">编辑</a>
  346. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-remove" onclick="deleteALLSelect('批量删除','autoFormStyleController.do?doBatchDel','autoFormStyleList',null,null)">批量删除</a>
  347. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" onclick="detail('查看','autoFormStyleController.do?goUpdate_vm','autoFormStyleList','100%','100%')">查看</a>
  348. </span>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. </body>
  354. </html>