2 lines
47 KiB
JavaScript
2 lines
47 KiB
JavaScript
|
import{_ as e,r as l,D as a,a2 as u,d as n,o as t,k as o,w as d,e as i,f as m,J as r,n as v,c,V as s,W as p,A as f,x as b,l as V,m as k,q as h,s as y,G as _,u as g,I as w,U as x,T as U,K as j,M as N,j as O,v as C}from"./index.e5c8b0d6.js";import{l as D,c as S,r as I,g as P,u as T,a as q,d as F}from"./job.fcbfb179.js";const G=e({__name:"second",props:{cron:{type:Object,default:{second:"*",min:"*",hour:"*",day:"*",month:"*",week:"?",year:""}},check:{type:Function,default:()=>{}}},emits:["update"],setup(e,{emit:f}){const b=e,V=l(1),k=l(0),h=l(1),y=l(0),_=l(1),g=l([]),w=l([0]),x=a((()=>(k.value=b.check(k.value,0,58),h.value=b.check(h.value,k.value+1,59),k.value+"-"+h.value))),U=a((()=>(y.value=b.check(y.value,0,58),_.value=b.check(_.value,1,59-y.value),y.value+"/"+_.value))),j=a((()=>g.value.join(",")));return u((()=>b.cron.second),(e=>function(e){if("*"===e)V.value=1;else if(e.indexOf("-")>-1){const l=e.split("-");k.value=Number(l[0]),h.value=Number(l[1]),V.value=2}else if(e.indexOf("/")>-1){const l=e.split("/");y.value=Number(l[0]),_.value=Number(l[1]),V.value=3}else g.value=[...new Set(e.split(",").map((e=>Number(e))))],V.value=4}(e))),u([V,x,U,j],(()=>function(){switch(V.value){case 1:f("update","second","*","second");break;case 2:f("update","second",x.value,"second");break;case 3:f("update","second",U.value,"second");break;case 4:0===g.value.length?g.value.push(w.value[0]):w.value=g.value,f("update","second",j.value,"second")}}())),(e,l)=>{const a=n("el-radio"),u=n("el-form-item"),f=n("el-input-number"),b=n("el-option"),w=n("el-select"),x=n("el-form");return t(),o(x,{size:"small"},{default:d((()=>[i(u,null,{default:d((()=>[i(a,{modelValue:m(V),"onUpdate:modelValue":l[0]||(l[0]=e=>r(V)?V.value=e:null),label:1},{default:d((()=>[v(" 秒,允许的通配符[, - * /] ")])),_:1},8,["modelValue"])])),_:1}),i(u,null,{default:d((()=>[i(a,{modelValue:m(V),"onUpdate:modelValue":l[3]||(l[3]=e=>r(V)?V.value=e:null),label:2},{default:d((()=>[v(" 周期从 "),i(f,{modelValue:m(k),"onUpdate:modelValue":l[1]||(l[1]=e=>r(k)?k.value=e:null),min:0,max:58},null,8,["modelValue"]),v(" - "),i(f,{modelValue:m(h),"onUpdate:modelValue":l[2]||(l[2]=e=>r(h)?h.value=e:null),min:m(k)+1,max:59},null,8,["modelValue","min"]),v(" 秒 ")])),_:1},8,["modelValue"])])),_:1}),i(u,null,{default:d((()=>[i(a,{modelValue:m(V),"onUpdate:modelValue":l[6]||(l[6]=e=>r(V)?V.value=e:null),label:3},{default:d((()=>[v(" 从 "),i(f,{modelValue:m(y),"onUpdate:modelValue":l[4]||(l[4]=e=>r(y)?y.value=e:null),min:0,max:58},null,8,["modelValue"]),v(" 秒开始,每 "),i(f,{modelValue:m(_),"onUpdate:modelValue":l[5]||(l[5]=e=>r(_)?_.value=e:null),min:1,max:59-m(y)},null,8,["modelValue","max"]),v(" 秒执行一次 ")])),_:1},8,["modelValue"])])),_:1}),i(u,null,{default:d((()=>[i(a,{modelValue:m(V),"onUpdate:modelValue":l[8]||(l[8]=e=>r(V)?V.value=e:null),label:4},{default:d((()=>[v(" 指定 "),i(w,{clearable:"",modelValue:m(g),"onUpdate:modelValue":l[7]||(l[7]=e=>r(g)?g.value=e:null),placeholder:"可多选",multiple:"","multiple-limit":10},{default:d((()=>[(t(),c(s,null,p(60,(e=>i(b,{key:e,label:e-1,value:e-1},null,8,["label","value"]))),64))])),_:1},8,["modelValue"])])),_:1},8,["modelValue"])])),_:1})])),_:1})}}},[["__scopeId","data-v-fa0e18fc"]]),z=e({__name:"min",props:{cron:{type:Object,default:{second:"*",min:"*",hour:"*",day:"*",month:"*",week:"?",year:""}},check:{type:Function,default:()=>{}}},emits:["update"],setup(e,{emit:f}){const b=e,V=l(1),k=l(0),h=l(1),y=l(0),_=l(1),g=l([]),w=l([0]),x=a((()=>(k.value=b.check(k.value,0,58),h.value=b.check(h.value,k.value+1,59),k.value+"-"+h.value))),U=a((()=>(y.value=b.check(y.value,0,58),_.value=b.check(_.value,1,59-y.value),y.value+"/"+_.value))),j=a((()=>g.value.join(",")));return u((()=>b.cron.min),(e=>function(e){if("*"===e)V.value=1;else if(e.indexOf("-")>-1){const l=e.split("-");k.value=Number(l[0]),h.value=Number(l[1]),V.value=2}else if(e.indexOf("/")>-1){const l=e.split("/");y.value=Number(l[0]),_.value=Number(l[1]),V.value=3}else g.value=[...new Set(e.split(",").map((e=>Number(e))))],V.value=4}(e))),u([V,x,U,j],(()=>func
|