bfg-common 1.4.298 → 1.4.299

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.
@@ -9,11 +9,11 @@
9
9
  v-model="model"
10
10
  />
11
11
 
12
- <div v-if="props.type === 'month'" class="">
12
+ <div v-if="props.type === 'month'">
13
13
  <div class="on-time__radio radio">
14
14
  <input
15
15
  id="on-time-monthly-by-day"
16
- v-model="selectedTimeMode"
16
+ v-model="model.frg_monthly_mode"
17
17
  data-id="on-time-monthly-by-day"
18
18
  type="radio"
19
19
  value="day"
@@ -49,7 +49,7 @@
49
49
  <div class="on-time__radio radio">
50
50
  <input
51
51
  id="on-time-monthly-by-week"
52
- v-model="selectedTimeMode"
52
+ v-model="model.frg_monthly_mode"
53
53
  data-id="on-time-monthly-by-week"
54
54
  type="radio"
55
55
  value="week"
@@ -115,8 +115,6 @@ const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
115
115
 
116
116
  const localization = computed<UI_I_Localization>(() => useLocal())
117
117
 
118
- const selectedTimeMode = ref<'day' | 'week'>('day')
119
-
120
118
  const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
121
119
  return frequencyOnWeeksDaysFunc(localization.value)
122
120
  })
@@ -125,7 +123,7 @@ const frequencyOnOrdinalNumber = computed<UI_I_SelectInputItem[]>(() => {
125
123
  })
126
124
 
127
125
  const isDisabledMonthlyDayField = computed<boolean>(
128
- () => selectedTimeMode.value === 'week'
126
+ () => model.value.frg_monthly_mode === 'week'
129
127
  )
130
128
 
131
129
  const isInitTimeIntervalValidation = ref<boolean>(false)
@@ -7,31 +7,31 @@ export const frequencyOnWeeksDaysFunc = (
7
7
  return [
8
8
  {
9
9
  label: localization.common.sunday,
10
- value: 'sunday',
10
+ value: 6,
11
11
  },
12
12
  {
13
13
  label: localization.common.monday,
14
- value: 'monday',
14
+ value: 1,
15
15
  },
16
16
  {
17
17
  label: localization.common.tuesday,
18
- value: 'tuesday',
18
+ value: 2,
19
19
  },
20
20
  {
21
21
  label: localization.common.wednesday,
22
- value: 'wednesday',
22
+ value: 3,
23
23
  },
24
24
  {
25
25
  label: localization.common.thursday,
26
- value: 'thursday',
26
+ value: 4,
27
27
  },
28
28
  {
29
29
  label: localization.common.friday,
30
- value: 'friday',
30
+ value: 5,
31
31
  },
32
32
  {
33
33
  label: localization.common.saturday,
34
- value: 'saturday',
34
+ value: 0,
35
35
  },
36
36
  ]
37
37
  }
@@ -42,23 +42,23 @@ export const frequencyOnOrdinalNumberFunc = (
42
42
  return [
43
43
  {
44
44
  label: localization.scheduledTasks.first,
45
- value: '',
45
+ value: 1,
46
46
  },
47
47
  {
48
48
  label: localization.scheduledTasks.second,
49
- value: 'once',
49
+ value: 2,
50
50
  },
51
51
  {
52
52
  label: localization.scheduledTasks.third,
53
- value: 'after-startup',
53
+ value: 3,
54
54
  },
55
55
  {
56
56
  label: localization.scheduledTasks.fourth,
57
- value: 'hour',
57
+ value: 4,
58
58
  },
59
59
  {
60
60
  label: localization.common.last,
61
- value: 'day',
61
+ value: 5,
62
62
  },
63
63
  ]
64
64
  }
@@ -178,15 +178,19 @@ const generateWeeklyCronExpression = (
178
178
  const generateMonthlyCronExpression = (
179
179
  data: UI_I_ScheduleNewTasksForm
180
180
  ): string => {
181
- const { frg_interval, frg_monthly_day } = data
181
+ const { frg_interval, frg_monthly_day, frq_week_day, frq_ordinal_number } =
182
+ data
182
183
 
183
184
  const startOn = new Date(data.frg_start_on_time)
184
185
  const end = new Date(data.frg_end_time)
185
186
 
186
187
  console.log(startOn, end)
188
+ const month = data.frg_monthly_mode === 'week' ? '*' : frg_monthly_day
189
+ const cronWeekly = `${frq_week_day}#${frq_ordinal_number}`
190
+ const dayOfWeek = data.frg_monthly_mode === 'week' ? cronWeekly : '*'
187
191
 
188
192
  // Генерируем cron-выражение
189
- return `* * ${frg_monthly_day} */${frg_interval} *`
193
+ return `* * ${month} */${frg_interval} ${dayOfWeek}`
190
194
  }
191
195
 
192
196
  const generateCronExpression = (
@@ -13,6 +13,7 @@ export const scheduledTaskDefaultFormFunc = (): UI_I_ScheduleNewTasksForm => {
13
13
  frg_interval: 1,
14
14
  frg_end_time: '',
15
15
  frg_start_on_time: '',
16
+ frg_monthly_mode: 'day',
16
17
  frg_monthly_day: 0,
17
18
  frq_week_day: '',
18
19
  frq_ordinal_number: '',
@@ -11,6 +11,7 @@ export interface UI_I_ScheduleNewTasksForm {
11
11
  frg_interval: number
12
12
  frg_end_time: string
13
13
  frg_start_on_time: string
14
+ frg_monthly_mode: 'day' | 'week'
14
15
  frg_monthly_day: number
15
16
  frq_ordinal_number: string
16
17
  frq_week_day: UI_T_FrequencyWeeksDays
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.298",
4
+ "version": "1.4.299",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",