shared-ritm 1.2.56 → 1.2.57

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 (78) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +5338 -5334
  3. package/dist/shared-ritm.umd.js +6 -6
  4. package/dist/types/utils/helpers.d.ts +17 -0
  5. package/package.json +1 -1
  6. package/src/App.vue +2461 -2461
  7. package/src/api/services/AuthService.ts +58 -58
  8. package/src/api/services/ControlsService.ts +64 -64
  9. package/src/api/services/FileService.ts +15 -15
  10. package/src/api/services/TasksService.ts +137 -137
  11. package/src/api/settings/ApiService.ts +128 -128
  12. package/src/api/types/Api_Controls.ts +72 -72
  13. package/src/common/app-button/AppButton.vue +173 -173
  14. package/src/common/app-date-picker/AppDatePicker.vue +81 -81
  15. package/src/common/app-icon/AppIcon.vue +108 -108
  16. package/src/common/app-input/AppInput.vue +147 -147
  17. package/src/common/app-input-search/AppInputSearch.vue +174 -174
  18. package/src/common/app-layout/AppLayout.vue +84 -84
  19. package/src/common/app-layout/components/AppLayoutHeader.vue +246 -246
  20. package/src/common/app-layout/components/AppLayoutPage.vue +16 -16
  21. package/src/common/app-loader/index.vue +43 -43
  22. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  23. package/src/common/app-sidebar/AppSidebar.vue +168 -168
  24. package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
  25. package/src/common/app-table/AppTable.vue +241 -244
  26. package/src/common/app-table/AppTableLayout.vue +102 -104
  27. package/src/common/app-table/components/ModalSelect.vue +264 -264
  28. package/src/common/app-table/components/TableModal.vue +329 -357
  29. package/src/common/app-table/components/TablePagination.vue +150 -151
  30. package/src/common/app-table/components/TableSearch.vue +76 -78
  31. package/src/common/app-table/controllers/useBaseTable.ts +42 -42
  32. package/src/common/app-table/controllers/useTableModel.ts +93 -93
  33. package/src/global.d.ts +1 -1
  34. package/src/icons/components/arrow-down-icon.vue +25 -25
  35. package/src/icons/components/arrow-frame-icon.vue +19 -19
  36. package/src/icons/components/arrow-square.vue +22 -22
  37. package/src/icons/header/NotificationIcon.vue +18 -18
  38. package/src/icons/header/PersonIcon.vue +11 -11
  39. package/src/icons/header/SettingIcon.vue +14 -14
  40. package/src/icons/header/flashIcon.vue +24 -24
  41. package/src/icons/header/searchStatusIcon.vue +24 -24
  42. package/src/icons/header/smallCapsIcon.vue +34 -34
  43. package/src/icons/sidebar/assign-module-icon.vue +36 -36
  44. package/src/icons/sidebar/instrument-history-icon.vue +32 -32
  45. package/src/icons/sidebar/instrument-order-icon.vue +38 -38
  46. package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
  47. package/src/icons/sidebar/instruments-icon.vue +45 -45
  48. package/src/icons/sidebar/logo-icon.vue +15 -15
  49. package/src/icons/sidebar/logout-icon.vue +13 -13
  50. package/src/icons/sidebar/modules-icon.vue +16 -16
  51. package/src/icons/sidebar/notifications-icon.vue +24 -24
  52. package/src/icons/sidebar/order-icon.vue +44 -44
  53. package/src/icons/sidebar/pass-icon.vue +38 -38
  54. package/src/icons/sidebar/positions-icon.vue +42 -42
  55. package/src/icons/sidebar/preorder-icon.vue +19 -19
  56. package/src/icons/sidebar/projects-icon.vue +31 -31
  57. package/src/icons/sidebar/repair-object-icon.vue +18 -18
  58. package/src/icons/sidebar/repairs-icon.vue +20 -20
  59. package/src/icons/sidebar/roles-icon.vue +26 -26
  60. package/src/icons/sidebar/status-history-icon.vue +24 -24
  61. package/src/icons/sidebar/tasks-icon.vue +28 -28
  62. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  63. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  64. package/src/icons/sidebar/teams-icon.vue +32 -32
  65. package/src/icons/sidebar/user-icon.vue +18 -18
  66. package/src/icons/sidebar/users-icon.vue +46 -46
  67. package/src/icons/sidebar/videosources-icon.vue +19 -19
  68. package/src/icons/sidebar/videowall-icon.vue +13 -13
  69. package/src/icons/sidebar/videozones-icon.vue +21 -21
  70. package/src/icons/sidebar/warehouses-icon.vue +43 -43
  71. package/src/icons/sidebar/workshop-icon.vue +100 -100
  72. package/src/icons/sidebar/workzones-icon.vue +22 -22
  73. package/src/index.ts +84 -84
  74. package/src/main.ts +28 -28
  75. package/src/quasar-user-options.ts +17 -17
  76. package/src/router/index.ts +10 -10
  77. package/src/shims-vue.d.ts +5 -5
  78. package/src/utils/helpers.ts +39 -0
@@ -1,128 +1,128 @@
1
- import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
-
3
- export enum ApiServiceType {
4
- SERVICE_AUTH = 'SERVICE_AUTH',
5
- }
6
-
7
- export type ResponseApi<T> = {
8
- count: number
9
- current_page: number
10
- data: T
11
- per_page: number
12
- total: number
13
- total_pages: number
14
- }
15
-
16
- export default class ApiService {
17
- private axiosInstance: AxiosInstance
18
-
19
- constructor() {
20
- this.axiosInstance = axios.create({
21
- baseURL: process.env.VUE_APP_BACKEND,
22
- headers: {
23
- 'Content-Type': 'application/json',
24
- Accept: 'application/json',
25
- },
26
- })
27
-
28
- this.axiosInstance.interceptors.request.use(
29
- (config: InternalAxiosRequestConfig) => {
30
- const token = this.getToken()
31
- if (token && config.headers) {
32
- config.headers.Authorization = `Bearer ${token}`
33
- }
34
- return config
35
- },
36
- (error: AxiosError) => {
37
- return Promise.reject(error)
38
- },
39
- )
40
-
41
- this.axiosInstance.interceptors.response.use(
42
- (response: AxiosResponse) => {
43
- return response.data
44
- },
45
- (error: AxiosError) => {
46
- if (error.response?.status === 401 || error.response?.status === 403) {
47
- this.logout()
48
- }
49
- return Promise.reject(error)
50
- },
51
- )
52
- }
53
-
54
- private getToken() {
55
- return localStorage.getItem('token')
56
- }
57
-
58
- private removeToken() {
59
- localStorage.removeItem('token')
60
- }
61
-
62
- public logout(): void {
63
- this.removeToken()
64
- window.location.href = '/sign-in'
65
- }
66
-
67
- private handleError(error: AxiosError): void {
68
- if (error.response) {
69
- console.error('API Error:', error.response.status, error.response.data)
70
- } else if (error.request) {
71
- console.error('No response received:', error.request)
72
- } else {
73
- console.error('Error during request setup:', error.message)
74
- }
75
- }
76
-
77
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
78
- try {
79
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
80
- if (response?.data === false) return false as unknown as T
81
- return response?.data ?? (response as unknown as T)
82
- } catch (error) {
83
- const axiosError = error as AxiosError
84
- this.handleError(axiosError)
85
- throw error
86
- }
87
- }
88
-
89
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
90
- try {
91
- return await this.axiosInstance.delete<T>(url, options)
92
- } catch (error) {
93
- const axiosError = error as AxiosError
94
- this.handleError(axiosError)
95
- throw error
96
- }
97
- }
98
-
99
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
100
- try {
101
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
102
- if (response?.data === false) return false
103
- return response?.data || (response as any)
104
- } catch (error) {
105
- const axiosError = error as AxiosError
106
- this.handleError(axiosError)
107
- throw error
108
- }
109
- }
110
-
111
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
112
- // return axios
113
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
114
- // .catch((err: AxiosError) => processError401<T2>(err))
115
- // .then(extractData)
116
- // }
117
- //
118
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
119
- try {
120
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
121
- return response.data
122
- } catch (error) {
123
- const axiosError = error as AxiosError
124
- this.handleError(axiosError)
125
- throw error
126
- }
127
- }
128
- }
1
+ import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
+
3
+ export enum ApiServiceType {
4
+ SERVICE_AUTH = 'SERVICE_AUTH',
5
+ }
6
+
7
+ export type ResponseApi<T> = {
8
+ count: number
9
+ current_page: number
10
+ data: T
11
+ per_page: number
12
+ total: number
13
+ total_pages: number
14
+ }
15
+
16
+ export default class ApiService {
17
+ private axiosInstance: AxiosInstance
18
+
19
+ constructor() {
20
+ this.axiosInstance = axios.create({
21
+ baseURL: process.env.VUE_APP_BACKEND,
22
+ headers: {
23
+ 'Content-Type': 'application/json',
24
+ Accept: 'application/json',
25
+ },
26
+ })
27
+
28
+ this.axiosInstance.interceptors.request.use(
29
+ (config: InternalAxiosRequestConfig) => {
30
+ const token = this.getToken()
31
+ if (token && config.headers) {
32
+ config.headers.Authorization = `Bearer ${token}`
33
+ }
34
+ return config
35
+ },
36
+ (error: AxiosError) => {
37
+ return Promise.reject(error)
38
+ },
39
+ )
40
+
41
+ this.axiosInstance.interceptors.response.use(
42
+ (response: AxiosResponse) => {
43
+ return response.data
44
+ },
45
+ (error: AxiosError) => {
46
+ if (error.response?.status === 401 || error.response?.status === 403) {
47
+ this.logout()
48
+ }
49
+ return Promise.reject(error)
50
+ },
51
+ )
52
+ }
53
+
54
+ private getToken() {
55
+ return localStorage.getItem('token')
56
+ }
57
+
58
+ private removeToken() {
59
+ localStorage.removeItem('token')
60
+ }
61
+
62
+ public logout(): void {
63
+ this.removeToken()
64
+ window.location.href = '/sign-in'
65
+ }
66
+
67
+ private handleError(error: AxiosError): void {
68
+ if (error.response) {
69
+ console.error('API Error:', error.response.status, error.response.data)
70
+ } else if (error.request) {
71
+ console.error('No response received:', error.request)
72
+ } else {
73
+ console.error('Error during request setup:', error.message)
74
+ }
75
+ }
76
+
77
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
78
+ try {
79
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
80
+ if (response?.data === false) return false as unknown as T
81
+ return response?.data ?? (response as unknown as T)
82
+ } catch (error) {
83
+ const axiosError = error as AxiosError
84
+ this.handleError(axiosError)
85
+ throw error
86
+ }
87
+ }
88
+
89
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
90
+ try {
91
+ return await this.axiosInstance.delete<T>(url, options)
92
+ } catch (error) {
93
+ const axiosError = error as AxiosError
94
+ this.handleError(axiosError)
95
+ throw error
96
+ }
97
+ }
98
+
99
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
100
+ try {
101
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
102
+ if (response?.data === false) return false
103
+ return response?.data || (response as any)
104
+ } catch (error) {
105
+ const axiosError = error as AxiosError
106
+ this.handleError(axiosError)
107
+ throw error
108
+ }
109
+ }
110
+
111
+ // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
112
+ // return axios
113
+ // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
114
+ // .catch((err: AxiosError) => processError401<T2>(err))
115
+ // .then(extractData)
116
+ // }
117
+ //
118
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
119
+ try {
120
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
121
+ return response.data
122
+ } catch (error) {
123
+ const axiosError = error as AxiosError
124
+ this.handleError(axiosError)
125
+ throw error
126
+ }
127
+ }
128
+ }
@@ -1,72 +1,72 @@
1
- export type Api_User_Dto = {
2
- id: string
3
- full_name: string
4
- }
5
- export type Api_ControlZones_Dto = {
6
- id: string
7
- name: string
8
- inventory_number: string
9
- uuid: string
10
- controller_zone: string
11
- users?: Api_User_Dto[]
12
- }
13
- export type ControlsParams = {
14
- search?: string
15
- page?: number
16
- filter?: Record<string, string[]>
17
- }
18
-
19
- export interface ControlMeta {
20
- total: number
21
- perPage: number
22
- totalPages: number
23
- currentPage: number
24
- }
25
-
26
- export type FiltersValue = {
27
- users?: {
28
- users: Api_User_Dto[]
29
- }
30
- controller?: {
31
- controller: Api_User_Dto[]
32
- }
33
- responsible?: {
34
- responsible: Api_User_Dto[]
35
- }
36
- status?: {
37
- status: boolean
38
- }
39
- }
40
- export type Api_Instrument_Dto = {
41
- id: string
42
- name: string
43
- storage_id?: string
44
- }
45
- export type Api_Warehouse_Dto = {
46
- id: string
47
- invoice_ref_key: string
48
- inventory_number: string
49
- instrument: Api_Instrument_Dto[]
50
- }
51
-
52
- export type Api_ControlLogs_Dto = {
53
- id: string
54
- automatically: string
55
- in_zone: string
56
- uuid: string
57
- controller_zone: string
58
- controller: Api_User_Dto[]
59
- user: Api_User_Dto[]
60
- frame: Api_ControlZones_Dto[]
61
- warehouse: Api_Warehouse_Dto[]
62
- }
63
- export type Api_New_Items = {
64
- title: string
65
- inventory_numbers: string
66
- storage_id: string
67
- }
68
- export type Api_ManualEntry_Dto = {
69
- user: string
70
- items?: string[]
71
- new_items?: Api_New_Items[]
72
- }
1
+ export type Api_User_Dto = {
2
+ id: string
3
+ full_name: string
4
+ }
5
+ export type Api_ControlZones_Dto = {
6
+ id: string
7
+ name: string
8
+ inventory_number: string
9
+ uuid: string
10
+ controller_zone: string
11
+ users?: Api_User_Dto[]
12
+ }
13
+ export type ControlsParams = {
14
+ search?: string
15
+ page?: number
16
+ filter?: Record<string, string[]>
17
+ }
18
+
19
+ export interface ControlMeta {
20
+ total: number
21
+ perPage: number
22
+ totalPages: number
23
+ currentPage: number
24
+ }
25
+
26
+ export type FiltersValue = {
27
+ users?: {
28
+ users: Api_User_Dto[]
29
+ }
30
+ controller?: {
31
+ controller: Api_User_Dto[]
32
+ }
33
+ responsible?: {
34
+ responsible: Api_User_Dto[]
35
+ }
36
+ status?: {
37
+ status: boolean
38
+ }
39
+ }
40
+ export type Api_Instrument_Dto = {
41
+ id: string
42
+ name: string
43
+ storage_id?: string
44
+ }
45
+ export type Api_Warehouse_Dto = {
46
+ id: string
47
+ invoice_ref_key: string
48
+ inventory_number: string
49
+ instrument: Api_Instrument_Dto[]
50
+ }
51
+
52
+ export type Api_ControlLogs_Dto = {
53
+ id: string
54
+ automatically: string
55
+ in_zone: string
56
+ uuid: string
57
+ controller_zone: string
58
+ controller: Api_User_Dto[]
59
+ user: Api_User_Dto[]
60
+ frame: Api_ControlZones_Dto[]
61
+ warehouse: Api_Warehouse_Dto[]
62
+ }
63
+ export type Api_New_Items = {
64
+ title: string
65
+ inventory_numbers: string
66
+ storage_id: string
67
+ }
68
+ export type Api_ManualEntry_Dto = {
69
+ user: string
70
+ items?: string[]
71
+ new_items?: Api_New_Items[]
72
+ }