jfromGraphreportHeadList.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. jQuery(function() {
  2. storage = jQuery.localStorage;
  3. if (!storage) storage = jQuery.cookieStorage;
  4. jQuery('#jformGraphreportHeadList').datagrid({
  5. idField: 'id',
  6. title: '图表配置',
  7. url: 'jformGraphreportHeadController.do?datagrid&field=id,code,name,cgrSql,content,ytext,categories,isShowList,xpageJs,',
  8. fit: true,
  9. queryParams: {},
  10. loadMsg: '数据加载中...',
  11. pageSize: 10,
  12. pagination: true,
  13. pageList: [10, 20, 30],
  14. rownumbers: true,
  15. singleSelect: false,
  16. fitColumns: false,
  17. striped: true,
  18. showFooter: true,
  19. frozenColumns: [[{
  20. field: 'ck',
  21. checkbox: 'true'
  22. },
  23. ]],
  24. columns: [[{
  25. field: 'id',
  26. title: '',
  27. width: 120,
  28. hidden: true,
  29. sortable: true
  30. },
  31. {
  32. field: 'code',
  33. title: '编码',
  34. width: 120,
  35. sortable: true
  36. },
  37. {
  38. field: 'name',
  39. title: '名称',
  40. width: 120,
  41. sortable: true
  42. },
  43. {
  44. field: 'cgrSql',
  45. title: '查询sql',
  46. width: 120,
  47. sortable: true
  48. },
  49. {
  50. field: 'content',
  51. title: '描述',
  52. width: 120,
  53. sortable: true
  54. },
  55. {
  56. field: 'ytext',
  57. title: 'y轴文字',
  58. sortable: true
  59. },
  60. {
  61. field: 'categories',
  62. title: 'x轴数据',
  63. sortable: true
  64. },
  65. {
  66. field: 'isShowList',
  67. title: '是否显示明细',
  68. sortable: true,
  69. align: 'center',
  70. formatter: function(value,rec,index){
  71. return value == 'Y'?'是':'否';
  72. }
  73. },
  74. {
  75. field: 'xpageJs',
  76. title: '扩展JS',
  77. sortable: true
  78. },
  79. {
  80. field: 'opt',
  81. title: '操作',
  82. width: 220,
  83. formatter: function(value, rec, index) {
  84. if (!rec.id) {
  85. return '';
  86. }
  87. var href = '';
  88. href += "<a href='#' class='ace_button' onclick=delObj('jformGraphreportHeadController.do?doDel&id=" + rec.id + "','jformGraphreportHeadList')>";
  89. href += "<i class=' fa fa-trash-o'></i>删除</a>";
  90. href += "<a href='#' style='margin-left:0.5em;' class='ace_button' onclick=addlisttab('" + rec.code + "','" + rec.content + "')>";
  91. href += "<i class=' fa fa-gavel'></i>功能测试</a>";
  92. href += "<a href='#' style='margin-left:0.5em;' class='ace_button' onclick=popMenuLinkGraph('" + rec.code + "','" + rec.content + "')>";
  93. href += "<i class=' fa fa-cog'></i>配置地址</a>";
  94. return href;
  95. }
  96. }]],
  97. onLoadSuccess: function(data) {
  98. jQuery("#jformGraphreportHeadList").datagrid("clearSelections");
  99. },
  100. onClickRow: function(rowIndex, rowData) {
  101. rowid = rowData.id;
  102. gridname = 'jformGraphreportHeadList';
  103. }
  104. });
  105. jQuery('#jformGraphreportHeadList').datagrid('getPager').pagination({
  106. beforePageText: '',
  107. afterPageText: '/{pages}',
  108. displayMsg: '{from}-{to}共 {total}条',
  109. showPageList: true,
  110. showRefresh: true
  111. });
  112. jQuery('#jformGraphreportHeadList').datagrid('getPager').pagination({
  113. onBeforeRefresh: function(pageNumber, pageSize) {
  114. jQuery(this).pagination('loading');
  115. jQuery(this).pagination('loaded');
  116. }
  117. });
  118. });
  119. function reloadTable() {
  120. try {
  121. jQuery('#' + gridname).datagrid('reload');
  122. jQuery('#' + gridname).treegrid('reload');
  123. } catch(ex) {}
  124. }
  125. function reloadjformGraphreportHeadList() {
  126. jQuery('#jformGraphreportHeadList').datagrid('reload');
  127. }
  128. function getJformGraphreportHeadListSelected(field) {
  129. return getSelected(field);
  130. }
  131. function getSelected(field) {
  132. var row = jQuery('#' + gridname).datagrid('getSelected');
  133. if (row != null) {
  134. value = row[field];
  135. } else {
  136. value = '';
  137. }
  138. return value;
  139. }
  140. //查询列表数据
  141. function jformGraphreportHeadListSearch(){
  142. //判断是否满足验证规则
  143. if(!jQuery("#jformGraphreportHeadList").Validform({
  144. tiptype:3
  145. }).check()){
  146. //校验规则不满足
  147. return false;
  148. }
  149. var queryParams = jQuery("#jformGraphreportHeadList").datagrid("options").queryParams;
  150. jQuery("#jformGraphreportHeadListtb").find('*').each(function(){
  151. queryParams[jQuery(this).attr('name')] = jQuery(this).val();
  152. });
  153. jQuery('#jformGraphreportHeadList').datagrid({
  154. url: 'jformGraphreportHeadController.do?datagrid&field=id,code,name,cgrSql,content,ytext,categories,isShowList,xpageJs,',
  155. pageNumber : 1
  156. });
  157. }
  158. //监测回车键
  159. function EnterPress(e) {
  160. var e = e || window.event;
  161. if (e.keyCode == 13) {
  162. jformGraphreportHeadListSearch();
  163. }
  164. }
  165. //切换到功能测试tab页面
  166. function addlisttab(tableName,content){
  167. addOneTab( '<t:mutiLang langKey="form.datalist"/>' + "["+content+"]", "graphReportController.do?list&id="+tableName);
  168. }
  169. //弹出菜单配置地址
  170. function popMenuLinkGraph(tableName,content){
  171. jQuery.dialog({
  172. content: "url:jformGraphreportHeadVMController.do?popMenuLink&url=graphReportController.do?list&isIframe&title="+tableName,
  173. drag : false,
  174. lock : true,
  175. title:'菜单链接' + '['+content+']',
  176. opacity : 0.3,
  177. width:400,
  178. height:80,drag:false,min:false,max:false
  179. }).zindex();
  180. }
  181. //导入
  182. function ImportXls() {
  183. openuploadwin('Excel导入', 'jformGraphreportHeadVMController.do?goImportExcel', "jformGraphreportHeadList");
  184. }
  185. //导出
  186. function ExportXls() {
  187. JeecgExcelExport("jformGraphreportHeadController.do?exportXls","jformGraphreportHeadList");
  188. }