shared-ritm 1.2.153 → 1.2.154

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.
Files changed (50) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +12 -14
  3. package/dist/shared-ritm.umd.js +6 -6
  4. package/dist/types/api/services/ComentsServise.d.ts +10 -0
  5. package/dist/types/api/services/PhotoService.d.ts +51 -38
  6. package/dist/types/api/types/Api_Tasks.d.ts +1 -0
  7. package/dist/types/api/types/Api_Users.d.ts +43 -0
  8. package/package.json +64 -64
  9. package/src/api/services/BrigadesService.ts +32 -32
  10. package/src/api/services/ControlsService.ts +92 -92
  11. package/src/api/services/EquipmentService.ts +29 -29
  12. package/src/api/services/InstrumentsService.ts +63 -63
  13. package/src/api/services/MetricsService.ts +110 -110
  14. package/src/api/services/ModulesService.ts +27 -27
  15. package/src/api/services/ProjectsService.ts +83 -83
  16. package/src/api/services/RepairsService.ts +124 -124
  17. package/src/api/services/ScheduleService.ts +69 -69
  18. package/src/api/services/SearchService.ts +22 -22
  19. package/src/api/services/UserService.ts +113 -113
  20. package/src/api/services/VideoService.ts +108 -108
  21. package/src/api/settings/ApiService.ts +124 -124
  22. package/src/api/types/Api_Auth.ts +105 -105
  23. package/src/api/types/Api_Brigades.ts +36 -36
  24. package/src/api/types/Api_Controls.ts +111 -111
  25. package/src/api/types/Api_Equipment.ts +3 -3
  26. package/src/api/types/Api_Instruments.ts +136 -136
  27. package/src/api/types/Api_Modules.ts +21 -21
  28. package/src/api/types/Api_Projects.ts +62 -62
  29. package/src/api/types/Api_Repairs.ts +140 -140
  30. package/src/api/types/Api_Schedule.ts +64 -64
  31. package/src/api/types/Api_Search.ts +80 -80
  32. package/src/api/types/Api_Tasks.ts +1 -0
  33. package/src/api/types/Api_User.ts +145 -145
  34. package/src/api/types/Api_Video.ts +198 -198
  35. package/src/common/app-datepicker/AppDatepicker.vue +176 -176
  36. package/src/common/app-dropdown/AppDropdown.vue +37 -37
  37. package/src/common/app-input-new/AppInputNew.vue +175 -175
  38. package/src/common/app-layout/AppLayout.vue +84 -84
  39. package/src/common/app-modal/index.vue +96 -96
  40. package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
  41. package/src/common/app-sidebar/AppSidebar.vue +168 -168
  42. package/src/common/app-sidebar/components/SidebarMenuItem.vue +149 -149
  43. package/src/common/app-table/AppTable.vue +308 -308
  44. package/src/common/app-table/AppTableLayout.vue +137 -137
  45. package/src/common/app-table/components/ModalSelect.vue +286 -286
  46. package/src/common/app-table/components/TableModal.vue +356 -356
  47. package/src/common/app-table/controllers/useBaseTable.ts +45 -45
  48. package/src/common/app-table/controllers/useTableModel.ts +102 -102
  49. package/src/index.ts +128 -128
  50. package/src/styles/variables.sass +12 -12
@@ -1,286 +1,286 @@
1
- <template>
2
- <label v-if="label" class="field-label">
3
- {{ label }}
4
- <span v-if="rules?.length && isShowRequired" class="required">*</span>
5
- </label>
6
-
7
- <q-select
8
- ref="select"
9
- v-model="selected"
10
- :options="filteredOptions"
11
- :disable="isDisabled"
12
- :multiple="multiple"
13
- :popup-content-class="'custom-select-menu'"
14
- :hide-selected="!showChip && !simple"
15
- :placeholder="isEmpty || (multiple && !showChip) ? placeholder : null"
16
- :loading="loading"
17
- :option-value="optionValue || 'value'"
18
- :option-label="optionLabel || 'label'"
19
- emit-value
20
- filled
21
- map-options
22
- stack-label
23
- :use-input="!hideSearch"
24
- :use-chips="!simple"
25
- :hide-bottom-space="hideBottomSpace"
26
- input-debounce="100"
27
- autocomplete=""
28
- :rules="rules"
29
- @virtual-scroll="onScroll"
30
- @filter="filterFn"
31
- >
32
- <template v-if="multiple || showChip || 'selected' in slots" #selected-item="scope">
33
- <slot v-if="'selected' in slots && scope.opt" name="selected" :opt="scope.opt" />
34
- <q-chip
35
- v-else-if="scope.opt"
36
- removable
37
- :tabindex="scope.tabindex"
38
- :style="{ backgroundColor: chipColor }"
39
- icon-remove="close"
40
- text-color="secondary"
41
- @remove="scope.removeAtIndex(scope.index)"
42
- >
43
- {{ scope.opt[optionLabel || 'label'] }}
44
- </q-chip>
45
- </template>
46
-
47
- <template #append>
48
- <q-icon
49
- v-if="!isDisabled && !isEmpty"
50
- name="close"
51
- class="cursor-pointer clear-input"
52
- @click.stop="handleClear"
53
- />
54
- </template>
55
-
56
- <template #no-option>
57
- <div class="q-pa-sm">
58
- <q-item>
59
- <q-item-section class="wrapper-empty-text">
60
- {{ emptyText || 'Ничего не найдено' }}
61
- <button
62
- v-if="allowCreate && internalSearch && internalSearch.trim()"
63
- class="add-new-items"
64
- @click="handleCreateFromSearch"
65
- >
66
- Добавить
67
- </button>
68
- </q-item-section>
69
- </q-item>
70
- </div>
71
- </template>
72
-
73
- <template #option="scope">
74
- <q-item v-if="scope.opt.__loading" class="q-py-md q-ml-md">
75
- <q-spinner-dots size="24px" color="primary" />
76
- </q-item>
77
- <q-item v-else-if="'option' in slots" v-bind="scope.itemProps">
78
- <slot name="option" :opt="scope.opt" />
79
- </q-item>
80
- <q-item v-else v-bind="scope.itemProps">
81
- <q-item-section>{{ scope.opt[optionLabel || 'label'] }}</q-item-section>
82
- </q-item>
83
- </template>
84
- </q-select>
85
- </template>
86
-
87
- <script setup lang="ts">
88
- import { computed, defineEmits, defineProps, ref, Ref, useSlots } from 'vue'
89
- type Option = Record<string, any>
90
-
91
- interface AppQSelectProps {
92
- modelValue: any
93
- options: Option[]
94
- placeholder?: string | undefined
95
- emptyText?: string
96
- optionLabel?: string
97
- optionValue?: string
98
- label?: string
99
- multiple?: boolean
100
- loading?: boolean
101
- isShowRequired?: boolean
102
- isDisabled?: boolean
103
- allowCreate?: boolean
104
- isSearch?: boolean
105
- hideSearch?: boolean
106
- showChip?: boolean
107
- simple?: boolean
108
- hideBottomSpace?: boolean
109
- chipColor?: string
110
- height?: string
111
- borderColor?: string
112
- borderRadius?: string
113
- menuWidth?: string
114
- rules?: ((val: any) => boolean | string)[]
115
- }
116
-
117
- const props = defineProps<AppQSelectProps>()
118
- const emit = defineEmits(['update:modelValue', 'update:scroll', 'update:search', 'clear', 'create'])
119
-
120
- const slots = useSlots()
121
-
122
- const select = ref({})
123
- const lcText: Ref<string> = ref('')
124
- const internalSearch = ref('')
125
-
126
- const selected = computed({
127
- get() {
128
- return props.modelValue
129
- },
130
- set(value) {
131
- emit('update:modelValue', value)
132
- },
133
- })
134
-
135
- const isEmpty = computed(() => {
136
- if (!props.modelValue && props.modelValue !== 0) return true
137
-
138
- return Array.isArray(props.modelValue) && !props.modelValue.length
139
- })
140
-
141
- function handleClear() {
142
- const emptyValue = props.multiple ? [] : null
143
- selected.value = emptyValue
144
- lcText.value = ''
145
- emit('update:modelValue', emptyValue)
146
- emit('clear')
147
- }
148
-
149
- const filteredOptions = computed(() => {
150
- const labelKey = props.optionLabel || 'label'
151
-
152
- const baseOptions =
153
- 'option' in slots
154
- ? props.options
155
- : props.options.filter(x => {
156
- const label = x[labelKey]
157
- return typeof label === 'string' && label.toLowerCase().includes(lcText.value)
158
- })
159
-
160
- if (props.loading) {
161
- return [
162
- ...baseOptions,
163
- {
164
- __loading: true,
165
- label: '__loading__',
166
- value: '__loading__',
167
- },
168
- ]
169
- }
170
-
171
- return baseOptions
172
- })
173
-
174
- function handleCreateFromSearch() {
175
- const labelKey = props.optionLabel || 'label'
176
- const valueKey = props.optionValue || 'value'
177
-
178
- const trimmed = internalSearch.value?.trim()
179
- if (!trimmed) return
180
-
181
- const newOption = {
182
- [labelKey]: trimmed,
183
- [valueKey]: trimmed,
184
- }
185
- emit('create', newOption)
186
- handleClear()
187
- }
188
-
189
- function filterFn(val: string, update: (cb: () => void) => void) {
190
- debouncedFilter(val, update)
191
- }
192
-
193
- const debouncedFilter = debounce((val: string, update: (cb: () => void) => void) => {
194
- internalSearch.value = val
195
- emit('update:search', val)
196
- update(() => {
197
- lcText.value = val.toLowerCase()
198
- })
199
- }, 500)
200
-
201
- function onScroll({ to, ref: qSelectRef }) {
202
- const totalOptions = qSelectRef.options.length
203
- if (to >= totalOptions - 1 && !lcText.value) {
204
- emit('update:scroll')
205
- }
206
- }
207
-
208
- function debounce<T>(fn: T, ms) {
209
- let timeoutId
210
- return function (...args) {
211
- clearTimeout(timeoutId)
212
- return new Promise(resolve => {
213
- timeoutId = setTimeout(() => {
214
- resolve(fn(...args))
215
- }, ms)
216
- })
217
- }
218
- }
219
- </script>
220
-
221
- <style lang="scss" scoped>
222
- .wrapper-empty-text {
223
- display: flex;
224
- align-items: center;
225
- justify-content: space-between;
226
- flex-direction: row;
227
- .add-new-items {
228
- background: #3f8cff;
229
- color: #fff;
230
- outline: none;
231
- border: none;
232
- border-radius: 4px;
233
- padding: 5px 10px;
234
- cursor: pointer;
235
- }
236
- }
237
- .field-label {
238
- font-size: 14px;
239
- font-weight: 700;
240
- color: #7d8592;
241
- }
242
- .required {
243
- color: #f65160;
244
- font-weight: bold;
245
- }
246
-
247
- ::v-deep(.q-placeholder) {
248
- color: #7d8592;
249
- }
250
- ::v-deep(.q-field__control) {
251
- border-radius: 8px;
252
- border: 1px solid #d8e0f0;
253
- background: #fff;
254
- box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
255
- }
256
- :deep(.q-field__control:before) {
257
- display: none;
258
- }
259
- :global(.q-field--filled.q-field--highlighted .q-field__control:before) {
260
- background: #fff !important;
261
- border: none;
262
- }
263
- ::v-deep(.q-field--with-bottom) {
264
- padding-bottom: 0;
265
- }
266
- ::v-deep(.q-field__bottom) {
267
- padding: 0;
268
- }
269
- .clear-input {
270
- color: #d8e0f0;
271
- }
272
- ::v-deep(.q-chip) {
273
- border-radius: 4px;
274
- background: #e9eff9;
275
- color: #1d425d;
276
- font-family: NunitoSansFont, sans-serif;
277
- font-size: 14px;
278
- height: 30px;
279
- line-height: 30px;
280
- padding: 0 15px;
281
- .q-chip__icon {
282
- color: #3f8cff;
283
- margin-left: 5px;
284
- }
285
- }
286
- </style>
1
+ <template>
2
+ <label v-if="label" class="field-label">
3
+ {{ label }}
4
+ <span v-if="rules?.length && isShowRequired" class="required">*</span>
5
+ </label>
6
+
7
+ <q-select
8
+ ref="select"
9
+ v-model="selected"
10
+ :options="filteredOptions"
11
+ :disable="isDisabled"
12
+ :multiple="multiple"
13
+ :popup-content-class="'custom-select-menu'"
14
+ :hide-selected="!showChip && !simple"
15
+ :placeholder="isEmpty || (multiple && !showChip) ? placeholder : null"
16
+ :loading="loading"
17
+ :option-value="optionValue || 'value'"
18
+ :option-label="optionLabel || 'label'"
19
+ emit-value
20
+ filled
21
+ map-options
22
+ stack-label
23
+ :use-input="!hideSearch"
24
+ :use-chips="!simple"
25
+ :hide-bottom-space="hideBottomSpace"
26
+ input-debounce="100"
27
+ autocomplete=""
28
+ :rules="rules"
29
+ @virtual-scroll="onScroll"
30
+ @filter="filterFn"
31
+ >
32
+ <template v-if="multiple || showChip || 'selected' in slots" #selected-item="scope">
33
+ <slot v-if="'selected' in slots && scope.opt" name="selected" :opt="scope.opt" />
34
+ <q-chip
35
+ v-else-if="scope.opt"
36
+ removable
37
+ :tabindex="scope.tabindex"
38
+ :style="{ backgroundColor: chipColor }"
39
+ icon-remove="close"
40
+ text-color="secondary"
41
+ @remove="scope.removeAtIndex(scope.index)"
42
+ >
43
+ {{ scope.opt[optionLabel || 'label'] }}
44
+ </q-chip>
45
+ </template>
46
+
47
+ <template #append>
48
+ <q-icon
49
+ v-if="!isDisabled && !isEmpty"
50
+ name="close"
51
+ class="cursor-pointer clear-input"
52
+ @click.stop="handleClear"
53
+ />
54
+ </template>
55
+
56
+ <template #no-option>
57
+ <div class="q-pa-sm">
58
+ <q-item>
59
+ <q-item-section class="wrapper-empty-text">
60
+ {{ emptyText || 'Ничего не найдено' }}
61
+ <button
62
+ v-if="allowCreate && internalSearch && internalSearch.trim()"
63
+ class="add-new-items"
64
+ @click="handleCreateFromSearch"
65
+ >
66
+ Добавить
67
+ </button>
68
+ </q-item-section>
69
+ </q-item>
70
+ </div>
71
+ </template>
72
+
73
+ <template #option="scope">
74
+ <q-item v-if="scope.opt.__loading" class="q-py-md q-ml-md">
75
+ <q-spinner-dots size="24px" color="primary" />
76
+ </q-item>
77
+ <q-item v-else-if="'option' in slots" v-bind="scope.itemProps">
78
+ <slot name="option" :opt="scope.opt" />
79
+ </q-item>
80
+ <q-item v-else v-bind="scope.itemProps">
81
+ <q-item-section>{{ scope.opt[optionLabel || 'label'] }}</q-item-section>
82
+ </q-item>
83
+ </template>
84
+ </q-select>
85
+ </template>
86
+
87
+ <script setup lang="ts">
88
+ import { computed, defineEmits, defineProps, ref, Ref, useSlots } from 'vue'
89
+ type Option = Record<string, any>
90
+
91
+ interface AppQSelectProps {
92
+ modelValue: any
93
+ options: Option[]
94
+ placeholder?: string | undefined
95
+ emptyText?: string
96
+ optionLabel?: string
97
+ optionValue?: string
98
+ label?: string
99
+ multiple?: boolean
100
+ loading?: boolean
101
+ isShowRequired?: boolean
102
+ isDisabled?: boolean
103
+ allowCreate?: boolean
104
+ isSearch?: boolean
105
+ hideSearch?: boolean
106
+ showChip?: boolean
107
+ simple?: boolean
108
+ hideBottomSpace?: boolean
109
+ chipColor?: string
110
+ height?: string
111
+ borderColor?: string
112
+ borderRadius?: string
113
+ menuWidth?: string
114
+ rules?: ((val: any) => boolean | string)[]
115
+ }
116
+
117
+ const props = defineProps<AppQSelectProps>()
118
+ const emit = defineEmits(['update:modelValue', 'update:scroll', 'update:search', 'clear', 'create'])
119
+
120
+ const slots = useSlots()
121
+
122
+ const select = ref({})
123
+ const lcText: Ref<string> = ref('')
124
+ const internalSearch = ref('')
125
+
126
+ const selected = computed({
127
+ get() {
128
+ return props.modelValue
129
+ },
130
+ set(value) {
131
+ emit('update:modelValue', value)
132
+ },
133
+ })
134
+
135
+ const isEmpty = computed(() => {
136
+ if (!props.modelValue && props.modelValue !== 0) return true
137
+
138
+ return Array.isArray(props.modelValue) && !props.modelValue.length
139
+ })
140
+
141
+ function handleClear() {
142
+ const emptyValue = props.multiple ? [] : null
143
+ selected.value = emptyValue
144
+ lcText.value = ''
145
+ emit('update:modelValue', emptyValue)
146
+ emit('clear')
147
+ }
148
+
149
+ const filteredOptions = computed(() => {
150
+ const labelKey = props.optionLabel || 'label'
151
+
152
+ const baseOptions =
153
+ 'option' in slots
154
+ ? props.options
155
+ : props.options.filter(x => {
156
+ const label = x[labelKey]
157
+ return typeof label === 'string' && label.toLowerCase().includes(lcText.value)
158
+ })
159
+
160
+ if (props.loading) {
161
+ return [
162
+ ...baseOptions,
163
+ {
164
+ __loading: true,
165
+ label: '__loading__',
166
+ value: '__loading__',
167
+ },
168
+ ]
169
+ }
170
+
171
+ return baseOptions
172
+ })
173
+
174
+ function handleCreateFromSearch() {
175
+ const labelKey = props.optionLabel || 'label'
176
+ const valueKey = props.optionValue || 'value'
177
+
178
+ const trimmed = internalSearch.value?.trim()
179
+ if (!trimmed) return
180
+
181
+ const newOption = {
182
+ [labelKey]: trimmed,
183
+ [valueKey]: trimmed,
184
+ }
185
+ emit('create', newOption)
186
+ handleClear()
187
+ }
188
+
189
+ function filterFn(val: string, update: (cb: () => void) => void) {
190
+ debouncedFilter(val, update)
191
+ }
192
+
193
+ const debouncedFilter = debounce((val: string, update: (cb: () => void) => void) => {
194
+ internalSearch.value = val
195
+ emit('update:search', val)
196
+ update(() => {
197
+ lcText.value = val.toLowerCase()
198
+ })
199
+ }, 500)
200
+
201
+ function onScroll({ to, ref: qSelectRef }) {
202
+ const totalOptions = qSelectRef.options.length
203
+ if (to >= totalOptions - 1 && !lcText.value) {
204
+ emit('update:scroll')
205
+ }
206
+ }
207
+
208
+ function debounce<T>(fn: T, ms) {
209
+ let timeoutId
210
+ return function (...args) {
211
+ clearTimeout(timeoutId)
212
+ return new Promise(resolve => {
213
+ timeoutId = setTimeout(() => {
214
+ resolve(fn(...args))
215
+ }, ms)
216
+ })
217
+ }
218
+ }
219
+ </script>
220
+
221
+ <style lang="scss" scoped>
222
+ .wrapper-empty-text {
223
+ display: flex;
224
+ align-items: center;
225
+ justify-content: space-between;
226
+ flex-direction: row;
227
+ .add-new-items {
228
+ background: #3f8cff;
229
+ color: #fff;
230
+ outline: none;
231
+ border: none;
232
+ border-radius: 4px;
233
+ padding: 5px 10px;
234
+ cursor: pointer;
235
+ }
236
+ }
237
+ .field-label {
238
+ font-size: 14px;
239
+ font-weight: 700;
240
+ color: #7d8592;
241
+ }
242
+ .required {
243
+ color: #f65160;
244
+ font-weight: bold;
245
+ }
246
+
247
+ ::v-deep(.q-placeholder) {
248
+ color: #7d8592;
249
+ }
250
+ ::v-deep(.q-field__control) {
251
+ border-radius: 8px;
252
+ border: 1px solid #d8e0f0;
253
+ background: #fff;
254
+ box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
255
+ }
256
+ :deep(.q-field__control:before) {
257
+ display: none;
258
+ }
259
+ :global(.q-field--filled.q-field--highlighted .q-field__control:before) {
260
+ background: #fff !important;
261
+ border: none;
262
+ }
263
+ ::v-deep(.q-field--with-bottom) {
264
+ padding-bottom: 0;
265
+ }
266
+ ::v-deep(.q-field__bottom) {
267
+ padding: 0;
268
+ }
269
+ .clear-input {
270
+ color: #d8e0f0;
271
+ }
272
+ ::v-deep(.q-chip) {
273
+ border-radius: 4px;
274
+ background: #e9eff9;
275
+ color: #1d425d;
276
+ font-family: NunitoSansFont, sans-serif;
277
+ font-size: 14px;
278
+ height: 30px;
279
+ line-height: 30px;
280
+ padding: 0 15px;
281
+ .q-chip__icon {
282
+ color: #3f8cff;
283
+ margin-left: 5px;
284
+ }
285
+ }
286
+ </style>