shared-ritm 1.3.28 → 1.3.29

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