123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- /**
- * 功能:
- *
- *
- * @author
- * @date 2015/10/12
- */
- QuartzTaskManagerManage = function() {
- /**定义变量**/
- var _this = this;
- _this.listGrid = null;//数据列表
- $queryForm = null;//查询区域表单
- $queryForm = null;//查询区域表单
- $searchButt = null;//查询按钮
- $more = null;//更多
- _this.loadParams = null;//列表加载参数
- _this.exportParams = null;//导出EXCEL参数
- /**私有方法**/
- /***新增信息***/
- _this.addForm = function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/task/QuartzTaskAddEdit.jsp?fd_id=');
- };
-
- /***修改信息***/
- _this.editForm = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要修改的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要修改的记录!");
- return;
- } else {
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID371;
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/task/QuartzTaskAddEdit.jsp?fd_id='+fd_id);
- }
- };
- /***删除信息***/
- _this.del = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID371 + ",";
- }
- var url = $.pathname() +"/ws/crud/CRUDService/delete/";
- var params = {
- objectIDs : ids,
- classid : 371
- };
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.request.del(url,params,function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- // 刷新表格数据
- _this.listGrid.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- });
- });
- };
- /****查看详细信息****/
- _this.showInfo = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要查看的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要查看的记录!");
- return;
- } else {
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID371;
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/task/QuartzTaskInfo.jsp?fd_id='+fd_id);
- }
- };
- //导出excel
- _this.exportData = function(){
- excelExport(371,_this.exportParams,"定时任务管理",['IS_DEL']);
- };
- //查询
- function search(obj){
- var queryFormValue = $queryForm.serialize();
- var val = queryFormValue.split("&");
- var coun = 0;
- for(var i=0 ;i<val.length;i++){
- if(val[i].split("=")[1].trim()!=null&&val[i].split("=")[1].trim()!=''){
- coun++;
- }
- }
- var valid = coun>0 ? true : false;
- if(obj != undefined) valid = true;
- if(valid){
- var queryParams = getQueryFormParams($queryForm);
- var params = concatJson({}, [_this.loadParams,queryParams]);
- _this.exportParams = params;
- _this.listGrid.setOptions( {
- params : params
- });
- //页号重置为1
- _this.listGrid.setNewPage(1);
- _this.listGrid.loadData();//加载数据
- }
- }
- //更多
- function more(){
- $('#moreDiv').toggle();
- }
- return {
- init : function() {
- $queryForm = $("#queryForm");
- /**绑定查询面板的按钮点击事件**/
- $searchButt = $("#searchButt");//查询按钮
- $searchButt.bind('click',function(){
- search();
- });
- //列表加载参数
- _this.loadParams = {
- listId : '371',
- condition : 'is_del=0'
- };
- _this.exportParams = _this.loadParams;
- /**grid载入数据**/
- _this.listGrid = $("#dataGrid").quiGrid({
- //title : "定时任务管理数据列表",
- columns : [
- {
- name : 'FD_OBJECTID371',
- display : '主键',
- align : 'center',
- hide : true
- },
- {
- name : 'TASK_NAME_371',
- display : '任务名称',
- align : 'center'
- },
- {
- name : 'TASK_JOB_371',
- display : '任务执行类',
- align : 'center'
- },
- {
- name : 'CRON_371',
- display : '表达式',
- align : 'center'
- },
- {
- name : 'END_TIME_371',
- display : '截止时间',
- align : 'center'
- }],
- url : $.pathname() + '/ws/crud/CRUDService/queryQui',
- params : _this.loadParams,
- sortName : 'updatedate',
- sortOrder : 'desc',//asc
- rownumbers : true,
- checkbox : true,
- height : "100%",
- width : "100%",
- pageSize : 10,
- percentWidthMode : true,
- toolbar : {
- items : [ {
- text : '新增',
- click : _this.addForm,
- iconClass : 'icon_add'
- }, {
- line : true
- }, {
- line : true
- }, {
- text : '删除',
- click : _this.del,
- iconClass : 'icon_delete'
- }, {
- text : '修改',
- click : _this.editForm,
- iconClass : 'icon_edit'
- }, {
- line : true
- }, {
- text : '查看',
- click : _this.showInfo,
- iconClass : 'icon_list'
- }, {
- line : true
- }, {
- text : '导出',
- click : _this.exportData,
- iconClass : 'icon_export'
- } ]
- }
- });
- }
- };
- }();
- $(function() {
- QuartzTaskManagerManage.init();
- });
|