shared-ritm 1.2.116 → 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 +86 -78
- 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-layout/components/AppLayoutHeader.vue +1 -1
- 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,72 +1,72 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
|
|
3
|
-
import { ResponseApi } from '../types/Api_Service'
|
|
4
|
-
import { Api_Project_Dto } from '../types/Api_Projects'
|
|
5
|
-
|
|
6
|
-
class ProjectsService extends ApiService {
|
|
7
|
-
public async fetchProjectById(id: string): Promise<Api_Project_Dto> {
|
|
8
|
-
return this.get(`/projects/${id}`)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public createProject(params: any): Promise<Api_Project_Dto> {
|
|
12
|
-
return this.post<any, Api_Project_Dto>('/projects', params)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public editProject(id: string, params: any): Promise<Api_Project_Dto> {
|
|
16
|
-
return this.put<any, Api_Project_Dto>(`/projects/${id}`, params)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public fetchProjects(params: any): Promise<ResponseApi<Api_Project_Dto[]>> {
|
|
20
|
-
return this.get(`/search/projects`, { params })
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public cloneProject(project: Api_Project_Dto): Promise<Api_Project_Dto> {
|
|
24
|
-
return this.post<Api_Project_Dto, Api_Project_Dto>(`projects/${project.id}/clone`, project)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public archiveProject(id: string, data: any): Promise<ResponseApi<any>> {
|
|
28
|
-
return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public unArchiveProject(id: string, data: any): Promise<ResponseApi<any>> {
|
|
32
|
-
return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public moveAprProject(id: string): Promise<ResponseApi<any>> {
|
|
36
|
-
return this.post<any, ResponseApi<any>>('repairs/move_plan_to_real', {
|
|
37
|
-
repairs: [id],
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
public restoreProject(id: string): Promise<ResponseApi<any>> {
|
|
41
|
-
return this.post<any, ResponseApi<any>>('/restore_project', { projects_ids: [id] })
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public importTasks(payload: any): Promise<ResponseApi<any>> {
|
|
45
|
-
return this.post<any, ResponseApi<any>>('tasks/import', payload)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public importKtd(payload: any): Promise<ResponseApi<any>> {
|
|
49
|
-
return this.post<any, ResponseApi<any>>('/parse_ktd', payload, {
|
|
50
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public fetchProjectTeamList(id: string): Promise<ResponseApi<any>> {
|
|
55
|
-
return this.put<any, ResponseApi<any>>(`/projects/${id}`, null)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public deleteProject(id: string): Promise<any> {
|
|
59
|
-
return this.delete<ResponseApi<any>>(`/projects/${id}`)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public getDynamicProgressWidget(id: string): Promise<any> {
|
|
63
|
-
return this.get<ResponseApi<any>>(`repairs/get_repair_list_dynamics_performance?repair_id_list[]=${id}`)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
let api: ProjectsService
|
|
68
|
-
|
|
69
|
-
export default function useProjectsService() {
|
|
70
|
-
if (!api) api = new ProjectsService()
|
|
71
|
-
return api
|
|
72
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
|
|
3
|
+
import { ResponseApi } from '../types/Api_Service'
|
|
4
|
+
import { Api_Project_Dto } from '../types/Api_Projects'
|
|
5
|
+
|
|
6
|
+
class ProjectsService extends ApiService {
|
|
7
|
+
public async fetchProjectById(id: string): Promise<Api_Project_Dto> {
|
|
8
|
+
return this.get(`/projects/${id}`)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public createProject(params: any): Promise<Api_Project_Dto> {
|
|
12
|
+
return this.post<any, Api_Project_Dto>('/projects', params)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public editProject(id: string, params: any): Promise<Api_Project_Dto> {
|
|
16
|
+
return this.put<any, Api_Project_Dto>(`/projects/${id}`, params)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public fetchProjects(params: any): Promise<ResponseApi<Api_Project_Dto[]>> {
|
|
20
|
+
return this.get(`/search/projects`, { params })
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public cloneProject(project: Api_Project_Dto): Promise<Api_Project_Dto> {
|
|
24
|
+
return this.post<Api_Project_Dto, Api_Project_Dto>(`projects/${project.id}/clone`, project)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public archiveProject(id: string, data: any): Promise<ResponseApi<any>> {
|
|
28
|
+
return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public unArchiveProject(id: string, data: any): Promise<ResponseApi<any>> {
|
|
32
|
+
return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public moveAprProject(id: string): Promise<ResponseApi<any>> {
|
|
36
|
+
return this.post<any, ResponseApi<any>>('repairs/move_plan_to_real', {
|
|
37
|
+
repairs: [id],
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
public restoreProject(id: string): Promise<ResponseApi<any>> {
|
|
41
|
+
return this.post<any, ResponseApi<any>>('/restore_project', { projects_ids: [id] })
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public importTasks(payload: any): Promise<ResponseApi<any>> {
|
|
45
|
+
return this.post<any, ResponseApi<any>>('tasks/import', payload)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public importKtd(payload: any): Promise<ResponseApi<any>> {
|
|
49
|
+
return this.post<any, ResponseApi<any>>('/parse_ktd', payload, {
|
|
50
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public fetchProjectTeamList(id: string): Promise<ResponseApi<any>> {
|
|
55
|
+
return this.put<any, ResponseApi<any>>(`/projects/${id}`, null)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public deleteProject(id: string): Promise<any> {
|
|
59
|
+
return this.delete<ResponseApi<any>>(`/projects/${id}`)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public getDynamicProgressWidget(id: string): Promise<any> {
|
|
63
|
+
return this.get<ResponseApi<any>>(`repairs/get_repair_list_dynamics_performance?repair_id_list[]=${id}`)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let api: ProjectsService
|
|
68
|
+
|
|
69
|
+
export default function useProjectsService() {
|
|
70
|
+
if (!api) api = new ProjectsService()
|
|
71
|
+
return api
|
|
72
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import ApiService from '../settings/ApiService'
|
|
2
|
-
import { ResponseApi } from '../types/Api_Service'
|
|
3
|
-
import { Api_Search_User, Api_Search_Instruments, Api_Search_Module } from '../types/Api_Search'
|
|
4
|
-
|
|
5
|
-
class SearchService extends ApiService {
|
|
6
|
-
public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>> {
|
|
7
|
-
return this.get<ResponseApi<Api_Search_User[]>>('search/users', { params })
|
|
8
|
-
}
|
|
9
|
-
public fetchSearchInstruments(params: any): Promise<ResponseApi<Api_Search_Instruments[]>> {
|
|
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 })
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let api: SearchService
|
|
18
|
-
|
|
19
|
-
export default function useSearchService() {
|
|
20
|
-
if (!api) api = new SearchService()
|
|
21
|
-
return api
|
|
22
|
-
}
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { ResponseApi } from '../types/Api_Service'
|
|
3
|
+
import { Api_Search_User, Api_Search_Instruments, Api_Search_Module } from '../types/Api_Search'
|
|
4
|
+
|
|
5
|
+
class SearchService extends ApiService {
|
|
6
|
+
public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>> {
|
|
7
|
+
return this.get<ResponseApi<Api_Search_User[]>>('search/users', { params })
|
|
8
|
+
}
|
|
9
|
+
public fetchSearchInstruments(params: any): Promise<ResponseApi<Api_Search_Instruments[]>> {
|
|
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 })
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let api: SearchService
|
|
18
|
+
|
|
19
|
+
export default function useSearchService() {
|
|
20
|
+
if (!api) api = new SearchService()
|
|
21
|
+
return api
|
|
22
|
+
}
|
|
@@ -1,101 +1,101 @@
|
|
|
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
|
-
public async checkUserVectors(id: string): Promise<{ count: number }> {
|
|
82
|
-
return await this.get(`/user/get-vectors/${id}`)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public async addUserVectors(formData: FormData): Promise<{ response: string }> {
|
|
86
|
-
return await this.post(`/user/add-vector`, formData, {
|
|
87
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
public async removeUserVectors(id: string): Promise<unknown> {
|
|
92
|
-
return await this.delete(`/user/delete-vectors/${id}`)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
let api: UserService
|
|
97
|
-
|
|
98
|
-
export default function useUserService() {
|
|
99
|
-
if (!api) api = new UserService()
|
|
100
|
-
return api
|
|
101
|
-
}
|
|
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
|
+
public async checkUserVectors(id: string): Promise<{ count: number }> {
|
|
82
|
+
return await this.get(`/user/get-vectors/${id}`)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public async addUserVectors(formData: FormData): Promise<{ response: string }> {
|
|
86
|
+
return await this.post(`/user/add-vector`, formData, {
|
|
87
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public async removeUserVectors(id: string): Promise<unknown> {
|
|
92
|
+
return await this.delete(`/user/delete-vectors/${id}`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let api: UserService
|
|
97
|
+
|
|
98
|
+
export default function useUserService() {
|
|
99
|
+
if (!api) api = new UserService()
|
|
100
|
+
return api
|
|
101
|
+
}
|
|
@@ -1,66 +1,71 @@
|
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import ApiService from '../settings/ApiService'
|
|
2
|
+
import { ResponseApi } from '@/api/types/Api_Service'
|
|
3
|
+
import {
|
|
4
|
+
Api_Video_Source_By_Repair,
|
|
5
|
+
Api_Video_Source_Create,
|
|
6
|
+
Api_Video_Source_Search,
|
|
7
|
+
Api_Work_Zone,
|
|
8
|
+
Api_Work_Zone_Search,
|
|
9
|
+
} from '@/api/types/Api_Video'
|
|
10
|
+
|
|
11
|
+
class VideoService extends ApiService {
|
|
12
|
+
public async startVideoAnalytics(): Promise<boolean> {
|
|
13
|
+
return await this.post('/statanly/start', null)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public reloadVideoAnalytics(ids: string[]): Promise<any> {
|
|
17
|
+
return this.post('/horizon/video-source/reload', { video_source_ids: ids })
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public hardReloadStream(): Promise<any> {
|
|
21
|
+
return this.post('horizon/video-source/streams/add', null)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async fetchWorkZones(params?: any): Promise<ResponseApi<Api_Work_Zone_Search[]>> {
|
|
25
|
+
return await this.get('/search/work_zones', { params })
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public async fetchWorkZone(id: string): Promise<ResponseApi<Api_Work_Zone>> {
|
|
29
|
+
return await this.get(`/work_zone/get_work_zone/${id}`)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public async editWorkZone(id: string, body: { title: string }): Promise<{ data: Api_Work_Zone; status: number }> {
|
|
33
|
+
return await this.put(`/admin/work-zones/${id}`, body)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public async deleteWorkZone(id: string): Promise<{ data: boolean; status: number }> {
|
|
37
|
+
return await this.delete(`/admin/work-zones/${id}`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public async fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>> {
|
|
41
|
+
return await this.get('/search/video_sources', { params })
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public async createVideoSource(
|
|
45
|
+
body: Api_Video_Source_Create,
|
|
46
|
+
): Promise<{ data: Api_Video_Source_Search; status: number }> {
|
|
47
|
+
return await this.post('horizon/video-source', body)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public async editVideoSource(
|
|
51
|
+
id: string,
|
|
52
|
+
body: Partial<Api_Video_Source_Create>,
|
|
53
|
+
): Promise<{ data: Api_Video_Source_Search; status: number }> {
|
|
54
|
+
return await this.put(`/horizon/video-source/${id}`, body)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public async deleteVideoSource(id: string): Promise<void> {
|
|
58
|
+
await this.delete(`/horizon/video-source/${id}`)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async fetchListRepairsVideoSource(params?: any): Promise<Api_Video_Source_By_Repair[]> {
|
|
62
|
+
return await this.get('work_zone/get_list_video_source_by_repair', { params })
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let api: VideoService
|
|
67
|
+
|
|
68
|
+
export default function useVideoService() {
|
|
69
|
+
if (!api) api = new VideoService()
|
|
70
|
+
return api
|
|
71
|
+
}
|