shared-ritm 1.2.97 → 1.2.98
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 +1461 -1437
- package/dist/shared-ritm.umd.js +27 -27
- package/dist/types/api/services/PhotoService.d.ts +38 -51
- package/dist/types/api/services/VideoService.d.ts +11 -1
- package/dist/types/api/types/Api_Video.d.ts +31 -0
- package/package.json +64 -64
- package/src/api/services/InstrumentsService.ts +22 -22
- package/src/api/services/UserService.ts +87 -87
- package/src/api/services/VideoService.ts +62 -36
- package/src/api/settings/ApiService.ts +123 -123
- package/src/api/types/Api_Instruments.ts +98 -98
- package/src/api/types/Api_User.ts +117 -117
- package/src/api/types/Api_Video.ts +123 -90
- package/src/common/app-input-new/AppInputNew.vue +17 -2
- 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 +312 -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 +331 -331
- package/src/common/app-table/controllers/useBaseTable.ts +45 -45
- package/src/index.ts +113 -113
- 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_Work_Zone, Api_Work_Zone_Search } from '@/api/types/Api_Video';
|
|
3
|
+
import { 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>;
|
|
@@ -16,6 +16,16 @@ declare class VideoService extends ApiService {
|
|
|
16
16
|
data: boolean;
|
|
17
17
|
status: number;
|
|
18
18
|
}>;
|
|
19
|
+
fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>>;
|
|
20
|
+
createVideoSource(body: Api_Video_Source_Create): Promise<{
|
|
21
|
+
data: Api_Video_Source_Search;
|
|
22
|
+
status: number;
|
|
23
|
+
}>;
|
|
24
|
+
editVideoSource(id: string, body: Partial<Api_Video_Source_Create>): Promise<{
|
|
25
|
+
data: Api_Video_Source_Search;
|
|
26
|
+
status: number;
|
|
27
|
+
}>;
|
|
28
|
+
deleteVideoSource(id: string): Promise<void>;
|
|
19
29
|
}
|
|
20
30
|
export default function useVideoService(): VideoService;
|
|
21
31
|
export {};
|
|
@@ -85,3 +85,34 @@ export type Api_Work_Zone = {
|
|
|
85
85
|
warehouse_by_work_zone_instruments: unknown[];
|
|
86
86
|
tasks: Api_Work_Zone_Task[];
|
|
87
87
|
};
|
|
88
|
+
export type Api_Video_Source_Search = {
|
|
89
|
+
comment: string;
|
|
90
|
+
domed: boolean;
|
|
91
|
+
fps: string;
|
|
92
|
+
height: number;
|
|
93
|
+
id: string;
|
|
94
|
+
interactive_zones: unknown;
|
|
95
|
+
login: string;
|
|
96
|
+
name: string;
|
|
97
|
+
password: string;
|
|
98
|
+
related_video_sources: unknown[];
|
|
99
|
+
shapes: unknown[];
|
|
100
|
+
snapshot_path: string;
|
|
101
|
+
url: string;
|
|
102
|
+
video_source: Api_Video_Source_Search[];
|
|
103
|
+
width: number;
|
|
104
|
+
work_zones: unknown[];
|
|
105
|
+
};
|
|
106
|
+
export type Api_Video_Source_Create = {
|
|
107
|
+
fps: string;
|
|
108
|
+
height: number;
|
|
109
|
+
login: string;
|
|
110
|
+
name: string;
|
|
111
|
+
password: string;
|
|
112
|
+
url: string;
|
|
113
|
+
width: number;
|
|
114
|
+
comment?: string;
|
|
115
|
+
domed?: boolean;
|
|
116
|
+
video_source_ids?: string[];
|
|
117
|
+
snapshot?: string;
|
|
118
|
+
};
|
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.98",
|
|
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,22 +1,22 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import { Api_instruments_HistoryResponse } from '../types/Api_Instruments'
|
|
3
|
-
|
|
4
|
-
class InstrumentsService extends ApiService {
|
|
5
|
-
public async fetchUserInstrumentsHistory(id: string, page?: number): Promise<Api_instruments_HistoryResponse> {
|
|
6
|
-
const params = {
|
|
7
|
-
status: 'issued',
|
|
8
|
-
page,
|
|
9
|
-
desc: 'desc',
|
|
10
|
-
column: 'issued_in',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return await this.get(`users/${id}/instruments`, { params })
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let api: InstrumentsService
|
|
18
|
-
|
|
19
|
-
export default function useInstrumentsService() {
|
|
20
|
-
if (!api) api = new InstrumentsService()
|
|
21
|
-
return api
|
|
22
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { Api_instruments_HistoryResponse } from '../types/Api_Instruments'
|
|
3
|
+
|
|
4
|
+
class InstrumentsService extends ApiService {
|
|
5
|
+
public async fetchUserInstrumentsHistory(id: string, page?: number): Promise<Api_instruments_HistoryResponse> {
|
|
6
|
+
const params = {
|
|
7
|
+
status: 'issued',
|
|
8
|
+
page,
|
|
9
|
+
desc: 'desc',
|
|
10
|
+
column: 'issued_in',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return await this.get(`users/${id}/instruments`, { params })
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let api: InstrumentsService
|
|
18
|
+
|
|
19
|
+
export default function useInstrumentsService() {
|
|
20
|
+
if (!api) api = new InstrumentsService()
|
|
21
|
+
return api
|
|
22
|
+
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import {
|
|
3
|
-
Api_User,
|
|
4
|
-
Api_User_Create,
|
|
5
|
-
Api_User_Delete_Body,
|
|
6
|
-
Api_User_Delete_Photos_Body,
|
|
7
|
-
Api_User_Position,
|
|
8
|
-
Api_User_Role,
|
|
9
|
-
Api_User_Team,
|
|
10
|
-
Api_User_Team_Search,
|
|
11
|
-
} from '../types/Api_User'
|
|
12
|
-
import { ResponseApi } from '../types/Api_Service'
|
|
13
|
-
|
|
14
|
-
class UserService extends ApiService {
|
|
15
|
-
public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
|
|
16
|
-
return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public async getUser(id: string): Promise<Api_User> {
|
|
20
|
-
return await this.get<Api_User>(`/admin/users/${id}`)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public async createUser(model: Api_User_Create): Promise<Api_User> {
|
|
24
|
-
return await this.post<Api_User_Create, Api_User>('/admin/users', model)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public async deleteUser({
|
|
28
|
-
user_id,
|
|
29
|
-
archive_reason,
|
|
30
|
-
}: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
|
|
31
|
-
return await this.post(`/users/archive_user`, { user_id, archive_reason })
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public async deleteUserPhotos({
|
|
35
|
-
user_id,
|
|
36
|
-
photos,
|
|
37
|
-
}: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
|
|
38
|
-
return await this.post(`/users/photos/delete`, { user_id, photos })
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
|
|
42
|
-
return await this.post(`/users/restore_user`, { user_id })
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
|
|
46
|
-
return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
|
|
50
|
-
return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
|
|
54
|
-
return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
|
|
58
|
-
return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
|
|
62
|
-
return await this.delete(`/admin/positions/${id}`)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
|
|
66
|
-
return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
|
|
70
|
-
return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
|
|
74
|
-
return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
|
|
78
|
-
return await this.delete(`/teams/${id}`)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
let api: UserService
|
|
83
|
-
|
|
84
|
-
export default function useUserService() {
|
|
85
|
-
if (!api) api = new UserService()
|
|
86
|
-
return api
|
|
87
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import {
|
|
3
|
+
Api_User,
|
|
4
|
+
Api_User_Create,
|
|
5
|
+
Api_User_Delete_Body,
|
|
6
|
+
Api_User_Delete_Photos_Body,
|
|
7
|
+
Api_User_Position,
|
|
8
|
+
Api_User_Role,
|
|
9
|
+
Api_User_Team,
|
|
10
|
+
Api_User_Team_Search,
|
|
11
|
+
} from '../types/Api_User'
|
|
12
|
+
import { ResponseApi } from '../types/Api_Service'
|
|
13
|
+
|
|
14
|
+
class UserService extends ApiService {
|
|
15
|
+
public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
|
|
16
|
+
return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public async getUser(id: string): Promise<Api_User> {
|
|
20
|
+
return await this.get<Api_User>(`/admin/users/${id}`)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async createUser(model: Api_User_Create): Promise<Api_User> {
|
|
24
|
+
return await this.post<Api_User_Create, Api_User>('/admin/users', model)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async deleteUser({
|
|
28
|
+
user_id,
|
|
29
|
+
archive_reason,
|
|
30
|
+
}: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
|
|
31
|
+
return await this.post(`/users/archive_user`, { user_id, archive_reason })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public async deleteUserPhotos({
|
|
35
|
+
user_id,
|
|
36
|
+
photos,
|
|
37
|
+
}: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
|
|
38
|
+
return await this.post(`/users/photos/delete`, { user_id, photos })
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
|
|
42
|
+
return await this.post(`/users/restore_user`, { user_id })
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
|
|
46
|
+
return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
|
|
50
|
+
return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
|
|
54
|
+
return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
|
|
58
|
+
return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
|
|
62
|
+
return await this.delete(`/admin/positions/${id}`)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
|
|
66
|
+
return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
|
|
70
|
+
return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
|
|
74
|
+
return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
|
|
78
|
+
return await this.delete(`/teams/${id}`)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let api: UserService
|
|
83
|
+
|
|
84
|
+
export default function useUserService() {
|
|
85
|
+
if (!api) api = new UserService()
|
|
86
|
+
return api
|
|
87
|
+
}
|
|
@@ -1,36 +1,62 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import { ResponseApi } from '@/api/types/Api_Service'
|
|
3
|
-
import {
|
|
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
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { ResponseApi } from '@/api/types/Api_Service'
|
|
3
|
+
import {
|
|
4
|
+
Api_Video_Source_Create,
|
|
5
|
+
Api_Video_Source_Search,
|
|
6
|
+
Api_Work_Zone,
|
|
7
|
+
Api_Work_Zone_Search,
|
|
8
|
+
} from '@/api/types/Api_Video'
|
|
9
|
+
|
|
10
|
+
class VideoService extends ApiService {
|
|
11
|
+
public async startVideoAnalytics(): Promise<boolean> {
|
|
12
|
+
return await this.post('/statanly/start', null)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public reloadVideoAnalytics(ids: string[]): Promise<any> {
|
|
16
|
+
return this.post('/horizon/video-source/reload', { video_source_ids: ids })
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public async fetchWorkZones(params?: any): Promise<ResponseApi<Api_Work_Zone_Search[]>> {
|
|
20
|
+
return await this.get('/search/work_zones', { params })
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async fetchWorkZone(id: string): Promise<ResponseApi<Api_Work_Zone>> {
|
|
24
|
+
return await this.get(`/work_zone/get_work_zone/${id}`)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async editWorkZone(id: string, body: { title: string }): Promise<{ data: Api_Work_Zone; status: number }> {
|
|
28
|
+
return await this.put(`/admin/work-zones/${id}`, body)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async deleteWorkZone(id: string): Promise<{ data: boolean; status: number }> {
|
|
32
|
+
return await this.delete(`/admin/work-zones/${id}`)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public async fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>> {
|
|
36
|
+
return await this.get('/search/video_sources', { params })
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public async createVideoSource(
|
|
40
|
+
body: Api_Video_Source_Create,
|
|
41
|
+
): Promise<{ data: Api_Video_Source_Search; status: number }> {
|
|
42
|
+
return await this.post('horizon/video-source', body)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async editVideoSource(
|
|
46
|
+
id: string,
|
|
47
|
+
body: Partial<Api_Video_Source_Create>,
|
|
48
|
+
): Promise<{ data: Api_Video_Source_Search; status: number }> {
|
|
49
|
+
return await this.put(`/horizon/video-source/${id}`, body)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public async deleteVideoSource(id: string): Promise<void> {
|
|
53
|
+
await this.delete(`/horizon/video-source/${id}`)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let api: VideoService
|
|
58
|
+
|
|
59
|
+
export default function useVideoService() {
|
|
60
|
+
if (!api) api = new VideoService()
|
|
61
|
+
return api
|
|
62
|
+
}
|