shared-ritm 1.1.46 → 1.1.48
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/shared-ritm.es.js +61355 -32897
- package/dist/shared-ritm.umd.js +72 -57
- package/dist/types/api/services/TasksService.d.ts +2 -0
- package/package.json +1 -1
- package/src/api/services/RepairsService.ts +98 -98
- package/src/api/services/TasksService.ts +48 -43
- package/src/api/types/Api_Repairs.ts +63 -63
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import ApiService, { ResponseApi } from '@/api/settings/ApiService';
|
|
2
2
|
import { Api_Tasks_Dto, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks';
|
|
3
|
+
import { Api_Equipment_Full_Dto } from '@/api/types/Api_Repairs';
|
|
3
4
|
declare class TasksService extends ApiService {
|
|
4
5
|
fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>>;
|
|
5
6
|
fetchTasksList(params: any): Promise<ResponseApi<Api_Tasks_Dto[]>>;
|
|
6
7
|
fetchSubtasksList(id: string): Promise<ResponseApi<Api_Tasks_Dto[]>>;
|
|
7
8
|
fetchTaskBranch(id: string): Promise<ResponseApi<any>>;
|
|
8
9
|
fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>>;
|
|
10
|
+
fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>>;
|
|
9
11
|
createTask(payload: any): Promise<ResponseApi<any>>;
|
|
10
12
|
mergeTask(payload: {
|
|
11
13
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import ApiService, { ResponseApi } from '@/api/settings/ApiService'
|
|
2
|
-
import {
|
|
3
|
-
Api_Create_Repair_With_Equipments,
|
|
4
|
-
Api_Equipment_Full_Dto,
|
|
5
|
-
Api_Repair_Dto,
|
|
6
|
-
Api_Update_Repair,
|
|
7
|
-
OptionFilters,
|
|
8
|
-
} from '@/api/types/Api_Repairs'
|
|
9
|
-
|
|
10
|
-
class RepairsService extends ApiService {
|
|
11
|
-
public fetchFilters(fullParams: string): Promise<OptionFilters> {
|
|
12
|
-
return this.get(`get_list_repair?smart=1&${fullParams}`)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public fetchRepairs(
|
|
16
|
-
isQuery: boolean,
|
|
17
|
-
queries?: string,
|
|
18
|
-
hasTeams?: boolean | string,
|
|
19
|
-
teamsFilter?: string,
|
|
20
|
-
typeFilter?: string,
|
|
21
|
-
): Promise<ResponseApi<Api_Repair_Dto[]>> {
|
|
22
|
-
return this.get(
|
|
23
|
-
'get_list_repair' +
|
|
24
|
-
(isQuery
|
|
25
|
-
? `${queries}&per_page=100000${typeFilter ? '&' + typeFilter : ''}&${!hasTeams ? teamsFilter : ''}`
|
|
26
|
-
: `?per_page=100000${typeFilter ? '&' + typeFilter : ''}&${teamsFilter}`),
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
|
|
31
|
-
return this.get('repairs/equipment/list?per_page=100000')
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public createRepair(payload: Api_Create_Repair_With_Equipments) {
|
|
35
|
-
return this.post<Api_Create_Repair_With_Equipments, any>('/repairs/equipments', payload)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public startRepair(id: string): Promise<void> {
|
|
39
|
-
return this.post<null, void>(`/repairs/${id}/start`, null)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public finishRepair(id: string) {
|
|
43
|
-
return this.post<null, void>(`/repairs/${id}/finish`, null)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public finishPreparationProject(id: string) {
|
|
47
|
-
return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public moveRepairToCurrent(id: string) {
|
|
51
|
-
return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
|
|
52
|
-
repairs: [id],
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
public moveArchiveToCurrent(id: string) {
|
|
57
|
-
return this.post<any, void>(`/repairs/transfer_repair_archive_to_current`, {
|
|
58
|
-
repairs_ids: [id],
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public moveRepairToApr(id: string) {
|
|
63
|
-
return this.post<any, void>(`/repairs/transfer_repair_current_to_plan`, {
|
|
64
|
-
repairs: [id],
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public moveRepairToArchive(id: string) {
|
|
69
|
-
return this.post<any, void>(`/repairs/transfer_repair_current_to_archive`, {
|
|
70
|
-
repairs_ids: [id],
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public restoreRepair(id: string) {
|
|
75
|
-
return this.post<any, void>(`/restore_repair`, {
|
|
76
|
-
repairs_ids: [id],
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public updateRepair(payload: Api_Update_Repair, id: string) {
|
|
81
|
-
return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public copyRepair(id: string) {
|
|
85
|
-
return this.post<null, any>(`/repairs/${id}/clone`, null)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public deleteRepair(id: string) {
|
|
89
|
-
return this.delete<any>(`/repairs/${id}`)
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
let api: RepairsService
|
|
94
|
-
|
|
95
|
-
export default function useRepairsService() {
|
|
96
|
-
if (!api) api = new RepairsService()
|
|
97
|
-
return api
|
|
98
|
-
}
|
|
1
|
+
import ApiService, { ResponseApi } from '@/api/settings/ApiService'
|
|
2
|
+
import {
|
|
3
|
+
Api_Create_Repair_With_Equipments,
|
|
4
|
+
Api_Equipment_Full_Dto,
|
|
5
|
+
Api_Repair_Dto,
|
|
6
|
+
Api_Update_Repair,
|
|
7
|
+
OptionFilters,
|
|
8
|
+
} from '@/api/types/Api_Repairs'
|
|
9
|
+
|
|
10
|
+
class RepairsService extends ApiService {
|
|
11
|
+
public fetchFilters(fullParams: string): Promise<OptionFilters> {
|
|
12
|
+
return this.get(`get_list_repair?smart=1&${fullParams}`)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public fetchRepairs(
|
|
16
|
+
isQuery: boolean,
|
|
17
|
+
queries?: string,
|
|
18
|
+
hasTeams?: boolean | string,
|
|
19
|
+
teamsFilter?: string,
|
|
20
|
+
typeFilter?: string,
|
|
21
|
+
): Promise<ResponseApi<Api_Repair_Dto[]>> {
|
|
22
|
+
return this.get(
|
|
23
|
+
'get_list_repair' +
|
|
24
|
+
(isQuery
|
|
25
|
+
? `${queries}&per_page=100000${typeFilter ? '&' + typeFilter : ''}&${!hasTeams ? teamsFilter : ''}`
|
|
26
|
+
: `?per_page=100000${typeFilter ? '&' + typeFilter : ''}&${teamsFilter}`),
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
|
|
31
|
+
return this.get('repairs/equipment/list?per_page=100000')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public createRepair(payload: Api_Create_Repair_With_Equipments) {
|
|
35
|
+
return this.post<Api_Create_Repair_With_Equipments, any>('/repairs/equipments', payload)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public startRepair(id: string): Promise<void> {
|
|
39
|
+
return this.post<null, void>(`/repairs/${id}/start`, null)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public finishRepair(id: string) {
|
|
43
|
+
return this.post<null, void>(`/repairs/${id}/finish`, null)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public finishPreparationProject(id: string) {
|
|
47
|
+
return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public moveRepairToCurrent(id: string) {
|
|
51
|
+
return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
|
|
52
|
+
repairs: [id],
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public moveArchiveToCurrent(id: string) {
|
|
57
|
+
return this.post<any, void>(`/repairs/transfer_repair_archive_to_current`, {
|
|
58
|
+
repairs_ids: [id],
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public moveRepairToApr(id: string) {
|
|
63
|
+
return this.post<any, void>(`/repairs/transfer_repair_current_to_plan`, {
|
|
64
|
+
repairs: [id],
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public moveRepairToArchive(id: string) {
|
|
69
|
+
return this.post<any, void>(`/repairs/transfer_repair_current_to_archive`, {
|
|
70
|
+
repairs_ids: [id],
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public restoreRepair(id: string) {
|
|
75
|
+
return this.post<any, void>(`/restore_repair`, {
|
|
76
|
+
repairs_ids: [id],
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public updateRepair(payload: Api_Update_Repair, id: string) {
|
|
81
|
+
return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public copyRepair(id: string) {
|
|
85
|
+
return this.post<null, any>(`/repairs/${id}/clone`, null)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public deleteRepair(id: string) {
|
|
89
|
+
return this.delete<any>(`/repairs/${id}`)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
let api: RepairsService
|
|
94
|
+
|
|
95
|
+
export default function useRepairsService() {
|
|
96
|
+
if (!api) api = new RepairsService()
|
|
97
|
+
return api
|
|
98
|
+
}
|
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
import ApiService, { ResponseApi } from '@/api/settings/ApiService'
|
|
2
|
-
import { Api_Tasks_Dto, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks'
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import ApiService, { ResponseApi } from '@/api/settings/ApiService'
|
|
2
|
+
import { Api_Tasks_Dto, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks'
|
|
3
|
+
import { Api_Equipment_Full_Dto } from '@/api/types/Api_Repairs'
|
|
4
|
+
|
|
5
|
+
class TasksService extends ApiService {
|
|
6
|
+
public async fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>> {
|
|
7
|
+
return await this.get(`/tasks/${id}`)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public async fetchTasksList(params: any): Promise<ResponseApi<Api_Tasks_Dto[]>> {
|
|
11
|
+
return await this.get('/list/tasks/search', { params })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public async fetchSubtasksList(id: string): Promise<ResponseApi<Api_Tasks_Dto[]>> {
|
|
15
|
+
return await this.get(`/task/${id}/subtasks/list`)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public async fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
|
|
19
|
+
return await this.get(`/get_list_task_branch?task_id=${id}`)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public async fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
|
|
23
|
+
return await this.get(`admin/instruments`, { params })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
|
|
27
|
+
return this.get('repairs/equipment/list', { params })
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public async createTask(payload: any): Promise<ResponseApi<any>> {
|
|
31
|
+
return await this.post(`tasks`, payload)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public async mergeTask(payload: { name: string; tasks_id: string[] }): Promise<ResponseApi<any>> {
|
|
35
|
+
return await this.post(`tasks/merge`, payload)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public async deleteTask(id: string): Promise<any> {
|
|
39
|
+
return await this.delete(`tasks/${id}`)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let api: TasksService
|
|
44
|
+
|
|
45
|
+
export default function useTasksService() {
|
|
46
|
+
if (!api) api = new TasksService()
|
|
47
|
+
return api
|
|
48
|
+
}
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
export type Api_Team = {
|
|
2
|
-
id: string
|
|
3
|
-
display_name: string
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export type Api_Equipment_Short_Dto = {
|
|
7
|
-
id: string
|
|
8
|
-
name: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type Api_Repairs = {
|
|
12
|
-
id: string
|
|
13
|
-
name: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type Api_Projects = {
|
|
17
|
-
id: string
|
|
18
|
-
name: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type OptionFilters = {
|
|
22
|
-
teams?: Api_Team[]
|
|
23
|
-
equipments?: Api_Equipment_Short_Dto[]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type Api_Equipment_Full_Dto = {
|
|
27
|
-
id: string
|
|
28
|
-
model: null | string
|
|
29
|
-
name: string
|
|
30
|
-
registration_number: string
|
|
31
|
-
repair_frequency: number
|
|
32
|
-
repair_range: number
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type Api_Create_Repair_With_Equipments = {
|
|
36
|
-
name: string
|
|
37
|
-
display_name: string
|
|
38
|
-
description: string
|
|
39
|
-
equipment_id: string
|
|
40
|
-
power_output_MWh?: number
|
|
41
|
-
cost_per_MWh?: number
|
|
42
|
-
category?: string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type Api_Update_Repair = {
|
|
46
|
-
name?: string
|
|
47
|
-
display_name?: string
|
|
48
|
-
description: string
|
|
49
|
-
power_output_MWh?: number
|
|
50
|
-
cost_per_MWh?: number
|
|
51
|
-
category?: string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type Api_Repair_Dto = {
|
|
55
|
-
id: string
|
|
56
|
-
name: string
|
|
57
|
-
display_name: string
|
|
58
|
-
description: string
|
|
59
|
-
start_date: string
|
|
60
|
-
end_date: string
|
|
61
|
-
projects: Api_Projects[]
|
|
62
|
-
equipments: Api_Equipment_Full_Dto[]
|
|
63
|
-
}
|
|
1
|
+
export type Api_Team = {
|
|
2
|
+
id: string
|
|
3
|
+
display_name: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type Api_Equipment_Short_Dto = {
|
|
7
|
+
id: string
|
|
8
|
+
name: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type Api_Repairs = {
|
|
12
|
+
id: string
|
|
13
|
+
name: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type Api_Projects = {
|
|
17
|
+
id: string
|
|
18
|
+
name: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type OptionFilters = {
|
|
22
|
+
teams?: Api_Team[]
|
|
23
|
+
equipments?: Api_Equipment_Short_Dto[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type Api_Equipment_Full_Dto = {
|
|
27
|
+
id: string
|
|
28
|
+
model: null | string
|
|
29
|
+
name: string
|
|
30
|
+
registration_number: string
|
|
31
|
+
repair_frequency: number
|
|
32
|
+
repair_range: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type Api_Create_Repair_With_Equipments = {
|
|
36
|
+
name: string
|
|
37
|
+
display_name: string
|
|
38
|
+
description: string
|
|
39
|
+
equipment_id: string
|
|
40
|
+
power_output_MWh?: number
|
|
41
|
+
cost_per_MWh?: number
|
|
42
|
+
category?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type Api_Update_Repair = {
|
|
46
|
+
name?: string
|
|
47
|
+
display_name?: string
|
|
48
|
+
description: string
|
|
49
|
+
power_output_MWh?: number
|
|
50
|
+
cost_per_MWh?: number
|
|
51
|
+
category?: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type Api_Repair_Dto = {
|
|
55
|
+
id: string
|
|
56
|
+
name: string
|
|
57
|
+
display_name: string
|
|
58
|
+
description: string
|
|
59
|
+
start_date: string
|
|
60
|
+
end_date: string
|
|
61
|
+
projects: Api_Projects[]
|
|
62
|
+
equipments: Api_Equipment_Full_Dto[]
|
|
63
|
+
}
|