shared-ritm 1.3.32 → 1.3.33
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/dist/index.css +1 -1
- package/dist/shared-ritm.es.js +8712 -8786
- package/dist/shared-ritm.umd.js +340 -340
- package/dist/types/api/services/ComentsServise.d.ts +10 -0
- package/dist/types/api/services/PhotoService.d.ts +51 -38
- package/dist/types/api/services/RepairsService.d.ts +1 -1
- package/dist/types/api/settings/ApiService.d.ts +1 -1
- package/dist/types/api/types/Api_Tasks.d.ts +2 -0
- package/dist/types/api/types/Api_Users.d.ts +43 -0
- package/package.json +64 -64
- package/src/App.vue +2461 -2461
- package/src/api/services/BrigadesService.ts +32 -32
- package/src/api/services/ControlsService.ts +96 -96
- package/src/api/services/EquipmentService.ts +29 -29
- package/src/api/services/InstrumentsService.ts +68 -68
- package/src/api/services/MetricsService.ts +123 -123
- package/src/api/services/ModulesService.ts +27 -27
- package/src/api/services/ProjectsService.ts +83 -83
- package/src/api/services/RepairsService.ts +111 -111
- package/src/api/services/ScheduleService.ts +69 -69
- package/src/api/services/SearchService.ts +22 -22
- package/src/api/services/UserService.ts +123 -123
- package/src/api/services/VideoService.ts +113 -113
- package/src/api/settings/ApiService.ts +124 -124
- package/src/api/types/Api_Auth.ts +105 -105
- package/src/api/types/Api_Brigades.ts +36 -36
- package/src/api/types/Api_Controls.ts +111 -111
- package/src/api/types/Api_Equipment.ts +3 -3
- package/src/api/types/Api_Instruments.ts +156 -156
- package/src/api/types/Api_Metrics.ts +5 -5
- package/src/api/types/Api_Modules.ts +21 -21
- package/src/api/types/Api_Projects.ts +62 -62
- package/src/api/types/Api_Repairs.ts +186 -186
- package/src/api/types/Api_Schedule.ts +64 -64
- package/src/api/types/Api_Search.ts +80 -80
- package/src/api/types/Api_Tasks.ts +376 -374
- package/src/api/types/Api_User.ts +146 -146
- package/src/api/types/Api_Video.ts +241 -241
- package/src/common/app-datepicker/AppDatepicker.vue +218 -218
- package/src/common/app-dropdown/AppDropdown.vue +37 -37
- package/src/common/app-input-new/AppInputNew.vue +179 -179
- package/src/common/app-layout/AppLayout.vue +84 -84
- package/src/common/app-modal/index.vue +96 -96
- package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
- package/src/common/app-sidebar/AppSidebar.vue +174 -174
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +149 -149
- package/src/common/app-table/AppTable.vue +313 -313
- package/src/common/app-table/AppTableLayout.vue +137 -137
- package/src/common/app-table/components/ModalSelect.vue +298 -298
- package/src/common/app-table/controllers/useBaseTable.ts +45 -45
- package/src/common/app-table/controllers/useTableModel.ts +102 -102
- package/src/icons/dialogs/SafetyIcon.vue +12 -12
- package/src/index.ts +131 -131
- package/src/styles/variables.sass +12 -12
- package/src/utils/files.ts +19 -19
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-drawer
|
|
3
|
-
:key="`${drawer}`"
|
|
4
|
-
v-model="drawer"
|
|
5
|
-
:class="$style.drawer"
|
|
6
|
-
:mini="isSidebarMini"
|
|
7
|
-
:overlay="!isFixSidebar"
|
|
8
|
-
:width="drawerWidth"
|
|
9
|
-
:mini-width="drawerMiniWidth"
|
|
10
|
-
:breakpoint="960"
|
|
11
|
-
show-if-above
|
|
12
|
-
persistent
|
|
13
|
-
@mouseover="toggleSidebarMini(false)"
|
|
14
|
-
@mouseout="toggleSidebarMini(true)"
|
|
15
|
-
>
|
|
16
|
-
<template v-if="isTablet">
|
|
17
|
-
<q-item :class="$style['tablet-logo']">
|
|
18
|
-
<q-item-section avatar>
|
|
19
|
-
<q-btn
|
|
20
|
-
round
|
|
21
|
-
unelevated
|
|
22
|
-
:class="$style['tablet-logo__btn']"
|
|
23
|
-
:icon="tabletLogoBtn"
|
|
24
|
-
@click="openDrawerIsTablet()"
|
|
25
|
-
/>
|
|
26
|
-
</q-item-section>
|
|
27
|
-
<q-item-section :class="$style['logo__text']">РИТМ</q-item-section>
|
|
28
|
-
</q-item>
|
|
29
|
-
</template>
|
|
30
|
-
<template v-else>
|
|
31
|
-
<q-item :class="$style.logo">
|
|
32
|
-
<q-item-section avatar>
|
|
33
|
-
<app-icon name="logo-icon" />
|
|
34
|
-
</q-item-section>
|
|
35
|
-
<q-item-section :class="$style['logo__text']">{{ isSidebarMini ? '' : 'РИТМ' }}</q-item-section>
|
|
36
|
-
</q-item>
|
|
37
|
-
<q-btn
|
|
38
|
-
dense
|
|
39
|
-
round
|
|
40
|
-
unelevated
|
|
41
|
-
class="q-mini-drawer-hide"
|
|
42
|
-
:class="$style['minify-btn']"
|
|
43
|
-
icon="chevron_left"
|
|
44
|
-
@click="isFixSidebar = !isFixSidebar"
|
|
45
|
-
>
|
|
46
|
-
<q-tooltip>Закрепить сайдбар</q-tooltip>
|
|
47
|
-
</q-btn>
|
|
48
|
-
</template>
|
|
49
|
-
<sidebar-menu :main="main" :menu-items="menuItems" :minify="isSidebarMini" :is-route-active="isRouteActive" />
|
|
50
|
-
<q-item v-ripple :class="$style['menu-exit']" clickable @click="logout()">
|
|
51
|
-
<q-item-section avatar>
|
|
52
|
-
<app-icon :name="'logout-icon'" color="white" size="24px" />
|
|
53
|
-
</q-item-section>
|
|
54
|
-
<q-item-section :class="$style['menu-exit__label']">Выход</q-item-section>
|
|
55
|
-
</q-item>
|
|
56
|
-
</q-drawer>
|
|
57
|
-
</template>
|
|
58
|
-
|
|
59
|
-
<script setup lang="ts">
|
|
60
|
-
import { computed, defineProps, defineEmits, ref, watch, withDefaults } from 'vue'
|
|
61
|
-
import SidebarMenu from './components/SidebarMenu.vue'
|
|
62
|
-
|
|
63
|
-
import { useQuasar } from 'quasar'
|
|
64
|
-
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
65
|
-
|
|
66
|
-
interface Props {
|
|
67
|
-
isDrawer: boolean
|
|
68
|
-
minify?: boolean
|
|
69
|
-
menuItems?: any[]
|
|
70
|
-
main?: boolean
|
|
71
|
-
isRouteActive: (item: any) => boolean
|
|
72
|
-
}
|
|
73
|
-
const emits = defineEmits(['logout'])
|
|
74
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
75
|
-
main: false,
|
|
76
|
-
menuItems: () => [],
|
|
77
|
-
})
|
|
78
|
-
const $q = useQuasar()
|
|
79
|
-
|
|
80
|
-
const drawer = ref(true)
|
|
81
|
-
const isSidebarMini = ref(true)
|
|
82
|
-
const isFixSidebar = ref(false)
|
|
83
|
-
|
|
84
|
-
const isTablet = computed(() => $q.screen.lt.lg)
|
|
85
|
-
const tabletLogoBtn = computed(() => (isSidebarMini.value ? 'menu' : 'close'))
|
|
86
|
-
const drawerWidth = computed(() => (isTablet.value ? 250 : 275))
|
|
87
|
-
const drawerMiniWidth = computed(() => (isTablet.value ? 47 : 72))
|
|
88
|
-
|
|
89
|
-
function toggleSidebarMini(value: boolean): void {
|
|
90
|
-
if (!isFixSidebar.value && !isTablet.value) isSidebarMini.value = value
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function openDrawerIsTablet() {
|
|
94
|
-
isFixSidebar.value = !isFixSidebar.value
|
|
95
|
-
isSidebarMini.value = !isSidebarMini.value
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function logout(): void {
|
|
99
|
-
emits('logout')
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
watch(
|
|
103
|
-
() => isTablet.value,
|
|
104
|
-
(value: boolean) => {
|
|
105
|
-
isFixSidebar.value = value
|
|
106
|
-
},
|
|
107
|
-
)
|
|
108
|
-
</script>
|
|
109
|
-
|
|
110
|
-
<style lang="scss">
|
|
111
|
-
.q-drawer {
|
|
112
|
-
z-index: 3000;
|
|
113
|
-
}
|
|
114
|
-
</style>
|
|
115
|
-
|
|
116
|
-
<style lang="scss" module>
|
|
117
|
-
.drawer {
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
height: 100vh;
|
|
121
|
-
background: linear-gradient(184deg, #0b3f8e 9.62%, #5386d3 59.23%, #5386d3 91.63%);
|
|
122
|
-
border-right: 1px solid #e4e6e8;
|
|
123
|
-
&::-webkit-scrollbar {
|
|
124
|
-
height: 4px;
|
|
125
|
-
width: 4px;
|
|
126
|
-
}
|
|
127
|
-
&::-webkit-scrollbar-thumb {
|
|
128
|
-
width: 4px;
|
|
129
|
-
height: 4px;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
.logo {
|
|
133
|
-
display: flex;
|
|
134
|
-
margin: 24px 0;
|
|
135
|
-
&__text {
|
|
136
|
-
color: white;
|
|
137
|
-
font-size: 20px;
|
|
138
|
-
font-weight: 700;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
.tablet-logo {
|
|
142
|
-
border-bottom: 1px solid white;
|
|
143
|
-
&__btn {
|
|
144
|
-
color: white;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.minify-btn {
|
|
149
|
-
background: #0b3f8e;
|
|
150
|
-
color: white;
|
|
151
|
-
position: absolute;
|
|
152
|
-
top: 25px;
|
|
153
|
-
right: -17px;
|
|
154
|
-
|
|
155
|
-
&:global(.--mini) {
|
|
156
|
-
:global(.q-icon) {
|
|
157
|
-
transform: rotate(180deg);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.menu-exit {
|
|
163
|
-
border-top: 1px solid white;
|
|
164
|
-
:global(.q-item__section--avatar) {
|
|
165
|
-
min-width: 24px;
|
|
166
|
-
}
|
|
167
|
-
&__label {
|
|
168
|
-
color: #fff;
|
|
169
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
170
|
-
font-size: 16px;
|
|
171
|
-
font-weight: 300;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-drawer
|
|
3
|
+
:key="`${drawer}`"
|
|
4
|
+
v-model="drawer"
|
|
5
|
+
:class="$style.drawer"
|
|
6
|
+
:mini="isSidebarMini"
|
|
7
|
+
:overlay="!isFixSidebar"
|
|
8
|
+
:width="drawerWidth"
|
|
9
|
+
:mini-width="drawerMiniWidth"
|
|
10
|
+
:breakpoint="960"
|
|
11
|
+
show-if-above
|
|
12
|
+
persistent
|
|
13
|
+
@mouseover="toggleSidebarMini(false)"
|
|
14
|
+
@mouseout="toggleSidebarMini(true)"
|
|
15
|
+
>
|
|
16
|
+
<template v-if="isTablet">
|
|
17
|
+
<q-item :class="$style['tablet-logo']">
|
|
18
|
+
<q-item-section avatar>
|
|
19
|
+
<q-btn
|
|
20
|
+
round
|
|
21
|
+
unelevated
|
|
22
|
+
:class="$style['tablet-logo__btn']"
|
|
23
|
+
:icon="tabletLogoBtn"
|
|
24
|
+
@click="openDrawerIsTablet()"
|
|
25
|
+
/>
|
|
26
|
+
</q-item-section>
|
|
27
|
+
<q-item-section :class="$style['logo__text']">РИТМ</q-item-section>
|
|
28
|
+
</q-item>
|
|
29
|
+
</template>
|
|
30
|
+
<template v-else>
|
|
31
|
+
<q-item :class="$style.logo">
|
|
32
|
+
<q-item-section avatar>
|
|
33
|
+
<app-icon name="logo-icon" />
|
|
34
|
+
</q-item-section>
|
|
35
|
+
<q-item-section :class="$style['logo__text']">{{ isSidebarMini ? '' : 'РИТМ' }}</q-item-section>
|
|
36
|
+
</q-item>
|
|
37
|
+
<q-btn
|
|
38
|
+
dense
|
|
39
|
+
round
|
|
40
|
+
unelevated
|
|
41
|
+
class="q-mini-drawer-hide"
|
|
42
|
+
:class="$style['minify-btn']"
|
|
43
|
+
icon="chevron_left"
|
|
44
|
+
@click="isFixSidebar = !isFixSidebar"
|
|
45
|
+
>
|
|
46
|
+
<q-tooltip>Закрепить сайдбар</q-tooltip>
|
|
47
|
+
</q-btn>
|
|
48
|
+
</template>
|
|
49
|
+
<sidebar-menu :main="main" :menu-items="menuItems" :minify="isSidebarMini" :is-route-active="isRouteActive" />
|
|
50
|
+
<q-item v-ripple :class="$style['menu-exit']" clickable @click="logout()">
|
|
51
|
+
<q-item-section avatar>
|
|
52
|
+
<app-icon :name="'logout-icon'" color="white" size="24px" />
|
|
53
|
+
</q-item-section>
|
|
54
|
+
<q-item-section :class="$style['menu-exit__label']">Выход</q-item-section>
|
|
55
|
+
</q-item>
|
|
56
|
+
</q-drawer>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { computed, defineProps, defineEmits, ref, watch, withDefaults } from 'vue'
|
|
61
|
+
import SidebarMenu from './components/SidebarMenu.vue'
|
|
62
|
+
|
|
63
|
+
import { useQuasar } from 'quasar'
|
|
64
|
+
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
65
|
+
|
|
66
|
+
interface Props {
|
|
67
|
+
isDrawer: boolean
|
|
68
|
+
minify?: boolean
|
|
69
|
+
menuItems?: any[]
|
|
70
|
+
main?: boolean
|
|
71
|
+
isRouteActive: (item: any) => boolean
|
|
72
|
+
}
|
|
73
|
+
const emits = defineEmits(['logout'])
|
|
74
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
75
|
+
main: false,
|
|
76
|
+
menuItems: () => [],
|
|
77
|
+
})
|
|
78
|
+
const $q = useQuasar()
|
|
79
|
+
|
|
80
|
+
const drawer = ref(true)
|
|
81
|
+
const isSidebarMini = ref(true)
|
|
82
|
+
const isFixSidebar = ref(false)
|
|
83
|
+
|
|
84
|
+
const isTablet = computed(() => $q.screen.lt.lg)
|
|
85
|
+
const tabletLogoBtn = computed(() => (isSidebarMini.value ? 'menu' : 'close'))
|
|
86
|
+
const drawerWidth = computed(() => (isTablet.value ? 250 : 275))
|
|
87
|
+
const drawerMiniWidth = computed(() => (isTablet.value ? 47 : 72))
|
|
88
|
+
|
|
89
|
+
function toggleSidebarMini(value: boolean): void {
|
|
90
|
+
if (!isFixSidebar.value && !isTablet.value) isSidebarMini.value = value
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function openDrawerIsTablet() {
|
|
94
|
+
isFixSidebar.value = !isFixSidebar.value
|
|
95
|
+
isSidebarMini.value = !isSidebarMini.value
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function logout(): void {
|
|
99
|
+
emits('logout')
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
watch(
|
|
103
|
+
() => isTablet.value,
|
|
104
|
+
(value: boolean) => {
|
|
105
|
+
isFixSidebar.value = value
|
|
106
|
+
},
|
|
107
|
+
)
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<style lang="scss">
|
|
111
|
+
.q-drawer {
|
|
112
|
+
z-index: 3000;
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
115
|
+
|
|
116
|
+
<style lang="scss" module>
|
|
117
|
+
.drawer {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
height: 100vh;
|
|
121
|
+
background: linear-gradient(184deg, #0b3f8e 9.62%, #5386d3 59.23%, #5386d3 91.63%);
|
|
122
|
+
border-right: 1px solid #e4e6e8;
|
|
123
|
+
&::-webkit-scrollbar {
|
|
124
|
+
height: 4px;
|
|
125
|
+
width: 4px;
|
|
126
|
+
}
|
|
127
|
+
&::-webkit-scrollbar-thumb {
|
|
128
|
+
width: 4px;
|
|
129
|
+
height: 4px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.logo {
|
|
133
|
+
display: flex;
|
|
134
|
+
margin: 24px 0;
|
|
135
|
+
&__text {
|
|
136
|
+
color: white;
|
|
137
|
+
font-size: 20px;
|
|
138
|
+
font-weight: 700;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
.tablet-logo {
|
|
142
|
+
border-bottom: 1px solid white;
|
|
143
|
+
&__btn {
|
|
144
|
+
color: white;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.minify-btn {
|
|
149
|
+
background: #0b3f8e;
|
|
150
|
+
color: white;
|
|
151
|
+
position: absolute;
|
|
152
|
+
top: 25px;
|
|
153
|
+
right: -17px;
|
|
154
|
+
|
|
155
|
+
&:global(.--mini) {
|
|
156
|
+
:global(.q-icon) {
|
|
157
|
+
transform: rotate(180deg);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.menu-exit {
|
|
163
|
+
border-top: 1px solid white;
|
|
164
|
+
:global(.q-item__section--avatar) {
|
|
165
|
+
min-width: 24px;
|
|
166
|
+
}
|
|
167
|
+
&__label {
|
|
168
|
+
color: #fff;
|
|
169
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
170
|
+
font-size: 16px;
|
|
171
|
+
font-weight: 300;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-expansion-item
|
|
3
|
-
v-if="item.items"
|
|
4
|
-
:model-value="isRouteActive(item) && expand"
|
|
5
|
-
header-class="text-purple"
|
|
6
|
-
:class="[$style['menu-item'], { 'expansion-item-active': isRouteActive(item) && minify }]"
|
|
7
|
-
:data-test="`sidebar-expansion-item-${(item.name || 'unnamed').toLowerCase().replace(/\s+/g, '-')}`"
|
|
8
|
-
:expand-icon-class="minify ? 'hidden' : ''"
|
|
9
|
-
@update:model-value="expand = $event"
|
|
10
|
-
>
|
|
11
|
-
<template #header>
|
|
12
|
-
<q-tooltip
|
|
13
|
-
v-if="minify"
|
|
14
|
-
:delay="100"
|
|
15
|
-
transition-show="jump-right"
|
|
16
|
-
transition-hide="jump-left"
|
|
17
|
-
anchor="center right"
|
|
18
|
-
self="center left"
|
|
19
|
-
>
|
|
20
|
-
{{ item.label }}
|
|
21
|
-
</q-tooltip>
|
|
22
|
-
|
|
23
|
-
<q-item-section v-if="item.icon" avatar>
|
|
24
|
-
<app-icon :name="item.icon" color="white" size="24px" />
|
|
25
|
-
</q-item-section>
|
|
26
|
-
|
|
27
|
-
<q-item-section :class="$style['menu-item__label']">{{ minify ? '' : item.label }}</q-item-section>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<sidebar-menu-item
|
|
31
|
-
v-for="(subItem, index) in item.items"
|
|
32
|
-
:key="index"
|
|
33
|
-
:item="subItem"
|
|
34
|
-
:main="main"
|
|
35
|
-
:is-route-active="isRouteActive"
|
|
36
|
-
/>
|
|
37
|
-
</q-expansion-item>
|
|
38
|
-
<q-item
|
|
39
|
-
v-else-if="item.name !== 'sign-out'"
|
|
40
|
-
v-ripple
|
|
41
|
-
:class="$style['menu-item']"
|
|
42
|
-
:active="isRouteActive(item)"
|
|
43
|
-
active-class="menu-active"
|
|
44
|
-
clickable
|
|
45
|
-
:to="main ? item.to : ''"
|
|
46
|
-
:data-test="`sidebar-item-${item.name.toLowerCase().replace(/\s+/g, '-')}`"
|
|
47
|
-
@click="goToRoute(item.to)"
|
|
48
|
-
>
|
|
49
|
-
<q-item-section v-if="item.icon" avatar>
|
|
50
|
-
<app-icon :name="item.icon" color="white" size="24px" />
|
|
51
|
-
</q-item-section>
|
|
52
|
-
|
|
53
|
-
<q-item-section :class="$style['menu-item__label']">
|
|
54
|
-
<p>{{ minify ? '' : item.label }}</p>
|
|
55
|
-
</q-item-section>
|
|
56
|
-
<q-tooltip
|
|
57
|
-
:delay="100"
|
|
58
|
-
transition-show="jump-right"
|
|
59
|
-
transition-hide="jump-left"
|
|
60
|
-
anchor="center right"
|
|
61
|
-
self="center left"
|
|
62
|
-
>
|
|
63
|
-
{{ item.label }}
|
|
64
|
-
</q-tooltip>
|
|
65
|
-
</q-item>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script lang="ts" setup>
|
|
69
|
-
import { defineProps, ref } from 'vue'
|
|
70
|
-
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
71
|
-
|
|
72
|
-
interface Props {
|
|
73
|
-
minify?: boolean
|
|
74
|
-
main: boolean
|
|
75
|
-
isRouteActive: (item: any) => boolean
|
|
76
|
-
item: {
|
|
77
|
-
name: string
|
|
78
|
-
label: string
|
|
79
|
-
icon: string
|
|
80
|
-
href: string
|
|
81
|
-
to: string
|
|
82
|
-
items: any[]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const emits = defineEmits(['goToRoute'])
|
|
87
|
-
const props = defineProps<Props>()
|
|
88
|
-
|
|
89
|
-
const expand = ref(true)
|
|
90
|
-
|
|
91
|
-
const goToRoute = (to: string) => {
|
|
92
|
-
if (!props.main) window.location.href = to
|
|
93
|
-
}
|
|
94
|
-
</script>
|
|
95
|
-
|
|
96
|
-
<style lang="scss" scoped>
|
|
97
|
-
.expansion-item-active {
|
|
98
|
-
background: rgba(243, 249, 253, 0.1);
|
|
99
|
-
border-radius: 10px;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
102
|
-
|
|
103
|
-
<style lang="scss" module>
|
|
104
|
-
.menu-item {
|
|
105
|
-
margin: 0 8px;
|
|
106
|
-
&:global(.menu-active) {
|
|
107
|
-
border-radius: 10px;
|
|
108
|
-
background: rgba(243, 249, 253, 0.1);
|
|
109
|
-
}
|
|
110
|
-
:global(.q-item__section--avatar) {
|
|
111
|
-
min-width: 24px;
|
|
112
|
-
padding-right: 14px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
:global(.q-expansion-item__content .q-item) {
|
|
116
|
-
padding-left: 20px;
|
|
117
|
-
}
|
|
118
|
-
:global(.q-item__section--main ~ .q-item__section--side) {
|
|
119
|
-
color: white;
|
|
120
|
-
}
|
|
121
|
-
&__label {
|
|
122
|
-
color: #fff;
|
|
123
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
124
|
-
font-size: 16px;
|
|
125
|
-
font-weight: 300;
|
|
126
|
-
p {
|
|
127
|
-
display: inline-block;
|
|
128
|
-
max-width: 160px;
|
|
129
|
-
white-space: nowrap;
|
|
130
|
-
overflow: hidden;
|
|
131
|
-
text-overflow: ellipsis;
|
|
132
|
-
margin: 0;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
@media (max-width: 1440px) {
|
|
138
|
-
.menu-item {
|
|
139
|
-
margin: 0 4px;
|
|
140
|
-
:global(.q-item__section--avatar) {
|
|
141
|
-
min-width: 24px;
|
|
142
|
-
padding-right: 10px;
|
|
143
|
-
}
|
|
144
|
-
&__label {
|
|
145
|
-
font-size: 14px;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-expansion-item
|
|
3
|
+
v-if="item.items"
|
|
4
|
+
:model-value="isRouteActive(item) && expand"
|
|
5
|
+
header-class="text-purple"
|
|
6
|
+
:class="[$style['menu-item'], { 'expansion-item-active': isRouteActive(item) && minify }]"
|
|
7
|
+
:data-test="`sidebar-expansion-item-${(item.name || 'unnamed').toLowerCase().replace(/\s+/g, '-')}`"
|
|
8
|
+
:expand-icon-class="minify ? 'hidden' : ''"
|
|
9
|
+
@update:model-value="expand = $event"
|
|
10
|
+
>
|
|
11
|
+
<template #header>
|
|
12
|
+
<q-tooltip
|
|
13
|
+
v-if="minify"
|
|
14
|
+
:delay="100"
|
|
15
|
+
transition-show="jump-right"
|
|
16
|
+
transition-hide="jump-left"
|
|
17
|
+
anchor="center right"
|
|
18
|
+
self="center left"
|
|
19
|
+
>
|
|
20
|
+
{{ item.label }}
|
|
21
|
+
</q-tooltip>
|
|
22
|
+
|
|
23
|
+
<q-item-section v-if="item.icon" avatar>
|
|
24
|
+
<app-icon :name="item.icon" color="white" size="24px" />
|
|
25
|
+
</q-item-section>
|
|
26
|
+
|
|
27
|
+
<q-item-section :class="$style['menu-item__label']">{{ minify ? '' : item.label }}</q-item-section>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<sidebar-menu-item
|
|
31
|
+
v-for="(subItem, index) in item.items"
|
|
32
|
+
:key="index"
|
|
33
|
+
:item="subItem"
|
|
34
|
+
:main="main"
|
|
35
|
+
:is-route-active="isRouteActive"
|
|
36
|
+
/>
|
|
37
|
+
</q-expansion-item>
|
|
38
|
+
<q-item
|
|
39
|
+
v-else-if="item.name !== 'sign-out'"
|
|
40
|
+
v-ripple
|
|
41
|
+
:class="$style['menu-item']"
|
|
42
|
+
:active="isRouteActive(item)"
|
|
43
|
+
active-class="menu-active"
|
|
44
|
+
clickable
|
|
45
|
+
:to="main ? item.to : ''"
|
|
46
|
+
:data-test="`sidebar-item-${item.name.toLowerCase().replace(/\s+/g, '-')}`"
|
|
47
|
+
@click="goToRoute(item.to)"
|
|
48
|
+
>
|
|
49
|
+
<q-item-section v-if="item.icon" avatar>
|
|
50
|
+
<app-icon :name="item.icon" color="white" size="24px" />
|
|
51
|
+
</q-item-section>
|
|
52
|
+
|
|
53
|
+
<q-item-section :class="$style['menu-item__label']">
|
|
54
|
+
<p>{{ minify ? '' : item.label }}</p>
|
|
55
|
+
</q-item-section>
|
|
56
|
+
<q-tooltip
|
|
57
|
+
:delay="100"
|
|
58
|
+
transition-show="jump-right"
|
|
59
|
+
transition-hide="jump-left"
|
|
60
|
+
anchor="center right"
|
|
61
|
+
self="center left"
|
|
62
|
+
>
|
|
63
|
+
{{ item.label }}
|
|
64
|
+
</q-tooltip>
|
|
65
|
+
</q-item>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script lang="ts" setup>
|
|
69
|
+
import { defineProps, ref } from 'vue'
|
|
70
|
+
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
71
|
+
|
|
72
|
+
interface Props {
|
|
73
|
+
minify?: boolean
|
|
74
|
+
main: boolean
|
|
75
|
+
isRouteActive: (item: any) => boolean
|
|
76
|
+
item: {
|
|
77
|
+
name: string
|
|
78
|
+
label: string
|
|
79
|
+
icon: string
|
|
80
|
+
href: string
|
|
81
|
+
to: string
|
|
82
|
+
items: any[]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const emits = defineEmits(['goToRoute'])
|
|
87
|
+
const props = defineProps<Props>()
|
|
88
|
+
|
|
89
|
+
const expand = ref(true)
|
|
90
|
+
|
|
91
|
+
const goToRoute = (to: string) => {
|
|
92
|
+
if (!props.main) window.location.href = to
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style lang="scss" scoped>
|
|
97
|
+
.expansion-item-active {
|
|
98
|
+
background: rgba(243, 249, 253, 0.1);
|
|
99
|
+
border-radius: 10px;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
102
|
+
|
|
103
|
+
<style lang="scss" module>
|
|
104
|
+
.menu-item {
|
|
105
|
+
margin: 0 8px;
|
|
106
|
+
&:global(.menu-active) {
|
|
107
|
+
border-radius: 10px;
|
|
108
|
+
background: rgba(243, 249, 253, 0.1);
|
|
109
|
+
}
|
|
110
|
+
:global(.q-item__section--avatar) {
|
|
111
|
+
min-width: 24px;
|
|
112
|
+
padding-right: 14px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:global(.q-expansion-item__content .q-item) {
|
|
116
|
+
padding-left: 20px;
|
|
117
|
+
}
|
|
118
|
+
:global(.q-item__section--main ~ .q-item__section--side) {
|
|
119
|
+
color: white;
|
|
120
|
+
}
|
|
121
|
+
&__label {
|
|
122
|
+
color: #fff;
|
|
123
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
124
|
+
font-size: 16px;
|
|
125
|
+
font-weight: 300;
|
|
126
|
+
p {
|
|
127
|
+
display: inline-block;
|
|
128
|
+
max-width: 160px;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
text-overflow: ellipsis;
|
|
132
|
+
margin: 0;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media (max-width: 1440px) {
|
|
138
|
+
.menu-item {
|
|
139
|
+
margin: 0 4px;
|
|
140
|
+
:global(.q-item__section--avatar) {
|
|
141
|
+
min-width: 24px;
|
|
142
|
+
padding-right: 10px;
|
|
143
|
+
}
|
|
144
|
+
&__label {
|
|
145
|
+
font-size: 14px;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
</style>
|