1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7181874e","chunk-2505857e"],{"975e":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-card",{staticClass:"aui-card--fill",attrs:{shadow:"never"}},[a("div",{staticClass:"mod-job__schedule"},[a("search-bar",{ref:"searchBarForm",attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick}}),a("base-table",{attrs:{"table-props":t.tableProps,page:t.listQuery.page,limit:t.listQuery.limit,"table-data":t.tableData}},[t.tableBtn.length?a("method-btn",{attrs:{slot:"handleBtn",width:200,label:"操作","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"}):t._e()],1),a("pagination",{attrs:{limit:t.listQuery.limit,page:t.listQuery.page,total:t.listQuery.total},on:{"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},"update:page":function(e){return t.$set(t.listQuery,"page",e)},pagination:t.getDataList}}),a("base-dialog",{attrs:{dialogTitle:t.addOrEditTitle,dialogVisible:t.addOrUpdateVisible,"before-close":t.handleCancel},on:{cancel:t.handleCancel,confirm:t.handleConfirm}},[a("add-or-update",{ref:"addOrUpdate",on:{successSubmit:t.successSubmit}})],1),t.logVisible?a("log",{ref:"log"}):t._e()],1)])},n=[],s=(a("d81d"),a("ed26")),o=a("5959"),r=a("9fca"),l=a("12cb"),c=a("fc23"),d=[{prop:"beanName",label:l["a"].t("schedule.beanName")},{prop:"params",label:l["a"].t("schedule.params")},{prop:"cronExpression",label:l["a"].t("schedule.cronExpression")},{prop:"remark",label:l["a"].t("schedule.remark")},{prop:"status",label:l["a"].t("schedule.status"),filter:Object(c["a"])("scheduleStatus")}],u=[{type:"edit",btnName:"编辑"},{type:"pause",btnName:"暂停"},{type:"restore",btnName:"恢复"},{type:"run",btnName:"执行"},{type:"delete",btnName:"删除"}],h={mixins:[s["a"]],data:function(){return{urlOptions:{getDataListURL:"/sys/schedule/page",deleteURL:"/sys/schedule"},dataForm:{beanName:""},tableProps:d,tableBtn:u,addDeleteURL:!0,logVisible:!1,formConfig:[{type:"input",label:l["a"].t("schedule.beanName"),placeholder:l["a"].t("schedule.beanName"),param:"beanName"},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"button",btnName:"新增",name:"add",color:"primary",plain:!0},{type:"button",btnName:"日志",name:"log",color:"success"}]}},components:{AddOrUpdate:o["default"],Log:r["default"]},methods:{buttonClick:function(t){switch(t.btnName){case"search":this.listQuery.beanName=t.beanName,this.listQuery.page=1,this.getDataList();break;case"add":this.addOrEditTitle="新增",this.addOrUpdateVisible=!0,this.addOrUpdateHandle();break;case"log":this.logHandle();break;default:console.log(t)}},btnFun:function(t){"pause"===t.type?this.pauseHandle(t.data.id):"restore"===t.type?this.resumeHandle(t.data.id):this.runHandle(t.data.id)},pauseHandle:function(t){var e=this;if(!t&&this.dataListSelections.length<=0)return this.$message({message:this.$t("prompt.deleteBatch"),type:"warning",duration:500});this.$confirm(this.$t("prompt.info",{handle:this.$t("schedule.pause")}),this.$t("prompt.title"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),type:"warning"}).then((function(){e.$http.put("/sys/schedule/pause",t?[t]:e.dataListSelections.map((function(t){return t.id}))).then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.$message({message:e.$t("prompt.success"),type:"success",duration:500,onClose:function(){e.getDataList()}})})).catch((function(){}))})).catch((function(){}))},resumeHandle:function(t){var e=this;if(!t&&this.dataListSelections.length<=0)return this.$message({message:this.$t("prompt.deleteBatch"),type:"warning",duration:500});this.$confirm(this.$t("prompt.info",{handle:this.$t("schedule.resume")}),this.$t("prompt.title"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),type:"warning"}).then((function(){e.$http.put("/sys/schedule/resume",t?[t]:e.dataListSelections.map((function(t){return t.id}))).then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.$message({message:e.$t("prompt.success"),type:"success",duration:500,onClose:function(){e.getDataList()}})})).catch((function(){}))})).catch((function(){}))},runHandle:function(t){var e=this;if(!t&&this.dataListSelections.length<=0)return this.$message({message:this.$t("prompt.deleteBatch"),type:"warning",duration:500});this.$confirm(this.$t("prompt.info",{handle:this.$t("schedule.run")}),this.$t("prompt.title"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),type:"warning"}).then((function(){e.$http.put("/sys/schedule/run",t?[t]:e.dataListSelections.map((function(t){return t.id}))).then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.$message({message:e.$t("prompt.success"),type:"success",duration:500,onClose:function(){e.getDataList()}})})).catch((function(){}))})).catch((function(){}))},logHandle:function(){var t=this;this.logVisible=!0,this.$nextTick((function(){t.$refs.log.init()}))}}},p=h,m=a("2877"),g=Object(m["a"])(p,i,n,!1,null,null,null);e["default"]=g.exports},"9fca":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{visible:t.visible,title:t.$t("schedule.log"),"close-on-click-modal":!1,"close-on-press-escape":!1,width:"75%"},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{attrs:{inline:!0,model:t.dataForm},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getDataList()}}},[a("el-form-item",[a("el-input",{attrs:{placeholder:t.$t("schedule.jobId"),clearable:""},model:{value:t.dataForm.jobId,callback:function(e){t.$set(t.dataForm,"jobId",e)},expression:"dataForm.jobId"}})],1),a("el-form-item",[a("el-button",{on:{click:function(e){return t.getDataList()}}},[t._v(t._s(t.$t("query")))])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.dataListLoading,expression:"dataListLoading"}],staticStyle:{width:"100%"},attrs:{data:t.dataList,border:"",height:"460"},on:{"sort-change":t.dataListSortChangeHandle}},[a("el-table-column",{attrs:{prop:"jobId",label:t.$t("schedule.jobId"),"header-align":"center",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"beanName",label:t.$t("schedule.beanName"),"header-align":"center",align:"center"}}),a("el-table-column",{attrs:{prop:"params",label:t.$t("schedule.params"),"header-align":"center",align:"center"}}),a("el-table-column",{attrs:{prop:"status",label:t.$t("schedule.status"),"header-align":"center",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[1===e.row.status?a("el-tag",{attrs:{size:"small"}},[t._v(t._s(t.$t("schedule.statusLog1")))]):a("el-tag",{staticStyle:{cursor:"pointer"},attrs:{type:"danger",size:"small"},nativeOn:{click:function(a){return t.showErrorInfo(e.row.id)}}},[t._v(t._s(t.$t("schedule.statusLog0")))])]}}])}),a("el-table-column",{attrs:{prop:"times",label:t.$t("schedule.times"),"header-align":"center",align:"center"}}),a("el-table-column",{attrs:{prop:"createDate",label:t.$t("schedule.createDate"),"header-align":"center",align:"center",width:"180"}})],1),a("el-pagination",{attrs:{"current-page":t.page,"page-sizes":[10,20,50,100],"page-size":t.limit,total:t.total,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":t.pageSizeChangeHandle,"current-change":t.pageCurrentChangeHandle}})],1)},n=[],s=a("e1a5"),o={mixins:[s["a"]],data:function(){return{visible:!1,mixinViewModuleOptions:{getDataListURL:"/sys/scheduleLog/page",getDataListIsPage:!0},dataForm:{jobId:""}}},methods:{init:function(){this.visible=!0,this.getDataList()},showErrorInfo:function(t){var e=this;this.$http.get("/sys/scheduleLog/".concat(t)).then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.$alert(a.data.error)})).catch((function(){}))}}},r=o,l=a("2877"),c=Object(l["a"])(r,i,n,!1,null,null,null);e["default"]=c.exports},e1a5:function(t,e,a){"use strict";a("99af"),a("4de4"),a("d81d"),a("b0c0"),a("ac1f"),a("5319");var i=a("5530"),n=a("a78e"),s=a.n(n),o=a("4328"),r=a.n(o);e["a"]={data:function(){return{mixinViewModuleOptions:{createdIsNeed:!0,activatedIsNeed:!1,getDataListURL:"",getDataListIsPage:!1,deleteURL:"",deleteIsBatch:!1,deleteIsBatchKey:"id",exportURL:""},dataForm:{},dataList:[],order:"",orderField:"",page:1,limit:10,total:0,dataListLoading:!1,dataListSelections:[],addOrUpdateVisible:!1}},created:function(){this.mixinViewModuleOptions.createdIsNeed&&this.query()},activated:function(){this.mixinViewModuleOptions.activatedIsNeed&&this.query()},methods:{query:function(){var t=this;this.dataListLoading=!0,this.$http.get(this.mixinViewModuleOptions.getDataListURL,{params:Object(i["a"])({order:this.order?this.order:null,orderField:this.orderField?this.orderField:null,page:this.mixinViewModuleOptions.getDataListIsPage?this.page:null,limit:this.mixinViewModuleOptions.getDataListIsPage?this.limit:null},this.dataForm)}).then((function(e){var a=e.data;if(t.dataListLoading=!1,0!==a.code)return t.dataList=[],t.total=0,t.$message.error(a.msg);t.dataList=t.mixinViewModuleOptions.getDataListIsPage?a.data.list:a.data,t.total=t.mixinViewModuleOptions.getDataListIsPage?a.data.total:0})).catch((function(){t.dataListLoading=!1}))},dataListSelectionChangeHandle:function(t){this.dataListSelections=t},dataListSortChangeHandle:function(t){if(!t.order||!t.prop)return this.order="",this.orderField="",!1;this.order=t.order.replace(/ending$/,""),this.orderField=t.prop.replace(/([A-Z])/g,"_$1").toLowerCase(),this.query()},pageSizeChangeHandle:function(t){this.page=1,this.limit=t,this.query()},pageCurrentChangeHandle:function(t){this.page=t,this.query()},getDataList:function(){this.page=1,this.query()},addOrUpdateHandle:function(t){var e=this;this.addOrUpdateVisible=!0,this.$nextTick((function(){e.$refs.addOrUpdate.dataForm.id=t,e.$refs.addOrUpdate.init()}))},closeCurrentTab:function(t){var e=this.$store.state.contentTabsActiveName;if(this.$store.state.contentTabs=this.$store.state.contentTabs.filter((function(t){return t.name!==e})),this.$store.state.contentTabs.length<=0)return this.$store.state.sidebarMenuActiveName=this.$store.state.contentTabsActiveName="home",!1;e===this.$store.state.contentTabsActiveName&&this.$router.push({name:this.$store.state.contentTabs[this.$store.state.contentTabs.length-1].name})},deleteHandle:function(t){var e=this;if(this.mixinViewModuleOptions.deleteIsBatch&&!t&&this.dataListSelections.length<=0)return this.$message({message:this.$t("prompt.deleteBatch"),type:"warning",duration:500});this.$confirm(this.$t("prompt.info",{handle:this.$t("delete")}),this.$t("prompt.title"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),type:"warning"}).then((function(){e.$http.delete("".concat(e.mixinViewModuleOptions.deleteURL).concat(e.mixinViewModuleOptions.deleteIsBatch?"":"/"+t),e.mixinViewModuleOptions.deleteIsBatch?{data:t?[t]:e.dataListSelections.map((function(t){return t[e.mixinViewModuleOptions.deleteIsBatchKey]}))}:{}).then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.$message({message:e.$t("prompt.success"),type:"success",duration:500,onClose:function(){e.query()}})})).catch((function(){}))})).catch((function(){}))},exportHandle:function(){var t=r.a.stringify(Object(i["a"])({token:s.a.get("token")},this.dataForm));window.location.href="".concat(window.SITE_CONFIG["apiURL"]).concat(this.mixinViewModuleOptions.exportURL,"?").concat(t)}}}},fc23:function(t,e,a){"use strict";var i=a("12cb"),n={sex:{0:"男",1:"女"},userStatus:{0:i["a"].t("user.status0"),1:i["a"].t("user.status1")},menuType:{0:i["a"].t("menu.type0"),1:i["a"].t("menu.type1")},logOperation:{0:i["a"].t("logLogin.operation0"),1:i["a"].t("logLogin.operation1")},logStatus:{0:i["a"].t("logLogin.status0"),1:i["a"].t("logLogin.status1")},scheduleStatus:{0:i["a"].t("schedule.status0"),1:i["a"].t("schedule.status1")}};e["a"]=function(t){return function(e){var a;return null===n||void 0===n||null===(a=n[t])||void 0===a?void 0:a[e]}}}}]); |