chunk-7971aaa4.aecf3cca.js 5.0 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7971aaa4"],{"09f4":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),Math.easeInOutQuad=function(t,e,n,a){return t/=a/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(t,e,n){var i=s(),r=t-i,u=20,c=0;e="undefined"===typeof e?500:e;var l=function t(){c+=u;var s=Math.easeInOutQuad(c,i,r,e);o(s),c<e?a(t):n&&"function"===typeof n&&n()};l()}},"8ce6":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"m-container"},[t._m(0),t._v(" "),n("div",{staticClass:"m-core"},[n("div",{staticClass:"tableWrap"},[n("el-table",{staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#EDEEF0",color:"#444"},data:t.tableData}},[n("el-table-column",{attrs:{prop:"id",align:"center",label:"任务编号"}}),t._v(" "),n("el-table-column",{attrs:{prop:"description",align:"center",label:"任务名"}}),t._v(" "),n("el-table-column",{attrs:{prop:"name",align:"center",label:"英文名"}}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"timeExp",label:"表达式"}}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"modifyOn",label:"最后执行时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",[t._v("\n "+t._s(t._f("dateForMinFormat")(e.row.modifyOn))+"\n ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"status",align:"center",label:"任务状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",[t._v("\n "+t._s(t.getStatus(e.row.status))+"\n ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[1!=e.row.status&&3!=e.row.status||!t.$helpers.permission("task/pause")?t._e():n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.onPause(e.row)}}},[t._v("暂停")]),t._v(" "),1!=e.row.status&&3!=e.row.status||!t.$helpers.permission("task/execute")?t._e():n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.onExecute(e.row)}}},[t._v("执行")]),t._v(" "),0==e.row.status&&t.$helpers.permission("task/resume")?n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.onResume(e.row)}}},[t._v("恢复")]):t._e()]}}])})],1),t._v(" "),n("pagination",{attrs:{sync:"",total:t.pageInfo.total,page:t.pageInfo.page,limit:t.pageInfo.limit,"page-sizes":t.pageInfo.page_size},on:{"update:total":function(e){return t.$set(t.pageInfo,"total",e)},"update:page":function(e){return t.$set(t.pageInfo,"page",e)},"update:limit":function(e){return t.$set(t.pageInfo,"limit",e)},pagination:t.__init}})],1)])])},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h2",[n("div",{staticClass:"squrt"}),t._v("定时任务\n ")])}],s=n("333d"),i=n("b775");function r(t){return Object(i["a"])({url:"/api-task/task/list",method:"get",params:t})}function u(t){return Object(i["a"])({url:"/api-task/task/resume/"+t.taskId,method:"post"})}function c(t){return Object(i["a"])({url:"/api-task/task/execute/"+t.taskId,method:"post"})}function l(t){return Object(i["a"])({url:"/api-task/task/pause/"+t.taskId,method:"post"})}var p={components:{pagination:s["a"]},data:function(){return{tableData:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]}}},mounted:function(){this.__init()},methods:{__init:function(){var t=this;r({rows:this.pageInfo.limit,page:this.pageInfo.page}).then((function(e){if(200==e.code){var n=e.data;t.tableData=n.rows,t.pageInfo.total=n.total}}))},onPause:function(t){var e=this;this.$confirm("您确定暂停吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){l({taskId:t.id}).then((function(t){200==t.code?(e.$message.success("暂停成功"),e.__init()):e.$message.error(t.msg)}))})).catch((function(){}))},onExecute:function(t){var e=this;this.$confirm("您确定执行吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){c({taskId:t.id}).then((function(t){200==t.code?(e.$message.success("执行成功"),e.__init()):e.$message.error(t.msg)}))})).catch((function(){}))},onResume:function(t){var e=this;this.$confirm("您确定恢复吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){u({taskId:t.id}).then((function(t){200==t.code?(e.$message.success("恢复成功"),e.__init()):e.$message.error(t.msg)}))})).catch((function(){}))},getStatus:function(t){var e={0:"暂停",1:"准备就绪",2:"执行中",3:"执行成功"};return-1==t?"执行失败":e[t]}}},f=p,d=n("2877"),m=Object(d["a"])(f,a,o,!1,null,null,null);e["default"]=m.exports}}]);