bfg-common 1.5.920 → 1.5.921
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/assets/localization/local_be.json +15 -3
- package/assets/localization/local_en.json +15 -3
- package/assets/localization/local_hy.json +15 -3
- package/assets/localization/local_kk.json +15 -3
- package/assets/localization/local_ru.json +15 -3
- package/assets/localization/local_zh.json +15 -3
- package/components/common/pages/scheduledTasks/lib/models/interfaces.ts +6 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/Frequency.vue +46 -42
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/AfterStartup.vue +15 -48
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/New.vue +43 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/Old.vue +65 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/End.vue +15 -69
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/New.vue +73 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/Old.vue +112 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue +19 -53
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/New.vue +49 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Old.vue +68 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils.ts +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/New.vue +137 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/Old.vue +234 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/On.vue +28 -168
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options.ts +17 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/New.vue +66 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/Old.vue +44 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue +17 -28
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/config/weekOptions.ts +20 -50
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/New.vue +46 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/Old.vue +77 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/StartOn.vue +15 -51
- package/components/common/pages/scheduledTasks/modals/common/taskForm/New.vue +194 -0
- package/components/common/pages/scheduledTasks/modals/common/{newTaskForm/NewTaskForm.vue → taskForm/Old.vue} +12 -69
- package/components/common/pages/scheduledTasks/modals/common/taskForm/TaskForm.vue +129 -0
- package/components/common/pages/scheduledTasks/table/Table.vue +27 -81
- package/components/common/pages/scheduledTasks/table/expandDetails/ExpandDetails.vue +2 -2
- package/components/common/pages/scheduledTasks/table/expandDetails/New.vue +48 -17
- package/components/common/pages/scheduledTasks/table/expandDetails/Old.vue +1 -3
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/HistoryRun.vue +16 -54
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/New.vue +147 -0
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/lib/config/historyRunsTable.ts +161 -0
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/old/Old.vue +68 -0
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{lib → old/lib}/config/historyRunsTable.ts +4 -4
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{lib → old/lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/config/expandDetails.ts +7 -5
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/models/interfaces.ts +8 -0
- package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +4 -0
- package/components/common/pages/scheduledTasks/table/new/New.vue +320 -0
- package/components/common/pages/scheduledTasks/table/new/lib/config/scheduledTasksTable.ts +218 -0
- package/components/common/pages/scheduledTasks/table/new/lib/models/enums.ts +14 -0
- package/components/common/pages/scheduledTasks/table/old/Old.vue +93 -0
- package/components/common/pages/scheduledTasks/table/{lib → old/lib}/config/scheduledTasksTable.ts +13 -9
- package/components/common/pages/scheduledTasks/table/{lib → old/lib}/config/tableKeys.ts +1 -1
- package/package.json +1 -1
- package/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus.ts +0 -4
- package/components/common/pages/scheduledTasks/table/lib/models/interfaces.ts +0 -11
- /package/components/common/pages/scheduledTasks/modals/common/{newTaskForm → taskForm}/lib/models/interfaces.ts +0 -0
- /package/components/common/pages/scheduledTasks/modals/common/{newTaskForm → taskForm}/lib/utils.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{lib → old/lib}/models/types.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/{lib → old/lib}/models/types.ts +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
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="scheduledTaskFormLocal"
|
|
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="scheduledTaskFormLocal.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="scheduledTaskFormLocal.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="scheduledTaskFormLocal.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="scheduledTaskFormLocal.frq_ordinal_number"
|
|
67
|
+
:data="props.frequencyOnOrdinalNumber"
|
|
68
|
+
:class="[
|
|
69
|
+
'radio__select ordinary-day',
|
|
70
|
+
!isDisabledMonthlyDayField && 'disabled',
|
|
71
|
+
]"
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<common-select-input
|
|
75
|
+
v-model="scheduledTaskFormLocal.frq_week_day"
|
|
76
|
+
:data="props.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="scheduledTaskFormLocal.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
|
+
validateDate,
|
|
113
|
+
validateField,
|
|
114
|
+
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
115
|
+
|
|
116
|
+
const scheduledTaskFormLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
117
|
+
required: true,
|
|
118
|
+
})
|
|
119
|
+
const props = defineProps<{
|
|
120
|
+
type: string
|
|
121
|
+
frequencyOnWeeksDays: UI_I_SelectInputItem[]
|
|
122
|
+
frequencyOnOrdinalNumber: UI_I_SelectInputItem[]
|
|
123
|
+
}>()
|
|
124
|
+
|
|
125
|
+
const { $formattedDatetime }: any = useNuxtApp()
|
|
126
|
+
|
|
127
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
128
|
+
|
|
129
|
+
const isDisabledMonthlyDayField = computed<boolean>(
|
|
130
|
+
() => scheduledTaskFormLocal.value.frg_monthly_mode === 'week'
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
const isInitTimeIntervalValidation = ref<boolean>(false)
|
|
134
|
+
const onInitTimeIntervalValidation = (): void => {
|
|
135
|
+
isInitTimeIntervalValidation.value = true
|
|
136
|
+
}
|
|
137
|
+
const schedulerOnDayErrorText = computed<string>(() => {
|
|
138
|
+
if (!isInitTimeIntervalValidation.value || isDisabledMonthlyDayField.value)
|
|
139
|
+
return ''
|
|
140
|
+
|
|
141
|
+
return validateField(
|
|
142
|
+
localization.value,
|
|
143
|
+
scheduledTaskFormLocal.value.frg_monthly_day,
|
|
144
|
+
true,
|
|
145
|
+
true
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
watch(
|
|
149
|
+
schedulerOnDayErrorText,
|
|
150
|
+
(newValue: string) => {
|
|
151
|
+
scheduledTaskFormLocal.value.isValid = !!newValue
|
|
152
|
+
},
|
|
153
|
+
{ immediate: true }
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
const schedulerAtOnceErrorText = computed<string>(() => {
|
|
157
|
+
return !scheduledTaskFormLocal.value.frg_on_time
|
|
158
|
+
? localization.value.common.fieldRequired
|
|
159
|
+
: validateDate(localization.value, scheduledTaskFormLocal.value.frg_on_time)
|
|
160
|
+
})
|
|
161
|
+
watch(
|
|
162
|
+
schedulerAtOnceErrorText,
|
|
163
|
+
(newValue: string) => {
|
|
164
|
+
scheduledTaskFormLocal.value.isValid = !!newValue
|
|
165
|
+
},
|
|
166
|
+
{ immediate: true }
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
onMounted(() => {
|
|
170
|
+
props.type === 'once' && setDefaultDateTime()
|
|
171
|
+
})
|
|
172
|
+
const setDefaultDateTime = () => {
|
|
173
|
+
scheduledTaskFormLocal.value.frg_on_time = $formattedDatetime(new Date(), {
|
|
174
|
+
formatDate: 'yyyy-MM-dd',
|
|
175
|
+
separator: ' ',
|
|
176
|
+
formatTime: 'HH:mm',
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
</script>
|
|
180
|
+
|
|
181
|
+
<style lang="scss" scoped>
|
|
182
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
183
|
+
.on-time {
|
|
184
|
+
display: flex;
|
|
185
|
+
margin-top: 25px;
|
|
186
|
+
&__label {
|
|
187
|
+
font-weight: 400;
|
|
188
|
+
padding-left: 0;
|
|
189
|
+
margin-right: 15px;
|
|
190
|
+
}
|
|
191
|
+
&__radio {
|
|
192
|
+
@include flex($align: center);
|
|
193
|
+
.monthly-day-field {
|
|
194
|
+
width: 110px;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
.radio {
|
|
199
|
+
&__select {
|
|
200
|
+
width: 100%;
|
|
201
|
+
margin-top: 10px;
|
|
202
|
+
:deep(.select-input__inner) {
|
|
203
|
+
max-width: 100% !important;
|
|
204
|
+
min-width: max-content;
|
|
205
|
+
}
|
|
206
|
+
&.ordinary-day :deep(select) {
|
|
207
|
+
min-width: 80px;
|
|
208
|
+
}
|
|
209
|
+
&.week-days {
|
|
210
|
+
margin-left: 15px;
|
|
211
|
+
:deep(select) {
|
|
212
|
+
min-width: 110px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
select {
|
|
216
|
+
width: 80px;
|
|
217
|
+
}
|
|
218
|
+
&.disabled {
|
|
219
|
+
opacity: 0.6;
|
|
220
|
+
pointer-events: none;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.tooltip {
|
|
226
|
+
& > .tooltip-content {
|
|
227
|
+
width: 200px;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
input[type='radio']:focus:checked + label::before,
|
|
231
|
+
input[type='radio']:focus + label::before {
|
|
232
|
+
box-shadow: inset 0 0 0 0.25rem #0094d2;
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
@@ -1,107 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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-monthly-mode="frequencyMonthlyMode"
|
|
6
|
+
:frequency-on-ordinal-number="frequencyOnOrdinalNumber"
|
|
7
|
+
:frequency-on-weeks-days="frequencyOnWeeksDays"
|
|
8
|
+
:type="type"
|
|
9
|
+
@vue:mounted="onSetDefaultDateTime"
|
|
10
|
+
/>
|
|
105
11
|
</template>
|
|
106
12
|
|
|
107
13
|
<script lang="ts" setup>
|
|
@@ -109,30 +15,40 @@ import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/
|
|
|
109
15
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
110
16
|
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
111
17
|
import {
|
|
112
|
-
|
|
18
|
+
frequencyMonthlyModeFunc,
|
|
113
19
|
frequencyOnWeeksDaysFunc,
|
|
20
|
+
frequencyOnOrdinalNumberFunc,
|
|
114
21
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options'
|
|
115
22
|
import {
|
|
116
23
|
validateDate,
|
|
117
24
|
validateField,
|
|
118
25
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
119
26
|
|
|
27
|
+
const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
|
|
120
28
|
const props = defineProps<{
|
|
121
29
|
type: string
|
|
122
30
|
}>()
|
|
123
31
|
|
|
32
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
124
33
|
const { $formattedDatetime }: any = useNuxtApp()
|
|
34
|
+
const { $store }: any = useNuxtApp()
|
|
125
35
|
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
36
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
37
|
+
const currentComponent = computed(() =>
|
|
38
|
+
isNewView.value
|
|
39
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
40
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
41
|
+
)
|
|
129
42
|
|
|
130
|
-
const
|
|
131
|
-
return
|
|
43
|
+
const frequencyMonthlyMode = computed<UI_I_SelectInputItem[]>(() => {
|
|
44
|
+
return frequencyMonthlyModeFunc(localization.value)
|
|
132
45
|
})
|
|
133
46
|
const frequencyOnOrdinalNumber = computed<UI_I_SelectInputItem[]>(() => {
|
|
134
47
|
return frequencyOnOrdinalNumberFunc(localization.value)
|
|
135
48
|
})
|
|
49
|
+
const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
|
|
50
|
+
return frequencyOnWeeksDaysFunc(localization.value)
|
|
51
|
+
})
|
|
136
52
|
|
|
137
53
|
const isDisabledMonthlyDayField = computed<boolean>(
|
|
138
54
|
() => model.value.frg_monthly_mode === 'week'
|
|
@@ -174,10 +90,9 @@ watch(
|
|
|
174
90
|
{ immediate: true }
|
|
175
91
|
)
|
|
176
92
|
|
|
177
|
-
|
|
178
|
-
props.type
|
|
179
|
-
|
|
180
|
-
const setDefaultDateTime = () => {
|
|
93
|
+
const onSetDefaultDateTime = () => {
|
|
94
|
+
if (props.type !== 'once') return
|
|
95
|
+
|
|
181
96
|
model.value.frg_on_time = $formattedDatetime(new Date(), {
|
|
182
97
|
formatDate: 'yyyy-MM-dd',
|
|
183
98
|
separator: ' ',
|
|
@@ -185,58 +100,3 @@ const setDefaultDateTime = () => {
|
|
|
185
100
|
})
|
|
186
101
|
}
|
|
187
102
|
</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>
|
package/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
2
|
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
3
3
|
|
|
4
|
+
export const frequencyMonthlyModeFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_SelectInputItem[] => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
label: localization.scheduledTasks.day,
|
|
10
|
+
value: 'day',
|
|
11
|
+
testId: 'on-time-monthly-by-day',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: localization.scheduledTasks.the,
|
|
15
|
+
value: 'week',
|
|
16
|
+
testId: 'on-time-monthly-by-week',
|
|
17
|
+
},
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
|
|
4
21
|
export const frequencyOnWeeksDaysFunc = (
|
|
5
22
|
localization: UI_I_Localization
|
|
6
23
|
): UI_I_SelectInputItem[] => {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex items-center column-gap-3 frequency-week-days">
|
|
3
|
+
<ui-block
|
|
4
|
+
v-for="item in props.tabs"
|
|
5
|
+
:key="item.value"
|
|
6
|
+
:class="{ selected: item.isActive }"
|
|
7
|
+
@click="onSelectDay(item.value)"
|
|
8
|
+
>
|
|
9
|
+
<div class="main-info">
|
|
10
|
+
<span class="main-info-label">{{ item.name }}</span>
|
|
11
|
+
</div>
|
|
12
|
+
</ui-block>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
import type { UI_I_SelectWeekDayTab } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/models/interfaces'
|
|
18
|
+
|
|
19
|
+
const props = defineProps<{
|
|
20
|
+
tabs: UI_I_SelectWeekDayTab[]
|
|
21
|
+
}>()
|
|
22
|
+
const emits = defineEmits<{
|
|
23
|
+
(event: 'select-day', value: number): void
|
|
24
|
+
}>()
|
|
25
|
+
|
|
26
|
+
const onSelectDay = (value: number): void => {
|
|
27
|
+
emits('select-day', value)
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="scss" scoped>
|
|
32
|
+
.frequency-week-days {
|
|
33
|
+
:deep(.block) {
|
|
34
|
+
width: max-content;
|
|
35
|
+
padding: 10px 12px;
|
|
36
|
+
color: var(--feedback-text-color);
|
|
37
|
+
background: var(--feedback-tab-bg-color);
|
|
38
|
+
box-shadow: inset 0 0 0 1px var(--feedback-tab-border-color);
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
|
|
41
|
+
&.selected {
|
|
42
|
+
box-shadow: inset 0 0 0 1.5px var(--feedback-tab-active-text-color);
|
|
43
|
+
color: var(--feedback-tab-active-text-color);
|
|
44
|
+
cursor: default;
|
|
45
|
+
}
|
|
46
|
+
&:not(.selected):hover {
|
|
47
|
+
background: var(--feedback-tab-hover-bg-color);
|
|
48
|
+
}
|
|
49
|
+
&.selected:hover {
|
|
50
|
+
background: #f0f8fd;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.main-info {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
|
|
59
|
+
&-label {
|
|
60
|
+
font-size: 13px;
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
line-height: 15.73px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- TODO это компонент уже есть надо сделат одну но не ламать функционалность -->
|
|
3
|
+
<div class="flex-align-center">
|
|
4
|
+
<div class="btn-group">
|
|
5
|
+
<button
|
|
6
|
+
v-for="item in props.tabs"
|
|
7
|
+
:key="item"
|
|
8
|
+
:data-id="item.testId"
|
|
9
|
+
:class="['btn btn-sm btn-secondary', { 'btn-primary': item.isActive }]"
|
|
10
|
+
@click="onSelectDay(item.value)"
|
|
11
|
+
>
|
|
12
|
+
{{ item.name }}
|
|
13
|
+
</button>
|
|
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_SelectWeekDayTab } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/models/interfaces'
|
|
21
|
+
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
tabs: UI_I_SelectWeekDayTab[]
|
|
24
|
+
}>()
|
|
25
|
+
const emits = defineEmits<{
|
|
26
|
+
(event: 'select-day', value: number): void
|
|
27
|
+
}>()
|
|
28
|
+
|
|
29
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
30
|
+
|
|
31
|
+
const onSelectDay = (value: number): void => {
|
|
32
|
+
emits('select-day', value)
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss" scoped>
|
|
37
|
+
.btn-group {
|
|
38
|
+
margin-right: 0;
|
|
39
|
+
button {
|
|
40
|
+
padding: 0 0.5rem;
|
|
41
|
+
min-width: 24px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</style>
|
package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
<div class="flex-align-center">
|
|
4
|
-
<div class="btn-group">
|
|
5
|
-
<button
|
|
6
|
-
v-for="item in tabs"
|
|
7
|
-
:key="item"
|
|
8
|
-
:data-id="item.testId"
|
|
9
|
-
:class="['btn btn-sm btn-secondary', { 'btn-primary': item.isActive }]"
|
|
10
|
-
@click="onSelectDay(item.value)"
|
|
11
|
-
>
|
|
12
|
-
{{ item.name }}
|
|
13
|
-
</button>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
2
|
+
<component :is="currentComponent" :tabs="tabs" @select-day="onSelectDay" />
|
|
16
3
|
</template>
|
|
17
4
|
|
|
18
5
|
<script lang="ts" setup>
|
|
@@ -26,6 +13,22 @@ const modelFrequency = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
|
26
13
|
})
|
|
27
14
|
|
|
28
15
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
16
|
+
const { $store }: any = useNuxtApp()
|
|
17
|
+
|
|
18
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
19
|
+
const currentComponent = computed(() =>
|
|
20
|
+
isNewView.value
|
|
21
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
22
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const tabs = computed<UI_I_SelectWeekDayTab[]>(() =>
|
|
26
|
+
weekDaysFunc(
|
|
27
|
+
localization.value,
|
|
28
|
+
modelFrequency.value.frg_on_week_days,
|
|
29
|
+
isNewView.value
|
|
30
|
+
)
|
|
31
|
+
)
|
|
29
32
|
|
|
30
33
|
const onSelectDay = (value: number): void => {
|
|
31
34
|
const index = modelFrequency.value?.frg_on_week_days.indexOf(value)
|
|
@@ -41,10 +44,6 @@ const onSelectDay = (value: number): void => {
|
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
const tabs = computed<UI_I_SelectWeekDayTab[]>(() =>
|
|
45
|
-
weekDaysFunc(localization.value, modelFrequency.value.frg_on_week_days)
|
|
46
|
-
)
|
|
47
|
-
|
|
48
47
|
watch(
|
|
49
48
|
modelFrequency,
|
|
50
49
|
(newValue: UI_I_ScheduleNewTasksForm) => {
|
|
@@ -56,13 +55,3 @@ watch(
|
|
|
56
55
|
}
|
|
57
56
|
)
|
|
58
57
|
</script>
|
|
59
|
-
|
|
60
|
-
<style lang="scss" scoped>
|
|
61
|
-
.btn-group {
|
|
62
|
-
margin-right: 0;
|
|
63
|
-
button {
|
|
64
|
-
padding: 0 0.5rem;
|
|
65
|
-
min-width: 24px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
</style>
|