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,179 +1,179 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="app-input-new">
|
|
3
|
-
<label v-if="label" class="app-input-new__label">
|
|
4
|
-
{{ label }}
|
|
5
|
-
<span v-if="required" class="required">*</span>
|
|
6
|
-
</label>
|
|
7
|
-
|
|
8
|
-
<q-input
|
|
9
|
-
v-model="model"
|
|
10
|
-
filled
|
|
11
|
-
:type="inputType"
|
|
12
|
-
:rules="rules"
|
|
13
|
-
:placeholder="placeholder"
|
|
14
|
-
:disable="disable"
|
|
15
|
-
:readonly="readonly"
|
|
16
|
-
:class="inputClass"
|
|
17
|
-
:error="error"
|
|
18
|
-
:autocomplete="autocomplete"
|
|
19
|
-
:debounce="debounce"
|
|
20
|
-
:loading="loading"
|
|
21
|
-
@blur="emit('blur')"
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
<template #append>
|
|
25
|
-
<slot name="append" />
|
|
26
|
-
<q-icon
|
|
27
|
-
v-if="type === 'password'"
|
|
28
|
-
:name="isVisiblePass ? 'visibility' : 'visibility_off'"
|
|
29
|
-
color="primary"
|
|
30
|
-
class="cursor-pointer"
|
|
31
|
-
@click="isVisiblePass = !isVisiblePass"
|
|
32
|
-
/>
|
|
33
|
-
<q-icon
|
|
34
|
-
v-if="clearable && (model || model === 0)"
|
|
35
|
-
name="close"
|
|
36
|
-
class="cursor-pointer clear-input"
|
|
37
|
-
@click="model = null"
|
|
38
|
-
/>
|
|
39
|
-
<q-btn
|
|
40
|
-
v-if="uuid && !disable && !readonly"
|
|
41
|
-
flat
|
|
42
|
-
no-caps
|
|
43
|
-
label="UUID"
|
|
44
|
-
size="sm"
|
|
45
|
-
class="q-ml-sm uuid-btn"
|
|
46
|
-
@click="model = uuidv4()"
|
|
47
|
-
/>
|
|
48
|
-
<q-icon
|
|
49
|
-
v-if="copyable"
|
|
50
|
-
name="content_copy"
|
|
51
|
-
class="cursor-pointer q-ml-sm copy-icon"
|
|
52
|
-
color="primary"
|
|
53
|
-
:disable="!model"
|
|
54
|
-
@click="copyToClipboard"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
</q-input>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script setup lang="ts">
|
|
62
|
-
import { defineEmits, defineProps, computed, ref } from 'vue'
|
|
63
|
-
import { uuidv4 } from '@/utils/helpers'
|
|
64
|
-
import { notificationSettings } from '@/utils/notification'
|
|
65
|
-
import { QInputProps, useQuasar } from 'quasar'
|
|
66
|
-
|
|
67
|
-
const props = defineProps<
|
|
68
|
-
QInputProps & {
|
|
69
|
-
modelValue?: string | number | null
|
|
70
|
-
label?: string
|
|
71
|
-
placeholder?: string
|
|
72
|
-
rules?: ((val: string | number | null | undefined) => boolean | string)[]
|
|
73
|
-
inputClass?: string
|
|
74
|
-
required?: boolean
|
|
75
|
-
readonly?: boolean
|
|
76
|
-
disable?: boolean
|
|
77
|
-
uuid?: boolean
|
|
78
|
-
clearable?: boolean
|
|
79
|
-
copyable?: boolean
|
|
80
|
-
error?: boolean
|
|
81
|
-
autocomplete?: string
|
|
82
|
-
debounce?: number
|
|
83
|
-
loading?: boolean
|
|
84
|
-
}
|
|
85
|
-
>()
|
|
86
|
-
|
|
87
|
-
const emit = defineEmits<{
|
|
88
|
-
(e: 'update:modelValue', val?: string | number | null): void
|
|
89
|
-
(e: 'blur', val?: string | number | null): void
|
|
90
|
-
}>()
|
|
91
|
-
|
|
92
|
-
const $q = useQuasar()
|
|
93
|
-
|
|
94
|
-
const isVisiblePass = ref(false)
|
|
95
|
-
|
|
96
|
-
const model = computed({
|
|
97
|
-
get: () => getValue(props.modelValue),
|
|
98
|
-
set: (newValue?: string | number | null) => emit('update:modelValue', getValue(newValue)),
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
const inputType = computed(() => (props.type === 'password' && isVisiblePass.value ? 'text' : props.type))
|
|
102
|
-
|
|
103
|
-
const getValue = (value?: string | number | null) => {
|
|
104
|
-
if (props.type === 'number') return value ? +value : value
|
|
105
|
-
|
|
106
|
-
return value
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const copyToClipboard = () => {
|
|
110
|
-
if (!model.value && model.value !== 0) return
|
|
111
|
-
|
|
112
|
-
navigator.clipboard.writeText(model.value.toString()).then(() => {
|
|
113
|
-
$q.notify(notificationSettings('success', 'Данные скопированы'))
|
|
114
|
-
})
|
|
115
|
-
}
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<style scoped lang="scss">
|
|
119
|
-
.app-input-new {
|
|
120
|
-
display: flex;
|
|
121
|
-
flex-direction: column;
|
|
122
|
-
margin-bottom: 15px;
|
|
123
|
-
|
|
124
|
-
&__label {
|
|
125
|
-
font-size: 14px;
|
|
126
|
-
font-weight: 700;
|
|
127
|
-
color: #7d8592;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.required {
|
|
131
|
-
color: #f65160;
|
|
132
|
-
font-weight: bold;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.clear-input {
|
|
136
|
-
color: #d8e0f0;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.uuid-btn {
|
|
140
|
-
height: 32px;
|
|
141
|
-
padding: 0 10px;
|
|
142
|
-
border: 1px solid #3f8cff;
|
|
143
|
-
color: #3f8cff;
|
|
144
|
-
font-weight: 700;
|
|
145
|
-
font-size: 14px;
|
|
146
|
-
background: white;
|
|
147
|
-
border-radius: 6px;
|
|
148
|
-
|
|
149
|
-
:deep(.block) {
|
|
150
|
-
line-height: normal;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
:deep(.q-placeholder) {
|
|
155
|
-
color: #7d8592;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
:deep(.q-field__control) {
|
|
159
|
-
min-height: 58px;
|
|
160
|
-
border-radius: 8px;
|
|
161
|
-
border: 1px solid #d8e0f0;
|
|
162
|
-
background: #fff;
|
|
163
|
-
box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
:deep(.q-field--filled .q-field__control:before) {
|
|
167
|
-
background: #fff !important;
|
|
168
|
-
border: none;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
:deep(.q-field--with-bottom) {
|
|
172
|
-
padding-bottom: 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
:deep(.q-field__bottom) {
|
|
176
|
-
padding: 0;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-input-new">
|
|
3
|
+
<label v-if="label" class="app-input-new__label">
|
|
4
|
+
{{ label }}
|
|
5
|
+
<span v-if="required" class="required">*</span>
|
|
6
|
+
</label>
|
|
7
|
+
|
|
8
|
+
<q-input
|
|
9
|
+
v-model="model"
|
|
10
|
+
filled
|
|
11
|
+
:type="inputType"
|
|
12
|
+
:rules="rules"
|
|
13
|
+
:placeholder="placeholder"
|
|
14
|
+
:disable="disable"
|
|
15
|
+
:readonly="readonly"
|
|
16
|
+
:class="inputClass"
|
|
17
|
+
:error="error"
|
|
18
|
+
:autocomplete="autocomplete"
|
|
19
|
+
:debounce="debounce"
|
|
20
|
+
:loading="loading"
|
|
21
|
+
@blur="emit('blur')"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
<template #append>
|
|
25
|
+
<slot name="append" />
|
|
26
|
+
<q-icon
|
|
27
|
+
v-if="type === 'password'"
|
|
28
|
+
:name="isVisiblePass ? 'visibility' : 'visibility_off'"
|
|
29
|
+
color="primary"
|
|
30
|
+
class="cursor-pointer"
|
|
31
|
+
@click="isVisiblePass = !isVisiblePass"
|
|
32
|
+
/>
|
|
33
|
+
<q-icon
|
|
34
|
+
v-if="clearable && (model || model === 0)"
|
|
35
|
+
name="close"
|
|
36
|
+
class="cursor-pointer clear-input"
|
|
37
|
+
@click="model = null"
|
|
38
|
+
/>
|
|
39
|
+
<q-btn
|
|
40
|
+
v-if="uuid && !disable && !readonly"
|
|
41
|
+
flat
|
|
42
|
+
no-caps
|
|
43
|
+
label="UUID"
|
|
44
|
+
size="sm"
|
|
45
|
+
class="q-ml-sm uuid-btn"
|
|
46
|
+
@click="model = uuidv4()"
|
|
47
|
+
/>
|
|
48
|
+
<q-icon
|
|
49
|
+
v-if="copyable"
|
|
50
|
+
name="content_copy"
|
|
51
|
+
class="cursor-pointer q-ml-sm copy-icon"
|
|
52
|
+
color="primary"
|
|
53
|
+
:disable="!model"
|
|
54
|
+
@click="copyToClipboard"
|
|
55
|
+
/>
|
|
56
|
+
</template>
|
|
57
|
+
</q-input>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { defineEmits, defineProps, computed, ref } from 'vue'
|
|
63
|
+
import { uuidv4 } from '@/utils/helpers'
|
|
64
|
+
import { notificationSettings } from '@/utils/notification'
|
|
65
|
+
import { QInputProps, useQuasar } from 'quasar'
|
|
66
|
+
|
|
67
|
+
const props = defineProps<
|
|
68
|
+
QInputProps & {
|
|
69
|
+
modelValue?: string | number | null
|
|
70
|
+
label?: string
|
|
71
|
+
placeholder?: string
|
|
72
|
+
rules?: ((val: string | number | null | undefined) => boolean | string)[]
|
|
73
|
+
inputClass?: string
|
|
74
|
+
required?: boolean
|
|
75
|
+
readonly?: boolean
|
|
76
|
+
disable?: boolean
|
|
77
|
+
uuid?: boolean
|
|
78
|
+
clearable?: boolean
|
|
79
|
+
copyable?: boolean
|
|
80
|
+
error?: boolean
|
|
81
|
+
autocomplete?: string
|
|
82
|
+
debounce?: number
|
|
83
|
+
loading?: boolean
|
|
84
|
+
}
|
|
85
|
+
>()
|
|
86
|
+
|
|
87
|
+
const emit = defineEmits<{
|
|
88
|
+
(e: 'update:modelValue', val?: string | number | null): void
|
|
89
|
+
(e: 'blur', val?: string | number | null): void
|
|
90
|
+
}>()
|
|
91
|
+
|
|
92
|
+
const $q = useQuasar()
|
|
93
|
+
|
|
94
|
+
const isVisiblePass = ref(false)
|
|
95
|
+
|
|
96
|
+
const model = computed({
|
|
97
|
+
get: () => getValue(props.modelValue),
|
|
98
|
+
set: (newValue?: string | number | null) => emit('update:modelValue', getValue(newValue)),
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const inputType = computed(() => (props.type === 'password' && isVisiblePass.value ? 'text' : props.type))
|
|
102
|
+
|
|
103
|
+
const getValue = (value?: string | number | null) => {
|
|
104
|
+
if (props.type === 'number') return value ? +value : value
|
|
105
|
+
|
|
106
|
+
return value
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const copyToClipboard = () => {
|
|
110
|
+
if (!model.value && model.value !== 0) return
|
|
111
|
+
|
|
112
|
+
navigator.clipboard.writeText(model.value.toString()).then(() => {
|
|
113
|
+
$q.notify(notificationSettings('success', 'Данные скопированы'))
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style scoped lang="scss">
|
|
119
|
+
.app-input-new {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
margin-bottom: 15px;
|
|
123
|
+
|
|
124
|
+
&__label {
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
color: #7d8592;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.required {
|
|
131
|
+
color: #f65160;
|
|
132
|
+
font-weight: bold;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.clear-input {
|
|
136
|
+
color: #d8e0f0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.uuid-btn {
|
|
140
|
+
height: 32px;
|
|
141
|
+
padding: 0 10px;
|
|
142
|
+
border: 1px solid #3f8cff;
|
|
143
|
+
color: #3f8cff;
|
|
144
|
+
font-weight: 700;
|
|
145
|
+
font-size: 14px;
|
|
146
|
+
background: white;
|
|
147
|
+
border-radius: 6px;
|
|
148
|
+
|
|
149
|
+
:deep(.block) {
|
|
150
|
+
line-height: normal;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:deep(.q-placeholder) {
|
|
155
|
+
color: #7d8592;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:deep(.q-field__control) {
|
|
159
|
+
min-height: 58px;
|
|
160
|
+
border-radius: 8px;
|
|
161
|
+
border: 1px solid #d8e0f0;
|
|
162
|
+
background: #fff;
|
|
163
|
+
box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:deep(.q-field--filled .q-field__control:before) {
|
|
167
|
+
background: #fff !important;
|
|
168
|
+
border: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:deep(.q-field--with-bottom) {
|
|
172
|
+
padding-bottom: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
:deep(.q-field__bottom) {
|
|
176
|
+
padding: 0;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
</style>
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-layout :class="$style.layout" view="lHh LpR fFf">
|
|
3
|
-
<div v-if="logged" :class="$style['loader-backdrop']">
|
|
4
|
-
<app-loader :loading="logged" size="md" :thickness="3" :backdrop="true" />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<slot name="drawer" />
|
|
8
|
-
<slot name="header" :style="marginLeft" />
|
|
9
|
-
|
|
10
|
-
<q-page-container :class="{ container: container }" @wheel="mouseMove">
|
|
11
|
-
<slot name="content" :style="marginLeft" />
|
|
12
|
-
</q-page-container>
|
|
13
|
-
|
|
14
|
-
<slot name="footer" />
|
|
15
|
-
</q-layout>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script lang="ts" setup>
|
|
19
|
-
import { computed, defineProps, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
20
|
-
import AppLoader from '@/common/app-loader/index.vue'
|
|
21
|
-
interface LayoutProps {
|
|
22
|
-
logged: boolean
|
|
23
|
-
console?: boolean
|
|
24
|
-
container?: boolean
|
|
25
|
-
padding?: string
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const props = defineProps<LayoutProps>()
|
|
29
|
-
|
|
30
|
-
const hasPaddingLeft = ref(false)
|
|
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
|
-
|
|
40
|
-
const marginLeft = computed(() => {
|
|
41
|
-
return hasPaddingLeft.value ? { 'margin-left': '0px' } : { 'margin-left': '72px' }
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
function checkPaddingLeft() {
|
|
45
|
-
const el = document.querySelector('.q-page-container') as HTMLElement | null
|
|
46
|
-
|
|
47
|
-
if (el) {
|
|
48
|
-
nextTick(() => {
|
|
49
|
-
const observer = new ResizeObserver(() => {
|
|
50
|
-
hasPaddingLeft.value = window.getComputedStyle(el).paddingLeft !== '0px'
|
|
51
|
-
})
|
|
52
|
-
observer.observe(el)
|
|
53
|
-
onBeforeUnmount(() => observer.disconnect())
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
onMounted(() => {
|
|
59
|
-
checkPaddingLeft()
|
|
60
|
-
})
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style lang="scss" module>
|
|
64
|
-
.layout {
|
|
65
|
-
position: relative;
|
|
66
|
-
background: linear-gradient(235deg, #87caff 9.16%, #5386d3 45.8%, #0b3f8e 92.27%);
|
|
67
|
-
}
|
|
68
|
-
.loader {
|
|
69
|
-
&-backdrop {
|
|
70
|
-
width: 100%;
|
|
71
|
-
height: 100%;
|
|
72
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
73
|
-
position: absolute;
|
|
74
|
-
right: 0;
|
|
75
|
-
z-index: 2999;
|
|
76
|
-
}
|
|
77
|
-
&-spinner {
|
|
78
|
-
position: absolute;
|
|
79
|
-
top: 50%;
|
|
80
|
-
left: 50%;
|
|
81
|
-
z-index: 2;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-layout :class="$style.layout" view="lHh LpR fFf">
|
|
3
|
+
<div v-if="logged" :class="$style['loader-backdrop']">
|
|
4
|
+
<app-loader :loading="logged" size="md" :thickness="3" :backdrop="true" />
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<slot name="drawer" />
|
|
8
|
+
<slot name="header" :style="marginLeft" />
|
|
9
|
+
|
|
10
|
+
<q-page-container :class="{ container: container }" @wheel="mouseMove">
|
|
11
|
+
<slot name="content" :style="marginLeft" />
|
|
12
|
+
</q-page-container>
|
|
13
|
+
|
|
14
|
+
<slot name="footer" />
|
|
15
|
+
</q-layout>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { computed, defineProps, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
20
|
+
import AppLoader from '@/common/app-loader/index.vue'
|
|
21
|
+
interface LayoutProps {
|
|
22
|
+
logged: boolean
|
|
23
|
+
console?: boolean
|
|
24
|
+
container?: boolean
|
|
25
|
+
padding?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const props = defineProps<LayoutProps>()
|
|
29
|
+
|
|
30
|
+
const hasPaddingLeft = ref(false)
|
|
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
|
+
|
|
40
|
+
const marginLeft = computed(() => {
|
|
41
|
+
return hasPaddingLeft.value ? { 'margin-left': '0px' } : { 'margin-left': '72px' }
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
function checkPaddingLeft() {
|
|
45
|
+
const el = document.querySelector('.q-page-container') as HTMLElement | null
|
|
46
|
+
|
|
47
|
+
if (el) {
|
|
48
|
+
nextTick(() => {
|
|
49
|
+
const observer = new ResizeObserver(() => {
|
|
50
|
+
hasPaddingLeft.value = window.getComputedStyle(el).paddingLeft !== '0px'
|
|
51
|
+
})
|
|
52
|
+
observer.observe(el)
|
|
53
|
+
onBeforeUnmount(() => observer.disconnect())
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
checkPaddingLeft()
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" module>
|
|
64
|
+
.layout {
|
|
65
|
+
position: relative;
|
|
66
|
+
background: linear-gradient(235deg, #87caff 9.16%, #5386d3 45.8%, #0b3f8e 92.27%);
|
|
67
|
+
}
|
|
68
|
+
.loader {
|
|
69
|
+
&-backdrop {
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
73
|
+
position: absolute;
|
|
74
|
+
right: 0;
|
|
75
|
+
z-index: 2999;
|
|
76
|
+
}
|
|
77
|
+
&-spinner {
|
|
78
|
+
position: absolute;
|
|
79
|
+
top: 50%;
|
|
80
|
+
left: 50%;
|
|
81
|
+
z-index: 2;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</style>
|