shared-ritm 1.2.117 → 1.2.118
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 +13 -8
- package/dist/shared-ritm.umd.js +6 -6
- package/dist/types/api/services/PhotoService.d.ts +38 -51
- package/dist/types/api/services/VideoService.d.ts +2 -1
- package/dist/types/api/types/Api_Repairs.d.ts +12 -11
- package/dist/types/api/types/Api_Video.d.ts +16 -1
- 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 -63
- package/src/api/services/ModulesService.ts +27 -27
- package/src/api/services/ProjectsService.ts +72 -72
- package/src/api/services/SearchService.ts +22 -22
- package/src/api/services/UserService.ts +101 -101
- package/src/api/services/VideoService.ts +71 -66
- package/src/api/settings/ApiService.ts +124 -124
- 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 -136
- package/src/api/types/Api_Modules.ts +21 -21
- package/src/api/types/Api_Repairs.ts +8 -6
- package/src/api/types/Api_Search.ts +77 -77
- package/src/api/types/Api_User.ts +117 -117
- package/src/api/types/Api_Video.ts +140 -123
- package/src/common/app-input-new/AppInputNew.vue +175 -175
- package/src/common/app-sheet-new/AppSheetNew.vue +246 -246
- package/src/common/app-table/AppTable.vue +314 -314
- 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 +122 -122
- 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,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,6 +1,6 @@
|
|
|
1
1
|
import ApiService from '../settings/ApiService';
|
|
2
2
|
import { ResponseApi } from '@/api/types/Api_Service';
|
|
3
|
-
import { Api_Video_Source_Create, Api_Video_Source_Search, Api_Work_Zone, Api_Work_Zone_Search } from '@/api/types/Api_Video';
|
|
3
|
+
import { Api_Video_Source_By_Repair, Api_Video_Source_Create, Api_Video_Source_Search, Api_Work_Zone, Api_Work_Zone_Search } from '@/api/types/Api_Video';
|
|
4
4
|
declare class VideoService extends ApiService {
|
|
5
5
|
startVideoAnalytics(): Promise<boolean>;
|
|
6
6
|
reloadVideoAnalytics(ids: string[]): Promise<any>;
|
|
@@ -27,6 +27,7 @@ declare class VideoService extends ApiService {
|
|
|
27
27
|
status: number;
|
|
28
28
|
}>;
|
|
29
29
|
deleteVideoSource(id: string): Promise<void>;
|
|
30
|
+
fetchListRepairsVideoSource(params?: any): Promise<Api_Video_Source_By_Repair[]>;
|
|
30
31
|
}
|
|
31
32
|
export default function useVideoService(): VideoService;
|
|
32
33
|
export {};
|
|
@@ -26,20 +26,21 @@ export type Api_Equipment_Full_Dto = {
|
|
|
26
26
|
repair_frequency: number;
|
|
27
27
|
repair_range: number;
|
|
28
28
|
};
|
|
29
|
+
export type Api_Work_Zone_By_Tasks = {
|
|
30
|
+
coordinates: {
|
|
31
|
+
x0: number;
|
|
32
|
+
x1: number;
|
|
33
|
+
y0: number;
|
|
34
|
+
y1: number;
|
|
35
|
+
};
|
|
36
|
+
id: string;
|
|
37
|
+
tasks: unknown[];
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
29
40
|
export type Api_Task_Video_Source = {
|
|
30
41
|
id: string;
|
|
31
42
|
name: string;
|
|
32
|
-
work_zones_by_tasks:
|
|
33
|
-
coordinates: {
|
|
34
|
-
x0: number;
|
|
35
|
-
x1: number;
|
|
36
|
-
y0: number;
|
|
37
|
-
y1: number;
|
|
38
|
-
};
|
|
39
|
-
id: string;
|
|
40
|
-
tasks: unknown[];
|
|
41
|
-
title: string;
|
|
42
|
-
}>;
|
|
43
|
+
work_zones_by_tasks: Api_Work_Zone_By_Tasks[];
|
|
43
44
|
};
|
|
44
45
|
export type Api_Task_Video_Source_Stream = {
|
|
45
46
|
id: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Api_Status_DTO } from '@/api/types/Api_Tasks';
|
|
2
|
+
import { Api_Work_Zone_By_Tasks } from '@/api/types/Api_Repairs';
|
|
2
3
|
export type Api_Video_Source = {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
@@ -64,7 +65,7 @@ export type Api_Work_Zone_Task = {
|
|
|
64
65
|
fact_start_date: null | string;
|
|
65
66
|
fact_end_date: null | string;
|
|
66
67
|
time_to_complete_sec: number | null;
|
|
67
|
-
status: Api_Status_DTO
|
|
68
|
+
status: Api_Status_DTO;
|
|
68
69
|
usage_users: Api_Work_Zone_Usage_User[];
|
|
69
70
|
};
|
|
70
71
|
export type Api_Work_Zone_Coords = {
|
|
@@ -116,3 +117,17 @@ export type Api_Video_Source_Create = {
|
|
|
116
117
|
video_source_ids?: string[];
|
|
117
118
|
snapshot?: string;
|
|
118
119
|
};
|
|
120
|
+
export type Api_Video_Source_By_Repair_Project = {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
deadline: string;
|
|
124
|
+
};
|
|
125
|
+
export type Api_Video_Source_By_Repair = {
|
|
126
|
+
list_video_source: {
|
|
127
|
+
id: string;
|
|
128
|
+
name: string;
|
|
129
|
+
url: string;
|
|
130
|
+
work_zones_by_tasks: Api_Work_Zone_By_Tasks[];
|
|
131
|
+
}[];
|
|
132
|
+
project: Api_Video_Source_By_Repair_Project;
|
|
133
|
+
};
|
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.118",
|
|
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,63 +1,63 @@
|
|
|
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
|
+
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,27 +1,27 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import { Api_Module, Api_Module_Create } from '../types/Api_Modules'
|
|
3
|
-
|
|
4
|
-
class ModulesService extends ApiService {
|
|
5
|
-
public async detectModule(id: string): Promise<{ data: string; status: number }> {
|
|
6
|
-
return await this.get(`module/${id}/detect`)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
public async createModule(model: Api_Module_Create): Promise<Api_Module> {
|
|
10
|
-
return await this.post('admin/modules', model)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public async editModule({ id, model }: { id: string; model: Partial<Api_Module_Create> }): Promise<Api_Module> {
|
|
14
|
-
return await this.put(`admin/modules/${id}`, model)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public deleteModule(id: string): Promise<{ data: boolean; status: number }> {
|
|
18
|
-
return this.delete(`admin/modules/${id}`)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let api: ModulesService
|
|
23
|
-
|
|
24
|
-
export default function useModulesService() {
|
|
25
|
-
if (!api) api = new ModulesService()
|
|
26
|
-
return api
|
|
27
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { Api_Module, Api_Module_Create } from '../types/Api_Modules'
|
|
3
|
+
|
|
4
|
+
class ModulesService extends ApiService {
|
|
5
|
+
public async detectModule(id: string): Promise<{ data: string; status: number }> {
|
|
6
|
+
return await this.get(`module/${id}/detect`)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
public async createModule(model: Api_Module_Create): Promise<Api_Module> {
|
|
10
|
+
return await this.post('admin/modules', model)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public async editModule({ id, model }: { id: string; model: Partial<Api_Module_Create> }): Promise<Api_Module> {
|
|
14
|
+
return await this.put(`admin/modules/${id}`, model)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public deleteModule(id: string): Promise<{ data: boolean; status: number }> {
|
|
18
|
+
return this.delete(`admin/modules/${id}`)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let api: ModulesService
|
|
23
|
+
|
|
24
|
+
export default function useModulesService() {
|
|
25
|
+
if (!api) api = new ModulesService()
|
|
26
|
+
return api
|
|
27
|
+
}
|