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,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="frequency-end-time">
|
|
3
|
+
<h2>{{ localization.scheduledTasks.end }}</h2>
|
|
4
|
+
<div class="frequency-end-time__radios">
|
|
5
|
+
<ui-radio
|
|
6
|
+
v-for="(option, key) in props.endOptions"
|
|
7
|
+
:key="key"
|
|
8
|
+
v-model="endTimeModeLocal"
|
|
9
|
+
:label="option.label"
|
|
10
|
+
:test-id="option.testId"
|
|
11
|
+
:value="option.value"
|
|
12
|
+
size="md"
|
|
13
|
+
>
|
|
14
|
+
</ui-radio>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<ui-input-with-datepicker
|
|
18
|
+
v-if="endTimeModeLocal === 'on'"
|
|
19
|
+
id="frequency-end-date"
|
|
20
|
+
v-model="modelFrequencyLocal.frg_end_time"
|
|
21
|
+
:format="datepickerFormat"
|
|
22
|
+
test-id="frequency-end-date-input"
|
|
23
|
+
time-format="12"
|
|
24
|
+
:error="''"
|
|
25
|
+
:error-timepicker="''"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
32
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
33
|
+
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
34
|
+
import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
|
|
35
|
+
|
|
36
|
+
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
37
|
+
required: true,
|
|
38
|
+
})
|
|
39
|
+
const endTimeModeLocal = defineModel<'never' | 'on'>('selectedEndMode', {
|
|
40
|
+
required: true,
|
|
41
|
+
})
|
|
42
|
+
const props = defineProps<{
|
|
43
|
+
endOptions: UI_I_SelectInputItem[]
|
|
44
|
+
type: string
|
|
45
|
+
}>()
|
|
46
|
+
|
|
47
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
48
|
+
|
|
49
|
+
const datepickerFormat = computed<string>(
|
|
50
|
+
() => getUiDatepickerFormatByLanguage('en_US') // TODO из пропс должен приходить язык
|
|
51
|
+
)
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style lang="scss" scoped>
|
|
55
|
+
.frequency-end-time {
|
|
56
|
+
grid-column: span 2;
|
|
57
|
+
&__radios {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
column-gap: 32px;
|
|
61
|
+
margin-bottom: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
h2 {
|
|
65
|
+
font-family: 'Inter', sans-serif;
|
|
66
|
+
color: var(--title-form-first-color);
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
line-height: 18px;
|
|
70
|
+
margin-bottom: 12px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="end-time">
|
|
3
|
+
<common-select-input
|
|
4
|
+
v-model="endTimeModeLocal"
|
|
5
|
+
:label="localization.scheduledTasks.end"
|
|
6
|
+
:data="props.endOptions"
|
|
7
|
+
:class="[
|
|
8
|
+
'end-time__select-input',
|
|
9
|
+
endTimeModeLocal === 'on' && 'enabled',
|
|
10
|
+
]"
|
|
11
|
+
test-id="frequency-ent-time"
|
|
12
|
+
>
|
|
13
|
+
<template #options>
|
|
14
|
+
<label
|
|
15
|
+
v-if="endTimeModeLocal === 'on'"
|
|
16
|
+
:class="[
|
|
17
|
+
'tooltip tooltip-validation tooltip-xs tooltip-top-left frequency-end-date',
|
|
18
|
+
schedulerEndDateErrorText && 'invalid',
|
|
19
|
+
]"
|
|
20
|
+
for="frequency-end-date"
|
|
21
|
+
>
|
|
22
|
+
<input
|
|
23
|
+
id="frequency-end-date"
|
|
24
|
+
v-model.lazy="modelFrequencyLocal.frg_end_time"
|
|
25
|
+
data-id="frequency-end-date-input"
|
|
26
|
+
type="datetime-local"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<span class="tooltip-content">
|
|
30
|
+
{{ schedulerEndDateErrorText }}
|
|
31
|
+
</span>
|
|
32
|
+
</label>
|
|
33
|
+
</template>
|
|
34
|
+
</common-select-input>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script lang="ts" setup>
|
|
39
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
40
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
41
|
+
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
42
|
+
import { validateDate } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
43
|
+
|
|
44
|
+
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
45
|
+
required: true,
|
|
46
|
+
})
|
|
47
|
+
const endTimeModeLocal = defineModel<'never' | 'on'>('selectedEndMode', {
|
|
48
|
+
required: true,
|
|
49
|
+
})
|
|
50
|
+
const props = defineProps<{
|
|
51
|
+
endOptions: UI_I_SelectInputItem[]
|
|
52
|
+
type: string
|
|
53
|
+
}>()
|
|
54
|
+
|
|
55
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
56
|
+
// const { $store, $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
|
|
57
|
+
|
|
58
|
+
const schedulerEndDateErrorText = computed<string>(() => {
|
|
59
|
+
const { frg_end_time, frg_start_on_time } = modelFrequencyLocal.value
|
|
60
|
+
return !frg_end_time
|
|
61
|
+
? localization.value.common.fieldRequired
|
|
62
|
+
: validateDate(
|
|
63
|
+
localization.value,
|
|
64
|
+
frg_end_time,
|
|
65
|
+
frg_start_on_time,
|
|
66
|
+
props.type
|
|
67
|
+
)
|
|
68
|
+
})
|
|
69
|
+
watch(
|
|
70
|
+
[schedulerEndDateErrorText, endTimeModeLocal],
|
|
71
|
+
([newValue1, newValue2]: [string, 'never' | 'on']) => {
|
|
72
|
+
modelFrequencyLocal.value.isValid =
|
|
73
|
+
newValue2 === 'never' ? false : !!newValue1
|
|
74
|
+
|
|
75
|
+
newValue2 === 'never' && (modelFrequencyLocal.value.frg_end_time = '')
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<style lang="scss" scoped>
|
|
81
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
82
|
+
.end-time {
|
|
83
|
+
margin-top: 10px;
|
|
84
|
+
&__select-input {
|
|
85
|
+
&.enabled {
|
|
86
|
+
row-gap: 15px;
|
|
87
|
+
&.clr-flex-row {
|
|
88
|
+
flex-direction: column !important;
|
|
89
|
+
align-items: flex-start;
|
|
90
|
+
}
|
|
91
|
+
:deep(.select-input__inner) {
|
|
92
|
+
flex-direction: row;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:deep(.select-input__label) {
|
|
97
|
+
font-weight: 400;
|
|
98
|
+
}
|
|
99
|
+
:deep(.select) {
|
|
100
|
+
max-width: max-content !important;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
.frequency-end-date {
|
|
104
|
+
margin-left: 15px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.tooltip {
|
|
108
|
+
& > .tooltip-content {
|
|
109
|
+
width: 200px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
</style>
|
package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue
CHANGED
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model="modelFrequencyLocal.frg_interval"
|
|
5
|
+
:time-interval-error-text="timeIntervalErrorText"
|
|
6
|
+
:interval-suffix-label="intervalSuffixLabel"
|
|
7
|
+
@init-validation="onInitValidation"
|
|
8
|
+
/>
|
|
32
9
|
</template>
|
|
33
10
|
|
|
34
11
|
<script lang="ts" setup>
|
|
@@ -39,17 +16,25 @@ import {
|
|
|
39
16
|
validateField,
|
|
40
17
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
41
18
|
|
|
42
|
-
const props = defineProps<{
|
|
43
|
-
type: string
|
|
44
|
-
}>()
|
|
45
19
|
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
46
20
|
required: true,
|
|
47
21
|
})
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
type: string
|
|
24
|
+
}>()
|
|
48
25
|
|
|
49
26
|
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
|
+
)
|
|
50
35
|
|
|
51
36
|
const isInitTimeIntervalValidation = ref<boolean>(false)
|
|
52
|
-
const
|
|
37
|
+
const onInitValidation = (): void => {
|
|
53
38
|
isInitTimeIntervalValidation.value = true
|
|
54
39
|
}
|
|
55
40
|
|
|
@@ -81,22 +66,3 @@ const intervalSuffixLabel = computed<string>(() => {
|
|
|
81
66
|
)
|
|
82
67
|
})
|
|
83
68
|
</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>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="frequency-interval">
|
|
3
|
+
<h2>{{ localization.scheduledTasks.repeatEvery }}</h2>
|
|
4
|
+
<ui-input
|
|
5
|
+
id="frequency-time-interval"
|
|
6
|
+
v-model="intervalModel"
|
|
7
|
+
:error="props.timeIntervalErrorText"
|
|
8
|
+
:placeholder="localization.common.value"
|
|
9
|
+
test-id="frequency-time-interval-input"
|
|
10
|
+
autocomplete="off"
|
|
11
|
+
@input="onInitValidation"
|
|
12
|
+
>
|
|
13
|
+
<template #icon>
|
|
14
|
+
<span>
|
|
15
|
+
{{ props.intervalSuffixLabel }}
|
|
16
|
+
</span>
|
|
17
|
+
</template>
|
|
18
|
+
</ui-input>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
24
|
+
|
|
25
|
+
const intervalModel = defineModel<number>({ required: true })
|
|
26
|
+
const props = defineProps<{
|
|
27
|
+
timeIntervalErrorText: string
|
|
28
|
+
intervalSuffixLabel: string
|
|
29
|
+
}>()
|
|
30
|
+
const emits = defineEmits<{
|
|
31
|
+
(event: 'init-validation'): void
|
|
32
|
+
}>()
|
|
33
|
+
|
|
34
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
35
|
+
|
|
36
|
+
const onInitValidation = (): void => emits('init-validation')
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="scss" scoped>
|
|
40
|
+
.frequency-interval {
|
|
41
|
+
h2 {
|
|
42
|
+
font-family: 'Inter', sans-serif;
|
|
43
|
+
color: var(--title-form-first-color);
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
margin-bottom: 12px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
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
|
+
props.timeIntervalErrorText && 'invalid',
|
|
11
|
+
]"
|
|
12
|
+
for="frequency-time-interval"
|
|
13
|
+
>
|
|
14
|
+
<input
|
|
15
|
+
id="frequency-time-interval"
|
|
16
|
+
v-model="intervalModel"
|
|
17
|
+
data-id="frequency-time-interval-input"
|
|
18
|
+
type="text"
|
|
19
|
+
@input="onInitValidation"
|
|
20
|
+
@blur="onInitValidation"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<span class="tooltip-content">
|
|
24
|
+
{{ props.timeIntervalErrorText }}
|
|
25
|
+
</span>
|
|
26
|
+
</label>
|
|
27
|
+
|
|
28
|
+
<span class="interval__suffix">
|
|
29
|
+
{{ props.intervalSuffixLabel }}
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
36
|
+
|
|
37
|
+
const intervalModel = defineModel<number>({ required: true })
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
timeIntervalErrorText: string
|
|
40
|
+
intervalSuffixLabel: string
|
|
41
|
+
}>()
|
|
42
|
+
const emits = defineEmits<{
|
|
43
|
+
(event: 'init-validation'): void
|
|
44
|
+
}>()
|
|
45
|
+
|
|
46
|
+
const onInitValidation = (): void => emits('init-validation')
|
|
47
|
+
|
|
48
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss" scoped>
|
|
52
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
53
|
+
.interval {
|
|
54
|
+
@include flex($align: center);
|
|
55
|
+
margin-top: 10px;
|
|
56
|
+
&__prefix {
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
}
|
|
59
|
+
.tooltip {
|
|
60
|
+
& > .tooltip-content {
|
|
61
|
+
width: 10rem;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
input {
|
|
65
|
+
width: 70px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="frequency-on-date">
|
|
3
|
+
<h2>{{ localization.common.on }}</h2>
|
|
4
|
+
|
|
5
|
+
<common-pages-scheduled-tasks-modals-common-frequency-on-select-week
|
|
6
|
+
v-if="props.type === 'week'"
|
|
7
|
+
v-model="scheduledTaskFormLocal"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<div v-if="props.type === 'month'" class="frequency-monthly-days">
|
|
11
|
+
<div class="frequency-on-date__radios">
|
|
12
|
+
<ui-radio
|
|
13
|
+
v-for="(option, key) in props.frequencyMonthlyMode"
|
|
14
|
+
:key="key"
|
|
15
|
+
v-model="scheduledTaskFormLocal.frg_monthly_mode"
|
|
16
|
+
:label="option.label"
|
|
17
|
+
:test-id="option.testId"
|
|
18
|
+
:value="option.value"
|
|
19
|
+
size="md"
|
|
20
|
+
>
|
|
21
|
+
</ui-radio>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<ui-input
|
|
25
|
+
v-if="scheduledTaskFormLocal.frg_monthly_mode === 'day'"
|
|
26
|
+
id="frequency-monthly-by-day"
|
|
27
|
+
v-model="scheduledTaskFormLocal.frg_monthly_day"
|
|
28
|
+
:error="props.timeIntervalErrorText"
|
|
29
|
+
:placeholder="localization.scheduledTasks.day"
|
|
30
|
+
test-id="frequency-monthly-by-day-field"
|
|
31
|
+
autocomplete="off"
|
|
32
|
+
type="number"
|
|
33
|
+
@input="onInitValidation"
|
|
34
|
+
></ui-input>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
v-if="scheduledTaskFormLocal.frg_monthly_mode === 'week'"
|
|
38
|
+
class="frequency-monthly-days__week"
|
|
39
|
+
>
|
|
40
|
+
<ui-select
|
|
41
|
+
v-model="scheduledTaskFormLocal.frq_ordinal_number"
|
|
42
|
+
:items="frequencyOrdinalNumberLocal"
|
|
43
|
+
test-id="frequency-monthly-ordinary-day"
|
|
44
|
+
:placeholder="localization.scheduledTasks.selectPosition"
|
|
45
|
+
size="md"
|
|
46
|
+
select-width="100%"
|
|
47
|
+
/>
|
|
48
|
+
<ui-select
|
|
49
|
+
v-model="scheduledTaskFormLocal.frq_week_day"
|
|
50
|
+
:items="frequencyWeeksDaysLocal"
|
|
51
|
+
test-id="frequency-monthly-week-day"
|
|
52
|
+
:placeholder="localization.scheduledTasks.selectDay"
|
|
53
|
+
size="md"
|
|
54
|
+
select-width="100%"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<ui-input-with-datepicker
|
|
60
|
+
v-if="props.type === 'once'"
|
|
61
|
+
id="frequency-on-date"
|
|
62
|
+
v-model="scheduledTaskFormLocal.frg_on_time"
|
|
63
|
+
:format="datepickerFormat"
|
|
64
|
+
test-id="frequency-on-date-input"
|
|
65
|
+
time-format="12"
|
|
66
|
+
:error="''"
|
|
67
|
+
:error-timepicker="''"
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<script lang="ts" setup>
|
|
73
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
74
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
75
|
+
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
76
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
77
|
+
import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
|
|
78
|
+
|
|
79
|
+
const scheduledTaskFormLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
80
|
+
required: true,
|
|
81
|
+
})
|
|
82
|
+
const props = defineProps<{
|
|
83
|
+
type: string
|
|
84
|
+
frequencyMonthlyMode: UI_I_SelectInputItem[]
|
|
85
|
+
frequencyOnOrdinalNumber: UI_I_SelectInputItem[]
|
|
86
|
+
frequencyOnWeeksDays: UI_I_SelectInputItem[]
|
|
87
|
+
}>()
|
|
88
|
+
|
|
89
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
90
|
+
|
|
91
|
+
const datepickerFormat = computed<string>(
|
|
92
|
+
() => getUiDatepickerFormatByLanguage('en_US') // TODO из пропс должен приходить язык
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
const frequencyOrdinalNumberLocal = computed<UI_I_Dropdown[]>(() =>
|
|
96
|
+
props.frequencyOnOrdinalNumber.map((item: UI_I_SelectInputItem) => ({
|
|
97
|
+
...item,
|
|
98
|
+
text: item.label,
|
|
99
|
+
}))
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const frequencyWeeksDaysLocal = computed<UI_I_Dropdown[]>(() =>
|
|
103
|
+
props.frequencyOnWeeksDays.map((item: UI_I_SelectInputItem) => ({
|
|
104
|
+
...item,
|
|
105
|
+
text: item.label,
|
|
106
|
+
}))
|
|
107
|
+
)
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<style lang="scss" scoped>
|
|
111
|
+
.frequency-on-date {
|
|
112
|
+
grid-column: span 2;
|
|
113
|
+
|
|
114
|
+
&__radios {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
column-gap: 32px;
|
|
118
|
+
margin-bottom: 12px;
|
|
119
|
+
}
|
|
120
|
+
h2 {
|
|
121
|
+
font-family: 'Inter', sans-serif;
|
|
122
|
+
color: var(--title-form-first-color);
|
|
123
|
+
font-size: 14px;
|
|
124
|
+
font-weight: 500;
|
|
125
|
+
line-height: 18px;
|
|
126
|
+
margin-bottom: 12px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.frequency-monthly-days {
|
|
130
|
+
&__week {
|
|
131
|
+
display: grid;
|
|
132
|
+
grid-template-columns: repeat(2, 1fr);
|
|
133
|
+
column-gap: 16px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</style>
|