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.
Files changed (37) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +86 -78
  3. package/dist/shared-ritm.umd.js +6 -6
  4. package/dist/types/api/services/PhotoService.d.ts +38 -51
  5. package/dist/types/api/services/VideoService.d.ts +2 -1
  6. package/dist/types/api/types/Api_Repairs.d.ts +12 -11
  7. package/dist/types/api/types/Api_Video.d.ts +16 -1
  8. package/package.json +64 -64
  9. package/src/api/services/BrigadesService.ts +32 -32
  10. package/src/api/services/EquipmentService.ts +29 -29
  11. package/src/api/services/InstrumentsService.ts +63 -63
  12. package/src/api/services/ModulesService.ts +27 -27
  13. package/src/api/services/ProjectsService.ts +72 -72
  14. package/src/api/services/SearchService.ts +22 -22
  15. package/src/api/services/UserService.ts +101 -101
  16. package/src/api/services/VideoService.ts +71 -66
  17. package/src/api/settings/ApiService.ts +124 -124
  18. package/src/api/types/Api_Brigades.ts +36 -36
  19. package/src/api/types/Api_Equipment.ts +3 -3
  20. package/src/api/types/Api_Instruments.ts +136 -136
  21. package/src/api/types/Api_Modules.ts +21 -21
  22. package/src/api/types/Api_Repairs.ts +8 -6
  23. package/src/api/types/Api_Search.ts +77 -77
  24. package/src/api/types/Api_User.ts +117 -117
  25. package/src/api/types/Api_Video.ts +140 -123
  26. package/src/common/app-input-new/AppInputNew.vue +175 -175
  27. package/src/common/app-layout/components/AppLayoutHeader.vue +1 -1
  28. package/src/common/app-sheet-new/AppSheetNew.vue +246 -246
  29. package/src/common/app-table/AppTable.vue +314 -314
  30. package/src/common/app-table/AppTableLayout.vue +137 -137
  31. package/src/common/app-table/components/ModalSelect.vue +270 -270
  32. package/src/common/app-table/components/TableModal.vue +356 -356
  33. package/src/common/app-table/controllers/useBaseTable.ts +45 -45
  34. package/src/index.ts +122 -122
  35. package/src/styles/variables.sass +12 -12
  36. package/dist/types/api/services/ComentsServise.d.ts +0 -10
  37. package/dist/types/api/types/Api_Users.d.ts +0 -43
@@ -1,124 +1,124 @@
1
- import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
-
3
- export enum ApiServiceType {
4
- SERVICE_AUTH = 'SERVICE_AUTH',
5
- }
6
-
7
- export default class ApiService {
8
- private axiosInstance: AxiosInstance
9
-
10
- constructor() {
11
- this.axiosInstance = axios.create({
12
- baseURL: process.env.VUE_APP_BACKEND,
13
- headers: {
14
- 'Content-Type': 'application/json',
15
- Accept: 'application/json',
16
- },
17
- })
18
-
19
- this.axiosInstance.interceptors.request.use(
20
- (config: InternalAxiosRequestConfig) => {
21
- const token = this.getToken()
22
- if (token && config.headers) {
23
- config.headers.Authorization = `Bearer ${token}`
24
- }
25
- return config
26
- },
27
- (error: AxiosError) => {
28
- return Promise.reject(error)
29
- },
30
- )
31
-
32
- this.axiosInstance.interceptors.response.use(
33
- (response: AxiosResponse) => {
34
- return response.data
35
- },
36
- (error: AxiosError) => {
37
- if (error.response?.status === 401 || error.response?.status === 403) {
38
- this.logout()
39
- }
40
- return Promise.reject(error)
41
- },
42
- )
43
- }
44
-
45
- private getToken() {
46
- return localStorage.getItem('token')
47
- }
48
-
49
- private removeToken() {
50
- localStorage.removeItem('token')
51
- }
52
-
53
- public logout(): void {
54
- this.removeToken()
55
- window.location.href = '/sign-in'
56
- }
57
-
58
- private handleError(error: AxiosError): void {
59
- if (error.response) {
60
- console.error('API Error:', error.response.status, error.response.data)
61
- } else if (error.request) {
62
- console.error('No response received:', error.request)
63
- } else {
64
- console.error('Error during request setup:', error.message)
65
- }
66
- }
67
-
68
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
69
- try {
70
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
71
- if (response?.data === false) return false as unknown as T
72
-
73
- return response?.data ?? (response as unknown as T)
74
- } catch (error) {
75
- const axiosError = error as AxiosError
76
- this.handleError(axiosError)
77
- throw error
78
- }
79
- }
80
-
81
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
82
- try {
83
- return await this.axiosInstance.delete<T>(url, options)
84
- } catch (error) {
85
- const axiosError = error as AxiosError
86
- this.handleError(axiosError)
87
- throw error
88
- }
89
- }
90
-
91
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
92
- try {
93
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
94
- if (response?.data === false) return false
95
- return response?.data || (response as any)
96
- } catch (error) {
97
- const axiosError = error as AxiosError
98
- this.handleError(axiosError)
99
- throw error
100
- }
101
- }
102
-
103
- protected async patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2> {
104
- try {
105
- const response: AxiosResponse<T2> = await this.axiosInstance.patch<T1, AxiosResponse<T2>>(url, payload, options)
106
- return response.data
107
- } catch (error) {
108
- const axiosError = error as AxiosError
109
- this.handleError(axiosError)
110
- throw error
111
- }
112
- }
113
-
114
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
115
- try {
116
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
117
- return response.data
118
- } catch (error) {
119
- const axiosError = error as AxiosError
120
- this.handleError(axiosError)
121
- throw error
122
- }
123
- }
124
- }
1
+ import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
+
3
+ export enum ApiServiceType {
4
+ SERVICE_AUTH = 'SERVICE_AUTH',
5
+ }
6
+
7
+ export default class ApiService {
8
+ private axiosInstance: AxiosInstance
9
+
10
+ constructor() {
11
+ this.axiosInstance = axios.create({
12
+ baseURL: process.env.VUE_APP_BACKEND,
13
+ headers: {
14
+ 'Content-Type': 'application/json',
15
+ Accept: 'application/json',
16
+ },
17
+ })
18
+
19
+ this.axiosInstance.interceptors.request.use(
20
+ (config: InternalAxiosRequestConfig) => {
21
+ const token = this.getToken()
22
+ if (token && config.headers) {
23
+ config.headers.Authorization = `Bearer ${token}`
24
+ }
25
+ return config
26
+ },
27
+ (error: AxiosError) => {
28
+ return Promise.reject(error)
29
+ },
30
+ )
31
+
32
+ this.axiosInstance.interceptors.response.use(
33
+ (response: AxiosResponse) => {
34
+ return response.data
35
+ },
36
+ (error: AxiosError) => {
37
+ if (error.response?.status === 401 || error.response?.status === 403) {
38
+ this.logout()
39
+ }
40
+ return Promise.reject(error)
41
+ },
42
+ )
43
+ }
44
+
45
+ private getToken() {
46
+ return localStorage.getItem('token')
47
+ }
48
+
49
+ private removeToken() {
50
+ localStorage.removeItem('token')
51
+ }
52
+
53
+ public logout(): void {
54
+ this.removeToken()
55
+ window.location.href = '/sign-in'
56
+ }
57
+
58
+ private handleError(error: AxiosError): void {
59
+ if (error.response) {
60
+ console.error('API Error:', error.response.status, error.response.data)
61
+ } else if (error.request) {
62
+ console.error('No response received:', error.request)
63
+ } else {
64
+ console.error('Error during request setup:', error.message)
65
+ }
66
+ }
67
+
68
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
69
+ try {
70
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
71
+ if (response?.data === false) return false as unknown as T
72
+
73
+ return response?.data ?? (response as unknown as T)
74
+ } catch (error) {
75
+ const axiosError = error as AxiosError
76
+ this.handleError(axiosError)
77
+ throw error
78
+ }
79
+ }
80
+
81
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
82
+ try {
83
+ return await this.axiosInstance.delete<T>(url, options)
84
+ } catch (error) {
85
+ const axiosError = error as AxiosError
86
+ this.handleError(axiosError)
87
+ throw error
88
+ }
89
+ }
90
+
91
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
92
+ try {
93
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
94
+ if (response?.data === false) return false
95
+ return response?.data || (response as any)
96
+ } catch (error) {
97
+ const axiosError = error as AxiosError
98
+ this.handleError(axiosError)
99
+ throw error
100
+ }
101
+ }
102
+
103
+ protected async patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2> {
104
+ try {
105
+ const response: AxiosResponse<T2> = await this.axiosInstance.patch<T1, AxiosResponse<T2>>(url, payload, options)
106
+ return response.data
107
+ } catch (error) {
108
+ const axiosError = error as AxiosError
109
+ this.handleError(axiosError)
110
+ throw error
111
+ }
112
+ }
113
+
114
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
115
+ try {
116
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
117
+ return response.data
118
+ } catch (error) {
119
+ const axiosError = error as AxiosError
120
+ this.handleError(axiosError)
121
+ throw error
122
+ }
123
+ }
124
+ }
@@ -1,36 +1,36 @@
1
- import { Api_User, Api_User_Team_Search } from '@/api/types/Api_User'
2
- import { Api_Tasks_Position_Dto } from '@/api/types/Api_Tasks'
3
-
4
- export type Api_Brigade_Master = {
5
- id: string
6
- full_name: string
7
- email: string
8
- }
9
-
10
- export type Api_Brigade_Position = {
11
- id: string
12
- user: Pick<Api_User, 'id' | 'first_name' | 'last_name' | 'patronymic' | 'email' | 'full_name'> | null
13
- position: Api_Tasks_Position_Dto
14
- }
15
-
16
- export type Api_Brigade = {
17
- id: string
18
- name: string
19
- task_master: Api_Brigade_Master
20
- teams: Api_User_Team_Search[]
21
- positions: Api_Brigade_Position[]
22
- }
23
-
24
- export type Api_Brigade_Create = Pick<Api_Brigade, 'name' | 'teams'> & {
25
- positions?: Api_Brigade_Position[]
26
- task_master_user_id: string
27
- }
28
-
29
- export type Api_Brigade_Search = {
30
- id: string
31
- name: string
32
- created_at: string
33
- updated_at: string
34
- task_master: Api_Brigade_Master
35
- teams: Api_User_Team_Search[]
36
- }
1
+ import { Api_User, Api_User_Team_Search } from '@/api/types/Api_User'
2
+ import { Api_Tasks_Position_Dto } from '@/api/types/Api_Tasks'
3
+
4
+ export type Api_Brigade_Master = {
5
+ id: string
6
+ full_name: string
7
+ email: string
8
+ }
9
+
10
+ export type Api_Brigade_Position = {
11
+ id: string
12
+ user: Pick<Api_User, 'id' | 'first_name' | 'last_name' | 'patronymic' | 'email' | 'full_name'> | null
13
+ position: Api_Tasks_Position_Dto
14
+ }
15
+
16
+ export type Api_Brigade = {
17
+ id: string
18
+ name: string
19
+ task_master: Api_Brigade_Master
20
+ teams: Api_User_Team_Search[]
21
+ positions: Api_Brigade_Position[]
22
+ }
23
+
24
+ export type Api_Brigade_Create = Pick<Api_Brigade, 'name' | 'teams'> & {
25
+ positions?: Api_Brigade_Position[]
26
+ task_master_user_id: string
27
+ }
28
+
29
+ export type Api_Brigade_Search = {
30
+ id: string
31
+ name: string
32
+ created_at: string
33
+ updated_at: string
34
+ task_master: Api_Brigade_Master
35
+ teams: Api_User_Team_Search[]
36
+ }
@@ -1,3 +1,3 @@
1
- import { Api_Equipment_Full_Dto } from '@/api/types/Api_Repairs'
2
-
3
- export type Api_Equipment_Create = Omit<Api_Equipment_Full_Dto, 'id'>
1
+ import { Api_Equipment_Full_Dto } from '@/api/types/Api_Repairs'
2
+
3
+ export type Api_Equipment_Create = Omit<Api_Equipment_Full_Dto, 'id'>
@@ -1,136 +1,136 @@
1
- import { Api_User } from '../types/Api_User'
2
- import { Api_Status_DTO } from '@/api/types/Api_Tasks'
3
- import { Api_Search_User } from '@/api/types/Api_Search'
4
-
5
- export type Api_Instrument_Storage = {
6
- id: string
7
- created_at: string
8
- deleted_at: string | null
9
- updated_at: string
10
- description: string
11
- name: string
12
- title: string
13
- parent: unknown | null
14
- parents: unknown[]
15
- state_id: unknown | null
16
- }
17
-
18
- export type Api_Instrument_Type = {
19
- id: string
20
- name: string
21
- created_at: string
22
- updated_at: string
23
- deleted_at: string | null
24
- icon: string
25
- storage_id: string
26
- storage: Api_Instrument_Storage
27
- }
28
-
29
- export type Api_Instrument_Location = {
30
- id: string
31
- name: string
32
- title: string
33
- description: string
34
- created_at: string
35
- updated_at: string
36
- deleted_at: string | null
37
- state_id: string | null
38
- }
39
-
40
- export type Api_Instrument_Status = {
41
- id: string
42
- description: string
43
- name: string
44
- title: string
45
- created_at: string
46
- updated_at: string
47
- deleted_at: string | null
48
- }
49
-
50
- export type Api_Instrument = {
51
- id: string
52
- RFID: string | null
53
- instrument_id: string
54
- arrival_at: string
55
- created_at: string
56
- supply_at: string
57
- updated_at: string
58
- deleted_at: string | null
59
- inventory_number: string
60
- instrument_type: Api_Instrument_Type
61
- invoice_ref_key: string
62
- last_status_updated_at: string
63
- location_id: string
64
- location: Api_Instrument_Location
65
- misplacement: boolean
66
- module: string | null
67
- module_id: string | null
68
- name: string
69
- pressure: unknown | null
70
- registry_module_id: string
71
- responsible_id: string
72
- responsible: Api_User
73
- status: Api_Instrument_Status
74
- status_id: string
75
- storage: Api_Instrument_Storage
76
- supervisor: unknown | null
77
- supervisor_id: string
78
- type: unknown | null
79
- weight: unknown | null
80
- }
81
-
82
- export type Api_instruments_HistoryResponse = {
83
- data: Api_Instrument[]
84
- from: number
85
- to: number
86
- total: number
87
- per_page: number
88
- current_page: number
89
- total_pages: number
90
- last_page_url: string
91
- first_page_url: string
92
- next_page_url: string | null
93
- prev_page_url: string | null
94
- path: string
95
- links: {
96
- label: string
97
- url: string
98
- active: boolean
99
- }[]
100
- }
101
-
102
- export type Api_Warehouse_Search = Omit<
103
- Api_Instrument,
104
- | 'created_at'
105
- | 'deleted_at'
106
- | 'invoice_ref_key'
107
- | 'last_status_updated_at'
108
- | 'pressure'
109
- | 'registry_module_id'
110
- | 'supervisor'
111
- | 'supervisor_id'
112
- | 'type'
113
- | 'weight'
114
- > & {
115
- issued_in: unknown | null
116
- registry: {
117
- id: string
118
- title: string
119
- }
120
- }
121
-
122
- export type Api_Warehouse_Create = {
123
- instrument_id: string
124
- inventory_number: string
125
- module_id?: string
126
- registry_module_id?: string
127
- }
128
-
129
- export type Api_Warehouse_Status_History_Item = {
130
- old_status: Api_Status_DTO
131
- new_status: Api_Status_DTO
132
- created_at: string
133
- responsible: Omit<Api_Search_User, 'photos' | 'divisions' | 'passes'> & {
134
- roles: { id: string; display_name: string }[]
135
- }
136
- }
1
+ import { Api_User } from '../types/Api_User'
2
+ import { Api_Status_DTO } from '@/api/types/Api_Tasks'
3
+ import { Api_Search_User } from '@/api/types/Api_Search'
4
+
5
+ export type Api_Instrument_Storage = {
6
+ id: string
7
+ created_at: string
8
+ deleted_at: string | null
9
+ updated_at: string
10
+ description: string
11
+ name: string
12
+ title: string
13
+ parent: unknown | null
14
+ parents: unknown[]
15
+ state_id: unknown | null
16
+ }
17
+
18
+ export type Api_Instrument_Type = {
19
+ id: string
20
+ name: string
21
+ created_at: string
22
+ updated_at: string
23
+ deleted_at: string | null
24
+ icon: string
25
+ storage_id: string
26
+ storage: Api_Instrument_Storage
27
+ }
28
+
29
+ export type Api_Instrument_Location = {
30
+ id: string
31
+ name: string
32
+ title: string
33
+ description: string
34
+ created_at: string
35
+ updated_at: string
36
+ deleted_at: string | null
37
+ state_id: string | null
38
+ }
39
+
40
+ export type Api_Instrument_Status = {
41
+ id: string
42
+ description: string
43
+ name: string
44
+ title: string
45
+ created_at: string
46
+ updated_at: string
47
+ deleted_at: string | null
48
+ }
49
+
50
+ export type Api_Instrument = {
51
+ id: string
52
+ RFID: string | null
53
+ instrument_id: string
54
+ arrival_at: string
55
+ created_at: string
56
+ supply_at: string
57
+ updated_at: string
58
+ deleted_at: string | null
59
+ inventory_number: string
60
+ instrument_type: Api_Instrument_Type
61
+ invoice_ref_key: string
62
+ last_status_updated_at: string
63
+ location_id: string
64
+ location: Api_Instrument_Location
65
+ misplacement: boolean
66
+ module: string | null
67
+ module_id: string | null
68
+ name: string
69
+ pressure: unknown | null
70
+ registry_module_id: string
71
+ responsible_id: string
72
+ responsible: Api_User
73
+ status: Api_Instrument_Status
74
+ status_id: string
75
+ storage: Api_Instrument_Storage
76
+ supervisor: unknown | null
77
+ supervisor_id: string
78
+ type: unknown | null
79
+ weight: unknown | null
80
+ }
81
+
82
+ export type Api_instruments_HistoryResponse = {
83
+ data: Api_Instrument[]
84
+ from: number
85
+ to: number
86
+ total: number
87
+ per_page: number
88
+ current_page: number
89
+ total_pages: number
90
+ last_page_url: string
91
+ first_page_url: string
92
+ next_page_url: string | null
93
+ prev_page_url: string | null
94
+ path: string
95
+ links: {
96
+ label: string
97
+ url: string
98
+ active: boolean
99
+ }[]
100
+ }
101
+
102
+ export type Api_Warehouse_Search = Omit<
103
+ Api_Instrument,
104
+ | 'created_at'
105
+ | 'deleted_at'
106
+ | 'invoice_ref_key'
107
+ | 'last_status_updated_at'
108
+ | 'pressure'
109
+ | 'registry_module_id'
110
+ | 'supervisor'
111
+ | 'supervisor_id'
112
+ | 'type'
113
+ | 'weight'
114
+ > & {
115
+ issued_in: unknown | null
116
+ registry: {
117
+ id: string
118
+ title: string
119
+ }
120
+ }
121
+
122
+ export type Api_Warehouse_Create = {
123
+ instrument_id: string
124
+ inventory_number: string
125
+ module_id?: string
126
+ registry_module_id?: string
127
+ }
128
+
129
+ export type Api_Warehouse_Status_History_Item = {
130
+ old_status: Api_Status_DTO
131
+ new_status: Api_Status_DTO
132
+ created_at: string
133
+ responsible: Omit<Api_Search_User, 'photos' | 'divisions' | 'passes'> & {
134
+ roles: { id: string; display_name: string }[]
135
+ }
136
+ }
@@ -1,21 +1,21 @@
1
- import { Api_Search_Module } from '@/api/types/Api_Search'
2
- import { Api_Instrument, Api_Instrument_Location } from '@/api/types/Api_Instruments'
3
-
4
- export type Api_Module_Create = Pick<Api_Search_Module, 'RFID' | 'inventory_number' | 'title' | 'type'> & {
5
- user_id: string
6
- teams: string[]
7
- }
8
-
9
- export type Api_Module = Api_Search_Module & {
10
- auth_count: number
11
- auth_failed_count: number
12
- instrument: Pick<Api_Instrument, 'id' | 'RFID' | 'instrument_id' | 'inventory_number' | 'name'> | null
13
- inventory_completed_count: number
14
- location: Pick<Api_Instrument_Location, 'id' | 'name' | 'title' | 'state_id' | 'description'> | null
15
- location_id: string | null
16
- team_id: string | null
17
- tun: unknown
18
- user_id: string
19
- warehouse_id: string | null
20
- work_zones: unknown[]
21
- }
1
+ import { Api_Search_Module } from '@/api/types/Api_Search'
2
+ import { Api_Instrument, Api_Instrument_Location } from '@/api/types/Api_Instruments'
3
+
4
+ export type Api_Module_Create = Pick<Api_Search_Module, 'RFID' | 'inventory_number' | 'title' | 'type'> & {
5
+ user_id: string
6
+ teams: string[]
7
+ }
8
+
9
+ export type Api_Module = Api_Search_Module & {
10
+ auth_count: number
11
+ auth_failed_count: number
12
+ instrument: Pick<Api_Instrument, 'id' | 'RFID' | 'instrument_id' | 'inventory_number' | 'name'> | null
13
+ inventory_completed_count: number
14
+ location: Pick<Api_Instrument_Location, 'id' | 'name' | 'title' | 'state_id' | 'description'> | null
15
+ location_id: string | null
16
+ team_id: string | null
17
+ tun: unknown
18
+ user_id: string
19
+ warehouse_id: string | null
20
+ work_zones: unknown[]
21
+ }
@@ -32,15 +32,17 @@ export type Api_Equipment_Full_Dto = {
32
32
  repair_range: number
33
33
  }
34
34
 
35
+ export type Api_Work_Zone_By_Tasks = {
36
+ coordinates: { x0: number; x1: number; y0: number; y1: number }
37
+ id: string
38
+ tasks: unknown[]
39
+ title: string
40
+ }
41
+
35
42
  export type Api_Task_Video_Source = {
36
43
  id: string
37
44
  name: string
38
- work_zones_by_tasks: Array<{
39
- coordinates: { x0: number; x1: number; y0: number; y1: number }
40
- id: string
41
- tasks: unknown[]
42
- title: string
43
- }>
45
+ work_zones_by_tasks: Api_Work_Zone_By_Tasks[]
44
46
  }
45
47
 
46
48
  export type Api_Task_Video_Source_Stream = {