shared-ritm 1.2.86 → 1.2.88
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 +47 -17
- package/dist/shared-ritm.umd.js +3 -3
- package/dist/types/api/services/MetricsService.d.ts +5 -5
- package/dist/types/api/services/PhotoService.d.ts +38 -51
- package/dist/types/api/services/UserService.d.ts +23 -2
- package/dist/types/api/settings/ApiService.d.ts +1 -0
- package/dist/types/api/types/Api_User.d.ts +28 -1
- package/package.json +64 -64
- package/src/api/services/MetricsService.ts +5 -5
- package/src/api/services/UserService.ts +44 -5
- package/src/api/settings/ApiService.ts +11 -7
- package/src/api/types/Api_User.ts +31 -1
- package/src/common/app-table/components/ModalSelect.vue +270 -270
- package/src/common/app-table/components/TableModal.vue +5 -3
- 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
|
@@ -5,7 +5,7 @@ declare class MetricsService extends ApiService {
|
|
|
5
5
|
fetchPieTasks(queryString: string): Promise<ResponseApi<any>>;
|
|
6
6
|
fetchPiePersonnel(queryString: string): Promise<ResponseApi<any>>;
|
|
7
7
|
fetchPersonnelData(queryString: string): Promise<ResponseApi<any>>;
|
|
8
|
-
fetchPersonnelInfo(params: string): Promise<
|
|
8
|
+
fetchPersonnelInfo(params: string): Promise<any>;
|
|
9
9
|
fetchPiePersonnelInfo(params: string): Promise<any>;
|
|
10
10
|
fetchPieCriticalPath(queryString: string): Promise<any[]>;
|
|
11
11
|
fetchPieCriticalPathInfo(params: string): Promise<any>;
|
|
@@ -22,10 +22,10 @@ declare class MetricsService extends ApiService {
|
|
|
22
22
|
fetchEconomicsInfo(params: string): Promise<any>;
|
|
23
23
|
fetchQualityMetrics(params: string): Promise<any>;
|
|
24
24
|
fetchQualityInfo(params: string): Promise<any>;
|
|
25
|
-
fetchPieWorkZone(queryString: string): Promise<
|
|
26
|
-
fetchWorkZoneInfo(queryString: string): Promise<
|
|
27
|
-
fetchPieAllTasks(queryString: string): Promise<
|
|
28
|
-
fetchPieAllTasksInfo(queryString: string): Promise<
|
|
25
|
+
fetchPieWorkZone(queryString: string): Promise<any>;
|
|
26
|
+
fetchWorkZoneInfo(queryString: string): Promise<any>;
|
|
27
|
+
fetchPieAllTasks(queryString: string): Promise<any>;
|
|
28
|
+
fetchPieAllTasksInfo(queryString: string): Promise<any>;
|
|
29
29
|
}
|
|
30
30
|
export default function useMetricsService(): MetricsService;
|
|
31
31
|
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,5 +1,5 @@
|
|
|
1
1
|
import ApiService from '../settings/ApiService';
|
|
2
|
-
import { Api_User, Api_User_Role } from '../types/Api_User';
|
|
2
|
+
import { Api_User, Api_User_Create, Api_User_Position, Api_User_Role, Api_User_Team, Api_User_Team_Search } from '../types/Api_User';
|
|
3
3
|
import { ResponseApi } from '../types/Api_Service';
|
|
4
4
|
declare class UserService extends ApiService {
|
|
5
5
|
editUser({ id, model }: {
|
|
@@ -7,7 +7,7 @@ declare class UserService extends ApiService {
|
|
|
7
7
|
model: any;
|
|
8
8
|
}): Promise<Api_User>;
|
|
9
9
|
getUser(id: string): Promise<Api_User>;
|
|
10
|
-
createUser(model:
|
|
10
|
+
createUser(model: Api_User_Create): Promise<Api_User>;
|
|
11
11
|
deleteUser(id: string): Promise<{
|
|
12
12
|
data: boolean;
|
|
13
13
|
status: number;
|
|
@@ -15,6 +15,27 @@ declare class UserService extends ApiService {
|
|
|
15
15
|
getRoles(params?: {
|
|
16
16
|
per_page?: number;
|
|
17
17
|
}): Promise<ResponseApi<Api_User_Role[]>>;
|
|
18
|
+
getPositions(params?: {
|
|
19
|
+
per_page?: number;
|
|
20
|
+
}): Promise<ResponseApi<Api_User_Position[]>>;
|
|
21
|
+
createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>>;
|
|
22
|
+
editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>>;
|
|
23
|
+
deletePosition(id: string): Promise<{
|
|
24
|
+
data: boolean;
|
|
25
|
+
status: number;
|
|
26
|
+
}>;
|
|
27
|
+
getTeams(params?: {
|
|
28
|
+
per_page?: number;
|
|
29
|
+
}): Promise<ResponseApi<Api_User_Team_Search[]>>;
|
|
30
|
+
createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>>;
|
|
31
|
+
editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{
|
|
32
|
+
data: boolean;
|
|
33
|
+
status: number;
|
|
34
|
+
}>;
|
|
35
|
+
deleteTeam(id: string): Promise<{
|
|
36
|
+
data: boolean;
|
|
37
|
+
status: number;
|
|
38
|
+
}>;
|
|
18
39
|
}
|
|
19
40
|
export default function useUserService(): UserService;
|
|
20
41
|
export {};
|
|
@@ -12,5 +12,6 @@ export default class ApiService {
|
|
|
12
12
|
protected get<T>(url: string, options?: AxiosRequestConfig): Promise<T>;
|
|
13
13
|
protected delete<T>(url: string, options?: AxiosRequestConfig): Promise<AxiosResponse<T, any>>;
|
|
14
14
|
protected post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<any>;
|
|
15
|
+
protected patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2>;
|
|
15
16
|
protected put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2>;
|
|
16
17
|
}
|
|
@@ -5,11 +5,16 @@ export type Api_User_Team = {
|
|
|
5
5
|
description: string;
|
|
6
6
|
created_at: string;
|
|
7
7
|
updated_at: string;
|
|
8
|
-
pivot
|
|
8
|
+
pivot?: {
|
|
9
9
|
team_id: string;
|
|
10
10
|
user_id: string;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
+
export type Api_User_Team_Search = {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
display_name: string;
|
|
17
|
+
};
|
|
13
18
|
export type Api_User_Photo = {
|
|
14
19
|
id: string;
|
|
15
20
|
name: string;
|
|
@@ -40,6 +45,22 @@ export type Api_User = {
|
|
|
40
45
|
teams: Api_User_Team[];
|
|
41
46
|
photos: Api_User_Photo[];
|
|
42
47
|
};
|
|
48
|
+
export type Api_User_Create = {
|
|
49
|
+
last_name?: string;
|
|
50
|
+
first_name?: string;
|
|
51
|
+
patronymic?: string;
|
|
52
|
+
email?: string;
|
|
53
|
+
phone?: string;
|
|
54
|
+
divisions?: string;
|
|
55
|
+
positions?: [string];
|
|
56
|
+
teams?: {
|
|
57
|
+
team_id: string;
|
|
58
|
+
roles: string[];
|
|
59
|
+
}[];
|
|
60
|
+
current_password?: string;
|
|
61
|
+
password?: string;
|
|
62
|
+
password_confirmation?: string;
|
|
63
|
+
};
|
|
43
64
|
export type Api_User_Permission = {
|
|
44
65
|
id: string;
|
|
45
66
|
name: string;
|
|
@@ -51,3 +72,9 @@ export type Api_User_Role = {
|
|
|
51
72
|
display_name: string;
|
|
52
73
|
permissions?: Api_User_Permission[];
|
|
53
74
|
};
|
|
75
|
+
export type Api_User_Position = {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
display_name: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
};
|
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.88",
|
|
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
|
+
}
|
|
@@ -18,7 +18,7 @@ class MetricsService extends ApiService {
|
|
|
18
18
|
return await this.get('repairs/metrics/list_position_intersection_group_by_status' + '?' + queryString)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
public async fetchPersonnelInfo(params: string): Promise<
|
|
21
|
+
public async fetchPersonnelInfo(params: string): Promise<any> {
|
|
22
22
|
return await this.get(`repairs/metrics/list_position_intersection_details?${params}`)
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -85,19 +85,19 @@ class MetricsService extends ApiService {
|
|
|
85
85
|
return await this.get(`repairs/metrics/get_list_task_by_quality?${params}`)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
public async fetchPieWorkZone(queryString: string): Promise<
|
|
88
|
+
public async fetchPieWorkZone(queryString: string): Promise<any> {
|
|
89
89
|
return await this.get('repairs/metrics/get_list_work_zone_instrument' + '?' + queryString)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
public async fetchWorkZoneInfo(queryString: string): Promise<
|
|
92
|
+
public async fetchWorkZoneInfo(queryString: string): Promise<any> {
|
|
93
93
|
return await this.get('repairs/metrics/get_list_work_zone_instrument_by_status' + '?' + queryString)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
public async fetchPieAllTasks(queryString: string): Promise<
|
|
96
|
+
public async fetchPieAllTasks(queryString: string): Promise<any> {
|
|
97
97
|
return await this.get('repairs/metrics/get_list_task_group_by_status' + '?' + queryString)
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
public async fetchPieAllTasksInfo(queryString: string): Promise<
|
|
100
|
+
public async fetchPieAllTasksInfo(queryString: string): Promise<any> {
|
|
101
101
|
return await this.get('repairs/metrics/get_list_task_by_status' + '?' + queryString)
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import ApiService from '../settings/ApiService'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Api_User,
|
|
4
|
+
Api_User_Create,
|
|
5
|
+
Api_User_Position,
|
|
6
|
+
Api_User_Role,
|
|
7
|
+
Api_User_Team,
|
|
8
|
+
Api_User_Team_Search,
|
|
9
|
+
} from '../types/Api_User'
|
|
3
10
|
import { ResponseApi } from '../types/Api_Service'
|
|
4
11
|
|
|
5
12
|
class UserService extends ApiService {
|
|
@@ -11,16 +18,48 @@ class UserService extends ApiService {
|
|
|
11
18
|
return await this.get<Api_User>(`/admin/users/${id}`)
|
|
12
19
|
}
|
|
13
20
|
|
|
14
|
-
public async createUser(model:
|
|
15
|
-
return await this.post<
|
|
21
|
+
public async createUser(model: Api_User_Create): Promise<Api_User> {
|
|
22
|
+
return await this.post<Api_User_Create, Api_User>('/admin/users', model)
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
public async deleteUser(id: string): Promise<{ data: boolean; status: number }> {
|
|
19
26
|
return await this.delete(`/admin/users/${id}`)
|
|
20
27
|
}
|
|
21
28
|
|
|
22
|
-
public getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
|
|
23
|
-
return this.get('/search/roles', { params })
|
|
29
|
+
public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
|
|
30
|
+
return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
|
|
34
|
+
return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
|
|
38
|
+
return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
|
|
42
|
+
return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
|
|
46
|
+
return await this.delete(`/admin/positions/${id}`)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
|
|
50
|
+
return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
|
|
54
|
+
return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
|
|
58
|
+
return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
|
|
62
|
+
return await this.delete(`/teams/${id}`)
|
|
24
63
|
}
|
|
25
64
|
}
|
|
26
65
|
|
|
@@ -99,13 +99,17 @@ export default class ApiService {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
protected async patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2> {
|
|
103
|
+
try {
|
|
104
|
+
const response: AxiosResponse<T2> = await this.axiosInstance.patch<T1, AxiosResponse<T2>>(url, payload, options)
|
|
105
|
+
return response.data
|
|
106
|
+
} catch (error) {
|
|
107
|
+
const axiosError = error as AxiosError
|
|
108
|
+
this.handleError(axiosError)
|
|
109
|
+
throw error
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
109
113
|
protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
|
|
110
114
|
try {
|
|
111
115
|
const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
|
|
@@ -5,12 +5,18 @@ export type Api_User_Team = {
|
|
|
5
5
|
description: string
|
|
6
6
|
created_at: string
|
|
7
7
|
updated_at: string
|
|
8
|
-
pivot
|
|
8
|
+
pivot?: {
|
|
9
9
|
team_id: string
|
|
10
10
|
user_id: string
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export type Api_User_Team_Search = {
|
|
15
|
+
id: string
|
|
16
|
+
name: string
|
|
17
|
+
display_name: string
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
export type Api_User_Photo = {
|
|
15
21
|
id: string
|
|
16
22
|
name: string
|
|
@@ -43,6 +49,23 @@ export type Api_User = {
|
|
|
43
49
|
photos: Api_User_Photo[]
|
|
44
50
|
}
|
|
45
51
|
|
|
52
|
+
export type Api_User_Create = {
|
|
53
|
+
last_name?: string
|
|
54
|
+
first_name?: string
|
|
55
|
+
patronymic?: string
|
|
56
|
+
email?: string
|
|
57
|
+
phone?: string
|
|
58
|
+
divisions?: string
|
|
59
|
+
positions?: [string]
|
|
60
|
+
teams?: {
|
|
61
|
+
team_id: string
|
|
62
|
+
roles: string[]
|
|
63
|
+
}[]
|
|
64
|
+
current_password?: string
|
|
65
|
+
password?: string
|
|
66
|
+
password_confirmation?: string
|
|
67
|
+
}
|
|
68
|
+
|
|
46
69
|
export type Api_User_Permission = {
|
|
47
70
|
id: string
|
|
48
71
|
name: string
|
|
@@ -55,3 +78,10 @@ export type Api_User_Role = {
|
|
|
55
78
|
display_name: string
|
|
56
79
|
permissions?: Api_User_Permission[]
|
|
57
80
|
}
|
|
81
|
+
|
|
82
|
+
export type Api_User_Position = {
|
|
83
|
+
id: string
|
|
84
|
+
name: string
|
|
85
|
+
display_name: string
|
|
86
|
+
description?: string
|
|
87
|
+
}
|