1853 lines
64 KiB
JavaScript
1853 lines
64 KiB
JavaScript
import { ref as b, computed as T, watch as S, resolveComponent as U, openBlock as M, createBlock as H, withCtx as d, createVNode as l, createTextVNode as m, createElementBlock as B, Fragment as ae, renderList as ue, toDisplayString as z, reactive as be, onMounted as ye, createElementVNode as j, getCurrentInstance as De, createCommentVNode as ne, pushScopeId as Ne, popScopeId as Oe } from "vue";
|
|
const Ae = {
|
|
__name: "Crontab-Second",
|
|
props: {
|
|
check: Function
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { expose: s, emit: f }) {
|
|
const e = L, o = b(1), v = b(1), y = b(2), _ = b(0), x = b(1), C = b([]), w = b(e.check), O = T({
|
|
get: () => v.value + "-" + y.value,
|
|
set: (n) => {
|
|
v.value = w.value(v.value, 0, 59), y.value = w.value(y.value, 0, 59);
|
|
}
|
|
}), D = T({
|
|
get: () => _.value + "/" + x.value,
|
|
set: (n) => {
|
|
_.value = w.value(_.value, 0, 59), x.value = w.value(x.value, 1, 59);
|
|
}
|
|
}), W = T(() => {
|
|
const n = C.value.join();
|
|
return n === "" ? "*" : n;
|
|
}), F = () => {
|
|
switch (o.value) {
|
|
case 1:
|
|
f("update", "second", "*", "second"), f("update", "min", "*", "second");
|
|
break;
|
|
case 2:
|
|
f("update", "second", v.value + "-" + y.value);
|
|
break;
|
|
case 3:
|
|
f("update", "second", _.value + "/" + x.value);
|
|
break;
|
|
case 4:
|
|
f("update", "second", W.value);
|
|
break;
|
|
}
|
|
}, g = () => {
|
|
o.value === 2 && f("update", "second", O.value);
|
|
}, k = () => {
|
|
o.value === 3 && f("update", "second", D.value);
|
|
}, h = () => {
|
|
o.value === 4 && f("update", "second", W.value);
|
|
};
|
|
return S(o, () => {
|
|
F();
|
|
}, { deep: !0 }), S(O, () => {
|
|
g();
|
|
}, { deep: !0 }), S(D, () => {
|
|
k();
|
|
}, { deep: !0 }), S(W, () => {
|
|
h();
|
|
}, { deep: !0 }), s({ radioValue: o.value }), (n, r) => {
|
|
const c = U("el-radio"), a = U("el-form-item"), A = U("el-input-number"), u = U("el-option"), V = U("el-select"), t = U("el-form");
|
|
return M(), H(t, { size: "small" }, {
|
|
default: d(() => [
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[0] || (r[0] = (i) => o.value = i),
|
|
label: 1
|
|
}, {
|
|
default: d(() => [
|
|
m(" 秒,允许的通配符[, - * /] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[3] || (r[3] = (i) => o.value = i),
|
|
label: 2
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从 "),
|
|
l(A, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": r[1] || (r[1] = (i) => v.value = i),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" - "),
|
|
l(A, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": r[2] || (r[2] = (i) => y.value = i),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 秒 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[6] || (r[6] = (i) => o.value = i),
|
|
label: 3
|
|
}, {
|
|
default: d(() => [
|
|
m(" 从 "),
|
|
l(A, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": r[4] || (r[4] = (i) => _.value = i),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 秒开始,每 "),
|
|
l(A, {
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": r[5] || (r[5] = (i) => x.value = i),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 秒执行一次 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[8] || (r[8] = (i) => o.value = i),
|
|
label: 4
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(V, {
|
|
clearable: "",
|
|
modelValue: C.value,
|
|
"onUpdate:modelValue": r[7] || (r[7] = (i) => C.value = i),
|
|
placeholder: "可多选",
|
|
multiple: "",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
style: { width: "100%" }
|
|
}, {
|
|
default: d(() => [
|
|
(M(), B(ae, null, ue(60, (i) => l(u, {
|
|
key: i,
|
|
value: i - 1
|
|
}, {
|
|
default: d(() => [
|
|
m(z(i - 1), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["value"])), 64))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, Se = {
|
|
__name: "Crontab-Min",
|
|
props: {
|
|
check: Function,
|
|
cron: Object
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = b(1), o = b(1), v = b(2), y = b(0), _ = b(1), x = b([]), C = b(f.check), w = T({
|
|
get: () => o.value + "-" + v.value,
|
|
set: (h) => {
|
|
o.value = C.value(o.value, 0, 59), v.value = C.value(v.value, 0, 59);
|
|
}
|
|
}), O = T({
|
|
get: () => y.value + "/" + _.value,
|
|
set: (h) => {
|
|
y.value = C.value(y.value, 0, 59), _.value = C.value(_.value, 1, 59);
|
|
}
|
|
}), D = T(() => {
|
|
const h = x.value.join();
|
|
return h === "" ? "*" : h;
|
|
}), W = () => {
|
|
var h;
|
|
switch (e.value !== 1 && ((h = f.cron) == null ? void 0 : h.second) === "*" && s("update", "second", "0", "min"), e.value) {
|
|
case 1:
|
|
s("update", "min", "*", "min"), s("update", "hour", "*", "min");
|
|
break;
|
|
case 2:
|
|
s("update", "min", o.value + "-" + v.value, "min");
|
|
break;
|
|
case 3:
|
|
s("update", "min", y.value + "/" + _.value, "min");
|
|
break;
|
|
case 4:
|
|
s("update", "min", D.value, "min");
|
|
break;
|
|
}
|
|
}, F = () => {
|
|
e.value === 2 && s("update", "min", w.value, "min");
|
|
}, g = () => {
|
|
e.value === 3 && s("update", "min", O.value, "min");
|
|
}, k = () => {
|
|
e.value === 4 && s("update", "min", D.value, "min");
|
|
};
|
|
return S(e, () => {
|
|
W();
|
|
}, { deep: !0 }), S(w, () => {
|
|
F();
|
|
}, { deep: !0 }), S(O, () => {
|
|
g();
|
|
}, { deep: !0 }), S(D, () => {
|
|
k();
|
|
}, { deep: !0 }), (h, n) => {
|
|
const r = U("el-radio"), c = U("el-form-item"), a = U("el-input-number"), A = U("el-option"), u = U("el-select"), V = U("el-form");
|
|
return M(), H(V, { size: "small" }, {
|
|
default: d(() => [
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.value = t),
|
|
label: 1
|
|
}, {
|
|
default: d(() => [
|
|
m(" 分钟,允许的通配符[, - * /] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[3] || (n[3] = (t) => e.value = t),
|
|
label: 2
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从 "),
|
|
l(a, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": n[1] || (n[1] = (t) => o.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" - "),
|
|
l(a, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": n[2] || (n[2] = (t) => v.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 分钟 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[6] || (n[6] = (t) => e.value = t),
|
|
label: 3
|
|
}, {
|
|
default: d(() => [
|
|
m(" 从 "),
|
|
l(a, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": n[4] || (n[4] = (t) => y.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 分钟开始,每 "),
|
|
l(a, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": n[5] || (n[5] = (t) => _.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 分钟执行一次 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[8] || (n[8] = (t) => e.value = t),
|
|
label: 4
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(u, {
|
|
clearable: "",
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": n[7] || (n[7] = (t) => x.value = t),
|
|
placeholder: "可多选",
|
|
multiple: "",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
style: { width: "100%" }
|
|
}, {
|
|
default: d(() => [
|
|
(M(), B(ae, null, ue(60, (t) => l(A, {
|
|
key: t,
|
|
value: t - 1
|
|
}, {
|
|
default: d(() => [
|
|
m(z(t - 1), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["value"])), 64))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, Me = {
|
|
__name: "Crontab-Hour",
|
|
props: {
|
|
check: Function,
|
|
cron: Object
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = b(1), o = b(0), v = b(1), y = b(0), _ = b(1), x = b([]), C = b(f.check), w = T({
|
|
get: () => o.value + "-" + v.value,
|
|
set: (h) => {
|
|
o.value = C.value(o.value, 0, 23), v.value = C.value(v.value, 0, 23);
|
|
}
|
|
}), O = T({
|
|
get: () => y.value + "/" + _.value,
|
|
set: (h) => {
|
|
y.value = C.value(y.value, 0, 23), _.value = C.value(_.value, 1, 23);
|
|
}
|
|
}), D = T(() => {
|
|
const h = x.value.join();
|
|
return h === "" ? "*" : h;
|
|
}), W = () => {
|
|
switch (e.value === 1 ? (s("update", "hour", "*", "hour"), s("update", "day", "*", "hour")) : (f.cron.min === "*" && s("update", "min", "0", "hour"), f.cron.second === "*" && s("update", "second", "0", "hour")), e.value) {
|
|
case 2:
|
|
s("update", "hour", o.value + "-" + v.value);
|
|
break;
|
|
case 3:
|
|
s("update", "hour", y.value + "/" + _.value);
|
|
break;
|
|
case 4:
|
|
s("update", "hour", D.value);
|
|
break;
|
|
}
|
|
}, F = () => {
|
|
e.value === 2 && s("update", "hour", w.value);
|
|
}, g = () => {
|
|
e.value === 3 && s("update", "hour", O.value);
|
|
}, k = () => {
|
|
e.value === 4 && s("update", "hour", D.value);
|
|
};
|
|
return S(e, () => {
|
|
W();
|
|
}, { deep: !0 }), S(w, () => {
|
|
F();
|
|
}, { deep: !0 }), S(O, () => {
|
|
g();
|
|
}, { deep: !0 }), S(D, () => {
|
|
k();
|
|
}, { deep: !0 }), (h, n) => {
|
|
const r = U("el-radio"), c = U("el-form-item"), a = U("el-input-number"), A = U("el-option"), u = U("el-select"), V = U("el-form");
|
|
return M(), H(V, { size: "small" }, {
|
|
default: d(() => [
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.value = t),
|
|
label: 1
|
|
}, {
|
|
default: d(() => [
|
|
m(" 小时,允许的通配符[, - * /] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[3] || (n[3] = (t) => e.value = t),
|
|
label: 2
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从 "),
|
|
l(a, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": n[1] || (n[1] = (t) => o.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" - "),
|
|
l(a, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": n[2] || (n[2] = (t) => v.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 小时 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[6] || (n[6] = (t) => e.value = t),
|
|
label: 3
|
|
}, {
|
|
default: d(() => [
|
|
m(" 从 "),
|
|
l(a, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": n[4] || (n[4] = (t) => y.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 小时开始,每 "),
|
|
l(a, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": n[5] || (n[5] = (t) => _.value = t),
|
|
min: 0,
|
|
max: 60
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 小时执行一次 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[8] || (n[8] = (t) => e.value = t),
|
|
label: 4
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(u, {
|
|
clearable: "",
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": n[7] || (n[7] = (t) => x.value = t),
|
|
placeholder: "可多选",
|
|
multiple: "",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
style: { width: "100%" }
|
|
}, {
|
|
default: d(() => [
|
|
(M(), B(ae, null, ue(60, (t) => l(A, {
|
|
key: t,
|
|
value: t - 1
|
|
}, {
|
|
default: d(() => [
|
|
m(z(t - 1), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["value"])), 64))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, Le = {
|
|
__name: "Crontab-Day",
|
|
props: {
|
|
check: Function,
|
|
cron: Object
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = b(1), o = b(1), v = b(1), y = b(2), _ = b(1), x = b(1), C = b([]), w = b(f.check), O = T({
|
|
get: () => v.value + "-" + y.value,
|
|
set: () => {
|
|
v.value = w.value(v.value, 0, 59), y.value = w.value(y.value, 0, 59);
|
|
}
|
|
}), D = T({
|
|
get: () => _.value + "/" + x.value,
|
|
set: () => {
|
|
_.value = w.value(_.value, 0, 59), x.value = w.value(x.value, 1, 59);
|
|
}
|
|
}), W = T({
|
|
get: () => o.value,
|
|
set: () => {
|
|
o.value = w.value(o.value, 1, 31);
|
|
}
|
|
}), F = T(() => {
|
|
const c = C.value.join();
|
|
return c === "" ? "*" : c;
|
|
}), g = () => {
|
|
switch (e.value === 1 ? (s("update", "day", "*", "day"), s("update", "week", "?", "day"), s("update", "mouth", "*", "day")) : (f.cron.hour === "*" && s("update", "hour", "0", "day"), f.cron.min === "*" && s("update", "min", "0", "day"), f.cron.second === "*" && s("update", "second", "0", "day")), e.value) {
|
|
case 2:
|
|
s("update", "day", "?");
|
|
break;
|
|
case 3:
|
|
s("update", "day", v.value + "-" + y.value);
|
|
break;
|
|
case 4:
|
|
s("update", "day", _.value + "/" + x.value);
|
|
break;
|
|
case 5:
|
|
s("update", "day", o.value + "W");
|
|
break;
|
|
case 6:
|
|
s("update", "day", "L");
|
|
break;
|
|
case 7:
|
|
s("update", "day", F.value);
|
|
break;
|
|
}
|
|
}, k = () => {
|
|
e.value === 3 && s("update", "day", O.value);
|
|
}, h = () => {
|
|
e.value === 4 && s("update", "day", D.value);
|
|
}, n = () => {
|
|
e.value === 5 && s("update", "day", o.value + "W");
|
|
}, r = () => {
|
|
e.value === 7 && s("update", "day", F.value);
|
|
};
|
|
return S(e, () => {
|
|
g();
|
|
}, { deep: !0 }), S(O, () => {
|
|
k();
|
|
}, { deep: !0 }), S(D, () => {
|
|
h();
|
|
}, { deep: !0 }), S(W, () => {
|
|
n();
|
|
}, { deep: !0 }), S(F, () => {
|
|
r();
|
|
}, { deep: !0 }), (c, a) => {
|
|
const A = U("el-radio"), u = U("el-form-item"), V = U("el-input-number"), t = U("el-option"), i = U("el-select"), I = U("el-form");
|
|
return M(), H(I, { size: "small" }, {
|
|
default: d(() => [
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[0] || (a[0] = (p) => e.value = p),
|
|
label: 1
|
|
}, {
|
|
default: d(() => [
|
|
m(" 日,允许的通配符[, - * / L M] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[1] || (a[1] = (p) => e.value = p),
|
|
label: 2
|
|
}, {
|
|
default: d(() => [
|
|
m(" 不指定 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[4] || (a[4] = (p) => e.value = p),
|
|
label: 3
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从 "),
|
|
l(V, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": a[2] || (a[2] = (p) => v.value = p),
|
|
min: 0,
|
|
max: 31
|
|
}, null, 8, ["modelValue"]),
|
|
m(" - "),
|
|
l(V, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": a[3] || (a[3] = (p) => y.value = p),
|
|
min: 0,
|
|
max: 31
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 日 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[7] || (a[7] = (p) => e.value = p),
|
|
label: 4
|
|
}, {
|
|
default: d(() => [
|
|
m(" 从 "),
|
|
l(V, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": a[5] || (a[5] = (p) => _.value = p),
|
|
min: 0,
|
|
max: 31
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 号开始,每 "),
|
|
l(V, {
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": a[6] || (a[6] = (p) => x.value = p),
|
|
min: 0,
|
|
max: 31
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 日执行一次 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[9] || (a[9] = (p) => e.value = p),
|
|
label: 5
|
|
}, {
|
|
default: d(() => [
|
|
m(" 每月 "),
|
|
l(V, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": a[8] || (a[8] = (p) => o.value = p),
|
|
min: 0,
|
|
max: 31
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 号最近的那个工作日 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[10] || (a[10] = (p) => e.value = p),
|
|
label: 6
|
|
}, {
|
|
default: d(() => [
|
|
m(" 本月最后一天 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[12] || (a[12] = (p) => e.value = p),
|
|
label: 7
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(i, {
|
|
clearable: "",
|
|
modelValue: C.value,
|
|
"onUpdate:modelValue": a[11] || (a[11] = (p) => C.value = p),
|
|
placeholder: "可多选",
|
|
multiple: "",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
style: { width: "100%" }
|
|
}, {
|
|
default: d(() => [
|
|
(M(), B(ae, null, ue(31, (p) => l(t, {
|
|
key: p,
|
|
value: p
|
|
}, {
|
|
default: d(() => [
|
|
m(z(p), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["value"])), 64))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, je = {
|
|
__name: "Crontab-Mouth",
|
|
props: {
|
|
check: Function,
|
|
cron: Object
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = b(1), o = b(1), v = b(2), y = b(1), _ = b(1), x = b([]), C = b(f.check), w = T({
|
|
get: () => o.value + "-" + v.value,
|
|
set: () => {
|
|
o.value = C.value(o.value, 0, 12), v.value = C.value(v.value, 0, 12);
|
|
}
|
|
}), O = T({
|
|
get: () => y.value + "/" + _.value,
|
|
set: () => {
|
|
y.value = C.value(y.value, 1, 12), _.value = C.value(_.value, 1, 12);
|
|
}
|
|
}), D = T(() => {
|
|
const h = x.value.join();
|
|
return h === "" ? "*" : h;
|
|
}), W = () => {
|
|
switch (e.value === 1 ? (s("update", "mouth", "*"), s("update", "year", "*")) : (f.cron.day === "*" && s("update", "day", "0", "mouth"), f.cron.hour === "*" && s("update", "hour", "0", "mouth"), f.cron.min === "*" && s("update", "min", "0", "mouth"), f.cron.second === "*" && s("update", "second", "0", "mouth")), e.value) {
|
|
case 2:
|
|
s("update", "mouth", o.value + "-" + v.value);
|
|
break;
|
|
case 3:
|
|
s("update", "mouth", y.value + "/" + _.value);
|
|
break;
|
|
case 4:
|
|
s("update", "mouth", D.value);
|
|
break;
|
|
}
|
|
}, F = () => {
|
|
e.value === 2 && s("update", "mouth", w.value);
|
|
}, g = () => {
|
|
e.value === 3 && s("update", "mouth", O.value);
|
|
}, k = () => {
|
|
e.value === 4 && s("update", "mouth", D.value);
|
|
};
|
|
return S(e, () => {
|
|
W();
|
|
}, { deep: !0 }), S(w, () => {
|
|
F();
|
|
}, { deep: !0 }), S(O, () => {
|
|
g();
|
|
}, { deep: !0 }), S(D, () => {
|
|
k();
|
|
}, { deep: !0 }), (h, n) => {
|
|
const r = U("el-radio"), c = U("el-form-item"), a = U("el-input-number"), A = U("el-option"), u = U("el-select"), V = U("el-form");
|
|
return M(), H(V, { size: "small" }, {
|
|
default: d(() => [
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.value = t),
|
|
label: 1
|
|
}, {
|
|
default: d(() => [
|
|
m(" 月,允许的通配符[, - * /] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[3] || (n[3] = (t) => e.value = t),
|
|
label: 2
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从 "),
|
|
l(a, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": n[1] || (n[1] = (t) => o.value = t),
|
|
min: 1,
|
|
max: 12
|
|
}, null, 8, ["modelValue"]),
|
|
m(" - "),
|
|
l(a, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": n[2] || (n[2] = (t) => v.value = t),
|
|
min: 1,
|
|
max: 12
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 月 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[6] || (n[6] = (t) => e.value = t),
|
|
label: 3
|
|
}, {
|
|
default: d(() => [
|
|
m(" 从 "),
|
|
l(a, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": n[4] || (n[4] = (t) => y.value = t),
|
|
min: 1,
|
|
max: 12
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 月开始,每 "),
|
|
l(a, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": n[5] || (n[5] = (t) => _.value = t),
|
|
min: 1,
|
|
max: 12
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 月月执行一次 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(c, null, {
|
|
default: d(() => [
|
|
l(r, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": n[8] || (n[8] = (t) => e.value = t),
|
|
label: 4
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(u, {
|
|
clearable: "",
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": n[7] || (n[7] = (t) => x.value = t),
|
|
placeholder: "可多选",
|
|
multiple: "",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
style: { width: "100%" }
|
|
}, {
|
|
default: d(() => [
|
|
(M(), B(ae, null, ue(12, (t) => l(A, {
|
|
key: t,
|
|
value: t
|
|
}, {
|
|
default: d(() => [
|
|
m(z(t), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["value"])), 64))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, Te = {
|
|
__name: "Crontab-Week",
|
|
props: {
|
|
check: Function,
|
|
cron: Object
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = b(2), o = b(1), v = b(1), y = b(2), _ = b(1), x = b(1), C = b([]), w = b(f.check), O = be(["周一", "周二", "周三", "周四", "周五", "周六", "周日"]), D = T({
|
|
get: () => v.value + "-" + y.value,
|
|
set: () => {
|
|
v.value = w.value(v.value, 1, 7), y.value = w.value(y.value, 1, 7);
|
|
}
|
|
}), W = T({
|
|
get: () => _.value + "/" + x.value,
|
|
set: () => {
|
|
_.value = w.value(_.value, 1, 4), x.value = w.value(x.value, 1, 7);
|
|
}
|
|
}), F = T({
|
|
get: () => o.value,
|
|
set: () => {
|
|
o.value = w.value(o.value, 1, 7);
|
|
}
|
|
}), g = T(() => {
|
|
const c = C.value.join();
|
|
return c === "" ? "*" : c;
|
|
}), k = () => {
|
|
switch (e.value === 1 ? (s("update", "week", "*"), s("update", "year", "*")) : (f.cron.mouth === "*" && s("update", "mouth", "0", "week"), f.cron.day === "*" && s("update", "day", "0", "week"), f.cron.hour === "*" && s("update", "hour", "0", "week"), f.cron.min === "*" && s("update", "min", "0", "week"), f.cron.second === "*" && s("update", "second", "0", "week")), e.value) {
|
|
case 2:
|
|
s("update", "week", "?");
|
|
break;
|
|
case 3:
|
|
s("update", "week", v.value + "-" + y.value);
|
|
break;
|
|
case 4:
|
|
s("update", "week", _.value + "#" + x.value);
|
|
break;
|
|
case 5:
|
|
s("update", "week", o.value + "L");
|
|
break;
|
|
case 6:
|
|
s("update", "week", g.value);
|
|
break;
|
|
}
|
|
}, h = () => {
|
|
e.value === "3" && s("update", "week", D.value);
|
|
}, n = () => {
|
|
e.value === "4" && s("update", "week", W.value);
|
|
}, r = () => {
|
|
e.value === "6" && s("update", "week", g.value);
|
|
};
|
|
return S(e, () => {
|
|
k();
|
|
}, { deep: !0 }), S(D, () => {
|
|
h();
|
|
}, { deep: !0 }), S(W, () => {
|
|
n();
|
|
}, { deep: !0 }), S(F, () => {
|
|
F();
|
|
}, { deep: !0 }), S(g, () => {
|
|
r();
|
|
}, { deep: !0 }), (c, a) => {
|
|
const A = U("el-radio"), u = U("el-form-item"), V = U("el-input-number"), t = U("el-option"), i = U("el-select"), I = U("el-form");
|
|
return M(), H(I, { size: "small" }, {
|
|
default: d(() => [
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[0] || (a[0] = (p) => e.value = p),
|
|
label: 1
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周,允许的通配符[, - * / L #] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[1] || (a[1] = (p) => e.value = p),
|
|
label: 2
|
|
}, {
|
|
default: d(() => [
|
|
m(" 不指定 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[4] || (a[4] = (p) => e.value = p),
|
|
label: 3
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从星期 "),
|
|
l(V, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": a[2] || (a[2] = (p) => v.value = p),
|
|
min: 1,
|
|
max: 7
|
|
}, null, 8, ["modelValue"]),
|
|
m(" - "),
|
|
l(V, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": a[3] || (a[3] = (p) => y.value = p),
|
|
min: 1,
|
|
max: 7
|
|
}, null, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[7] || (a[7] = (p) => e.value = p),
|
|
label: 4
|
|
}, {
|
|
default: d(() => [
|
|
m(" 第 "),
|
|
l(V, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": a[5] || (a[5] = (p) => _.value = p),
|
|
min: 1,
|
|
max: 4
|
|
}, null, 8, ["modelValue"]),
|
|
m(" 周的星期 "),
|
|
l(V, {
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": a[6] || (a[6] = (p) => x.value = p),
|
|
min: 1,
|
|
max: 7
|
|
}, null, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[9] || (a[9] = (p) => e.value = p),
|
|
label: 5
|
|
}, {
|
|
default: d(() => [
|
|
m(" 本月最后一个星期 "),
|
|
l(V, {
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": a[8] || (a[8] = (p) => o.value = p),
|
|
min: 1,
|
|
max: 7
|
|
}, null, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(u, null, {
|
|
default: d(() => [
|
|
l(A, {
|
|
modelValue: e.value,
|
|
"onUpdate:modelValue": a[11] || (a[11] = (p) => e.value = p),
|
|
label: 6
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(i, {
|
|
clearable: "",
|
|
modelValue: C.value,
|
|
"onUpdate:modelValue": a[10] || (a[10] = (p) => C.value = p),
|
|
placeholder: "可多选",
|
|
multiple: "",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
style: { width: "100%" }
|
|
}, {
|
|
default: d(() => [
|
|
(M(!0), B(ae, null, ue(O, (p, R) => (M(), H(t, {
|
|
key: R,
|
|
value: R + 1
|
|
}, {
|
|
default: d(() => [
|
|
m(z(p), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["value"]))), 128))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, We = {
|
|
__name: "Crontab-Year",
|
|
props: {
|
|
check: Function,
|
|
cron: Object
|
|
},
|
|
emits: ["update", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = b(0), o = b(1), v = b(0), y = b(0), _ = b(0), x = b(1), C = b([]), w = b(f.check), O = T({
|
|
get: () => v.value + "-" + y.value,
|
|
set: () => {
|
|
v.value = w.value(v.value, e.value, e.value + 100), y.value = w.value(y.value, e.value + 1, e.value + 101);
|
|
}
|
|
}), D = T({
|
|
get: () => _.value + "/" + x.value,
|
|
set: () => {
|
|
_.value = w.value(_.value, e.value, e.value + 100), x.value = w.value(x.value, 1, 10);
|
|
}
|
|
}), W = T(() => C.value.join()), F = () => {
|
|
switch (f.cron.mouth === "*" && s("update", "mouth", "0", "year"), f.cron.day === "*" && s("update", "day", "0", "year"), f.cron.hour === "*" && s("update", "hour", "0", "year"), f.cron.min === "*" && s("update", "min", "0", "year"), f.cron.second === "*" && s("update", "second", "0", "year"), o.value) {
|
|
case 1:
|
|
s("update", "year", "");
|
|
break;
|
|
case 2:
|
|
s("update", "year", "*");
|
|
break;
|
|
case 3:
|
|
s("update", "year", v.value + "-" + y.value);
|
|
break;
|
|
case 4:
|
|
s("update", "year", _.value + "/" + x.value);
|
|
break;
|
|
case 5:
|
|
s("update", "year", W.value);
|
|
break;
|
|
}
|
|
}, g = () => {
|
|
o.value === 3 && s("update", "year", O.value);
|
|
}, k = () => {
|
|
o.value === 4 && s("update", "year", D.value);
|
|
}, h = () => {
|
|
o.value === 5 && s("update", "year", W.value);
|
|
};
|
|
return S(o, () => {
|
|
F();
|
|
}, { deep: !0 }), S(O, () => {
|
|
g();
|
|
}, { deep: !0 }), S(D, () => {
|
|
k();
|
|
}, { deep: !0 }), S(W, () => {
|
|
h();
|
|
}, { deep: !0 }), ye(() => {
|
|
e.value = Number((/* @__PURE__ */ new Date()).getFullYear());
|
|
}), (n, r) => {
|
|
const c = U("el-radio"), a = U("el-form-item"), A = U("el-input-number"), u = U("el-option"), V = U("el-select"), t = U("el-form");
|
|
return M(), H(t, { size: "small" }, {
|
|
default: d(() => [
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
label: 1,
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[0] || (r[0] = (i) => o.value = i)
|
|
}, {
|
|
default: d(() => [
|
|
m(" 不填,允许的通配符[, - * /] ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
label: 2,
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[1] || (r[1] = (i) => o.value = i)
|
|
}, {
|
|
default: d(() => [
|
|
m(" 每年 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
label: 3,
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[4] || (r[4] = (i) => o.value = i)
|
|
}, {
|
|
default: d(() => [
|
|
m(" 周期从 "),
|
|
l(A, {
|
|
modelValue: v.value,
|
|
"onUpdate:modelValue": r[2] || (r[2] = (i) => v.value = i),
|
|
min: e.value
|
|
}, null, 8, ["modelValue", "min"]),
|
|
m(" - "),
|
|
l(A, {
|
|
modelValue: y.value,
|
|
"onUpdate:modelValue": r[3] || (r[3] = (i) => y.value = i),
|
|
min: e.value
|
|
}, null, 8, ["modelValue", "min"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
label: 4,
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[7] || (r[7] = (i) => o.value = i)
|
|
}, {
|
|
default: d(() => [
|
|
m(" 从 "),
|
|
l(A, {
|
|
modelValue: _.value,
|
|
"onUpdate:modelValue": r[5] || (r[5] = (i) => _.value = i),
|
|
min: e.value
|
|
}, null, 8, ["modelValue", "min"]),
|
|
m(" 年开始,每 "),
|
|
l(A, {
|
|
modelValue: x.value,
|
|
"onUpdate:modelValue": r[6] || (r[6] = (i) => x.value = i),
|
|
min: e.value
|
|
}, null, 8, ["modelValue", "min"]),
|
|
m(" 年执行一次 ")
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(a, null, {
|
|
default: d(() => [
|
|
l(c, {
|
|
label: 5,
|
|
modelValue: o.value,
|
|
"onUpdate:modelValue": r[9] || (r[9] = (i) => o.value = i)
|
|
}, {
|
|
default: d(() => [
|
|
m(" 指定 "),
|
|
l(V, {
|
|
clearable: "",
|
|
modelValue: C.value,
|
|
"onUpdate:modelValue": r[8] || (r[8] = (i) => C.value = i),
|
|
placeholder: "可多选",
|
|
"collapse-tags": "",
|
|
"collapse-tags-tooltip": "",
|
|
multiple: ""
|
|
}, {
|
|
default: d(() => [
|
|
(M(), B(ae, null, ue(9, (i) => l(u, {
|
|
key: i,
|
|
value: i - 1 + e.value,
|
|
label: i - 1 + e.value
|
|
}, null, 8, ["value", "label"])), 64))
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["modelValue"])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
}, Ye = { class: "popup-result" }, Fe = /* @__PURE__ */ j("p", { class: "title" }, "最近5次运行时间", -1), Ie = { class: "popup-result-scroll" }, $e = { key: 1 }, ze = {
|
|
__name: "Crontab-Result",
|
|
props: {
|
|
ex: String
|
|
},
|
|
setup(L) {
|
|
const s = L, f = b(""), e = b(""), o = b([]), v = b([]), y = b(!1), _ = (u, V) => V - u > 0 ? -1 : 1, x = (u, V) => {
|
|
if (V <= u[0] || V > u[u.length - 1])
|
|
return 0;
|
|
for (let t = 0; t < u.length - 1; t++)
|
|
if (V > u[t] && V <= u[t + 1])
|
|
return t + 1;
|
|
}, C = (u, V) => {
|
|
const t = [];
|
|
for (let i = u; i <= V; i++)
|
|
t.push(i);
|
|
return t;
|
|
}, w = (u) => {
|
|
const V = [], t = u.split(",");
|
|
for (let i = 0; i < t.length; i++)
|
|
V[i] = Number(t[i]);
|
|
return V.sort(_), V;
|
|
}, O = (u, V) => {
|
|
const t = [], i = u.split("/");
|
|
let I = Number(i[0]);
|
|
const p = Number(i[1]);
|
|
for (; I <= V; )
|
|
t.push(I), I += p;
|
|
return t;
|
|
}, D = (u, V, t) => {
|
|
const i = [], I = u.split("-"), p = Number(I[0]);
|
|
let R = Number(I[1]);
|
|
p > R && (R += V);
|
|
for (let P = p; P <= R; P++) {
|
|
let Q = 0;
|
|
t === !1 && P % V === 0 && (Q = V), i.push(Math.round(P % V + Q));
|
|
}
|
|
return i.sort(_), i;
|
|
}, W = (u) => {
|
|
o.value[2] = C(0, 23), u.indexOf("-") >= 0 ? o.value[2] = D(u, 24, !0) : u.indexOf("/") >= 0 ? o.value[2] = O(u, 23) : u !== "*" && (o.value[2] = w(u));
|
|
}, F = (u) => {
|
|
o.value[1] = C(0, 59), u.indexOf("-") >= 0 ? o.value[1] = D(u, 60, !0) : u.indexOf("/") >= 0 ? o.value[1] = O(u, 59) : u !== "*" && (o.value[1] = w(u));
|
|
}, g = (u) => {
|
|
o.value[0] = C(0, 59), u.indexOf("-") >= 0 ? o.value[0] = D(u, 60, !0) : u.indexOf("/") >= 0 ? o.value[0] = O(u, 59) : u !== "*" && (o.value[0] = w(u));
|
|
}, k = (u, V) => {
|
|
o.value[5] = C(V, V + 100), u !== void 0 && (u.indexOf("-") >= 0 ? o.value[5] = D(u, V + 100, !1) : u.indexOf("/") >= 0 ? o.value[5] = O(u, V + 100) : u !== "*" && (o.value[5] = w(u)));
|
|
}, h = (u) => {
|
|
o.value[4] = C(1, 12), u.indexOf("-") >= 0 ? o.value[4] = D(u, 12, !1) : u.indexOf("/") >= 0 ? o.value[4] = O(u, 12) : u !== "*" && (o.value[4] = w(u));
|
|
}, n = (u) => {
|
|
if (f.value === "" && e.value === "") {
|
|
if (u.indexOf("-") >= 0)
|
|
f.value = "weekDay", e.value = D(u, 7, !1);
|
|
else if (u.indexOf("#") >= 0) {
|
|
f.value = "assWeek";
|
|
const V = u.match(/[0-9]{1}/g);
|
|
e.value = [Number(V[0]), Number(V[1])], o.value[3] = [1], e.value[1] === 7 && (e.value[1] = 0);
|
|
} else
|
|
u.indexOf("L") >= 0 ? (f.value = "lastWeek", e.value = Number(u.match(/[0-9]{1,2}/g)[0]), o.value[3] = [31], e.value === 7 && (e.value = 0)) : u !== "*" && u !== "?" && (f.value = "weekDay", e.value = w(u));
|
|
if (f.value === "weekDay")
|
|
for (let V = 0; V < e.value.length; V++)
|
|
e.value[V] === 7 && (e.value[V] = 0);
|
|
}
|
|
}, r = (u) => {
|
|
o.value[3] = C(1, 31), f.value = "", e.value = "", u.indexOf("-") >= 0 ? (o.value[3] = D(u, 31, !1), e.value = "null") : u.indexOf("/") >= 0 ? (o.value[3] = O(u, 31), e.value = "null") : u.indexOf("W") >= 0 ? (f.value = "workDay", e.value = Number(u.match(/[0-9]{1,2}/g)[0]), o.value[3] = [e.value]) : u.indexOf("L") >= 0 ? (f.value = "lastDay", e.value = "null", o.value[3] = [31]) : u !== "*" && u !== "?" ? (o.value[3] = w(u), e.value = "null") : u === "*" && (e.value = "null");
|
|
}, c = (u, V) => {
|
|
const t = typeof u == "number" ? new Date(u) : u, i = t.getFullYear(), I = t.getMonth() + 1, p = t.getDate(), R = t.getHours(), P = t.getMinutes(), Q = t.getSeconds(), ve = t.getDay();
|
|
if (V === void 0)
|
|
return i + "-" + (I < 10 ? "0" + I : I) + "-" + (p < 10 ? "0" + p : p) + " " + (R < 10 ? "0" + R : R) + ":" + (P < 10 ? "0" + P : P) + ":" + (Q < 10 ? "0" + Q : Q);
|
|
if (V === "week")
|
|
return ve;
|
|
}, a = (u) => {
|
|
const V = new Date(u), t = c(V);
|
|
return u === t;
|
|
}, A = () => {
|
|
y.value = !1;
|
|
const u = s.ex.split(" ");
|
|
let V = 0;
|
|
const t = [], i = /* @__PURE__ */ new Date(), I = i.getFullYear();
|
|
let p = i.getMonth() + 1, R = i.getDate(), P = i.getHours(), Q = i.getMinutes(), ve = i.getSeconds();
|
|
g(u[0]), F(u[1]), W(u[2]), r(u[3]), h(u[4]), n(u[5]), k(u[6], I);
|
|
const Z = o.value[0], X = o.value[1], J = o.value[2], K = o.value[3], q = o.value[4], ce = o.value[5];
|
|
let ge = x(Z, ve), pe = x(X, Q), me = x(J, P), fe = x(K, R), Ve = x(q, p);
|
|
const he = x(ce, I), _e = function() {
|
|
ge = 0, ve = Z[ge];
|
|
}, ie = function() {
|
|
pe = 0, Q = X[pe], _e();
|
|
}, se = function() {
|
|
me = 0, P = J[me], ie();
|
|
}, ee = function() {
|
|
fe = 0, R = K[fe], se();
|
|
}, te = function() {
|
|
Ve = 0, p = q[Ve], ee();
|
|
};
|
|
I !== ce[he] && te(), p !== q[Ve] && ee(), R !== K[fe] && se(), P !== J[me] && ie(), Q !== X[pe] && _e();
|
|
e:
|
|
for (let ke = he; ke < ce.length; ke++) {
|
|
const G = ce[ke];
|
|
if (p > q[q.length - 1]) {
|
|
te();
|
|
continue;
|
|
}
|
|
l:
|
|
for (let le = Ve; le < q.length; le++) {
|
|
let $ = q[le];
|
|
if ($ = $ < 10 ? "0" + $ : $, R > K[K.length - 1]) {
|
|
if (ee(), le === q.length - 1) {
|
|
te();
|
|
continue e;
|
|
}
|
|
continue;
|
|
}
|
|
a:
|
|
for (let oe = fe; oe < K.length; oe++) {
|
|
let N = K[oe], E = N < 10 ? "0" + N : N;
|
|
if (P > J[J.length - 1]) {
|
|
if (se(), oe === K.length - 1) {
|
|
if (ee(), le === q.length - 1) {
|
|
te();
|
|
continue e;
|
|
}
|
|
continue l;
|
|
}
|
|
continue;
|
|
}
|
|
if (a(G + "-" + $ + "-" + E + " 00:00:00") !== !0 && f.value !== "workDay" && f.value !== "lastWeek" && f.value !== "lastDay") {
|
|
ee();
|
|
continue l;
|
|
}
|
|
if (f.value === "lastDay") {
|
|
if (a(G + "-" + $ + "-" + E + " 00:00:00") !== !0)
|
|
for (; N > 0 && a(G + "-" + $ + "-" + E + " 00:00:00") !== !0; )
|
|
N--, E = N < 10 ? "0" + N : N;
|
|
} else if (f.value === "workDay") {
|
|
if (a(G + "-" + $ + "-" + E + " 00:00:00") !== !0)
|
|
for (; N > 0 && a(G + "-" + $ + "-" + E + " 00:00:00") !== !0; )
|
|
N--, E = N < 10 ? "0" + N : N;
|
|
const Y = c(/* @__PURE__ */ new Date(G + "-" + $ + "-" + E + " 00:00:00"), "week");
|
|
Y === 0 ? (N++, E = N < 10 ? "0" + N : N, a(G + "-" + $ + "-" + E + " 00:00:00") !== !0 && (N -= 3)) : Y === 6 && (e.value !== 1 ? N-- : N += 2);
|
|
} else if (f.value === "weekDay") {
|
|
const Y = c(/* @__PURE__ */ new Date(G + "-" + $ + "-" + N + " 00:00:00"), "week");
|
|
if (Array.indexOf(e.value, Y) < 0) {
|
|
if (oe === K.length - 1) {
|
|
if (ee(), le === q.length - 1) {
|
|
te();
|
|
continue e;
|
|
}
|
|
continue l;
|
|
}
|
|
continue;
|
|
}
|
|
} else if (f.value === "assWeek") {
|
|
const Y = c(/* @__PURE__ */ new Date(G + "-" + $ + "-" + N + " 00:00:00"), "week");
|
|
e.value[1] >= Y ? N = (e.value[0] - 1) * 7 + e.value[1] - Y + 1 : N = e.value[0] * 7 + e.value[1] - Y + 1;
|
|
} else if (f.value === "lastWeek") {
|
|
if (a(G + "-" + $ + "-" + E + " 00:00:00") !== !0)
|
|
for (; N > 0 && a(G + "-" + $ + "-" + E + " 00:00:00") !== !0; )
|
|
N--, E = N < 10 ? "0" + N : N;
|
|
const Y = c(/* @__PURE__ */ new Date(G + "-" + $ + "-" + E + " 00:00:00"), "week");
|
|
e.value < Y ? N -= Y - e.value : e.value > Y && (N -= 7 - (e.value - Y));
|
|
}
|
|
N = N < 10 ? "0" + N : N;
|
|
u:
|
|
for (let Y = me; Y < J.length; Y++) {
|
|
const Ue = J[Y] < 10 ? "0" + J[Y] : J[Y];
|
|
if (Q > X[X.length - 1]) {
|
|
if (ie(), Y === J.length - 1) {
|
|
if (se(), oe === K.length - 1) {
|
|
if (ee(), le === q.length - 1) {
|
|
te();
|
|
continue e;
|
|
}
|
|
continue l;
|
|
}
|
|
continue a;
|
|
}
|
|
continue;
|
|
}
|
|
t:
|
|
for (let de = pe; de < X.length; de++) {
|
|
const we = X[de] < 10 ? "0" + X[de] : X[de];
|
|
if (ve > Z[Z.length - 1]) {
|
|
if (_e(), de === X.length - 1) {
|
|
if (ie(), Y === J.length - 1) {
|
|
if (se(), oe === K.length - 1) {
|
|
if (ee(), le === q.length - 1) {
|
|
te();
|
|
continue e;
|
|
}
|
|
continue l;
|
|
}
|
|
continue a;
|
|
}
|
|
continue u;
|
|
}
|
|
continue;
|
|
}
|
|
for (let re = ge; re <= Z.length - 1; re++) {
|
|
const Ce = Z[re] < 10 ? "0" + Z[re] : Z[re];
|
|
if ($ !== "00" && N !== "00" && (t.push(G + "-" + $ + "-" + N + " " + Ue + ":" + we + ":" + Ce), V++), V === 5)
|
|
break e;
|
|
if (re === Z.length - 1) {
|
|
if (_e(), de === X.length - 1) {
|
|
if (ie(), Y === J.length - 1) {
|
|
if (se(), oe === K.length - 1) {
|
|
if (ee(), le === q.length - 1) {
|
|
te();
|
|
continue e;
|
|
}
|
|
continue l;
|
|
}
|
|
continue a;
|
|
}
|
|
continue u;
|
|
}
|
|
continue t;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
t.length === 0 ? v.value = ["没有达到条件的结果!"] : (v.value = t, t.length !== 5 && v.value.push("最近100年内只有上面" + t.length + "条结果!")), y.value = !0;
|
|
};
|
|
return S(() => s.ex, () => {
|
|
A();
|
|
}, { deep: !0 }), ye(() => {
|
|
A();
|
|
}), (u, V) => (M(), B("div", Ye, [
|
|
Fe,
|
|
j("ul", Ie, [
|
|
y.value ? (M(!0), B(ae, { key: 0 }, ue(v.value, (t) => (M(), B("li", { key: t }, z(t), 1))), 128)) : (M(), B("li", $e, "计算结果中..."))
|
|
])
|
|
]));
|
|
}
|
|
};
|
|
const He = (L, s) => {
|
|
const f = L.__vccOpts || L;
|
|
for (const [e, o] of s)
|
|
f[e] = o;
|
|
return f;
|
|
}, xe = (L) => (Ne("data-v-8ae49d29"), L = L(), Oe(), L), Re = { class: "popup-main" }, Ee = { class: "popup-result" }, Be = /* @__PURE__ */ xe(() => /* @__PURE__ */ j("p", { class: "title" }, "时间表达式", -1)), Pe = /* @__PURE__ */ xe(() => /* @__PURE__ */ j("th", null, "crontab完整表达式", -1)), qe = { class: "pop_btn" }, Ge = {
|
|
name: "vue3-cron-plus-picker"
|
|
}, Je = /* @__PURE__ */ Object.assign(Ge, {
|
|
props: {
|
|
expression: String,
|
|
hideComponent: String
|
|
},
|
|
emits: ["hide", "fill"],
|
|
setup(L, { emit: s }) {
|
|
const f = L, e = De(), o = be(["秒", "分钟", "小时", "日", "月", "周", "年"]);
|
|
b(0), b(0);
|
|
const v = be({
|
|
second: "*",
|
|
min: "*",
|
|
hour: "*",
|
|
day: "*",
|
|
mouth: "*",
|
|
week: "?",
|
|
year: ""
|
|
}), y = T(() => {
|
|
const g = v;
|
|
return g.second + " " + g.min + " " + g.hour + " " + g.day + " " + g.mouth + " " + g.week + (g.year === "" ? "" : " " + g.year);
|
|
}), _ = (g) => !(f.hideComponent && f.hideComponent.includes(g)), x = (g, k) => {
|
|
const h = ["second", "min", "hour", "mouth"], n = "cron" + g;
|
|
let r;
|
|
const c = e.refs;
|
|
if (c[n]) {
|
|
if (h.includes(g))
|
|
if (k === "*")
|
|
r = 1;
|
|
else if (k.indexOf("-") > -1) {
|
|
const a = k.split("-");
|
|
isNaN(a[0]) ? c[n].cycle01 = 0 : c[n].cycle01 = a[0], c[n].cycle02 = a[1], r = 2;
|
|
} else if (k.indexOf("/") > -1) {
|
|
const a = k.split("/");
|
|
isNaN(a[0]) ? c[n].average01 = 0 : c[n].average01 = a[0], c[n].average02 = a[1], r = 3;
|
|
} else
|
|
r = 4, c[n].checkboxList = k.split(",");
|
|
else if (g === "day")
|
|
if (k === "*")
|
|
r = 1;
|
|
else if (k === "?")
|
|
r = 2;
|
|
else if (k.indexOf("-") > -1) {
|
|
const a = k.split("-");
|
|
isNaN(a[0]) ? c[n].cycle01 = 0 : c[n].cycle01 = a[0], c[n].cycle02 = a[1], r = 3;
|
|
} else if (k.indexOf("/") > -1) {
|
|
const a = k.split("/");
|
|
isNaN(a[0]) ? c[n].average01 = 0 : c[n].average01 = a[0], c[n].average02 = a[1], r = 4;
|
|
} else if (k.indexOf("W") > -1) {
|
|
const a = k.split("W");
|
|
isNaN(a[0]) ? c[n].workday = 0 : c[n].workday = a[0], r = 5;
|
|
} else
|
|
k === "L" ? r = 6 : (c[n].checkboxList = k.split(","), r = 7);
|
|
else if (g === "week")
|
|
if (k === "*")
|
|
r = 1;
|
|
else if (k === "?")
|
|
r = 2;
|
|
else if (k.indexOf("-") > -1) {
|
|
const a = k.split("-");
|
|
isNaN(a[0]) ? c[n].cycle01 = 0 : c[n].cycle01 = a[0], c[n].cycle02 = a[1], r = 3;
|
|
} else if (k.indexOf("#") > -1) {
|
|
const a = k.split("#");
|
|
isNaN(a[0]) ? c[n].average01 = 1 : c[n].average01 = a[0], c[n].average02 = a[1], r = 4;
|
|
} else if (k.indexOf("L") > -1) {
|
|
const a = k.split("L");
|
|
isNaN(a[0]) ? c[n].weekday = 1 : c[n].weekday = a[0], r = 5;
|
|
} else
|
|
c[n].checkboxList = k.split(","), r = 7;
|
|
else
|
|
g === "year" && (k === "" ? r = 1 : k === "*" ? r = 2 : k.indexOf("-") > -1 ? r = 3 : k.indexOf("/") > -1 ? r = 4 : (c[n].checkboxList = k.split(","), r = 5));
|
|
c[n].radioValue = r;
|
|
}
|
|
}, C = () => {
|
|
v.second = "*", v.min = "*", v.hour = "*", v.day = "*", v.mouth = "*", v.week = "?", v.year = "*";
|
|
for (const g in v)
|
|
x(g, v[g]);
|
|
}, w = () => {
|
|
if (f.expression) {
|
|
const g = f.expression.split(" ");
|
|
if (g.length >= 6) {
|
|
const k = {
|
|
second: g[0],
|
|
min: g[1],
|
|
hour: g[2],
|
|
day: g[3],
|
|
mouth: g[4],
|
|
week: g[5],
|
|
year: g[6] ? g[6] : ""
|
|
};
|
|
for (const h in k)
|
|
v[h] = k[h];
|
|
for (const h in k)
|
|
k[h] && x(h, k[h]);
|
|
}
|
|
} else
|
|
C();
|
|
}, O = (g, k, h) => {
|
|
v[g] = k, h && h !== g && x(g, k);
|
|
}, D = (g, k, h) => (g = Math.floor(g), g < k ? g = k : g > h && (g = h), g), W = () => {
|
|
s("hide");
|
|
}, F = () => {
|
|
s("fill", y.value), W();
|
|
};
|
|
return ye(() => {
|
|
w();
|
|
}), S(() => f.expression, () => {
|
|
w();
|
|
}, { deep: !0 }), (g, k) => {
|
|
const h = U("el-tab-pane"), n = U("el-tabs"), r = U("el-button");
|
|
return M(), B("div", null, [
|
|
l(n, { type: "border-card" }, {
|
|
default: d(() => [
|
|
_("second") ? (M(), H(h, {
|
|
key: 0,
|
|
label: "秒"
|
|
}, {
|
|
default: d(() => [
|
|
l(Ae, {
|
|
onUpdate: O,
|
|
check: D,
|
|
ref: "cronsecond"
|
|
}, null, 512)
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0),
|
|
_("min") ? (M(), H(h, {
|
|
key: 1,
|
|
label: "分钟"
|
|
}, {
|
|
default: d(() => [
|
|
l(Se, {
|
|
onUpdate: O,
|
|
check: D,
|
|
cron: v,
|
|
ref: "cronmin"
|
|
}, null, 8, ["cron"])
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0),
|
|
_("hour") ? (M(), H(h, {
|
|
key: 2,
|
|
label: "小时"
|
|
}, {
|
|
default: d(() => [
|
|
l(Me, {
|
|
onUpdate: O,
|
|
check: D,
|
|
cron: v,
|
|
ref: "cronhour"
|
|
}, null, 8, ["cron"])
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0),
|
|
_("day") ? (M(), H(h, {
|
|
key: 3,
|
|
label: "日"
|
|
}, {
|
|
default: d(() => [
|
|
l(Le, {
|
|
onUpdate: O,
|
|
check: D,
|
|
cron: v,
|
|
ref: "cronday"
|
|
}, null, 8, ["cron"])
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0),
|
|
_("mouth") ? (M(), H(h, {
|
|
key: 4,
|
|
label: "月"
|
|
}, {
|
|
default: d(() => [
|
|
l(je, {
|
|
onUpdate: O,
|
|
check: D,
|
|
cron: v,
|
|
ref: "cronmouth"
|
|
}, null, 8, ["cron"])
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0),
|
|
_("week") ? (M(), H(h, {
|
|
key: 5,
|
|
label: "周"
|
|
}, {
|
|
default: d(() => [
|
|
l(Te, {
|
|
onUpdate: O,
|
|
check: D,
|
|
cron: v,
|
|
ref: "cronweek"
|
|
}, null, 8, ["cron"])
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0),
|
|
_("year") ? (M(), H(h, {
|
|
key: 6,
|
|
label: "年"
|
|
}, {
|
|
default: d(() => [
|
|
l(We, {
|
|
onUpdate: O,
|
|
check: D,
|
|
cron: v,
|
|
ref: "cronyear"
|
|
}, null, 8, ["cron"])
|
|
]),
|
|
_: 1
|
|
})) : ne("", !0)
|
|
]),
|
|
_: 1
|
|
}),
|
|
j("div", Re, [
|
|
j("div", Ee, [
|
|
Be,
|
|
j("table", null, [
|
|
j("thead", null, [
|
|
(M(!0), B(ae, null, ue(o, (c) => (M(), B("th", {
|
|
width: "40",
|
|
key: c
|
|
}, z(c), 1))), 128)),
|
|
Pe
|
|
]),
|
|
j("tbody", null, [
|
|
j("td", null, [
|
|
j("span", null, z(v.second), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(v.min), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(v.hour), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(v.day), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(v.mouth), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(v.week), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(v.year), 1)
|
|
]),
|
|
j("td", null, [
|
|
j("span", null, z(y.value), 1)
|
|
])
|
|
])
|
|
])
|
|
]),
|
|
_("result") ? (M(), H(ze, {
|
|
key: 0,
|
|
ex: y.value
|
|
}, null, 8, ["ex"])) : ne("", !0),
|
|
j("div", qe, [
|
|
l(r, {
|
|
size: "small",
|
|
type: "primary",
|
|
onClick: F
|
|
}, {
|
|
default: d(() => [
|
|
m("确定")
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(r, {
|
|
size: "small",
|
|
type: "warning",
|
|
onClick: C
|
|
}, {
|
|
default: d(() => [
|
|
m("重置")
|
|
]),
|
|
_: 1
|
|
}),
|
|
l(r, {
|
|
size: "small",
|
|
onClick: W
|
|
}, {
|
|
default: d(() => [
|
|
m("取消")
|
|
]),
|
|
_: 1
|
|
})
|
|
])
|
|
])
|
|
]);
|
|
};
|
|
}
|
|
}), Ke = /* @__PURE__ */ He(Je, [["__scopeId", "data-v-8ae49d29"]]), Qe = [Ke], Xe = function(L) {
|
|
Qe.forEach((s) => {
|
|
L.component(s.name, s);
|
|
});
|
|
}, el = { install: Xe };
|
|
export {
|
|
Ke as Vue3CronPlusPicker,
|
|
el as default
|
|
};
|