bfg-common 1.5.921 → 1.5.923
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 +4 -16
- package/assets/localization/local_en.json +4 -16
- package/assets/localization/local_hy.json +4 -16
- package/assets/localization/local_kk.json +4 -16
- package/assets/localization/local_ru.json +4 -16
- package/assets/localization/local_zh.json +4 -16
- package/components/common/pages/scheduledTasks/lib/models/interfaces.ts +0 -6
- package/components/common/pages/scheduledTasks/modals/common/frequency/Frequency.vue +42 -46
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/AfterStartup.vue +48 -15
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/End.vue +69 -15
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue +53 -19
- package/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils.ts +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/On.vue +168 -28
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options.ts +0 -17
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue +28 -17
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/config/weekOptions.ts +50 -20
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/StartOn.vue +51 -15
- package/components/common/pages/scheduledTasks/modals/common/{taskForm/Old.vue → newTaskForm/NewTaskForm.vue} +69 -12
- package/components/common/pages/scheduledTasks/table/Table.vue +81 -27
- package/components/common/pages/scheduledTasks/table/expandDetails/ExpandDetails.vue +2 -2
- package/components/common/pages/scheduledTasks/table/expandDetails/New.vue +17 -48
- package/components/common/pages/scheduledTasks/table/expandDetails/Old.vue +3 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/HistoryRun.vue +54 -16
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/config/historyRunsTable.ts +4 -4
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/config/expandDetails.ts +5 -7
- package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/scheduledTasksTable.ts +9 -13
- package/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus.ts +4 -0
- package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/lib/models/interfaces.ts +11 -0
- package/package.json +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/New.vue +0 -43
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/Old.vue +0 -65
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/New.vue +0 -73
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/Old.vue +0 -112
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/New.vue +0 -49
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Old.vue +0 -68
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/New.vue +0 -137
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/Old.vue +0 -234
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/New.vue +0 -66
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/Old.vue +0 -44
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/New.vue +0 -46
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/Old.vue +0 -77
- package/components/common/pages/scheduledTasks/modals/common/taskForm/New.vue +0 -194
- package/components/common/pages/scheduledTasks/modals/common/taskForm/TaskForm.vue +0 -129
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/New.vue +0 -147
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/lib/config/historyRunsTable.ts +0 -161
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/old/Old.vue +0 -68
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/models/interfaces.ts +0 -8
- package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +0 -4
- package/components/common/pages/scheduledTasks/table/new/New.vue +0 -320
- package/components/common/pages/scheduledTasks/table/new/lib/config/scheduledTasksTable.ts +0 -218
- package/components/common/pages/scheduledTasks/table/new/lib/models/enums.ts +0 -14
- package/components/common/pages/scheduledTasks/table/old/Old.vue +0 -93
- /package/components/common/pages/scheduledTasks/modals/common/{taskForm → newTaskForm}/lib/models/interfaces.ts +0 -0
- /package/components/common/pages/scheduledTasks/modals/common/{taskForm → newTaskForm}/lib/utils.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/models/types.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/{old/lib → lib}/models/types.ts +0 -0
package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div class="interval clr-col-6 pl-0">
|
|
3
|
+
<span class="interval__prefix">
|
|
4
|
+
{{ localization.scheduledTasks.repeatEvery }}
|
|
5
|
+
</span>
|
|
6
|
+
|
|
7
|
+
<label
|
|
8
|
+
:class="[
|
|
9
|
+
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
10
|
+
timeIntervalErrorText && 'invalid',
|
|
11
|
+
]"
|
|
12
|
+
for="frequency-time-interval"
|
|
13
|
+
>
|
|
14
|
+
<input
|
|
15
|
+
id="frequency-time-interval"
|
|
16
|
+
v-model="modelFrequencyLocal.frg_interval"
|
|
17
|
+
data-id="frequency-time-interval-input"
|
|
18
|
+
type="text"
|
|
19
|
+
@input="onInitTimeIntervalValidation"
|
|
20
|
+
@blur="onInitTimeIntervalValidation"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<span class="tooltip-content">
|
|
24
|
+
{{ timeIntervalErrorText }}
|
|
25
|
+
</span>
|
|
26
|
+
</label>
|
|
27
|
+
|
|
28
|
+
<span class="interval__suffix">
|
|
29
|
+
{{ intervalSuffixLabel }}
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
9
32
|
</template>
|
|
10
33
|
|
|
11
34
|
<script lang="ts" setup>
|
|
@@ -16,25 +39,17 @@ import {
|
|
|
16
39
|
validateField,
|
|
17
40
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
18
41
|
|
|
19
|
-
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
20
|
-
required: true,
|
|
21
|
-
})
|
|
22
42
|
const props = defineProps<{
|
|
23
43
|
type: string
|
|
24
44
|
}>()
|
|
45
|
+
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
46
|
+
required: true,
|
|
47
|
+
})
|
|
25
48
|
|
|
26
49
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
27
|
-
const { $store }: any = useNuxtApp()
|
|
28
|
-
|
|
29
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
30
|
-
const currentComponent = computed(() =>
|
|
31
|
-
isNewView.value
|
|
32
|
-
? defineAsyncComponent(() => import('./New.vue'))
|
|
33
|
-
: defineAsyncComponent(() => import('./Old.vue'))
|
|
34
|
-
)
|
|
35
50
|
|
|
36
51
|
const isInitTimeIntervalValidation = ref<boolean>(false)
|
|
37
|
-
const
|
|
52
|
+
const onInitTimeIntervalValidation = (): void => {
|
|
38
53
|
isInitTimeIntervalValidation.value = true
|
|
39
54
|
}
|
|
40
55
|
|
|
@@ -66,3 +81,22 @@ const intervalSuffixLabel = computed<string>(() => {
|
|
|
66
81
|
)
|
|
67
82
|
})
|
|
68
83
|
</script>
|
|
84
|
+
|
|
85
|
+
<style lang="scss" scoped>
|
|
86
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
87
|
+
.interval {
|
|
88
|
+
@include flex($align: center);
|
|
89
|
+
margin-top: 10px;
|
|
90
|
+
&__prefix {
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
.tooltip {
|
|
94
|
+
& > .tooltip-content {
|
|
95
|
+
width: 10rem;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
input {
|
|
99
|
+
width: 70px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -1,13 +1,107 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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>
|
|
11
105
|
</template>
|
|
12
106
|
|
|
13
107
|
<script lang="ts" setup>
|
|
@@ -15,40 +109,30 @@ import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/
|
|
|
15
109
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
16
110
|
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
17
111
|
import {
|
|
18
|
-
frequencyMonthlyModeFunc,
|
|
19
|
-
frequencyOnWeeksDaysFunc,
|
|
20
112
|
frequencyOnOrdinalNumberFunc,
|
|
113
|
+
frequencyOnWeeksDaysFunc,
|
|
21
114
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options'
|
|
22
115
|
import {
|
|
23
116
|
validateDate,
|
|
24
117
|
validateField,
|
|
25
118
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
26
119
|
|
|
27
|
-
const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
|
|
28
120
|
const props = defineProps<{
|
|
29
121
|
type: string
|
|
30
122
|
}>()
|
|
31
123
|
|
|
32
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
33
124
|
const { $formattedDatetime }: any = useNuxtApp()
|
|
34
|
-
const { $store }: any = useNuxtApp()
|
|
35
125
|
|
|
36
|
-
const
|
|
37
|
-
const currentComponent = computed(() =>
|
|
38
|
-
isNewView.value
|
|
39
|
-
? defineAsyncComponent(() => import('./New.vue'))
|
|
40
|
-
: defineAsyncComponent(() => import('./Old.vue'))
|
|
41
|
-
)
|
|
126
|
+
const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
|
|
42
127
|
|
|
43
|
-
const
|
|
44
|
-
|
|
128
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
129
|
+
|
|
130
|
+
const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
|
|
131
|
+
return frequencyOnWeeksDaysFunc(localization.value)
|
|
45
132
|
})
|
|
46
133
|
const frequencyOnOrdinalNumber = computed<UI_I_SelectInputItem[]>(() => {
|
|
47
134
|
return frequencyOnOrdinalNumberFunc(localization.value)
|
|
48
135
|
})
|
|
49
|
-
const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
|
|
50
|
-
return frequencyOnWeeksDaysFunc(localization.value)
|
|
51
|
-
})
|
|
52
136
|
|
|
53
137
|
const isDisabledMonthlyDayField = computed<boolean>(
|
|
54
138
|
() => model.value.frg_monthly_mode === 'week'
|
|
@@ -90,9 +174,10 @@ watch(
|
|
|
90
174
|
{ immediate: true }
|
|
91
175
|
)
|
|
92
176
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
177
|
+
onMounted(() => {
|
|
178
|
+
props.type === 'once' && setDefaultDateTime()
|
|
179
|
+
})
|
|
180
|
+
const setDefaultDateTime = () => {
|
|
96
181
|
model.value.frg_on_time = $formattedDatetime(new Date(), {
|
|
97
182
|
formatDate: 'yyyy-MM-dd',
|
|
98
183
|
separator: ' ',
|
|
@@ -100,3 +185,58 @@ const onSetDefaultDateTime = () => {
|
|
|
100
185
|
})
|
|
101
186
|
}
|
|
102
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>
|
package/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options.ts
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
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
|
-
|
|
21
4
|
export const frequencyOnWeeksDaysFunc = (
|
|
22
5
|
localization: UI_I_Localization
|
|
23
6
|
): UI_I_SelectInputItem[] => {
|
package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- TODO это компонент уже есть надо сделат одну но не ламать функционалность -->
|
|
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>
|
|
3
16
|
</template>
|
|
4
17
|
|
|
5
18
|
<script lang="ts" setup>
|
|
@@ -13,22 +26,6 @@ const modelFrequency = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
|
13
26
|
})
|
|
14
27
|
|
|
15
28
|
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
|
-
)
|
|
32
29
|
|
|
33
30
|
const onSelectDay = (value: number): void => {
|
|
34
31
|
const index = modelFrequency.value?.frg_on_week_days.indexOf(value)
|
|
@@ -44,6 +41,10 @@ const onSelectDay = (value: number): void => {
|
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
|
|
44
|
+
const tabs = computed<UI_I_SelectWeekDayTab[]>(() =>
|
|
45
|
+
weekDaysFunc(localization.value, modelFrequency.value.frg_on_week_days)
|
|
46
|
+
)
|
|
47
|
+
|
|
47
48
|
watch(
|
|
48
49
|
modelFrequency,
|
|
49
50
|
(newValue: UI_I_ScheduleNewTasksForm) => {
|
|
@@ -55,3 +56,13 @@ watch(
|
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
58
|
</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>
|
|
@@ -1,25 +1,55 @@
|
|
|
1
1
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
import { UI_I_SelectWeekDayTab } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/models/interfaces'
|
|
3
|
-
|
|
4
|
-
const WEEK_DAYS_CONFIG = [
|
|
5
|
-
{ value: 1, newKey: 'weekMon', oldKey: 'weekM', testId: 'week-m-value' },
|
|
6
|
-
{ value: 2, newKey: 'weekTue', oldKey: 'weekT', testId: 'week-t-value' },
|
|
7
|
-
{ value: 3, newKey: 'weekWed', oldKey: 'weekW', testId: 'week-w-value' },
|
|
8
|
-
{ value: 4, newKey: 'weekThu', oldKey: 'weekTh', testId: 'week-th-value' },
|
|
9
|
-
{ value: 5, newKey: 'weekFri', oldKey: 'weekF', testId: 'week-f-value' },
|
|
10
|
-
{ value: 6, newKey: 'weekSat', oldKey: 'weekS', testId: 'week-s-value' },
|
|
11
|
-
{ value: 0, newKey: 'weekSun', oldKey: 'weekSu', testId: 'week-su-value' },
|
|
12
|
-
]
|
|
13
2
|
|
|
14
3
|
export const weekDaysFunc = (
|
|
15
4
|
localization: UI_I_Localization,
|
|
16
|
-
selectedWeeks: number[]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
selectedWeeks: number[]
|
|
6
|
+
): any => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
name: localization.common.weekM,
|
|
10
|
+
value: 1,
|
|
11
|
+
isActive: checkIsActiveDay(1, selectedWeeks),
|
|
12
|
+
testId: 'week-m-value',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: localization.common.weekT,
|
|
16
|
+
value: 2,
|
|
17
|
+
isActive: checkIsActiveDay(2, selectedWeeks),
|
|
18
|
+
testId: 'week-t-value',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: localization.common.weekW,
|
|
22
|
+
value: 3,
|
|
23
|
+
isActive: checkIsActiveDay(3, selectedWeeks),
|
|
24
|
+
testId: 'week-w-value',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: localization.common.weekTh,
|
|
28
|
+
value: 4,
|
|
29
|
+
isActive: checkIsActiveDay(4, selectedWeeks),
|
|
30
|
+
testId: 'week-th-value',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: localization.common.weekF,
|
|
34
|
+
value: 5,
|
|
35
|
+
isActive: checkIsActiveDay(5, selectedWeeks),
|
|
36
|
+
testId: 'week-f-value',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: localization.common.weekS,
|
|
40
|
+
value: 6,
|
|
41
|
+
isActive: checkIsActiveDay(6, selectedWeeks),
|
|
42
|
+
testId: 'week-s-value',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: localization.common.weekSu,
|
|
46
|
+
value: 0,
|
|
47
|
+
isActive: checkIsActiveDay(0, selectedWeeks),
|
|
48
|
+
testId: 'week-su-value',
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const checkIsActiveDay = (value: number, weeks: number[]): boolean => {
|
|
54
|
+
return !!weeks?.includes(value)
|
|
25
55
|
}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<div class="start-on">
|
|
3
|
+
<label class="clr-control-label clr-col-2 pl-0 start-on__label">
|
|
4
|
+
{{ localization.scheduledTasks.startOn }}
|
|
5
|
+
</label>
|
|
6
|
+
|
|
7
|
+
<label
|
|
8
|
+
:class="[
|
|
9
|
+
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
10
|
+
schedulerStartOnErrorText && 'invalid',
|
|
11
|
+
]"
|
|
12
|
+
for="frequency-start-on-date"
|
|
13
|
+
>
|
|
14
|
+
<input
|
|
15
|
+
id="frequency-start-on-date"
|
|
16
|
+
v-model.lazy="modelFrequencyLocal.frg_start_on_time"
|
|
17
|
+
data-id="frequency-start-on-date-input"
|
|
18
|
+
type="datetime-local"
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<span class="tooltip-content">
|
|
22
|
+
{{ schedulerStartOnErrorText }}
|
|
23
|
+
</span>
|
|
24
|
+
</label>
|
|
25
|
+
</div>
|
|
7
26
|
</template>
|
|
8
27
|
|
|
9
28
|
<script lang="ts" setup>
|
|
@@ -15,17 +34,10 @@ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
|
15
34
|
required: true,
|
|
16
35
|
})
|
|
17
36
|
|
|
18
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
19
37
|
const { $formattedDatetime }: any = useNuxtApp()
|
|
20
|
-
const { $store }: any = useNuxtApp()
|
|
21
|
-
// const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
|
|
22
38
|
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
isNewView.value
|
|
26
|
-
? defineAsyncComponent(() => import('./New.vue'))
|
|
27
|
-
: defineAsyncComponent(() => import('./Old.vue'))
|
|
28
|
-
)
|
|
39
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
40
|
+
// const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
|
|
29
41
|
|
|
30
42
|
const schedulerStartOnErrorText = computed<string>(() => {
|
|
31
43
|
return !modelFrequencyLocal.value.frg_start_on_time
|
|
@@ -43,7 +55,10 @@ watch(
|
|
|
43
55
|
{ immediate: true }
|
|
44
56
|
)
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
setDefaultDateTime()
|
|
60
|
+
})
|
|
61
|
+
const setDefaultDateTime = () => {
|
|
47
62
|
modelFrequencyLocal.value.frg_start_on_time = $formattedDatetime(new Date(), {
|
|
48
63
|
formatDate: 'yyyy-MM-dd',
|
|
49
64
|
separator: ' ',
|
|
@@ -51,3 +66,24 @@ const onSetDefaultDateTime = () => {
|
|
|
51
66
|
})
|
|
52
67
|
}
|
|
53
68
|
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
72
|
+
.start-on {
|
|
73
|
+
@include flex($align: center);
|
|
74
|
+
margin-top: 10px;
|
|
75
|
+
&__select-input {
|
|
76
|
+
:deep(.select-input__label) {
|
|
77
|
+
font-weight: 400;
|
|
78
|
+
}
|
|
79
|
+
:deep(.select) {
|
|
80
|
+
max-width: 80px !important;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
.tooltip {
|
|
85
|
+
& > .tooltip-content {
|
|
86
|
+
width: 200px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|