shared-ritm 1.1.29 → 1.1.31

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 (54) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +82293 -23606
  3. package/dist/shared-ritm.umd.js +62 -32
  4. package/dist/types/api/types/Api_Files.d.ts +1 -3
  5. package/dist/types/router/index.d.ts +2 -0
  6. package/package.json +1 -1
  7. package/src/api/services/AuthService.ts +41 -41
  8. package/src/api/services/FileService.ts +2 -2
  9. package/src/api/services/GanttService.ts +17 -17
  10. package/src/api/settings/ApiService.ts +125 -125
  11. package/src/api/types/Api_Files.ts +1 -1
  12. package/src/api/types/Api_Repairs.ts +57 -57
  13. package/src/common/app-icon/AppIcon.vue +104 -104
  14. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  15. package/src/global.d.ts +1 -1
  16. package/src/icons/components/arrow-down-icon.vue +25 -25
  17. package/src/icons/components/arrow-frame-icon.vue +19 -19
  18. package/src/icons/components/arrow-square.vue +22 -22
  19. package/src/icons/header/flashIcon.vue +24 -24
  20. package/src/icons/header/notificationIcon.vue +18 -18
  21. package/src/icons/header/searchStatusIcon.vue +24 -24
  22. package/src/icons/header/smallCapsIcon.vue +34 -34
  23. package/src/icons/sidebar/assign-module-icon.vue +36 -36
  24. package/src/icons/sidebar/instrument-history-icon.vue +32 -32
  25. package/src/icons/sidebar/instrument-order-icon.vue +38 -38
  26. package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
  27. package/src/icons/sidebar/instruments-icon.vue +45 -45
  28. package/src/icons/sidebar/logo-icon.vue +15 -15
  29. package/src/icons/sidebar/logout-icon.vue +13 -13
  30. package/src/icons/sidebar/modules-icon.vue +16 -16
  31. package/src/icons/sidebar/notifications-icon.vue +24 -24
  32. package/src/icons/sidebar/order-icon.vue +44 -44
  33. package/src/icons/sidebar/pass-icon.vue +38 -38
  34. package/src/icons/sidebar/positions-icon.vue +42 -42
  35. package/src/icons/sidebar/preorder-icon.vue +19 -19
  36. package/src/icons/sidebar/projects-icon.vue +31 -31
  37. package/src/icons/sidebar/repair-object-icon.vue +18 -18
  38. package/src/icons/sidebar/repairs-icon.vue +20 -20
  39. package/src/icons/sidebar/roles-icon.vue +26 -26
  40. package/src/icons/sidebar/status-history-icon.vue +24 -24
  41. package/src/icons/sidebar/tasks-icon.vue +28 -28
  42. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  43. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  44. package/src/icons/sidebar/teams-icon.vue +32 -32
  45. package/src/icons/sidebar/user-icon.vue +18 -18
  46. package/src/icons/sidebar/users-icon.vue +46 -46
  47. package/src/icons/sidebar/videosources-icon.vue +19 -19
  48. package/src/icons/sidebar/videowall-icon.vue +13 -13
  49. package/src/icons/sidebar/videozones-icon.vue +21 -21
  50. package/src/icons/sidebar/warehouses-icon.vue +43 -43
  51. package/src/icons/sidebar/workshop-icon.vue +100 -100
  52. package/src/icons/sidebar/workzones-icon.vue +22 -22
  53. package/src/quasar-user-options.ts +17 -17
  54. package/src/shims-vue.d.ts +5 -5
@@ -1,3 +1 @@
1
- export type Api_Files_Responsible_Dto = {
2
- file: string;
3
- }[];
1
+ export type Api_Files_Responsible_Dto = unknown;
@@ -0,0 +1,2 @@
1
+ declare const router: import('vue-router').Router
2
+ export default router
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.1.29",
3
+ "version": "1.1.31",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,41 +1,41 @@
1
- import ApiService from '@/api/settings/ApiService'
2
-
3
- type LoginPayload = {
4
- email: string
5
- password: string
6
- }
7
-
8
- type LoginResponse = {
9
- token: string
10
- user: any
11
- }
12
-
13
- type ConfigResponse = any
14
-
15
- class AuthService extends ApiService {
16
- public login(email: string, password: string) {
17
- return this.post<LoginPayload, LoginResponse>(`/login`, {
18
- email,
19
- password,
20
- })
21
- }
22
-
23
- public logout() {
24
- return this.post<null, LoginResponse>(`/logout`, null)
25
- }
26
-
27
- public userInfo() {
28
- return this.get<any>(`/users/auth`)
29
- }
30
-
31
- public configs() {
32
- return this.get<ConfigResponse>(`/configs`)
33
- }
34
- }
35
-
36
- let api: AuthService
37
-
38
- export default function useAuthService() {
39
- if (!api) api = new AuthService()
40
- return api
41
- }
1
+ import ApiService from '@/api/settings/ApiService'
2
+
3
+ type LoginPayload = {
4
+ email: string
5
+ password: string
6
+ }
7
+
8
+ type LoginResponse = {
9
+ token: string
10
+ user: any
11
+ }
12
+
13
+ type ConfigResponse = any
14
+
15
+ class AuthService extends ApiService {
16
+ public login(email: string, password: string) {
17
+ return this.post<LoginPayload, LoginResponse>(`/login`, {
18
+ email,
19
+ password,
20
+ })
21
+ }
22
+
23
+ public logout() {
24
+ return this.post<null, LoginResponse>(`/logout`, null)
25
+ }
26
+
27
+ public userInfo() {
28
+ return this.get<any>(`/users/auth`)
29
+ }
30
+
31
+ public configs() {
32
+ return this.get<ConfigResponse>(`/configs`)
33
+ }
34
+ }
35
+
36
+ let api: AuthService
37
+
38
+ export default function useAuthService() {
39
+ if (!api) api = new AuthService()
40
+ return api
41
+ }
@@ -2,8 +2,8 @@ import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
2
  import { Api_Files_Responsible_Dto } from '@/api/types/Api_Files'
3
3
 
4
4
  class FileService extends ApiService {
5
- public async uploadFile(data: FormData): Promise<ResponseApi<Api_Files_Responsible_Dto>> {
6
- return await this.post<FormData, any>(`/upload-file`, data, { headers: { 'Content-Type': 'multipart/form-data' } })
5
+ public uploadFile(data: FormData): Promise<ResponseApi<Api_Files_Responsible_Dto>> {
6
+ return this.post<FormData, any>(`/upload-file`, data, { headers: { 'Content-Type': 'multipart/form-data' } })
7
7
  }
8
8
  }
9
9
 
@@ -1,17 +1,17 @@
1
- import ApiService from '@/api/settings/ApiService'
2
-
3
- class GanttService extends ApiService {
4
- public async fetchCriticalPathTasks(params: string): Promise<any> {
5
- return await this.get(`gantt/get_list_task_on_critical_path?${params}`)
6
- }
7
- public async fetchGanttList(params: string): Promise<any> {
8
- return await this.get(`/gantt/tasks?${params}`)
9
- }
10
- }
11
-
12
- let api: GanttService
13
-
14
- export default function useGanttService() {
15
- if (!api) api = new GanttService()
16
- return api
17
- }
1
+ import ApiService from '@/api/settings/ApiService'
2
+
3
+ class GanttService extends ApiService {
4
+ public async fetchCriticalPathTasks(params: string): Promise<any> {
5
+ return await this.get(`gantt/get_list_task_on_critical_path?${params}`)
6
+ }
7
+ public async fetchGanttList(params: string): Promise<any> {
8
+ return await this.get(`/gantt/tasks?${params}`)
9
+ }
10
+ }
11
+
12
+ let api: GanttService
13
+
14
+ export default function useGanttService() {
15
+ if (!api) api = new GanttService()
16
+ return api
17
+ }
@@ -1,125 +1,125 @@
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
- },
25
- })
26
-
27
- this.axiosInstance.interceptors.request.use(
28
- (config: InternalAxiosRequestConfig) => {
29
- const token = this.getToken()
30
- if (token && config.headers) {
31
- config.headers.Authorization = `Bearer ${token}`
32
- }
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
- (error: AxiosError) => {
45
- if (error.response?.status === 401 || error.response?.status === 403) {
46
- this.logout()
47
- }
48
- return Promise.reject(error)
49
- },
50
- )
51
- }
52
-
53
- private getToken() {
54
- return localStorage.getItem('token')
55
- }
56
-
57
- private removeToken() {
58
- localStorage.removeItem('token')
59
- }
60
-
61
- public logout(): void {
62
- this.removeToken()
63
- window.location.href = '/sign-in'
64
- }
65
-
66
- private handleError(error: AxiosError): void {
67
- if (error.response) {
68
- console.error('API Error:', error.response.status, error.response.data)
69
- } else if (error.request) {
70
- console.error('No response received:', error.request)
71
- } else {
72
- console.error('Error during request setup:', error.message)
73
- }
74
- }
75
-
76
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
77
- try {
78
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
79
- return response?.data ?? (response as unknown as T)
80
- } catch (error) {
81
- const axiosError = error as AxiosError
82
- this.handleError(axiosError)
83
- throw error
84
- }
85
- }
86
-
87
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
88
- try {
89
- return await this.axiosInstance.delete<T>(url, options)
90
- } catch (error) {
91
- const axiosError = error as AxiosError
92
- this.handleError(axiosError)
93
- throw error
94
- }
95
- }
96
-
97
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
98
- try {
99
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
100
- return response.data
101
- } catch (error) {
102
- const axiosError = error as AxiosError
103
- this.handleError(axiosError)
104
- throw error
105
- }
106
- }
107
-
108
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
109
- // return axios
110
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
111
- // .catch((err: AxiosError) => processError401<T2>(err))
112
- // .then(extractData)
113
- // }
114
- //
115
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
116
- try {
117
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
118
- return response.data
119
- } catch (error) {
120
- const axiosError = error as AxiosError
121
- this.handleError(axiosError)
122
- throw error
123
- }
124
- }
125
- }
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
+ },
25
+ })
26
+
27
+ this.axiosInstance.interceptors.request.use(
28
+ (config: InternalAxiosRequestConfig) => {
29
+ const token = this.getToken()
30
+ if (token && config.headers) {
31
+ config.headers.Authorization = `Bearer ${token}`
32
+ }
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
+ (error: AxiosError) => {
45
+ if (error.response?.status === 401 || error.response?.status === 403) {
46
+ this.logout()
47
+ }
48
+ return Promise.reject(error)
49
+ },
50
+ )
51
+ }
52
+
53
+ private getToken() {
54
+ return localStorage.getItem('token')
55
+ }
56
+
57
+ private removeToken() {
58
+ localStorage.removeItem('token')
59
+ }
60
+
61
+ public logout(): void {
62
+ this.removeToken()
63
+ window.location.href = '/sign-in'
64
+ }
65
+
66
+ private handleError(error: AxiosError): void {
67
+ if (error.response) {
68
+ console.error('API Error:', error.response.status, error.response.data)
69
+ } else if (error.request) {
70
+ console.error('No response received:', error.request)
71
+ } else {
72
+ console.error('Error during request setup:', error.message)
73
+ }
74
+ }
75
+
76
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
77
+ try {
78
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
79
+ return response?.data ?? (response as unknown as T)
80
+ } catch (error) {
81
+ const axiosError = error as AxiosError
82
+ this.handleError(axiosError)
83
+ throw error
84
+ }
85
+ }
86
+
87
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
88
+ try {
89
+ return await this.axiosInstance.delete<T>(url, options)
90
+ } catch (error) {
91
+ const axiosError = error as AxiosError
92
+ this.handleError(axiosError)
93
+ throw error
94
+ }
95
+ }
96
+
97
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
98
+ try {
99
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
100
+ return response.data
101
+ } catch (error) {
102
+ const axiosError = error as AxiosError
103
+ this.handleError(axiosError)
104
+ throw error
105
+ }
106
+ }
107
+
108
+ // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
109
+ // return axios
110
+ // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
111
+ // .catch((err: AxiosError) => processError401<T2>(err))
112
+ // .then(extractData)
113
+ // }
114
+ //
115
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
116
+ try {
117
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
118
+ return response.data
119
+ } catch (error) {
120
+ const axiosError = error as AxiosError
121
+ this.handleError(axiosError)
122
+ throw error
123
+ }
124
+ }
125
+ }
@@ -1 +1 @@
1
- export type Api_Files_Responsible_Dto = { file: string }[]
1
+ export type Api_Files_Responsible_Dto = unknown
@@ -1,57 +1,57 @@
1
- export type Api_Team = {
2
- id: string
3
- display_name: string
4
- }
5
-
6
- export type Api_Equipment_Short_Dto = {
7
- id: string
8
- name: string
9
- }
10
-
11
- export type Api_Repairs = {
12
- id: string
13
- name: string
14
- }
15
-
16
- export type Api_Projects = {
17
- id: string
18
- name: string
19
- }
20
-
21
- export type OptionFilters = {
22
- teams?: Api_Team[]
23
- equipments?: Api_Equipment_Short_Dto[]
24
- }
25
-
26
- export type Api_Equipment_Full_Dto = {
27
- id: string
28
- model: null | string
29
- name: string
30
- registration_number: string
31
- repair_frequency: number
32
- repair_range: number
33
- }
34
-
35
- export type Api_Create_Repair_With_Equipments = {
36
- name: string
37
- display_name: string
38
- description: string
39
- equipment_id: string
40
- }
41
-
42
- export type Api_Update_Repair = {
43
- name?: string
44
- display_name?: string
45
- description: string
46
- }
47
-
48
- export type Api_Repair_Dto = {
49
- id: string
50
- name: string
51
- display_name: string
52
- description: string
53
- start_date: string
54
- end_date: string
55
- projects: Api_Projects[]
56
- equipments: Api_Equipment_Full_Dto[]
57
- }
1
+ export type Api_Team = {
2
+ id: string
3
+ display_name: string
4
+ }
5
+
6
+ export type Api_Equipment_Short_Dto = {
7
+ id: string
8
+ name: string
9
+ }
10
+
11
+ export type Api_Repairs = {
12
+ id: string
13
+ name: string
14
+ }
15
+
16
+ export type Api_Projects = {
17
+ id: string
18
+ name: string
19
+ }
20
+
21
+ export type OptionFilters = {
22
+ teams?: Api_Team[]
23
+ equipments?: Api_Equipment_Short_Dto[]
24
+ }
25
+
26
+ export type Api_Equipment_Full_Dto = {
27
+ id: string
28
+ model: null | string
29
+ name: string
30
+ registration_number: string
31
+ repair_frequency: number
32
+ repair_range: number
33
+ }
34
+
35
+ export type Api_Create_Repair_With_Equipments = {
36
+ name: string
37
+ display_name: string
38
+ description: string
39
+ equipment_id: string
40
+ }
41
+
42
+ export type Api_Update_Repair = {
43
+ name?: string
44
+ display_name?: string
45
+ description: string
46
+ }
47
+
48
+ export type Api_Repair_Dto = {
49
+ id: string
50
+ name: string
51
+ display_name: string
52
+ description: string
53
+ start_date: string
54
+ end_date: string
55
+ projects: Api_Projects[]
56
+ equipments: Api_Equipment_Full_Dto[]
57
+ }