shared-ritm 1.3.96 → 1.3.98

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 (99) hide show
  1. package/README.md +103 -103
  2. package/dist/index.css +1 -1
  3. package/dist/shared-ritm.es.js +24 -23
  4. package/dist/shared-ritm.umd.js +3 -3
  5. package/dist/types/api/services/InstrumentsService.d.ts +5 -1
  6. package/dist/types/api/types/Api_Instruments.d.ts +4 -0
  7. package/package.json +1 -1
  8. package/src/api/services/BrigadesService.ts +32 -32
  9. package/src/api/services/CommentsService.ts +24 -24
  10. package/src/api/services/FileService.ts +17 -17
  11. package/src/api/services/GanttService.ts +47 -47
  12. package/src/api/services/InstrumentsService.ts +72 -68
  13. package/src/api/services/ModulesService.ts +27 -27
  14. package/src/api/services/ProjectsService.ts +83 -83
  15. package/src/api/services/ScheduleService.ts +69 -69
  16. package/src/api/services/SearchService.ts +22 -22
  17. package/src/api/services/TasksService.ts +157 -157
  18. package/src/api/settings/ApiService.ts +184 -185
  19. package/src/api/types/Api_Brigades.ts +36 -36
  20. package/src/api/types/Api_Comment.ts +40 -40
  21. package/src/api/types/Api_Files.ts +7 -7
  22. package/src/api/types/Api_Instruments.ts +161 -156
  23. package/src/api/types/Api_Modules.ts +21 -21
  24. package/src/api/types/Api_Projects.ts +62 -62
  25. package/src/api/types/Api_Schedule.ts +64 -64
  26. package/src/api/types/Api_Service.ts +9 -9
  27. package/src/common/app-button/AppButton.vue +173 -173
  28. package/src/common/app-date-picker/AppDatePicker.vue +81 -81
  29. package/src/common/app-datepicker/AppDatepicker.vue +218 -218
  30. package/src/common/app-dropdown/AppDropdown.vue +37 -37
  31. package/src/common/app-file/AppFile.vue +80 -80
  32. package/src/common/app-input/AppInput.vue +150 -150
  33. package/src/common/app-input-search/AppInputSearch.vue +174 -174
  34. package/src/common/app-layout/AppLayout.vue +84 -84
  35. package/src/common/app-layout/components/AppLayoutPage.vue +16 -16
  36. package/src/common/app-loader/index.vue +43 -43
  37. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  38. package/src/common/app-sheet/AppSheet.vue +120 -120
  39. package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
  40. package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
  41. package/src/common/app-sidebar/components/SidebarMenuItem.vue +149 -149
  42. package/src/common/app-table/AppTableLayout.vue +137 -137
  43. package/src/common/app-table/components/TablePagination.vue +152 -152
  44. package/src/common/app-table/components/TableSearch.vue +76 -76
  45. package/src/common/app-table/controllers/useBaseTable.ts +45 -45
  46. package/src/global.d.ts +1 -1
  47. package/src/icons/components/arrow-down-icon.vue +25 -25
  48. package/src/icons/components/arrow-frame-icon.vue +19 -19
  49. package/src/icons/components/arrow-square.vue +22 -22
  50. package/src/icons/components/table-filter-icon.vue +30 -30
  51. package/src/icons/dialogs/RemoveIcon.vue +12 -12
  52. package/src/icons/dialogs/SafetyIcon.vue +12 -12
  53. package/src/icons/header/NotificationIcon.vue +18 -18
  54. package/src/icons/header/PersonIcon.vue +11 -11
  55. package/src/icons/header/SettingIcon.vue +14 -14
  56. package/src/icons/header/flashIcon.vue +24 -24
  57. package/src/icons/header/searchStatusIcon.vue +24 -24
  58. package/src/icons/header/smallCapsIcon.vue +34 -34
  59. package/src/icons/sidebar/assign-module-icon.vue +36 -36
  60. package/src/icons/sidebar/instrument-history-icon.vue +32 -32
  61. package/src/icons/sidebar/instrument-order-icon.vue +38 -38
  62. package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
  63. package/src/icons/sidebar/instruments-icon.vue +45 -45
  64. package/src/icons/sidebar/logo-icon.vue +15 -15
  65. package/src/icons/sidebar/logout-icon.vue +13 -13
  66. package/src/icons/sidebar/modules-icon.vue +16 -16
  67. package/src/icons/sidebar/notifications-icon.vue +24 -24
  68. package/src/icons/sidebar/order-icon.vue +44 -44
  69. package/src/icons/sidebar/pass-icon.vue +38 -38
  70. package/src/icons/sidebar/positions-icon.vue +42 -42
  71. package/src/icons/sidebar/preorder-icon.vue +19 -19
  72. package/src/icons/sidebar/projects-icon.vue +31 -31
  73. package/src/icons/sidebar/repair-object-icon.vue +18 -18
  74. package/src/icons/sidebar/repairs-icon.vue +20 -20
  75. package/src/icons/sidebar/roles-icon.vue +26 -26
  76. package/src/icons/sidebar/status-history-icon.vue +24 -24
  77. package/src/icons/sidebar/tasks-icon.vue +28 -28
  78. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  79. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  80. package/src/icons/sidebar/teams-icon.vue +32 -32
  81. package/src/icons/sidebar/user-icon.vue +18 -18
  82. package/src/icons/sidebar/users-icon.vue +46 -46
  83. package/src/icons/sidebar/videosources-icon.vue +19 -19
  84. package/src/icons/sidebar/videowall-icon.vue +13 -13
  85. package/src/icons/sidebar/videozones-icon.vue +21 -21
  86. package/src/icons/sidebar/warehouses-icon.vue +43 -43
  87. package/src/icons/sidebar/workshop-icon.vue +100 -100
  88. package/src/icons/sidebar/workzones-icon.vue +22 -22
  89. package/src/icons/task/attention-icon.vue +13 -13
  90. package/src/icons/task/clock-icon.vue +10 -10
  91. package/src/icons/task/delete-icon.vue +10 -10
  92. package/src/icons/task/fire-icon.vue +16 -16
  93. package/src/main.ts +28 -28
  94. package/src/quasar-user-options.ts +17 -17
  95. package/src/router/index.ts +10 -10
  96. package/src/shims-vue.d.ts +5 -5
  97. package/src/utils/confirm.ts +12 -12
  98. package/src/utils/faceApiHelper.ts +132 -132
  99. package/src/utils/notification.ts +9 -9
@@ -1,185 +1,184 @@
1
- import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
- import { Api_Auth_Login } from '@/api/types/Api_Auth'
3
-
4
- // eslint-disable-next-line
5
- var isRefreshing = false
6
- // eslint-disable-next-line
7
- var refreshSubscribers: any[] = []
8
-
9
- interface Api_Auth_Refresh {
10
- accessToken: string
11
- }
12
-
13
- export enum ApiServiceType {
14
- SERVICE_AUTH = 'SERVICE_AUTH',
15
- }
16
-
17
- export default class ApiService {
18
- private axiosInstance: AxiosInstance
19
-
20
- constructor() {
21
- this.axiosInstance = axios.create({
22
- baseURL: process.env.VUE_APP_BACKEND,
23
- headers: {
24
- 'Content-Type': 'application/json',
25
- Accept: 'application/json',
26
- },
27
- withCredentials: true,
28
- })
29
-
30
- this.axiosInstance.interceptors.request.use(
31
- (config: InternalAxiosRequestConfig) => {
32
- config.headers.Authorization = `Bearer ${this.getAccessToken()}`
33
- return config
34
- },
35
- (error: AxiosError) => {
36
- return Promise.reject(error)
37
- },
38
- )
39
-
40
- this.axiosInstance.interceptors.response.use(
41
- (response: AxiosResponse) => {
42
- return response.data
43
- },
44
- async error => {
45
- const originalRequest = error.config
46
-
47
- if (
48
- error.response?.status !== 401 ||
49
- originalRequest.url === '/v2/auth/refresh' ||
50
- originalRequest.url === '/v2/login' ||
51
- originalRequest._retry
52
- ) {
53
- return Promise.reject(error)
54
- }
55
-
56
- originalRequest._retry = true
57
-
58
- if (isRefreshing) {
59
- return new Promise(resolve => {
60
- this.subscribeTokenRefresh(() => resolve(this.axiosInstance(originalRequest)))
61
- })
62
- }
63
-
64
- isRefreshing = true
65
-
66
- try {
67
- const response = await this.refresh()
68
-
69
- const newToken = response.accessToken
70
- if (!newToken) {
71
- this.logoutUser()
72
- return Promise.reject(error)
73
- }
74
-
75
- this.setAccessToken(newToken)
76
- this.onRefreshed()
77
- isRefreshing = false
78
- return this.axiosInstance(originalRequest)
79
- } catch (e) {
80
- this.logoutUser()
81
- return Promise.reject(e)
82
- }
83
- },
84
- )
85
- }
86
-
87
- private setAccessToken(token: string) {
88
- localStorage.setItem('token', token)
89
- }
90
- private getAccessToken() {
91
- return localStorage.getItem('token')
92
- }
93
-
94
- private removeToken() {
95
- localStorage.removeItem('token')
96
- }
97
-
98
- private subscribeTokenRefresh(cb: any) {
99
- refreshSubscribers.push(cb)
100
- }
101
-
102
- private refresh(): Promise<Api_Auth_Refresh> {
103
- return this.post<null, Api_Auth_Login>(`/v2/auth/refresh`, null)
104
- }
105
-
106
- private onRefreshed() {
107
- refreshSubscribers.forEach(cb => cb())
108
- refreshSubscribers = []
109
- }
110
-
111
- public logoutUser(): any {
112
- isRefreshing = false
113
- this.post<any, any>(`/v2/logout`, null).then(() => {
114
- this.removeToken()
115
- window.location.href = '/sign-in'
116
- })
117
- }
118
-
119
- private handleError(error: AxiosError): void {
120
- if (error.response) {
121
- console.error('API Error:', error.response.status, error.response.data)
122
- } else if (error.request) {
123
- console.error('No response received:', error.request)
124
- } else {
125
- console.error('Error during request setup:', error.message)
126
- }
127
- }
128
-
129
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
130
- try {
131
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
132
- if (response?.data === false) return false as unknown as T
133
-
134
- return response?.data ?? (response as unknown as T)
135
- } catch (error) {
136
- const axiosError = error as AxiosError
137
- this.handleError(axiosError)
138
- throw error
139
- }
140
- }
141
-
142
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
143
- try {
144
- return await this.axiosInstance.delete<T>(url, options)
145
- } catch (error) {
146
- const axiosError = error as AxiosError
147
- this.handleError(axiosError)
148
- throw error
149
- }
150
- }
151
-
152
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
153
- try {
154
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
155
- if (response?.data === false) return false
156
- return response?.data || (response as any)
157
- } catch (error) {
158
- const axiosError = error as AxiosError
159
- this.handleError(axiosError)
160
- throw error
161
- }
162
- }
163
-
164
- protected async patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2> {
165
- try {
166
- const response: AxiosResponse<T2> = await this.axiosInstance.patch<T1, AxiosResponse<T2>>(url, payload, options)
167
- return response.data
168
- } catch (error) {
169
- const axiosError = error as AxiosError
170
- this.handleError(axiosError)
171
- throw error
172
- }
173
- }
174
-
175
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
176
- try {
177
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
178
- return response.data
179
- } catch (error) {
180
- const axiosError = error as AxiosError
181
- this.handleError(axiosError)
182
- throw error
183
- }
184
- }
185
- }
1
+ import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
+ import { Api_Auth_Login } from '@/api/types/Api_Auth'
3
+
4
+ // eslint-disable-next-line
5
+ var isRefreshing = false
6
+ // eslint-disable-next-line
7
+ var refreshSubscribers: any[] = []
8
+
9
+ interface Api_Auth_Refresh {
10
+ accessToken: string
11
+ }
12
+
13
+ export enum ApiServiceType {
14
+ SERVICE_AUTH = 'SERVICE_AUTH',
15
+ }
16
+
17
+ export default class ApiService {
18
+ private axiosInstance: AxiosInstance
19
+
20
+ constructor() {
21
+ this.axiosInstance = axios.create({
22
+ baseURL: process.env.VUE_APP_BACKEND,
23
+ headers: {
24
+ 'Content-Type': 'application/json',
25
+ Accept: 'application/json',
26
+ },
27
+ withCredentials: true,
28
+ })
29
+
30
+ this.axiosInstance.interceptors.request.use(
31
+ (config: InternalAxiosRequestConfig) => {
32
+ config.headers.Authorization = `Bearer ${this.getAccessToken()}`
33
+ return config
34
+ },
35
+ (error: AxiosError) => {
36
+ return Promise.reject(error)
37
+ },
38
+ )
39
+
40
+ this.axiosInstance.interceptors.response.use(
41
+ (response: AxiosResponse) => {
42
+ return response.data
43
+ },
44
+ async error => {
45
+ const originalRequest = error.config
46
+
47
+ if (
48
+ error.response?.status !== 401 ||
49
+ originalRequest.url === '/v2/auth/refresh' ||
50
+ originalRequest.url === '/v2/login' ||
51
+ originalRequest._retry
52
+ ) {
53
+ return Promise.reject(error)
54
+ }
55
+
56
+ originalRequest._retry = true
57
+
58
+ if (isRefreshing) {
59
+ return new Promise(resolve => {
60
+ this.subscribeTokenRefresh(() => resolve(this.axiosInstance(originalRequest)))
61
+ })
62
+ }
63
+
64
+ isRefreshing = true
65
+
66
+ try {
67
+ const response = await this.refresh()
68
+
69
+ const newToken = response.accessToken
70
+ if (!newToken) {
71
+ this.logoutUser()
72
+ return Promise.reject(error)
73
+ }
74
+
75
+ this.setAccessToken(newToken)
76
+ this.onRefreshed()
77
+ isRefreshing = false
78
+ return this.axiosInstance(originalRequest)
79
+ } catch (e) {
80
+ this.logoutUser()
81
+ return Promise.reject(e)
82
+ }
83
+ },
84
+ )
85
+ }
86
+
87
+ private setAccessToken(token: string) {
88
+ localStorage.setItem('token', token)
89
+ }
90
+ private getAccessToken() {
91
+ return localStorage.getItem('token')
92
+ }
93
+
94
+ private removeToken() {
95
+ localStorage.removeItem('token')
96
+ }
97
+
98
+ private subscribeTokenRefresh(cb: any) {
99
+ refreshSubscribers.push(cb)
100
+ }
101
+
102
+ private refresh(): Promise<Api_Auth_Refresh> {
103
+ return this.post<null, Api_Auth_Login>(`/v2/auth/refresh`, null)
104
+ }
105
+
106
+ private onRefreshed() {
107
+ refreshSubscribers.forEach(cb => cb())
108
+ refreshSubscribers = []
109
+ }
110
+
111
+ public logoutUser(): any {
112
+ isRefreshing = false
113
+ this.post<any, any>(`/v2/logout`, null)
114
+ this.removeToken()
115
+ window.location.href = '/sign-in'
116
+ }
117
+
118
+ private handleError(error: AxiosError): void {
119
+ if (error.response) {
120
+ console.error('API Error:', error.response.status, error.response.data)
121
+ } else if (error.request) {
122
+ console.error('No response received:', error.request)
123
+ } else {
124
+ console.error('Error during request setup:', error.message)
125
+ }
126
+ }
127
+
128
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
129
+ try {
130
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
131
+ if (response?.data === false) return false as unknown as T
132
+
133
+ return response?.data ?? (response as unknown as T)
134
+ } catch (error) {
135
+ const axiosError = error as AxiosError
136
+ this.handleError(axiosError)
137
+ throw error
138
+ }
139
+ }
140
+
141
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
142
+ try {
143
+ return await this.axiosInstance.delete<T>(url, options)
144
+ } catch (error) {
145
+ const axiosError = error as AxiosError
146
+ this.handleError(axiosError)
147
+ throw error
148
+ }
149
+ }
150
+
151
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
152
+ try {
153
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
154
+ if (response?.data === false) return false
155
+ return response?.data || (response as any)
156
+ } catch (error) {
157
+ const axiosError = error as AxiosError
158
+ this.handleError(axiosError)
159
+ throw error
160
+ }
161
+ }
162
+
163
+ protected async patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2> {
164
+ try {
165
+ const response: AxiosResponse<T2> = await this.axiosInstance.patch<T1, AxiosResponse<T2>>(url, payload, options)
166
+ return response.data
167
+ } catch (error) {
168
+ const axiosError = error as AxiosError
169
+ this.handleError(axiosError)
170
+ throw error
171
+ }
172
+ }
173
+
174
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
175
+ try {
176
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
177
+ return response.data
178
+ } catch (error) {
179
+ const axiosError = error as AxiosError
180
+ this.handleError(axiosError)
181
+ throw error
182
+ }
183
+ }
184
+ }
@@ -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,40 +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
+ 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,7 +1,7 @@
1
- export type Api_Files_Responsible_Dto = {
2
- name: string
3
- type: string
4
- path: string
5
- extension: string
6
- id: string
7
- }
1
+ export type Api_Files_Responsible_Dto = {
2
+ name: string
3
+ type: string
4
+ path: string
5
+ extension: string
6
+ id: string
7
+ }