test_lgq/niucloud/public/admin/assets/schedule-e24af307.js

2 lines
7.1 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{d as Q,O as Z,n as O,r as f,f as ee,q as te,N as l,h as u,c as h,e as i,w as o,a as p,t as m,u as n,i as c,y as $,I as _,F as T,G as D,B as b,a8 as ae,E as le,ar as oe,ah as ne,aj as ie,at as se,$ as re,as as me,aF as de,X as ue,W as pe,az as ce,aA as _e,Y as fe,aa as ye,a0 as ge,_ as ve}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* 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 */import{a4 as we,a5 as ke,a6 as he,S as be,a7 as xe,a8 as Ve,a9 as Ce}from"./sys-8ead7f22.js";import{_ as Ee}from"./cron-info.vue_vue_type_script_setup_true_lang-13e7b8d6.js";const Te={class:"main-container"},De={class:"flex justify-between items-center mb-[20px]"},Ue={class:"text-[20px]"},Be={class:"flex items-center"},ze={class:"mt-2"},Fe={class:"mt-[20px]"},Le={class:"mt-[16px] flex justify-end"},Re={class:"flex"},Ne={class:"input-width flex items-center text-sm"},Oe={class:"dialog-footer"},$e=Q({__name:"schedule",setup(Pe){const P=Z().meta.title,s=O({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",type:"",last_time:""}}),U=f([]),B=f([]),z=f([]);f(),(async()=>{U.value=await(await we()).data,B.value=await(await ke()).data,z.value=await(await he()).data})();const g=(r=1)=>{s.loading=!0,s.page=r,be({page:s.page,limit:s.limit,...s.searchParam}).then(a=>{s.loading=!1,s.data=a.data.data,s.total=a.data.total}).catch(()=>{s.loading=!1})};g(),ee();const w=f(!1),e=O({...{id:0,key:"",status:2,time:{type:"min",week:"",day:"",hour:"",min:""}}}),F=f(),S=()=>{e.id=0,e.key="",e.status=2,e.time.type="min",e.time.week="",e.time.day="",e.time.hour="",e.time.min="",w.value=!0},j=te(()=>({key:[{required:!0,message:l("titlePlaceholder"),trigger:"blur"}],timeDate:[{required:!0,validator:I,trigger:"blur"}]})),I=(r,a,d)=>e.time.type=="min"&&e.time.min!=""||e.time.type=="week"&&e.time.week!=""&&e.time.hour!=""&&e.time.min!=""||e.time.type=="month"&&e.time.day!=""&&e.time.hour!=""&&e.time.min!=""||e.time.type=="day"&&e.time.day!=""&&e.time.hour!=""&&e.time.min!=""||e.time.type=="hour"&&e.time.hour!=""&&e.time.min!=""?d():d(new Error(l("cronTimeTips"))),k=f(!1),q=async r=>{k.value||!r||await r.validate(async a=>{if(a){k.value=!0;const d=e;(e.id>0?xe:Ve)(d).then(v=>{k.value=!1,w.value=!1,g()}).catch(()=>{k.value=!1})}})},A=r=>{e.id=r.id,e.key=r.key,e.status=r.status,e.time=r.time,w.value=!0},G=r=>{ae.confirm(l("cronDeleteTips"),l("warning"),{confirmButtonText:l("confirm"),cancelButtonText:l("cancel"),type:"warning"}).then(()=>{Ce(r).then(()=>{g()}).catch(()=>{})})},W=f(null);return(r,a)=>{const d=le,L=oe,v=ne,M=ie,X=se,Y=re,x=me,V=de,C=ue,E=pe,R=ce,H=_e,J=fe,K=ye,N=ge;return u(),h("div",Te,[i(Y,{class:"box-card !border-none",shadow:"never"},{default:o(()=>[p("div",De,[p("span",Ue,m(n(P)),1),i(d,{type:"primary",onClick:S},{default:o(()=>[c(m(n(l)("addCron")),1)]),_:1})]),i(L,{class:"warm-prompt",type:"info"},{default:o(()=>[p("div",Be,[p("div",null,[p("p",null,m(n(l)("cronTipsOne")),1),p("p",ze,m(n(l)("cronTipsTwo")),1)])])]),_:1}),p("div",Fe,[$((u(),_(M,{data:s.data,size:"large"},{empty:o(()=>[p("span",null,m(s.loading?"":n(l)("emptyData")),1)]),default:o(()=>[i(v,{prop:"name",label:n(l)("title"),"min-width":"150"},null,8,["label"]),i(v,{prop:"key",label:n(l)("key"),"min-width":"150"},null,8,["label"]),i(v,{label:n(l)("crondType"),"min-width":"150"},{default:o(({row:t})=>[c(m(t.crontab_content),1)]),_:1},8,["label"]),i(v,{prop:"status_name",label:n(l)("openStatus"),"min-width":"100"},null,8,["label"]),i(v,{label:n(l)("operation"),align:"right",fixed:"right",width:"130"},{default:o(({row:t})=>[i(d,{type:"primary",link:"",onClick:y=>A(t)},{