shared-ritm 1.2.46 → 1.2.48
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/README.md +103 -103
- package/dist/index.css +1 -1
- package/dist/shared-ritm.es.js +199855 -72176
- package/dist/shared-ritm.umd.js +97 -42
- package/dist/types/api/services/ControlsService.d.ts +1 -0
- package/dist/types/api/types/Api_Controls.d.ts +12 -2
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/api/services/ControlsService.ts +40 -36
- package/src/api/services/FileService.ts +15 -15
- package/src/api/services/GanttService.ts +17 -17
- package/src/api/services/MetricsService.ts +109 -109
- package/src/api/services/RepairsService.ts +100 -100
- package/src/api/settings/ApiService.ts +128 -128
- package/src/api/types/Api_Controls.ts +12 -2
- package/src/api/types/Api_Files.ts +1 -1
- package/src/api/types/Api_Projects.ts +55 -55
- package/src/api/types/Api_Repairs.ts +93 -93
- package/src/common/app-button/AppButton.vue +173 -173
- package/src/common/app-checkbox/AppCheckbox.vue +26 -26
- package/src/common/app-dialogs/AppConfirmDialog.vue +99 -99
- package/src/common/app-dropdown/AppDropdown.vue +31 -31
- package/src/common/app-input/AppInput.vue +147 -147
- package/src/common/app-loader/index.vue +43 -43
- package/src/common/app-page-layout/AppPageLayout.vue +122 -122
- package/src/common/app-select/AppSelect.vue +157 -157
- package/src/common/app-sidebar/AppSidebar.vue +168 -168
- package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +148 -148
- package/src/common/app-table/AppTable.vue +211 -211
- package/src/common/app-table/AppTableLayout.vue +93 -93
- package/src/common/app-table/components/ModalSelect.vue +215 -0
- package/src/common/app-table/components/TableModal.vue +26 -53
- package/src/common/app-table/components/TablePagination.vue +151 -151
- package/src/common/app-table/components/TableSearch.vue +78 -78
- package/src/common/app-table/controllers/useBaseTable.ts +43 -43
- package/src/common/app-table/controllers/useColumnSelector.ts +38 -38
- package/src/common/app-table/controllers/useTableModel.ts +93 -93
- package/src/common/app-toggle/AppToggle.vue +23 -23
- package/src/common/app-wrapper/AppWrapper.vue +28 -28
- package/src/global.d.ts +1 -1
- package/src/icons/components/arrow-down-icon.vue +25 -25
- package/src/icons/components/arrow-frame-icon.vue +19 -19
- package/src/icons/components/arrow-square.vue +22 -22
- package/src/icons/components/table-filter-icon.vue +30 -30
- package/src/icons/dialogs/RemoveIcon.vue +12 -12
- package/src/icons/dialogs/SafetyIcon.vue +12 -12
- package/src/icons/header/flashIcon.vue +24 -24
- package/src/icons/header/searchStatusIcon.vue +24 -24
- package/src/icons/header/smallCapsIcon.vue +34 -34
- package/src/icons/sidebar/assign-module-icon.vue +36 -36
- package/src/icons/sidebar/instrument-history-icon.vue +32 -32
- package/src/icons/sidebar/instrument-order-icon.vue +38 -38
- package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
- package/src/icons/sidebar/instruments-icon.vue +45 -45
- package/src/icons/sidebar/logo-icon.vue +15 -15
- package/src/icons/sidebar/logout-icon.vue +13 -13
- package/src/icons/sidebar/modules-icon.vue +16 -16
- package/src/icons/sidebar/notifications-icon.vue +24 -24
- package/src/icons/sidebar/order-icon.vue +44 -44
- package/src/icons/sidebar/pass-icon.vue +38 -38
- package/src/icons/sidebar/positions-icon.vue +42 -42
- package/src/icons/sidebar/preorder-icon.vue +19 -19
- package/src/icons/sidebar/projects-icon.vue +31 -31
- package/src/icons/sidebar/repair-object-icon.vue +18 -18
- package/src/icons/sidebar/repairs-icon.vue +20 -20
- package/src/icons/sidebar/roles-icon.vue +26 -26
- package/src/icons/sidebar/status-history-icon.vue +24 -24
- package/src/icons/sidebar/tasks-icon.vue +28 -28
- package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
- package/src/icons/sidebar/tasks_today-icon.vue +27 -27
- package/src/icons/sidebar/teams-icon.vue +32 -32
- package/src/icons/sidebar/user-icon.vue +18 -18
- package/src/icons/sidebar/users-icon.vue +46 -46
- package/src/icons/sidebar/videosources-icon.vue +19 -19
- package/src/icons/sidebar/videowall-icon.vue +13 -13
- package/src/icons/sidebar/videozones-icon.vue +21 -21
- package/src/icons/sidebar/warehouses-icon.vue +43 -43
- package/src/icons/sidebar/workshop-icon.vue +100 -100
- package/src/icons/sidebar/workzones-icon.vue +22 -22
- package/src/icons/task/attention-icon.vue +13 -13
- package/src/icons/task/clock-icon.vue +10 -10
- package/src/icons/task/delete-icon.vue +10 -10
- package/src/icons/task/fire-icon.vue +16 -16
- package/src/index.ts +2 -0
- package/src/quasar-user-options.ts +17 -17
- package/src/router/index.ts +10 -10
- package/src/shared/styles/general.css +96 -96
- package/src/shims-vue.d.ts +5 -5
- package/src/utils/confirm.ts +12 -12
- package/src/utils/notification.ts +9 -9
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-select
|
|
3
|
-
ref="select"
|
|
4
|
-
v-model="selected"
|
|
5
|
-
:options="filteredOptions"
|
|
6
|
-
:option-value="optionValue"
|
|
7
|
-
:option-label="optionLabel"
|
|
8
|
-
emit-value
|
|
9
|
-
map-options
|
|
10
|
-
:disable="isDisabled"
|
|
11
|
-
:multiple="multiple"
|
|
12
|
-
outlined
|
|
13
|
-
stack-label
|
|
14
|
-
:use-input="search"
|
|
15
|
-
:class="[$style.select]"
|
|
16
|
-
:label="label"
|
|
17
|
-
input-debounce="100"
|
|
18
|
-
:popup-content-class="$style['app-select__menu']"
|
|
19
|
-
:clearable="clearable"
|
|
20
|
-
rounded
|
|
21
|
-
autocomplete=""
|
|
22
|
-
@filter="filterFn"
|
|
23
|
-
>
|
|
24
|
-
<template v-if="multiple" #selected-item="scope">
|
|
25
|
-
<q-chip
|
|
26
|
-
v-if="scope.opt"
|
|
27
|
-
removable
|
|
28
|
-
class="q-ma-none"
|
|
29
|
-
dense
|
|
30
|
-
:tabindex="scope.tabindex"
|
|
31
|
-
color="white"
|
|
32
|
-
text-color="secondary"
|
|
33
|
-
@remove="scope.removeAtIndex(scope.index)"
|
|
34
|
-
>
|
|
35
|
-
{{ scope.opt[`${optionLabel}`] }}
|
|
36
|
-
</q-chip>
|
|
37
|
-
</template>
|
|
38
|
-
<template #no-option>
|
|
39
|
-
<q-item>{{ emptyText }}</q-item>
|
|
40
|
-
</template>
|
|
41
|
-
<q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
|
|
42
|
-
</q-select>
|
|
43
|
-
</template>
|
|
44
|
-
<script setup lang="ts">
|
|
45
|
-
import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
|
|
46
|
-
|
|
47
|
-
import { QSelect } from 'quasar'
|
|
48
|
-
|
|
49
|
-
type Option = Record<string, any>
|
|
50
|
-
|
|
51
|
-
interface AppQSelectProps {
|
|
52
|
-
modelValue: any
|
|
53
|
-
options: Option[]
|
|
54
|
-
placeholder: string
|
|
55
|
-
emptyText: string
|
|
56
|
-
optionLabel?: string
|
|
57
|
-
optionValue?: string
|
|
58
|
-
label?: string
|
|
59
|
-
multiple?: boolean
|
|
60
|
-
borderColor: string
|
|
61
|
-
isDisabled?: boolean
|
|
62
|
-
clearable?: boolean
|
|
63
|
-
search?: boolean
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const props = defineProps<AppQSelectProps>()
|
|
67
|
-
const select = ref({})
|
|
68
|
-
const emit = defineEmits(['update:modelValue'])
|
|
69
|
-
const selected = computed({
|
|
70
|
-
get() {
|
|
71
|
-
return props.modelValue
|
|
72
|
-
},
|
|
73
|
-
set(value) {
|
|
74
|
-
emit('update:modelValue', value)
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
const type = () => {
|
|
79
|
-
if (Array.isArray(selected.value) && !selected.value.length) return true
|
|
80
|
-
return typeof selected.value === 'string' && !selected.value
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const lcText: Ref<string> = ref('')
|
|
84
|
-
const filteredOptions = computed(() => {
|
|
85
|
-
return props.options.filter(x => x[props?.optionLabel || 'label'].toLowerCase().includes(lcText.value))
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
function filterFn(val: string, update: (arg0: () => void) => void) {
|
|
89
|
-
update(() => {
|
|
90
|
-
lcText.value = val.toLowerCase()
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
</script>
|
|
94
|
-
<style module lang="scss">
|
|
95
|
-
.wrap {
|
|
96
|
-
position: relative;
|
|
97
|
-
|
|
98
|
-
&:global(.--option-tree) {
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.select {
|
|
104
|
-
&:global(.q-field--outlined.q-field--rounded .q-field__control) {
|
|
105
|
-
border-radius: 14px;
|
|
106
|
-
}
|
|
107
|
-
&:global(.q-field--outlined .q-field__control:before) {
|
|
108
|
-
border-color: v-bind(borderColor);
|
|
109
|
-
}
|
|
110
|
-
&:global(.q-select .q-field__input) {
|
|
111
|
-
padding: 0 6px;
|
|
112
|
-
}
|
|
113
|
-
//&:global(.q-field--filled .q-field__control) {
|
|
114
|
-
// //color: red;
|
|
115
|
-
//}
|
|
116
|
-
//&:global(.q-field--filled.q-field--focused .q-field__control) {
|
|
117
|
-
//}
|
|
118
|
-
//&:global(.q-field--filled .q-field__control:after) {
|
|
119
|
-
// left: 8px;
|
|
120
|
-
// right: 8px;
|
|
121
|
-
//}
|
|
122
|
-
&:global(.q-field--outlined .q-item) {
|
|
123
|
-
color: #1d1d1d;
|
|
124
|
-
position: absolute;
|
|
125
|
-
padding: 0 4px;
|
|
126
|
-
top: 18px;
|
|
127
|
-
left: 0;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.append-wrapper {
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
column-gap: 4px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.menu-wrap {
|
|
138
|
-
padding: 8px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.search-wrapper {
|
|
142
|
-
position: sticky;
|
|
143
|
-
top: 0;
|
|
144
|
-
padding: 4px;
|
|
145
|
-
background: var(--main-bg);
|
|
146
|
-
z-index: 1;
|
|
147
|
-
}
|
|
148
|
-
.app-select__menu {
|
|
149
|
-
border-radius: 14px;
|
|
150
|
-
.q-item__label {
|
|
151
|
-
word-break: break-word;
|
|
152
|
-
}
|
|
153
|
-
&:global(.q-menu) {
|
|
154
|
-
max-height: 200px !important;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-select
|
|
3
|
+
ref="select"
|
|
4
|
+
v-model="selected"
|
|
5
|
+
:options="filteredOptions"
|
|
6
|
+
:option-value="optionValue"
|
|
7
|
+
:option-label="optionLabel"
|
|
8
|
+
emit-value
|
|
9
|
+
map-options
|
|
10
|
+
:disable="isDisabled"
|
|
11
|
+
:multiple="multiple"
|
|
12
|
+
outlined
|
|
13
|
+
stack-label
|
|
14
|
+
:use-input="search"
|
|
15
|
+
:class="[$style.select]"
|
|
16
|
+
:label="label"
|
|
17
|
+
input-debounce="100"
|
|
18
|
+
:popup-content-class="$style['app-select__menu']"
|
|
19
|
+
:clearable="clearable"
|
|
20
|
+
rounded
|
|
21
|
+
autocomplete=""
|
|
22
|
+
@filter="filterFn"
|
|
23
|
+
>
|
|
24
|
+
<template v-if="multiple" #selected-item="scope">
|
|
25
|
+
<q-chip
|
|
26
|
+
v-if="scope.opt"
|
|
27
|
+
removable
|
|
28
|
+
class="q-ma-none"
|
|
29
|
+
dense
|
|
30
|
+
:tabindex="scope.tabindex"
|
|
31
|
+
color="white"
|
|
32
|
+
text-color="secondary"
|
|
33
|
+
@remove="scope.removeAtIndex(scope.index)"
|
|
34
|
+
>
|
|
35
|
+
{{ scope.opt[`${optionLabel}`] }}
|
|
36
|
+
</q-chip>
|
|
37
|
+
</template>
|
|
38
|
+
<template #no-option>
|
|
39
|
+
<q-item>{{ emptyText }}</q-item>
|
|
40
|
+
</template>
|
|
41
|
+
<q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
|
|
42
|
+
</q-select>
|
|
43
|
+
</template>
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
|
|
46
|
+
|
|
47
|
+
import { QSelect } from 'quasar'
|
|
48
|
+
|
|
49
|
+
type Option = Record<string, any>
|
|
50
|
+
|
|
51
|
+
interface AppQSelectProps {
|
|
52
|
+
modelValue: any
|
|
53
|
+
options: Option[]
|
|
54
|
+
placeholder: string
|
|
55
|
+
emptyText: string
|
|
56
|
+
optionLabel?: string
|
|
57
|
+
optionValue?: string
|
|
58
|
+
label?: string
|
|
59
|
+
multiple?: boolean
|
|
60
|
+
borderColor: string
|
|
61
|
+
isDisabled?: boolean
|
|
62
|
+
clearable?: boolean
|
|
63
|
+
search?: boolean
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const props = defineProps<AppQSelectProps>()
|
|
67
|
+
const select = ref({})
|
|
68
|
+
const emit = defineEmits(['update:modelValue'])
|
|
69
|
+
const selected = computed({
|
|
70
|
+
get() {
|
|
71
|
+
return props.modelValue
|
|
72
|
+
},
|
|
73
|
+
set(value) {
|
|
74
|
+
emit('update:modelValue', value)
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const type = () => {
|
|
79
|
+
if (Array.isArray(selected.value) && !selected.value.length) return true
|
|
80
|
+
return typeof selected.value === 'string' && !selected.value
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const lcText: Ref<string> = ref('')
|
|
84
|
+
const filteredOptions = computed(() => {
|
|
85
|
+
return props.options.filter(x => x[props?.optionLabel || 'label'].toLowerCase().includes(lcText.value))
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
function filterFn(val: string, update: (arg0: () => void) => void) {
|
|
89
|
+
update(() => {
|
|
90
|
+
lcText.value = val.toLowerCase()
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
94
|
+
<style module lang="scss">
|
|
95
|
+
.wrap {
|
|
96
|
+
position: relative;
|
|
97
|
+
|
|
98
|
+
&:global(.--option-tree) {
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.select {
|
|
104
|
+
&:global(.q-field--outlined.q-field--rounded .q-field__control) {
|
|
105
|
+
border-radius: 14px;
|
|
106
|
+
}
|
|
107
|
+
&:global(.q-field--outlined .q-field__control:before) {
|
|
108
|
+
border-color: v-bind(borderColor);
|
|
109
|
+
}
|
|
110
|
+
&:global(.q-select .q-field__input) {
|
|
111
|
+
padding: 0 6px;
|
|
112
|
+
}
|
|
113
|
+
//&:global(.q-field--filled .q-field__control) {
|
|
114
|
+
// //color: red;
|
|
115
|
+
//}
|
|
116
|
+
//&:global(.q-field--filled.q-field--focused .q-field__control) {
|
|
117
|
+
//}
|
|
118
|
+
//&:global(.q-field--filled .q-field__control:after) {
|
|
119
|
+
// left: 8px;
|
|
120
|
+
// right: 8px;
|
|
121
|
+
//}
|
|
122
|
+
&:global(.q-field--outlined .q-item) {
|
|
123
|
+
color: #1d1d1d;
|
|
124
|
+
position: absolute;
|
|
125
|
+
padding: 0 4px;
|
|
126
|
+
top: 18px;
|
|
127
|
+
left: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.append-wrapper {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
column-gap: 4px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.menu-wrap {
|
|
138
|
+
padding: 8px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.search-wrapper {
|
|
142
|
+
position: sticky;
|
|
143
|
+
top: 0;
|
|
144
|
+
padding: 4px;
|
|
145
|
+
background: var(--main-bg);
|
|
146
|
+
z-index: 1;
|
|
147
|
+
}
|
|
148
|
+
.app-select__menu {
|
|
149
|
+
border-radius: 14px;
|
|
150
|
+
.q-item__label {
|
|
151
|
+
word-break: break-word;
|
|
152
|
+
}
|
|
153
|
+
&:global(.q-menu) {
|
|
154
|
+
max-height: 200px !important;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -1,168 +1,168 @@
|
|
|
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
|
-
@mouseover="toggleSidebarMini(false)"
|
|
13
|
-
@mouseout="toggleSidebarMini(true)"
|
|
14
|
-
>
|
|
15
|
-
<template v-if="isTablet">
|
|
16
|
-
<q-item :class="$style['tablet-logo']">
|
|
17
|
-
<q-item-section avatar>
|
|
18
|
-
<q-btn
|
|
19
|
-
round
|
|
20
|
-
unelevated
|
|
21
|
-
:class="$style['tablet-logo__btn']"
|
|
22
|
-
:icon="tabletLogoBtn"
|
|
23
|
-
@click="openDrawerIsTablet()"
|
|
24
|
-
/>
|
|
25
|
-
</q-item-section>
|
|
26
|
-
<q-item-section :class="$style['logo__text']">РИТМ</q-item-section>
|
|
27
|
-
</q-item>
|
|
28
|
-
</template>
|
|
29
|
-
<template v-else>
|
|
30
|
-
<q-item :class="$style.logo">
|
|
31
|
-
<q-item-section avatar>
|
|
32
|
-
<app-icon name="logo-icon" />
|
|
33
|
-
</q-item-section>
|
|
34
|
-
<q-item-section :class="$style['logo__text']">РИТМ</q-item-section>
|
|
35
|
-
</q-item>
|
|
36
|
-
<q-btn
|
|
37
|
-
dense
|
|
38
|
-
round
|
|
39
|
-
unelevated
|
|
40
|
-
class="q-mini-drawer-hide"
|
|
41
|
-
:class="$style['minify-btn']"
|
|
42
|
-
icon="chevron_left"
|
|
43
|
-
@click="isFixSidebar = !isFixSidebar"
|
|
44
|
-
>
|
|
45
|
-
<q-tooltip>Закрепить сайдбар</q-tooltip>
|
|
46
|
-
</q-btn>
|
|
47
|
-
</template>
|
|
48
|
-
<sidebar-menu :main="main" :menu-items="menuItems" :minify="isSidebarMini" :is-route-active="isRouteActive" />
|
|
49
|
-
<q-item v-ripple :class="$style['menu-exit']" clickable @click="logout()">
|
|
50
|
-
<q-item-section avatar>
|
|
51
|
-
<app-icon :name="'logout-icon'" color="white" size="24px" />
|
|
52
|
-
</q-item-section>
|
|
53
|
-
<q-item-section :class="$style['menu-exit__label']">Выход</q-item-section>
|
|
54
|
-
</q-item>
|
|
55
|
-
</q-drawer>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script setup lang="ts">
|
|
59
|
-
import { computed, defineProps, defineEmits, ref, watch, withDefaults } from 'vue'
|
|
60
|
-
import SidebarMenu from './components/SidebarMenu.vue'
|
|
61
|
-
|
|
62
|
-
import { useQuasar } from 'quasar'
|
|
63
|
-
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
64
|
-
|
|
65
|
-
interface Props {
|
|
66
|
-
isDrawer: boolean
|
|
67
|
-
minify?: boolean
|
|
68
|
-
menuItems?: any[]
|
|
69
|
-
main?: boolean
|
|
70
|
-
isRouteActive: (item: any) => boolean
|
|
71
|
-
}
|
|
72
|
-
const emits = defineEmits(['logout'])
|
|
73
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
74
|
-
main: false,
|
|
75
|
-
menuItems: () => [],
|
|
76
|
-
})
|
|
77
|
-
const $q = useQuasar()
|
|
78
|
-
|
|
79
|
-
const drawer = ref(true)
|
|
80
|
-
const isSidebarMini = ref(true)
|
|
81
|
-
const isFixSidebar = ref(false)
|
|
82
|
-
|
|
83
|
-
const isTablet = computed(() => $q.screen.lt.lg)
|
|
84
|
-
const tabletLogoBtn = computed(() => (isSidebarMini.value ? 'menu' : 'close'))
|
|
85
|
-
const drawerWidth = computed(() => (isTablet.value ? 250 : 275))
|
|
86
|
-
const drawerMiniWidth = computed(() => (isTablet.value ? 47 : 72))
|
|
87
|
-
|
|
88
|
-
function toggleSidebarMini(value: boolean): void {
|
|
89
|
-
if (!isFixSidebar.value && !isTablet.value) isSidebarMini.value = value
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function openDrawerIsTablet() {
|
|
93
|
-
isFixSidebar.value = !isFixSidebar.value
|
|
94
|
-
isSidebarMini.value = !isSidebarMini.value
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function logout(): void {
|
|
98
|
-
emits('logout')
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
watch(
|
|
102
|
-
() => isTablet.value,
|
|
103
|
-
(value: boolean) => {
|
|
104
|
-
isFixSidebar.value = value
|
|
105
|
-
},
|
|
106
|
-
)
|
|
107
|
-
</script>
|
|
108
|
-
|
|
109
|
-
<style lang="scss" module>
|
|
110
|
-
.drawer {
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
height: 100vh;
|
|
114
|
-
background: linear-gradient(184deg, #0b3f8e 9.62%, #5386d3 59.23%, #5386d3 91.63%);
|
|
115
|
-
border-right: 1px solid #e4e6e8;
|
|
116
|
-
&::-webkit-scrollbar {
|
|
117
|
-
height: 4px;
|
|
118
|
-
width: 4px;
|
|
119
|
-
}
|
|
120
|
-
&::-webkit-scrollbar-thumb {
|
|
121
|
-
width: 4px;
|
|
122
|
-
height: 4px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
.logo {
|
|
126
|
-
display: flex;
|
|
127
|
-
justify-content: center;
|
|
128
|
-
margin: 24px 0;
|
|
129
|
-
&__text {
|
|
130
|
-
color: white;
|
|
131
|
-
font-size: 20px;
|
|
132
|
-
font-weight: 700;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
.tablet-logo {
|
|
136
|
-
border-bottom: 1px solid white;
|
|
137
|
-
&__btn {
|
|
138
|
-
color: white;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.minify-btn {
|
|
143
|
-
background: #0b3f8e;
|
|
144
|
-
color: white;
|
|
145
|
-
position: absolute;
|
|
146
|
-
top: 25px;
|
|
147
|
-
right: -17px;
|
|
148
|
-
|
|
149
|
-
&:global(.--mini) {
|
|
150
|
-
:global(.q-icon) {
|
|
151
|
-
transform: rotate(180deg);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.menu-exit {
|
|
157
|
-
border-top: 1px solid white;
|
|
158
|
-
:global(.q-item__section--avatar) {
|
|
159
|
-
min-width: 24px;
|
|
160
|
-
}
|
|
161
|
-
&__label {
|
|
162
|
-
color: #fff;
|
|
163
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
164
|
-
font-size: 16px;
|
|
165
|
-
font-weight: 300;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
</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
|
+
@mouseover="toggleSidebarMini(false)"
|
|
13
|
+
@mouseout="toggleSidebarMini(true)"
|
|
14
|
+
>
|
|
15
|
+
<template v-if="isTablet">
|
|
16
|
+
<q-item :class="$style['tablet-logo']">
|
|
17
|
+
<q-item-section avatar>
|
|
18
|
+
<q-btn
|
|
19
|
+
round
|
|
20
|
+
unelevated
|
|
21
|
+
:class="$style['tablet-logo__btn']"
|
|
22
|
+
:icon="tabletLogoBtn"
|
|
23
|
+
@click="openDrawerIsTablet()"
|
|
24
|
+
/>
|
|
25
|
+
</q-item-section>
|
|
26
|
+
<q-item-section :class="$style['logo__text']">РИТМ</q-item-section>
|
|
27
|
+
</q-item>
|
|
28
|
+
</template>
|
|
29
|
+
<template v-else>
|
|
30
|
+
<q-item :class="$style.logo">
|
|
31
|
+
<q-item-section avatar>
|
|
32
|
+
<app-icon name="logo-icon" />
|
|
33
|
+
</q-item-section>
|
|
34
|
+
<q-item-section :class="$style['logo__text']">РИТМ</q-item-section>
|
|
35
|
+
</q-item>
|
|
36
|
+
<q-btn
|
|
37
|
+
dense
|
|
38
|
+
round
|
|
39
|
+
unelevated
|
|
40
|
+
class="q-mini-drawer-hide"
|
|
41
|
+
:class="$style['minify-btn']"
|
|
42
|
+
icon="chevron_left"
|
|
43
|
+
@click="isFixSidebar = !isFixSidebar"
|
|
44
|
+
>
|
|
45
|
+
<q-tooltip>Закрепить сайдбар</q-tooltip>
|
|
46
|
+
</q-btn>
|
|
47
|
+
</template>
|
|
48
|
+
<sidebar-menu :main="main" :menu-items="menuItems" :minify="isSidebarMini" :is-route-active="isRouteActive" />
|
|
49
|
+
<q-item v-ripple :class="$style['menu-exit']" clickable @click="logout()">
|
|
50
|
+
<q-item-section avatar>
|
|
51
|
+
<app-icon :name="'logout-icon'" color="white" size="24px" />
|
|
52
|
+
</q-item-section>
|
|
53
|
+
<q-item-section :class="$style['menu-exit__label']">Выход</q-item-section>
|
|
54
|
+
</q-item>
|
|
55
|
+
</q-drawer>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import { computed, defineProps, defineEmits, ref, watch, withDefaults } from 'vue'
|
|
60
|
+
import SidebarMenu from './components/SidebarMenu.vue'
|
|
61
|
+
|
|
62
|
+
import { useQuasar } from 'quasar'
|
|
63
|
+
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
64
|
+
|
|
65
|
+
interface Props {
|
|
66
|
+
isDrawer: boolean
|
|
67
|
+
minify?: boolean
|
|
68
|
+
menuItems?: any[]
|
|
69
|
+
main?: boolean
|
|
70
|
+
isRouteActive: (item: any) => boolean
|
|
71
|
+
}
|
|
72
|
+
const emits = defineEmits(['logout'])
|
|
73
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
74
|
+
main: false,
|
|
75
|
+
menuItems: () => [],
|
|
76
|
+
})
|
|
77
|
+
const $q = useQuasar()
|
|
78
|
+
|
|
79
|
+
const drawer = ref(true)
|
|
80
|
+
const isSidebarMini = ref(true)
|
|
81
|
+
const isFixSidebar = ref(false)
|
|
82
|
+
|
|
83
|
+
const isTablet = computed(() => $q.screen.lt.lg)
|
|
84
|
+
const tabletLogoBtn = computed(() => (isSidebarMini.value ? 'menu' : 'close'))
|
|
85
|
+
const drawerWidth = computed(() => (isTablet.value ? 250 : 275))
|
|
86
|
+
const drawerMiniWidth = computed(() => (isTablet.value ? 47 : 72))
|
|
87
|
+
|
|
88
|
+
function toggleSidebarMini(value: boolean): void {
|
|
89
|
+
if (!isFixSidebar.value && !isTablet.value) isSidebarMini.value = value
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function openDrawerIsTablet() {
|
|
93
|
+
isFixSidebar.value = !isFixSidebar.value
|
|
94
|
+
isSidebarMini.value = !isSidebarMini.value
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function logout(): void {
|
|
98
|
+
emits('logout')
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
watch(
|
|
102
|
+
() => isTablet.value,
|
|
103
|
+
(value: boolean) => {
|
|
104
|
+
isFixSidebar.value = value
|
|
105
|
+
},
|
|
106
|
+
)
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style lang="scss" module>
|
|
110
|
+
.drawer {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
height: 100vh;
|
|
114
|
+
background: linear-gradient(184deg, #0b3f8e 9.62%, #5386d3 59.23%, #5386d3 91.63%);
|
|
115
|
+
border-right: 1px solid #e4e6e8;
|
|
116
|
+
&::-webkit-scrollbar {
|
|
117
|
+
height: 4px;
|
|
118
|
+
width: 4px;
|
|
119
|
+
}
|
|
120
|
+
&::-webkit-scrollbar-thumb {
|
|
121
|
+
width: 4px;
|
|
122
|
+
height: 4px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.logo {
|
|
126
|
+
display: flex;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
margin: 24px 0;
|
|
129
|
+
&__text {
|
|
130
|
+
color: white;
|
|
131
|
+
font-size: 20px;
|
|
132
|
+
font-weight: 700;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
.tablet-logo {
|
|
136
|
+
border-bottom: 1px solid white;
|
|
137
|
+
&__btn {
|
|
138
|
+
color: white;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.minify-btn {
|
|
143
|
+
background: #0b3f8e;
|
|
144
|
+
color: white;
|
|
145
|
+
position: absolute;
|
|
146
|
+
top: 25px;
|
|
147
|
+
right: -17px;
|
|
148
|
+
|
|
149
|
+
&:global(.--mini) {
|
|
150
|
+
:global(.q-icon) {
|
|
151
|
+
transform: rotate(180deg);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.menu-exit {
|
|
157
|
+
border-top: 1px solid white;
|
|
158
|
+
:global(.q-item__section--avatar) {
|
|
159
|
+
min-width: 24px;
|
|
160
|
+
}
|
|
161
|
+
&__label {
|
|
162
|
+
color: #fff;
|
|
163
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
font-weight: 300;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|