mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-17 21:02:48 +00:00
2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
import{d as ne,v as se,f as ie,l as j,r as d,h as y,c as A,e,w as l,a as u,t as r,u as o,k as a,F as re,O as ue,m as D,i as g,J as H,S as B,P as ce,av as de,K as me,$ as pe,ad as fe,G as _e,be as ge,E as ve,H as he,ak as be,a0 as xe,a1 as ye,a2 as ke,V as we,L as Ce}from"./index-a59af0dd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import{a7 as Te,ae as Ee,af as M,ag as Le}from"./sys-d9b3645a.js";const Ve={class:"main-container"},De={class:"text-large font-600 mr-3"},Be={class:"flex justify-between"},Pe={class:"mt-[20px]"},ze={class:"mb-[10px] flex items-center"},Fe={class:"mt-[16px] flex justify-end"},Re={class:"input-width"},Se={class:"input-width"},$e={class:"input-width"},Ue={class:"input-width"},je={class:"input-width"},Ae={class:"input-width"},He={class:"dialog-footer"},da=ne({__name:"schedule_log",setup(Me){const E=se(),N=ie(),O=E.meta.title,Y=()=>{N.push("/tools/schedule")},n=j({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{schedule_id:E.query.id,key:"",status:"all",execute_time:[]}}),P=d([]),z=d(),I=i=>{i&&(i.resetFields(),_())};(async()=>{P.value=await(await Te()).data})();const _=(i=1)=>{n.loading=!0,n.page=i,Ee({page:n.page,limit:n.limit,...n.searchParam}).then(t=>{n.loading=!1,n.data=t.data.data,n.total=t.data.total}).catch(()=>{n.loading=!1})};_();const k=d(!1),L=d(!0),c=d(!1),w=d(!1),C=d(!1),F={id:"",name:"",key:"",execute_result:"",status_name:"",class:"",job:"",execute_time:""},m=j({...F}),q=i=>{L.value=!0,Object.assign(m,F),i&&Object.keys(m).forEach(t=>{i[t]!=null&&(m[t]=i[t])}),L.value=!1,k.value=!0},G=i=>{B.confirm(a("deleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{c.value||(c.value=!0,M({ids:i.id}).then(t=>{t.code==1&&_(),c.value=!1}).catch(()=>{c.value=!1}))})},b=d(),T=d(!1),J=i=>{T.value=!1,R.value.toggleAllSelection()},R=d(),v=d([]),K=i=>{v.value=i,b.value=!1,v.value.length>0&&v.value.length<n.data.length?T.value=!0:T.value=!1,v.value.length==n.data.length&&n.data.length&&v.value.length&&(b.value=!0)},Q=()=>{if(v.value.length==0){ce({type:"warning",message:`${a("batchEmptySelectedCronLogTips")}`});return}B.confirm(a("batchDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{if(c.value)return;c.value=!0,w.value=!0;const i=[];v.value.forEach(t=>{i.push(t.id)}),M({ids:i}).then(()=>{_(),b.value=!1,c.value=!1,w.value=!1}).catch(()=>{c.value=!1,w.value=!1})})},W=()=>{B.confirm(a("clearAllTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{if(c.value)return;c.value=!0,C.value=!0;const i=E.query.id??"";Le({schedule_id:i}).then(()=>{_(),b.value=!1,c.value=!1,C.value=!1}).catch(()=>{c.value=!1,C.value=!1})})};return(i,t)=>{const X=de,V=me,x=pe,S=fe,p=_e,Z=ge,h=ve,$=he,ee=be,f=xe,ae=ye,te=ke,le=we,U=Ce;return y(),A("div",Ve,[e(V,{class:"card !border-none",shadow:"never"},{default:l(()=>[e(X,{icon:i.ArrowLeft,onBack:t[0]||(t[0]=s=>Y())},{content:l(()=>[u("span",De,r(o(O)),1)]),_:1},8,["icon"])]),_:1}),e(V,{class:"box-card !border-none",shadow:"never"},{default:l(()=>[e(V,{class:"box-card !border-none mb-[10px] table-search-wrap",shadow:"never"},{default:l(()=>[u("div",Be,[e($,{inline:!0,model:n.searchParam,ref_key:"searchFormRef",ref:z},{default:l(()=>[e(p,{label:o(a)("name"),prop:"key"},{default:l(()=>[e(S,{modelValue:n.searchParam.key,"onUpdate:modelValue":t[1]||(t[1]=s=>n.searchParam.key=s),placeholder:"全部",filterable:"",remote:"",clearable:""},{default:l(()=>[e(x,{label:"全部",value:"all"}),(y(!0),A(re,null,ue(P.value,s=>(y(),D(x,{key:s.key,label:s.name,value:s.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),e(p,{label:o(a)("status"),prop:"status"},{default:l(()=>[e(S,{modelValue:n.searchParam.status,"onUpdate:modelValue":t[2]||(t[2]=s=>n.searchParam.status=s),placeholder:"全部",filterable:"",remote:"",clearable:""},{default:l(()=>[e(x,{label:"全部",value:"all"}),e(x,{label:"成功",value:"success"}),e(x,{label:"失败",value:"error"})]),_:1},8,["modelValue"])]),_:1},8,["label"]),e(p,{label:o(a)("executeTime"),prop:"execute_time"},{default:l(()=>[e(Z,{modelValue:n.searchParam.execute_time,"onUpdate:modelValue":t[3]||(t[3]=s=>n.searchParam.execute_time=s),type:"datetimerange","value-format":"YYYY-MM-DD HH:mm:ss","start-placeholder":o(a)("startDate"),"end-placeholder":o(a)("endDate")},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),e(p,null,{default:l(()=>[e(h,{type:"primary",onClick:t[4]||(t[4]=s=>_())},{default:l(()=>[g(r(o(a)("search")),1)]),_:1}),e(h,{onClick:t[5]||(t[5]=s=>I(z.value))},{default:l(()=>[g(r(o(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])])]),_:1}),u("div",Pe,[u("div",ze,[e(ee,{modelValue:b.value,"onUpdate:modelValue":t[6]||(t[6]=s=>b.value=s),size:"large",class:"px-[14px]",onChange:J,indeterminate:T.value},null,8,["modelValue","indeterminate"]),e(h,{onClick:Q,size:"small",loading:w.value},{default:l(()=>[g(r(o(a)("batchDelete")),1)]),_:1},8,["loading"]),e(h,{onClick:W,size:"small",loading:C.value},{default:l(()=>[g(r(o(a)("clearAll")),1)]),_:1},8,["loading"])]),H((y(),D(ae,{data:n.data,size:"large",ref_key:"cronLogListTableRef",ref:R,onSelectionChange:K},{empty:l(()=>[u("span",null,r(n.loading?"":o(a)("emptyData")),1)]),default:l(()=>[e(f,{type:"selection",width:"55"}),e(f,{prop:"id",label:o(a)("id"),"min-width":"80"},null,8,["label"]),e(f,{prop:"name",label:o(a)("name"),"min-width":"150"},null,8,["label"]),e(f,{prop:"key",label:o(a)("key"),"min-width":"150"},null,8,["label"]),e(f,{prop:"class",label:o(a)("class"),"min-width":"150"},null,8,["label"]),e(f,{label:o(a)("executeResult"),"min-width":"150"},{default:l(({row:s})=>[g(r(s.execute_result),1)]),_:1},8,["label"]),e(f,{prop:"status_name",label:o(a)("status"),"min-width":"100"},null,8,["label"]),e(f,{prop:"execute_time",label:o(a)("executeTime"),"min-width":"100"},null,8,["label"]),e(f,{label:o(a)("operation"),align:"right",fixed:"right",width:"130"},{default:l(({row:s})=>[e(h,{type:"primary",link:"",onClick:oe=>q(s)},{default:l(()=>[g(r(o(a)("info")),1)]),_:2},1032,["onClick"]),e(h,{type:"primary",link:"",onClick:oe=>G(s)},{default:l(()=>[g(r(o(a)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[U,n.loading]]),u("div",Fe,[e(te,{"current-page":n.page,"onUpdate:current-page":t[7]||(t[7]=s=>n.page=s),"page-size":n.limit,"onUpdate:page-size":t[8]||(t[8]=s=>n.limit=s),layout:"total, sizes, prev, pager, next, jumper",total:n.total,onSizeChange:t[9]||(t[9]=s=>_()),onCurrentChange:_},null,8,["current-page","page-size","total"])])])]),_:1}),e(le,{modelValue:k.value,"onUpdate:modelValue":t[11]||(t[11]=s=>k.value=s),title:o(a)("cronInfo"),width:"550px","destroy-on-close":!0},{footer:l(()=>[u("span",He,[e(h,{type:"primary",onClick:t[10]||(t[10]=s=>k.value=!1)},{default:l(()=>[g(r(o(a)("confirm")),1)]),_:1})])]),default:l(()=>[H((y(),D($,{model:m,"label-width":"110px",ref:"formRef",class:"page-form"},{default:l(()=>[e(p,{label:o(a)("name")},{default:l(()=>[u("div",Re,r(m.name),1)]),_:1},8,["label"]),e(p,{label:o(a)("key")},{default:l(()=>[u("div",Se,r(m.key),1)]),_:1},8,["label"]),e(p,{label:o(a)("class")},{default:l(()=>[u("div",$e,r(m.class),1)]),_:1},8,["label"]),e(p,{label:o(a)("executeResult")},{default:l(()=>[u("div",Ue,r(m.execute_result),1)]),_:1},8,["label"]),e(p,{label:o(a)("status")},{default:l(()=>[u("div",je,r(m.status_name),1)]),_:1},8,["label"]),e(p,{label:o(a)("executeTime")},{default:l(()=>[u("div",Ae,r(m.execute_time),1)]),_:1},8,["label"])]),_:1},8,["model"])),[[U,L.value]])]),_:1},8,["modelValue","title"])])}}});export{da as default};
|