shared-ritm 1.1.83 → 1.1.85

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.1.83",
3
+ "version": "1.1.85",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,137 +1,137 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
- import {
3
- Api_Task_Close_Reason,
4
- Api_Task_Instrument_Dto,
5
- Api_Task_Instrument_From_Warehouse,
6
- Api_Task_Module_Instrument_Condition,
7
- Api_Tasks_Dto,
8
- Api_Tasks_Task_Dto,
9
- } from '@/api/types/Api_Tasks'
10
- import { Api_Equipment_Full_Dto, Api_Task_Video_Source, Api_Task_Video_Source_Stream } from '@/api/types/Api_Repairs'
11
-
12
- class TasksService extends ApiService {
13
- public async fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>> {
14
- return await this.get(`/tasks/${id}`)
15
- }
16
-
17
- public async fetchTasksList(params: any): Promise<ResponseApi<Api_Tasks_Dto[]>> {
18
- return await this.get('/list/tasks/search', { params })
19
- }
20
-
21
- public async fetchSubtasksList(id: string): Promise<ResponseApi<Api_Tasks_Dto[]>> {
22
- return await this.get(`/task/${id}/subtasks/list`)
23
- }
24
-
25
- public async fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
26
- return await this.get(`/get_list_task_branch?task_id=${id}`)
27
- }
28
-
29
- public async fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
30
- return await this.get('admin/instruments', { params })
31
- }
32
-
33
- public async fetchInstrumentTypeListWithPreparedWarehouse(params: {
34
- page: number
35
- per_page: number
36
- 'filterList[taskId]'?: string | undefined
37
- search?: string
38
- }): Promise<Api_Task_Instrument_From_Warehouse[]> {
39
- return await this.get('/instrument_type/get_instrument_type_list_with_prepared_warehouse', { params })
40
- }
41
-
42
- public async fetchInstrumentsEquivalentList(params: any): Promise<ResponseApi<Api_Task_Instrument_Dto[]>> {
43
- return await this.get('tasks/instrument/list', { params })
44
- }
45
-
46
- public async fetchDiffInstruments(params: any): Promise<ResponseApi<Api_Task_Module_Instrument_Condition>> {
47
- return await this.get(`tasks/${params.taskId}/fill/module`, { params })
48
- }
49
-
50
- public async replaceInstruments(payload: any): Promise<ResponseApi<any>> {
51
- return await this.post(`/instruments/equivalent/attach`, payload)
52
- }
53
-
54
- public async fetchTaskUsagePersonal(params: any): Promise<ResponseApi<unknown[]>> {
55
- return await this.get(`tasks/${params.taskId}/usage/users`, { params })
56
- }
57
-
58
- public async fetchTaskUsageInstrument(params: any): Promise<ResponseApi<unknown[]>> {
59
- return await this.get(`tasks/${params.taskId}/usage/instruments`, { params })
60
- }
61
-
62
- public fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
63
- return this.get('repairs/equipment/list', { params })
64
- }
65
-
66
- public fetchTaskVideoSources(params: any): Promise<ResponseApi<Api_Task_Video_Source[]>> {
67
- return this.get('work_zone/get_list_video_source', { params })
68
- }
69
-
70
- public fetchTaskVideoSourcesStream(params: any): Promise<ResponseApi<Api_Task_Video_Source_Stream[]>> {
71
- return this.get('horizon/video-source', { params })
72
- }
73
-
74
- public createWorkZone(payload: any): Promise<unknown> {
75
- return this.post('admin/work-zones', payload)
76
- }
77
-
78
- public async createTask(payload: any): Promise<ResponseApi<any>> {
79
- return await this.post(`tasks`, payload)
80
- }
81
-
82
- public async editTask(payload: any): Promise<ResponseApi<any>> {
83
- return await this.put(`tasks/${payload.taskId}`, payload.data)
84
- }
85
-
86
- public async mergeTask(payload: { name: string; tasks_id: string[] }): Promise<ResponseApi<any>> {
87
- return await this.post(`tasks/merge`, payload)
88
- }
89
-
90
- public async deleteTask(id: string): Promise<any> {
91
- return await this.delete(`tasks/${id}`)
92
- }
93
-
94
- public async changeStatus(payload: { taskId: string; data: unknown }): Promise<unknown> {
95
- const { taskId, data } = payload
96
- return await this.put(`task/${taskId}/change-status`, data)
97
- }
98
-
99
- public async uploadComment(payload: unknown): Promise<unknown> {
100
- return await this.post('comments', payload)
101
- }
102
-
103
- public async deleteComment(commentId: string): Promise<unknown> {
104
- return await this.delete(`comments/${commentId}`)
105
- }
106
-
107
- public async editComment(payload: { commentId: string; data: unknown }): Promise<unknown> {
108
- const { commentId, data } = payload
109
- return await this.put(`comments/${commentId}`, data)
110
- }
111
-
112
- public async saveMetrics(payload: unknown): Promise<unknown> {
113
- return await this.put('/update_quality_metrics', payload)
114
- }
115
-
116
- public async checkReasonForStatus(payload: { task_Id: string; data: unknown }): Promise<Api_Task_Close_Reason> {
117
- return await this.post('/tasks/check_reason_for_task', payload)
118
- }
119
-
120
- public async verifyTaskStatus(payload: { task_id: string; data: unknown }): Promise<unknown> {
121
- const { task_id, data } = payload
122
- return await this.get(`/task/${task_id}/change-status/verification`, {
123
- params: data,
124
- })
125
- }
126
-
127
- public async checkBranchBeforeCloseTask(payload: { task_Id: string }): Promise<unknown> {
128
- return await this.post(`/check_branch_before_close_task`, payload)
129
- }
130
- }
131
-
132
- let api: TasksService
133
-
134
- export default function useTasksService() {
135
- if (!api) api = new TasksService()
136
- return api
137
- }
1
+ import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
+ import {
3
+ Api_Task_Close_Reason,
4
+ Api_Task_Instrument_Dto,
5
+ Api_Task_Instrument_From_Warehouse,
6
+ Api_Task_Module_Instrument_Condition,
7
+ Api_Tasks_Dto,
8
+ Api_Tasks_Task_Dto,
9
+ } from '@/api/types/Api_Tasks'
10
+ import { Api_Equipment_Full_Dto, Api_Task_Video_Source, Api_Task_Video_Source_Stream } from '@/api/types/Api_Repairs'
11
+
12
+ class TasksService extends ApiService {
13
+ public async fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>> {
14
+ return await this.get(`/tasks/${id}`)
15
+ }
16
+
17
+ public async fetchTasksList(params: any): Promise<ResponseApi<Api_Tasks_Dto[]>> {
18
+ return await this.get('/list/tasks/search', { params })
19
+ }
20
+
21
+ public async fetchSubtasksList(id: string): Promise<ResponseApi<Api_Tasks_Dto[]>> {
22
+ return await this.get(`/task/${id}/subtasks/list`)
23
+ }
24
+
25
+ public async fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
26
+ return await this.get(`/get_list_task_branch?task_id=${id}`)
27
+ }
28
+
29
+ public async fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
30
+ return await this.get('admin/instruments', { params })
31
+ }
32
+
33
+ public async fetchInstrumentTypeListWithPreparedWarehouse(params: {
34
+ page: number
35
+ per_page: number
36
+ 'filterList[taskId]'?: string | undefined
37
+ search?: string
38
+ }): Promise<Api_Task_Instrument_From_Warehouse[]> {
39
+ return await this.get('/instrument_type/get_instrument_type_list_with_prepared_warehouse', { params })
40
+ }
41
+
42
+ public async fetchInstrumentsEquivalentList(params: any): Promise<ResponseApi<Api_Task_Instrument_Dto[]>> {
43
+ return await this.get('tasks/instrument/list', { params })
44
+ }
45
+
46
+ public async fetchDiffInstruments(params: any): Promise<ResponseApi<Api_Task_Module_Instrument_Condition>> {
47
+ return await this.get(`tasks/${params.taskId}/fill/module`, { params })
48
+ }
49
+
50
+ public async replaceInstruments(payload: any): Promise<ResponseApi<any>> {
51
+ return await this.post(`/instruments/equivalent/attach`, payload)
52
+ }
53
+
54
+ public async fetchTaskUsagePersonal(params: any): Promise<ResponseApi<unknown[]>> {
55
+ return await this.get(`tasks/${params.taskId}/usage/users`, { params })
56
+ }
57
+
58
+ public async fetchTaskUsageInstrument(params: any): Promise<ResponseApi<unknown[]>> {
59
+ return await this.get(`tasks/${params.taskId}/usage/instruments`, { params })
60
+ }
61
+
62
+ public fetchEquipment(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
63
+ return this.get('repairs/equipment/list', { params })
64
+ }
65
+
66
+ public fetchTaskVideoSources(params: any): Promise<ResponseApi<Api_Task_Video_Source[]>> {
67
+ return this.get('work_zone/get_list_video_source', { params })
68
+ }
69
+
70
+ public fetchTaskVideoSourcesStream(params: any): Promise<ResponseApi<Api_Task_Video_Source_Stream[]>> {
71
+ return this.get('horizon/video-source', { params })
72
+ }
73
+
74
+ public createWorkZone(payload: any): Promise<unknown> {
75
+ return this.post('admin/work-zones', payload)
76
+ }
77
+
78
+ public async createTask(payload: any): Promise<ResponseApi<any>> {
79
+ return await this.post(`tasks`, payload)
80
+ }
81
+
82
+ public async editTask(payload: any): Promise<ResponseApi<any>> {
83
+ return await this.put(`tasks/${payload.taskId}`, payload.data)
84
+ }
85
+
86
+ public async mergeTask(payload: { name: string; tasks_id: string[] }): Promise<ResponseApi<any>> {
87
+ return await this.post(`tasks/merge`, payload)
88
+ }
89
+
90
+ public async deleteTask(id: string): Promise<any> {
91
+ return await this.delete(`tasks/${id}`)
92
+ }
93
+
94
+ public async changeStatus(payload: { taskId: string; data: unknown }): Promise<unknown> {
95
+ const { taskId, data } = payload
96
+ return await this.put(`task/${taskId}/change-status`, data)
97
+ }
98
+
99
+ public async uploadComment(payload: unknown): Promise<unknown> {
100
+ return await this.post('comments', payload)
101
+ }
102
+
103
+ public async deleteComment(commentId: string): Promise<unknown> {
104
+ return await this.delete(`comments/${commentId}`)
105
+ }
106
+
107
+ public async editComment(payload: { commentId: string; data: unknown }): Promise<unknown> {
108
+ const { commentId, data } = payload
109
+ return await this.put(`comments/${commentId}`, data)
110
+ }
111
+
112
+ public async saveMetrics(payload: unknown): Promise<unknown> {
113
+ return await this.put('/update_quality_metrics', payload)
114
+ }
115
+
116
+ public async checkReasonForStatus(payload: { task_Id: string; data: unknown }): Promise<Api_Task_Close_Reason> {
117
+ return await this.post('/tasks/check_reason_for_task', payload)
118
+ }
119
+
120
+ public async verifyTaskStatus(payload: { task_id: string; data: unknown }): Promise<unknown> {
121
+ const { task_id, data } = payload
122
+ return await this.get(`/task/${task_id}/change-status/verification`, {
123
+ params: data,
124
+ })
125
+ }
126
+
127
+ public async checkBranchBeforeCloseTask(payload: { task_Id: string }): Promise<unknown> {
128
+ return await this.post(`/check_branch_before_close_task`, payload)
129
+ }
130
+ }
131
+
132
+ let api: TasksService
133
+
134
+ export default function useTasksService() {
135
+ if (!api) api = new TasksService()
136
+ return api
137
+ }
@@ -21,6 +21,7 @@ export default class ApiService {
21
21
  baseURL: process.env.VUE_APP_BACKEND,
22
22
  headers: {
23
23
  'Content-Type': 'application/json',
24
+ Accept: 'application/json',
24
25
  },
25
26
  })
26
27
 
@@ -1,114 +1,119 @@
1
- <template>
2
- <q-dialog
3
- ref="DialogRef"
4
- :model-value="true"
5
- :position="'right'"
6
- :class="$style['sheet-dialog']"
7
- full-height
8
- full-width
9
- >
10
- <template v-if="type === 'details'">
11
- <q-card>
12
- <div class="wrapper">
13
- <div class="sheet-header">
14
- <h2>{{ title }}</h2>
15
- <div class="close-button">
16
- <q-btn v-close-popup dense flat icon="close" />
17
- </div>
18
- </div>
19
- <div v-if="loading" class="loader">
20
- <q-spinner-audio v-if="loading" class="loader-spinner" size="md" :thickness="3" color="primary" />
21
- </div>
22
- <slot v-else />
23
- </div>
24
- </q-card>
25
- </template>
26
- <template v-if="type === 'custom'">
27
- <div v-if="loading" class="custom-wrapper">
28
- <div class="loader">
29
- <q-spinner-audio v-if="loading" class="loader-spinner" size="md" :thickness="3" color="primary" />
30
- </div>
31
- </div>
32
- <slot v-else />
33
- </template>
34
- </q-dialog>
35
- </template>
36
-
37
- <script setup lang="ts">
38
- import { computed, defineEmits, defineProps, withDefaults } from 'vue'
39
-
40
- interface DialogProps {
41
- dialogRef: any
42
- loading?: boolean
43
- title?: string
44
- width?: string
45
- type?: 'details' | 'custom'
46
- tabs?: any[]
47
- currentTabName?: string
48
- }
49
-
50
- const props = withDefaults(defineProps<DialogProps>(), {
51
- title: '',
52
- width: '976px',
53
- type: 'details',
54
- loading: false,
55
- tabs: () => [],
56
- currentTabName: '',
57
- })
58
-
59
- const emit = defineEmits(['update:dialogRef', 'update:currentTabName'])
60
-
61
- const DialogRef = computed({
62
- get() {
63
- return props.dialogRef
64
- },
65
- set(value) {
66
- emit('update:dialogRef', value)
67
- },
68
- })
69
- </script>
70
-
71
- <style lang="scss" scoped>
72
- .custom-wrapper {
73
- width: v-bind(width);
74
- background-color: white;
75
- }
76
- .wrapper {
77
- display: flex;
78
- flex-direction: column;
79
- gap: 1rem;
80
- width: v-bind(width);
81
- height: 100vh;
82
- min-height: 100vh;
83
- position: relative;
84
- padding: 2rem 2rem 4rem 2rem;
85
- background-color: #7991ad32;
86
- font-family: 'NunitoSansFont', sans-serif;
87
- }
88
-
89
- .sheet-header {
90
- display: flex;
91
- justify-content: space-between;
92
- align-items: center;
93
- h2 {
94
- font-size: 36px;
95
- }
96
- }
97
- .loader {
98
- min-width: 976px;
99
- &-spinner {
100
- position: absolute;
101
- top: 50%;
102
- left: 50%;
103
- z-index: 4;
104
- }
105
- }
106
- </style>
107
-
108
- <style lang="scss" module>
109
- .sheet-dialog {
110
- :global(.q-dialog__inner--minimized) {
111
- padding: 0;
112
- }
113
- }
114
- </style>
1
+ <template>
2
+ <q-dialog
3
+ ref="DialogRef"
4
+ :model-value="true"
5
+ :position="'right'"
6
+ :class="$style['sheet-dialog']"
7
+ no-esc-dismiss
8
+ full-height
9
+ full-width
10
+ >
11
+ <template v-if="type === 'details'">
12
+ <q-card>
13
+ <div class="wrapper">
14
+ <div class="sheet-header">
15
+ <h2>{{ title }}</h2>
16
+ <div class="close-button">
17
+ <q-btn v-close-popup dense flat icon="close" />
18
+ </div>
19
+ </div>
20
+ <div v-if="loading" class="loader">
21
+ <q-spinner-audio v-if="loading" class="loader-spinner" size="md" :thickness="3" color="primary" />
22
+ </div>
23
+ <slot v-else />
24
+ </div>
25
+ </q-card>
26
+ </template>
27
+ <template v-if="type === 'custom'">
28
+ <div v-if="loading" class="custom-wrapper">
29
+ <div class="loader">
30
+ <q-spinner-audio v-if="loading" class="loader-spinner" size="md" :thickness="3" color="primary" />
31
+ </div>
32
+ </div>
33
+ <slot v-else />
34
+ </template>
35
+ </q-dialog>
36
+ </template>
37
+
38
+ <script setup lang="ts">
39
+ import { computed, defineEmits, defineProps, withDefaults } from 'vue'
40
+
41
+ interface DialogProps {
42
+ dialogRef: any
43
+ loading?: boolean
44
+ title?: string
45
+ width?: string
46
+ type?: 'details' | 'custom'
47
+ tabs?: any[]
48
+ currentTabName?: string
49
+ }
50
+
51
+ const props = withDefaults(defineProps<DialogProps>(), {
52
+ title: '',
53
+ width: '976px',
54
+ type: 'details',
55
+ loading: false,
56
+ tabs: () => [],
57
+ currentTabName: '',
58
+ })
59
+
60
+ const emit = defineEmits(['update:dialogRef', 'update:currentTabName'])
61
+
62
+ const DialogRef = computed({
63
+ get() {
64
+ return props.dialogRef
65
+ },
66
+ set(value) {
67
+ emit('update:dialogRef', value)
68
+ },
69
+ })
70
+ </script>
71
+
72
+ <style lang="scss" scoped>
73
+ .custom-wrapper {
74
+ width: v-bind(width);
75
+ background-color: white;
76
+ }
77
+
78
+ .wrapper {
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: 1rem;
82
+ width: v-bind(width);
83
+ height: 100vh;
84
+ min-height: 100vh;
85
+ position: relative;
86
+ padding: 2rem 2rem 4rem 2rem;
87
+ background-color: #7991ad32;
88
+ font-family: 'NunitoSansFont', sans-serif;
89
+ }
90
+
91
+ .sheet-header {
92
+ display: flex;
93
+ justify-content: space-between;
94
+ align-items: center;
95
+
96
+ h2 {
97
+ font-size: 36px;
98
+ }
99
+ }
100
+
101
+ .loader {
102
+ min-width: 976px;
103
+
104
+ &-spinner {
105
+ position: absolute;
106
+ top: 50%;
107
+ left: 50%;
108
+ z-index: 4;
109
+ }
110
+ }
111
+ </style>
112
+
113
+ <style lang="scss" module>
114
+ .sheet-dialog {
115
+ :global(.q-dialog__inner--minimized) {
116
+ padding: 0;
117
+ }
118
+ }
119
+ </style>