import{C as w}from"./ConnectStatus.60fff513.js";import{_ as m}from"./index.9e59753f.js";import{ah as i,o as _,c as f,V as a,P as l,a as c,U as d,ar as z,Q as $,T as y}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:w},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 n=await this.$http.function(t);n.code==0?(this.$msg.success("\u64CD\u4F5C\u6210\u529F"),this.$emit("on-success")):this.$msg.error(n.msg)},async handleStatusChange(e){let t={id:e.id};const n=await this.$http.function(t);n.code==0?(this.$msg.success("\u64CD\u4F5C\u6210\u529F"),this.$emit("on-success")):this.$msg.error(n.msg)},handleUpdateSuccess(){this.$emit("on-success")}},created(){}};function v(e,t,n,b,o,p){const r=i("el-table-column"),u=i("ConnectStatus"),h=i("el-table");return _(),f("div",null,[a(h,{data:n.list,stripe:"",border:""},{default:l(()=>[a(r,{label:e.$t("\u5E8F\u53F7"),align:"center",prop:"id",width:"60"},{default:l(s=>[c("span",null,d(s.$index+1),1)]),_:1},8,["label"]),a(r,{label:e.$t("\u5F00\u59CB\u65F6\u95F4"),"header-align":"center",align:"center",prop:"create_time"},{default:l(s=>[c("span",null,d(s.row.create_time||"-"),1)]),_:1},8,["label"]),a(r,{label:e.$t("\u7ED3\u675F\u65F6\u95F4"),"header-align":"center",align:"center",prop:"update_time"},{default:l(s=>[c("span",null,d(s.row.update_time||"-"),1)]),_:1},8,["label"]),a(r,{label:e.$t("\u6301\u7EED\u65F6\u95F4"),"header-align":"center",align:"center",prop:"total_time_label"},{default:l(s=>[c("span",null,d(s.row.total_time_label||"-"),1)]),_:1},8,["label"]),a(r,{label:e.$t("\u72B6\u6001"),"header-align":"center",align:"center",prop:"status",width:"60"},{default:l(s=>[a(u,{value:s.row.status},null,8,["value"])]),_:1},8,["label"]),a(r,{label:e.$t("\u6267\u884C\u7ED3\u679C"),"header-align":"center",align:"center",prop:"status"},{default:l(s=>[c("span",null,d(s.row.error_message||"-"),1)]),_:1},8,["label"])]),_:1},8,["data"])])}const V=m(k,[["render",v]]),T={name:"log-scheduler-list",props:{},components:{DataTable:V},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.getLogSchedulerList(e);t.code==0&&(this.list=t.data.list.map(n=>(n.status==!1&&(n.status=null),n)),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.clearLogSchedulerList();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()}},B={class:"app-container"},x={class:"flex justify-between mb-sm"},L=c("div",null,null,-1);function P(e,t,n,b,o,p){const r=i("Delete"),u=i("el-icon"),h=i("el-link"),s=i("el-popconfirm"),S=i("DataTable"),C=i("el-pagination"),D=z("loading");return _(),f("div",B,[c("div",x,[L,a(s,{title:"\u786E\u5B9A\u6E05\u7A7A\u65E5\u5FD7\uFF1F",onConfirm:p.handleBatchDeleteConfirm},{reference:l(()=>[a(h,{underline:!1,type:"danger",class:"mr-sm"},{default:l(()=>[a(u,null,{default:l(()=>[a(r)]),_:1}),y(d(e.$t("\u6E05\u7A7A\u65E5\u5FD7")),1)]),_:1})]),_:1},8,["onConfirm"])]),$(a(S,{list:o.list,onOnSuccess:p.resetData},null,8,["list","onOnSuccess"]),[[D,o.loading]]),a(C,{class:"mt-md justify-center",background:"",layout:"total, sizes, prev, pager, next",total:o.total,"page-size":o.size,"onUpdate:pageSize":t[0]||(t[0]=g=>o.size=g),"current-page":o.page,"onUpdate:currentPage":t[1]||(t[1]=g=>o.page=g),onCurrentChange:p.getData,onSizeChange:p.handleSizeChange},null,8,["total","page-size","current-page","onCurrentChange","onSizeChange"])])}const E=m(T,[["render",P]]);export{E as default};
