shared-ritm 1.2.82 → 1.2.83

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.
Files changed (49) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +3066 -3050
  3. package/dist/shared-ritm.umd.js +269 -269
  4. package/dist/types/api/services/AuthService.d.ts +1 -1
  5. package/dist/types/api/services/ComentsServise.d.ts +10 -0
  6. package/dist/types/api/services/CommentsService.d.ts +10 -0
  7. package/dist/types/api/services/ControlsService.d.ts +3 -3
  8. package/dist/types/api/services/FileService.d.ts +3 -4
  9. package/dist/types/api/services/GanttService.d.ts +1 -1
  10. package/dist/types/api/services/InstrumentsService.d.ts +2 -2
  11. package/dist/types/api/services/MetricsService.d.ts +2 -2
  12. package/dist/types/api/services/PhotoService.d.ts +51 -38
  13. package/dist/types/api/services/ProjectsService.d.ts +7 -7
  14. package/dist/types/api/services/RepairsService.d.ts +3 -3
  15. package/dist/types/api/services/SearchService.d.ts +4 -4
  16. package/dist/types/api/services/TasksService.d.ts +25 -34
  17. package/dist/types/api/services/UserService.d.ts +3 -3
  18. package/dist/types/api/services/VideoService.d.ts +2 -1
  19. package/dist/types/api/types/Api_Comment.d.ts +37 -0
  20. package/dist/types/api/types/Api_Files.d.ts +7 -1
  21. package/dist/types/api/types/Api_Instruments.d.ts +1 -1
  22. package/dist/types/api/types/Api_Tasks.d.ts +133 -18
  23. package/dist/types/api/types/Api_Users.d.ts +43 -0
  24. package/dist/types/index.d.ts +43 -40
  25. package/dist/types/utils/faceApiHelper.d.ts +40 -0
  26. package/package.json +1 -1
  27. package/src/api/services/AuthService.ts +1 -1
  28. package/src/api/services/CommentsService.ts +24 -0
  29. package/src/api/services/ControlsService.ts +3 -3
  30. package/src/api/services/FileService.ts +6 -5
  31. package/src/api/services/GanttService.ts +1 -1
  32. package/src/api/services/InstrumentsService.ts +2 -2
  33. package/src/api/services/MetricsService.ts +2 -2
  34. package/src/api/services/ProjectsService.ts +10 -10
  35. package/src/api/services/RepairsService.ts +3 -3
  36. package/src/api/services/SearchService.ts +5 -5
  37. package/src/api/services/TasksService.ts +72 -65
  38. package/src/api/services/UserService.ts +3 -3
  39. package/src/api/services/VideoService.ts +4 -1
  40. package/src/api/types/Api_Comment.ts +40 -0
  41. package/src/api/types/Api_Files.ts +7 -1
  42. package/src/api/types/Api_Instruments.ts +1 -1
  43. package/src/api/types/Api_Tasks.ts +144 -18
  44. package/src/common/app-dialogs/AppConfirmDialog.vue +1 -1
  45. package/src/index.ts +48 -41
  46. package/src/shared/styles/general.css +0 -1
  47. package/src/styles/variables.sass +12 -12
  48. package/src/{api/services/PhotoService.ts → utils/faceApiHelper.ts} +5 -5
  49. package/src/utils/helpers.ts +1 -0
@@ -1,45 +1,46 @@
1
- import '@/shared/styles/general.css';
2
- import AppButton from '@/common/app-button/AppButton.vue';
3
- import AppCheckbox from '@/common/app-checkbox/AppCheckbox.vue';
4
- import AppDatePicker from '@/common/app-date-picker/AppDatePicker.vue';
5
- import AppDatepicker from '@/common/app-datepicker/AppDatepicker.vue';
6
- import AppInput from '@/common/app-input/AppInput.vue';
7
- import AppInputNew from '@/common/app-input-new/AppInputNew.vue';
8
- import AppInputSearch from '@/common/app-input-search/AppInputSearch.vue';
9
- import AppLayout from '@/common/app-layout/AppLayout.vue';
10
- import AppLayoutHeader from '@/common/app-layout/components/AppLayoutHeader.vue';
11
- import AppLayoutPage from '@/common/app-layout/components/AppLayoutPage.vue';
12
- import AppLoader from '@/common/app-loader/index.vue';
13
- import AppSelect from '@/common/app-select/AppSelect.vue';
14
- import AppSheet from '@/common/app-sheet/AppSheet.vue';
1
+ import './shared/styles/general.css';
2
+ import AppButton from './common/app-button/AppButton.vue';
3
+ import AppCheckbox from './common/app-checkbox/AppCheckbox.vue';
4
+ import AppDatePicker from './common/app-date-picker/AppDatePicker.vue';
5
+ import AppDatepicker from './common/app-datepicker/AppDatepicker.vue';
6
+ import AppInput from './common/app-input/AppInput.vue';
7
+ import AppInputNew from './common/app-input-new/AppInputNew.vue';
8
+ import AppInputSearch from './common/app-input-search/AppInputSearch.vue';
9
+ import AppLayout from './common/app-layout/AppLayout.vue';
10
+ import AppLayoutHeader from './common/app-layout/components/AppLayoutHeader.vue';
11
+ import AppLayoutPage from './common/app-layout/components/AppLayoutPage.vue';
12
+ import AppLoader from './common/app-loader/index.vue';
13
+ import AppSelect from './common/app-select/AppSelect.vue';
14
+ import AppSheet from './common/app-sheet/AppSheet.vue';
15
15
  import AppSheetNew from '@/common/app-sheet-new/AppSheetNew.vue';
16
- import AppSidebar from '@/common/app-sidebar/AppSidebar.vue';
17
- import AppToggle from '@/common/app-toggle/AppToggle.vue';
18
- import AppWrapper from '@/common/app-wrapper/AppWrapper.vue';
19
- import AppConfirmDialog from '@/common/app-dialogs/AppConfirmDialog.vue';
20
- import AppDropdown from '@/common/app-dropdown/AppDropdown.vue';
21
- import AppTablePagination from '@/common/app-table/components/TablePagination.vue';
22
- import AppTableSearch from '@/common/app-table/components/TableSearch.vue';
23
- import AppTableModal from '@/common/app-table/components/TableModal.vue';
24
- import AppTable from '@/common/app-table/AppTable.vue';
25
- import AppTableLayout from '@/common/app-table/AppTableLayout.vue';
26
- import AppModalSelect from '@/common/app-table/components/ModalSelect.vue';
27
- import ApiService from '@/api/settings/ApiService';
28
- import useGanttService from '@/api/services/GanttService';
29
- import useMetricsService from '@/api/services/MetricsService';
30
- import useProjectsService from '@/api/services/ProjectsService';
31
- import useRepairsService from '@/api/services/RepairsService';
32
- import useTasksService from '@/api/services/TasksService';
33
- import useAuthService from '@/api/services/AuthService';
34
- import useFileService from '@/api/services/FileService';
35
- import useVideoService from '@/api/services/VideoService';
36
- import useUserService from '@/api/services/UserService';
37
- import usePhotoService from '@/api/services/PhotoService';
38
- import useInstrumentsService from '@/api/services/InstrumentsService';
39
- import useControlsService from '@/api/services/ControlsService';
40
- import useSearchService from '@/api/services/SearchService';
16
+ import AppSidebar from './common/app-sidebar/AppSidebar.vue';
17
+ import AppToggle from './common/app-toggle/AppToggle.vue';
18
+ import AppWrapper from './common/app-wrapper/AppWrapper.vue';
19
+ import AppConfirmDialog from './common/app-dialogs/AppConfirmDialog.vue';
20
+ import AppDropdown from './common/app-dropdown/AppDropdown.vue';
21
+ import AppTablePagination from './common/app-table/components/TablePagination.vue';
22
+ import AppTableSearch from './common/app-table/components/TableSearch.vue';
23
+ import AppTableModal from './common/app-table/components/TableModal.vue';
24
+ import AppTable from './common/app-table/AppTable.vue';
25
+ import AppTableLayout from './common/app-table/AppTableLayout.vue';
26
+ import AppModalSelect from './common/app-table/components/ModalSelect.vue';
27
+ import ApiService from './api/settings/ApiService';
28
+ import useGanttService from './api/services/GanttService';
29
+ import useMetricsService from './api/services/MetricsService';
30
+ import useProjectsService from './api/services/ProjectsService';
31
+ import useRepairsService from './api/services/RepairsService';
32
+ import useTasksService from './api/services/TasksService';
33
+ import useAuthService from './api/services/AuthService';
34
+ import useFileService from './api/services/FileService';
35
+ import useVideoService from './api/services/VideoService';
36
+ import useUserService from './api/services/UserService';
37
+ import useInstrumentsService from './api/services/InstrumentsService';
38
+ import useControlsService from './api/services/ControlsService';
39
+ import useSearchService from './api/services/SearchService';
40
+ import useCommentsService from './api/services/CommentsService';
41
+ import useFaceApiHelper from './utils/faceApiHelper';
41
42
  export { AppButton, AppCheckbox, AppDatepicker, AppDatePicker, AppInput, AppInputNew, AppInputSearch, AppLayout, AppLayoutHeader, AppLayoutPage, AppLoader, AppSelect, AppSheet, AppSheetNew, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, AppDropdown, AppTablePagination, AppTableSearch, AppTableModal, AppTable, AppTableLayout, AppModalSelect, };
42
- export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useUserService, usePhotoService, useInstrumentsService, useSearchService, };
43
+ export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useUserService, useInstrumentsService, useSearchService, useCommentsService, useFaceApiHelper, };
43
44
  export { useBaseTable } from './common/app-table/controllers/useBaseTable';
44
45
  export { useTableModel } from './common/app-table/controllers/useTableModel';
45
46
  export { useColumnSelector } from './common/app-table/controllers/useColumnSelector';
@@ -55,3 +56,5 @@ export * from './api/types/Api_Controls';
55
56
  export * from './api/types/Api_Instruments';
56
57
  export * from './api/types/Api_Search';
57
58
  export * from './api/types/Api_User';
59
+ export * from './api/types/Api_Comment';
60
+ export * from './api/types/Api_Files';
@@ -0,0 +1,40 @@
1
+ import * as faceapi from 'face-api.js';
2
+ declare class FaceApiHelper {
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>;
38
+ }
39
+ export default function useFaceApiHelper(): FaceApiHelper;
40
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.82",
3
+ "version": "1.2.83",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,4 +1,4 @@
1
- import ApiService from '@/api/settings/ApiService'
1
+ import ApiService from '../settings/ApiService'
2
2
 
3
3
  export type LoginPayload = {
4
4
  email: string
@@ -0,0 +1,24 @@
1
+ import ApiService from '../settings/ApiService'
2
+ import { Api_Comment_Request_Dto, Api_Comment_Update_Dto } from '../types/Api_Comment'
3
+ import { Api_Tasks_Task_Dto } from '../types/Api_Tasks'
4
+
5
+ class CommentsService extends ApiService {
6
+ public async uploadComment(payload: Api_Comment_Request_Dto): Promise<Api_Tasks_Task_Dto> {
7
+ return await this.post<Api_Comment_Request_Dto, Api_Tasks_Task_Dto>('comments', payload)
8
+ }
9
+
10
+ public async deleteComment(commentId: string): Promise<any> {
11
+ return await this.delete(`comments/${commentId}`)
12
+ }
13
+
14
+ public async editComment(commentId: string, payload: Api_Comment_Request_Dto): Promise<Api_Comment_Update_Dto> {
15
+ return await this.put(`comments/${commentId}`, payload)
16
+ }
17
+ }
18
+
19
+ let api: CommentsService
20
+
21
+ export default function useCommentsService() {
22
+ if (!api) api = new CommentsService()
23
+ return api
24
+ }
@@ -1,7 +1,7 @@
1
- import ApiService from '@/api/settings/ApiService'
1
+ import ApiService from '../settings/ApiService'
2
2
 
3
- import { Api_ControlLogs_Dto, Api_ControlZones_Dto } from '@/api/types/Api_Controls'
4
- import { ResponseApi } from '@/api/types/Api_Service'
3
+ import { Api_ControlLogs_Dto, Api_ControlZones_Dto } from '../types/Api_Controls'
4
+ import { ResponseApi } from '../types/Api_Service'
5
5
 
6
6
  class ControlsService extends ApiService {
7
7
  public fetchControlZones(params: Record<string, any>): Promise<ResponseApi<Api_ControlZones_Dto[]>> {
@@ -1,10 +1,11 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
3
- import { Api_Files_Responsible_Dto } from '@/api/types/Api_Files'
1
+ import ApiService from '../settings/ApiService'
2
+ import { Api_Files_Responsible_Dto } from '../types/Api_Files'
4
3
 
5
4
  class FileService extends ApiService {
6
- public uploadFile(data: FormData): Promise<ResponseApi<Api_Files_Responsible_Dto>> {
7
- return this.post<FormData, any>(`/upload-file`, data, { headers: { 'Content-Type': 'multipart/form-data' } })
5
+ public uploadFile(data: FormData): Promise<Api_Files_Responsible_Dto[]> {
6
+ return this.post<FormData, Api_Files_Responsible_Dto[]>(`/upload-file`, data, {
7
+ headers: { 'Content-Type': 'multipart/form-data' },
8
+ })
8
9
  }
9
10
  }
10
11
 
@@ -1,4 +1,4 @@
1
- import ApiService from '@/api/settings/ApiService'
1
+ import ApiService from '../settings/ApiService'
2
2
 
3
3
  class GanttService extends ApiService {
4
4
  public async fetchCriticalPathTasks(params: string): Promise<any> {
@@ -1,5 +1,5 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { Api_instruments_HistoryResponse } from '@/api/types/Api_Instruments'
1
+ import ApiService from '../settings/ApiService'
2
+ import { Api_instruments_HistoryResponse } from '../types/Api_Instruments'
3
3
 
4
4
  class InstrumentsService extends ApiService {
5
5
  public async fetchUserInstrumentsHistory(id: string, page: number): Promise<Api_instruments_HistoryResponse> {
@@ -1,5 +1,5 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
1
+ import ApiService from '../settings/ApiService'
2
+ import { ResponseApi } from '../types/Api_Service'
3
3
 
4
4
  class MetricsService extends ApiService {
5
5
  public async fetchPieProjects(queryString: string): Promise<ResponseApi<any>> {
@@ -1,27 +1,27 @@
1
- import ApiService from '@/api/settings/ApiService'
1
+ import ApiService from '../settings/ApiService'
2
2
 
3
- import { ResponseApi } from '@/api/types/Api_Service'
4
- import { Api_Project_Dto } from '@/api/types/Api_Projects'
3
+ import { ResponseApi } from '../types/Api_Service'
4
+ import { Api_Project_Dto } from '../types/Api_Projects'
5
5
 
6
6
  class ProjectsService extends ApiService {
7
- public async fetchProjectById(id: string): Promise<ResponseApi<Api_Project_Dto>> {
7
+ public async fetchProjectById(id: string): Promise<Api_Project_Dto> {
8
8
  return this.get(`/projects/${id}`)
9
9
  }
10
10
 
11
- public createProject(params: any): Promise<ResponseApi<any>> {
12
- return this.post<any, ResponseApi<any>>('/projects', params)
11
+ public createProject(params: any): Promise<Api_Project_Dto> {
12
+ return this.post<any, Api_Project_Dto>('/projects', params)
13
13
  }
14
14
 
15
- public editProject(id: string, params: any): Promise<ResponseApi<any>> {
16
- return this.put<any, ResponseApi<any>>(`/projects/${id}`, params)
15
+ public editProject(id: string, params: any): Promise<Api_Project_Dto> {
16
+ return this.put<any, Api_Project_Dto>(`/projects/${id}`, params)
17
17
  }
18
18
 
19
19
  public fetchProjects(params: any): Promise<ResponseApi<Api_Project_Dto[]>> {
20
20
  return this.get(`/search/projects`, { params })
21
21
  }
22
22
 
23
- public cloneProject(project: any): Promise<ResponseApi<any>> {
24
- return this.post<any, ResponseApi<any>>(`projects/${project.id}/clone`, project)
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
25
  }
26
26
 
27
27
  public archiveProject(id: string, data: any): Promise<ResponseApi<any>> {
@@ -1,5 +1,5 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
1
+ import ApiService from '../settings/ApiService'
2
+ import { ResponseApi } from '../types/Api_Service'
3
3
  import {
4
4
  Api_Create_Repair_With_Equipments,
5
5
  Api_Create_Repair_With_Template,
@@ -8,7 +8,7 @@ import {
8
8
  Api_Repair_Template,
9
9
  Api_Update_Repair,
10
10
  OptionFilters,
11
- } from '@/api/types/Api_Repairs'
11
+ } from '../types/Api_Repairs'
12
12
 
13
13
  class RepairsService extends ApiService {
14
14
  public fetchFilters(fullParams: string): Promise<OptionFilters> {
@@ -1,10 +1,10 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
3
- import { Api_Search_User } from '@/api/types/Api_Search'
1
+ import ApiService from '../settings/ApiService'
2
+ import { ResponseApi } from '../types/Api_Service'
3
+ import { Api_Search_User } from '../types/Api_Search'
4
4
 
5
5
  class SearchService extends ApiService {
6
- public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User>> {
7
- return this.get('search/users', { params })
6
+ public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>> {
7
+ return this.get<ResponseApi<Api_Search_User[]>>('search/users', { params })
8
8
  }
9
9
  }
10
10
 
@@ -1,132 +1,139 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
1
+ import ApiService from '../settings/ApiService'
2
+ import { ResponseApi } from '../types/Api_Service'
3
3
  import {
4
4
  Api_Task_Close_Reason,
5
5
  Api_Task_Instrument_Dto,
6
6
  Api_Task_Instrument_From_Warehouse,
7
7
  Api_Task_Module_Instrument_Condition,
8
- Api_Task_DTO,
8
+ Api_Task_Dto,
9
9
  Api_Tasks_Task_Dto,
10
- } from '@/api/types/Api_Tasks'
11
- import { Api_Equipment_Full_Dto, Api_Task_Video_Source, Api_Task_Video_Source_Stream } from '@/api/types/Api_Repairs'
10
+ Api_Task_ChangeStatusVerification_Dto,
11
+ Api_QualityMetric_Request_Dto,
12
+ Api_Tasks_Task_Edit_Request_Dto,
13
+ Api_Tasks_ReplaceInstrument_Request_Dto,
14
+ Api_Tasks_AllPersonalUser_Dto,
15
+ Api_Tasks_InstrumentHistory_Item_Dto,
16
+ } from '../types/Api_Tasks'
17
+ import { Api_Equipment_Full_Dto, Api_Task_Video_Source, Api_Task_Video_Source_Stream } from '../types/Api_Repairs'
18
+
19
+ export type EquipmentData = {
20
+ id: string
21
+ model: unknown
22
+ name: string
23
+ registration_number: string
24
+ repair_frequency: unknown
25
+ repair_range: number
26
+ }
12
27
 
13
28
  class TasksService extends ApiService {
14
- public async fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>> {
15
- return await this.get(`/tasks/${id}`)
29
+ public fetchTaskById(id: string): Promise<Api_Tasks_Task_Dto> {
30
+ return this.get<Api_Tasks_Task_Dto>(`/tasks/${id}`)
16
31
  }
17
32
 
18
- public async fetchTasksList(params: any): Promise<ResponseApi<Api_Task_DTO[]>> {
19
- return await this.get('/list/tasks/search', { params })
33
+ public fetchTasksList(params: any): Promise<ResponseApi<Api_Task_Dto[]>> {
34
+ return this.get<ResponseApi<Api_Task_Dto[]>>('/list/tasks/search', { params })
20
35
  }
21
36
 
22
- public async fetchSubtasksList(id: string): Promise<ResponseApi<Api_Task_DTO[]>> {
23
- return await this.get(`/task/${id}/subtasks/list`)
37
+ public fetchSubtasksList(id: string): Promise<Api_Task_Dto[]> {
38
+ return this.get<Api_Task_Dto[]>(`/task/${id}/subtasks/list`)
24
39
  }
25
40
 
26
- public async fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
27
- return await this.get(`/get_list_task_branch?task_id=${id}`)
41
+ public fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
42
+ return this.get(`/get_list_task_branch?task_id=${id}`)
28
43
  }
29
44
 
30
- public async fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
31
- return await this.get('admin/instruments', { params })
45
+ public fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
46
+ return this.get('admin/instruments', { params })
32
47
  }
33
48
 
34
- public async fetchInstrumentTypeListWithPreparedWarehouse(params: {
49
+ public fetchInstrumentTypeListWithPreparedWarehouse(params: {
35
50
  page: number
36
51
  per_page: number
37
52
  'filterList[taskId]'?: string | undefined
38
53
  search?: string
39
- }): Promise<Api_Task_Instrument_From_Warehouse[]> {
40
- return await this.get('/instrument_type/get_instrument_type_list_with_prepared_warehouse', { params })
54
+ }): Promise<ResponseApi<Api_Task_Instrument_From_Warehouse[]>> {
55
+ return this.get('/instrument_type/get_instrument_type_list_with_prepared_warehouse', { params })
41
56
  }
42
57
 
43
- public async fetchInstrumentsEquivalentList(params: any): Promise<ResponseApi<Api_Task_Instrument_Dto[]>> {
44
- return await this.get('tasks/instrument/list', { params })
58
+ public fetchInstrumentsEquivalentList(params: any): Promise<ResponseApi<Api_Task_Instrument_Dto[]>> {
59
+ return this.get<ResponseApi<Api_Task_Instrument_Dto[]>>('tasks/instrument/list', { params })
45
60
  }
46
61
 
47
- public async fetchDiffInstruments(params: any): Promise<ResponseApi<Api_Task_Module_Instrument_Condition>> {
48
- return await this.get(`tasks/${params.taskId}/fill/module`, { params })
62
+ public fetchDiffInstruments(params: any): Promise<ResponseApi<Api_Task_Module_Instrument_Condition>> {
63
+ return this.get<ResponseApi<Api_Task_Module_Instrument_Condition>>(`tasks/${params.taskId}/fill/module`, {
64
+ params,
65
+ })
49
66
  }
50
67
 
51
- public async replaceInstruments(payload: any): Promise<ResponseApi<any>> {
52
- return await this.post(`/instruments/equivalent/attach`, payload)
68
+ public replaceInstruments(payload: Api_Tasks_ReplaceInstrument_Request_Dto[]): Promise<ResponseApi<any[]>> {
69
+ return this.post<Api_Tasks_ReplaceInstrument_Request_Dto[], ResponseApi<any[]>>(
70
+ `/instruments/equivalent/attach`,
71
+ payload,
72
+ )
53
73
  }
54
74
 
55
- public async fetchTaskUsagePersonal(params: any): Promise<ResponseApi<unknown[]>> {
56
- return await this.get(`tasks/${params.taskId}/usage/users`, { params })
75
+ public fetchTaskUsagePersonal(task_id: string): Promise<Api_Tasks_AllPersonalUser_Dto> {
76
+ return this.get<Api_Tasks_AllPersonalUser_Dto>(`tasks/${task_id}/usage/users`)
57
77
  }
58
78
 
59
- public async fetchTaskUsageInstrument(params: any): Promise<ResponseApi<unknown[]>> {
60
- return await this.get(`tasks/${params.taskId}/usage/instruments`, { params })
79
+ public fetchTaskUsageInstrument(task_id: string): Promise<Api_Tasks_InstrumentHistory_Item_Dto[]> {
80
+ return this.get<Api_Tasks_InstrumentHistory_Item_Dto[]>(`tasks/${task_id}/usage/instruments`)
61
81
  }
62
82
 
63
83
  public fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
64
- return this.get('repairs/equipment/list', { params })
84
+ return this.get<ResponseApi<Api_Equipment_Full_Dto[]>>('repairs/equipment/list', { params })
65
85
  }
66
86
 
67
87
  public fetchTaskVideoSources(params: any): Promise<ResponseApi<Api_Task_Video_Source[]>> {
68
- return this.get('work_zone/get_list_video_source', { params })
88
+ return this.get<ResponseApi<Api_Task_Video_Source[]>>('work_zone/get_list_video_source', { params })
69
89
  }
70
90
 
71
91
  public fetchTaskVideoSourcesStream(params: any): Promise<ResponseApi<Api_Task_Video_Source_Stream[]>> {
72
- return this.get('horizon/video-source', { params })
92
+ return this.get<ResponseApi<Api_Task_Video_Source_Stream[]>>('horizon/video-source', { params })
73
93
  }
74
94
 
75
95
  public createWorkZone(payload: any): Promise<unknown> {
76
96
  return this.post('admin/work-zones', payload)
77
97
  }
78
98
 
79
- public async createTask(payload: any): Promise<ResponseApi<any>> {
80
- return await this.post(`tasks`, payload)
99
+ public createTask(payload: any): Promise<ResponseApi<any>> {
100
+ return this.post(`tasks`, payload)
81
101
  }
82
102
 
83
- public async editTask(payload: any): Promise<ResponseApi<any>> {
84
- return await this.put(`tasks/${payload.taskId}`, payload.data)
103
+ public editTask(task_id: string, payload: Api_Tasks_Task_Edit_Request_Dto): Promise<Api_Tasks_Task_Dto> {
104
+ return this.put<Api_Tasks_Task_Edit_Request_Dto, Api_Tasks_Task_Dto>(`tasks/${task_id}`, payload)
85
105
  }
86
106
 
87
- public async mergeTask(payload: { name: string; tasks_id: string[]; defect?: string }): Promise<ResponseApi<any>> {
88
- return await this.post(`tasks/merge`, payload)
107
+ public mergeTask(payload: { name: string; tasks_id: string[]; defect?: string }): Promise<ResponseApi<any>> {
108
+ return this.post(`tasks/merge`, payload)
89
109
  }
90
110
 
91
- public async deleteTask(id: string): Promise<any> {
92
- return await this.delete(`tasks/${id}`)
111
+ public deleteTask(id: string): Promise<any> {
112
+ return this.delete(`tasks/${id}`)
93
113
  }
94
114
 
95
- public async changeStatus(payload: { taskId: string; data: unknown }): Promise<unknown> {
96
- const { taskId, data } = payload
97
- return await this.put(`task/${taskId}/change-status`, data)
98
- }
99
-
100
- public async uploadComment(payload: unknown): Promise<unknown> {
101
- return await this.post('comments', payload)
102
- }
103
-
104
- public async deleteComment(commentId: string): Promise<unknown> {
105
- return await this.delete(`comments/${commentId}`)
106
- }
107
-
108
- public async editComment(payload: { commentId: string; data: unknown }): Promise<unknown> {
109
- const { commentId, data } = payload
110
- return await this.put(`comments/${commentId}`, data)
115
+ public changeStatus(taskId: string, statusId: string): Promise<any> {
116
+ return this.put<{ status_id: string }, any>(`task/${taskId}/change-status`, {
117
+ status_id: statusId,
118
+ })
111
119
  }
112
120
 
113
- public async saveMetrics(payload: unknown): Promise<unknown> {
114
- return await this.put('/update_quality_metrics', payload)
121
+ public saveMetrics(payload: Api_QualityMetric_Request_Dto[]): Promise<EquipmentData[]> {
122
+ return this.put<Api_QualityMetric_Request_Dto[], EquipmentData[]>('/update_quality_metrics', payload)
115
123
  }
116
124
 
117
- public async checkReasonForStatus(payload: { task_Id: string; data: unknown }): Promise<Api_Task_Close_Reason> {
118
- return await this.post('/tasks/check_reason_for_task', payload)
125
+ public checkReasonForStatus(task_id: string): Promise<Api_Task_Close_Reason> {
126
+ return this.post<{ task_id: string }, Api_Task_Close_Reason>('/tasks/check_reason_for_task', { task_id })
119
127
  }
120
128
 
121
- public async verifyTaskStatus(payload: { task_id: string; data: unknown }): Promise<unknown> {
122
- const { task_id, data } = payload
123
- return await this.get(`/task/${task_id}/change-status/verification`, {
124
- params: data,
129
+ public verifyTaskStatus(task_id: string, status_id: string): Promise<Api_Task_ChangeStatusVerification_Dto[]> {
130
+ return this.get<Api_Task_ChangeStatusVerification_Dto[]>(`/task/${task_id}/change-status/verification`, {
131
+ params: { status_id },
125
132
  })
126
133
  }
127
134
 
128
- public async checkBranchBeforeCloseTask(payload: { task_Id: string }): Promise<unknown> {
129
- return await this.post(`/check_branch_before_close_task`, payload)
135
+ public checkBranchBeforeCloseTask(task_id: string): Promise<ResponseApi<boolean>> {
136
+ return this.post<{ task_id: string }, ResponseApi<boolean>>(`/check_branch_before_close_task`, { task_id })
130
137
  }
131
138
  }
132
139
 
@@ -1,6 +1,6 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { Api_User, Api_User_Role } from '@/api/types/Api_User'
3
- import { ResponseApi } from '@/api/types/Api_Service'
1
+ import ApiService from '../settings/ApiService'
2
+ import { Api_User, Api_User_Role } from '../types/Api_User'
3
+ import { ResponseApi } from '../types/Api_Service'
4
4
 
5
5
  class UserService extends ApiService {
6
6
  public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
@@ -1,9 +1,12 @@
1
- import ApiService from '@/api/settings/ApiService'
1
+ import ApiService from '../settings/ApiService'
2
2
 
3
3
  class VideoService extends ApiService {
4
4
  public async startVideoAnalytics(): Promise<boolean> {
5
5
  return await this.post('/statanly/start', null)
6
6
  }
7
+ public reloadVideoAnalytics(ids: string[]): Promise<any> {
8
+ return this.post('/horizon/video-source/reload', { video_source_ids: ids })
9
+ }
7
10
  }
8
11
 
9
12
  let api: VideoService
@@ -0,0 +1,40 @@
1
+ export type FileRequest = {
2
+ name: string
3
+ type: string
4
+ path: string
5
+ extension: string
6
+ id: string
7
+ }
8
+
9
+ export type Api_Comment_Dto = {
10
+ created_at: string
11
+ files: FileRequest[]
12
+ first_name: string
13
+ for_status: boolean
14
+ full_name: string
15
+ id: string
16
+ last_name: string
17
+ text: string
18
+ user_id: string
19
+ user_name: string
20
+ }
21
+
22
+ export type Api_Comment_Request_Dto = {
23
+ for_status?: boolean
24
+ task_id?: string
25
+ text?: string
26
+ type_id?: string
27
+ files?: string[]
28
+ }
29
+
30
+ export type Api_Comment_Update_Dto = {
31
+ created_at: string
32
+ files: FileRequest[]
33
+ for_status: false
34
+ id: string
35
+ text: string
36
+ type: string | null
37
+ type_id: string | null
38
+ updated_at: string
39
+ user_id: string
40
+ }
@@ -1 +1,7 @@
1
- export type Api_Files_Responsible_Dto = unknown
1
+ export type Api_Files_Responsible_Dto = {
2
+ name: string
3
+ type: string
4
+ path: string
5
+ extension: string
6
+ id: string
7
+ }
@@ -1,4 +1,4 @@
1
- import { Api_User } from '@/api/types/Api_User'
1
+ import { Api_User } from '../types/Api_User'
2
2
 
3
3
  export type Api_Instrument_Storage = {
4
4
  id: string