1eeef22cccbed2d519ba7410b1ce5a9d90c64ff4.svn-base 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /**
  2. * 功能:
  3. *
  4. *
  5. * @author
  6. * @date 2015/10/12
  7. */
  8. QuartzTaskManagerManage = function() {
  9. /**定义变量**/
  10. var _this = this;
  11. _this.listGrid = null;//数据列表
  12. $queryForm = null;//查询区域表单
  13. $queryForm = null;//查询区域表单
  14. $searchButt = null;//查询按钮
  15. $more = null;//更多
  16. _this.loadParams = null;//列表加载参数
  17. _this.exportParams = null;//导出EXCEL参数
  18. /**私有方法**/
  19. /***新增信息***/
  20. _this.addForm = function(){
  21. $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/task/QuartzTaskAddEdit.jsp?fd_id=');
  22. };
  23. /***修改信息***/
  24. _this.editForm = function(){
  25. var rows = _this.listGrid.getSelectedRows();
  26. var rowsLength = rows.length;
  27. if (rowsLength == 0) {
  28. top.Dialog.alert("请选中要修改的记录!");
  29. return;
  30. } else if (rowsLength > 1) {
  31. top.Dialog.alert("请选中一条要修改的记录!");
  32. return;
  33. } else {
  34. var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID371;
  35. $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/task/QuartzTaskAddEdit.jsp?fd_id='+fd_id);
  36. }
  37. };
  38. /***删除信息***/
  39. _this.del = function(){
  40. var rows = _this.listGrid.getSelectedRows();
  41. var rowsLength = rows.length;
  42. if (rowsLength == 0) {
  43. top.Dialog.alert("请选中要删除的记录!");
  44. return;
  45. }
  46. var ids = "";
  47. for ( var i = 0; i < rowsLength; i++) {
  48. ids += rows[i].FD_OBJECTID371 + ",";
  49. }
  50. var url = $.pathname() +"/ws/crud/CRUDService/delete/";
  51. var params = {
  52. objectIDs : ids,
  53. classid : 371
  54. };
  55. top.Dialog.confirm("确定要删除吗?|删除", function() {
  56. $.request.del(url,params,function(result){
  57. if (result.Msg.sucsess == true) {
  58. top.Dialog.alert("删除成功!");
  59. // 刷新表格数据
  60. _this.listGrid.loadData();
  61. } else {
  62. top.Dialog.alert("删除失败!");
  63. }
  64. });
  65. });
  66. };
  67. /****查看详细信息****/
  68. _this.showInfo = function(){
  69. var rows = _this.listGrid.getSelectedRows();
  70. var rowsLength = rows.length;
  71. if (rowsLength == 0) {
  72. top.Dialog.alert("请选中要查看的记录!");
  73. return;
  74. } else if (rowsLength > 1) {
  75. top.Dialog.alert("请选中一条要查看的记录!");
  76. return;
  77. } else {
  78. var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID371;
  79. $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/task/QuartzTaskInfo.jsp?fd_id='+fd_id);
  80. }
  81. };
  82. //导出excel
  83. _this.exportData = function(){
  84. excelExport(371,_this.exportParams,"定时任务管理",['IS_DEL']);
  85. };
  86. //查询
  87. function search(obj){
  88. var queryFormValue = $queryForm.serialize();
  89. var val = queryFormValue.split("&");
  90. var coun = 0;
  91. for(var i=0 ;i<val.length;i++){
  92. if(val[i].split("=")[1].trim()!=null&&val[i].split("=")[1].trim()!=''){
  93. coun++;
  94. }
  95. }
  96. var valid = coun>0 ? true : false;
  97. if(obj != undefined) valid = true;
  98. if(valid){
  99. var queryParams = getQueryFormParams($queryForm);
  100. var params = concatJson({}, [_this.loadParams,queryParams]);
  101. _this.exportParams = params;
  102. _this.listGrid.setOptions( {
  103. params : params
  104. });
  105. //页号重置为1
  106. _this.listGrid.setNewPage(1);
  107. _this.listGrid.loadData();//加载数据
  108. }
  109. }
  110. //更多
  111. function more(){
  112. $('#moreDiv').toggle();
  113. }
  114. return {
  115. init : function() {
  116. $queryForm = $("#queryForm");
  117. /**绑定查询面板的按钮点击事件**/
  118. $searchButt = $("#searchButt");//查询按钮
  119. $searchButt.bind('click',function(){
  120. search();
  121. });
  122. //列表加载参数
  123. _this.loadParams = {
  124. listId : '371',
  125. condition : 'is_del=0'
  126. };
  127. _this.exportParams = _this.loadParams;
  128. /**grid载入数据**/
  129. _this.listGrid = $("#dataGrid").quiGrid({
  130. //title : "定时任务管理数据列表",
  131. columns : [
  132. {
  133. name : 'FD_OBJECTID371',
  134. display : '主键',
  135. align : 'center',
  136. hide : true
  137. },
  138. {
  139. name : 'TASK_NAME_371',
  140. display : '任务名称',
  141. align : 'center'
  142. },
  143. {
  144. name : 'TASK_JOB_371',
  145. display : '任务执行类',
  146. align : 'center'
  147. },
  148. {
  149. name : 'CRON_371',
  150. display : '表达式',
  151. align : 'center'
  152. },
  153. {
  154. name : 'END_TIME_371',
  155. display : '截止时间',
  156. align : 'center'
  157. }],
  158. url : $.pathname() + '/ws/crud/CRUDService/queryQui',
  159. params : _this.loadParams,
  160. sortName : 'updatedate',
  161. sortOrder : 'desc',//asc
  162. rownumbers : true,
  163. checkbox : true,
  164. height : "100%",
  165. width : "100%",
  166. pageSize : 10,
  167. percentWidthMode : true,
  168. toolbar : {
  169. items : [ {
  170. text : '新增',
  171. click : _this.addForm,
  172. iconClass : 'icon_add'
  173. }, {
  174. line : true
  175. }, {
  176. line : true
  177. }, {
  178. text : '删除',
  179. click : _this.del,
  180. iconClass : 'icon_delete'
  181. }, {
  182. text : '修改',
  183. click : _this.editForm,
  184. iconClass : 'icon_edit'
  185. }, {
  186. line : true
  187. }, {
  188. text : '查看',
  189. click : _this.showInfo,
  190. iconClass : 'icon_list'
  191. }, {
  192. line : true
  193. }, {
  194. text : '导出',
  195. click : _this.exportData,
  196. iconClass : 'icon_export'
  197. } ]
  198. }
  199. });
  200. }
  201. };
  202. }();
  203. $(function() {
  204. QuartzTaskManagerManage.init();
  205. });