shared-ritm 1.2.16 → 1.2.18
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 +2923 -2909
- package/dist/shared-ritm.umd.js +7 -7
- package/package.json +1 -1
- package/src/App.vue +2445 -2455
- package/src/api/services/GanttService.ts +17 -17
- package/src/api/services/MetricsService.ts +101 -101
- package/src/api/services/ProjectsService.ts +67 -67
- package/src/api/settings/ApiService.ts +126 -126
- 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-checkbox/AppCheckbox.vue +26 -26
- package/src/common/app-date-picker/AppDatePicker.vue +81 -81
- package/src/common/app-dialogs/AppConfirmDialog.vue +100 -100
- package/src/common/app-dropdown/AppDropdown.vue +31 -31
- package/src/common/app-input-search/AppInputSearch.vue +170 -170
- package/src/common/app-layout/AppLayout.vue +5 -1
- package/src/common/app-layout/components/AppLayoutHeader.vue +29 -41
- package/src/common/app-select/AppSelect.vue +157 -157
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +146 -146
- package/src/common/app-toggle/AppToggle.vue +23 -23
- package/src/common/app-wrapper/AppWrapper.vue +28 -28
- package/src/icons/dialogs/RemoveIcon.vue +12 -12
- package/src/icons/dialogs/SafetyIcon.vue +12 -12
- 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 +62 -62
- package/src/shared/styles/general.css +96 -96
- package/src/utils/confirm.ts +12 -12
- package/src/utils/notification.ts +9 -9
- package/src/common/app-layout/components/AppPageContent.vue +0 -32
|
@@ -1,33 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-header
|
|
2
|
+
<q-header :class="[$style.header, { [$style[`header-full`]]: fullWidth }]">
|
|
3
3
|
<q-toolbar :class="$style.toolbar">
|
|
4
|
-
<
|
|
4
|
+
<!-- <app-input-search v-model.trim="text" type="text" label="Поиск по системе" :class="$style['header-search']" />-->
|
|
5
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
|
+
|
|
6
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>-->
|
|
7
25
|
</div>
|
|
8
26
|
</q-toolbar>
|
|
9
27
|
</q-header>
|
|
10
28
|
</template>
|
|
11
29
|
|
|
12
30
|
<script lang="ts" setup>
|
|
13
|
-
import { computed, defineProps
|
|
31
|
+
import { computed, defineProps } from 'vue'
|
|
32
|
+
//import AppInput from '@/common/app-input-search/AppInputSearch.vue'
|
|
14
33
|
import AppButton from '@/common/app-button/AppButton.vue'
|
|
34
|
+
|
|
35
|
+
//import SmallCapsIcon from '@/icons/header/smallCapsIcon.vue'
|
|
36
|
+
//import SearchStatusIcon from '@/icons/header/searchStatusIcon.vue'
|
|
37
|
+
//import FlashIcon from '@/icons/header/flashIcon.vue'
|
|
38
|
+
//import NotificationIcon from '@/icons/header/notificationIcon.vue'
|
|
15
39
|
interface Props {
|
|
16
40
|
userData: any
|
|
17
41
|
fullWidth?: boolean
|
|
18
|
-
autoMargin?: boolean
|
|
19
|
-
pageTitle?: string
|
|
20
|
-
leftMini?: string
|
|
21
|
-
leftMax?: string
|
|
22
42
|
}
|
|
23
43
|
|
|
24
|
-
const props =
|
|
25
|
-
pageTitle: '',
|
|
26
|
-
leftMini: '100px',
|
|
27
|
-
leftMax: '30px',
|
|
28
|
-
})
|
|
44
|
+
const props = defineProps<Props>()
|
|
29
45
|
|
|
30
|
-
const hasPaddingLeft = ref(false)
|
|
31
46
|
// const counter = ref(1)
|
|
32
47
|
const shortName = computed(
|
|
33
48
|
() =>
|
|
@@ -35,27 +50,6 @@ const shortName = computed(
|
|
|
35
50
|
props.userData?.patronymic?.[0] ? '.' : ''
|
|
36
51
|
}`,
|
|
37
52
|
)
|
|
38
|
-
|
|
39
|
-
const marginLeft = computed(() => {
|
|
40
|
-
if (!props.autoMargin) return {}
|
|
41
|
-
return hasPaddingLeft.value ? { 'margin-left': props.leftMax } : { 'margin-left': props.leftMini }
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
function checkPaddingLeft() {
|
|
45
|
-
const el = document.querySelector('.q-header') as HTMLElement | null
|
|
46
|
-
if (el) {
|
|
47
|
-
const observer = new ResizeObserver(() => {
|
|
48
|
-
console.log(window.getComputedStyle(el).left)
|
|
49
|
-
hasPaddingLeft.value = window.getComputedStyle(el).left !== '0px'
|
|
50
|
-
})
|
|
51
|
-
observer.observe(el)
|
|
52
|
-
onBeforeUnmount(() => observer.disconnect())
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
onMounted(() => {
|
|
57
|
-
checkPaddingLeft()
|
|
58
|
-
})
|
|
59
53
|
</script>
|
|
60
54
|
|
|
61
55
|
<style lang="scss" module>
|
|
@@ -67,17 +61,11 @@ onMounted(() => {
|
|
|
67
61
|
}
|
|
68
62
|
.header-full {
|
|
69
63
|
max-width: 100%;
|
|
70
|
-
padding
|
|
64
|
+
padding: 0 20px;
|
|
71
65
|
}
|
|
72
66
|
.toolbar {
|
|
73
67
|
padding: 0;
|
|
74
68
|
min-height: 100%;
|
|
75
|
-
h1 {
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
font-size: 28px;
|
|
78
|
-
line-height: 100%;
|
|
79
|
-
font-family: Montserrat, sans-serif;
|
|
80
|
-
}
|
|
81
69
|
}
|
|
82
70
|
|
|
83
71
|
.header-search {
|
|
@@ -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>
|