shared-ritm 1.2.106 → 1.2.108
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.
- package/dist/index.css +1 -1
- package/dist/shared-ritm.es.js +41 -10
- package/dist/shared-ritm.umd.js +41 -41
- package/dist/types/api/services/InstrumentsService.d.ts +17 -1
- package/dist/types/api/services/PhotoService.d.ts +38 -51
- package/dist/types/api/services/SearchService.d.ts +2 -1
- package/dist/types/api/types/Api_Instruments.d.ts +26 -0
- package/dist/types/api/types/Api_Search.d.ts +16 -0
- package/package.json +64 -64
- package/src/api/services/BrigadesService.ts +32 -32
- package/src/api/services/EquipmentService.ts +29 -29
- package/src/api/services/InstrumentsService.ts +63 -22
- package/src/api/services/SearchService.ts +5 -2
- package/src/api/services/UserService.ts +101 -101
- package/src/api/services/VideoService.ts +62 -62
- package/src/api/settings/ApiService.ts +124 -126
- package/src/api/types/Api_Brigades.ts +36 -36
- package/src/api/types/Api_Equipment.ts +3 -3
- package/src/api/types/Api_Instruments.ts +136 -98
- package/src/api/types/Api_Search.ts +19 -0
- package/src/api/types/Api_User.ts +117 -117
- package/src/api/types/Api_Video.ts +123 -123
- package/src/common/app-input-new/AppInputNew.vue +167 -167
- package/src/common/app-layout/components/AppLayoutHeader.vue +250 -250
- package/src/common/app-sheet-new/AppSheetNew.vue +246 -246
- package/src/common/app-table/AppTable.vue +314 -312
- package/src/common/app-table/AppTableLayout.vue +137 -137
- package/src/common/app-table/components/ModalSelect.vue +270 -270
- package/src/common/app-table/components/TableModal.vue +356 -356
- package/src/common/app-table/controllers/useBaseTable.ts +45 -45
- package/src/index.ts +119 -119
- package/src/styles/variables.sass +12 -12
- package/dist/types/api/services/ComentsServise.d.ts +0 -10
- package/dist/types/api/types/Api_Users.d.ts +0 -43
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import ApiService from '../settings/ApiService';
|
|
2
|
-
import { Api_instruments_HistoryResponse } from '../types/Api_Instruments';
|
|
2
|
+
import { Api_Instrument, Api_instruments_HistoryResponse, Api_Warehouse_Create, Api_Warehouse_Search, Api_Warehouse_Status_History_Item } from '../types/Api_Instruments';
|
|
3
|
+
import { ResponseApi } from '@/api/types/Api_Service';
|
|
3
4
|
declare class InstrumentsService extends ApiService {
|
|
4
5
|
fetchUserInstrumentsHistory(id: string, page?: number): Promise<Api_instruments_HistoryResponse>;
|
|
6
|
+
fetchWarehouses(params: any): Promise<ResponseApi<Api_Warehouse_Search[]>>;
|
|
7
|
+
fetchWarehouse(id: string): Promise<Api_Instrument>;
|
|
8
|
+
fetchStatusHistory(id: string): Promise<Api_Warehouse_Status_History_Item[]>;
|
|
9
|
+
createWarehouse(model: Api_Warehouse_Create): Promise<Api_Instrument>;
|
|
10
|
+
editWarehouse({ id, model, }: {
|
|
11
|
+
id: string;
|
|
12
|
+
model: Partial<Api_Warehouse_Create>;
|
|
13
|
+
}): Promise<Api_Instrument>;
|
|
14
|
+
deleteWarehouse(id: string): Promise<{
|
|
15
|
+
data: boolean;
|
|
16
|
+
status: number;
|
|
17
|
+
}>;
|
|
18
|
+
unsetWarehouseRfid(model: {
|
|
19
|
+
warehouses: string[];
|
|
20
|
+
}): Promise<Api_Warehouse_Search[]>;
|
|
5
21
|
}
|
|
6
22
|
export default function useInstrumentsService(): InstrumentsService;
|
|
7
23
|
export {};
|
|
@@ -1,53 +1,40 @@
|
|
|
1
|
-
import * as faceapi from 'face-api.js'
|
|
1
|
+
import * as faceapi from 'face-api.js';
|
|
2
2
|
declare class PhotoService {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
faceapi.WithFaceExpressions<
|
|
39
|
-
faceapi.WithFaceLandmarks<
|
|
40
|
-
{
|
|
41
|
-
detection: faceapi.FaceDetection
|
|
42
|
-
},
|
|
43
|
-
faceapi.FaceLandmarks68
|
|
44
|
-
>
|
|
45
|
-
>[]
|
|
46
|
-
>
|
|
47
|
-
getCanvas(videoRef: any): HTMLCanvasElement
|
|
48
|
-
getResizedAndDetection(canvas: any, detections: any, ctx: any, videoWidth: number, videoHeight: number): void
|
|
49
|
-
getFaceSnapshot(inputImage: any, box: any): Promise<string | null>
|
|
50
|
-
initModels(): Promise<void>
|
|
3
|
+
getVideoStreamConfig(width: number, height: number): {
|
|
4
|
+
audio: boolean;
|
|
5
|
+
video: {
|
|
6
|
+
width: {
|
|
7
|
+
min: number;
|
|
8
|
+
ideal: number;
|
|
9
|
+
};
|
|
10
|
+
height: {
|
|
11
|
+
min: number;
|
|
12
|
+
ideal: number;
|
|
13
|
+
};
|
|
14
|
+
facingMode: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
getContourCoordinate(width: number, height: number): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
getBoxData(box: any): {
|
|
24
|
+
x: any;
|
|
25
|
+
y: any;
|
|
26
|
+
width: any;
|
|
27
|
+
height: any;
|
|
28
|
+
} | null;
|
|
29
|
+
setStylesForCanvas(canvasContainer: any): void;
|
|
30
|
+
checkFaceInclusion(frame: any, face: any): boolean;
|
|
31
|
+
getFaceDetections(videoRef: any): Promise<faceapi.WithFaceExpressions<faceapi.WithFaceLandmarks<{
|
|
32
|
+
detection: faceapi.FaceDetection;
|
|
33
|
+
}, faceapi.FaceLandmarks68>>[]>;
|
|
34
|
+
getCanvas(videoRef: any): HTMLCanvasElement;
|
|
35
|
+
getResizedAndDetection(canvas: any, detections: any, ctx: any, videoWidth: number, videoHeight: number): void;
|
|
36
|
+
getFaceSnapshot(inputImage: any, box: any): Promise<string | null>;
|
|
37
|
+
initModels(): Promise<void>;
|
|
51
38
|
}
|
|
52
|
-
export default function usePhotoService(): PhotoService
|
|
53
|
-
export {}
|
|
39
|
+
export default function usePhotoService(): PhotoService;
|
|
40
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import ApiService from '../settings/ApiService';
|
|
2
2
|
import { ResponseApi } from '../types/Api_Service';
|
|
3
|
-
import { Api_Search_User, Api_Search_Instruments } from '../types/Api_Search';
|
|
3
|
+
import { Api_Search_User, Api_Search_Instruments, Api_Search_Module } from '../types/Api_Search';
|
|
4
4
|
declare class SearchService extends ApiService {
|
|
5
5
|
fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>>;
|
|
6
6
|
fetchSearchInstruments(params: any): Promise<ResponseApi<Api_Search_Instruments[]>>;
|
|
7
|
+
fetchSearchModules(params: any): Promise<ResponseApi<Api_Search_Module[]>>;
|
|
7
8
|
}
|
|
8
9
|
export default function useSearchService(): SearchService;
|
|
9
10
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Api_User } from '../types/Api_User';
|
|
2
|
+
import { Api_Status_DTO } from '@/api/types/Api_Tasks';
|
|
3
|
+
import { Api_Search_User } from '@/api/types/Api_Search';
|
|
2
4
|
export type Api_Instrument_Storage = {
|
|
3
5
|
id: string;
|
|
4
6
|
created_at: string;
|
|
@@ -90,3 +92,27 @@ export type Api_instruments_HistoryResponse = {
|
|
|
90
92
|
active: boolean;
|
|
91
93
|
}[];
|
|
92
94
|
};
|
|
95
|
+
export type Api_Warehouse_Search = Omit<Api_Instrument, 'created_at' | 'deleted_at' | 'invoice_ref_key' | 'last_status_updated_at' | 'pressure' | 'registry_module_id' | 'supervisor' | 'supervisor_id' | 'type' | 'weight'> & {
|
|
96
|
+
issued_in: unknown | null;
|
|
97
|
+
registry: {
|
|
98
|
+
id: string;
|
|
99
|
+
title: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export type Api_Warehouse_Create = {
|
|
103
|
+
instrument_id: string;
|
|
104
|
+
inventory_number: string;
|
|
105
|
+
module_id?: string;
|
|
106
|
+
registry_module_id?: string;
|
|
107
|
+
};
|
|
108
|
+
export type Api_Warehouse_Status_History_Item = {
|
|
109
|
+
old_status: Api_Status_DTO;
|
|
110
|
+
new_status: Api_Status_DTO;
|
|
111
|
+
created_at: string;
|
|
112
|
+
responsible: Omit<Api_Search_User, 'photos' | 'divisions' | 'passes'> & {
|
|
113
|
+
roles: {
|
|
114
|
+
id: string;
|
|
115
|
+
display_name: string;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Api_Warehouse_Search } from '@/api/types/Api_Instruments';
|
|
1
2
|
export type Api_Search_User_Passes = {
|
|
2
3
|
id: string;
|
|
3
4
|
type: string;
|
|
@@ -50,3 +51,18 @@ export type Api_Search_Instruments = {
|
|
|
50
51
|
divisions: string;
|
|
51
52
|
personnel_number: string;
|
|
52
53
|
};
|
|
54
|
+
export type Api_Search_Module_User = Pick<Api_Search_User, 'id' | 'full_name' | 'email'> & {
|
|
55
|
+
teams: Omit<Api_Search_User_Teams, 'roles'>[];
|
|
56
|
+
};
|
|
57
|
+
export type Api_Search_Module = {
|
|
58
|
+
id: string;
|
|
59
|
+
RFID: string;
|
|
60
|
+
inventory_number: string;
|
|
61
|
+
title: string;
|
|
62
|
+
type: string;
|
|
63
|
+
mac: unknown;
|
|
64
|
+
wlan: unknown;
|
|
65
|
+
warehouses: Api_Warehouse_Search[];
|
|
66
|
+
user: Api_Search_Module_User;
|
|
67
|
+
teams: Omit<Api_Search_User_Teams, 'roles'>[];
|
|
68
|
+
};
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "shared-ritm",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"private": false,
|
|
5
|
-
"files": [
|
|
6
|
-
"dist",
|
|
7
|
-
"src"
|
|
8
|
-
],
|
|
9
|
-
"main": "dist/shared-ritm.umd.js",
|
|
10
|
-
"type": "module",
|
|
11
|
-
"module": "./dist/shared-ritm.es.js",
|
|
12
|
-
"types": "./dist/types/index.d.ts",
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"import": "./dist/shared-ritm.es.js",
|
|
16
|
-
"require": "./dist/shared-ritm.umd.js",
|
|
17
|
-
"default": "./dist/shared-ritm.es.js",
|
|
18
|
-
"types": "./dist/types/index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"./style": "./dist/index.css"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"dev": "vite",
|
|
24
|
-
"build": "vite build && tsc --emitDeclarationOnly",
|
|
25
|
-
"typecheck": "vue-tsc --noEmit",
|
|
26
|
-
"lint": "eslint --fix",
|
|
27
|
-
"format": "prettier -w -u ."
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@quasar/extras": "^1.16.17",
|
|
31
|
-
"@vueuse/core": "^10.1.2",
|
|
32
|
-
"face-api.js": "^0.22.2",
|
|
33
|
-
"axios": "^1.7.7",
|
|
34
|
-
"vue": "^3.5.12",
|
|
35
|
-
"vue-router": "^4.0.3"
|
|
36
|
-
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"quasar": "^2.18.1"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@quasar/vite-plugin": "^1.9.0",
|
|
42
|
-
"@rollup/pluginutils": "^5.1.3",
|
|
43
|
-
"@types/node": "^22.7.9",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
|
45
|
-
"@typescript-eslint/parser": "^4.25.0",
|
|
46
|
-
"@vitejs/plugin-vue": "^5.1.4",
|
|
47
|
-
"@vue/compiler-sfc": "^3.0.5",
|
|
48
|
-
"@vue/eslint-config-prettier": "^6.0.0",
|
|
49
|
-
"@vue/eslint-config-typescript": "^7.0.0",
|
|
50
|
-
"eslint": "^7.27.0",
|
|
51
|
-
"eslint-plugin-prettier": "^3.4.0",
|
|
52
|
-
"eslint-plugin-vue": "^7.10.0",
|
|
53
|
-
"install": "^0.13.0",
|
|
54
|
-
"npm": "^11.4.0",
|
|
55
|
-
"prettier": "^2.3.0",
|
|
56
|
-
"quasar": "^2.18.1",
|
|
57
|
-
"rollup-plugin-visualizer": "^5.14.0",
|
|
58
|
-
"sass": "^1.80.4",
|
|
59
|
-
"typescript": "^5.6.3",
|
|
60
|
-
"vite": "^5.4.9",
|
|
61
|
-
"vite-plugin-css-modules": "^0.0.1",
|
|
62
|
-
"vue-tsc": "^2.1.6"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "shared-ritm",
|
|
3
|
+
"version": "1.2.108",
|
|
4
|
+
"private": false,
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"src"
|
|
8
|
+
],
|
|
9
|
+
"main": "dist/shared-ritm.umd.js",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"module": "./dist/shared-ritm.es.js",
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/shared-ritm.es.js",
|
|
16
|
+
"require": "./dist/shared-ritm.umd.js",
|
|
17
|
+
"default": "./dist/shared-ritm.es.js",
|
|
18
|
+
"types": "./dist/types/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./style": "./dist/index.css"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
25
|
+
"typecheck": "vue-tsc --noEmit",
|
|
26
|
+
"lint": "eslint --fix",
|
|
27
|
+
"format": "prettier -w -u ."
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@quasar/extras": "^1.16.17",
|
|
31
|
+
"@vueuse/core": "^10.1.2",
|
|
32
|
+
"face-api.js": "^0.22.2",
|
|
33
|
+
"axios": "^1.7.7",
|
|
34
|
+
"vue": "^3.5.12",
|
|
35
|
+
"vue-router": "^4.0.3"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"quasar": "^2.18.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@quasar/vite-plugin": "^1.9.0",
|
|
42
|
+
"@rollup/pluginutils": "^5.1.3",
|
|
43
|
+
"@types/node": "^22.7.9",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
|
45
|
+
"@typescript-eslint/parser": "^4.25.0",
|
|
46
|
+
"@vitejs/plugin-vue": "^5.1.4",
|
|
47
|
+
"@vue/compiler-sfc": "^3.0.5",
|
|
48
|
+
"@vue/eslint-config-prettier": "^6.0.0",
|
|
49
|
+
"@vue/eslint-config-typescript": "^7.0.0",
|
|
50
|
+
"eslint": "^7.27.0",
|
|
51
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
52
|
+
"eslint-plugin-vue": "^7.10.0",
|
|
53
|
+
"install": "^0.13.0",
|
|
54
|
+
"npm": "^11.4.0",
|
|
55
|
+
"prettier": "^2.3.0",
|
|
56
|
+
"quasar": "^2.18.1",
|
|
57
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
58
|
+
"sass": "^1.80.4",
|
|
59
|
+
"typescript": "^5.6.3",
|
|
60
|
+
"vite": "^5.4.9",
|
|
61
|
+
"vite-plugin-css-modules": "^0.0.1",
|
|
62
|
+
"vue-tsc": "^2.1.6"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import { Api_Brigade, Api_Brigade_Create, Api_Brigade_Search } from '../types/Api_Brigades'
|
|
3
|
-
import { ResponseApi } from '../types/Api_Service'
|
|
4
|
-
|
|
5
|
-
class BrigadesService extends ApiService {
|
|
6
|
-
public fetchBrigades(params: any): Promise<ResponseApi<Api_Brigade_Search[]>> {
|
|
7
|
-
return this.get<ResponseApi<Api_Brigade_Search[]>>('/search/brigades', { params })
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
public editBrigade({ id, model }: { id: string; model: Partial<Api_Brigade_Create> }): Promise<Api_Brigade> {
|
|
11
|
-
return this.put<Partial<Api_Brigade_Create>, Api_Brigade>(`/brigades/${id}`, model)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public getBrigade(id: string): Promise<Api_Brigade> {
|
|
15
|
-
return this.get<Api_Brigade>(`/brigades/${id}`)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public createBrigade(model: Api_Brigade_Create): Promise<Api_Brigade> {
|
|
19
|
-
return this.post<Api_Brigade_Create, Api_Brigade>('/brigades', model)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public deleteBrigade(id: string): Promise<{ data: boolean; status: number }> {
|
|
23
|
-
return this.delete(`/brigades/${id}`)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let api: BrigadesService
|
|
28
|
-
|
|
29
|
-
export default function useBrigadesService() {
|
|
30
|
-
if (!api) api = new BrigadesService()
|
|
31
|
-
return api
|
|
32
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { Api_Brigade, Api_Brigade_Create, Api_Brigade_Search } from '../types/Api_Brigades'
|
|
3
|
+
import { ResponseApi } from '../types/Api_Service'
|
|
4
|
+
|
|
5
|
+
class BrigadesService extends ApiService {
|
|
6
|
+
public fetchBrigades(params: any): Promise<ResponseApi<Api_Brigade_Search[]>> {
|
|
7
|
+
return this.get<ResponseApi<Api_Brigade_Search[]>>('/search/brigades', { params })
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public editBrigade({ id, model }: { id: string; model: Partial<Api_Brigade_Create> }): Promise<Api_Brigade> {
|
|
11
|
+
return this.put<Partial<Api_Brigade_Create>, Api_Brigade>(`/brigades/${id}`, model)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public getBrigade(id: string): Promise<Api_Brigade> {
|
|
15
|
+
return this.get<Api_Brigade>(`/brigades/${id}`)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public createBrigade(model: Api_Brigade_Create): Promise<Api_Brigade> {
|
|
19
|
+
return this.post<Api_Brigade_Create, Api_Brigade>('/brigades', model)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public deleteBrigade(id: string): Promise<{ data: boolean; status: number }> {
|
|
23
|
+
return this.delete(`/brigades/${id}`)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let api: BrigadesService
|
|
28
|
+
|
|
29
|
+
export default function useBrigadesService() {
|
|
30
|
+
if (!api) api = new BrigadesService()
|
|
31
|
+
return api
|
|
32
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import { ResponseApi } from '../types/Api_Service'
|
|
3
|
-
import { Api_Equipment_Full_Dto } from '@/api/types/Api_Repairs'
|
|
4
|
-
import { Api_Equipment_Create } from '@/api/types/Api_Equipment'
|
|
5
|
-
|
|
6
|
-
class EquipmentService extends ApiService {
|
|
7
|
-
public fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
|
|
8
|
-
return this.get<ResponseApi<Api_Equipment_Full_Dto[]>>('repairs/equipment/list', { params })
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public createEquipment(body: Api_Equipment_Create): Promise<Api_Equipment_Full_Dto> {
|
|
12
|
-
return this.post<Api_Equipment_Create, Api_Equipment_Full_Dto>('repairs/equipment', body)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public editEquipment(id: string, body: Partial<Api_Equipment_Create>): Promise<Api_Equipment_Full_Dto> {
|
|
16
|
-
return this.put<Partial<Api_Equipment_Create>, Api_Equipment_Full_Dto>(`repairs/equipment/${id}`, body)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public deleteEquipment(id: string): Promise<{ data: boolean; status: number }> {
|
|
20
|
-
return this.delete(`repairs/equipment/${id}`)
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
let api: EquipmentService
|
|
25
|
-
|
|
26
|
-
export default function useEquipmentService() {
|
|
27
|
-
if (!api) api = new EquipmentService()
|
|
28
|
-
return api
|
|
29
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { ResponseApi } from '../types/Api_Service'
|
|
3
|
+
import { Api_Equipment_Full_Dto } from '@/api/types/Api_Repairs'
|
|
4
|
+
import { Api_Equipment_Create } from '@/api/types/Api_Equipment'
|
|
5
|
+
|
|
6
|
+
class EquipmentService extends ApiService {
|
|
7
|
+
public fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
|
|
8
|
+
return this.get<ResponseApi<Api_Equipment_Full_Dto[]>>('repairs/equipment/list', { params })
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public createEquipment(body: Api_Equipment_Create): Promise<Api_Equipment_Full_Dto> {
|
|
12
|
+
return this.post<Api_Equipment_Create, Api_Equipment_Full_Dto>('repairs/equipment', body)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public editEquipment(id: string, body: Partial<Api_Equipment_Create>): Promise<Api_Equipment_Full_Dto> {
|
|
16
|
+
return this.put<Partial<Api_Equipment_Create>, Api_Equipment_Full_Dto>(`repairs/equipment/${id}`, body)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public deleteEquipment(id: string): Promise<{ data: boolean; status: number }> {
|
|
20
|
+
return this.delete(`repairs/equipment/${id}`)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let api: EquipmentService
|
|
25
|
+
|
|
26
|
+
export default function useEquipmentService() {
|
|
27
|
+
if (!api) api = new EquipmentService()
|
|
28
|
+
return api
|
|
29
|
+
}
|
|
@@ -1,22 +1,63 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import {
|
|
3
|
+
Api_Instrument,
|
|
4
|
+
Api_instruments_HistoryResponse,
|
|
5
|
+
Api_Warehouse_Create,
|
|
6
|
+
Api_Warehouse_Search,
|
|
7
|
+
Api_Warehouse_Status_History_Item,
|
|
8
|
+
} from '../types/Api_Instruments'
|
|
9
|
+
import { ResponseApi } from '@/api/types/Api_Service'
|
|
10
|
+
|
|
11
|
+
class InstrumentsService extends ApiService {
|
|
12
|
+
public async fetchUserInstrumentsHistory(id: string, page?: number): Promise<Api_instruments_HistoryResponse> {
|
|
13
|
+
const params = {
|
|
14
|
+
status: 'issued',
|
|
15
|
+
page,
|
|
16
|
+
desc: 'desc',
|
|
17
|
+
column: 'issued_in',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return await this.get(`users/${id}/instruments`, { params })
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async fetchWarehouses(params: any): Promise<ResponseApi<Api_Warehouse_Search[]>> {
|
|
24
|
+
return await this.get('search/warehouses', { params })
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async fetchWarehouse(id: string): Promise<Api_Instrument> {
|
|
28
|
+
return await this.get(`admin/warehouses/${id}`)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async fetchStatusHistory(id: string): Promise<Api_Warehouse_Status_History_Item[]> {
|
|
32
|
+
return await this.get(`warehouses/${id}/history/status`)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public async createWarehouse(model: Api_Warehouse_Create): Promise<Api_Instrument> {
|
|
36
|
+
return await this.post('admin/warehouses', model)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public async editWarehouse({
|
|
40
|
+
id,
|
|
41
|
+
model,
|
|
42
|
+
}: {
|
|
43
|
+
id: string
|
|
44
|
+
model: Partial<Api_Warehouse_Create>
|
|
45
|
+
}): Promise<Api_Instrument> {
|
|
46
|
+
return await this.put(`admin/warehouses/${id}`, model)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public deleteWarehouse(id: string): Promise<{ data: boolean; status: number }> {
|
|
50
|
+
return this.delete(`admin/warehouses/${id}`)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public async unsetWarehouseRfid(model: { warehouses: string[] }): Promise<Api_Warehouse_Search[]> {
|
|
54
|
+
return await this.post('warehouses/unset-rfid', model)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
let api: InstrumentsService
|
|
59
|
+
|
|
60
|
+
export default function useInstrumentsService() {
|
|
61
|
+
if (!api) api = new InstrumentsService()
|
|
62
|
+
return api
|
|
63
|
+
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import ApiService from '../settings/ApiService'
|
|
2
2
|
import { ResponseApi } from '../types/Api_Service'
|
|
3
|
-
import { Api_Search_User, Api_Search_Instruments } from '../types/Api_Search'
|
|
3
|
+
import { Api_Search_User, Api_Search_Instruments, Api_Search_Module } from '../types/Api_Search'
|
|
4
4
|
|
|
5
5
|
class SearchService extends ApiService {
|
|
6
6
|
public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>> {
|
|
7
7
|
return this.get<ResponseApi<Api_Search_User[]>>('search/users', { params })
|
|
8
8
|
}
|
|
9
9
|
public fetchSearchInstruments(params: any): Promise<ResponseApi<Api_Search_Instruments[]>> {
|
|
10
|
-
return this.get<ResponseApi<
|
|
10
|
+
return this.get<ResponseApi<Api_Search_Instruments[]>>('search/instrument_type', { params })
|
|
11
|
+
}
|
|
12
|
+
public fetchSearchModules(params: any): Promise<ResponseApi<Api_Search_Module[]>> {
|
|
13
|
+
return this.get<ResponseApi<Api_Search_Module[]>>('search/modules', { params })
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
16
|
|