bfg-common 1.5.902 → 1.5.904

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.
@@ -3393,7 +3393,8 @@
3393
3393
  "fourth": "Па-чацвёртае",
3394
3394
  "once": "Адзін раз",
3395
3395
  "selectFrequency": "Выберыце частату",
3396
- "frequency": "Частата"
3396
+ "frequency": "Частата",
3397
+ "delayMinutes": "Затрымка (хвілін)"
3397
3398
  },
3398
3399
  "license": {
3399
3400
  "limits": "Мяжа",
@@ -3397,7 +3397,8 @@
3397
3397
  "fourth": "Fourth",
3398
3398
  "once": "Once",
3399
3399
  "selectFrequency": "Select Frequency",
3400
- "frequency": "Frequency"
3400
+ "frequency": "Frequency",
3401
+ "delayMinutes": "Delay (Minutes)"
3401
3402
  },
3402
3403
  "license": {
3403
3404
  "limits": "Limits",
@@ -3397,7 +3397,8 @@
3397
3397
  "fourth": "Չորրորդ",
3398
3398
  "once": "Մեկ անգամ",
3399
3399
  "selectFrequency": "Ընտրեք հաճախականությունը",
3400
- "frequency": "Հաճախականություն"
3400
+ "frequency": "Հաճախականություն",
3401
+ "delayMinutes": "Ժամանակաձգում (րոպե)"
3401
3402
  },
3402
3403
  "license": {
3403
3404
  "limits": "Սահմանները",
@@ -3396,7 +3396,8 @@
3396
3396
  "fourth": "Төртінші",
3397
3397
  "once": "Бір рет",
3398
3398
  "selectFrequency": "Жиілікті таңдаңыз",
3399
- "frequency": "Жиілік"
3399
+ "frequency": "Жиілік",
3400
+ "delayMinutes": "Кешігу (минут)"
3400
3401
  },
3401
3402
  "license": {
3402
3403
  "limits": "Шектеулер",
@@ -3396,7 +3396,8 @@
3396
3396
  "fourth": "Четвертый",
3397
3397
  "once": "Один раз",
3398
3398
  "selectFrequency": "Выберите частоту",
3399
- "frequency": "Частота"
3399
+ "frequency": "Частота",
3400
+ "delayMinutes": "Задержка (минут)"
3400
3401
  },
3401
3402
  "license": {
3402
3403
  "limits": "Пределы",
@@ -3394,7 +3394,8 @@
3394
3394
  "fourth": "第四",
3395
3395
  "once": "一次",
3396
3396
  "selectFrequency": "选择频率",
3397
- "frequency": "频率"
3397
+ "frequency": "频率",
3398
+ "delayMinutes": "延迟(分钟)"
3398
3399
  },
3399
3400
  "license": {
3400
3401
  "limits": "限制",
@@ -1,32 +1,10 @@
1
1
  <template>
2
- <div class="after-startup clr-col-6 pl-0">
3
- <span class="after-startup__prefix">
4
- {{ localization.scheduledTasks.with }}
5
- </span>
6
-
7
- <label
8
- :class="timeIntervalErrorText && 'invalid'"
9
- for="minute-delay-field"
10
- class="tooltip tooltip-validation tooltip-xs tooltip-top-left"
11
- >
12
- <input
13
- id="minute-delay-field"
14
- v-model="modelFrequencyLocal.frg_after_startup"
15
- data-id="edit-lockout-policy-time-interval-input"
16
- type="text"
17
- @input="onInitTimeIntervalValidation"
18
- @blur="onInitTimeIntervalValidation"
19
- />
20
-
21
- <span class="tooltip-content">
22
- {{ timeIntervalErrorText }}
23
- </span>
24
- </label>
25
-
26
- <span class="after-startup__suffix">
27
- {{ localization.scheduledTasks.minuteDelay }}
28
- </span>
29
- </div>
2
+ <component
3
+ :is="currentComponent"
4
+ v-model="modelFrequencyLocal.frg_after_startup"
5
+ :time-interval-error-text="timeIntervalErrorText"
6
+ @init-validation="onInitValidation"
7
+ />
30
8
  </template>
31
9
 
32
10
  <script lang="ts" setup>
@@ -39,9 +17,17 @@ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
39
17
  })
40
18
 
41
19
  const localization = computed<UI_I_Localization>(() => useLocal())
20
+ const { $store }: any = useNuxtApp()
21
+
22
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
23
+ const currentComponent = computed(() =>
24
+ isNewView.value
25
+ ? defineAsyncComponent(() => import('./New.vue'))
26
+ : defineAsyncComponent(() => import('./Old.vue'))
27
+ )
42
28
 
43
29
  const isInitTimeIntervalValidation = ref<boolean>(false)
44
- const onInitTimeIntervalValidation = (): void => {
30
+ const onInitValidation = (): void => {
45
31
  isInitTimeIntervalValidation.value = true
46
32
  }
47
33
 
@@ -61,22 +47,3 @@ watch(
61
47
  { immediate: true }
62
48
  )
63
49
  </script>
64
-
65
- <style lang="scss" scoped>
66
- @import 'bfg-common/assets/scss/common/mixins.scss';
67
- .after-startup {
68
- @include flex($align: center);
69
- margin-top: 10px;
70
- &__suffix {
71
- white-space: nowrap;
72
- }
73
- .tooltip {
74
- & > .tooltip-content {
75
- width: 200px;
76
- }
77
- }
78
- input {
79
- width: 70px;
80
- }
81
- }
82
- </style>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div class="frequency-after-startup">
3
+ <h2>{{ localization.scheduledTasks.delayMinutes }}</h2>
4
+ <ui-input
5
+ id="ip-address"
6
+ v-model="afterStartupModel"
7
+ :error="props.timeIntervalErrorText"
8
+ :placeholder="localization.scheduledTasks.delayMinutes"
9
+ test-id="scheduler-frequency-delay-minute-field"
10
+ autocomplete="off"
11
+ type="number"
12
+ @input="onInitValidation"
13
+ ></ui-input>
14
+ </div>
15
+ </template>
16
+
17
+ <script lang="ts" setup>
18
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
19
+
20
+ const afterStartupModel = defineModel<number>({ required: true })
21
+ const props = defineProps<{
22
+ timeIntervalErrorText: string
23
+ }>()
24
+ const emits = defineEmits<{
25
+ (event: 'init-validation'): void
26
+ }>()
27
+
28
+ const localization = computed<UI_I_Localization>(() => useLocal())
29
+
30
+ const onInitValidation = (): void => emits('init-validation')
31
+ </script>
32
+
33
+ <style lang="scss" scoped>
34
+ .frequency-after-startup {
35
+ h2 {
36
+ font-family: 'Inter', sans-serif;
37
+ color: var(--title-form-first-color);
38
+ font-size: 14px;
39
+ font-weight: 500;
40
+ margin-bottom: 12px;
41
+ }
42
+ }
43
+ </style>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div class="after-startup clr-col-6 pl-0">
3
+ <span class="after-startup__prefix">
4
+ {{ localization.scheduledTasks.with }}
5
+ </span>
6
+
7
+ <label
8
+ :class="props.timeIntervalErrorText && 'invalid'"
9
+ for="minute-delay-field"
10
+ class="tooltip tooltip-validation tooltip-xs tooltip-top-left"
11
+ >
12
+ <input
13
+ id="minute-delay-field"
14
+ v-model="afterStartupModel"
15
+ data-id="edit-lockout-policy-time-interval-input"
16
+ type="text"
17
+ @input="onInitValidation"
18
+ @blur="onInitValidation"
19
+ />
20
+
21
+ <span class="tooltip-content">
22
+ {{ props.timeIntervalErrorText }}
23
+ </span>
24
+ </label>
25
+
26
+ <span class="after-startup__suffix">
27
+ {{ localization.scheduledTasks.minuteDelay }}
28
+ </span>
29
+ </div>
30
+ </template>
31
+
32
+ <script lang="ts" setup>
33
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
34
+
35
+ const afterStartupModel = defineModel<number>({ required: true })
36
+ const props = defineProps<{
37
+ timeIntervalErrorText: string
38
+ }>()
39
+ const emits = defineEmits<{
40
+ (event: 'init-validation'): void
41
+ }>()
42
+
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const onInitValidation = (): void => emits('init-validation')
46
+ </script>
47
+
48
+ <style lang="scss" scoped>
49
+ @import 'bfg-common/assets/scss/common/mixins.scss';
50
+ .after-startup {
51
+ @include flex($align: center);
52
+ margin-top: 10px;
53
+ &__suffix {
54
+ white-space: nowrap;
55
+ }
56
+ .tooltip {
57
+ & > .tooltip-content {
58
+ width: 200px;
59
+ }
60
+ }
61
+ input {
62
+ width: 70px;
63
+ }
64
+ }
65
+ </style>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div class="frequency-on-date">
3
+ <div>
4
+ <h2>{{ localization.common.on }}</h2>
5
+ <ui-input-with-datepicker
6
+ id="events-filter-time-range-date-to"
7
+ v-model="scheduledTaskFormLocal.frg_on_time"
8
+ :format="datepickerFormat"
9
+ test-id="frequency-on-date-input"
10
+ time-format="12"
11
+ :error="''"
12
+ :error-timepicker="''"
13
+ />
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script lang="ts" setup>
19
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
20
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
21
+ import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
22
+
23
+ const scheduledTaskFormLocal = defineModel<UI_I_ScheduleNewTasksForm>({
24
+ required: true,
25
+ })
26
+
27
+ const localization = computed<UI_I_Localization>(() => useLocal())
28
+
29
+ const datepickerFormat = computed<string>(
30
+ () => getUiDatepickerFormatByLanguage('en_US') // TODO из пропс должен приходить язык
31
+ )
32
+ </script>
33
+
34
+ <style lang="scss" scoped>
35
+ .frequency-on-date {
36
+ h2 {
37
+ font-family: 'Inter', sans-serif;
38
+ color: var(--title-form-first-color);
39
+ font-size: 14px;
40
+ font-weight: 500;
41
+ line-height: 18px;
42
+ margin-bottom: 12px;
43
+ }
44
+ }
45
+ </style>
@@ -0,0 +1,242 @@
1
+ <template>
2
+ <div class="on-time">
3
+ <label class="on-time__label">
4
+ {{ localization.common.on }}
5
+ </label>
6
+
7
+ <common-pages-scheduled-tasks-modals-common-frequency-on-select-week
8
+ v-if="props.type === 'week'"
9
+ v-model="model"
10
+ />
11
+
12
+ <div v-if="props.type === 'month'">
13
+ <div class="on-time__radio radio">
14
+ <input
15
+ id="on-time-monthly-by-day"
16
+ v-model="model.frg_monthly_mode"
17
+ data-id="on-time-monthly-by-day"
18
+ type="radio"
19
+ value="day"
20
+ class="custom-radio-button"
21
+ name="name"
22
+ />
23
+ <label for="on-time-monthly-by-day" class="custom-radio-label">
24
+ {{ localization.scheduledTasks.day }}
25
+ </label>
26
+
27
+ <label
28
+ :class="[
29
+ 'tooltip tooltip-validation tooltip-xs tooltip-top-left',
30
+ schedulerOnDayErrorText && 'invalid',
31
+ ]"
32
+ for="monthly-by-day-field"
33
+ >
34
+ <input
35
+ id="monthly-by-day-field"
36
+ v-model="model.frg_monthly_day"
37
+ :disabled="isDisabledMonthlyDayField"
38
+ data-id="edit-lockout-policy-time-interval-input"
39
+ type="text"
40
+ class="monthly-day-field"
41
+ @input="onInitTimeIntervalValidation"
42
+ @blur="onInitTimeIntervalValidation"
43
+ />
44
+
45
+ <span class="tooltip-content">
46
+ {{ schedulerOnDayErrorText }}
47
+ </span>
48
+ </label>
49
+ </div>
50
+
51
+ <div class="on-time__radio radio">
52
+ <input
53
+ id="on-time-monthly-by-week"
54
+ v-model="model.frg_monthly_mode"
55
+ data-id="on-time-monthly-by-week"
56
+ type="radio"
57
+ value="week"
58
+ class="custom-radio-button"
59
+ name="name"
60
+ />
61
+
62
+ <label for="on-time-monthly-by-week" class="custom-radio-label mr-6">
63
+ {{ localization.scheduledTasks.the }}
64
+ </label>
65
+ <common-select-input
66
+ v-model="model.frq_ordinal_number"
67
+ :data="frequencyOnOrdinalNumber"
68
+ :class="[
69
+ 'radio__select ordinary-day',
70
+ !isDisabledMonthlyDayField && 'disabled',
71
+ ]"
72
+ />
73
+
74
+ <common-select-input
75
+ v-model="model.frq_week_day"
76
+ :data="frequencyOnWeeksDays"
77
+ :class="[
78
+ 'radio__select week-days',
79
+ !isDisabledMonthlyDayField && 'disabled',
80
+ ]"
81
+ />
82
+ </div>
83
+ </div>
84
+
85
+ <label
86
+ v-if="props.type === 'once'"
87
+ :class="[
88
+ 'tooltip tooltip-validation tooltip-xs tooltip-top-left',
89
+ schedulerAtOnceErrorText && 'invalid',
90
+ ]"
91
+ for="frequency-on-date"
92
+ >
93
+ <input
94
+ id="frequency-on-date"
95
+ v-model.lazy="model.frg_on_time"
96
+ data-id="frequency-on-date-input"
97
+ type="datetime-local"
98
+ />
99
+
100
+ <span class="tooltip-content">
101
+ {{ schedulerAtOnceErrorText }}
102
+ </span>
103
+ </label>
104
+ </div>
105
+ </template>
106
+
107
+ <script lang="ts" setup>
108
+ import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
109
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
110
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
111
+ import {
112
+ frequencyOnOrdinalNumberFunc,
113
+ frequencyOnWeeksDaysFunc,
114
+ } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options'
115
+ import {
116
+ validateDate,
117
+ validateField,
118
+ } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
119
+
120
+ const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
121
+ const props = defineProps<{
122
+ type: string
123
+ }>()
124
+
125
+ const { $formattedDatetime }: any = useNuxtApp()
126
+
127
+
128
+ const localization = computed<UI_I_Localization>(() => useLocal())
129
+
130
+ const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
131
+ return frequencyOnWeeksDaysFunc(localization.value)
132
+ })
133
+ const frequencyOnOrdinalNumber = computed<UI_I_SelectInputItem[]>(() => {
134
+ return frequencyOnOrdinalNumberFunc(localization.value)
135
+ })
136
+
137
+ const isDisabledMonthlyDayField = computed<boolean>(
138
+ () => model.value.frg_monthly_mode === 'week'
139
+ )
140
+
141
+ const isInitTimeIntervalValidation = ref<boolean>(false)
142
+ const onInitTimeIntervalValidation = (): void => {
143
+ isInitTimeIntervalValidation.value = true
144
+ }
145
+ const schedulerOnDayErrorText = computed<string>(() => {
146
+ if (!isInitTimeIntervalValidation.value || isDisabledMonthlyDayField.value)
147
+ return ''
148
+
149
+ return validateField(
150
+ localization.value,
151
+ model.value.frg_monthly_day,
152
+ true,
153
+ true
154
+ )
155
+ })
156
+ watch(
157
+ schedulerOnDayErrorText,
158
+ (newValue: string) => {
159
+ model.value.isValid = !!newValue
160
+ },
161
+ { immediate: true }
162
+ )
163
+
164
+ const schedulerAtOnceErrorText = computed<string>(() => {
165
+ return !model.value.frg_on_time
166
+ ? localization.value.common.fieldRequired
167
+ : validateDate(localization.value, model.value.frg_on_time)
168
+ })
169
+ watch(
170
+ schedulerAtOnceErrorText,
171
+ (newValue: string) => {
172
+ model.value.isValid = !!newValue
173
+ },
174
+ { immediate: true }
175
+ )
176
+
177
+ onMounted(() => {
178
+ props.type === 'once' && setDefaultDateTime()
179
+ })
180
+ const setDefaultDateTime = () => {
181
+ model.value.frg_on_time = $formattedDatetime(new Date(), {
182
+ formatDate: 'yyyy-MM-dd',
183
+ separator: ' ',
184
+ formatTime: 'HH:mm',
185
+ })
186
+ }
187
+ </script>
188
+
189
+ <style lang="scss" scoped>
190
+ @import 'bfg-common/assets/scss/common/mixins.scss';
191
+ .on-time {
192
+ display: flex;
193
+ margin-top: 25px;
194
+ &__label {
195
+ font-weight: 400;
196
+ padding-left: 0;
197
+ margin-right: 15px;
198
+ }
199
+ &__radio {
200
+ @include flex($align: center);
201
+ .monthly-day-field {
202
+ width: 110px;
203
+ }
204
+ }
205
+ }
206
+ .radio {
207
+ &__select {
208
+ width: 100%;
209
+ margin-top: 10px;
210
+ :deep(.select-input__inner) {
211
+ max-width: 100% !important;
212
+ min-width: max-content;
213
+ }
214
+ &.ordinary-day :deep(select) {
215
+ min-width: 80px;
216
+ }
217
+ &.week-days {
218
+ margin-left: 15px;
219
+ :deep(select) {
220
+ min-width: 110px;
221
+ }
222
+ }
223
+ select {
224
+ width: 80px;
225
+ }
226
+ &.disabled {
227
+ opacity: 0.6;
228
+ pointer-events: none;
229
+ }
230
+ }
231
+ }
232
+
233
+ .tooltip {
234
+ & > .tooltip-content {
235
+ width: 200px;
236
+ }
237
+ }
238
+ input[type='radio']:focus:checked + label::before,
239
+ input[type='radio']:focus + label::before {
240
+ box-shadow: inset 0 0 0 0.25rem #0094d2;
241
+ }
242
+ </style>
@@ -1,107 +1,12 @@
1
1
  <template>
2
- <div class="on-time">
3
- <label class="on-time__label">
4
- {{ localization.common.on }}
5
- </label>
6
-
7
- <common-pages-scheduled-tasks-modals-common-frequency-on-select-week
8
- v-if="props.type === 'week'"
9
- v-model="model"
10
- />
11
-
12
- <div v-if="props.type === 'month'">
13
- <div class="on-time__radio radio">
14
- <input
15
- id="on-time-monthly-by-day"
16
- v-model="model.frg_monthly_mode"
17
- data-id="on-time-monthly-by-day"
18
- type="radio"
19
- value="day"
20
- class="custom-radio-button"
21
- name="name"
22
- />
23
- <label for="on-time-monthly-by-day" class="custom-radio-label">
24
- {{ localization.scheduledTasks.day }}
25
- </label>
26
-
27
- <label
28
- :class="[
29
- 'tooltip tooltip-validation tooltip-xs tooltip-top-left',
30
- schedulerOnDayErrorText && 'invalid',
31
- ]"
32
- for="monthly-by-day-field"
33
- >
34
- <input
35
- id="monthly-by-day-field"
36
- v-model="model.frg_monthly_day"
37
- :disabled="isDisabledMonthlyDayField"
38
- data-id="edit-lockout-policy-time-interval-input"
39
- type="text"
40
- class="monthly-day-field"
41
- @input="onInitTimeIntervalValidation"
42
- @blur="onInitTimeIntervalValidation"
43
- />
44
-
45
- <span class="tooltip-content">
46
- {{ schedulerOnDayErrorText }}
47
- </span>
48
- </label>
49
- </div>
50
-
51
- <div class="on-time__radio radio">
52
- <input
53
- id="on-time-monthly-by-week"
54
- v-model="model.frg_monthly_mode"
55
- data-id="on-time-monthly-by-week"
56
- type="radio"
57
- value="week"
58
- class="custom-radio-button"
59
- name="name"
60
- />
61
-
62
- <label for="on-time-monthly-by-week" class="custom-radio-label mr-6">
63
- {{ localization.scheduledTasks.the }}
64
- </label>
65
- <common-select-input
66
- v-model="model.frq_ordinal_number"
67
- :data="frequencyOnOrdinalNumber"
68
- :class="[
69
- 'radio__select ordinary-day',
70
- !isDisabledMonthlyDayField && 'disabled',
71
- ]"
72
- />
73
-
74
- <common-select-input
75
- v-model="model.frq_week_day"
76
- :data="frequencyOnWeeksDays"
77
- :class="[
78
- 'radio__select week-days',
79
- !isDisabledMonthlyDayField && 'disabled',
80
- ]"
81
- />
82
- </div>
83
- </div>
84
-
85
- <label
86
- v-if="props.type === 'once'"
87
- :class="[
88
- 'tooltip tooltip-validation tooltip-xs tooltip-top-left',
89
- schedulerAtOnceErrorText && 'invalid',
90
- ]"
91
- for="frequency-on-date"
92
- >
93
- <input
94
- id="frequency-on-date"
95
- v-model.lazy="model.frg_on_time"
96
- data-id="frequency-on-date-input"
97
- type="datetime-local"
98
- />
99
-
100
- <span class="tooltip-content">
101
- {{ schedulerAtOnceErrorText }}
102
- </span>
103
- </label>
104
- </div>
2
+ <component
3
+ :is="currentComponent"
4
+ v-model="model"
5
+ :frequency-on-weeks-days="frequencyOnWeeksDays"
6
+ :frequency-on-ordinal-number="frequencyOnOrdinalNumber"
7
+ :type="type"
8
+ @vue:mounted="onSetDefaultDateTime"
9
+ />
105
10
  </template>
106
11
 
107
12
  <script lang="ts" setup>
@@ -117,15 +22,21 @@ import {
117
22
  validateField,
118
23
  } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
119
24
 
25
+ const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
120
26
  const props = defineProps<{
121
27
  type: string
122
28
  }>()
123
29
 
30
+ const localization = computed<UI_I_Localization>(() => useLocal())
124
31
  const { $formattedDatetime }: any = useNuxtApp()
32
+ const { $store }: any = useNuxtApp()
125
33
 
126
- const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
127
-
128
- const localization = computed<UI_I_Localization>(() => useLocal())
34
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
35
+ const currentComponent = computed(() =>
36
+ isNewView.value
37
+ ? defineAsyncComponent(() => import('./New.vue'))
38
+ : defineAsyncComponent(() => import('./Old.vue'))
39
+ )
129
40
 
130
41
  const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
131
42
  return frequencyOnWeeksDaysFunc(localization.value)
@@ -174,10 +85,9 @@ watch(
174
85
  { immediate: true }
175
86
  )
176
87
 
177
- onMounted(() => {
178
- props.type === 'once' && setDefaultDateTime()
179
- })
180
- const setDefaultDateTime = () => {
88
+ const onSetDefaultDateTime = () => {
89
+ if (props.type !== 'once') return
90
+
181
91
  model.value.frg_on_time = $formattedDatetime(new Date(), {
182
92
  formatDate: 'yyyy-MM-dd',
183
93
  separator: ' ',
@@ -185,58 +95,3 @@ const setDefaultDateTime = () => {
185
95
  })
186
96
  }
187
97
  </script>
188
-
189
- <style lang="scss" scoped>
190
- @import 'bfg-common/assets/scss/common/mixins.scss';
191
- .on-time {
192
- display: flex;
193
- margin-top: 25px;
194
- &__label {
195
- font-weight: 400;
196
- padding-left: 0;
197
- margin-right: 15px;
198
- }
199
- &__radio {
200
- @include flex($align: center);
201
- .monthly-day-field {
202
- width: 110px;
203
- }
204
- }
205
- }
206
- .radio {
207
- &__select {
208
- width: 100%;
209
- margin-top: 10px;
210
- :deep(.select-input__inner) {
211
- max-width: 100% !important;
212
- min-width: max-content;
213
- }
214
- &.ordinary-day :deep(select) {
215
- min-width: 80px;
216
- }
217
- &.week-days {
218
- margin-left: 15px;
219
- :deep(select) {
220
- min-width: 110px;
221
- }
222
- }
223
- select {
224
- width: 80px;
225
- }
226
- &.disabled {
227
- opacity: 0.6;
228
- pointer-events: none;
229
- }
230
- }
231
- }
232
-
233
- .tooltip {
234
- & > .tooltip-content {
235
- width: 200px;
236
- }
237
- }
238
- input[type='radio']:focus:checked + label::before,
239
- input[type='radio']:focus + label::before {
240
- box-shadow: inset 0 0 0 0.25rem #0094d2;
241
- }
242
- </style>
@@ -35,7 +35,7 @@
35
35
  class="form__description"
36
36
  />
37
37
 
38
- <div>
38
+ <div class="form__run">
39
39
  <h2>{{ localization.common.run }}</h2>
40
40
 
41
41
  <h2 class="frequency">{{ localization.scheduledTasks.frequency }}</h2>
@@ -48,6 +48,10 @@
48
48
  select-width="100%"
49
49
  class="mt-3"
50
50
  />
51
+ <common-pages-scheduled-tasks-modals-common-frequency
52
+ v-model="model"
53
+ :type="model.frequency"
54
+ />
51
55
  </div>
52
56
 
53
57
  <div class="form__email">
@@ -71,8 +75,6 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
71
75
  import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
72
76
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
73
77
  import type { UI_I_InitialValidationFields } from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/models/interfaces'
74
- import type { UI_T_FrequencyType } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/models/types'
75
- import * as cron from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/utils'
76
78
 
77
79
  const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
78
80
  const props = defineProps<{
@@ -110,52 +112,6 @@ const frequencyMethodOptionsLocal = computed<UI_I_Dropdown[]>(() =>
110
112
  text: item.label,
111
113
  }))
112
114
  )
113
-
114
- watch(
115
- model,
116
- (newValue: UI_I_ScheduleNewTasksForm) => {
117
- newValue.cron = generateCronExpression(newValue.frequency, newValue)
118
- },
119
- { deep: true }
120
- )
121
-
122
- const generateCronExpression = (
123
- runType: UI_T_FrequencyType,
124
- interval: UI_I_ScheduleNewTasksForm
125
- ): string => {
126
- let cronExpression
127
-
128
- // Генерируем cron-выражение на основе runType
129
- switch (runType) {
130
- case 'once':
131
- const timestamp = Math.floor(
132
- new Date(interval.frg_on_time).getTime() / 1000
133
- )
134
- cronExpression = `* * * * * ${timestamp}:0-0-0-0:once`
135
- break
136
- case 'after-startup':
137
- const suffixDelay =
138
- interval.frg_after_startup === 0 ? '' : `-${interval.frg_after_startup}`
139
- cronExpression = `* * * * * after_procurator_startup${suffixDelay}` // Выполняется после запуска procurator_startup с задержой N минут
140
- break
141
- case 'hour':
142
- cronExpression = cron.generateHourlyCronExpression(interval)
143
- break
144
- case 'day':
145
- cronExpression = cron.generateDailyCronExpression(interval)
146
- break
147
- case 'week':
148
- cronExpression = cron.generateWeeklyCronExpression(interval)
149
- break
150
- case 'month':
151
- cronExpression = cron.generateMonthlyCronExpression(interval)
152
- break
153
- default:
154
- cronExpression = '* * * * *'
155
- }
156
-
157
- return cronExpression
158
- }
159
115
  </script>
160
116
 
161
117
  <style lang="scss" scoped>
@@ -190,6 +146,7 @@ const generateCronExpression = (
190
146
  }
191
147
  }
192
148
 
149
+ &__run,
193
150
  &__email {
194
151
  border-top: 1px solid var(--horizontal-line);
195
152
  padding-top: 16px;
@@ -102,8 +102,6 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
102
102
  import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
103
103
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
104
104
  import type { UI_I_InitialValidationFields } from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/models/interfaces'
105
- import type { UI_T_FrequencyType } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/models/types'
106
- import * as cron from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/utils'
107
105
 
108
106
  const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
109
107
  const props = defineProps<{
@@ -121,52 +119,6 @@ const localization = computed<UI_I_Localization>(() => useLocal())
121
119
  const onInitValidation = (types: string[]): void => {
122
120
  emits('init-validation', types)
123
121
  }
124
-
125
- watch(
126
- model,
127
- (newValue: UI_I_ScheduleNewTasksForm) => {
128
- newValue.cron = generateCronExpression(newValue.frequency, newValue)
129
- },
130
- { deep: true }
131
- )
132
-
133
- const generateCronExpression = (
134
- runType: UI_T_FrequencyType,
135
- interval: UI_I_ScheduleNewTasksForm
136
- ): string => {
137
- let cronExpression
138
-
139
- // Генерируем cron-выражение на основе runType
140
- switch (runType) {
141
- case 'once':
142
- const timestamp = Math.floor(
143
- new Date(interval.frg_on_time).getTime() / 1000
144
- )
145
- cronExpression = `* * * * * ${timestamp}:0-0-0-0:once`
146
- break
147
- case 'after-startup':
148
- const suffixDelay =
149
- interval.frg_after_startup === 0 ? '' : `-${interval.frg_after_startup}`
150
- cronExpression = `* * * * * after_procurator_startup${suffixDelay}` // Выполняется после запуска procurator_startup с задержой N минут
151
- break
152
- case 'hour':
153
- cronExpression = cron.generateHourlyCronExpression(interval)
154
- break
155
- case 'day':
156
- cronExpression = cron.generateDailyCronExpression(interval)
157
- break
158
- case 'week':
159
- cronExpression = cron.generateWeeklyCronExpression(interval)
160
- break
161
- case 'month':
162
- cronExpression = cron.generateMonthlyCronExpression(interval)
163
- break
164
- default:
165
- cronExpression = '* * * * *'
166
- }
167
-
168
- return cronExpression
169
- }
170
122
  </script>
171
123
 
172
124
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.902",
4
+ "version": "1.5.904",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",