import{C as D}from"./ConnectStatus.60fff513.js";import{_ as m}from"./index.9e59753f.js";import{ah as o,o as _,c as f,V as s,P as n,a as i,U as d,ar as S,Q as y,T as z}from"./vendor-vue.cefe3aef.js";import"./element-plus.af689926.js";import"./element-icon.1fe9d2a8.js";import"./vendor-lib.a8c0b8df.js";const k={name:"",components:{ConnectStatus:D},props:{list:{type:Array}},computed:{},data(){return{currentRow:null,dialogVisible:!1}},methods:{handleEditRow(e){this.currentRow=e,this.dialogVisible=!0},async handleDeleteClick(e){let t={id:e.id};const r=await this.$http.function(t);r.code==0?(this.$msg.success("\u64CD\u4F5C\u6210\u529F"),this.$emit("on-success")):this.$msg.error(r.msg)},async handleStatusChange(e){let t={id:e.id};const r=await this.$http.function(t);r.code==0?(this.$msg.success("\u64CD\u4F5C\u6210\u529F"),this.$emit("on-success")):this.$msg.error(r.msg)},handleUpdateSuccess(){this.$emit("on-success")}},created(){}};function v(e,t,r,b,c,p){const l=o("el-table-column"),h=o("ConnectStatus"),u=o("el-table");return _(),f("div",null,[s(u,{data:r.list,stripe:"",border:""},{default:n(()=>[s(l,{label:e.$t("\u5E8F\u53F7"),align:"center",prop:"id",width:"60"},{default:n(a=>[i("span",null,d(a.$index+1),1)]),_:1},8,["label"]),s(l,{label:e.$t("\u7528\u6237"),"header-align":"center",align:"center",prop:"create_time",width:"140"},{default:n(a=>[i("span",null,d(a.row.user_name||"-"),1)]),_:1},8,["label"]),s(l,{label:e.$t("\u4EFB\u52A1\u540D\u79F0"),"header-align":"center",align:"center",width:"180",prop:"create_time"},{default:n(a=>[i("span",null,d(a.row.task_name||"-"),1)]),_:1},8,["label"]),s(l,{label:e.$t("\u5F00\u59CB\u65F6\u95F4"),"header-align":"center",align:"center",width:"180",prop:"create_time"},{default:n(a=>[i("span",null,d(a.row.start_time||"-"),1)]),_:1},8,["label"]),s(l,{label:e.$t("\u7ED3\u675F\u65F6\u95F4"),"header-align":"center",align:"center",width:"180",prop:"end_time"},{default:n(a=>[i("span",null,d(a.row.end_time||"-"),1)]),_:1},8,["label"]),s(l,{label:e.$t("\u6301\u7EED\u65F6\u95F4"),"header-align":"center",align:"center",width:"80",prop:"total_time_label"},{default:n(a=>[i("span",null,d(a.row.total_time_label||"-"),1)]),_:1},8,["label"]),s(l,{label:e.$t("\u72B6\u6001"),"header-align":"center",align:"center",prop:"status",width:"60"},{default:n(a=>[s(h,{value:a.row.status},null,8,["value"])]),_:1},8,["label"]),s(l,{label:e.$t("\u6267\u884C\u7ED3\u679C"),"header-align":"center",align:"center",prop:"status"},{default:n(a=>[i("span",null,d(a.row.result||"-"),1)]),_:1},8,["label"])]),_:1},8,["data"])])}const T=m(k,[["render",v]]),V={name:"log-scheduler-list",props:{},components:{DataTable:T},data(){return{list:[],total:0,page:1,size:20,keywords:"",loading:!0,dialogVisible:!1,pageSizeCachekey:"pageSize"}},computed:{},methods:{resetData(){this.page=1,this.getData()},refreshData(){this.getData()},async getData(){this.loading=!0;let e={ticket:this.ticket,page:this.page,size:this.size,keywords:this.keywords};const t=await this.$http.getAsyncTaskLogList(e);t.code==0&&(this.list=t.data.list,this.total=t.data.total),this.loading=!1},handleAddRow(){this.dialogVisible=!0},handleAddSuccess(){this.resetData()},handleSizeChange(e){localStorage.setItem(this.pageSizeCachekey,e),this.resetData()},loadPageSize(){let e=localStorage.getItem(this.pageSizeCachekey);e&&(this.size=parseInt(e))},async handleBatchDeleteConfirm(){let e=this.$loading({fullscreen:!0});try{const t=await this.$http.clearAsyncTaskLogList();t.code==0?(this.$msg.success("\u64CD\u4F5C\u6210\u529F"),this.resetData()):this.$msg.error(t.msg)}catch(t){console.log(t)}finally{this.$nextTick(()=>{e.close()})}}},created(){this.loadPageSize(),this.getData()}},A={class:"app-container"},B={class:"flex justify-between mb-sm"},L=i("div",null,null,-1);function P(e,t,r,b,c,p){const l=o("Delete"),h=o("el-icon"),u=o("el-link"),a=o("el-popconfirm"),w=o("DataTable"),C=o("el-pagination"),$=S("loading");return _(),f("div",A,[i("div",B,[L,s(a,{title:"\u786E\u5B9A\u6E05\u7A7A\u65E5\u5FD7\uFF1F",onConfirm:p.handleBatchDeleteConfirm},{reference:n(()=>[s(u,{underline:!1,type:"danger",class:"mr-sm"},{default:n(()=>[s(h,null,{default:n(()=>[s(l)]),_:1}),z(d(e.$t("\u6E05\u7A7A\u65E5\u5FD7")),1)]),_:1})]),_:1},8,["onConfirm"])]),y(s(w,{list:c.list,onOnSuccess:p.resetData},null,8,["list","onOnSuccess"]),[[$,c.loading]]),s(C,{class:"mt-md justify-center",background:"",layout:"total, sizes, prev, pager, next",total:c.total,"page-size":c.size,"onUpdate:pageSize":t[0]||(t[0]=g=>c.size=g),"current-page":c.page,"onUpdate:currentPage":t[1]||(t[1]=g=>c.page=g),onCurrentChange:p.getData,onSizeChange:p.handleSizeChange},null,8,["total","page-size","current-page","onCurrentChange","onSizeChange"])])}const E=m(V,[["render",P]]);export{E as default};
