1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-51735418"],{"434c":function(e,t,r){},"474d":function(e,t,r){"use strict";r("434c")},"6e0b":function(e,t,r){"use strict";r.d(t,"e",(function(){return l})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return n})),r.d(t,"f",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"d",(function(){return s}));var o=r("b775");function l(e){return Object(o["a"])({url:"/job/group/list",method:"get",params:e})}function a(e){return Object(o["a"])({url:"/job/group/"+e,method:"get"})}function n(e){return Object(o["a"])({url:"/job/group/add",method:"post",data:e})}function i(e){return Object(o["a"])({url:"/job/group/edit",method:"put",data:e})}function u(e){return Object(o["a"])({url:"/job/group/"+e,method:"delete"})}function s(e){return Object(o["a"])({url:"/job/group/getSelectAll",method:"get",params:e})}},b97d:function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-container"},[r("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"85px"}},[r("el-form-item",{attrs:{label:"执行器",prop:"jobGroup"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.queryParams.jobGroup,callback:function(t){e.$set(e.queryParams,"jobGroup",t)},expression:"queryParams.jobGroup"}},e._l(e.jobGroupOptions,(function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})})),1)],1),r("el-form-item",{attrs:{label:"运行状态",prop:"triggerStatus"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.queryParams.triggerStatus,callback:function(t){e.$set(e.queryParams,"triggerStatus",t)},expression:"queryParams.triggerStatus"}},e._l(e.dict.type.sys_job_trigger_status,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),r("el-form-item",{attrs:{label:"任务描述",prop:"jobDesc"}},[r("el-input",{attrs:{placeholder:"请输入任务描述",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.jobDesc,callback:function(t){e.$set(e.queryParams,"jobDesc",t)},expression:"queryParams.jobDesc"}})],1),r("el-form-item",{attrs:{label:"JobHandler",prop:"executorHandler"}},[r("el-input",{attrs:{placeholder:"请输入JobHandler",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.executorHandler,callback:function(t){e.$set(e.queryParams,"executorHandler",t)},expression:"queryParams.executorHandler"}})],1),r("el-form-item",{attrs:{label:"负责人",prop:"author"}},[r("el-input",{attrs:{placeholder:"请输入负责人",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.author,callback:function(t){e.$set(e.queryParams,"author",t)},expression:"queryParams.author"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),r("el-row",{staticClass:"mb8",attrs:{gutter:10}},[r("el-col",{attrs:{span:1.5}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:add"],expression:"['job:info:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),r("el-col",{attrs:{span:1.5}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:remove"],expression:"['job:info:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),r("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.infoList},on:{"selection-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),r("el-table-column",{attrs:{label:"任务ID",align:"center",prop:"jobGroup"}}),r("el-table-column",{attrs:{label:"任务描述",align:"center",prop:"jobDesc"}}),r("el-table-column",{attrs:{label:"调度类型",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.scheduleType+":"+t.row.scheduleConf)+" ")]}}])}),r("el-table-column",{attrs:{label:"运行模式",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.glueType+":"+t.row.executorHandler)+" ")]}}])}),r("el-table-column",{attrs:{label:"负责人",align:"center",prop:"author"}}),r("el-table-column",{attrs:{label:"状态",align:"center",prop:"triggerStatus"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("dict-tag",{attrs:{options:e.dict.type.sys_job_trigger_status,value:t.row.triggerStatus}})]}}])}),r("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:trigger"],expression:"['job:info:trigger']"}],attrs:{size:"mini",type:"text",icon:"el-icon-caret-right"},on:{click:function(r){return e.executeOnce(t.row)}}},[e._v("执行一次")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:edit"],expression:"['job:info:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(r){return e.handleUpdate(t.row)}}},[e._v("修改")]),0===t.row.triggerStatus?r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:start"],expression:"['job:info:start']"}],attrs:{size:"mini",type:"text",icon:"el-icon-video-play"},on:{click:function(r){return e.start(t.row)}}},[e._v("开启")]):e._e(),1===t.row.triggerStatus?r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:stop"],expression:"['job:info:stop']"}],attrs:{size:"mini",type:"text",icon:"el-icon-video-pause"},on:{click:function(r){return e.stop(t.row)}}},[e._v("停止")]):e._e(),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:copy"],expression:"['job:info:copy']"}],attrs:{size:"mini",type:"text",icon:"el-icon-document-copy"},on:{click:function(r){return e.copy(t.row)}}},[e._v("复制")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["job:info:nextTriggerTime"],expression:"['job:info:nextTriggerTime']"}],attrs:{size:"mini",type:"text",icon:"el-icon-view"},on:{click:function(r){return e.viewNextTriggerTime(t.row)}}},[e._v("查看下次执行时间")])]}}])})],1),r("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),r("el-dialog",{attrs:{title:e.title,visible:e.open,width:"1000px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[r("p",{staticClass:"form-left-title"},[e._v("基础配置")]),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"执行器",prop:"jobGroup"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.jobGroup,callback:function(t){e.$set(e.form,"jobGroup",t)},expression:"form.jobGroup"}},e._l(e.jobGroupOptions,(function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})})),1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"任务描述",prop:"jobDesc"}},[r("el-input",{attrs:{placeholder:"请输入任务描述"},model:{value:e.form.jobDesc,callback:function(t){e.$set(e.form,"jobDesc",t)},expression:"form.jobDesc"}})],1)],1)],1),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"负责人",prop:"author"}},[r("el-input",{attrs:{placeholder:"请输入负责人姓名"},model:{value:e.form.author,callback:function(t){e.$set(e.form,"author",t)},expression:"form.author"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"报警邮件",prop:"alarmEmail"}},[r("el-input",{attrs:{placeholder:"请输入报警邮件地址,多个邮件则逗号分开"},model:{value:e.form.alarmEmail,callback:function(t){e.$set(e.form,"alarmEmail",t)},expression:"form.alarmEmail"}})],1)],1)],1),r("p",{staticClass:"form-left-title"},[e._v("调度配置")]),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"调度类型",prop:"scheduleType"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.scheduleType,callback:function(t){e.$set(e.form,"scheduleType",t)},expression:"form.scheduleType"}},e._l(e.dict.type.sys_job_schedule_type,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),r("el-col",{attrs:{span:12}},["CRON"===e.form.scheduleType?r("el-form-item",{attrs:{label:"Cron",prop:"scheduleConf"}},[r("el-input",{attrs:{placeholder:"cron表达式"},model:{value:e.form.scheduleConf,callback:function(t){e.$set(e.form,"scheduleConf",t)},expression:"form.scheduleConf"}})],1):e._e()],1)],1),r("p",{staticClass:"form-left-title"},[e._v("任务配置")]),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"运行模式",prop:"glueType"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.glueType,callback:function(t){e.$set(e.form,"glueType",t)},expression:"form.glueType"}},e._l(e.dict.type.sys_job_glue_type,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"JobHandler",prop:"executorHandler"}},[r("el-input",{attrs:{disabled:"BEAN"!==e.form.glueType,placeholder:"请输入JobHandler"},model:{value:e.form.executorHandler,callback:function(t){e.$set(e.form,"executorHandler",t)},expression:"form.executorHandler"}})],1)],1)],1),r("el-row",[r("el-col",{attrs:{span:24}},[r("el-form-item",{attrs:{label:"任务参数"}},[r("el-input",{attrs:{type:"textarea"},model:{value:e.form.executorParam,callback:function(t){e.$set(e.form,"executorParam",t)},expression:"form.executorParam"}})],1)],1)],1),r("p",{staticClass:"form-left-title"},[e._v("高级配置")]),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"路由策略",prop:"executorRouteStrategy"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.executorRouteStrategy,callback:function(t){e.$set(e.form,"executorRouteStrategy",t)},expression:"form.executorRouteStrategy"}},e._l(e.dict.type.sys_job_executor_route_strategy,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"子任务ID",prop:"childJobId"}},[r("el-input",{attrs:{placeholder:"请输入子任务ID"},model:{value:e.form.childJobId,callback:function(t){e.$set(e.form,"childJobId",t)},expression:"form.childJobId"}})],1)],1)],1),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"调度过期策略",prop:"misfireStrategy"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.misfireStrategy,callback:function(t){e.$set(e.form,"misfireStrategy",t)},expression:"form.misfireStrategy"}},e._l(e.dict.type.sys_job_misfire_strategy,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"阻塞处理策略",prop:"executorBlockStrategy"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.executorBlockStrategy,callback:function(t){e.$set(e.form,"executorBlockStrategy",t)},expression:"form.executorBlockStrategy"}},e._l(e.dict.type.sys_job_executor_block_strategy,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"任务超时时间",prop:"executorTimeout"}},[r("el-input",{attrs:{placeholder:"任务超时时间,单位秒,大于零时生效"},model:{value:e.form.executorTimeout,callback:function(t){e.$set(e.form,"executorTimeout",t)},expression:"form.executorTimeout"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"失败重试次数",prop:"executorFailRetryCount"}},[r("el-input",{attrs:{placeholder:"失败重试次数,大于零时生效"},model:{value:e.form.executorFailRetryCount,callback:function(t){e.$set(e.form,"executorFailRetryCount",t)},expression:"form.executorFailRetryCount"}})],1)],1)],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),r("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1),r("el-dialog",{attrs:{title:e.executeOnceTitle,visible:e.executeOnceOpen,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.executeOnceOpen=t}}},[r("el-form",{ref:"form",attrs:{model:e.executeOnceForm,rules:e.executeOnceRules,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"任务参数",prop:"executorParam"}},[r("el-input",{attrs:{placeholder:"请输入任务参数"},model:{value:e.executeOnceForm.executorParam,callback:function(t){e.$set(e.executeOnceForm,"executorParam",t)},expression:"executeOnceForm.executorParam"}})],1),r("el-form-item",{attrs:{label:"机器地址",prop:"jobDesc"}},[r("el-input",{attrs:{placeholder:"请输入本次执行的机器地址,为空则从执行器获取"},model:{value:e.executeOnceForm.jobDesc,callback:function(t){e.$set(e.executeOnceForm,"jobDesc",t)},expression:"executeOnceForm.jobDesc"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:e.executeOnceSubmitForm}},[e._v("确 定")]),r("el-button",{on:{click:e.executeOnceCancel}},[e._v("取 消")])],1)],1)],1)},l=[],a=r("5530"),n=(r("d81d"),r("b775"));function i(e){return Object(n["a"])({url:"/job/info/list",method:"get",params:e})}function u(e){return Object(n["a"])({url:"/job/info/"+e,method:"get"})}function s(e){return Object(n["a"])({url:"/job/info/add",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/job/info",method:"put",data:e})}function m(e){return Object(n["a"])({url:"/job/info/"+e,method:"delete"})}function p(e){return Object(n["a"])({url:"/job/info/trigger",method:"post",data:e})}function d(e){return Object(n["a"])({url:"/job/group/"+e,method:"get"})}function f(e){return Object(n["a"])({url:"/job/info/start/"+e,method:"get"})}function b(e){return Object(n["a"])({url:"/job/info/stop/"+e,method:"get"})}function g(e){return Object(n["a"])({url:"/job/info/nextTriggerTime",method:"post",data:e})}var h=r("6e0b"),y=r("2da1"),x={name:"Info",dicts:["sys_job_trigger_status","sys_job_schedule_type","sys_job_glue_type","sys_job_executor_route_strategy","sys_job_misfire_strategy","sys_job_executor_block_strategy"],data:function(){return{jobGroupOptions:[],currItem:{},executeOnceRules:{executorParam:[],jobDesc:[]},executeOnceForm:{jobGroup:null},executeOnceTitle:"执行一次",executeOnceOpen:!1,loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,infoList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,jobGroup:null,jobDesc:null,addTime:null,author:null,alarmEmail:null,scheduleType:null,scheduleConf:null,misfireStrategy:null,executorRouteStrategy:null,executorHandler:null,executorParam:null,executorBlockStrategy:null,executorTimeout:null,executorFailRetryCount:null,glueType:null,glueSource:null,glueRemark:null,glueUpdatetime:null,childJobid:null,triggerStatus:null,triggerLastTime:null,triggerNextTime:null,tenantId:null},form:{jobGroup:null},rules:{jobGroup:[{required:!0,message:"请选择执行器",trigger:"blur"}],jobDesc:[{required:!0,message:"任务描述必填",trigger:"blur"}],author:[{required:!0,message:"负责人必填",trigger:"blur"}],alarmEmail:[{required:!0,message:"报警邮件必填",trigger:"blur"}],scheduleType:[{required:!0,message:"请选择调度类型",trigger:"blur"}],scheduleConf:[{required:!0,message:"调度配置必填",trigger:"blur"}],glueType:[{required:!0,message:"请选择运行模式",trigger:"blur"}],executorHandler:[{required:!0,message:"执行器任务handler必填",trigger:"blur"}],executorRouteStrategy:[{required:!0,message:"请选择路由策略",trigger:"blur"}],misfireStrategy:[{required:!0,message:"请选择调度过期策略",trigger:"blur"}],executorBlockStrategy:[{required:!0,message:"请选择阻塞处理策略",trigger:"blur"}],executorTimeout:[{required:!0,message:"任务超时时间必填",trigger:"blur"}],executorFailRetryCount:[{required:!0,message:"失败重试次数必填",trigger:"blur"}]}}},created:function(){this.getList(),this.initPageDicData()},methods:{copy:function(e){var t=this;this.reset();var r=e.id||this.ids;u(r).then((function(e){t.form=e.data,t.form.id=null,t.open=!0,t.title="新增"}))},initPageDicData:function(){var e=this;this.jobGroupOptions=[],Object(h["d"])({title:""}).then((function(t){e.jobGroupOptions=t.data}))},viewNextTriggerTime:function(e){var t=this;g({scheduleType:e.scheduleType,scheduleConf:e.scheduleConf}).then((function(e){console.log("查看下次执行时间",e),200===e.code?t.$modal.msg("下次执行时间:\n"+e.data):t.$modal.msgError(e.data)}))},stop:function(e){var t=this,r=e.id;b(r).then((function(e){console.log("停止",e),t.$modal.msgSuccess("操作成功"),t.handleQuery()}))},start:function(e){var t=this,r=e.id;f(r).then((function(e){t.$modal.msgSuccess("操作成功"),console.log("开启",e),t.handleQuery()}))},viewRegisterNode:function(e){var t=e.id;d(t).then((function(e){console.log("注册节点",e)}))},executeOnceCancel:function(){console.log("弹框关闭"),this.executeOnceOpen=!1},executeOnceSubmitForm:function(){var e=this;console.log("弹框提交");var t={id:this.currItem.id,executorParam:"",executorAddress:""};p(t).then((function(t){e.$modal.msgSuccess("执行成功"),e.executeOnceOpen=!1}))},executeOnce:function(e){console.log("执行一次",e),this.currItem=e,this.executeOnceOpen=!0},viewLog:function(e){console.log("查询日志",e),this.$store.dispatch("log")},getList:function(){var e=this;this.loading=!0,i(this.queryParams).then((function(t){e.infoList=t.data,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,jobGroup:null,jobDesc:null,addTime:null,updateTime:null,author:null,alarmEmail:null,scheduleType:null,scheduleConf:null,misfireStrategy:null,executorRouteStrategy:null,executorHandler:null,executorParam:null,executorBlockStrategy:null,executorTimeout:null,executorFailRetryCount:null,glueType:null,glueSource:null,glueRemark:null,glueUpdatetime:null,childJobid:null,triggerStatus:0,triggerLastTime:null,triggerNextTime:null,tenantId:null},this.resetForm("form")},resetExecuteOnceForm:function(){this.executeOnceForm={jobGroup:null,jobDesc:null},this.resetForm("queryForm")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="新增"},handleUpdate:function(e){var t=this;this.reset();var r=e.id||this.ids;u(r).then((function(e){t.form=e.data,t.open=!0,t.title="修改任务"}))},submitForm:function(){var e=this,t=this;t.$refs["form"].validate((function(r){r&&(null!=t.form.id?c(e.form).then((function(e){t.$modal.msgSuccess("修改成功"),t.open=!1,t.getList()})):s(t.form).then((function(e){t.$modal.msgSuccess("新增成功"),t.open=!1,t.getList()})))}))},handleDelete:function(e){var t=this,r=e.id||this.ids;this.$modal.confirm("是否确认删除当前任务数据项?").then((function(){return m(r)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("job/info/export",Object(a["a"])({},this.queryParams),"任务_".concat(Object(y["f"])((new Date).getTime(),"{y}-{m}-{d}"),".xlsx"))}}},v=x,j=(r("474d"),r("2877")),_=Object(j["a"])(v,o,l,!1,null,null,null);t["default"]=_.exports}}]);
|