2 lines
49 KiB
JavaScript
2 lines
49 KiB
JavaScript
|
import{_ as xe,r as y,z,Y as ee,d as x,o as b,j as A,w as a,e,f as l,F as k,m,c as O,Q,R as K,x as F,t as Se,k as R,l as Ve,p as Re,q as Le,B as Me,u as Fe,D as Pe,P as We,O as Oe,G as re,H as $e,i as Ye,s as qe}from"./index.b27a548a.js";import{l as Ee,c as Ge,r as ze,g as Ae,u as He,a as Je,d as Be}from"./job.5e17a232.js";const Qe={__name:"second",props:{cron:{type:Object,default:{second:"*",min:"*",hour:"*",day:"*",month:"*",week:"?",year:""}},check:{type:Function,default:()=>{}}},emits:["update"],setup(H,{emit:j}){const f=H,n=y(1),r=y(0),p=y(1),o=y(0),g=y(1),v=y([]),C=y([0]),$=z(()=>(r.value=f.check(r.value,0,58),p.value=f.check(p.value,r.value+1,59),r.value+"-"+p.value)),I=z(()=>(o.value=f.check(o.value,0,58),g.value=f.check(g.value,1,59-o.value),o.value+"/"+g.value)),L=z(()=>v.value.join(","));ee(()=>f.cron.second,_=>q(_)),ee([n,$,I,L],()=>P());function q(_){if(_==="*")n.value=1;else if(_.indexOf("-")>-1){const s=_.split("-");r.value=Number(s[0]),p.value=Number(s[1]),n.value=2}else if(_.indexOf("/")>-1){const s=_.split("/");o.value=Number(s[0]),g.value=Number(s[1]),n.value=3}else v.value=[...new Set(_.split(",").map(s=>Number(s)))],n.value=4}function P(){switch(n.value){case 1:j("update","second","*","second");break;case 2:j("update","second",$.value,"second");break;case 3:j("update","second",I.value,"second");break;case 4:v.value.length===0?v.value.push(C.value[0]):C.value=v.value,j("update","second",L.value,"second");break}}return(_,s)=>{const c=x("el-radio"),d=x("el-form-item"),u=x("el-input-number"),D=x("el-option"),N=x("el-select"),M=x("el-form");return b(),A(M,{size:"small"},{default:a(()=>[e(d,null,{default:a(()=>[e(c,{modelValue:l(n),"onUpdate:modelValue":s[0]||(s[0]=t=>k(n)?n.value=t:null),label:1},{default:a(()=>[m(" \u79D2\uFF0C\u5141\u8BB8\u7684\u901A\u914D\u7B26[, - * /] ")]),_:1},8,["modelValue"])]),_:1}),e(d,null,{default:a(()=>[e(c,{modelValue:l(n),"onUpdate:modelValue":s[3]||(s[3]=t=>k(n)?n.value=t:null),label:2},{default:a(()=>[m(" \u5468\u671F\u4ECE "),e(u,{modelValue:l(r),"onUpdate:modelValue":s[1]||(s[1]=t=>k(r)?r.value=t:null),min:0,max:58},null,8,["modelValue"]),m(" - "),e(u,{modelValue:l(p),"onUpdate:modelValue":s[2]||(s[2]=t=>k(p)?p.value=t:null),min:l(r)+1,max:59},null,8,["modelValue","min"]),m(" \u79D2 ")]),_:1},8,["modelValue"])]),_:1}),e(d,null,{default:a(()=>[e(c,{modelValue:l(n),"onUpdate:modelValue":s[6]||(s[6]=t=>k(n)?n.value=t:null),label:3},{default:a(()=>[m(" \u4ECE "),e(u,{modelValue:l(o),"onUpdate:modelValue":s[4]||(s[4]=t=>k(o)?o.value=t:null),min:0,max:58},null,8,["modelValue"]),m(" \u79D2\u5F00\u59CB\uFF0C\u6BCF "),e(u,{modelValue:l(g),"onUpdate:modelValue":s[5]||(s[5]=t=>k(g)?g.value=t:null),min:1,max:59-l(o)},null,8,["modelValue","max"]),m(" \u79D2\u6267\u884C\u4E00\u6B21 ")]),_:1},8,["modelValue"])]),_:1}),e(d,null,{default:a(()=>[e(c,{modelValue:l(n),"onUpdate:modelValue":s[8]||(s[8]=t=>k(n)?n.value=t:null),label:4},{default:a(()=>[m(" \u6307\u5B9A "),e(N,{clearable:"",modelValue:l(v),"onUpdate:modelValue":s[7]||(s[7]=t=>k(v)?v.value=t:null),placeholder:"\u53EF\u591A\u9009",multiple:"","multiple-limit":10},{default:a(()=>[(b(),O(Q,null,K(60,t=>e(D,{key:t,label:t-1,value:t-1},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})]),_:1})}}},Ke=xe(Qe,[["__scopeId","data-v-fa0e18fc"]]);const Xe={__name:"min",props:{cron:{type:Object,default:{second:"*",min:"*",hour:"*",day:"*",month:"*",week:"?",year:""}},check:{type:Function,default:()=>{}}},emits:["update"],setup(H,{emit:j}){const f=H,n=y(1),r=y(0),p=y(1),o=y(0),g=y(1),v=y([]),C=y([0]),$=z(()=>(r.value=f.check(r.value,0,58),p.value=f.check(p.value,r.value+1,59),r.value+"-"+p.value)),I=z(()=>(o.value=f.check(o.value,0,58),g.value=f.check(g.value,1,59-o.value),o.value+"/"+g.value)),L=z(()=>v.value.join(","));ee(()=>f.cron.min,_=>q(_)),ee([n,$,I,L],()=>P());function q(_){if(_==="*")n.value=1;else if(_.indexOf("-")>-1){const s=_.split("-");r.value=Number(s[0]),p.value=Number(s[1]),n.value=2}else if(_.indexOf("/")>-1){const s=_.split("/");o.value=Number(s[0]),g.value=Number(s[1]),n.value=3}el
|