shared-ritm 1.3.28 → 1.3.30

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.
@@ -2,6 +2,7 @@ import ApiService from '../settings/ApiService';
2
2
  declare class GanttService extends ApiService {
3
3
  fetchCriticalPathTasks(params: string): Promise<any>;
4
4
  fetchGanttList(params: string): Promise<any>;
5
+ setFixPlan(project_id: string): Promise<any>;
5
6
  }
6
7
  export default function useGanttService(): GanttService;
7
8
  export {};
@@ -38,6 +38,7 @@ declare class VideoService extends ApiService {
38
38
  fetchVisualizationDataLink(params?: Record<string, string>): Promise<string>;
39
39
  updateVisualizationData(params?: Record<string, string>): Promise<number>;
40
40
  deleteFrameFromVideo(id: string): Promise<void>;
41
+ sendEvent(params?: Record<string, any>): Promise<number>;
41
42
  }
42
43
  export default function useVideoService(): VideoService;
43
44
  export {};
@@ -1,4 +1,4 @@
1
- import { Api_Status_DTO } from '@/api/types/Api_Tasks';
1
+ import { Api_Status_DTO, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks';
2
2
  import { Api_Work_Zone_By_Tasks } from '@/api/types/Api_Repairs';
3
3
  export type Api_Video_Source = {
4
4
  id: string;
@@ -102,7 +102,7 @@ export type Api_Video_Source_Search = {
102
102
  url: string;
103
103
  video_source: Api_Video_Source_Search[];
104
104
  width: number;
105
- work_zones: unknown[];
105
+ work_zones: Api_Video_Source_Work_Zone[];
106
106
  };
107
107
  export type Api_Video_Source_Create = {
108
108
  fps: string;
@@ -183,3 +183,13 @@ export type Api_Video_Combination = {
183
183
  };
184
184
  origin_data: Api_Video_Combination_Origin;
185
185
  };
186
+ export type Api_Video_Source_Work_Zone_Task = Pick<Api_Tasks_Task_Dto, 'id' | 'fact_end_date' | 'fact_start_date' | 'deadline' | 'expired' | 'name' | 'plan_date' | 'responsible' | 'status' | 'time_to_complete_sec'> & {
187
+ power_output_MWh: number | null;
188
+ cost_per_MWh: number | null;
189
+ };
190
+ export type Api_Video_Source_Work_Zone = Pick<Api_Work_Zone_Search, 'id' | 'detect_face' | 'detect_helmet' | 'detect_mask' | 'detect_work_time' | 'detect_work_zone' | 'is_parent' | 'name' | 'x0' | 'x1' | 'y0' | 'y1' | 'video_source_id' | 'parent_id' | 'type' | 'title'> & {
191
+ power_output_MWh: number | null;
192
+ cost_per_MWh: number | null;
193
+ points: unknown[];
194
+ tasks: Api_Video_Source_Work_Zone_Task[];
195
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.3.28",
3
+ "version": "1.3.30",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -7,6 +7,12 @@ class GanttService extends ApiService {
7
7
  public async fetchGanttList(params: string): Promise<any> {
8
8
  return await this.get(`/list/tasks/search?${params}&gantt=1`)
9
9
  }
10
+ public async setFixPlan(project_id: string): Promise<any> {
11
+ const params = new URLSearchParams()
12
+ params.append(`projects[0]`, project_id)
13
+ params.append(`filter[state]`, '1')
14
+ return await this.post<null, any>(`/gantt/set-planned-date?${params.toString()}`, null)
15
+ }
10
16
  }
11
17
 
12
18
  let api: GanttService
@@ -98,6 +98,11 @@ class VideoService extends ApiService {
98
98
  public async deleteFrameFromVideo(id: string): Promise<void> {
99
99
  await this.delete(`horizon/video-source/delete/fragment/video/training/${id}`)
100
100
  }
101
+
102
+ // Для тестирования ws видеостены
103
+ public async sendEvent(params?: Record<string, any>): Promise<number> {
104
+ return await this.post('alerts_callback_url', params)
105
+ }
101
106
  }
102
107
 
103
108
  let api: VideoService
@@ -1,4 +1,4 @@
1
- import { Api_Status_DTO } from '@/api/types/Api_Tasks'
1
+ import { Api_Status_DTO, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks'
2
2
  import { Api_Work_Zone_By_Tasks } from '@/api/types/Api_Repairs'
3
3
 
4
4
  export type Api_Video_Source = {
@@ -106,7 +106,7 @@ export type Api_Video_Source_Search = {
106
106
  url: string
107
107
  video_source: Api_Video_Source_Search[]
108
108
  width: number
109
- work_zones: unknown[]
109
+ work_zones: Api_Video_Source_Work_Zone[]
110
110
  }
111
111
 
112
112
  export type Api_Video_Source_Create = {
@@ -196,3 +196,45 @@ export type Api_Video_Combination = {
196
196
  }
197
197
  origin_data: Api_Video_Combination_Origin
198
198
  }
199
+
200
+ export type Api_Video_Source_Work_Zone_Task = Pick<
201
+ Api_Tasks_Task_Dto,
202
+ | 'id'
203
+ | 'fact_end_date'
204
+ | 'fact_start_date'
205
+ | 'deadline'
206
+ | 'expired'
207
+ | 'name'
208
+ | 'plan_date'
209
+ | 'responsible'
210
+ | 'status'
211
+ | 'time_to_complete_sec'
212
+ > & {
213
+ power_output_MWh: number | null
214
+ cost_per_MWh: number | null
215
+ }
216
+
217
+ export type Api_Video_Source_Work_Zone = Pick<
218
+ Api_Work_Zone_Search,
219
+ | 'id'
220
+ | 'detect_face'
221
+ | 'detect_helmet'
222
+ | 'detect_mask'
223
+ | 'detect_work_time'
224
+ | 'detect_work_zone'
225
+ | 'is_parent'
226
+ | 'name'
227
+ | 'x0'
228
+ | 'x1'
229
+ | 'y0'
230
+ | 'y1'
231
+ | 'video_source_id'
232
+ | 'parent_id'
233
+ | 'type'
234
+ | 'title'
235
+ > & {
236
+ power_output_MWh: number | null
237
+ cost_per_MWh: number | null
238
+ points: unknown[]
239
+ tasks: Api_Video_Source_Work_Zone_Task[]
240
+ }
@@ -8,7 +8,7 @@
8
8
  <q-card-section>
9
9
  <q-form ref="formRef" @submit.prevent="submit">
10
10
  <div v-for="field in fields" :key="field.key" class="field-wrapper">
11
- <label v-if="field.type === 'text'" class="field-label">
11
+ <label v-if="field.type === 'text'" :data-test="`${field.key}-label`" class="field-label">
12
12
  {{ field.label }}
13
13
  <span v-if="field.rules?.length && mode !== 'view'" class="required">*</span>
14
14
  </label>
@@ -16,6 +16,7 @@
16
16
  <q-input
17
17
  v-if="field.type === 'text'"
18
18
  v-model="formData[field.key]"
19
+ :data-test="`${field.key}-input`"
19
20
  :rules="field.rules"
20
21
  :readonly="mode === 'view' || (field.key === 'uuid' && mode === 'edit')"
21
22
  filled
@@ -50,6 +51,7 @@
50
51
  <app-modal-select
51
52
  v-else-if="field.type === 'select'"
52
53
  v-model="formData[field.key]"
54
+ :data-test="`${field.key}-select`"
53
55
  :options="filteredOptions[field.key] || field.options"
54
56
  :rules="field.rules"
55
57
  :placeholder="mode === 'view' ? '' : field.placeholder"
@@ -77,18 +79,35 @@
77
79
  </q-card-section>
78
80
 
79
81
  <q-card-actions align="center">
80
- <q-btn v-if="mode === 'view'" class="remove" flat label="Удалить" :loading="loading" @click="emit('delete')" />
82
+ <q-btn
83
+ v-if="mode === 'view'"
84
+ class="remove"
85
+ data-test="remove-button"
86
+ flat
87
+ label="Удалить"
88
+ :loading="loading"
89
+ @click="emit('delete')"
90
+ />
81
91
  <q-btn
82
92
  v-if="mode !== 'view'"
83
93
  class="confirm"
94
+ data-test="save-create-button"
84
95
  flat
85
96
  :label="mode === 'edit' ? 'Сохранить' : 'Создать'"
86
97
  :disable="isSubmitDisabled"
87
98
  :loading="loading"
88
99
  @click="submit"
89
100
  />
90
- <q-btn v-else class="confirm" flat label="Редактировать" :disable="loading" @click="$emit('edit')" />
91
- <q-btn class="cancel" flat label="Закрыть" :disable="loading" @click="close" />
101
+ <q-btn
102
+ v-else
103
+ class="confirm"
104
+ data-test="edit-button"
105
+ flat
106
+ label="Редактировать"
107
+ :disable="loading"
108
+ @click="$emit('edit')"
109
+ />
110
+ <q-btn class="cancel" data-test="cancel-button" flat label="Закрыть" :disable="loading" @click="close" />
92
111
  </q-card-actions>
93
112
  </q-card>
94
113
  </q-dialog>
@@ -23,7 +23,18 @@ export function useColumnSelector(allColumns: ColumnConfig[], fixedColumnNames:
23
23
  disable: fixedColumnNames.includes(col.name),
24
24
  })),
25
25
  },
26
- cancel: true,
26
+ cancel: {
27
+ label: 'Отмена',
28
+ attrs: {
29
+ 'data-test': 'cancel-button',
30
+ },
31
+ },
32
+ ok: {
33
+ label: 'Ок',
34
+ attrs: {
35
+ 'data-test': 'ok-button',
36
+ },
37
+ },
27
38
  persistent: true,
28
39
  }).onOk((val: string[]) => {
29
40
  selectedColumnNames.value = Array.from(new Set([...val, ...fixedColumnNames]))