shared-ritm 1.2.126 → 1.2.128

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,5 +1,5 @@
1
1
  import ApiService from '../settings/ApiService';
2
- import { Api_ControlLogs_Dto, Api_ControlZones_Dto } from '../types/Api_Controls';
2
+ import { Api_ControlLogs_Dto, Api_ControlZones_Dto, Api_Instrument_Type_Search } from '../types/Api_Controls';
3
3
  import { ResponseApi } from '../types/Api_Service';
4
4
  declare class ControlsService extends ApiService {
5
5
  fetchControlZones(params: Record<string, any>): Promise<ResponseApi<Api_ControlZones_Dto[]>>;
@@ -14,7 +14,8 @@ declare class ControlsService extends ApiService {
14
14
  manualEntry(params: any): Promise<ResponseApi<any>>;
15
15
  manualExit(params: any): Promise<ResponseApi<any>>;
16
16
  deleteControlLogs(params: any): Promise<any>;
17
- fetchInstrumentTypeList(params: any): Promise<any>;
17
+ fetchInstrumentTypeList(params: any): Promise<ResponseApi<Api_Instrument_Type_Search[]>>;
18
+ deleteInstrumentType(id: string): Promise<any>;
18
19
  fetchRpdzLogList(params: Record<string, any>): Promise<ResponseApi<Api_ControlLogs_Dto[]>>;
19
20
  }
20
21
  export default function useControlsService(): ControlsService;
@@ -22,6 +22,7 @@ declare class RepairsService extends ApiService {
22
22
  updateRepair(payload: Api_Update_Repair, id: string): Promise<void>;
23
23
  copyRepair(id: string): Promise<any>;
24
24
  deleteRepair(id: string): Promise<import("axios").AxiosResponse<any, any>>;
25
+ fetchIntersection(id: string): Promise<any>;
25
26
  }
26
27
  export default function useRepairsService(): RepairsService;
27
28
  export {};
@@ -77,3 +77,13 @@ export type Api_ManualEntry_Dto = {
77
77
  items?: string[];
78
78
  new_items?: Api_New_Items[];
79
79
  };
80
+ export type Api_Instrument_Type_Search = {
81
+ id: string;
82
+ icon: string;
83
+ name: string;
84
+ storage: {
85
+ id: string;
86
+ title: string;
87
+ };
88
+ warehouse_statuses: boolean;
89
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.126",
3
+ "version": "1.2.128",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,6 @@
1
1
  import ApiService from '../settings/ApiService'
2
2
 
3
- import { Api_ControlLogs_Dto, Api_ControlZones_Dto } from '../types/Api_Controls'
3
+ import { Api_ControlLogs_Dto, Api_ControlZones_Dto, Api_Instrument_Type_Search } from '../types/Api_Controls'
4
4
  import { ResponseApi } from '../types/Api_Service'
5
5
 
6
6
  class ControlsService extends ApiService {
@@ -25,7 +25,7 @@ class ControlsService extends ApiService {
25
25
  }
26
26
 
27
27
  public fetchControlLogs(params: Record<string, any>): Promise<ResponseApi<Api_ControlLogs_Dto[]>> {
28
- return this.get('/exposed_equipment_zones/list', { params })
28
+ return this.get('list_for_controller', { params })
29
29
  }
30
30
 
31
31
  public fetchControllers(params: Record<string, any>): Promise<ResponseApi<Api_ControlLogs_Dto[]>> {
@@ -52,8 +52,12 @@ class ControlsService extends ApiService {
52
52
  return this.delete<ResponseApi<any>>(`exposed_equipment_zones`, params)
53
53
  }
54
54
 
55
- public fetchInstrumentTypeList(params: any): Promise<any> {
56
- return this.get<ResponseApi<any>>(`search/instrument_types`, { params })
55
+ public fetchInstrumentTypeList(params: any): Promise<ResponseApi<Api_Instrument_Type_Search[]>> {
56
+ return this.get<ResponseApi<Api_Instrument_Type_Search[]>>(`search/instrument_types`, { params })
57
+ }
58
+
59
+ public deleteInstrumentType(id: string): Promise<any> {
60
+ return this.delete<ResponseApi<any>>(`admin/instruments/${id}`)
57
61
  }
58
62
 
59
63
  public fetchRpdzLogList(params: Record<string, any>): Promise<ResponseApi<Api_ControlLogs_Dto[]>> {
@@ -90,7 +90,7 @@ class MetricsService extends ApiService {
90
90
  }
91
91
 
92
92
  public async fetchWorkZoneInfo(queryString: string): Promise<any> {
93
- return await this.get('exposed_equipment_zones_history/list/current/status' + '?' + queryString)
93
+ return await this.get('exposed_equipment_zones/list' + '?' + queryString)
94
94
  }
95
95
 
96
96
  public async fetchPieAllTasks(queryString: string): Promise<any> {
@@ -109,6 +109,10 @@ class RepairsService extends ApiService {
109
109
  public deleteRepair(id: string) {
110
110
  return this.delete<any>(`/repairs/${id}`)
111
111
  }
112
+
113
+ public fetchIntersection(id: string): Promise<any> {
114
+ return this.get(`v3/repairs/${id}/personnel/intersection`)
115
+ }
112
116
  }
113
117
 
114
118
  let api: RepairsService
@@ -80,3 +80,14 @@ export type Api_ManualEntry_Dto = {
80
80
  items?: string[]
81
81
  new_items?: Api_New_Items[]
82
82
  }
83
+
84
+ export type Api_Instrument_Type_Search = {
85
+ id: string
86
+ icon: string
87
+ name: string
88
+ storage: {
89
+ id: string
90
+ title: string
91
+ }
92
+ warehouse_statuses: boolean
93
+ }
@@ -14,7 +14,7 @@
14
14
  <q-popup-proxy v-if="!disabled" class="datepicker__wrapper" @update:model-value="updateError">
15
15
  <q-date
16
16
  v-model="model"
17
- :mask="`DD.MM.YYYY ${timeFormat}`"
17
+ :mask="time ? `DD.MM.YYYY ${timeFormat}` : 'DD.MM.YYYY'"
18
18
  :options="disablePastDates"
19
19
  @update:model-value="error = false"
20
20
  />
@@ -63,7 +63,7 @@ const model = defineModel<string | null | undefined>()
63
63
  const error = ref(false)
64
64
 
65
65
  const updateError = (state: boolean) => {
66
- if (!error.value && !model.value && !state) {
66
+ if (props.required && !error.value && !model.value && !state) {
67
67
  error.value = true
68
68
  }
69
69
  }
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <q-btn-dropdown :color="color" :content-style="{ width: width || '200px', minWidth: height || '200px' }">
2
+ <q-btn-dropdown
3
+ v-model="model"
4
+ :color="color"
5
+ :content-style="{ width: width || '200px', minWidth: height || '200px' }"
6
+ >
3
7
  <template #label>
4
8
  <slot name="label">
5
9
  {{ label }}
@@ -20,6 +24,8 @@ interface Props {
20
24
  }
21
25
 
22
26
  const props = defineProps<Props>()
27
+
28
+ const model = defineModel<boolean>()
23
29
  </script>
24
30
 
25
31
  <style scoped lang="scss">
@@ -3,7 +3,7 @@
3
3
  <q-table
4
4
  v-model:selected="selected"
5
5
  :rows="rows.value"
6
- :columns="resCols"
6
+ :columns="columns"
7
7
  row-key="id"
8
8
  flat
9
9
  bordered
@@ -29,10 +29,10 @@
29
29
  </q-td>
30
30
  </template>
31
31
 
32
- <template v-for="col in resCols" :key="col.name" #[`header-cell-${col.name}`]="propsSlot">
32
+ <template v-for="col in columns" :key="col.name" #[`header-cell-${col.name}`]="propsSlot">
33
33
  <q-th
34
34
  :props="propsSlot"
35
- :class="{ 'cursor-pointer': col.filterType, actions: col.name === 'actions' }"
35
+ :class="{ 'cursor-pointer': col.filterType, fixed: col.name === 'fixed' }"
36
36
  :style="col.style"
37
37
  >
38
38
  <div
@@ -99,15 +99,12 @@
99
99
  <q-td
100
100
  :props="cellProps"
101
101
  :class="{
102
- 'q-td--no-hover': noHover || cellProps.col.name === 'actions',
103
- actions: cellProps.col.name === 'actions',
102
+ 'q-td--no-hover': noHover || cellProps.col.name === 'fixed',
103
+ fixed: cellProps.col.name === 'fixed',
104
104
  }"
105
105
  >
106
- <div v-if="cellProps.col.name === 'actions'" class="actions__btns">
107
- <q-btn square icon="edit" size="sm" unelevated title="Редактировать" @click="emit('edit', cellProps.row)" />
108
- </div>
109
106
  <q-badge
110
- v-else-if="cellProps.col.badge && typeof cellProps.value === 'boolean'"
107
+ v-if="cellProps.col.badge && typeof cellProps.value === 'boolean'"
111
108
  :color="
112
109
  cellProps.col.badge.colorTrue && cellProps.value
113
110
  ? cellProps.col.badge.colorTrue
@@ -123,7 +120,12 @@
123
120
  {{ cellProps.value ? cellProps.col.badge.true ?? 'Да' : cellProps.col.badge.false ?? 'Нет' }}
124
121
  </q-badge>
125
122
  <span v-else-if="cellProps.col.html" v-html="cellProps.value"></span>
126
- <slot v-else-if="hasSlot(cellProps.col.name)" :name="cellProps.col.name" :cellProps="cellProps" />
123
+ <slot
124
+ v-else-if="hasSlot(cellProps.col.name)"
125
+ :name="cellProps.col.name"
126
+ :cellProps="cellProps"
127
+ :class="{ fixed__btns: cellProps.col.name === 'fixed' }"
128
+ />
127
129
  <span v-else :title="cellProps.value">{{ cellProps.value }}</span>
128
130
  </q-td>
129
131
  </template>
@@ -160,7 +162,6 @@ const props = defineProps<{
160
162
  noHover?: boolean
161
163
  hidePagination?: boolean
162
164
  selectedRows: any[]
163
- actions?: string[]
164
165
  tableRowStyleFn?: (row: Record<string, any>) => string
165
166
  slots?: Slots
166
167
  }>()
@@ -169,12 +170,6 @@ const emit = defineEmits<TableEmits>()
169
170
  const localSearches = ref<Record<string, string>>({})
170
171
  const selected = ref<any[]>([])
171
172
 
172
- const resCols = computed(() => {
173
- if (!props.actions?.length) return props.columns
174
-
175
- return [...props.columns, { name: 'actions', label: 'Действия', align: 'center' }]
176
- })
177
-
178
173
  const filteredOptions = computed(() => {
179
174
  const result: Record<string, FilterOption[]> = {}
180
175
  for (const col of props.columns) {
@@ -190,7 +185,7 @@ const hasSlot = (name: string) => props.slots && name in props.slots
190
185
  const rowClick = (e: Event, row: Record<string, any>) => {
191
186
  const target = e?.target
192
187
 
193
- if (!(target instanceof HTMLElement) || target.closest('.actions') || document.getSelection()?.toString()) return
188
+ if (!(target instanceof HTMLElement) || target.closest('.fixed') || document.getSelection()?.toString()) return
194
189
 
195
190
  emit('row-click', row)
196
191
  }
@@ -218,8 +213,7 @@ watch(
218
213
  )
219
214
  </script>
220
215
  <style scoped lang="scss">
221
- .actions {
222
- width: 100px;
216
+ .fixed {
223
217
  background-color: #f2f7fb;
224
218
  position: sticky;
225
219
  right: 0;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <label class="field-label">
2
+ <label v-if="label" class="field-label">
3
3
  {{ label }}
4
4
  <span v-if="rules?.length && isShowRequired" class="required">*</span>
5
5
  </label>
@@ -45,7 +45,7 @@
45
45
 
46
46
  <template #append>
47
47
  <q-icon
48
- v-if="!isDisabled && selected && (selected.length || selected > 0)"
48
+ v-if="!isDisabled && !isEmpty"
49
49
  name="close"
50
50
  class="cursor-pointer clear-input"
51
51
  @click.stop="handleClear"
@@ -73,6 +73,9 @@
73
73
  <q-item v-if="scope.opt.__loading" class="q-py-md q-ml-md">
74
74
  <q-spinner-dots size="24px" color="primary" />
75
75
  </q-item>
76
+ <q-item v-else-if="'option' in slots" v-bind="scope.itemProps">
77
+ <slot name="option" :opt="scope.opt" />
78
+ </q-item>
76
79
  <q-item v-else v-bind="scope.itemProps">
77
80
  <q-item-section>{{ scope.opt[optionLabel || 'label'] }}</q-item-section>
78
81
  </q-item>
@@ -81,7 +84,7 @@
81
84
  </template>
82
85
 
83
86
  <script setup lang="ts">
84
- import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
87
+ import { computed, defineEmits, defineProps, ref, Ref, useSlots } from 'vue'
85
88
  type Option = Record<string, any>
86
89
 
87
90
  interface AppQSelectProps {
@@ -112,6 +115,8 @@ interface AppQSelectProps {
112
115
  const props = defineProps<AppQSelectProps>()
113
116
  const emit = defineEmits(['update:modelValue', 'update:scroll', 'update:search', 'clear', 'create'])
114
117
 
118
+ const slots = useSlots()
119
+
115
120
  const select = ref({})
116
121
  const lcText: Ref<string> = ref('')
117
122
  const internalSearch = ref('')
@@ -125,6 +130,12 @@ const selected = computed({
125
130
  },
126
131
  })
127
132
 
133
+ const isEmpty = computed(() => {
134
+ if (!props.modelValue && props.modelValue !== 0) return true
135
+
136
+ return Array.isArray(props.modelValue) && !props.modelValue.length
137
+ })
138
+
128
139
  function handleClear() {
129
140
  const emptyValue = props.multiple ? [] : null
130
141
  selected.value = emptyValue