(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-21ce0abe"],{"3e25":function(t,e,a){"use strict";var n=a("cebc"),l=a.n(n);l.a},5905:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticStyle:{height:"40px",float:"right","margin-left":"25px","margin-right":"20px"}},[a("el-form",{attrs:{inline:!0,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"任务名称"}},[a("el-input",{attrs:{size:"mini",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.startgettasklog(e)}},model:{value:t.logquery.name,callback:function(e){t.$set(t.logquery,"name",e)},expression:"logquery.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"执行结果"}},[a("el-select",{attrs:{size:"mini"},on:{change:t.startgettasklog},model:{value:t.logquery.status,callback:function(e){t.$set(t.logquery,"status",e)},expression:"logquery.status"}},t._l(t.statusoption,(function(t){return a("el-option",{key:t.label,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),a("el-form-item",[a("el-tooltip",{attrs:{content:"清理运行任务日志",effect:"dark",placement:"top-start"}},[a("el-button",{attrs:{type:"warning",size:"mini"},on:{click:function(e){t.cleanlogvisible=!0}}},[t._v("清理")])],1)],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"清理日志",center:"",visible:t.cleanlogvisible,width:"25%"},on:{"update:visible":function(e){t.cleanlogvisible=e}}},[a("el-form",{ref:"cleanlog",attrs:{rules:t.rules,size:"mini",model:t.cleanlog}},[a("el-form-item",{attrs:{label:"任务名称",prop:"name"}},[a("el-input",{staticStyle:{width:"70%"},attrs:{size:"mini",placeholder:"请输入需要清理的任务名称",maxlength:"30","show-word-limit":""},model:{value:t.cleanlog.name,callback:function(e){t.$set(t.cleanlog,"name",e)},expression:"cleanlog.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"清理时间",prop:"cleanpredat"}},[a("el-select",{staticStyle:{width:"70%"},attrs:{size:"mini"},model:{value:t.cleanlog.cleanpredat,callback:function(e){t.$set(t.cleanlog,"cleanpredat",e)},expression:"cleanlog.cleanpredat"}},t._l(t.cleantimeoption,(function(t){return a("el-option",{key:t.label,attrs:{label:t.label,value:t.value}})})),1)],1)],1),t._v(" "),a("p"),t._v(" "),a("div",{staticStyle:{"text-align":"center"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.startcleantask("cleanlog")}}},[t._v("确定")]),t._v(" "),a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){t.cleanlogvisible=!1}}},[t._v("取消")])],1)],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.data,stripe:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",fixed:"left",label:"任务名称","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.name))])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"开始时间","min-width":"155"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.start_timestr))])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"结束时间","min-width":"155"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.end_timestr))])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"运行时间","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.total_runtime<=1e3?a("span",[t._v(t._s(e.row.total_runtime)+"ms")]):t._e(),t._v(" "),e.row.total_runtime>1e3?a("span",[t._v(t._s(e.row.total_runtime/1e3)+"s")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"触发方式","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.trigger_str))])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"执行结果","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[1===e.row.status?a("el-tag",{attrs:{type:"success"}},[t._v("成功")]):-1===e.row.status?a("el-tag",{attrs:{type:"danger"}},[t._v("失败")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button-group",[-1===e.row.status?a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return t.gettasklogpre(e.row)}}},[t._v("详情")]):a("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(a){return t.gettasklogpre(e.row)}}},[t._v("详情")])],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{fixed:"right",type:"expand"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.status?a("div",[a("span",[a("strong",[t._v("ErrTask:")]),t._v("\n            "+t._s(e.row.err_task)+"\n          ")]),t._v(" "),a("el-divider"),t._v(" "),a("span",[a("strong",[t._v("ErrCode:")]),t._v("\n            "+t._s(e.row.err_code)+"\n          ")]),t._v(" "),a("el-divider"),t._v(" "),a("span",[a("strong",[t._v("ErrMsg:")]),t._v("\n            "+t._s(e.row.err_msg)+"\n          ")]),t._v(" "),a("el-divider"),t._v(" "),a("span",[a("strong",[t._v("ErrTaskType:")]),t._v("\n            "+t._s(t.tasktype[e.row.err_tasktype])+"\n          ")])],1):t._e()]}}])})],1),t._v(" "),a("div",{staticStyle:{"margin-top":"10px",float:"right",height:"70px"}},[a("el-pagination",{attrs:{"page-size":t.logquery.limit,background:"",layout:"total,prev, pager, next",total:t.pagecount},on:{"current-change":t.handleCurrentChangerun}})],1),t._v(" "),a("el-dialog",{attrs:{title:t.diatasktitle,visible:t.diaogVisible,center:"",width:"70%"},on:{"update:visible":function(e){t.diaogVisible=e}}},[a("el-container",[a("el-aside",{attrs:{width:"140px"}},[a("el-tree",{attrs:{data:t.treetaskdata,"highlight-current":"","default-expand-all":!0,props:t.defaultProps,"render-content":t.renderContent},on:{"node-click":t.handleNodeClick}})],1),t._v(" "),a("el-main",[a("span",{staticClass:"sub-title",domProps:{innerHTML:t._s(t.tasklogtitle)}}),t._v(" "),""!=t.tasklog?a("el-card",{staticStyle:{"margin-top":"5px"},attrs:{"body-style":{padding:"0px"}}},[a("editor",{attrs:{theme:"solarized_dark",lang:"text",height:"500",width:"100%",options:{readOnly:!0,wrap:"free",indentedSoftWrap:!1}},on:{init:t.initEditor},model:{value:t.tasklog,callback:function(e){t.tasklog=e},expression:"tasklog"}})],1):t._e()],1)],1)],1)],1)},l=[],r=(a("7f7f"),a("b199")),i=a("5c96"),o=(a("a18c"),{components:{editor:a("7c9e")},watch:{"logquery.name":{handler:function(t,e){this.cleanlog.name=t},deep:!0,immediate:!0}},data:function(){return{diatasktitle:"",diaogVisible:!1,tasklogtitle:"",tasklog:"",taskselect:[],data:[],treetaskdata:[],pagecount:0,listLoading:!1,logquery:{name:"",offset:0,limit:15,status:0},statusoption:[{label:"成功",value:1},{label:"失败",value:-1},{label:"全部",value:0}],tasktype:{1:"主任务",2:"父任务",3:"子任务"},defaultProps:{children:"children",label:"name"},cleanlogvisible:!1,cleanlog:{name:"",cleanpredat:""},cleantimeoption:[{label:"全部日志",value:0},{label:"一周以前的日志",value:7},{label:"一月以前的日志",value:30},{label:"两个月以前的日志",value:60},{label:"三个月以前的日志",value:90},{label:"半年以前的日志",value:182},{label:"一年以前的日志",value:365}],rules:{name:[{required:!0,message:"请输入任务名称",trigger:"blur"}],cleanpredat:[{required:!0,message:"请选择清理时间",trigger:"blur"}]}}},created:function(){void 0!==this.$route.query.name&&(this.logquery.name=this.$route.query.name),this.startgettasklog()},methods:{initEditor:function(t){t.setAutoScrollEditorIntoView(!0),t.setShowPrintMargin(!1),a("2099"),a("8a2a"),a("6c73")},handleCurrentChangerun:function(t){this.logquery.offset=(t-1)*this.logquery.limit,this.startgettasklog()},startgettasklog:function(){var t=this;Object(r["i"])(this.logquery).then((function(e){t.data=e.data,t.pagecount=e.count}))},handleNodeClick:function(t){if(void 0!==t.id){this.tasklog=t.taskresp_data;var e={1:"主任务",2:"父任务",3:"子任务"};this.tasklogtitle="".concat(e[t.tasktype]," ").concat(t.name,"[").concat(t.id,"]")}else this.tasklog="",this.tasklogtitle=""},renderContent:function(t,e){e.node;var a=e.data;e.store;return t("span",{class:"custom-tree-node"},[t("svg-icon",{attrs:{"icon-class":a.status}}),t("span",{style:"margin-left:5px;"},[a.name])])},gettasklogpre:function(t){var e=this;this.diatasktitle="任务运行日志 ".concat(t.name),this.diaogVisible=!0;var a={id:t.runby_taskid,start_time:t.start_time};Object(r["j"])(a).then((function(t){e.treetaskdata=t.data,e.tasklog="",e.tasklogtitle=""}))},startcleantask:function(t){var e=this;""!==this.logquery.name&&(this.cleanlog.name=this.logquery.name),this.$refs[t].validate((function(t){if(t){var a={name:e.cleanlog.name,preday:e.cleanlog.cleanpredat};Object(r["b"])(a).then((function(t){0===t.code?(i["Message"].success("总共清理任务 ".concat(e.logquery.name," 的日志共 ").concat(t.data.delcount," 条")),e.cleanlogvisible=!1,e.startgettasklog()):i["Message"].error("清理任务失败 ".concat(t.msg))}))}}))}}}),s=o,u=(a("3e25"),a("2877")),c=Object(u["a"])(s,n,l,!1,null,"8d970c14",null);e["default"]=c.exports},b199:function(t,e,a){"use strict";a.d(e,"h",(function(){return l})),a.d(e,"d",(function(){return r})),a.d(e,"a",(function(){return i})),a.d(e,"e",(function(){return o})),a.d(e,"k",(function(){return s})),a.d(e,"m",(function(){return u})),a.d(e,"f",(function(){return c})),a.d(e,"i",(function(){return d})),a.d(e,"j",(function(){return g})),a.d(e,"l",(function(){return p})),a.d(e,"g",(function(){return m})),a.d(e,"c",(function(){return f})),a.d(e,"b",(function(){return v}));var n=a("b775");function l(t){return Object(n["a"])({url:"/api/v1/task",method:"get",params:t})}function r(t){return Object(n["a"])({url:"/api/v1/task",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/api/v1/task",method:"put",data:t})}function o(t){return Object(n["a"])({url:"/api/v1/task",method:"delete",data:t})}function s(t){return Object(n["a"])({url:"/api/v1/task/kill",method:"put",data:t})}function u(t){return Object(n["a"])({url:"/api/v1/task/run",method:"put",data:t})}function c(t){return Object(n["a"])({url:"/api/v1/task/running",method:"get",params:t})}function d(t){return Object(n["a"])({url:"/api/v1/task/log",method:"get",params:t})}function g(t){return Object(n["a"])({url:"/api/v1/task/log/tree",method:"get",params:t})}function p(t){return Object(n["a"])({url:"/api/v1/task/cron",method:"get",params:t})}function m(){return Object(n["a"])({url:"/api/v1/task/select",method:"get"})}function f(t){return Object(n["a"])({url:"/api/v1/task/clone",method:"post",data:t})}function v(t){return Object(n["a"])({url:"/api/v1/task/log",method:"delete",data:t})}},cebc:function(t,e,a){}}]);