From f1bad07c67303c134e109bb3d48dc379c0aa4d17 Mon Sep 17 00:00:00 2001 From: w940853815 <940853815@qq.com> Date: Mon, 12 May 2025 16:03:21 +0800 Subject: [PATCH] fix: Update WeekCronSelect failed --- src/components/Form/FormFields/WeekCronSelect.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/Form/FormFields/WeekCronSelect.vue b/src/components/Form/FormFields/WeekCronSelect.vue index a34cc26ee..75239b8b6 100644 --- a/src/components/Form/FormFields/WeekCronSelect.vue +++ b/src/components/Form/FormFields/WeekCronSelect.vue @@ -170,7 +170,7 @@ export default { const [start, end] = val.split('~') const startVal = this.countIndex(start) const endVal = this.countIndex(end) - for (let i = startVal; i < (endVal === 0 ? 48 : endVal); i++) { + for (let i = startVal; i < (endVal === 0 ? 24 : endVal); i++) { const curWeek = this.weekTimeData[idNum] const curChild = curWeek.child[i] if (curChild) { @@ -181,11 +181,8 @@ export default { // 计算索引 countIndex(val) { const one = val.substr(0, 2) - const a1 = one.startsWith('0') ? one.substr(1, 2) : one - var reg = RegExp(/30/) - const a2 = val.match(reg) ? 1 : 0 - const curIndex = (a1 * 2) + a2 - return curIndex + const index = one.startsWith('0') ? one.substr(1, 2) : one + return Number(index) }, formatDate(date, fmt) { const o = {