lepu-test-platform-web/dist/static/js/17.ec280eeaeab92a78bac8.js

2 lines
13 KiB
JavaScript

webpackJsonp([17],{ZRZU:function(e,t){},aoBN:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a("mvHQ"),i=a.n(o),l={data:function(){return{taskOptions:[{id:1,name:"接口任务",value:"InterfaceTestTask"},{id:2,name:"性能任务",value:"PerformanceTestTask"}],detailForm:{},editForm:{},queryInfo:{jobName:"",pageNum:1,pageSize:10},taskList:[],currpage:1,total:0,addDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,jobStatusFlag:!1,addForm:{jobName:"",cronExpression:"",beanClass:"",jobGroup:"",jobStatus:"",createTime:"",createPerson:JSON.parse(localStorage.getItem("userInfo")).nick,comments:""},addFormRules:{jobName:[{required:!0,message:"请输入任务名",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符",trigger:"blur"}],beanClass:[{required:!0,message:"请选择",trigger:"blur"}],cronExpression:[{required:!0,message:"请输入CRON表达式",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],jobStatus:[{required:!0,message:"请输入任务状态",trigger:"blur"},{min:1,max:10,message:"长度在 1 到 10 个字符",trigger:"blur"}],comments:[{required:!1,message:"请输入备注信息",trigger:"blur"},{min:0,max:200,message:"长度在 0 到 200 个字符",trigger:"blur"}]}}},mounted:function(){},created:function(){this.getTaskList()},methods:{helpCronExpression:function(){this.$notify({title:"https://cron.qqe2.com/",message:'<li><span style="color: green;">每隔5秒钟执行一次</span></li>*/5 * * * * ?\n <li><span style="color: green;">每隔1分钟执行一次</span></li>0 */1 * * * ?\n <li><span style="color: green;">每天23点执行一次</span></li>0 0 23 * * ?\n <li><span style="color: green;">每天凌晨1点执行一次</span></li>0 0 1 * * ?\n <li><span style="color: green;">每月1号凌晨1点执行一次</span></li>0 0 1 1 * ?\n <li><span style="color: green;">每月最后一天23点执行一次</span></li>0 0 23 L * ?\n <li><span style="color: green;">每周星期天凌晨1点执行一次</span></li>0 0 1 ? * L\n <li><span style="color: green;">在26分/29分/33分都执行一次</span></li>0 26,29,33 * * * ?\n <li><span style="color: green;">在0点/13点/18点/21点都执行一次</span></li>0 0 0,13,18,21 * * ?',offset:10,duration:0,dangerouslyUseHTMLString:!0})},changeJobStatus:function(e){var t=this,a={};a.id=e.id,a.jobStatus=e.jobStatus,this.$api.task.updateTaskManagerStatus(i()(a)).then(function(e){t.$notify({type:"success",message:e.data.msg})}).catch(function(){})},selectTaskList:function(){this.queryInfo.pageNum=1,this.total=0,this.getTaskList()},getTaskList:function(){var e=this;this.loading=!0,this.$api.task.queryAllTaskManagerInfo(i()(this.queryInfo)).then(function(t){e.loading=!1,e.taskList=t.data.data,e.total=t.data.count,e.queryInfo.pageNum=1}).catch(function(){e.loading=!1})},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getTaskList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getTaskList()},addDialogClose:function(){this.$refs.addFormRef.resetFields()},addTask:function(){var e=this;this.$refs.addFormRef.validate(function(t){t&&e.$api.task.addTaskManager(i()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.addDialogVisible=!1,e.getTaskList()}).catch(function(){e.loading=!1})})},editDialogClose:function(){this.$refs.editFormRef.resetFields()},showEditDialog:function(e){var t=this;this.editDialogVisible=!0,this.$api.task.queryTaskManagerById(e).then(function(e){t.loading=!1,t.editForm=e.data.data}).catch(function(){t.loading=!1})},editTask:function(){var e=this;this.$refs.editFormRef.validate(function(t){t&&(e.editForm.updatePerson=JSON.parse(localStorage.getItem("userInfo")).nick,e.$api.task.updateTaskManager(i()(e.editForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.editDialogVisible=!1,e.getTaskList()}).catch(function(){e.loading=!1}))})},showDetailDialog:function(e){var t=this;this.detailDialogVisible=!0,this.$api.task.queryTaskManagerById(e).then(function(e){t.loading=!1,t.detailForm=e.data.data}).catch(function(){t.loading=!1})},delTask:function(e){var t=this;this.$confirm("确定删除该任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.task.deleteTaskManagerById(e).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.getTaskList()}).catch(function(){t.loading=!1})}).catch(function(){})},batchDeleteTaskManager:function(e){var t=this;this.$confirm("确定删除该任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.task.batchDeleteTaskManager(e).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.getTaskList()}).catch(function(){t.loading=!1})}).catch(function(){})}}},s={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"task-box"},[a("el-form",{staticClass:"task-form-inline",attrs:{inline:!0}},[a("el-form-item",{attrs:{label:"任务名称"}},[a("el-input",{attrs:{type:"text",placeholder:"请输入任务名称",clearable:""},model:{value:e.queryInfo.jobName,callback:function(t){e.$set(e.queryInfo,"jobName",t)},expression:"queryInfo.jobName"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.selectTaskList}},[e._v("查询")])],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:4}},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.addDialogVisible=!0}}},[e._v("添加")]),e._v(" "),a("el-button",{attrs:{icon:"el-icon-question"},on:{click:e.helpCronExpression}},[e._v("帮助")])],1)],1)],1)],1),e._v(" "),a("el-table",{attrs:{data:e.taskList.slice((e.currpage-1)*e.queryInfo.pageSize,e.currpage*e.queryInfo.pageSize),border:"",fit:!0}},[a("el-table-column",{attrs:{label:"序号",type:"index",align:"center",width:"80"}}),e._v(" "),a("el-table-column",{attrs:{label:"任务名称",prop:"jobName"}}),e._v(" "),e._e(),e._v(" "),a("el-table-column",{attrs:{label:"CRON",prop:"cronExpression",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"createTime",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{label:"创建人员",prop:"createPerson",width:"120"}}),e._v(" "),a("el-table-column",{attrs:{label:"更新时间",prop:"updateTime",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{label:"更新人员",prop:"updatePerson",width:"120"}}),e._v(" "),a("el-table-column",{attrs:{label:"备注",prop:"comments","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",fixed:"right",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["default"!=t.row.beanClass?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.showDetailDialog(t.row.id)}}},[e._v("查看")]):e._e(),e._v(" "),"default"!=t.row.beanClass?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.showEditDialog(t.row.id)}}},[e._v("编辑")]):e._e(),e._v(" "),"default"!=t.row.beanClass?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.delTask(t.row.id)}}},[e._v("删除")]):e._e()]}}])})],1),e._v(" "),a("el-pagination",{attrs:{"current-page":e.currpage,"page-sizes":[5,10,20,30],"page-size":e.queryInfo.pageSize,layout:"prev, pager, next, sizes, total, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:"添加",visible:e.addDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.addDialogVisible=t},close:e.addDialogClose}},[a("el-form",{ref:"addFormRef",attrs:{model:e.addForm,rules:e.addFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"任务类型",prop:"beanClass"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.addForm.beanClass,callback:function(t){e.$set(e.addForm,"beanClass",t)},expression:"addForm.beanClass"}},e._l(e.taskOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"任务名",prop:"jobName"}},[a("el-input",{model:{value:e.addForm.jobName,callback:function(t){e.$set(e.addForm,"jobName",t)},expression:"addForm.jobName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"CRON",prop:"cronExpression"}},[a("el-input",{model:{value:e.addForm.cronExpression,callback:function(t){e.$set(e.addForm,"cronExpression",t)},expression:"addForm.cronExpression"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"comments"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.addForm.comments,callback:function(t){e.$set(e.addForm,"comments",t)},expression:"addForm.comments"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.addDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.addTask}},[e._v("确 定")])],1)],1),e._v(" "),a("el-dialog",{attrs:{title:"修改",visible:e.editDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.editDialogVisible=t},close:e.editDialogClose}},[a("el-form",{ref:"editFormRef",attrs:{model:e.editForm,rules:e.addFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"任务名",prop:"jobName"}},[a("el-input",{model:{value:e.editForm.jobName,callback:function(t){e.$set(e.editForm,"jobName",t)},expression:"editForm.jobName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"CRON",prop:"cronExpression"}},[a("el-input",{model:{value:e.editForm.cronExpression,callback:function(t){e.$set(e.editForm,"cronExpression",t)},expression:"editForm.cronExpression"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"comments"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.editForm.comments,callback:function(t){e.$set(e.editForm,"comments",t)},expression:"editForm.comments"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.editDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.editTask}},[e._v("确 定")])],1)],1),e._v(" "),a("el-dialog",{attrs:{title:"查看",visible:e.detailDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.detailDialogVisible=t}}},[a("el-form",{attrs:{model:e.detailForm,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"任务名",prop:"jobName"}},[a("el-input",{attrs:{disabled:""},model:{value:e.detailForm.jobName,callback:function(t){e.$set(e.detailForm,"jobName",t)},expression:"detailForm.jobName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"CRON",prop:"cronExpression"}},[a("el-input",{attrs:{disabled:""},model:{value:e.detailForm.cronExpression,callback:function(t){e.$set(e.detailForm,"cronExpression",t)},expression:"detailForm.cronExpression"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"任务状态",prop:"jobStatus"}},[a("el-select",{attrs:{placeholder:"请选择",disabled:""},model:{value:e.detailForm.beanClass,callback:function(t){e.$set(e.detailForm,"beanClass",t)},expression:"detailForm.beanClass"}},e._l(e.taskOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"创建时间",prop:"createTime"}},[a("el-input",{attrs:{disabled:""},model:{value:e.detailForm.createTime,callback:function(t){e.$set(e.detailForm,"createTime",t)},expression:"detailForm.createTime"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"创建人员",prop:"createPerson"}},[a("el-input",{attrs:{disabled:""},model:{value:e.detailForm.createPerson,callback:function(t){e.$set(e.detailForm,"createPerson",t)},expression:"detailForm.createPerson"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"更新时间",prop:"updateTime"}},[a("el-input",{attrs:{disabled:""},model:{value:e.detailForm.updateTime,callback:function(t){e.$set(e.detailForm,"updateTime",t)},expression:"detailForm.updateTime"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"更新人员",prop:"updatePerson"}},[a("el-input",{attrs:{disabled:""},model:{value:e.detailForm.updatePerson,callback:function(t){e.$set(e.detailForm,"updatePerson",t)},expression:"detailForm.updatePerson"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"comments"}},[a("el-input",{attrs:{type:"textarea",disabled:""},model:{value:e.detailForm.comments,callback:function(t){e.$set(e.detailForm,"comments",t)},expression:"detailForm.comments"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.detailDialogVisible=!1}}},[e._v("取 消")])],1)],1)],1)},staticRenderFns:[]};var n=a("VU/8")(l,s,!1,function(e){a("ZRZU")},"data-v-7c51fc76",null);t.default=n.exports}});
//# sourceMappingURL=17.ec280eeaeab92a78bac8.js.map