bfg-common 1.5.905 → 1.5.906
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_en.json +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/Frequency.vue +0 -11
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/New.vue +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/New.vue +45 -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 +4 -2
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="frequency">
|
|
3
2
|
<common-pages-scheduled-tasks-modals-common-frequency-after-startup
|
|
4
3
|
v-if="props.type === 'after-startup'"
|
|
5
4
|
v-model="model"
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
v-model="model"
|
|
28
27
|
:type="props.type"
|
|
29
28
|
/>
|
|
30
|
-
</div>
|
|
31
29
|
</template>
|
|
32
30
|
|
|
33
31
|
<script lang="ts" setup>
|
|
@@ -48,12 +46,3 @@ const showTimeOn = computed<boolean>(() => {
|
|
|
48
46
|
return ['once', 'week', 'month'].includes(props.type)
|
|
49
47
|
})
|
|
50
48
|
</script>
|
|
51
|
-
|
|
52
|
-
<style lang="scss" scoped>
|
|
53
|
-
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
54
|
-
.frequency {
|
|
55
|
-
width: 100%;
|
|
56
|
-
&__interval {
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="frequency-start-on">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>{{ localization.scheduledTasks.startOn }}</h2>
|
|
5
|
+
<ui-input-with-datepicker
|
|
6
|
+
id="frequency-start-on-date"
|
|
7
|
+
v-model="modelFrequencyLocal.frg_start_on_time"
|
|
8
|
+
:format="datepickerFormat"
|
|
9
|
+
test-id="frequency-start-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 modelFrequencyLocal = 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-start-on {
|
|
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,77 @@
|
|
|
1
|
+
<template>
|
|
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>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
30
|
+
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
31
|
+
import { validateDate } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
32
|
+
|
|
33
|
+
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
34
|
+
required: true,
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
39
|
+
// const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
|
|
40
|
+
|
|
41
|
+
const schedulerStartOnErrorText = computed<string>(() => {
|
|
42
|
+
return !modelFrequencyLocal.value.frg_start_on_time
|
|
43
|
+
? localization.value.common.fieldRequired
|
|
44
|
+
: validateDate(
|
|
45
|
+
localization.value,
|
|
46
|
+
modelFrequencyLocal.value.frg_start_on_time
|
|
47
|
+
)
|
|
48
|
+
})
|
|
49
|
+
watch(
|
|
50
|
+
schedulerStartOnErrorText,
|
|
51
|
+
(newValue: string) => {
|
|
52
|
+
modelFrequencyLocal.value.isValid = !!newValue
|
|
53
|
+
},
|
|
54
|
+
{ immediate: true }
|
|
55
|
+
)
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style lang="scss" scoped>
|
|
59
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
60
|
+
.start-on {
|
|
61
|
+
@include flex($align: center);
|
|
62
|
+
margin-top: 10px;
|
|
63
|
+
&__select-input {
|
|
64
|
+
:deep(.select-input__label) {
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
}
|
|
67
|
+
:deep(.select) {
|
|
68
|
+
max-width: 80px !important;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.tooltip {
|
|
73
|
+
& > .tooltip-content {
|
|
74
|
+
width: 200px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model="modelFrequencyLocal"
|
|
5
|
+
@vue:mounted="onSetDefaultDateTime"
|
|
6
|
+
/>
|
|
26
7
|
</template>
|
|
27
8
|
|
|
28
9
|
<script lang="ts" setup>
|
|
@@ -34,11 +15,18 @@ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
|
34
15
|
required: true,
|
|
35
16
|
})
|
|
36
17
|
|
|
37
|
-
const { $formattedDatetime }: any = useNuxtApp()
|
|
38
|
-
|
|
39
18
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
19
|
+
const { $formattedDatetime }: any = useNuxtApp()
|
|
20
|
+
const { $store }: any = useNuxtApp()
|
|
40
21
|
// const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
|
|
41
22
|
|
|
23
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
24
|
+
const currentComponent = computed(() =>
|
|
25
|
+
isNewView.value
|
|
26
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
27
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
28
|
+
)
|
|
29
|
+
|
|
42
30
|
const schedulerStartOnErrorText = computed<string>(() => {
|
|
43
31
|
return !modelFrequencyLocal.value.frg_start_on_time
|
|
44
32
|
? localization.value.common.fieldRequired
|
|
@@ -55,10 +43,7 @@ watch(
|
|
|
55
43
|
{ immediate: true }
|
|
56
44
|
)
|
|
57
45
|
|
|
58
|
-
|
|
59
|
-
setDefaultDateTime()
|
|
60
|
-
})
|
|
61
|
-
const setDefaultDateTime = () => {
|
|
46
|
+
const onSetDefaultDateTime = () => {
|
|
62
47
|
modelFrequencyLocal.value.frg_start_on_time = $formattedDatetime(new Date(), {
|
|
63
48
|
formatDate: 'yyyy-MM-dd',
|
|
64
49
|
separator: ' ',
|
|
@@ -66,24 +51,3 @@ const setDefaultDateTime = () => {
|
|
|
66
51
|
})
|
|
67
52
|
}
|
|
68
53
|
</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>
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
|
|
41
41
|
<div
|
|
42
42
|
class="form__run-frequency"
|
|
43
|
-
:class="
|
|
43
|
+
:class="{
|
|
44
|
+
'grid-single-col': !model.frequency || model.frequency === 'once',
|
|
45
|
+
}"
|
|
44
46
|
>
|
|
45
47
|
<div>
|
|
46
48
|
<h2 class="frequency">
|
|
@@ -166,7 +168,7 @@ const frequencyMethodOptionsLocal = computed<UI_I_Dropdown[]>(() =>
|
|
|
166
168
|
&__run {
|
|
167
169
|
&-frequency {
|
|
168
170
|
display: grid;
|
|
169
|
-
grid-template-columns:
|
|
171
|
+
grid-template-columns: 1fr 1fr;
|
|
170
172
|
grid-gap: 16px;
|
|
171
173
|
&.grid-single-col {
|
|
172
174
|
grid-template-columns: 1fr;
|