hl-core 0.0.7-beta.9 → 0.0.8-beta.1
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/.prettierrc +2 -1
- package/api/index.ts +94 -107
- package/api/interceptors.ts +4 -4
- package/components/Button/Btn.vue +7 -2
- package/components/Button/ScrollButtons.vue +6 -0
- package/components/Complex/ContentBlock.vue +5 -0
- package/components/{Layout → Dialog}/Dialog.vue +3 -27
- package/components/Dialog/FamilyDialog.vue +39 -0
- package/components/Form/FormBlock.vue +114 -0
- package/components/Form/FormSection.vue +18 -0
- package/components/Form/FormTextSection.vue +20 -0
- package/components/Form/FormToggle.vue +52 -0
- package/components/Form/ProductConditionsBlock.vue +68 -0
- package/components/Input/EmptyFormField.vue +5 -0
- package/components/Input/FileInput.vue +71 -0
- package/components/Input/FormInput.vue +171 -0
- package/components/Input/PanelInput.vue +133 -0
- package/components/Input/RoundedInput.vue +35 -36
- package/components/Layout/Drawer.vue +19 -16
- package/components/Layout/Header.vue +4 -18
- package/components/Layout/Loader.vue +1 -7
- package/components/Layout/SettingsPanel.vue +17 -37
- package/components/List/ListEmpty.vue +22 -0
- package/components/Menu/MenuNav.vue +22 -20
- package/components/Menu/MenuNavItem.vue +6 -6
- package/components/Pages/Anketa.vue +333 -0
- package/components/Pages/Auth.vue +91 -0
- package/components/Pages/Documents.vue +108 -0
- package/components/Pages/MemberForm.vue +1134 -0
- package/components/Pages/ProductAgreement.vue +18 -0
- package/components/Pages/ProductConditions.vue +360 -0
- package/components/Panel/PanelHandler.vue +231 -0
- package/components/Panel/PanelItem.vue +2 -4
- package/components/Panel/PanelSelectItem.vue +20 -0
- package/components/Transitions/FadeTransition.vue +5 -0
- package/components/Transitions/SlideTransition.vue +5 -0
- package/composables/classes.ts +301 -255
- package/composables/constants.ts +16 -9
- package/composables/index.ts +55 -60
- package/composables/styles.ts +33 -7
- package/layouts/default.vue +46 -26
- package/layouts/full.vue +2 -12
- package/nuxt.config.ts +3 -0
- package/package.json +13 -10
- package/pages/500.vue +40 -12
- package/plugins/helperFunctionsPlugins.ts +6 -2
- package/plugins/storePlugin.ts +6 -5
- package/store/data.store.js +865 -1942
- package/store/member.store.ts +291 -0
- package/store/messages.ts +70 -51
- package/store/rules.js +26 -28
- package/types/index.ts +303 -0
- package/composables/models.ts +0 -43
- /package/store/{form.store.js → form.store.ts} +0 -0
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-text-field
|
|
3
3
|
class="rounded-input"
|
|
4
|
-
|
|
4
|
+
:model-value="modelValue"
|
|
5
5
|
v-maska="maska"
|
|
6
6
|
:rules="rules"
|
|
7
7
|
:loading="loading"
|
|
8
8
|
:placeholder="placeholder"
|
|
9
|
+
:label="label"
|
|
9
10
|
:type="type"
|
|
10
11
|
:variant="variant"
|
|
11
12
|
:clear-icon="clearIcon"
|
|
12
13
|
:color="color"
|
|
13
14
|
:hint="hint"
|
|
14
|
-
:clearable="clearable"
|
|
15
|
+
:clearable="props.readonly ? false : clearable"
|
|
15
16
|
:disabled="disabled"
|
|
16
|
-
:
|
|
17
|
+
:readonly="props.readonly"
|
|
18
|
+
:prepend-icon="prependIcon ? prependIcon : ''"
|
|
17
19
|
:append-icon="appendIcon ? appendIcon : ''"
|
|
20
|
+
:prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
|
|
21
|
+
:append-inner-icon="appendInnerIcon ? appendInnerIcon : ''"
|
|
18
22
|
:bg-color="bgColor ? bgColor : ''"
|
|
19
23
|
@keyup.enter.prevent="submitted"
|
|
24
|
+
@click:append="!props.readonly && $emit('append-out')"
|
|
25
|
+
@click:prepend="!props.readonly && $emit('prepend-out')"
|
|
26
|
+
@click:append-inner="!props.readonly && $emit('append')"
|
|
27
|
+
@click:prepend-inner="!props.readonly && $emit('prepend')"
|
|
28
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
20
29
|
>
|
|
21
30
|
<template v-if="loading" #loader>
|
|
22
|
-
<v-progress-linear
|
|
23
|
-
:active="loading"
|
|
24
|
-
:color="color"
|
|
25
|
-
absolute
|
|
26
|
-
height="1"
|
|
27
|
-
indeterminate
|
|
28
|
-
></v-progress-linear>
|
|
31
|
+
<v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
|
|
29
32
|
</template>
|
|
30
33
|
</v-text-field>
|
|
31
34
|
</template>
|
|
32
35
|
|
|
33
36
|
<script lang="ts">
|
|
34
|
-
import { InputTypes } from '@/composables/models';
|
|
35
|
-
|
|
36
37
|
export default defineComponent({
|
|
37
38
|
name: 'BaseRoundedInput',
|
|
38
39
|
props: {
|
|
39
40
|
modelValue: {
|
|
40
|
-
|
|
41
|
-
default: '',
|
|
41
|
+
required: false,
|
|
42
42
|
},
|
|
43
43
|
loading: {
|
|
44
44
|
type: Boolean,
|
|
@@ -52,9 +52,17 @@ export default defineComponent({
|
|
|
52
52
|
type: Boolean,
|
|
53
53
|
default: false,
|
|
54
54
|
},
|
|
55
|
+
readonly: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
},
|
|
55
59
|
placeholder: {
|
|
56
60
|
type: String,
|
|
57
|
-
default: '
|
|
61
|
+
default: '',
|
|
62
|
+
},
|
|
63
|
+
label: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '',
|
|
58
66
|
},
|
|
59
67
|
maska: {
|
|
60
68
|
type: String,
|
|
@@ -73,9 +81,7 @@ export default defineComponent({
|
|
|
73
81
|
default: 'text',
|
|
74
82
|
},
|
|
75
83
|
variant: {
|
|
76
|
-
type: String as PropType<
|
|
77
|
-
'solo' | 'filled' | 'outlined' | 'plain' | 'underlined'
|
|
78
|
-
>,
|
|
84
|
+
type: String as PropType<InputVariants>,
|
|
79
85
|
default: 'solo',
|
|
80
86
|
},
|
|
81
87
|
color: {
|
|
@@ -92,34 +98,26 @@ export default defineComponent({
|
|
|
92
98
|
appendIcon: {
|
|
93
99
|
type: String,
|
|
94
100
|
},
|
|
101
|
+
prependInnerIcon: {
|
|
102
|
+
type: String,
|
|
103
|
+
},
|
|
104
|
+
appendInnerIcon: {
|
|
105
|
+
type: String,
|
|
106
|
+
},
|
|
95
107
|
bgColor: {
|
|
96
108
|
type: String,
|
|
97
109
|
},
|
|
98
110
|
},
|
|
99
|
-
emits: ['update:modelValue', 'submitted'],
|
|
111
|
+
emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out'],
|
|
100
112
|
|
|
101
113
|
setup(props, { emit }) {
|
|
102
|
-
const fieldModel = ref(props.modelValue || '');
|
|
103
|
-
|
|
104
|
-
const updateValue = (event: any) => {
|
|
105
|
-
emit('update:modelValue', fieldModel.value);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
114
|
const submitted = (event: any) => {
|
|
109
115
|
emit('submitted', event);
|
|
110
116
|
};
|
|
111
117
|
|
|
112
|
-
watch(
|
|
113
|
-
fieldModel,
|
|
114
|
-
() => {
|
|
115
|
-
updateValue(fieldModel.value);
|
|
116
|
-
},
|
|
117
|
-
{ immediate: true },
|
|
118
|
-
);
|
|
119
|
-
|
|
120
118
|
return {
|
|
121
|
-
fieldModel,
|
|
122
119
|
submitted,
|
|
120
|
+
props
|
|
123
121
|
};
|
|
124
122
|
},
|
|
125
123
|
});
|
|
@@ -130,14 +128,15 @@ export default defineComponent({
|
|
|
130
128
|
border: none !important;
|
|
131
129
|
outline: none !important;
|
|
132
130
|
}
|
|
133
|
-
|
|
131
|
+
.rounded-input .v-label.v-field-label {
|
|
132
|
+
top: 20px;
|
|
133
|
+
}
|
|
134
134
|
.rounded-input .v-field {
|
|
135
135
|
border-radius: 8px;
|
|
136
136
|
border: 1px solid #dadada;
|
|
137
137
|
box-shadow: none;
|
|
138
138
|
font-size: 14px;
|
|
139
139
|
}
|
|
140
|
-
|
|
141
140
|
.rounded-input .v-field--error {
|
|
142
141
|
border-color: #ff5449;
|
|
143
142
|
}
|
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
v-model="$dataStore[whichPanel].open"
|
|
4
4
|
:temporary="$dataStore[whichPanel].overlay"
|
|
5
5
|
location="right"
|
|
6
|
-
class="sm:!w-[400px] lg:!relative"
|
|
7
|
-
:class="[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
]"
|
|
6
|
+
class="sm:!w-[400px] lg:!relative !right-0"
|
|
7
|
+
:class="[$dataStore[whichPanel].overlay ? 'lg:!hidden' : '', $dataStore[whichPanel].open ? '!w-full lg:!w-[420px]' : 'lg:!w-[0px]']"
|
|
8
|
+
:disable-resize-watcher="true"
|
|
9
|
+
:disable-route-watcher="true"
|
|
11
10
|
>
|
|
12
|
-
<base-header
|
|
13
|
-
|
|
14
|
-
:has-back="true"
|
|
15
|
-
back-icon="mdi-close"
|
|
16
|
-
class="justify-center"
|
|
17
|
-
@onBack="$dataStore[whichPanel].open = false"
|
|
18
|
-
></base-header>
|
|
19
|
-
<div>
|
|
11
|
+
<base-header :title="panelTitle" :has-back="true" back-icon="mdi-close" class="justify-center" @onBack="closePanel"></base-header>
|
|
12
|
+
<div v-if="$dataStore.panelAction === null" class="flex flex-col" id="panel-actions">
|
|
20
13
|
<slot></slot>
|
|
21
14
|
</div>
|
|
15
|
+
<base-panel-handler v-else></base-panel-handler>
|
|
22
16
|
</v-navigation-drawer>
|
|
23
17
|
</template>
|
|
24
18
|
|
|
@@ -31,12 +25,21 @@ export default defineComponent({
|
|
|
31
25
|
default: '',
|
|
32
26
|
},
|
|
33
27
|
whichPanel: {
|
|
34
|
-
type: String as PropType<
|
|
28
|
+
type: String as PropType<PanelTypes>,
|
|
35
29
|
default: 'panel',
|
|
36
30
|
},
|
|
37
31
|
},
|
|
38
|
-
setup() {
|
|
39
|
-
|
|
32
|
+
setup(props) {
|
|
33
|
+
const dataStore = useDataStore();
|
|
34
|
+
|
|
35
|
+
const closePanel = () => {
|
|
36
|
+
dataStore[props.whichPanel].open = false;
|
|
37
|
+
dataStore.panelAction = null;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
closePanel,
|
|
42
|
+
};
|
|
40
43
|
},
|
|
41
44
|
});
|
|
42
45
|
</script>
|
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<header
|
|
3
|
-
class="
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<i
|
|
7
|
-
v-if="hasBack"
|
|
8
|
-
@click="$emit('onBack')"
|
|
9
|
-
class="absolute left-5 mdi text-xl cursor-pointer"
|
|
10
|
-
:class="[backIcon]"
|
|
11
|
-
></i>
|
|
12
|
-
{{ title }}
|
|
13
|
-
<i
|
|
14
|
-
v-if="hasMore"
|
|
15
|
-
@click="$emit('onMore')"
|
|
16
|
-
class="mdi absolute right-5 text-xl cursor-pointer"
|
|
17
|
-
:class="[moreIcon, hideMoreOnLg ? 'lg:!hidden' : '']"
|
|
18
|
-
>
|
|
19
|
-
</i>
|
|
2
|
+
<header class="relative w-full h-[70px] text-center font-medium align-middle flex items-center border-b-[1px]" :class="[$libStyles.blueBgLight, $libStyles.textSimple]">
|
|
3
|
+
<i v-if="hasBack" @click="$emit('onBack')" class="absolute left-5 mdi text-xl cursor-pointer" :class="[backIcon]"></i>
|
|
4
|
+
<span class="mx-10">{{ title }}</span>
|
|
5
|
+
<i v-if="hasMore" @click="$emit('onMore')" class="mdi absolute right-5 text-xl cursor-pointer" :class="[moreIcon, hideMoreOnLg ? 'lg:!hidden' : '']"> </i>
|
|
20
6
|
</header>
|
|
21
7
|
</template>
|
|
22
8
|
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-progress-circular
|
|
3
|
-
:size="size"
|
|
4
|
-
:width="width"
|
|
5
|
-
:indeterminate="indeterminate"
|
|
6
|
-
:color="color"
|
|
7
|
-
:bg-color="bgColor"
|
|
8
|
-
></v-progress-circular>
|
|
2
|
+
<v-progress-circular :size="size" :width="width" :indeterminate="indeterminate" :color="color" :bg-color="bgColor"></v-progress-circular>
|
|
9
3
|
</template>
|
|
10
4
|
|
|
11
5
|
<script lang="ts">
|
|
@@ -1,59 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<base-drawer :panel-title="$dataStore.menu.title" which-panel="settings">
|
|
3
3
|
<base-panel-item>
|
|
4
|
-
<v-btn
|
|
5
|
-
size="x-small"
|
|
6
|
-
icon="mdi-minus"
|
|
7
|
-
color="#A0B3D8"
|
|
8
|
-
class="text-white"
|
|
9
|
-
variant="flat"
|
|
10
|
-
></v-btn>
|
|
4
|
+
<v-btn size="x-small" icon="mdi-minus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('decrease')"></v-btn>
|
|
11
5
|
Шрифт
|
|
12
|
-
<v-btn
|
|
13
|
-
size="x-small"
|
|
14
|
-
icon="mdi-plus"
|
|
15
|
-
color="#A0B3D8"
|
|
16
|
-
class="text-white"
|
|
17
|
-
variant="flat"
|
|
18
|
-
></v-btn>
|
|
6
|
+
<v-btn size="x-small" icon="mdi-plus" color="#A0B3D8" class="text-white" variant="flat" @click="handleFontSize('increase')"></v-btn>
|
|
19
7
|
</base-panel-item>
|
|
20
8
|
<base-panel-item>
|
|
21
|
-
<v-text-field
|
|
22
|
-
v-model="$dataStore.user.fullName"
|
|
23
|
-
:readonly="true"
|
|
24
|
-
hide-details
|
|
25
|
-
variant="plain"
|
|
26
|
-
:label="$dataStore.user.roles?.join(', ')"
|
|
27
|
-
></v-text-field>
|
|
9
|
+
<v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')"></v-text-field>
|
|
28
10
|
<i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"></i
|
|
29
11
|
></base-panel-item>
|
|
30
12
|
<base-panel-item
|
|
31
|
-
v-for="panelItem of dataStore.settings.items"
|
|
32
|
-
:key="panelItem.title"
|
|
13
|
+
v-for="panelItem of dataStore.settings.items.filter(i => (typeof i.show === 'boolean' ? i.show : true))"
|
|
14
|
+
:key="panelItem.title!"
|
|
33
15
|
class="cursor-pointer"
|
|
34
16
|
@click="panelItem.action ? panelItem.action() : null"
|
|
35
17
|
>
|
|
36
18
|
{{ panelItem.title }}
|
|
37
|
-
<i
|
|
38
|
-
v-if="panelItem.icon"
|
|
39
|
-
class="mdi text-xl text-[#A0B3D8]"
|
|
40
|
-
:class="[panelItem.icon]"
|
|
41
|
-
></i>
|
|
19
|
+
<i v-if="panelItem.icon" class="mdi text-xl text-[#A0B3D8]" :class="[panelItem.icon]"></i>
|
|
42
20
|
</base-panel-item>
|
|
43
21
|
<base-panel-item @click="dialog = true" class="cursor-pointer">
|
|
44
22
|
Выход
|
|
45
23
|
<i class="mdi mdi-logout text-xl text-[#A0B3D8]"></i>
|
|
46
24
|
</base-panel-item>
|
|
47
25
|
|
|
48
|
-
<base-dialog
|
|
49
|
-
v-model="dialog"
|
|
50
|
-
:title="$t('dialog.exit')"
|
|
51
|
-
:subtitle="$t('dialog.dataWillClear')"
|
|
52
|
-
actions="default"
|
|
53
|
-
@yes="logoutUser"
|
|
54
|
-
@no="dialog = false"
|
|
55
|
-
>
|
|
56
|
-
</base-dialog
|
|
26
|
+
<base-dialog v-model="dialog" :title="$t('dialog.exit')" :subtitle="$t('dialog.dataWillClear')" actions="default" @yes="logoutUser" @no="dialog = false"> </base-dialog
|
|
57
27
|
></base-drawer>
|
|
58
28
|
</template>
|
|
59
29
|
|
|
@@ -61,6 +31,16 @@
|
|
|
61
31
|
const dialog = ref(false);
|
|
62
32
|
const dataStore = useDataStore();
|
|
63
33
|
|
|
34
|
+
const handleFontSize = (action: 'increase' | 'decrease') => {
|
|
35
|
+
if (action === 'increase' && dataStore.fontSize < 24) dataStore.fontSize += 2;
|
|
36
|
+
if (action === 'decrease' && dataStore.fontSize > 14) dataStore.fontSize -= 2;
|
|
37
|
+
if (dataStore.isEFO) {
|
|
38
|
+
dataStore.sendToChild(constants.postActions.font, dataStore.fontSize);
|
|
39
|
+
} else {
|
|
40
|
+
dataStore.sendToParent(constants.postActions.font, dataStore.fontSize);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
64
44
|
const logoutUser = async () => {
|
|
65
45
|
dialog.value = false;
|
|
66
46
|
await dataStore.logoutUser();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="border-[1px] rounded-lg h-[80px] mx-[10px] mt-[14px] flex place-content-center" :class="[$libStyles.blueBgLight, $libStyles.textTitle]">
|
|
3
|
+
<div class="flex justify-center items-center font-medium gap-2 opacity-40">
|
|
4
|
+
{{ text }}
|
|
5
|
+
<i class="text-2xl mdi" :class="[icon ? icon : 'mdi-database-off-outline']"></i>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
props: {
|
|
13
|
+
text: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'Отсутствуют данные',
|
|
16
|
+
},
|
|
17
|
+
icon: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<aside class="w-full lg:w-1/4 bg-white flex flex-col border-r-2">
|
|
2
|
+
<aside class="w-full lg:w-1/4 bg-white flex flex-col border-r-2 relative">
|
|
3
3
|
<base-header
|
|
4
4
|
class="justify-center"
|
|
5
5
|
:title="title"
|
|
@@ -12,21 +12,15 @@
|
|
|
12
12
|
@onMore="$emit('onMore')"
|
|
13
13
|
></base-header>
|
|
14
14
|
<slot key="slot-content" name="content"></slot>
|
|
15
|
-
<section key="main" class="
|
|
15
|
+
<section key="main" :class="[$libStyles.flexColNav]">
|
|
16
16
|
<slot name="start"></slot>
|
|
17
|
-
<
|
|
18
|
-
<div
|
|
19
|
-
v-
|
|
20
|
-
class="flex flex-col gap-[10px]"
|
|
21
|
-
>
|
|
22
|
-
<div v-for="(item, index) of $dataStore.menuItems" :key="index">
|
|
17
|
+
<base-fade-transition>
|
|
18
|
+
<div v-if="$dataStore.menuItems && $dataStore.menuItems.length" class="flex flex-col gap-[10px]">
|
|
19
|
+
<div v-for="(item, index) of $dataStore.menuItems.filter(i => (typeof i.show === 'boolean' ? i.show : true))" :key="index">
|
|
23
20
|
<base-menu-nav-item
|
|
24
21
|
:menu-item="item"
|
|
25
|
-
:selected="
|
|
26
|
-
|
|
27
|
-
!!item.title &&
|
|
28
|
-
selected.title === item.title
|
|
29
|
-
"
|
|
22
|
+
:selected="!!selected.title && !!item.title && selected.title === item.title"
|
|
23
|
+
:disabled="typeof item.disabled === 'boolean' ? item.disabled : false"
|
|
30
24
|
@click.left="pickItem(item)"
|
|
31
25
|
@click.middle="openTab(item)"
|
|
32
26
|
>
|
|
@@ -34,8 +28,17 @@
|
|
|
34
28
|
<hr v-if="item.hasLine" class="mt-[10px]" />
|
|
35
29
|
</div>
|
|
36
30
|
</div>
|
|
37
|
-
</transition>
|
|
31
|
+
</base-fade-transition>
|
|
38
32
|
<slot name="end"></slot>
|
|
33
|
+
<slot name="actions"></slot>
|
|
34
|
+
<base-fade-transition>
|
|
35
|
+
<div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[30%] w-full pr-4">
|
|
36
|
+
<div v-for="(item, index) of $dataStore.buttons" :key="index">
|
|
37
|
+
<transition enter-active-class="animate__animated animate__fadeIn animate__faster" leave-active-class="animate__animated animate__fadeOut animate__faster">
|
|
38
|
+
<base-btn v-if="typeof item.show === 'boolean' ? item.show : true" :text="item.title!" :btn="item.color" :disabled="item.disabled" @click="item.action"> </base-btn>
|
|
39
|
+
</transition>
|
|
40
|
+
</div></div
|
|
41
|
+
></base-fade-transition>
|
|
39
42
|
</section>
|
|
40
43
|
</aside>
|
|
41
44
|
</template>
|
|
@@ -75,22 +78,21 @@ export default defineComponent({
|
|
|
75
78
|
default: 'mdi-cog-outline',
|
|
76
79
|
},
|
|
77
80
|
},
|
|
78
|
-
emits: ['
|
|
81
|
+
emits: ['onLink', 'onBack', 'onMore', 'clicked'],
|
|
79
82
|
setup(props, { emit }) {
|
|
80
83
|
const dataStore = useDataStore();
|
|
81
84
|
const router = useRouter();
|
|
82
85
|
|
|
83
|
-
const pickItem = (item: MenuItem) => {
|
|
84
|
-
if (item.title !== dataStore.menu.selectedItem.title) {
|
|
85
|
-
emit('update:modelValue', item);
|
|
86
|
+
const pickItem = async (item: MenuItem) => {
|
|
87
|
+
if (item.title !== dataStore.menu.selectedItem.title && (typeof item.disabled === 'boolean' ? !item.disabled : true)) {
|
|
86
88
|
if (typeof item.link === 'object') {
|
|
87
89
|
if (item.link && 'name' in item.link) {
|
|
88
|
-
router.push(item.link as RouteLocationNormalized);
|
|
90
|
+
await router.push(item.link as RouteLocationNormalized);
|
|
89
91
|
} else {
|
|
90
92
|
dataStore.showToaster('warning', 'Отсутствует ссылка для перехода');
|
|
91
93
|
}
|
|
92
94
|
} else {
|
|
93
|
-
|
|
95
|
+
emit('onLink', item);
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
};
|
|
@@ -5,17 +5,13 @@
|
|
|
5
5
|
selected ? $libStyles.whiteText : $libStyles.blackText,
|
|
6
6
|
$libStyles.rounded,
|
|
7
7
|
$libStyles.textSimple,
|
|
8
|
+
disabled ? 'cursor-not-allowed opacity-50' : '',
|
|
8
9
|
]"
|
|
9
10
|
class="h-[60px] flex items-center justify-between hover:bg-[#A0B3D8] hover:!text-white pl-4 cursor-pointer transition-all"
|
|
10
11
|
>
|
|
11
12
|
<span>{{ menuItem.title }}</span>
|
|
12
13
|
<i v-if="menuItem.icon" class="mdi text-xl pr-4" :class="[menuItem.icon]"></i>
|
|
13
|
-
<v-tooltip
|
|
14
|
-
v-if="menuItem.description"
|
|
15
|
-
activator="parent"
|
|
16
|
-
location="bottom"
|
|
17
|
-
>{{ menuItem.description }}</v-tooltip
|
|
18
|
-
>
|
|
14
|
+
<v-tooltip v-if="menuItem.description" activator="parent" location="bottom">{{ menuItem.description }}</v-tooltip>
|
|
19
15
|
</div>
|
|
20
16
|
</template>
|
|
21
17
|
|
|
@@ -32,6 +28,10 @@ export default defineComponent({
|
|
|
32
28
|
type: Boolean,
|
|
33
29
|
default: false,
|
|
34
30
|
},
|
|
31
|
+
disabled: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
</script>
|