@web-utils/component 3.8.1 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vue-cron/index.mjs +360 -284
- package/vue-cron/style.css +1 -1
- package/web-types.json +9 -1
package/package.json
CHANGED
package/vue-cron/index.mjs
CHANGED
|
@@ -1,69 +1,72 @@
|
|
|
1
1
|
var W = (n, e, t) => new Promise((s, a) => {
|
|
2
|
-
var
|
|
2
|
+
var i = (o) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
4
|
+
c(t.next(o));
|
|
5
5
|
} catch (l) {
|
|
6
6
|
a(l);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, r = (o) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
10
|
+
c(t.throw(o));
|
|
11
11
|
} catch (l) {
|
|
12
12
|
a(l);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, c = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, r);
|
|
15
|
+
c((t = t.apply(n, e)).next());
|
|
16
16
|
});
|
|
17
17
|
import { formatDate as H } from "@web-utils/integrations/dayjs";
|
|
18
18
|
import { copy as L } from "@web-utils/core";
|
|
19
19
|
import { n as F } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
20
|
-
const
|
|
20
|
+
const Y = {
|
|
21
21
|
Seconds: {
|
|
22
22
|
name: "秒",
|
|
23
|
-
every: "每秒钟,允许的通配符[, -
|
|
23
|
+
every: "每秒钟,允许的通配符[* / , -]",
|
|
24
24
|
interval: ["从", "秒钟开始,每", "秒钟执行一次"],
|
|
25
25
|
specific: "指定",
|
|
26
26
|
cycle: ["周期从", " - ", "秒"]
|
|
27
27
|
},
|
|
28
28
|
Minutes: {
|
|
29
29
|
name: "分",
|
|
30
|
-
every: "每分钟,允许的通配符[, -
|
|
30
|
+
every: "每分钟,允许的通配符[* / , -]",
|
|
31
31
|
interval: ["从", "分钟开始,每", "分钟执行一次"],
|
|
32
32
|
specific: "指定",
|
|
33
33
|
cycle: ["周期从", " - ", "分"]
|
|
34
34
|
},
|
|
35
35
|
Hours: {
|
|
36
36
|
name: "时",
|
|
37
|
-
every: "每小时,允许的通配符[, -
|
|
37
|
+
every: "每小时,允许的通配符[* / , -]",
|
|
38
38
|
interval: ["从", "小时开始,每", "小时执行一次"],
|
|
39
39
|
specific: "指定",
|
|
40
40
|
cycle: ["周期从", " - ", "小时"]
|
|
41
41
|
},
|
|
42
42
|
Day: {
|
|
43
43
|
name: "天",
|
|
44
|
-
every: "
|
|
45
|
-
|
|
46
|
-
intervalDay: ["从", "天开始,每", "天执行一次"],
|
|
47
|
-
specificWeek: "指定星期",
|
|
44
|
+
every: "每一天,允许的通配符[* / , - L W]",
|
|
45
|
+
intervalDay: ["从第", "天开始,每", "天执行一次"],
|
|
48
46
|
specificDay: "指定天",
|
|
49
|
-
lastDay: "
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
lastDay: "每月的最后一天",
|
|
48
|
+
lastWorkday: "每月的最后一个工作日",
|
|
49
|
+
beforeEndMonth: ["每月倒数第", "天"],
|
|
50
|
+
nearestWorkday: ["距离本月", "号最近的一个工作日(周一至周五)"]
|
|
51
|
+
},
|
|
52
|
+
Week: {
|
|
53
|
+
name: "周",
|
|
54
|
+
every: "每周,允许的通配符[* / , - L #]",
|
|
55
|
+
intervalWeek: ["从", "开始,每", "天执行一次"],
|
|
56
|
+
specificWeek: "指定星期",
|
|
57
|
+
lastWeek: ["每月的最后一个"],
|
|
58
|
+
someWeekday: ["每月第", "周的"]
|
|
55
59
|
},
|
|
56
|
-
Week: ["天", "一", "二", "三", "四", "五", "六"].map((n) => `星期${n}`),
|
|
57
60
|
Month: {
|
|
58
61
|
name: "月",
|
|
59
|
-
every: "
|
|
62
|
+
every: "每个月,允许的通配符[* / , -]",
|
|
60
63
|
interval: ["从", "月开始,每", "月执行一次"],
|
|
61
64
|
specific: "指定",
|
|
62
65
|
cycle: ["周期从", " - ", "月"]
|
|
63
66
|
},
|
|
64
67
|
Year: {
|
|
65
68
|
name: "年",
|
|
66
|
-
every: "
|
|
69
|
+
every: "每一年,允许的通配符[* / , -]",
|
|
67
70
|
interval: ["从", "年开始,每", "年执行一次"],
|
|
68
71
|
specific: "指定",
|
|
69
72
|
cycle: ["周期从", " - ", "年"]
|
|
@@ -82,7 +85,7 @@ const T = {
|
|
|
82
85
|
"@daily": "0 0 0 * * * *",
|
|
83
86
|
"@midnight": "0 0 0 * * * *",
|
|
84
87
|
"@hourly": "0 0 * * * * *"
|
|
85
|
-
},
|
|
88
|
+
}, R = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], U = new RegExp(R.join("|"), "g"), M = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], B = new RegExp(M.join("|"), "g"), g = 275759;
|
|
86
89
|
var S;
|
|
87
90
|
(function(n) {
|
|
88
91
|
n.IncrementLargerThanRange = "IncrementLargerThanRange";
|
|
@@ -100,57 +103,57 @@ function C(n) {
|
|
|
100
103
|
t.push("*");
|
|
101
104
|
}
|
|
102
105
|
return [
|
|
103
|
-
new
|
|
104
|
-
new
|
|
106
|
+
new O(t[0]),
|
|
107
|
+
new O(t[1]),
|
|
105
108
|
new P(t[2]),
|
|
106
109
|
new V(t[3], t[5]),
|
|
107
110
|
new j(t[4]),
|
|
108
|
-
new
|
|
111
|
+
new G(t[6])
|
|
109
112
|
];
|
|
110
113
|
}
|
|
111
|
-
function
|
|
114
|
+
function E(n, e, t) {
|
|
112
115
|
const s = [];
|
|
113
116
|
for (let a of n) {
|
|
114
|
-
let
|
|
115
|
-
a.step > 1 && a.step > (
|
|
117
|
+
let i;
|
|
118
|
+
a.step > 1 && a.step > (i = a.rangeLength(e, t)) && s.push({
|
|
116
119
|
type: S.IncrementLargerThanRange,
|
|
117
|
-
message: `Increment (${a.step}) is larger than range (${
|
|
120
|
+
message: `Increment (${a.step}) is larger than range (${i}) for expression '${a.itemString}'`
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
return s;
|
|
121
124
|
}
|
|
122
|
-
class
|
|
125
|
+
class f {
|
|
123
126
|
constructor(e) {
|
|
124
127
|
this.field = e;
|
|
125
128
|
}
|
|
126
129
|
parse() {
|
|
127
|
-
return this.field.split(",").map((e) =>
|
|
130
|
+
return this.field.split(",").map((e) => y.parse(e, this.first, this.last, !0));
|
|
128
131
|
}
|
|
129
132
|
get items() {
|
|
130
133
|
return this._items || (this._items = this.parse()), this._items;
|
|
131
134
|
}
|
|
132
135
|
get values() {
|
|
133
|
-
return
|
|
136
|
+
return f.getValues(this.items, this.first, this.last);
|
|
134
137
|
}
|
|
135
138
|
get warnings() {
|
|
136
|
-
return
|
|
139
|
+
return E(this.items, this.first, this.last);
|
|
137
140
|
}
|
|
138
141
|
static getValues(e, t, s) {
|
|
139
142
|
return Array.from(new Set(b(e, (a) => a.values(t, s)))).sort(w);
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
|
-
class
|
|
145
|
+
class y {
|
|
143
146
|
constructor(e) {
|
|
144
147
|
this.itemString = e, this.step = 1;
|
|
145
148
|
}
|
|
146
149
|
rangeLength(e, t) {
|
|
147
|
-
var s, a,
|
|
148
|
-
const
|
|
149
|
-
return
|
|
150
|
+
var s, a, i, r;
|
|
151
|
+
const c = (a = (s = this.range) === null || s === void 0 ? void 0 : s.from) !== null && a !== void 0 ? a : e, o = (r = (i = this.range) === null || i === void 0 ? void 0 : i.to) !== null && r !== void 0 ? r : t;
|
|
152
|
+
return o < c ? t - c + (o - e) + 1 : o - c;
|
|
150
153
|
}
|
|
151
154
|
values(e, t) {
|
|
152
155
|
const s = this.range ? this.range.from : e, a = this.rangeLength(e, t);
|
|
153
|
-
return Array(Math.floor(a / this.step) + 1).fill(0).map((
|
|
156
|
+
return Array(Math.floor(a / this.step) + 1).fill(0).map((i, r) => e + (s - e + this.step * r) % (t - e + 1));
|
|
154
157
|
}
|
|
155
158
|
get any() {
|
|
156
159
|
return this.range === void 0 && this.step === 1;
|
|
@@ -158,41 +161,41 @@ class f {
|
|
|
158
161
|
get single() {
|
|
159
162
|
return !!this.range && this.range.from === this.range.to;
|
|
160
163
|
}
|
|
161
|
-
static parse(e, t, s, a = !1,
|
|
162
|
-
var
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
164
|
+
static parse(e, t, s, a = !1, i) {
|
|
165
|
+
var r;
|
|
166
|
+
const c = new y(e), [o, l, d, m, p] = (r = e.match(/^(?:(\*)|([0-9]+)|([0-9]+-[0-9]+))(?:\/([1-9][0-9]*))?$/)) !== null && r !== void 0 ? r : [];
|
|
167
|
+
if (!o)
|
|
165
168
|
throw new Error("Field item invalid format");
|
|
166
|
-
if (
|
|
169
|
+
if (p && (c.step = parseInt(p, 10)), d) {
|
|
167
170
|
let u = parseInt(d, 10);
|
|
168
|
-
if (u =
|
|
171
|
+
if (u = i ? i(u) : u, u < t || u > s)
|
|
169
172
|
throw new Error("Field item out of valid value range");
|
|
170
|
-
|
|
173
|
+
c.range = {
|
|
171
174
|
from: u,
|
|
172
|
-
to:
|
|
175
|
+
to: p ? void 0 : u
|
|
173
176
|
};
|
|
174
|
-
} else if (
|
|
175
|
-
const [u,
|
|
177
|
+
} else if (m) {
|
|
178
|
+
const [u, k] = m.split("-").map((N) => {
|
|
176
179
|
const I = parseInt(N, 10);
|
|
177
|
-
return
|
|
180
|
+
return i ? i(I) : I;
|
|
178
181
|
});
|
|
179
|
-
if (u < t || u > s ||
|
|
182
|
+
if (u < t || u > s || k < t || k > s || k < u && !a)
|
|
180
183
|
throw new Error("Field item range invalid, either value out of valid range or start greater than end in non wraparound field");
|
|
181
|
-
|
|
184
|
+
c.range = {
|
|
182
185
|
from: u,
|
|
183
|
-
to:
|
|
186
|
+
to: k
|
|
184
187
|
};
|
|
185
188
|
}
|
|
186
|
-
return
|
|
189
|
+
return c;
|
|
187
190
|
}
|
|
188
191
|
}
|
|
189
|
-
|
|
190
|
-
class
|
|
192
|
+
y.asterisk = new y("*");
|
|
193
|
+
class O extends f {
|
|
191
194
|
constructor() {
|
|
192
195
|
super(...arguments), this.first = 0, this.last = 59;
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
|
-
class P extends
|
|
198
|
+
class P extends f {
|
|
196
199
|
constructor() {
|
|
197
200
|
super(...arguments), this.first = 0, this.last = 23;
|
|
198
201
|
}
|
|
@@ -200,23 +203,23 @@ class P extends y {
|
|
|
200
203
|
class V {
|
|
201
204
|
constructor(e, t) {
|
|
202
205
|
this.lastDay = !1, this.lastWeekday = !1, this.daysItems = [], this.nearestWeekdayItems = [], this.daysOfWeekItems = [], this.lastDaysOfWeekItems = [], this.nthDaysOfWeekItems = [];
|
|
203
|
-
for (let
|
|
204
|
-
|
|
205
|
-
const s = t.replace(B, (
|
|
206
|
-
for (let
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
this.lastDaysOfWeekItems.push(a(
|
|
210
|
-
else if (
|
|
211
|
-
const
|
|
212
|
-
if (!/^[1-5]$/.test(
|
|
206
|
+
for (let i of e.split(",").map((r) => r === "?" ? "*" : r))
|
|
207
|
+
i === "l" ? this.lastDay = !0 : i === "lw" ? this.lastWeekday = !0 : i.endsWith("w") ? this.nearestWeekdayItems.push(y.parse(i.slice(0, -1), 1, 31)) : this.daysItems.push(y.parse(i, 1, 31));
|
|
208
|
+
const s = t.replace(B, (i) => M.indexOf(i) + ""), a = (i) => y.parse(i, 0, 6, !0, (r) => r === 7 ? 0 : r);
|
|
209
|
+
for (let i of s.split(",").map((r) => r === "?" ? "*" : r)) {
|
|
210
|
+
const r = i.lastIndexOf("#");
|
|
211
|
+
if (i.endsWith("l"))
|
|
212
|
+
this.lastDaysOfWeekItems.push(a(i.slice(0, -1)));
|
|
213
|
+
else if (r !== -1) {
|
|
214
|
+
const c = i.slice(r + 1);
|
|
215
|
+
if (!/^[1-5]$/.test(c))
|
|
213
216
|
throw new Error("Field item nth of month (#) invalid");
|
|
214
217
|
this.nthDaysOfWeekItems.push({
|
|
215
|
-
item: a(
|
|
216
|
-
nth: parseInt(
|
|
218
|
+
item: a(i.slice(0, r)),
|
|
219
|
+
nth: parseInt(c, 10)
|
|
217
220
|
});
|
|
218
221
|
} else
|
|
219
|
-
this.daysOfWeekItems.push(a(
|
|
222
|
+
this.daysOfWeekItems.push(a(i));
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
get values() {
|
|
@@ -231,7 +234,7 @@ class V {
|
|
|
231
234
|
...this.lastDaysOfWeekItems,
|
|
232
235
|
...this.nthDaysOfWeekItems.map(({ item: a }) => a)
|
|
233
236
|
];
|
|
234
|
-
return e.push(...
|
|
237
|
+
return e.push(...E(t, 1, 31), ...E(s, 0, 6)), e;
|
|
235
238
|
}
|
|
236
239
|
get allDays() {
|
|
237
240
|
return !this.lastDay && !this.lastWeekday && !this.nearestWeekdayItems.length && !this.lastDaysOfWeekItems.length && !this.nthDaysOfWeekItems.length && this.daysItems.length === 1 && this.daysItems[0].any && this.daysOfWeekItems.length === 1 && this.daysOfWeekItems[0].any;
|
|
@@ -242,105 +245,105 @@ class D {
|
|
|
242
245
|
this.lastDay = !1, this.lastWeekday = !1, this.days = [], this.nearestWeekday = [], this.daysOfWeek = [], this.lastDaysOfWeek = [], this.nthDaysOfWeek = [];
|
|
243
246
|
}
|
|
244
247
|
static fromField(e) {
|
|
245
|
-
const t = new D(), s = (
|
|
246
|
-
t.lastDay = e.lastDay, t.lastWeekday = e.lastWeekday, t.days =
|
|
248
|
+
const t = new D(), s = (i) => i.filter((r) => !r.any);
|
|
249
|
+
t.lastDay = e.lastDay, t.lastWeekday = e.lastWeekday, t.days = f.getValues(e.allDays ? [y.asterisk] : s(e.daysItems), 1, 31), t.nearestWeekday = f.getValues(e.nearestWeekdayItems, 1, 31), t.daysOfWeek = f.getValues(s(e.daysOfWeekItems), 0, 6), t.lastDaysOfWeek = f.getValues(e.lastDaysOfWeekItems, 0, 6);
|
|
247
250
|
const a = /* @__PURE__ */ new Set();
|
|
248
|
-
for (let
|
|
249
|
-
for (let
|
|
250
|
-
let
|
|
251
|
-
a.has(
|
|
251
|
+
for (let i of e.nthDaysOfWeekItems)
|
|
252
|
+
for (let r of i.item.values(0, 6)) {
|
|
253
|
+
let c = r * 10 + i.nth;
|
|
254
|
+
a.has(c) || (a.add(c), t.nthDaysOfWeek.push([r, i.nth]));
|
|
252
255
|
}
|
|
253
256
|
return t;
|
|
254
257
|
}
|
|
255
258
|
getDays(e, t) {
|
|
256
|
-
const s = new Set(this.days), a = new Date(e, t, 0).getDate(),
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
let l =
|
|
259
|
+
const s = new Set(this.days), a = new Date(e, t, 0).getDate(), i = new Date(e, t - 1, 1).getDay(), r = (c) => {
|
|
260
|
+
c > a && (c = a);
|
|
261
|
+
const o = (c + i - 1) % 7;
|
|
262
|
+
let l = c + (o === 0 ? 1 : o === 6 ? -1 : 0);
|
|
260
263
|
return l + (l < 1 ? 3 : l > a ? -3 : 0);
|
|
261
264
|
};
|
|
262
|
-
this.lastDay && s.add(a), this.lastWeekday && s.add(
|
|
263
|
-
for (const
|
|
264
|
-
s.add(
|
|
265
|
+
this.lastDay && s.add(a), this.lastWeekday && s.add(r(a));
|
|
266
|
+
for (const c of this.nearestWeekday)
|
|
267
|
+
s.add(r(c));
|
|
265
268
|
if (this.daysOfWeek.length || this.lastDaysOfWeek.length || this.nthDaysOfWeek.length) {
|
|
266
|
-
const
|
|
267
|
-
for (let
|
|
268
|
-
|
|
269
|
-
for (const
|
|
270
|
-
for (const l of o
|
|
269
|
+
const c = Array(7).fill(0).map(() => []);
|
|
270
|
+
for (let o = 1; o < 36; o++)
|
|
271
|
+
c[(o + i - 1) % 7].push(o);
|
|
272
|
+
for (const o of this.daysOfWeek)
|
|
273
|
+
for (const l of c[o])
|
|
271
274
|
s.add(l);
|
|
272
|
-
for (const
|
|
273
|
-
for (let l = o
|
|
274
|
-
if (o
|
|
275
|
-
s.add(o
|
|
275
|
+
for (const o of this.lastDaysOfWeek)
|
|
276
|
+
for (let l = c[o].length - 1; l >= 0; l--)
|
|
277
|
+
if (c[o][l] <= a) {
|
|
278
|
+
s.add(c[o][l]);
|
|
276
279
|
break;
|
|
277
280
|
}
|
|
278
|
-
for (const [
|
|
279
|
-
s.add(o
|
|
281
|
+
for (const [o, l] of this.nthDaysOfWeek)
|
|
282
|
+
s.add(c[o][l - 1]);
|
|
280
283
|
}
|
|
281
|
-
return Array.from(s).filter((
|
|
284
|
+
return Array.from(s).filter((c) => c <= a).sort(w);
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
|
-
class j extends
|
|
287
|
+
class j extends f {
|
|
285
288
|
constructor(e) {
|
|
286
|
-
super(e.replace(
|
|
289
|
+
super(e.replace(U, (t) => R.indexOf(t) + 1 + "")), this.first = 1, this.last = 12;
|
|
287
290
|
}
|
|
288
291
|
}
|
|
289
|
-
class
|
|
292
|
+
class G extends f {
|
|
290
293
|
constructor(e) {
|
|
291
294
|
super(e), this.first = 1970, this.last = 2099, this.items;
|
|
292
295
|
}
|
|
293
296
|
parse() {
|
|
294
|
-
return this.field.split(",").map((e) =>
|
|
297
|
+
return this.field.split(",").map((e) => y.parse(e, 0, g));
|
|
295
298
|
}
|
|
296
299
|
get warnings() {
|
|
297
|
-
return
|
|
300
|
+
return E(this.items, this.first, g);
|
|
298
301
|
}
|
|
299
302
|
nextYear(e) {
|
|
300
303
|
var t;
|
|
301
304
|
return (t = this.items.reduce((s, a) => {
|
|
302
|
-
var r,
|
|
305
|
+
var i, r, c, o;
|
|
303
306
|
if (a.any)
|
|
304
307
|
s.push(e);
|
|
305
308
|
else if (a.single) {
|
|
306
309
|
const l = a.range.from;
|
|
307
310
|
l >= e && s.push(l);
|
|
308
311
|
} else {
|
|
309
|
-
const l = (
|
|
312
|
+
const l = (r = (i = a.range) === null || i === void 0 ? void 0 : i.from) !== null && r !== void 0 ? r : this.first;
|
|
310
313
|
if (l > e)
|
|
311
314
|
s.push(l);
|
|
312
315
|
else {
|
|
313
316
|
const d = l + Math.ceil((e - l) / a.step) * a.step;
|
|
314
|
-
d <= ((
|
|
317
|
+
d <= ((o = (c = a.range) === null || c === void 0 ? void 0 : c.to) !== null && o !== void 0 ? o : g) && s.push(d);
|
|
315
318
|
}
|
|
316
319
|
}
|
|
317
320
|
return s;
|
|
318
321
|
}, []).sort(w)[0]) !== null && t !== void 0 ? t : null;
|
|
319
322
|
}
|
|
320
323
|
}
|
|
321
|
-
class
|
|
322
|
-
constructor(e, t = 1, s = 1, a = 0,
|
|
323
|
-
this.year = e, this.month = t, this.day = s, this.hour = a, this.minute =
|
|
324
|
+
class h {
|
|
325
|
+
constructor(e, t = 1, s = 1, a = 0, i = 0, r = 0) {
|
|
326
|
+
this.year = e, this.month = t, this.day = s, this.hour = a, this.minute = i, this.second = r;
|
|
324
327
|
}
|
|
325
328
|
static fromDate(e, t) {
|
|
326
|
-
return t ? t.nativeDateToCronosDate(e) : new
|
|
329
|
+
return t ? t.nativeDateToCronosDate(e) : new h(e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds());
|
|
327
330
|
}
|
|
328
331
|
toDate(e) {
|
|
329
332
|
return e ? e.cronosDateToNativeDate(this) : new Date(this.year, this.month - 1, this.day, this.hour, this.minute, this.second);
|
|
330
333
|
}
|
|
331
334
|
static fromUTCTimestamp(e) {
|
|
332
335
|
const t = new Date(e);
|
|
333
|
-
return new
|
|
336
|
+
return new h(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate(), t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds());
|
|
334
337
|
}
|
|
335
338
|
toUTCTimestamp() {
|
|
336
339
|
return Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second);
|
|
337
340
|
}
|
|
338
|
-
copyWith({ year: e = this.year, month: t = this.month, day: s = this.day, hour: a = this.hour, minute:
|
|
339
|
-
return new
|
|
341
|
+
copyWith({ year: e = this.year, month: t = this.month, day: s = this.day, hour: a = this.hour, minute: i = this.minute, second: r = this.second } = {}) {
|
|
342
|
+
return new h(e, t, s, a, i, r);
|
|
340
343
|
}
|
|
341
344
|
}
|
|
342
345
|
const _ = /* @__PURE__ */ new Map();
|
|
343
|
-
class
|
|
346
|
+
class z {
|
|
344
347
|
constructor(e) {
|
|
345
348
|
if (typeof e == "number") {
|
|
346
349
|
if (e > 840 || e < -840)
|
|
@@ -384,48 +387,48 @@ class O {
|
|
|
384
387
|
offset(e) {
|
|
385
388
|
if (!this.dateTimeFormat)
|
|
386
389
|
return this.fixedOffset || 0;
|
|
387
|
-
const t = new Date(e), { year: s, month: a, day:
|
|
390
|
+
const t = new Date(e), { year: s, month: a, day: i, hour: r, minute: c, second: o } = this.nativeDateToCronosDate(t), l = Date.UTC(s, a - 1, i, r, c, o), d = e - e % 1e3;
|
|
388
391
|
return (l - d) / 6e4;
|
|
389
392
|
}
|
|
390
393
|
nativeDateToCronosDate(e) {
|
|
391
|
-
return this.dateTimeFormat ? this.dateTimeFormat.formatToParts ?
|
|
394
|
+
return this.dateTimeFormat ? this.dateTimeFormat.formatToParts ? Q(this.dateTimeFormat, e) : q(this.dateTimeFormat, e) : h.fromUTCTimestamp(e.getTime() + (this.fixedOffset || 0) * 6e4);
|
|
392
395
|
}
|
|
393
396
|
cronosDateToNativeDate(e) {
|
|
394
397
|
if (!this.dateTimeFormat)
|
|
395
398
|
return new Date(e.toUTCTimestamp() - (this.fixedOffset || 0) * 6e4);
|
|
396
399
|
const t = (e.month > 3 || e.month < 11 ? this.summerOffset : this.winterOffset) || 0, s = e.toUTCTimestamp();
|
|
397
400
|
let a = s - t * 6e4;
|
|
398
|
-
const r = this.offset(a);
|
|
399
|
-
if (t === r)
|
|
400
|
-
return new Date(a);
|
|
401
|
-
a -= (r - t) * 6e4;
|
|
402
401
|
const i = this.offset(a);
|
|
403
|
-
|
|
402
|
+
if (t === i)
|
|
403
|
+
return new Date(a);
|
|
404
|
+
a -= (i - t) * 6e4;
|
|
405
|
+
const r = this.offset(a);
|
|
406
|
+
return i === r ? new Date(a) : new Date(s - Math.min(i, r) * 6e4);
|
|
404
407
|
}
|
|
405
408
|
}
|
|
406
|
-
function G(n, e) {
|
|
407
|
-
const t = n.format(e).replace(/\u200E/g, ""), s = t.match(/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/), [, a, r, i, o, c, l] = (s != null ? s : []).map((d) => parseInt(d, 10));
|
|
408
|
-
return new m(i, a, r, o % 24, c, l);
|
|
409
|
-
}
|
|
410
409
|
function q(n, e) {
|
|
410
|
+
const t = n.format(e).replace(/\u200E/g, ""), s = t.match(/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/), [, a, i, r, c, o, l] = (s != null ? s : []).map((d) => parseInt(d, 10));
|
|
411
|
+
return new h(r, a, i, c % 24, o, l);
|
|
412
|
+
}
|
|
413
|
+
function Q(n, e) {
|
|
411
414
|
const t = n.formatToParts(e);
|
|
412
|
-
return new
|
|
415
|
+
return new h(parseInt(t[4].value, 10), parseInt(t[0].value, 10), parseInt(t[2].value, 10), parseInt(t[6].value, 10) % 24, parseInt(t[8].value, 10), parseInt(t[10].value, 10));
|
|
413
416
|
}
|
|
414
|
-
const
|
|
417
|
+
const v = 60 * 60 * 1e3, x = (n, e) => e.findIndex((t) => t >= n);
|
|
415
418
|
class $ {
|
|
416
|
-
constructor(e, t, s, a,
|
|
417
|
-
this.cronString = e, this.seconds = t, this.minutes = s, this.hours = a, this.days =
|
|
419
|
+
constructor(e, t, s, a, i, r, c) {
|
|
420
|
+
this.cronString = e, this.seconds = t, this.minutes = s, this.hours = a, this.days = i, this.months = r, this.years = c, this.skipRepeatedHour = !0, this.missingHour = "insert", this._warnings = null;
|
|
418
421
|
}
|
|
419
422
|
static parse(e, t = {}) {
|
|
420
423
|
var s;
|
|
421
424
|
const a = C(e);
|
|
422
425
|
if (t.strict) {
|
|
423
|
-
let
|
|
424
|
-
if (typeof t.strict == "object" && (
|
|
425
|
-
throw new Error(`Strict mode: Parsing failed with ${
|
|
426
|
+
let r = b(a, (c) => c.warnings);
|
|
427
|
+
if (typeof t.strict == "object" && (r = r.filter((c) => !!t.strict[c.type])), r.length > 0)
|
|
428
|
+
throw new Error(`Strict mode: Parsing failed with ${r.length} warnings`);
|
|
426
429
|
}
|
|
427
|
-
const
|
|
428
|
-
return
|
|
430
|
+
const i = new $(e, a[0].values, a[1].values, a[2].values, a[3].values, a[4].values, a[5]);
|
|
431
|
+
return i.timezone = t.timezone instanceof z ? t.timezone : t.timezone !== void 0 ? new z(t.timezone) : void 0, i.skipRepeatedHour = t.skipRepeatedHour !== void 0 ? t.skipRepeatedHour : i.skipRepeatedHour, i.missingHour = (s = t.missingHour) !== null && s !== void 0 ? s : i.missingHour, i;
|
|
429
432
|
}
|
|
430
433
|
get warnings() {
|
|
431
434
|
if (!this._warnings) {
|
|
@@ -440,15 +443,15 @@ class $ {
|
|
|
440
443
|
tz: (t = (e = this.timezone) === null || e === void 0 ? void 0 : e.toString()) !== null && t !== void 0 ? t : "Local",
|
|
441
444
|
skipRepeatedHour: s && this.skipRepeatedHour.toString(),
|
|
442
445
|
missingHour: s && this.missingHour
|
|
443
|
-
}).map(([
|
|
446
|
+
}).map(([i, r]) => r && i + ": " + r).filter((i) => i).join(", ");
|
|
444
447
|
return `${this.cronString} (${a})`;
|
|
445
448
|
}
|
|
446
449
|
nextDate(e = /* @__PURE__ */ new Date()) {
|
|
447
450
|
var t;
|
|
448
|
-
const s =
|
|
451
|
+
const s = h.fromDate(e, this.timezone);
|
|
449
452
|
if (((t = this.timezone) === null || t === void 0 ? void 0 : t.fixedOffset) !== void 0)
|
|
450
453
|
return this._next(s).date;
|
|
451
|
-
const a = e.getTime(),
|
|
454
|
+
const a = e.getTime(), i = s.toUTCTimestamp(), r = h.fromDate(new Date(a - v), this.timezone).toUTCTimestamp(), c = h.fromDate(new Date(a + v), this.timezone).toUTCTimestamp(), o = c - i === 0, l = i - r === 0, d = i - r === v * 2;
|
|
452
455
|
if (this.skipRepeatedHour && l)
|
|
453
456
|
return this._next(s.copyWith({ minute: 59, second: 60 }), !1).date;
|
|
454
457
|
if (this.missingHour === "offset" && d) {
|
|
@@ -456,8 +459,8 @@ class $ {
|
|
|
456
459
|
if (!u || u.getTime() > a)
|
|
457
460
|
return u;
|
|
458
461
|
}
|
|
459
|
-
let { date:
|
|
460
|
-
return this.missingHour !== "offset" &&
|
|
462
|
+
let { date: m, cronosDate: p } = this._next(s);
|
|
463
|
+
return this.missingHour !== "offset" && p && m && p.copyWith({ hour: p.hour + 1 }).toDate(this.timezone).getTime() === m.getTime() ? this.missingHour === "insert" ? p.copyWith({ minute: 0, second: 0 }).toDate(this.timezone) : this._next(p.copyWith({ minute: 59, second: 59 })).date : (this.skipRepeatedHour || (o && (!m || m.getTime() > a + v) && (m = this._next(s.copyWith({ minute: 0, second: 0 }), !1).date), m && m < e && (m = new Date(m.getTime() + v))), m);
|
|
461
464
|
}
|
|
462
465
|
_next(e, t = !0) {
|
|
463
466
|
const s = this._nextYear(t ? e.copyWith({ second: e.second + 1 }) : e);
|
|
@@ -469,11 +472,11 @@ class $ {
|
|
|
469
472
|
nextNDates(e = /* @__PURE__ */ new Date(), t = 5) {
|
|
470
473
|
const s = [];
|
|
471
474
|
let a = e;
|
|
472
|
-
for (let
|
|
473
|
-
const
|
|
474
|
-
if (!
|
|
475
|
+
for (let i = 0; i < t; i++) {
|
|
476
|
+
const r = this.nextDate(a);
|
|
477
|
+
if (!r)
|
|
475
478
|
break;
|
|
476
|
-
a =
|
|
479
|
+
a = r, s.push(r);
|
|
477
480
|
}
|
|
478
481
|
return s;
|
|
479
482
|
}
|
|
@@ -482,62 +485,66 @@ class $ {
|
|
|
482
485
|
for (; !s; ) {
|
|
483
486
|
if (t = this.years.nextYear(t), t === null)
|
|
484
487
|
return null;
|
|
485
|
-
s = this._nextMonth(t === e.year ? e : new
|
|
488
|
+
s = this._nextMonth(t === e.year ? e : new h(t)), t++;
|
|
486
489
|
}
|
|
487
490
|
return s;
|
|
488
491
|
}
|
|
489
492
|
_nextMonth(e) {
|
|
490
|
-
let t =
|
|
493
|
+
let t = x(e.month, this.months), s = null;
|
|
491
494
|
for (; !s; ) {
|
|
492
495
|
const a = this.months[t];
|
|
493
496
|
if (a === void 0)
|
|
494
497
|
return null;
|
|
495
|
-
s = this._nextDay(a === e.month ? e : new
|
|
498
|
+
s = this._nextDay(a === e.month ? e : new h(e.year, a)), t++;
|
|
496
499
|
}
|
|
497
500
|
return s;
|
|
498
501
|
}
|
|
499
502
|
_nextDay(e) {
|
|
500
503
|
const t = this.days.getDays(e.year, e.month);
|
|
501
|
-
let s =
|
|
504
|
+
let s = x(e.day, t), a = null;
|
|
502
505
|
for (; !a; ) {
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
506
|
+
const i = t[s];
|
|
507
|
+
if (i === void 0)
|
|
505
508
|
return null;
|
|
506
|
-
a = this._nextHour(
|
|
509
|
+
a = this._nextHour(i === e.day ? e : new h(e.year, e.month, i)), s++;
|
|
507
510
|
}
|
|
508
511
|
return a;
|
|
509
512
|
}
|
|
510
513
|
_nextHour(e) {
|
|
511
|
-
let t =
|
|
514
|
+
let t = x(e.hour, this.hours), s = null;
|
|
512
515
|
for (; !s; ) {
|
|
513
516
|
const a = this.hours[t];
|
|
514
517
|
if (a === void 0)
|
|
515
518
|
return null;
|
|
516
|
-
s = this._nextMinute(a === e.hour ? e : new
|
|
519
|
+
s = this._nextMinute(a === e.hour ? e : new h(e.year, e.month, e.day, a)), t++;
|
|
517
520
|
}
|
|
518
521
|
return s;
|
|
519
522
|
}
|
|
520
523
|
_nextMinute(e) {
|
|
521
|
-
let t =
|
|
524
|
+
let t = x(e.minute, this.minutes), s = null;
|
|
522
525
|
for (; !s; ) {
|
|
523
526
|
const a = this.minutes[t];
|
|
524
527
|
if (a === void 0)
|
|
525
528
|
return null;
|
|
526
|
-
s = this._nextSecond(a === e.minute ? e : new
|
|
529
|
+
s = this._nextSecond(a === e.minute ? e : new h(e.year, e.month, e.day, e.hour, a)), t++;
|
|
527
530
|
}
|
|
528
531
|
return s;
|
|
529
532
|
}
|
|
530
533
|
_nextSecond(e) {
|
|
531
|
-
const t =
|
|
534
|
+
const t = x(e.second, this.seconds), s = this.seconds[t];
|
|
532
535
|
return s === void 0 ? null : e.copyWith({ second: s });
|
|
533
536
|
}
|
|
534
537
|
}
|
|
535
|
-
const
|
|
538
|
+
const Z = {
|
|
536
539
|
name: "VueCron",
|
|
537
540
|
props: {
|
|
538
541
|
data: Object,
|
|
539
542
|
expression: String,
|
|
540
|
-
runsParser: Function
|
|
543
|
+
runsParser: Function,
|
|
544
|
+
quartz: {
|
|
545
|
+
type: Boolean,
|
|
546
|
+
default: !0
|
|
547
|
+
}
|
|
541
548
|
},
|
|
542
549
|
data() {
|
|
543
550
|
const n = (/* @__PURE__ */ new Date()).getFullYear();
|
|
@@ -565,7 +572,7 @@ const J = {
|
|
|
565
572
|
expression: ""
|
|
566
573
|
},
|
|
567
574
|
{
|
|
568
|
-
type: "
|
|
575
|
+
type: "week",
|
|
569
576
|
expression: ""
|
|
570
577
|
},
|
|
571
578
|
{
|
|
@@ -604,16 +611,16 @@ const J = {
|
|
|
604
611
|
rangeStart: "",
|
|
605
612
|
rangeEnd: "",
|
|
606
613
|
specificSpecific: [],
|
|
607
|
-
cronLastSpecificDomDay: 1,
|
|
608
614
|
cronDaysBeforeEomMinus: "",
|
|
609
615
|
cronDaysNearestWeekday: ""
|
|
610
616
|
},
|
|
611
617
|
week: {
|
|
612
618
|
cronEvery: "",
|
|
613
|
-
incrementStart: "
|
|
619
|
+
incrementStart: "0",
|
|
614
620
|
incrementIncrement: "1",
|
|
615
621
|
specificSpecific: [],
|
|
616
|
-
|
|
622
|
+
cronLastSpecificDomDay: "0",
|
|
623
|
+
cronNthDayDay: "0",
|
|
617
624
|
cronNthDayNth: "1"
|
|
618
625
|
},
|
|
619
626
|
month: {
|
|
@@ -638,16 +645,46 @@ const J = {
|
|
|
638
645
|
hour: "",
|
|
639
646
|
day: "",
|
|
640
647
|
month: "",
|
|
641
|
-
|
|
648
|
+
week: "",
|
|
642
649
|
year: ""
|
|
643
650
|
},
|
|
644
651
|
runs: [],
|
|
645
|
-
defaultStr: "0"
|
|
652
|
+
defaultStr: "0",
|
|
653
|
+
weekOptions: [
|
|
654
|
+
{
|
|
655
|
+
value: "0",
|
|
656
|
+
label: "星期天"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
value: "1",
|
|
660
|
+
label: "星期一"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
value: "2",
|
|
664
|
+
label: "星期二"
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
value: "3",
|
|
668
|
+
label: "星期三"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
value: "4",
|
|
672
|
+
label: "星期四"
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
value: "5",
|
|
676
|
+
label: "星期五"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
value: "6",
|
|
680
|
+
label: "星期六"
|
|
681
|
+
}
|
|
682
|
+
]
|
|
646
683
|
};
|
|
647
684
|
},
|
|
648
685
|
computed: {
|
|
649
686
|
text() {
|
|
650
|
-
return
|
|
687
|
+
return Y;
|
|
651
688
|
},
|
|
652
689
|
secondsText() {
|
|
653
690
|
let n = "";
|
|
@@ -710,70 +747,86 @@ const J = {
|
|
|
710
747
|
return n || this.defaultStr;
|
|
711
748
|
},
|
|
712
749
|
daysText() {
|
|
713
|
-
|
|
714
|
-
|
|
750
|
+
const n = this.day.cronEvery;
|
|
751
|
+
if (!n)
|
|
752
|
+
return "?";
|
|
753
|
+
let e = "";
|
|
754
|
+
switch (n.toString()) {
|
|
715
755
|
case "1":
|
|
716
|
-
|
|
717
|
-
break;
|
|
718
|
-
case "2":
|
|
719
|
-
case "4":
|
|
720
|
-
case "11":
|
|
721
|
-
n = "?";
|
|
756
|
+
e = "*";
|
|
722
757
|
break;
|
|
723
758
|
case "3":
|
|
724
|
-
|
|
759
|
+
e = `${this.day.incrementStart}/${this.day.incrementIncrement}`;
|
|
725
760
|
break;
|
|
726
761
|
case "5":
|
|
727
762
|
this.day.specificSpecific.forEach((t) => {
|
|
728
|
-
|
|
729
|
-
}),
|
|
763
|
+
e += `${t},`;
|
|
764
|
+
}), e = e.slice(0, -1);
|
|
730
765
|
break;
|
|
731
766
|
case "6":
|
|
732
|
-
|
|
767
|
+
e = "L";
|
|
733
768
|
break;
|
|
734
769
|
case "7":
|
|
735
|
-
|
|
736
|
-
break;
|
|
737
|
-
case "8":
|
|
738
|
-
n = `${this.day.cronLastSpecificDomDay}L`;
|
|
770
|
+
e = "LW";
|
|
739
771
|
break;
|
|
740
772
|
case "9":
|
|
741
|
-
|
|
773
|
+
e = `L-${this.day.cronDaysBeforeEomMinus}`;
|
|
742
774
|
break;
|
|
743
775
|
case "10":
|
|
744
|
-
|
|
776
|
+
e = `${this.day.cronDaysNearestWeekday}W`;
|
|
745
777
|
break;
|
|
746
778
|
}
|
|
747
|
-
return
|
|
779
|
+
return e;
|
|
748
780
|
},
|
|
749
781
|
weeksText() {
|
|
750
|
-
|
|
751
|
-
|
|
782
|
+
const n = this.week.cronEvery;
|
|
783
|
+
if (!n)
|
|
784
|
+
return "?";
|
|
785
|
+
let e = "";
|
|
786
|
+
switch (n.toString()) {
|
|
752
787
|
case "1":
|
|
753
|
-
|
|
754
|
-
case "5":
|
|
755
|
-
n = "?";
|
|
788
|
+
e = "*";
|
|
756
789
|
break;
|
|
757
790
|
case "2":
|
|
758
|
-
|
|
791
|
+
e = `${this.week.incrementStart}/${this.week.incrementIncrement}`;
|
|
759
792
|
break;
|
|
760
793
|
case "4":
|
|
761
794
|
this.week.specificSpecific.forEach((t) => {
|
|
762
|
-
|
|
763
|
-
}),
|
|
795
|
+
e += `${t},`;
|
|
796
|
+
}), e = e.slice(0, -1);
|
|
764
797
|
break;
|
|
765
|
-
case "6":
|
|
766
|
-
case "7":
|
|
767
798
|
case "8":
|
|
768
|
-
|
|
769
|
-
case "10":
|
|
770
|
-
n = "?";
|
|
799
|
+
e = `${this.week.cronLastSpecificDomDay}L`;
|
|
771
800
|
break;
|
|
772
801
|
case "11":
|
|
773
|
-
|
|
802
|
+
e = `${this.week.cronNthDayDay}#${this.week.cronNthDayNth}`;
|
|
774
803
|
break;
|
|
775
804
|
}
|
|
776
|
-
return
|
|
805
|
+
return e;
|
|
806
|
+
},
|
|
807
|
+
weeksTextQuartz() {
|
|
808
|
+
const n = this.week.cronEvery;
|
|
809
|
+
if (!n)
|
|
810
|
+
return "?";
|
|
811
|
+
let e = "";
|
|
812
|
+
switch (n.toString()) {
|
|
813
|
+
case "1":
|
|
814
|
+
e = "*";
|
|
815
|
+
break;
|
|
816
|
+
case "2":
|
|
817
|
+
e = `${this.week.incrementStart}/${this.week.incrementIncrement}`;
|
|
818
|
+
break;
|
|
819
|
+
case "4":
|
|
820
|
+
e = this.week.specificSpecific.map((t) => Number(t) + 1).join(",");
|
|
821
|
+
break;
|
|
822
|
+
case "8":
|
|
823
|
+
e = `${Number(this.week.cronLastSpecificDomDay) + 1}L`;
|
|
824
|
+
break;
|
|
825
|
+
case "11":
|
|
826
|
+
e = `${Number(this.week.cronNthDayDay) + 1}#${this.week.cronNthDayNth}`;
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
return e;
|
|
777
830
|
},
|
|
778
831
|
monthsText() {
|
|
779
832
|
let n = "";
|
|
@@ -816,7 +869,7 @@ const J = {
|
|
|
816
869
|
return n || "*";
|
|
817
870
|
},
|
|
818
871
|
cron() {
|
|
819
|
-
return `${this.secondsText} ${this.minutesText} ${this.hoursText} ${this.daysText} ${this.monthsText} ${this.weeksText} ${this.yearsText}`;
|
|
872
|
+
return `${this.secondsText} ${this.minutesText} ${this.hoursText} ${this.daysText} ${this.monthsText} ${this.quartz ? this.weeksTextQuartz : this.weeksText} ${this.yearsText}`;
|
|
820
873
|
}
|
|
821
874
|
},
|
|
822
875
|
watch: {
|
|
@@ -825,8 +878,9 @@ const J = {
|
|
|
825
878
|
},
|
|
826
879
|
cron: {
|
|
827
880
|
immediate: !0,
|
|
828
|
-
handler(
|
|
881
|
+
handler() {
|
|
829
882
|
return W(this, null, function* () {
|
|
883
|
+
const n = `${this.secondsText} ${this.minutesText} ${this.hoursText} ${this.daysText} ${this.monthsText} ${this.weeksText} ${this.yearsText}`;
|
|
830
884
|
try {
|
|
831
885
|
this.runsParser ? this.runs = yield this.runsParser(n) : this.runs = $.parse(n).nextNDates(/* @__PURE__ */ new Date(), 5).map((e) => H(e));
|
|
832
886
|
} catch (e) {
|
|
@@ -893,7 +947,7 @@ const J = {
|
|
|
893
947
|
case "second":
|
|
894
948
|
this.commonParser(this[t.type], t.expression);
|
|
895
949
|
return;
|
|
896
|
-
case "
|
|
950
|
+
case "week":
|
|
897
951
|
this.resolveWeek(t.expression);
|
|
898
952
|
return;
|
|
899
953
|
case "day":
|
|
@@ -907,17 +961,19 @@ const J = {
|
|
|
907
961
|
},
|
|
908
962
|
resolveWeek(n) {
|
|
909
963
|
if (n.indexOf("/") >= 0)
|
|
910
|
-
this.
|
|
964
|
+
this.week.cronEvery = "2", this.resolveSlash(this.week, n);
|
|
911
965
|
else if (n.indexOf(",") >= 0)
|
|
912
|
-
this.
|
|
966
|
+
this.week.cronEvery = "4", this.resolveComma(this.week, n);
|
|
967
|
+
else if (n.indexOf("L") === n.length - 1)
|
|
968
|
+
this.week.cronEvery = "8", this.week.cronLastSpecificDomDay = n.slice(0, -1);
|
|
913
969
|
else if (n.indexOf("#") >= 0) {
|
|
914
|
-
this.
|
|
970
|
+
this.week.cronEvery = "11";
|
|
915
971
|
const e = n.split("#");
|
|
916
|
-
this.
|
|
972
|
+
this.week.cronNthDayDay = e[0], this.week.cronNthDayNth = e[1];
|
|
917
973
|
}
|
|
918
974
|
},
|
|
919
975
|
resolveDay(n) {
|
|
920
|
-
n === "*" ? this.resolveStar(this.day) : n.indexOf("/") >= 0 ? this.resolveSlash(this.day, n, "3") : n === "L" ? this.day.cronEvery = "6" : n === "LW" ? this.day.cronEvery = "7" :
|
|
976
|
+
n === "*" ? this.resolveStar(this.day) : n.indexOf("/") >= 0 ? this.resolveSlash(this.day, n, "3") : n === "L" ? this.day.cronEvery = "6" : n === "LW" ? this.day.cronEvery = "7" : /L-\d+/.test(n) ? (this.day.cronEvery = "9", this.day.cronDaysBeforeEomMinus = Number(n.match(/L-(\d+)/)[1])) : /\d+W/.test(n) ? (this.day.cronEvery = "10", this.day.cronDaysNearestWeekday = Number(n.match(/(\d+)W/))[1]) : n.indexOf(",") >= 0 && this.resolveComma(this.day, n, "5");
|
|
921
977
|
},
|
|
922
978
|
resolveStar(n, e = "1") {
|
|
923
979
|
n.cronEvery = e;
|
|
@@ -934,184 +990,204 @@ const J = {
|
|
|
934
990
|
},
|
|
935
991
|
resolveComma(n, e, t = "3") {
|
|
936
992
|
n.cronEvery = t, n.specificSpecific = e.split(",");
|
|
993
|
+
},
|
|
994
|
+
setSecond(n) {
|
|
995
|
+
var e;
|
|
996
|
+
n === "3" ? (e = this.second.specificSpecific) != null && e.length || (this.second.specificSpecific = [0]) : this.second.specificSpecific = [];
|
|
997
|
+
},
|
|
998
|
+
setMinute(n) {
|
|
999
|
+
var e;
|
|
1000
|
+
n === "3" ? (e = this.minute.specificSpecific) != null && e.length || (this.minute.specificSpecific = [0]) : this.minute.specificSpecific = [];
|
|
1001
|
+
},
|
|
1002
|
+
setHour(n) {
|
|
1003
|
+
var e;
|
|
1004
|
+
n === "3" ? (e = this.hour.specificSpecific) != null && e.length || (this.hour.specificSpecific = [0]) : this.hour.specificSpecific = [];
|
|
1005
|
+
},
|
|
1006
|
+
setMonth(n) {
|
|
1007
|
+
var e;
|
|
1008
|
+
n === "3" ? (e = this.month.specificSpecific) != null && e.length || (this.month.specificSpecific = [1]) : this.month.specificSpecific = [];
|
|
1009
|
+
},
|
|
1010
|
+
setYear(n) {
|
|
1011
|
+
var e;
|
|
1012
|
+
n === "3" ? (e = this.year.specificSpecific) != null && e.length || (this.year.specificSpecific = [(/* @__PURE__ */ new Date()).getFullYear()]) : this.year.specificSpecific = [];
|
|
1013
|
+
},
|
|
1014
|
+
setDay(n) {
|
|
1015
|
+
var e;
|
|
1016
|
+
this.week.cronEvery = "", n === "5" ? (e = this.day.specificSpecific) != null && e.length || (this.day.specificSpecific = [1]) : this.day.specificSpecific = [];
|
|
1017
|
+
},
|
|
1018
|
+
setWeek(n) {
|
|
1019
|
+
var e;
|
|
1020
|
+
this.day.cronEvery = "", n === "4" ? (e = this.week.specificSpecific) != null && e.length || (this.week.specificSpecific = ["1"]) : this.week.specificSpecific = [];
|
|
937
1021
|
}
|
|
938
1022
|
}
|
|
939
1023
|
};
|
|
940
|
-
var
|
|
1024
|
+
var J = function() {
|
|
941
1025
|
var e = this, t = e._self._c;
|
|
942
1026
|
return t("div", { staticClass: "vue-cron" }, [t("ElTabs", { attrs: { type: "border-card" } }, [t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
943
1027
|
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Seconds.name))])];
|
|
944
|
-
}, proxy: !0 }]) }, [t("
|
|
945
|
-
e.$set(e.second, "cronEvery", s);
|
|
946
|
-
}, expression: "second.cronEvery" } }, [e._v(e._s(e.text.Seconds.every))])], 1), t("ElRow", [t("ElRadio", { attrs: { label: "4" }, model: { value: e.second.cronEvery, callback: function(s) {
|
|
1028
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setSecond }, model: { value: e.second.cronEvery, callback: function(s) {
|
|
947
1029
|
e.$set(e.second, "cronEvery", s);
|
|
948
|
-
}, expression: "second.cronEvery" } }, [e._v(" " + e._s(e.text.Seconds.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 60 }, model: { value: e.second.rangeStart, callback: function(s) {
|
|
1030
|
+
}, expression: "second.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" } }, [e._v(e._s(e.text.Seconds.every))]), t("ElRadio", { attrs: { label: "4" } }, [e._v(" " + e._s(e.text.Seconds.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 60 }, model: { value: e.second.rangeStart, callback: function(s) {
|
|
949
1031
|
e.$set(e.second, "rangeStart", s);
|
|
950
1032
|
}, expression: "second.rangeStart" } }), e._v(" " + e._s(e.text.Seconds.cycle[1] || "") + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 59 }, model: { value: e.second.rangeEnd, callback: function(s) {
|
|
951
1033
|
e.$set(e.second, "rangeEnd", s);
|
|
952
|
-
}, expression: "second.rangeEnd" } }), e._v(" " + e._s(e.text.Seconds.cycle[2] || "") + " ")], 1)
|
|
953
|
-
e.$set(e.second, "cronEvery", s);
|
|
954
|
-
}, expression: "second.cronEvery" } }, [e._v(" " + e._s(e.text.Seconds.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 59 }, model: { value: e.second.incrementStart, callback: function(s) {
|
|
1034
|
+
}, expression: "second.rangeEnd" } }), e._v(" " + e._s(e.text.Seconds.cycle[2] || "") + " ")], 1), t("ElRadio", { attrs: { label: "2" } }, [e._v(" " + e._s(e.text.Seconds.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 59 }, model: { value: e.second.incrementStart, callback: function(s) {
|
|
955
1035
|
e.$set(e.second, "incrementStart", s);
|
|
956
1036
|
}, expression: "second.incrementStart" } }), e._v(" " + e._s(e.text.Seconds.interval[1] || "") + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 60 }, model: { value: e.second.incrementIncrement, callback: function(s) {
|
|
957
1037
|
e.$set(e.second, "incrementIncrement", s);
|
|
958
|
-
}, expression: "second.incrementIncrement" } }), e._v(" " + e._s(e.text.Seconds.interval[2] || "") + " ")], 1)
|
|
959
|
-
e.$set(e.second, "cronEvery", s);
|
|
960
|
-
}, expression: "second.cronEvery" } }, [e._v(" " + e._s(e.text.Seconds.specific) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.second.specificSpecific, callback: function(s) {
|
|
1038
|
+
}, expression: "second.incrementIncrement" } }), e._v(" " + e._s(e.text.Seconds.interval[2] || "") + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "3" } }, [e._v(" " + e._s(e.text.Seconds.specific) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.second.specificSpecific, callback: function(s) {
|
|
961
1039
|
e.$set(e.second, "specificSpecific", s);
|
|
962
1040
|
}, expression: "second.specificSpecific" } }, e._l(60, function(s) {
|
|
963
1041
|
return t("ElOption", { key: s, attrs: { value: s - 1 } }, [e._v(e._s(s - 1))]);
|
|
964
|
-
}), 1)], 1)], 1)], 1)
|
|
1042
|
+
}), 1)], 1)], 1)], 1), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
965
1043
|
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Minutes.name))])];
|
|
966
|
-
}, proxy: !0 }]) }, [t("
|
|
967
|
-
e.$set(e.minute, "cronEvery", s);
|
|
968
|
-
}, expression: "minute.cronEvery" } }, [e._v(e._s(e.text.Minutes.every))])], 1), t("ElRow", [t("ElRadio", { attrs: { label: "4" }, model: { value: e.minute.cronEvery, callback: function(s) {
|
|
1044
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setMinute }, model: { value: e.minute.cronEvery, callback: function(s) {
|
|
969
1045
|
e.$set(e.minute, "cronEvery", s);
|
|
970
|
-
}, expression: "minute.cronEvery" } }, [e._v(" " + e._s(e.text.Minutes.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 60 }, model: { value: e.minute.rangeStart, callback: function(s) {
|
|
1046
|
+
}, expression: "minute.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" } }, [e._v(e._s(e.text.Minutes.every))]), t("ElRadio", { attrs: { label: "4" } }, [e._v(" " + e._s(e.text.Minutes.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 60 }, model: { value: e.minute.rangeStart, callback: function(s) {
|
|
971
1047
|
e.$set(e.minute, "rangeStart", s);
|
|
972
1048
|
}, expression: "minute.rangeStart" } }), e._v(" " + e._s(e.text.Minutes.cycle[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 59 }, model: { value: e.minute.rangeEnd, callback: function(s) {
|
|
973
1049
|
e.$set(e.minute, "rangeEnd", s);
|
|
974
|
-
}, expression: "minute.rangeEnd" } }), e._v(" " + e._s(e.text.Minutes.cycle[2]) + " ")], 1)
|
|
975
|
-
e.$set(e.minute, "cronEvery", s);
|
|
976
|
-
}, expression: "minute.cronEvery" } }, [e._v(" " + e._s(e.text.Minutes.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 59 }, model: { value: e.minute.incrementStart, callback: function(s) {
|
|
1050
|
+
}, expression: "minute.rangeEnd" } }), e._v(" " + e._s(e.text.Minutes.cycle[2]) + " ")], 1), t("ElRadio", { attrs: { label: "2" } }, [e._v(" " + e._s(e.text.Minutes.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 59 }, model: { value: e.minute.incrementStart, callback: function(s) {
|
|
977
1051
|
e.$set(e.minute, "incrementStart", s);
|
|
978
1052
|
}, expression: "minute.incrementStart" } }), e._v(" " + e._s(e.text.Minutes.interval[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 60 }, model: { value: e.minute.incrementIncrement, callback: function(s) {
|
|
979
1053
|
e.$set(e.minute, "incrementIncrement", s);
|
|
980
|
-
}, expression: "minute.incrementIncrement" } }), e._v(" " + e._s(e.text.Minutes.interval[2] || "") + " ")], 1)
|
|
981
|
-
e.$set(e.minute, "cronEvery", s);
|
|
982
|
-
}, expression: "minute.cronEvery" } }, [e._v(" " + e._s(e.text.Minutes.specific) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.minute.specificSpecific, callback: function(s) {
|
|
1054
|
+
}, expression: "minute.incrementIncrement" } }), e._v(" " + e._s(e.text.Minutes.interval[2] || "") + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "3" } }, [e._v(" " + e._s(e.text.Minutes.specific) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.minute.specificSpecific, callback: function(s) {
|
|
983
1055
|
e.$set(e.minute, "specificSpecific", s);
|
|
984
1056
|
}, expression: "minute.specificSpecific" } }, e._l(60, function(s) {
|
|
985
1057
|
return t("ElOption", { key: s, attrs: { value: s - 1 } }, [e._v(e._s(s - 1))]);
|
|
986
|
-
}), 1)], 1)], 1)], 1)
|
|
1058
|
+
}), 1)], 1)], 1)], 1), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
987
1059
|
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Hours.name))])];
|
|
988
|
-
}, proxy: !0 }]) }, [t("
|
|
1060
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setHour }, model: { value: e.hour.cronEvery, callback: function(s) {
|
|
1061
|
+
e.$set(e.hour, "cronEvery", s);
|
|
1062
|
+
}, expression: "hour.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" }, model: { value: e.hour.cronEvery, callback: function(s) {
|
|
989
1063
|
e.$set(e.hour, "cronEvery", s);
|
|
990
|
-
}, expression: "hour.cronEvery" } }, [e._v(e._s(e.text.Hours.every))])
|
|
1064
|
+
}, expression: "hour.cronEvery" } }, [e._v(e._s(e.text.Hours.every))]), t("ElRadio", { attrs: { label: "4" }, model: { value: e.hour.cronEvery, callback: function(s) {
|
|
991
1065
|
e.$set(e.hour, "cronEvery", s);
|
|
992
1066
|
}, expression: "hour.cronEvery" } }, [e._v(" " + e._s(e.text.Hours.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 23 }, model: { value: e.hour.rangeStart, callback: function(s) {
|
|
993
1067
|
e.$set(e.hour, "rangeStart", s);
|
|
994
1068
|
}, expression: "hour.rangeStart" } }), e._v(" " + e._s(e.text.Hours.cycle[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 23 }, model: { value: e.hour.rangeEnd, callback: function(s) {
|
|
995
1069
|
e.$set(e.hour, "rangeEnd", s);
|
|
996
|
-
}, expression: "hour.rangeEnd" } }), e._v(" " + e._s(e.text.Hours.cycle[2]) + " ")], 1)
|
|
1070
|
+
}, expression: "hour.rangeEnd" } }), e._v(" " + e._s(e.text.Hours.cycle[2]) + " ")], 1), t("ElRadio", { attrs: { label: "2" }, model: { value: e.hour.cronEvery, callback: function(s) {
|
|
997
1071
|
e.$set(e.hour, "cronEvery", s);
|
|
998
1072
|
}, expression: "hour.cronEvery" } }, [e._v(" " + e._s(e.text.Hours.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 23 }, model: { value: e.hour.incrementStart, callback: function(s) {
|
|
999
1073
|
e.$set(e.hour, "incrementStart", s);
|
|
1000
1074
|
}, expression: "hour.incrementStart" } }), e._v(" " + e._s(e.text.Hours.interval[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 23 }, model: { value: e.hour.incrementIncrement, callback: function(s) {
|
|
1001
1075
|
e.$set(e.hour, "incrementIncrement", s);
|
|
1002
|
-
}, expression: "hour.incrementIncrement" } }), e._v(" " + e._s(e.text.Hours.interval[2]) + " ")], 1)
|
|
1076
|
+
}, expression: "hour.incrementIncrement" } }), e._v(" " + e._s(e.text.Hours.interval[2]) + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "3" }, model: { value: e.hour.cronEvery, callback: function(s) {
|
|
1003
1077
|
e.$set(e.hour, "cronEvery", s);
|
|
1004
1078
|
}, expression: "hour.cronEvery" } }, [e._v(" " + e._s(e.text.Hours.specific) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.hour.specificSpecific, callback: function(s) {
|
|
1005
1079
|
e.$set(e.hour, "specificSpecific", s);
|
|
1006
1080
|
}, expression: "hour.specificSpecific" } }, e._l(24, function(s) {
|
|
1007
1081
|
return t("ElOption", { key: s, attrs: { value: s - 1 } }, [e._v(e._s(s - 1))]);
|
|
1008
|
-
}), 1)], 1)], 1)], 1)
|
|
1082
|
+
}), 1)], 1)], 1)], 1), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
1009
1083
|
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Day.name))])];
|
|
1010
|
-
}, proxy: !0 }]) }, [t("
|
|
1084
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setDay }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1011
1085
|
e.$set(e.day, "cronEvery", s);
|
|
1012
|
-
}, expression: "day.cronEvery" } }, [
|
|
1086
|
+
}, expression: "day.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1013
1087
|
e.$set(e.day, "cronEvery", s);
|
|
1014
|
-
}, expression: "day.cronEvery" } }, [e._v(
|
|
1015
|
-
e.$set(e.week, "incrementStart", s);
|
|
1016
|
-
}, expression: "week.incrementStart" } }, e._l(7, function(s) {
|
|
1017
|
-
return t("ElOption", { key: s, attrs: { label: e.text.Week[s - 1], value: s } });
|
|
1018
|
-
}), 1), e._v(" " + e._s(e.text.Day.intervalWeek[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 7 }, model: { value: e.week.incrementIncrement, callback: function(s) {
|
|
1019
|
-
e.$set(e.week, "incrementIncrement", s);
|
|
1020
|
-
}, expression: "week.incrementIncrement" } }), e._v(" " + e._s(e.text.Day.intervalWeek[2]) + " ")], 1)], 1), t("ElRow", [t("ElRadio", { attrs: { label: "3" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1088
|
+
}, expression: "day.cronEvery" } }, [e._v(e._s(e.text.Day.every))]), t("ElRadio", { attrs: { label: "3" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1021
1089
|
e.$set(e.day, "cronEvery", s);
|
|
1022
1090
|
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.intervalDay[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 31 }, model: { value: e.day.incrementStart, callback: function(s) {
|
|
1023
1091
|
e.$set(e.day, "incrementStart", s);
|
|
1024
1092
|
}, expression: "day.incrementStart" } }), e._v(" " + e._s(e.text.Day.intervalDay[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 31 }, model: { value: e.day.incrementIncrement, callback: function(s) {
|
|
1025
1093
|
e.$set(e.day, "incrementIncrement", s);
|
|
1026
|
-
}, expression: "day.incrementIncrement" } }), e._v(" " + e._s(e.text.Day.intervalDay[2]) + " ")], 1)
|
|
1027
|
-
e.$set(e.day, "cronEvery", s);
|
|
1028
|
-
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.specificWeek) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.week.specificSpecific, callback: function(s) {
|
|
1029
|
-
e.$set(e.week, "specificSpecific", s);
|
|
1030
|
-
}, expression: "week.specificSpecific" } }, e._l(7, function(s) {
|
|
1031
|
-
return t("ElOption", { key: s, attrs: { label: e.text.Week[s - 1], value: ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][s - 1] } });
|
|
1032
|
-
}), 1)], 1)], 1), t("ElRow", [t("ElRadio", { staticClass: "long", attrs: { label: "5" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1094
|
+
}, expression: "day.incrementIncrement" } }), e._v(" " + e._s(e.text.Day.intervalDay[2]) + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "5" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1033
1095
|
e.$set(e.day, "cronEvery", s);
|
|
1034
1096
|
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.specificDay) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.day.specificSpecific, callback: function(s) {
|
|
1035
1097
|
e.$set(e.day, "specificSpecific", s);
|
|
1036
1098
|
}, expression: "day.specificSpecific" } }, e._l(31, function(s) {
|
|
1037
1099
|
return t("ElOption", { key: s, attrs: { value: s } }, [e._v(e._s(s))]);
|
|
1038
|
-
}), 1)], 1)
|
|
1039
|
-
e.$set(e.day, "cronEvery", s);
|
|
1040
|
-
}, expression: "day.cronEvery" } }, [e._v(e._s(e.text.Day.lastDay))])], 1), t("ElRow", [t("ElRadio", { attrs: { label: "7" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1100
|
+
}), 1)], 1), t("ElRadio", { attrs: { label: "6" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1041
1101
|
e.$set(e.day, "cronEvery", s);
|
|
1042
|
-
}, expression: "day.cronEvery" } }, [e._v(e._s(e.text.Day.
|
|
1102
|
+
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.lastDay) + " ")]), t("ElRadio", { attrs: { label: "7" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1043
1103
|
e.$set(e.day, "cronEvery", s);
|
|
1044
|
-
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.
|
|
1045
|
-
e.$set(e.day, "cronLastSpecificDomDay", s);
|
|
1046
|
-
}, expression: "day.cronLastSpecificDomDay" } }, e._l(7, function(s) {
|
|
1047
|
-
return t("ElOption", { key: s, attrs: { label: e.text.Week[s - 1], value: s } });
|
|
1048
|
-
}), 1), e._v(" " + e._s(e.text.Day.lastWeek[1] || "") + " ")], 1)], 1), t("ElRow", [t("ElRadio", { attrs: { label: "9" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1104
|
+
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.lastWorkday) + " ")]), t("ElRadio", { attrs: { label: "9" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1049
1105
|
e.$set(e.day, "cronEvery", s);
|
|
1050
|
-
}, expression: "day.cronEvery" } }, [t("ElInputNumber", { attrs: { size: "small", min: 1, max: 31 }, model: { value: e.day.cronDaysBeforeEomMinus, callback: function(s) {
|
|
1106
|
+
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.beforeEndMonth[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 31 }, model: { value: e.day.cronDaysBeforeEomMinus, callback: function(s) {
|
|
1051
1107
|
e.$set(e.day, "cronDaysBeforeEomMinus", s);
|
|
1052
|
-
}, expression: "day.cronDaysBeforeEomMinus" } }), e._v(" " + e._s(e.text.Day.beforeEndMonth[
|
|
1108
|
+
}, expression: "day.cronDaysBeforeEomMinus" } }), e._v(" " + e._s(e.text.Day.beforeEndMonth[1]) + " ")], 1), t("ElRadio", { attrs: { label: "10" }, model: { value: e.day.cronEvery, callback: function(s) {
|
|
1053
1109
|
e.$set(e.day, "cronEvery", s);
|
|
1054
|
-
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.
|
|
1110
|
+
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.nearestWorkday[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 31 }, model: { value: e.day.cronDaysNearestWeekday, callback: function(s) {
|
|
1055
1111
|
e.$set(e.day, "cronDaysNearestWeekday", s);
|
|
1056
|
-
}, expression: "day.cronDaysNearestWeekday" } }), e._v(" " + e._s(e.text.Day.
|
|
1057
|
-
e.$set(e.day, "cronEvery", s);
|
|
1058
|
-
}, expression: "day.cronEvery" } }, [e._v(" " + e._s(e.text.Day.someWeekday[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 5 }, model: { value: e.week.cronNthDayNth, callback: function(s) {
|
|
1059
|
-
e.$set(e.week, "cronNthDayNth", s);
|
|
1060
|
-
}, expression: "week.cronNthDayNth" } }), e._v(" " + e._s(e.text.Day.someWeekday[1]) + " "), t("ElSelect", { attrs: { size: "small" }, model: { value: e.week.cronNthDayDay, callback: function(s) {
|
|
1061
|
-
e.$set(e.week, "cronNthDayDay", s);
|
|
1062
|
-
}, expression: "week.cronNthDayDay" } }, e._l(7, function(s) {
|
|
1063
|
-
return t("ElOption", { key: s, attrs: { label: e.text.Week[s - 1], value: s } });
|
|
1064
|
-
}), 1)], 1)], 1)], 1)]), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
1112
|
+
}, expression: "day.cronDaysNearestWeekday" } }), e._v(" " + e._s(e.text.Day.nearestWorkday[1]) + " ")], 1)], 1)], 1), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
1065
1113
|
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Month.name))])];
|
|
1066
|
-
}, proxy: !0 }]) }, [t("
|
|
1114
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setMonth }, model: { value: e.month.cronEvery, callback: function(s) {
|
|
1115
|
+
e.$set(e.month, "cronEvery", s);
|
|
1116
|
+
}, expression: "month.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" }, model: { value: e.month.cronEvery, callback: function(s) {
|
|
1067
1117
|
e.$set(e.month, "cronEvery", s);
|
|
1068
|
-
}, expression: "month.cronEvery" } }, [e._v(e._s(e.text.Month.every))])
|
|
1118
|
+
}, expression: "month.cronEvery" } }, [e._v(e._s(e.text.Month.every))]), t("ElRadio", { attrs: { label: "4" }, model: { value: e.month.cronEvery, callback: function(s) {
|
|
1069
1119
|
e.$set(e.month, "cronEvery", s);
|
|
1070
1120
|
}, expression: "month.cronEvery" } }, [e._v(" " + e._s(e.text.Month.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 12 }, model: { value: e.month.rangeStart, callback: function(s) {
|
|
1071
1121
|
e.$set(e.month, "rangeStart", s);
|
|
1072
1122
|
}, expression: "month.rangeStart" } }), e._v(" " + e._s(e.text.Month.cycle[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 12 }, model: { value: e.month.rangeEnd, callback: function(s) {
|
|
1073
1123
|
e.$set(e.month, "rangeEnd", s);
|
|
1074
|
-
}, expression: "month.rangeEnd" } }), e._v(" " + e._s(e.text.Month.cycle[2]) + " ")], 1)
|
|
1124
|
+
}, expression: "month.rangeEnd" } }), e._v(" " + e._s(e.text.Month.cycle[2]) + " ")], 1), t("ElRadio", { attrs: { label: "2" }, model: { value: e.month.cronEvery, callback: function(s) {
|
|
1075
1125
|
e.$set(e.month, "cronEvery", s);
|
|
1076
1126
|
}, expression: "month.cronEvery" } }, [e._v(" " + e._s(e.text.Month.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 0, max: 12 }, model: { value: e.month.incrementStart, callback: function(s) {
|
|
1077
1127
|
e.$set(e.month, "incrementStart", s);
|
|
1078
1128
|
}, expression: "month.incrementStart" } }), e._v(" " + e._s(e.text.Month.interval[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 12 }, model: { value: e.month.incrementIncrement, callback: function(s) {
|
|
1079
1129
|
e.$set(e.month, "incrementIncrement", s);
|
|
1080
|
-
}, expression: "month.incrementIncrement" } }), e._v(" " + e._s(e.text.Month.interval[2]) + " ")], 1)
|
|
1130
|
+
}, expression: "month.incrementIncrement" } }), e._v(" " + e._s(e.text.Month.interval[2]) + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "3" }, model: { value: e.month.cronEvery, callback: function(s) {
|
|
1081
1131
|
e.$set(e.month, "cronEvery", s);
|
|
1082
1132
|
}, expression: "month.cronEvery" } }, [e._v(" " + e._s(e.text.Month.specific) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.month.specificSpecific, callback: function(s) {
|
|
1083
1133
|
e.$set(e.month, "specificSpecific", s);
|
|
1084
1134
|
}, expression: "month.specificSpecific" } }, e._l(12, function(s) {
|
|
1085
1135
|
return t("ElOption", { key: s, attrs: { label: s, value: s } });
|
|
1086
|
-
}), 1)], 1)], 1)], 1)
|
|
1136
|
+
}), 1)], 1)], 1)], 1), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
1137
|
+
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Week.name))])];
|
|
1138
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setWeek }, model: { value: e.week.cronEvery, callback: function(s) {
|
|
1139
|
+
e.$set(e.week, "cronEvery", s);
|
|
1140
|
+
}, expression: "week.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" } }, [e._v(e._s(e.text.Week.every))]), t("ElRadio", { attrs: { label: "2" } }, [e._v(" " + e._s(e.text.Week.intervalWeek[0]) + " "), t("ElSelect", { attrs: { size: "small" }, model: { value: e.week.incrementStart, callback: function(s) {
|
|
1141
|
+
e.$set(e.week, "incrementStart", s);
|
|
1142
|
+
}, expression: "week.incrementStart" } }, e._l(e.weekOptions, function(s) {
|
|
1143
|
+
return t("ElOption", { key: s.value, attrs: { label: s.label, value: s.value } });
|
|
1144
|
+
}), 1), e._v(" " + e._s(e.text.Week.intervalWeek[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 7 }, model: { value: e.week.incrementIncrement, callback: function(s) {
|
|
1145
|
+
e.$set(e.week, "incrementIncrement", s);
|
|
1146
|
+
}, expression: "week.incrementIncrement" } }), e._v(" " + e._s(e.text.Week.intervalWeek[2]) + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "4" } }, [e._v(" " + e._s(e.text.Week.specificWeek) + " "), t("ElSelect", { attrs: { size: "small", multiple: "" }, model: { value: e.week.specificSpecific, callback: function(s) {
|
|
1147
|
+
e.$set(e.week, "specificSpecific", s);
|
|
1148
|
+
}, expression: "week.specificSpecific" } }, e._l(e.weekOptions, function(s) {
|
|
1149
|
+
return t("ElOption", { key: s.value, attrs: { label: s.label, value: s.value } });
|
|
1150
|
+
}), 1)], 1), t("ElRadio", { attrs: { label: "8" } }, [e._v(" " + e._s(e.text.Week.lastWeek[0]) + " "), t("ElSelect", { attrs: { size: "small" }, model: { value: e.week.cronLastSpecificDomDay, callback: function(s) {
|
|
1151
|
+
e.$set(e.week, "cronLastSpecificDomDay", s);
|
|
1152
|
+
}, expression: "week.cronLastSpecificDomDay" } }, e._l(e.weekOptions, function(s) {
|
|
1153
|
+
return t("ElOption", { key: s.value, attrs: { value: s.value, label: s.label } });
|
|
1154
|
+
}), 1)], 1), t("ElRadio", { attrs: { label: "11" } }, [e._v(" " + e._s(e.text.Week.someWeekday[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 5 }, model: { value: e.week.cronNthDayNth, callback: function(s) {
|
|
1155
|
+
e.$set(e.week, "cronNthDayNth", s);
|
|
1156
|
+
}, expression: "week.cronNthDayNth" } }), e._v(" " + e._s(e.text.Week.someWeekday[1]) + " "), t("ElSelect", { attrs: { size: "small" }, model: { value: e.week.cronNthDayDay, callback: function(s) {
|
|
1157
|
+
e.$set(e.week, "cronNthDayDay", s);
|
|
1158
|
+
}, expression: "week.cronNthDayDay" } }, e._l(e.weekOptions, function(s) {
|
|
1159
|
+
return t("ElOption", { key: s.value, attrs: { label: s.label, value: s.value } });
|
|
1160
|
+
}), 1)], 1)], 1)], 1), t("ElTabPane", { scopedSlots: e._u([{ key: "label", fn: function() {
|
|
1087
1161
|
return [t("span", [t("i", { staticClass: "el-icon-date" }), e._v(" " + e._s(e.text.Year.name))])];
|
|
1088
|
-
}, proxy: !0 }]) }, [t("
|
|
1162
|
+
}, proxy: !0 }]) }, [t("ElRadioGroup", { staticClass: "tabBody", on: { input: e.setYear }, model: { value: e.year.cronEvery, callback: function(s) {
|
|
1163
|
+
e.$set(e.year, "cronEvery", s);
|
|
1164
|
+
}, expression: "year.cronEvery" } }, [t("ElRadio", { attrs: { label: "1" }, model: { value: e.year.cronEvery, callback: function(s) {
|
|
1089
1165
|
e.$set(e.year, "cronEvery", s);
|
|
1090
|
-
}, expression: "year.cronEvery" } }, [e._v(e._s(e.text.Year.every))])
|
|
1166
|
+
}, expression: "year.cronEvery" } }, [e._v(e._s(e.text.Year.every))]), t("ElRadio", { attrs: { label: "4" }, model: { value: e.year.cronEvery, callback: function(s) {
|
|
1091
1167
|
e.$set(e.year, "cronEvery", s);
|
|
1092
1168
|
}, expression: "year.cronEvery" } }, [e._v(" " + e._s(e.text.Year.cycle[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: e.currentYear, max: 2118 }, model: { value: e.year.rangeStart, callback: function(s) {
|
|
1093
1169
|
e.$set(e.year, "rangeStart", s);
|
|
1094
1170
|
}, expression: "year.rangeStart" } }), e._v(" " + e._s(e.text.Year.cycle[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: e.currentYear, max: 2118 }, model: { value: e.year.rangeEnd, callback: function(s) {
|
|
1095
1171
|
e.$set(e.year, "rangeEnd", s);
|
|
1096
|
-
}, expression: "year.rangeEnd" } }), e._v(" " + e._s(e.text.Year.cycle[2]) + " ")], 1)
|
|
1172
|
+
}, expression: "year.rangeEnd" } }), e._v(" " + e._s(e.text.Year.cycle[2]) + " ")], 1), t("ElRadio", { attrs: { label: "2" }, model: { value: e.year.cronEvery, callback: function(s) {
|
|
1097
1173
|
e.$set(e.year, "cronEvery", s);
|
|
1098
1174
|
}, expression: "year.cronEvery" } }, [e._v(" " + e._s(e.text.Year.interval[0]) + " "), t("ElInputNumber", { attrs: { size: "small", min: e.currentYear, max: 2118 }, model: { value: e.year.incrementStart, callback: function(s) {
|
|
1099
1175
|
e.$set(e.year, "incrementStart", s);
|
|
1100
1176
|
}, expression: "year.incrementStart" } }), e._v(" " + e._s(e.text.Year.interval[1]) + " "), t("ElInputNumber", { attrs: { size: "small", min: 1, max: 99 }, model: { value: e.year.incrementIncrement, callback: function(s) {
|
|
1101
1177
|
e.$set(e.year, "incrementIncrement", s);
|
|
1102
|
-
}, expression: "year.incrementIncrement" } }), e._v(" " + e._s(e.text.Year.interval[2]) + " ")], 1)
|
|
1178
|
+
}, expression: "year.incrementIncrement" } }), e._v(" " + e._s(e.text.Year.interval[2]) + " ")], 1), t("ElRadio", { staticClass: "long", attrs: { label: "3" }, model: { value: e.year.cronEvery, callback: function(s) {
|
|
1103
1179
|
e.$set(e.year, "cronEvery", s);
|
|
1104
1180
|
}, expression: "year.cronEvery" } }, [e._v(" " + e._s(e.text.Year.specific) + " "), t("ElSelect", { attrs: { size: "small", filterable: "", multiple: "" }, model: { value: e.year.specificSpecific, callback: function(s) {
|
|
1105
1181
|
e.$set(e.year, "specificSpecific", s);
|
|
1106
1182
|
}, expression: "year.specificSpecific" } }, e._l(100, function(s) {
|
|
1107
|
-
return t("ElOption", { key: s, attrs: { label: 2017 + s
|
|
1108
|
-
}), 1)], 1)], 1)], 1)]
|
|
1109
|
-
return t("ul", { key: s, staticStyle: { "padding-left": "18px" } }, [t("li", { staticStyle: { "margin-bottom": "4px"
|
|
1183
|
+
return t("ElOption", { key: s, attrs: { label: `${2017 + s}`, value: 2017 + s } });
|
|
1184
|
+
}), 1)], 1)], 1)], 1)], 1), t("div", { staticStyle: { padding: "0 0 10px" } }, [t("div", { staticClass: "cron-expression", staticStyle: { "padding-top": "20px" } }, [t("p", { staticClass: "title" }, [e._v("Cron 表达式")]), t("div", { staticClass: "flex-row" }, [t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v("秒")]), t("span", { staticClass: "field-value" }, [e._v(e._s(e.secondsText))])]), t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v(" 分钟")]), t("span", { staticClass: "field-value" }, [e._v(e._s(e.minutesText))])]), t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v("小时")]), t("span", { staticClass: "field-value" }, [e._v(e._s(e.hoursText))])]), t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v("天")]), t("span", { staticClass: "field-value highlight" }, [e._v(e._s(e.daysText))])]), t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v("月")]), t("span", { staticClass: "field-value" }, [e._v(e._s(e.monthsText))])]), t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v("周")]), t("span", { staticClass: "field-value highlight" }, [e._v(e._s(e.quartz ? e.weeksTextQuartz : e.weeksText))])]), t("div", { staticClass: "flex-column field" }, [t("span", { staticClass: "field-name" }, [e._v("年")]), t("span", { staticClass: "field-value" }, [e._v(e._s(e.yearsText))])]), t("div", { staticClass: "flex-column flex-item", staticStyle: { padding: "0 10px" } }, [t("span", { staticClass: "field-name" }, [e._v("cron 完整表达式")]), t("span", { staticClass: "field-value", staticStyle: { width: "auto", cursor: "copy" }, on: { click: e.copyCron } }, [e._v(e._s(e.cron))])])])]), t("div", { staticClass: "cron-expression", staticStyle: { "margin-top": "10px" } }, [t("div", { staticStyle: { "margin-bottom": "10px" } }, [e._v("最近 5 次运行时间")]), e._l(e.runs, function(s) {
|
|
1185
|
+
return t("ul", { key: s, staticStyle: { "padding-left": "18px" } }, [t("li", { staticStyle: { "margin-bottom": "4px" } }, [e._v(e._s(s))])]);
|
|
1110
1186
|
})], 2)]), t("div", { staticClass: "bottom" }, [t("ElButton", { attrs: { type: "primary" }, on: { click: e.change } }, [e._v(e._s(e.text.Save))]), t("ElButton", { attrs: { type: "primary" }, on: { click: e.close } }, [e._v(e._s(e.text.Close))])], 1)], 1);
|
|
1111
|
-
},
|
|
1187
|
+
}, K = [], X = /* @__PURE__ */ F(
|
|
1188
|
+
Z,
|
|
1112
1189
|
J,
|
|
1113
1190
|
K,
|
|
1114
|
-
Q,
|
|
1115
1191
|
!1,
|
|
1116
1192
|
null,
|
|
1117
1193
|
null
|
package/vue-cron/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.vue-cron{min-width:600px}.vue-cron .language{z-index:1;position:absolute;right:25px}.vue-cron .el-tabs{box-shadow:none}.vue-cron .el-tabs .el-tabs__content{padding:0 14px}.vue-cron .tabBody
|
|
1
|
+
.vue-cron{min-width:600px}.vue-cron .language{z-index:1;position:absolute;right:25px}.vue-cron .el-tabs{box-shadow:none}.vue-cron .el-tabs .el-tabs__content{padding:0 14px}.vue-cron .tabBody{display:block}.vue-cron .tabBody .long .el-select{width:350px}.vue-cron .tabBody .el-input-number{width:110px}.vue-cron .tabBody .el-radio{margin-top:10px;display:block}.vue-cron .tabBody .el-radio:last-child{margin-bottom:10px}.vue-cron .bottom{text-align:center;width:100%;margin-top:5px;position:relative}.vue-cron .cron-expression{border:1px solid #ccc;border-radius:4px;margin-top:20px;padding:14px;position:relative}.vue-cron .cron-expression .title{background:#fff;padding:10px 40px;position:absolute;top:-50%;left:50%;transform:translate(-50%,60%)}.vue-cron .cron-expression .field-name{text-align:center;margin-bottom:6px}.vue-cron .cron-expression .field-value{text-align:center;border:1px solid #ccc;border-radius:4px;min-width:20px;padding:6px}.vue-cron .cron-expression .field-value.highlight{color:#ff8100;border-color:#ff8100}.vue-cron .cron-expression .field{justify-content:center;align-items:center;padding-left:10px;padding-right:10px}
|
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@web-utils/component",
|
|
5
|
-
"version": "3.8.
|
|
5
|
+
"version": "3.8.3",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"description-markup": "markdown",
|
|
@@ -20074,6 +20074,14 @@
|
|
|
20074
20074
|
"type": "func"
|
|
20075
20075
|
},
|
|
20076
20076
|
"default": ""
|
|
20077
|
+
},
|
|
20078
|
+
{
|
|
20079
|
+
"name": "quartz",
|
|
20080
|
+
"value": {
|
|
20081
|
+
"kind": "expression",
|
|
20082
|
+
"type": "boolean"
|
|
20083
|
+
},
|
|
20084
|
+
"default": "true"
|
|
20077
20085
|
}
|
|
20078
20086
|
],
|
|
20079
20087
|
"events": [
|