bfg-common 1.4.279 → 1.4.282
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/components/common/pages/scheduledTasks/modals/common/frequency/on/On.vue +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue +22 -17
- package/components/common/pages/scheduledTasks/modals/common/newTaskForm/NewTaskForm.vue +15 -11
- package/package.json +1 -1
package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue
CHANGED
|
@@ -18,38 +18,43 @@
|
|
|
18
18
|
<script lang="ts" setup>
|
|
19
19
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
20
20
|
import type { UI_I_SelectWeekDayTab } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/models/interfaces'
|
|
21
|
+
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
21
22
|
import { weekDaysFunc } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/config/weekOptions'
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
+
const modelFrequency = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
25
|
+
required: true,
|
|
26
|
+
})
|
|
24
27
|
|
|
25
28
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
26
29
|
|
|
27
30
|
const onSelectDay = (value: number): void => {
|
|
28
|
-
const index =
|
|
31
|
+
const index = modelFrequency.value?.frg_on_week_days.indexOf(value)
|
|
29
32
|
|
|
30
33
|
if (index === -1) {
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
modelFrequency.value.frg_on_week_days.push(value)
|
|
35
|
+
modelFrequency.value.frg_on_week_days.sort((a: number, b: number) => a - b)
|
|
33
36
|
} else {
|
|
34
|
-
|
|
35
|
-
(
|
|
36
|
-
|
|
37
|
+
modelFrequency.value.frg_on_week_days =
|
|
38
|
+
modelFrequency.value?.frg_on_week_days.filter(
|
|
39
|
+
(_: number, key: number) => key !== index
|
|
40
|
+
)
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
const tabs = computed<UI_I_SelectWeekDayTab[]>(() =>
|
|
41
|
-
weekDaysFunc(localization.value,
|
|
45
|
+
weekDaysFunc(localization.value, modelFrequency.value.frg_on_week_days)
|
|
42
46
|
)
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
watch(
|
|
49
|
+
modelFrequency.value.frg_on_week_days,
|
|
50
|
+
(newValue: number[]) => {
|
|
51
|
+
modelFrequency.value.isValid = !newValue.length
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
deep: true,
|
|
55
|
+
immediate: true,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
53
58
|
</script>
|
|
54
59
|
|
|
55
60
|
<style lang="scss" scoped>
|
|
@@ -194,8 +194,9 @@ const generateCronExpression = (
|
|
|
194
194
|
// Генерируем cron-выражение на основе runType
|
|
195
195
|
switch (runType) {
|
|
196
196
|
case 'once':
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
cronExpression = generateOnceCronExpression(
|
|
198
|
+
new Date(interval.frg_on_time)
|
|
199
|
+
)
|
|
199
200
|
break
|
|
200
201
|
case 'after-startup':
|
|
201
202
|
const delay =
|
|
@@ -206,24 +207,27 @@ const generateCronExpression = (
|
|
|
206
207
|
break
|
|
207
208
|
case 'hour':
|
|
208
209
|
const hourlyDelay = interval.frg_interval
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
cronExpression = generateHourlyCronExpression(
|
|
211
|
+
hourlyDelay,
|
|
212
|
+
new Date(interval.frg_start_on_time)
|
|
213
|
+
)
|
|
212
214
|
break
|
|
213
215
|
case 'day':
|
|
214
216
|
const dayDelay = interval.frg_interval
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
cronExpression = generateDaylyCronExpression(
|
|
218
|
+
dayDelay,
|
|
219
|
+
new Date(interval.frg_start_on_time)
|
|
220
|
+
)
|
|
218
221
|
break
|
|
219
222
|
case 'week':
|
|
220
223
|
cronExpression = generateWeeklyCronExpression(interval)
|
|
221
224
|
break
|
|
222
225
|
case 'month':
|
|
223
226
|
const monthDelay = interval.frg_interval
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
+
cronExpression = generateMonthlyCronExpression(
|
|
228
|
+
monthDelay,
|
|
229
|
+
new Date(interval.frg_start_on_time)
|
|
230
|
+
)
|
|
227
231
|
break
|
|
228
232
|
default:
|
|
229
233
|
cronExpression = '* * * * *'
|