shared-ritm 1.2.131 → 1.2.132

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, Api_Instrument_Type_Search } from '../types/Api_Controls';
2
+ import { Api_ControlLogs_Dto, Api_ControlZones_Dto, Api_Instrument_Category, Api_instrument_Type, Api_instrument_Type_Create, 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[]>>;
@@ -15,6 +15,11 @@ declare class ControlsService extends ApiService {
15
15
  manualExit(params: any): Promise<ResponseApi<any>>;
16
16
  deleteControlLogs(params: any): Promise<any>;
17
17
  fetchInstrumentTypeList(params: any): Promise<ResponseApi<Api_Instrument_Type_Search[]>>;
18
+ fetchInstrumentCategoryList(params?: {
19
+ search?: string;
20
+ }): Promise<Api_Instrument_Category[]>;
21
+ createInstrumentType(body: Api_instrument_Type_Create): Promise<Api_instrument_Type>;
22
+ editInstrumentType(id: string, body: Partial<Api_instrument_Type_Create>): Promise<Api_instrument_Type>;
18
23
  deleteInstrumentType(id: string): Promise<any>;
19
24
  fetchRpdzLogList(params: Record<string, any>): Promise<ResponseApi<Api_ControlLogs_Dto[]>>;
20
25
  }
@@ -87,3 +87,18 @@ export type Api_Instrument_Type_Search = {
87
87
  };
88
88
  warehouse_statuses: boolean;
89
89
  };
90
+ export type Api_Instrument_Category = {
91
+ id: string;
92
+ title: string[];
93
+ };
94
+ export type Api_instrument_Type_Create = {
95
+ name: string;
96
+ storage_id: string;
97
+ };
98
+ export type Api_instrument_Type = {
99
+ id: string;
100
+ name: string;
101
+ storage_id: string;
102
+ created_at: string;
103
+ updated_at: string;
104
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.131",
3
+ "version": "1.2.132",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,13 @@
1
1
  import ApiService from '../settings/ApiService'
2
2
 
3
- import { Api_ControlLogs_Dto, Api_ControlZones_Dto, Api_Instrument_Type_Search } from '../types/Api_Controls'
3
+ import {
4
+ Api_ControlLogs_Dto,
5
+ Api_ControlZones_Dto,
6
+ Api_Instrument_Category,
7
+ Api_instrument_Type,
8
+ Api_instrument_Type_Create,
9
+ Api_Instrument_Type_Search,
10
+ } from '../types/Api_Controls'
4
11
  import { ResponseApi } from '../types/Api_Service'
5
12
 
6
13
  class ControlsService extends ApiService {
@@ -53,7 +60,19 @@ class ControlsService extends ApiService {
53
60
  }
54
61
 
55
62
  public fetchInstrumentTypeList(params: any): Promise<ResponseApi<Api_Instrument_Type_Search[]>> {
56
- return this.get<ResponseApi<Api_Instrument_Type_Search[]>>(`search/instrument_types`, { params })
63
+ return this.get<ResponseApi<Api_Instrument_Type_Search[]>>('search/instrument_types', { params })
64
+ }
65
+
66
+ public fetchInstrumentCategoryList(params: { search?: string } = {}): Promise<Api_Instrument_Category[]> {
67
+ return this.get<Api_Instrument_Category[]>('instrument_category/list', { params })
68
+ }
69
+
70
+ public createInstrumentType(body: Api_instrument_Type_Create): Promise<Api_instrument_Type> {
71
+ return this.post<Api_instrument_Type_Create, Api_instrument_Type>('admin/instruments', body)
72
+ }
73
+
74
+ public editInstrumentType(id: string, body: Partial<Api_instrument_Type_Create>): Promise<Api_instrument_Type> {
75
+ return this.put<Partial<Api_instrument_Type_Create>, Api_instrument_Type>(`admin/instruments/${id}`, body)
57
76
  }
58
77
 
59
78
  public deleteInstrumentType(id: string): Promise<any> {
@@ -91,3 +91,21 @@ export type Api_Instrument_Type_Search = {
91
91
  }
92
92
  warehouse_statuses: boolean
93
93
  }
94
+
95
+ export type Api_Instrument_Category = {
96
+ id: string
97
+ title: string[]
98
+ }
99
+
100
+ export type Api_instrument_Type_Create = {
101
+ name: string
102
+ storage_id: string
103
+ }
104
+
105
+ export type Api_instrument_Type = {
106
+ id: string
107
+ name: string
108
+ storage_id: string
109
+ created_at: string
110
+ updated_at: string
111
+ }
@@ -106,8 +106,6 @@ const currTabId = computed({
106
106
  }
107
107
 
108
108
  .loader {
109
- min-width: 976px;
110
-
111
109
  &-spinner {
112
110
  position: absolute;
113
111
  top: 50%;
@@ -12,7 +12,7 @@
12
12
  :multiple="multiple"
13
13
  :popup-content-class="'custom-select-menu'"
14
14
  :hide-selected="!showChip && !simple"
15
- :placeholder="placeholder"
15
+ :placeholder="isEmpty ? placeholder : null"
16
16
  :loading="loading"
17
17
  :option-value="optionValue || 'value'"
18
18
  :option-label="optionLabel || 'label'"
@@ -29,9 +29,10 @@
29
29
  @virtual-scroll="onScroll"
30
30
  @filter="filterFn"
31
31
  >
32
- <template v-if="multiple || showChip" #selected-item="scope">
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" />
33
34
  <q-chip
34
- v-if="scope.opt"
35
+ v-else-if="scope.opt"
35
36
  removable
36
37
  :tabindex="scope.tabindex"
37
38
  :style="{ backgroundColor: chipColor }"
@@ -147,10 +148,13 @@ function handleClear() {
147
148
  const filteredOptions = computed(() => {
148
149
  const labelKey = props.optionLabel || 'label'
149
150
 
150
- const baseOptions = props.options.filter(x => {
151
- const label = x[labelKey]
152
- return typeof label === 'string' && label.toLowerCase().includes(lcText.value)
153
- })
151
+ const baseOptions =
152
+ 'option' in slots
153
+ ? props.options
154
+ : props.options.filter(x => {
155
+ const label = x[labelKey]
156
+ return typeof label === 'string' && label.toLowerCase().includes(lcText.value)
157
+ })
154
158
 
155
159
  if (props.loading) {
156
160
  return [