shared-ritm 1.3.132 → 1.3.133

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.
@@ -1,161 +1,186 @@
1
- import { Api_Tasks_Status_Dto } from '@/api/types/Api_Tasks'
2
- import { Api_Instrument } from '@/api/types/Api_Instruments'
3
- import { Api_Search_User_Passes, Api_Search_User_Positions } from '@/api/types/Api_Search'
4
-
5
- export type Api_User_Team = {
6
- id: string
7
- name: string
8
- display_name: string
9
- description: string
10
- created_at: string
11
- updated_at: string
12
- pivot?: {
13
- team_id: string
14
- user_id: string
15
- }
16
- roles?: Api_User_Role[]
17
- }
18
-
19
- export type Api_User_Team_Search = {
20
- id: string
21
- name: string
22
- display_name: string
23
- }
24
-
25
- export type Api_User_Photo = {
26
- id: string
27
- name: string
28
- path: string
29
- type: string
30
- }
31
-
32
- export type Api_User_Archive_History_Item = {
33
- user_id: string
34
- responsible_id: string
35
- archived_at: string
36
- reason: string | null
37
- restored_at: string | null
38
- }
39
-
40
- export type Api_User_Task = {
41
- id: string
42
- name: string
43
- project_id: string
44
- status: Api_Tasks_Status_Dto
45
- }
46
-
47
- export type Api_User = {
48
- id: string
49
- RFID: string
50
- avatar: unknown | null
51
- avatar_id: string | null
52
- change_password: string
53
- created_at: string
54
- updated_at: string
55
- deleted_at: string | null
56
- dismissal_at: string | null
57
- email_verified_at: string
58
- divisions: string
59
- email: string
60
- face_recognition_id: string | null
61
- first_name: string
62
- full_name: string
63
- last_name: string
64
- patronymic: string
65
- personnel_number: number
66
- phone: string
67
- profession: string
68
- teams: Api_User_Team[]
69
- photos: Api_User_Photo[]
70
- archiveHistory: Api_User_Archive_History_Item[]
71
- assigned_tasks?: Api_User_Task[]
72
- responsible_tasks?: Api_User_Task[]
73
- passes?: Api_Search_User_Passes[]
74
- positions: Api_Search_User_Positions[]
75
- warehouses?: Partial<Api_User_Warehouse>[]
76
- brigades: { id: string; name: string }[]
77
- password_change_available_at: string
78
- password_change_due_at: string
79
- password_last_changed_at: string
80
- has_video_analytics_photo?: boolean
81
- calc_performance_median?: number | null
82
- }
83
-
84
- export type Api_User_Change_Password_Payload = {
85
- email: string
86
- password: string
87
- currentPassword: string
88
- passwordConfirmation: string
89
- }
90
-
91
- export type Api_User_Create = {
92
- last_name?: string
93
- first_name?: string
94
- patronymic?: string
95
- email?: string
96
- phone?: string
97
- divisions?: string
98
- positions?: [string]
99
- teams?: {
100
- team_id: string
101
- roles: string[]
102
- }[]
103
- current_password?: string
104
- password?: string
105
- password_confirmation?: string
106
- }
107
-
108
- export type Api_User_Permission = {
109
- id: string
110
- name: string
111
- display_name: string
112
- }
113
-
114
- export type Api_User_Role = {
115
- id: string
116
- name: string
117
- display_name: string
118
- permissions?: Api_User_Permission[]
119
- }
120
-
121
- export type Api_User_Position_Type = 'admin' | 'worker' | null
122
-
123
- export type Api_User_Position = {
124
- id: string
125
- name: string
126
- display_name: string
127
- description?: string
128
- type?: Api_User_Position_Type
129
- }
130
-
131
- export type Api_User_Delete_Body = {
132
- user_id: string
133
- archive_reason?: string
134
- }
135
-
136
- export type Api_User_Delete_Photos_Body = {
137
- user_id: string
138
- photos?: string[]
139
- }
140
-
141
- export type Api_User_Warehouse = Pick<
142
- Api_Instrument,
143
- | 'id'
144
- | 'RFID'
145
- | 'instrument_type'
146
- | 'inventory_number'
147
- | 'location'
148
- | 'misplacement'
149
- | 'module'
150
- | 'name'
151
- | 'responsible'
152
- | 'status'
153
- | 'storage'
154
- | 'updated_at'
155
- > & {
156
- issued_in: string | null
157
- registry: {
158
- id: string
159
- title: string
160
- } | null
161
- }
1
+ import { Api_Tasks_Status_Dto } from '@/api/types/Api_Tasks'
2
+ import { Api_Instrument } from '@/api/types/Api_Instruments'
3
+ import { Api_Search_User_Passes, Api_Search_User_Positions } from '@/api/types/Api_Search'
4
+
5
+ export type Api_Visitor_Dto = {
6
+ id: string
7
+ entry_at: string
8
+ exit_at: null | string
9
+ in_zone: boolean
10
+ is_auto: boolean
11
+ user: {
12
+ id: string
13
+ email: string
14
+ full_name: string
15
+ divisions: string
16
+ }
17
+ task: {
18
+ id: string
19
+ name: string
20
+ state_id: string
21
+ project_id: string
22
+ status: {
23
+ id: string
24
+ name: string
25
+ title: string
26
+ }
27
+ }
28
+ }
29
+
30
+ export type Api_User_Team = {
31
+ id: string
32
+ name: string
33
+ display_name: string
34
+ description: string
35
+ created_at: string
36
+ updated_at: string
37
+ pivot?: {
38
+ team_id: string
39
+ user_id: string
40
+ }
41
+ roles?: Api_User_Role[]
42
+ }
43
+
44
+ export type Api_User_Team_Search = {
45
+ id: string
46
+ name: string
47
+ display_name: string
48
+ }
49
+
50
+ export type Api_User_Photo = {
51
+ id: string
52
+ name: string
53
+ path: string
54
+ type: string
55
+ }
56
+
57
+ export type Api_User_Archive_History_Item = {
58
+ user_id: string
59
+ responsible_id: string
60
+ archived_at: string
61
+ reason: string | null
62
+ restored_at: string | null
63
+ }
64
+
65
+ export type Api_User_Task = {
66
+ id: string
67
+ name: string
68
+ project_id: string
69
+ status: Api_Tasks_Status_Dto
70
+ }
71
+
72
+ export type Api_User = {
73
+ id: string
74
+ RFID: string
75
+ avatar: unknown | null
76
+ avatar_id: string | null
77
+ change_password: string
78
+ created_at: string
79
+ updated_at: string
80
+ deleted_at: string | null
81
+ dismissal_at: string | null
82
+ email_verified_at: string
83
+ divisions: string
84
+ email: string
85
+ face_recognition_id: string | null
86
+ first_name: string
87
+ full_name: string
88
+ last_name: string
89
+ patronymic: string
90
+ personnel_number: number
91
+ phone: string
92
+ profession: string
93
+ teams: Api_User_Team[]
94
+ photos: Api_User_Photo[]
95
+ archiveHistory: Api_User_Archive_History_Item[]
96
+ assigned_tasks?: Api_User_Task[]
97
+ responsible_tasks?: Api_User_Task[]
98
+ passes?: Api_Search_User_Passes[]
99
+ positions: Api_Search_User_Positions[]
100
+ warehouses?: Partial<Api_User_Warehouse>[]
101
+ brigades: { id: string; name: string }[]
102
+ password_change_available_at: string
103
+ password_change_due_at: string
104
+ password_last_changed_at: string
105
+ has_video_analytics_photo?: boolean
106
+ calc_performance_median?: number | null
107
+ }
108
+
109
+ export type Api_User_Change_Password_Payload = {
110
+ email: string
111
+ password: string
112
+ currentPassword: string
113
+ passwordConfirmation: string
114
+ }
115
+
116
+ export type Api_User_Create = {
117
+ last_name?: string
118
+ first_name?: string
119
+ patronymic?: string
120
+ email?: string
121
+ phone?: string
122
+ divisions?: string
123
+ positions?: [string]
124
+ teams?: {
125
+ team_id: string
126
+ roles: string[]
127
+ }[]
128
+ current_password?: string
129
+ password?: string
130
+ password_confirmation?: string
131
+ }
132
+
133
+ export type Api_User_Permission = {
134
+ id: string
135
+ name: string
136
+ display_name: string
137
+ }
138
+
139
+ export type Api_User_Role = {
140
+ id: string
141
+ name: string
142
+ display_name: string
143
+ permissions?: Api_User_Permission[]
144
+ }
145
+
146
+ export type Api_User_Position_Type = 'admin' | 'worker' | null
147
+
148
+ export type Api_User_Position = {
149
+ id: string
150
+ name: string
151
+ display_name: string
152
+ description?: string
153
+ type?: Api_User_Position_Type
154
+ }
155
+
156
+ export type Api_User_Delete_Body = {
157
+ user_id: string
158
+ archive_reason?: string
159
+ }
160
+
161
+ export type Api_User_Delete_Photos_Body = {
162
+ user_id: string
163
+ photos?: string[]
164
+ }
165
+
166
+ export type Api_User_Warehouse = Pick<
167
+ Api_Instrument,
168
+ | 'id'
169
+ | 'RFID'
170
+ | 'instrument_type'
171
+ | 'inventory_number'
172
+ | 'location'
173
+ | 'misplacement'
174
+ | 'module'
175
+ | 'name'
176
+ | 'responsible'
177
+ | 'status'
178
+ | 'storage'
179
+ | 'updated_at'
180
+ > & {
181
+ issued_in: string | null
182
+ registry: {
183
+ id: string
184
+ title: string
185
+ } | null
186
+ }
@@ -1,167 +1,167 @@
1
- <template>
2
- <q-select
3
- ref="select"
4
- v-model="selected"
5
- :data-test="dataTest"
6
- :options="filteredOptions"
7
- :option-value="optionValue"
8
- :option-label="optionLabel"
9
- emit-value
10
- map-options
11
- :disable="isDisabled"
12
- :multiple="multiple"
13
- outlined
14
- stack-label
15
- :use-input="search"
16
- :class="[$style.select]"
17
- :label="label"
18
- input-debounce="100"
19
- :popup-content-class="$style['app-select__menu']"
20
- :clearable="clearable"
21
- rounded
22
- autocomplete=""
23
- @filter="filterFn"
24
- >
25
- <template v-if="multiple && hideChips" #selected>
26
- <div v-if="Array.isArray(selected) && selected.length" class="q-field__input">
27
- <span class="selected-counter">Выбрано: {{ selected.length }} </span>
28
- </div>
29
- </template>
30
-
31
- <template v-else-if="multiple" #selected-item="scope">
32
- <q-chip
33
- v-if="scope.opt"
34
- removable
35
- class="q-ma-none"
36
- dense
37
- :tabindex="scope.tabindex"
38
- color="white"
39
- text-color="secondary"
40
- @remove="scope.removeAtIndex(scope.index)"
41
- >
42
- {{ scope.opt[`${optionLabel}`] }}
43
- </q-chip>
44
- </template>
45
- <template #no-option>
46
- <q-item>{{ emptyText }}</q-item>
47
- </template>
48
- <q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
49
- </q-select>
50
- </template>
51
- <script setup lang="ts">
52
- import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
53
-
54
- import { QSelect } from 'quasar'
55
-
56
- type Option = Record<string, any>
57
-
58
- interface AppQSelectProps {
59
- modelValue: any
60
- options: Option[]
61
- placeholder: string
62
- emptyText: string
63
- optionLabel?: string
64
- optionValue?: string
65
- label?: string
66
- multiple?: boolean
67
- borderColor: string
68
- isDisabled?: boolean
69
- clearable?: boolean
70
- search?: boolean
71
- dataTest?: string
72
- hideChips?: boolean
73
- }
74
-
75
- const props = defineProps<AppQSelectProps>()
76
- const select = ref({})
77
- const emit = defineEmits(['update:modelValue'])
78
- const selected = computed({
79
- get() {
80
- return props.modelValue
81
- },
82
- set(value) {
83
- emit('update:modelValue', value)
84
- },
85
- })
86
-
87
- const type = () => {
88
- if (Array.isArray(selected.value) || props.multiple) return !selected.value?.length
89
-
90
- return !selected.value
91
- }
92
-
93
- const lcText: Ref<string> = ref('')
94
- const filteredOptions = computed(() => {
95
- return props.options.filter(x => (x[props?.optionLabel || 'label'] || '-').toLowerCase().includes(lcText.value))
96
- })
97
-
98
- function filterFn(val: string, update: (arg0: () => void) => void) {
99
- update(() => {
100
- lcText.value = val.toLowerCase()
101
- })
102
- }
103
- </script>
104
- <style module lang="scss">
105
- .wrap {
106
- position: relative;
107
-
108
- &:global(.--option-tree) {
109
- cursor: pointer;
110
- }
111
- }
112
-
113
- .select {
114
- &:global(.q-field--outlined.q-field--rounded .q-field__control) {
115
- border-radius: 14px;
116
- }
117
- &:global(.q-field--outlined .q-field__control:before) {
118
- border-color: v-bind(borderColor);
119
- }
120
- &:global(.q-select .q-field__input) {
121
- padding: 0 6px;
122
- }
123
- //&:global(.q-field--filled .q-field__control) {
124
- // //color: red;
125
- //}
126
- //&:global(.q-field--filled.q-field--focused .q-field__control) {
127
- //}
128
- //&:global(.q-field--filled .q-field__control:after) {
129
- // left: 8px;
130
- // right: 8px;
131
- //}
132
- &:global(.q-field--outlined .q-item) {
133
- color: #1d1d1d;
134
- position: absolute;
135
- padding: 0 4px;
136
- top: 18px;
137
- left: 0;
138
- }
139
- }
140
-
141
- .append-wrapper {
142
- display: flex;
143
- align-items: center;
144
- column-gap: 4px;
145
- }
146
-
147
- .menu-wrap {
148
- padding: 8px;
149
- }
150
-
151
- .search-wrapper {
152
- position: sticky;
153
- top: 0;
154
- padding: 4px;
155
- background: var(--main-bg);
156
- z-index: 1;
157
- }
158
- .app-select__menu {
159
- border-radius: 14px;
160
- .q-item__label {
161
- word-break: break-word;
162
- }
163
- &:global(.q-menu) {
164
- max-height: 200px !important;
165
- }
166
- }
167
- </style>
1
+ <template>
2
+ <q-select
3
+ ref="select"
4
+ v-model="selected"
5
+ :data-test="dataTest"
6
+ :options="filteredOptions"
7
+ :option-value="optionValue"
8
+ :option-label="optionLabel"
9
+ emit-value
10
+ map-options
11
+ :disable="isDisabled"
12
+ :multiple="multiple"
13
+ outlined
14
+ stack-label
15
+ :use-input="search"
16
+ :class="[$style.select]"
17
+ :label="label"
18
+ input-debounce="100"
19
+ :popup-content-class="$style['app-select__menu']"
20
+ :clearable="clearable"
21
+ rounded
22
+ autocomplete=""
23
+ @filter="filterFn"
24
+ >
25
+ <template v-if="multiple && hideChips" #selected>
26
+ <div v-if="Array.isArray(selected) && selected.length" class="q-field__input">
27
+ <span class="selected-counter">Выбрано: {{ selected.length }} </span>
28
+ </div>
29
+ </template>
30
+
31
+ <template v-else-if="multiple" #selected-item="scope">
32
+ <q-chip
33
+ v-if="scope.opt"
34
+ removable
35
+ class="q-ma-none"
36
+ dense
37
+ :tabindex="scope.tabindex"
38
+ color="white"
39
+ text-color="secondary"
40
+ @remove="scope.removeAtIndex(scope.index)"
41
+ >
42
+ {{ scope.opt[`${optionLabel}`] }}
43
+ </q-chip>
44
+ </template>
45
+ <template #no-option>
46
+ <q-item>{{ emptyText }}</q-item>
47
+ </template>
48
+ <q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
49
+ </q-select>
50
+ </template>
51
+ <script setup lang="ts">
52
+ import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
53
+
54
+ import { QSelect } from 'quasar'
55
+
56
+ type Option = Record<string, any>
57
+
58
+ interface AppQSelectProps {
59
+ modelValue: any
60
+ options: Option[]
61
+ placeholder: string
62
+ emptyText: string
63
+ optionLabel?: string
64
+ optionValue?: string
65
+ label?: string
66
+ multiple?: boolean
67
+ borderColor: string
68
+ isDisabled?: boolean
69
+ clearable?: boolean
70
+ search?: boolean
71
+ dataTest?: string
72
+ hideChips?: boolean
73
+ }
74
+
75
+ const props = defineProps<AppQSelectProps>()
76
+ const select = ref({})
77
+ const emit = defineEmits(['update:modelValue'])
78
+ const selected = computed({
79
+ get() {
80
+ return props.modelValue
81
+ },
82
+ set(value) {
83
+ emit('update:modelValue', value)
84
+ },
85
+ })
86
+
87
+ const type = () => {
88
+ if (Array.isArray(selected.value) || props.multiple) return !selected.value?.length
89
+
90
+ return !selected.value
91
+ }
92
+
93
+ const lcText: Ref<string> = ref('')
94
+ const filteredOptions = computed(() => {
95
+ return props.options.filter(x => (x[props?.optionLabel || 'label'] || '-').toLowerCase().includes(lcText.value))
96
+ })
97
+
98
+ function filterFn(val: string, update: (arg0: () => void) => void) {
99
+ update(() => {
100
+ lcText.value = val.toLowerCase()
101
+ })
102
+ }
103
+ </script>
104
+ <style module lang="scss">
105
+ .wrap {
106
+ position: relative;
107
+
108
+ &:global(.--option-tree) {
109
+ cursor: pointer;
110
+ }
111
+ }
112
+
113
+ .select {
114
+ &:global(.q-field--outlined.q-field--rounded .q-field__control) {
115
+ border-radius: 14px;
116
+ }
117
+ &:global(.q-field--outlined .q-field__control:before) {
118
+ border-color: v-bind(borderColor);
119
+ }
120
+ &:global(.q-select .q-field__input) {
121
+ padding: 0 6px;
122
+ }
123
+ //&:global(.q-field--filled .q-field__control) {
124
+ // //color: red;
125
+ //}
126
+ //&:global(.q-field--filled.q-field--focused .q-field__control) {
127
+ //}
128
+ //&:global(.q-field--filled .q-field__control:after) {
129
+ // left: 8px;
130
+ // right: 8px;
131
+ //}
132
+ &:global(.q-field--outlined .q-item) {
133
+ color: #1d1d1d;
134
+ position: absolute;
135
+ padding: 0 4px;
136
+ top: 18px;
137
+ left: 0;
138
+ }
139
+ }
140
+
141
+ .append-wrapper {
142
+ display: flex;
143
+ align-items: center;
144
+ column-gap: 4px;
145
+ }
146
+
147
+ .menu-wrap {
148
+ padding: 8px;
149
+ }
150
+
151
+ .search-wrapper {
152
+ position: sticky;
153
+ top: 0;
154
+ padding: 4px;
155
+ background: var(--main-bg);
156
+ z-index: 1;
157
+ }
158
+ .app-select__menu {
159
+ border-radius: 14px;
160
+ .q-item__label {
161
+ word-break: break-word;
162
+ }
163
+ &:global(.q-menu) {
164
+ max-height: 200px !important;
165
+ }
166
+ }
167
+ </style>