shared-ritm 1.0.21 → 1.0.23
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 +1 -1
- package/dist/shared-ritm.umd.js +2 -2
- package/package.json +6 -5
- package/src/App.vue +8 -0
- package/src/api/services/GanttService.ts +17 -0
- package/src/api/services/MetricsService.ts +74 -0
- package/src/api/services/ProjectsService.ts +15 -0
- package/src/api/services/RepairsService.ts +76 -0
- package/src/api/services/TasksService.ts +15 -0
- package/src/api/settings/ApiService.ts +124 -0
- package/src/api/types/Api_Metrics.ts +0 -0
- package/src/api/types/Api_Repairs.ts +57 -0
- package/src/api/types/Api_Tasks.ts +99 -0
- package/src/common/app-button/AppButton.vue +156 -0
- package/src/common/app-input/AppInput.vue +168 -0
- package/src/common/app-layout/AppLayout.vue +61 -0
- package/src/common/app-layout/components/AppLayoutHeader.vue +114 -0
- package/src/common/app-select/AppSelect.vue +154 -0
- package/src/common/app-sidebar/AppSidebar.vue +162 -0
- package/src/common/app-sidebar/components/SidebarMenu.vue +27 -0
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +135 -0
- package/src/common/app-test-button/AppTestButton.vue +11 -0
- package/src/common/app-wrapper/AppWrapper.vue +25 -0
- package/src/global.d.ts +1 -0
- package/src/index.ts +19 -0
- package/src/main.ts +15 -0
- package/src/quasar-user-options.ts +17 -0
- package/src/shared/fonts/Montserrat.ttf +0 -0
- package/src/shared/fonts/NunitoSansFont.ttf +0 -0
- package/src/shared/styles/general.css +77 -0
- package/src/shims-vue.d.ts +5 -0
- package/src/styles/variables.sass +12 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-input
|
|
3
|
+
v-model="value"
|
|
4
|
+
standout
|
|
5
|
+
outlined
|
|
6
|
+
clearable
|
|
7
|
+
dense
|
|
8
|
+
bg-color="white"
|
|
9
|
+
:class="[$style['app-input'], itemClasses]"
|
|
10
|
+
:type="type"
|
|
11
|
+
:readonly="readonly || field"
|
|
12
|
+
:placeholder="label"
|
|
13
|
+
>
|
|
14
|
+
<template #prepend>
|
|
15
|
+
<q-icon>
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
17
|
+
<path
|
|
18
|
+
d="M11.5 21C16.7467 21 21 16.7467 21 11.5C21 6.25329 16.7467 2 11.5 2C6.25329 2 2 6.25329 2 11.5C2 16.7467 6.25329 21 11.5 21Z"
|
|
19
|
+
stroke="#404650"
|
|
20
|
+
stroke-width="1.5"
|
|
21
|
+
stroke-linecap="round"
|
|
22
|
+
stroke-linejoin="round"
|
|
23
|
+
/>
|
|
24
|
+
<path d="M22 22L20 20" stroke="#3F8CFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
25
|
+
</svg>
|
|
26
|
+
</q-icon>
|
|
27
|
+
</template>
|
|
28
|
+
</q-input>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script lang="ts" setup>
|
|
32
|
+
import { defineProps, defineEmits, computed, withDefaults } from 'vue'
|
|
33
|
+
|
|
34
|
+
import { ValidationRule, VueClassProp, VueStyleProp } from 'quasar/dist/types/api'
|
|
35
|
+
|
|
36
|
+
interface AppQInputProps {
|
|
37
|
+
name?: string | undefined
|
|
38
|
+
mask?: string | undefined
|
|
39
|
+
fillMask?: boolean | string | undefined
|
|
40
|
+
reverseFillMask?: boolean | undefined
|
|
41
|
+
unmaskedValue?: boolean | undefined
|
|
42
|
+
modelValue: string | number | null | undefined
|
|
43
|
+
error?: boolean | undefined
|
|
44
|
+
errorMessage?: string | undefined
|
|
45
|
+
noErrorIcon?: boolean | undefined
|
|
46
|
+
rules?: ValidationRule[] | undefined
|
|
47
|
+
reactiveRules?: boolean | undefined
|
|
48
|
+
lazyRules?: boolean | 'ondemand' | undefined
|
|
49
|
+
label?: string | undefined
|
|
50
|
+
stackLabel?: boolean | undefined
|
|
51
|
+
hint?: string | undefined
|
|
52
|
+
hideHint?: boolean | undefined
|
|
53
|
+
prefix?: string | undefined
|
|
54
|
+
suffix?: string | undefined
|
|
55
|
+
labelColor?: string | undefined
|
|
56
|
+
color?: string | undefined
|
|
57
|
+
bgColor?: string | undefined
|
|
58
|
+
dark?: boolean | undefined
|
|
59
|
+
loading?: boolean | undefined
|
|
60
|
+
clearable?: boolean | undefined
|
|
61
|
+
clearIcon?: string | undefined
|
|
62
|
+
filled?: boolean | undefined
|
|
63
|
+
outlined?: boolean | undefined
|
|
64
|
+
borderless?: boolean | undefined
|
|
65
|
+
bordered?: boolean | undefined
|
|
66
|
+
standout?: boolean | string | undefined
|
|
67
|
+
labelSlot?: boolean | undefined
|
|
68
|
+
bottomSlots?: boolean | undefined
|
|
69
|
+
hideBottomSpace?: boolean | undefined
|
|
70
|
+
counter?: boolean | undefined
|
|
71
|
+
rounded?: boolean | undefined
|
|
72
|
+
square?: boolean | undefined
|
|
73
|
+
dense?: boolean | undefined
|
|
74
|
+
itemAligned?: boolean | undefined
|
|
75
|
+
disable?: boolean | undefined
|
|
76
|
+
readonly?: boolean | undefined
|
|
77
|
+
autofocus?: boolean | undefined
|
|
78
|
+
for?: string | undefined
|
|
79
|
+
shadowText?: string | undefined
|
|
80
|
+
type?:
|
|
81
|
+
| 'text'
|
|
82
|
+
| 'password'
|
|
83
|
+
| 'textarea'
|
|
84
|
+
| 'email'
|
|
85
|
+
| 'search'
|
|
86
|
+
| 'tel'
|
|
87
|
+
| 'file'
|
|
88
|
+
| 'number'
|
|
89
|
+
| 'url'
|
|
90
|
+
| 'time'
|
|
91
|
+
| 'date'
|
|
92
|
+
| undefined
|
|
93
|
+
debounce?: string | number | undefined
|
|
94
|
+
maxlength?: string | number | undefined
|
|
95
|
+
autogrow?: boolean | undefined
|
|
96
|
+
inputClass?: VueClassProp | undefined
|
|
97
|
+
inputStyle?: VueStyleProp | undefined
|
|
98
|
+
onClear?: (value: any) => void
|
|
99
|
+
'onUpdate:modelValue'?: (value: string | number | null) => void
|
|
100
|
+
onFocus?: (evt: Event) => void
|
|
101
|
+
onBlur?: (evt: Event) => void
|
|
102
|
+
onClick?: (evt: Event) => void
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface AppInputProps extends AppQInputProps {
|
|
106
|
+
field?: boolean
|
|
107
|
+
required?: boolean
|
|
108
|
+
datePicker?: boolean
|
|
109
|
+
timePicker?: boolean
|
|
110
|
+
dateLocale?: any
|
|
111
|
+
withIcon?: boolean
|
|
112
|
+
iconName?: string
|
|
113
|
+
iconColor?: string
|
|
114
|
+
withButton?: boolean
|
|
115
|
+
buttonIcon?: string
|
|
116
|
+
buttonTooltip?: string
|
|
117
|
+
clearTooltip?: string
|
|
118
|
+
withArrow?: boolean
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const props = withDefaults(defineProps<AppInputProps>(), {
|
|
122
|
+
dense: true,
|
|
123
|
+
outlined: true,
|
|
124
|
+
error: undefined,
|
|
125
|
+
modelValue: '',
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const emit = defineEmits(['update:modelValue', 'button-click', 'clear', 'focus', 'blur', 'click'])
|
|
129
|
+
|
|
130
|
+
const value = computed({
|
|
131
|
+
get: () =>
|
|
132
|
+
props.modelValue !== null && props.modelValue !== undefined && props.type === 'number'
|
|
133
|
+
? +props.modelValue
|
|
134
|
+
: props.modelValue,
|
|
135
|
+
set: (newValue: any) => emit('update:modelValue', props.type === 'number' ? +newValue : newValue),
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const itemClasses = computed(() => ({
|
|
139
|
+
'--dense': props.dense,
|
|
140
|
+
'--bordered': props.bordered,
|
|
141
|
+
}))
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<style lang="scss" module>
|
|
145
|
+
.app-input {
|
|
146
|
+
&:global(.q-field--outlined .q-field__control) {
|
|
147
|
+
border-radius: 14px;
|
|
148
|
+
height: 48px;
|
|
149
|
+
align-items: center;
|
|
150
|
+
padding: 0 16px;
|
|
151
|
+
color: #87caff;
|
|
152
|
+
}
|
|
153
|
+
:global(.q-field__control-container) {
|
|
154
|
+
margin-left: 8px;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
@media (max-width: 1440px) {
|
|
158
|
+
.app-input {
|
|
159
|
+
&:global(.q-field--outlined .q-field__control) {
|
|
160
|
+
height: 40px;
|
|
161
|
+
padding: 0 12px;
|
|
162
|
+
}
|
|
163
|
+
:global(.q-field__control-container) {
|
|
164
|
+
margin-left: 6px;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-layout :class="$style.layout" view="lHh LpR fFf">
|
|
3
|
+
<div v-if="logged" :class="$style['loader-backdrop']">
|
|
4
|
+
<q-spinner size="md" color="white" :class="$style['loader-spinner']" />
|
|
5
|
+
</div>
|
|
6
|
+
<slot name="drawer"></slot>
|
|
7
|
+
<slot name="header"></slot>
|
|
8
|
+
<q-page-container :class="{ container: container }" @wheel="mouseMove">
|
|
9
|
+
<q-page>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
|
|
12
|
+
<slot name="page-bottom"></slot>
|
|
13
|
+
</q-page>
|
|
14
|
+
</q-page-container>
|
|
15
|
+
|
|
16
|
+
<slot name="footer"></slot>
|
|
17
|
+
</q-layout>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import { defineProps } from 'vue'
|
|
22
|
+
// import LoaderGeneral from '@g/src/components/General/LoaderGeneral.vue'
|
|
23
|
+
interface LayoutProps {
|
|
24
|
+
logged: boolean
|
|
25
|
+
console?: boolean
|
|
26
|
+
container?: boolean
|
|
27
|
+
padding?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const props = defineProps<LayoutProps>()
|
|
31
|
+
|
|
32
|
+
function mouseMove(e: any) {
|
|
33
|
+
const content = document.getElementById('content')
|
|
34
|
+
const scrollable = e.target
|
|
35
|
+
if (content && !scrollable.closest('#content')) {
|
|
36
|
+
content.scrollBy({ top: e.deltaY })
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style lang="scss" module>
|
|
42
|
+
.layout {
|
|
43
|
+
position: relative;
|
|
44
|
+
background: linear-gradient(235deg, #87caff 9.16%, #5386d3 45.8%, #0b3f8e 92.27%);
|
|
45
|
+
}
|
|
46
|
+
.loader {
|
|
47
|
+
&-backdrop {
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
background-color: rgba(255, 255, 255, 0.45);
|
|
51
|
+
position: absolute;
|
|
52
|
+
z-index: 9999;
|
|
53
|
+
}
|
|
54
|
+
&-spinner {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 50%;
|
|
57
|
+
left: 50%;
|
|
58
|
+
z-index: 2;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-header :class="$style.header">
|
|
3
|
+
<q-toolbar :class="$style.toolbar">
|
|
4
|
+
<!-- <app-input v-model.trim="text" type="text" label="Поиск по системе" :class="$style['header-search']" />-->
|
|
5
|
+
<div :class="$style['action-buttons']">
|
|
6
|
+
<slot name="filters-actions"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div :class="$style['action-buttons']">
|
|
10
|
+
<slot name="action-buttons"></slot>
|
|
11
|
+
|
|
12
|
+
<app-button icon="person" text-color="black" :label="shortName" rounded :class="$style['button-person']" />
|
|
13
|
+
<!-- <app-button :class="$style.button" rounded>-->
|
|
14
|
+
<!-- <small-caps-icon />-->
|
|
15
|
+
<!-- </app-button>-->
|
|
16
|
+
<!-- <app-button :class="$style.button" rounded>-->
|
|
17
|
+
<!-- <search-status-icon />-->
|
|
18
|
+
<!-- </app-button>-->
|
|
19
|
+
<!-- <app-button @click="counter++" :class="$style.button" rounded :badge="`+${counter}`" badge-color="#3F8CFF">-->
|
|
20
|
+
<!-- <flash-icon />-->
|
|
21
|
+
<!-- </app-button>-->
|
|
22
|
+
<!-- <app-button :class="$style.button" rounded>-->
|
|
23
|
+
<!-- <notification-icon />-->
|
|
24
|
+
<!-- </app-button>-->
|
|
25
|
+
</div>
|
|
26
|
+
</q-toolbar>
|
|
27
|
+
</q-header>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import { computed } from 'vue'
|
|
32
|
+
//import AppInput from '@/common/app-input/AppInput.vue'
|
|
33
|
+
import AppButton from '@/common/app-button/AppButton.vue'
|
|
34
|
+
import { storeToRefs } from 'pinia'
|
|
35
|
+
import { useAuthStore } from '@/pinia/auth/useAuthStore'
|
|
36
|
+
//import SmallCapsIcon from '@/icons/header/smallCapsIcon.vue'
|
|
37
|
+
//import SearchStatusIcon from '@/icons/header/searchStatusIcon.vue'
|
|
38
|
+
//import FlashIcon from '@/icons/header/flashIcon.vue'
|
|
39
|
+
//import NotificationIcon from '@/icons/header/notificationIcon.vue'
|
|
40
|
+
|
|
41
|
+
const { userData } = storeToRefs(useAuthStore())
|
|
42
|
+
|
|
43
|
+
// const counter = ref(1)
|
|
44
|
+
const shortName = computed(
|
|
45
|
+
() => `${userData.value?.last_name} ${userData.value?.first_name?.[0]}. ${userData.value?.patronymic?.[0]}.`,
|
|
46
|
+
)
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style lang="scss" module>
|
|
50
|
+
.header {
|
|
51
|
+
height: 100px;
|
|
52
|
+
background: transparent;
|
|
53
|
+
margin: 0 auto;
|
|
54
|
+
max-width: 1300px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.toolbar {
|
|
58
|
+
padding: 0;
|
|
59
|
+
min-height: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.header-search {
|
|
63
|
+
width: 412px;
|
|
64
|
+
font-size: 16px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.action-buttons {
|
|
68
|
+
flex: 1;
|
|
69
|
+
position: relative;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
column-gap: 16px;
|
|
73
|
+
justify-content: end;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.button {
|
|
77
|
+
padding: 12px;
|
|
78
|
+
background: white;
|
|
79
|
+
transition: all 0.3s ease, color 0.3s ease;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.button-person {
|
|
83
|
+
padding: 10px 14px;
|
|
84
|
+
background: white;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (max-width: 1440px) {
|
|
88
|
+
.header {
|
|
89
|
+
height: 100px;
|
|
90
|
+
background: transparent;
|
|
91
|
+
margin: 0 auto;
|
|
92
|
+
max-width: 874px;
|
|
93
|
+
}
|
|
94
|
+
.header-search {
|
|
95
|
+
width: 343px;
|
|
96
|
+
font-size: 16px;
|
|
97
|
+
}
|
|
98
|
+
.action-buttons {
|
|
99
|
+
position: relative;
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
column-gap: 8px;
|
|
103
|
+
}
|
|
104
|
+
.button {
|
|
105
|
+
padding: 10px;
|
|
106
|
+
background: white;
|
|
107
|
+
transition: all 0.3s ease, color 0.3s ease;
|
|
108
|
+
}
|
|
109
|
+
.button-person {
|
|
110
|
+
padding: 8px 10px;
|
|
111
|
+
background: white;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,154 @@
|
|
|
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
|
|
15
|
+
:class="[$style.select]"
|
|
16
|
+
:label="label"
|
|
17
|
+
input-debounce="100"
|
|
18
|
+
:popup-content-class="$style['app-select__menu']"
|
|
19
|
+
rounded
|
|
20
|
+
autocomplete=""
|
|
21
|
+
@filter="filterFn"
|
|
22
|
+
>
|
|
23
|
+
<template v-if="multiple" #selected-item="scope">
|
|
24
|
+
<q-chip
|
|
25
|
+
v-if="scope.opt"
|
|
26
|
+
removable
|
|
27
|
+
class="q-ma-none"
|
|
28
|
+
dense
|
|
29
|
+
:tabindex="scope.tabindex"
|
|
30
|
+
color="white"
|
|
31
|
+
text-color="secondary"
|
|
32
|
+
@remove="scope.removeAtIndex(scope.index)"
|
|
33
|
+
>
|
|
34
|
+
{{ scope.opt[`${optionLabel}`] }}
|
|
35
|
+
</q-chip>
|
|
36
|
+
</template>
|
|
37
|
+
<template #no-option>
|
|
38
|
+
<q-item>{{ emptyText }}</q-item>
|
|
39
|
+
</template>
|
|
40
|
+
<q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
|
|
41
|
+
</q-select>
|
|
42
|
+
</template>
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
|
|
45
|
+
|
|
46
|
+
import { QSelect } from 'quasar'
|
|
47
|
+
|
|
48
|
+
type Option = Record<string, any>
|
|
49
|
+
|
|
50
|
+
interface AppQSelectProps {
|
|
51
|
+
modelValue: any
|
|
52
|
+
options: Option[]
|
|
53
|
+
placeholder: string
|
|
54
|
+
emptyText: string
|
|
55
|
+
optionLabel?: string
|
|
56
|
+
optionValue?: string
|
|
57
|
+
label?: string
|
|
58
|
+
multiple?: boolean
|
|
59
|
+
borderColor: string
|
|
60
|
+
isDisabled?: boolean
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const props = defineProps<AppQSelectProps>()
|
|
64
|
+
const select = ref({})
|
|
65
|
+
const emit = defineEmits(['update:modelValue'])
|
|
66
|
+
const selected = computed({
|
|
67
|
+
get() {
|
|
68
|
+
return props.modelValue
|
|
69
|
+
},
|
|
70
|
+
set(value) {
|
|
71
|
+
emit('update:modelValue', value)
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const type = () => {
|
|
76
|
+
if (Array.isArray(selected.value) && !selected.value.length) return true
|
|
77
|
+
return typeof selected.value === 'string' && !selected.value
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const lcText: Ref<string> = ref('')
|
|
81
|
+
const filteredOptions = computed(() => {
|
|
82
|
+
return props.options.filter(x => x[props?.optionLabel || 'label'].toLowerCase().includes(lcText.value))
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
function filterFn(val: string, update: (arg0: () => void) => void) {
|
|
86
|
+
update(() => {
|
|
87
|
+
lcText.value = val.toLowerCase()
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
<style module lang="scss">
|
|
92
|
+
.wrap {
|
|
93
|
+
position: relative;
|
|
94
|
+
|
|
95
|
+
&:global(.--option-tree) {
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.select {
|
|
101
|
+
&:global(.q-field--outlined.q-field--rounded .q-field__control) {
|
|
102
|
+
border-radius: 14px;
|
|
103
|
+
}
|
|
104
|
+
&:global(.q-field--outlined .q-field__control:before) {
|
|
105
|
+
border-color: v-bind(borderColor);
|
|
106
|
+
}
|
|
107
|
+
&:global(.q-select .q-field__input) {
|
|
108
|
+
padding: 0 6px;
|
|
109
|
+
}
|
|
110
|
+
//&:global(.q-field--filled .q-field__control) {
|
|
111
|
+
// //color: red;
|
|
112
|
+
//}
|
|
113
|
+
//&:global(.q-field--filled.q-field--focused .q-field__control) {
|
|
114
|
+
//}
|
|
115
|
+
//&:global(.q-field--filled .q-field__control:after) {
|
|
116
|
+
// left: 8px;
|
|
117
|
+
// right: 8px;
|
|
118
|
+
//}
|
|
119
|
+
&:global(.q-field--outlined .q-item) {
|
|
120
|
+
color: #1d1d1d;
|
|
121
|
+
position: absolute;
|
|
122
|
+
padding: 0 4px;
|
|
123
|
+
top: 18px;
|
|
124
|
+
left: 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.append-wrapper {
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
column-gap: 4px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.menu-wrap {
|
|
135
|
+
padding: 8px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.search-wrapper {
|
|
139
|
+
position: sticky;
|
|
140
|
+
top: 0;
|
|
141
|
+
padding: 4px;
|
|
142
|
+
background: var(--main-bg);
|
|
143
|
+
z-index: 1;
|
|
144
|
+
}
|
|
145
|
+
.app-select__menu {
|
|
146
|
+
border-radius: 14px;
|
|
147
|
+
.q-item__label {
|
|
148
|
+
word-break: break-word;
|
|
149
|
+
}
|
|
150
|
+
&:global(.q-menu) {
|
|
151
|
+
max-height: 200px !important;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
</style>
|
|
@@ -0,0 +1,162 @@
|
|
|
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 :menu-items="menuItems" :minify="isSidebarMini" />
|
|
49
|
+
<q-item :class="$style['menu-exit']" clickable v-ripple @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, onMounted, ref, watch } 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
|
+
}
|
|
70
|
+
const props = defineProps<Props>()
|
|
71
|
+
const $q = useQuasar()
|
|
72
|
+
|
|
73
|
+
const drawer = ref(true)
|
|
74
|
+
const isSidebarMini = ref(true)
|
|
75
|
+
const isFixSidebar = ref(false)
|
|
76
|
+
|
|
77
|
+
const isTablet = computed(() => $q.screen.lt.lg)
|
|
78
|
+
const tabletLogoBtn = computed(() => (isSidebarMini.value ? 'menu' : 'close'))
|
|
79
|
+
const drawerWidth = computed(() => (isTablet.value ? 250 : 275))
|
|
80
|
+
const drawerMiniWidth = computed(() => (isTablet.value ? 47 : 72))
|
|
81
|
+
|
|
82
|
+
function toggleSidebarMini(value: boolean): void {
|
|
83
|
+
if (!isFixSidebar.value && !isTablet.value) isSidebarMini.value = value
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function openDrawerIsTablet() {
|
|
87
|
+
isFixSidebar.value = !isFixSidebar.value
|
|
88
|
+
isSidebarMini.value = !isSidebarMini.value
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function logout(): void {
|
|
92
|
+
window.location.href = '/sign-out'
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
watch(
|
|
96
|
+
() => isTablet.value,
|
|
97
|
+
(value: boolean) => {
|
|
98
|
+
isFixSidebar.value = value
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<style lang="scss" module>
|
|
104
|
+
.drawer {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
height: 100vh;
|
|
108
|
+
background: linear-gradient(184deg, #0b3f8e 9.62%, #5386d3 59.23%, #5386d3 91.63%);
|
|
109
|
+
border-right: 1px solid #e4e6e8;
|
|
110
|
+
&::-webkit-scrollbar {
|
|
111
|
+
height: 4px;
|
|
112
|
+
width: 4px;
|
|
113
|
+
}
|
|
114
|
+
&::-webkit-scrollbar-thumb {
|
|
115
|
+
width: 4px;
|
|
116
|
+
height: 4px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
.logo {
|
|
120
|
+
display: flex;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
margin: 24px 0;
|
|
123
|
+
&__text {
|
|
124
|
+
color: white;
|
|
125
|
+
font-size: 20px;
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
.tablet-logo {
|
|
130
|
+
border-bottom: 1px solid white;
|
|
131
|
+
&__btn {
|
|
132
|
+
color: white;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.minify-btn {
|
|
137
|
+
background: #0b3f8e;
|
|
138
|
+
color: white;
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: 25px;
|
|
141
|
+
right: -17px;
|
|
142
|
+
|
|
143
|
+
&:global(.--mini) {
|
|
144
|
+
:global(.q-icon) {
|
|
145
|
+
transform: rotate(180deg);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.menu-exit {
|
|
151
|
+
border-top: 1px solid white;
|
|
152
|
+
:global(.q-item__section--avatar) {
|
|
153
|
+
min-width: 24px;
|
|
154
|
+
}
|
|
155
|
+
&__label {
|
|
156
|
+
color: #fff;
|
|
157
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
158
|
+
font-size: 16px;
|
|
159
|
+
font-weight: 300;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.wrapper">
|
|
3
|
+
<sidebar-menu-item v-for="(item, index) in menuItems" :key="index" :item="item" :minify="minify" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { defineProps } from 'vue'
|
|
9
|
+
import SidebarMenuItem from './SidebarMenuItem.vue'
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
menuItems?: any[]
|
|
13
|
+
minify?: boolean
|
|
14
|
+
}
|
|
15
|
+
const props = defineProps<Props>()
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style lang="scss" module>
|
|
19
|
+
.wrapper {
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
overflow-x: hidden;
|
|
22
|
+
flex-grow: 1;
|
|
23
|
+
:global(.q-item) {
|
|
24
|
+
min-height: 54px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</style>
|