shared-ritm 1.1.25 → 1.1.27

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 (87) hide show
  1. package/README.md +93 -0
  2. package/dist/index.css +1 -1
  3. package/dist/shared-ritm.es.js +16940 -75617
  4. package/dist/shared-ritm.umd.js +22 -52
  5. package/dist/types/api/services/FileService.d.ts +7 -0
  6. package/dist/types/api/types/Api_Files.d.ts +3 -0
  7. package/dist/types/index.d.ts +2 -1
  8. package/package.json +56 -56
  9. package/src/App.vue +2432 -2432
  10. package/src/api/services/AuthService.ts +41 -41
  11. package/src/api/services/FileService.ts +15 -0
  12. package/src/api/services/GanttService.ts +17 -17
  13. package/src/api/services/MetricsService.ts +101 -101
  14. package/src/api/services/ProjectsService.ts +61 -61
  15. package/src/api/services/RepairsService.ts +82 -82
  16. package/src/api/services/TasksService.ts +39 -39
  17. package/src/api/settings/ApiService.ts +124 -124
  18. package/src/api/types/Api_Files.ts +1 -0
  19. package/src/api/types/Api_Projects.ts +40 -40
  20. package/src/api/types/Api_Repairs.ts +57 -57
  21. package/src/api/types/Api_Tasks.ts +124 -124
  22. package/src/common/app-button/AppButton.vue +173 -173
  23. package/src/common/app-checkbox/AppCheckbox.vue +26 -26
  24. package/src/common/app-date-picker/AppDatePicker.vue +66 -66
  25. package/src/common/app-dialogs/AppConfirmDialog.vue +100 -100
  26. package/src/common/app-icon/AppIcon.vue +104 -104
  27. package/src/common/app-input/AppInput.vue +147 -147
  28. package/src/common/app-input-search/AppInputSearch.vue +170 -170
  29. package/src/common/app-layout/AppLayout.vue +62 -62
  30. package/src/common/app-layout/components/AppLayoutHeader.vue +124 -124
  31. package/src/common/app-loader/index.vue +43 -43
  32. package/src/common/app-page-layout/AppPageLayout.vue +122 -122
  33. package/src/common/app-select/AppSelect.vue +157 -157
  34. package/src/common/app-sheet/AppSheet.vue +114 -114
  35. package/src/common/app-sidebar/AppSidebar.vue +167 -167
  36. package/src/common/app-sidebar/components/SidebarMenu.vue +29 -29
  37. package/src/common/app-sidebar/components/SidebarMenuItem.vue +137 -137
  38. package/src/common/app-toggle/AppToggle.vue +23 -23
  39. package/src/common/app-wrapper/AppWrapper.vue +28 -28
  40. package/src/global.d.ts +1 -1
  41. package/src/icons/components/arrow-down-icon.vue +25 -25
  42. package/src/icons/components/arrow-frame-icon.vue +19 -19
  43. package/src/icons/components/arrow-square.vue +22 -22
  44. package/src/icons/dialogs/RemoveIcon.vue +12 -12
  45. package/src/icons/dialogs/SafetyIcon.vue +12 -12
  46. package/src/icons/header/flashIcon.vue +24 -24
  47. package/src/icons/header/notificationIcon.vue +18 -18
  48. package/src/icons/header/searchStatusIcon.vue +24 -24
  49. package/src/icons/header/smallCapsIcon.vue +34 -34
  50. package/src/icons/sidebar/assign-module-icon.vue +36 -36
  51. package/src/icons/sidebar/instrument-history-icon.vue +32 -32
  52. package/src/icons/sidebar/instrument-order-icon.vue +38 -38
  53. package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
  54. package/src/icons/sidebar/instruments-icon.vue +45 -45
  55. package/src/icons/sidebar/logo-icon.vue +15 -15
  56. package/src/icons/sidebar/logout-icon.vue +13 -13
  57. package/src/icons/sidebar/modules-icon.vue +16 -16
  58. package/src/icons/sidebar/notifications-icon.vue +24 -24
  59. package/src/icons/sidebar/order-icon.vue +44 -44
  60. package/src/icons/sidebar/pass-icon.vue +38 -38
  61. package/src/icons/sidebar/positions-icon.vue +42 -42
  62. package/src/icons/sidebar/preorder-icon.vue +19 -19
  63. package/src/icons/sidebar/projects-icon.vue +31 -31
  64. package/src/icons/sidebar/repair-object-icon.vue +18 -18
  65. package/src/icons/sidebar/repairs-icon.vue +20 -20
  66. package/src/icons/sidebar/roles-icon.vue +26 -26
  67. package/src/icons/sidebar/status-history-icon.vue +24 -24
  68. package/src/icons/sidebar/tasks-icon.vue +28 -28
  69. package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
  70. package/src/icons/sidebar/tasks_today-icon.vue +27 -27
  71. package/src/icons/sidebar/teams-icon.vue +32 -32
  72. package/src/icons/sidebar/user-icon.vue +18 -18
  73. package/src/icons/sidebar/users-icon.vue +46 -46
  74. package/src/icons/sidebar/videosources-icon.vue +19 -19
  75. package/src/icons/sidebar/videowall-icon.vue +13 -13
  76. package/src/icons/sidebar/videozones-icon.vue +21 -21
  77. package/src/icons/sidebar/warehouses-icon.vue +43 -43
  78. package/src/icons/sidebar/workshop-icon.vue +100 -100
  79. package/src/icons/sidebar/workzones-icon.vue +22 -22
  80. package/src/index.ts +2 -0
  81. package/src/main.ts +15 -15
  82. package/src/quasar-user-options.ts +17 -17
  83. package/src/shared/styles/general.css +96 -96
  84. package/src/shims-vue.d.ts +5 -5
  85. package/src/utils/confirm.ts +12 -12
  86. package/src/utils/notification.ts +9 -9
  87. package/dist/types/router/index.d.ts +0 -2
@@ -1,39 +1,39 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
- import { Api_Tasks_Dto, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks'
3
-
4
- class TasksService extends ApiService {
5
- public async fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>> {
6
- return await this.get(`/tasks/${id}`)
7
- }
8
-
9
- public async fetchTasksList(params: any): Promise<ResponseApi<Api_Tasks_Dto[]>> {
10
- return await this.get('/list/tasks/search', { params })
11
- }
12
-
13
- public async fetchSubtasksList(id: string): Promise<ResponseApi<Api_Tasks_Dto[]>> {
14
- return await this.get(`/task/${id}/subtasks/list`)
15
- }
16
-
17
- public async fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
18
- return await this.get(`/get_list_task_branch?task_id=${id}`)
19
- }
20
-
21
- public async fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
22
- return await this.get(`admin/instruments`, { params })
23
- }
24
-
25
- public async createTask(payload: any): Promise<ResponseApi<any>> {
26
- return await this.post(`tasks`, payload)
27
- }
28
-
29
- public async deleteTask(id: string): Promise<any> {
30
- return await this.delete(`tasks/${id}`)
31
- }
32
- }
33
-
34
- let api: TasksService
35
-
36
- export default function useTasksService() {
37
- if (!api) api = new TasksService()
38
- return api
39
- }
1
+ import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
+ import { Api_Tasks_Dto, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks'
3
+
4
+ class TasksService extends ApiService {
5
+ public async fetchTaskById(id: string): Promise<ResponseApi<Api_Tasks_Task_Dto>> {
6
+ return await this.get(`/tasks/${id}`)
7
+ }
8
+
9
+ public async fetchTasksList(params: any): Promise<ResponseApi<Api_Tasks_Dto[]>> {
10
+ return await this.get('/list/tasks/search', { params })
11
+ }
12
+
13
+ public async fetchSubtasksList(id: string): Promise<ResponseApi<Api_Tasks_Dto[]>> {
14
+ return await this.get(`/task/${id}/subtasks/list`)
15
+ }
16
+
17
+ public async fetchTaskBranch(id: string): Promise<ResponseApi<any>> {
18
+ return await this.get(`/get_list_task_branch?task_id=${id}`)
19
+ }
20
+
21
+ public async fetchInstrumentsList(params: any): Promise<ResponseApi<any[]>> {
22
+ return await this.get(`admin/instruments`, { params })
23
+ }
24
+
25
+ public async createTask(payload: any): Promise<ResponseApi<any>> {
26
+ return await this.post(`tasks`, payload)
27
+ }
28
+
29
+ public async deleteTask(id: string): Promise<any> {
30
+ return await this.delete(`tasks/${id}`)
31
+ }
32
+ }
33
+
34
+ let api: TasksService
35
+
36
+ export default function useTasksService() {
37
+ if (!api) api = new TasksService()
38
+ return api
39
+ }
@@ -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 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
- private getToken() {
53
- return localStorage.getItem('token')
54
- }
55
-
56
- private removeToken() {
57
- localStorage.removeItem('token')
58
- }
59
-
60
- public logout(): void {
61
- this.removeToken()
62
- window.location.href = '/sign-in'
63
- }
64
-
65
- private handleError(error: AxiosError): void {
66
- if (error.response) {
67
- console.error('API Error:', error.response.status, error.response.data)
68
- } else if (error.request) {
69
- console.error('No response received:', error.request)
70
- } else {
71
- console.error('Error during request setup:', error.message)
72
- }
73
- }
74
-
75
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
76
- try {
77
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
78
- return response?.data ?? (response as unknown as T)
79
- } catch (error) {
80
- const axiosError = error as AxiosError
81
- this.handleError(axiosError)
82
- throw error
83
- }
84
- }
85
-
86
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
87
- try {
88
- return await this.axiosInstance.delete<T>(url, options)
89
- } catch (error) {
90
- const axiosError = error as AxiosError
91
- this.handleError(axiosError)
92
- throw error
93
- }
94
- }
95
-
96
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
97
- try {
98
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
99
- return response.data
100
- } catch (error) {
101
- const axiosError = error as AxiosError
102
- this.handleError(axiosError)
103
- throw error
104
- }
105
- }
106
-
107
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
108
- // return axios
109
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
110
- // .catch((err: AxiosError) => processError401<T2>(err))
111
- // .then(extractData)
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 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
+ private getToken() {
53
+ return localStorage.getItem('token')
54
+ }
55
+
56
+ private removeToken() {
57
+ localStorage.removeItem('token')
58
+ }
59
+
60
+ public logout(): void {
61
+ this.removeToken()
62
+ window.location.href = '/sign-in'
63
+ }
64
+
65
+ private handleError(error: AxiosError): void {
66
+ if (error.response) {
67
+ console.error('API Error:', error.response.status, error.response.data)
68
+ } else if (error.request) {
69
+ console.error('No response received:', error.request)
70
+ } else {
71
+ console.error('Error during request setup:', error.message)
72
+ }
73
+ }
74
+
75
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
76
+ try {
77
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
78
+ return response?.data ?? (response as unknown as T)
79
+ } catch (error) {
80
+ const axiosError = error as AxiosError
81
+ this.handleError(axiosError)
82
+ throw error
83
+ }
84
+ }
85
+
86
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
87
+ try {
88
+ return await this.axiosInstance.delete<T>(url, options)
89
+ } catch (error) {
90
+ const axiosError = error as AxiosError
91
+ this.handleError(axiosError)
92
+ throw error
93
+ }
94
+ }
95
+
96
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
97
+ try {
98
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
99
+ return response.data
100
+ } catch (error) {
101
+ const axiosError = error as AxiosError
102
+ this.handleError(axiosError)
103
+ throw error
104
+ }
105
+ }
106
+
107
+ // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
108
+ // return axios
109
+ // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
110
+ // .catch((err: AxiosError) => processError401<T2>(err))
111
+ // .then(extractData)
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
+ }
@@ -0,0 +1 @@
1
+ export type Api_Files_Responsible_Dto = { file: string }[]
@@ -1,40 +1,40 @@
1
- export type Api_Project_Repair = {
2
- id: string
3
- name: string
4
- start_date: null | string
5
- end_date: null | string
6
- }
7
-
8
- export type Api_Project_Team = {
9
- id: string
10
- name: string
11
- display_name: string
12
- description: string
13
- created_at: string
14
- updated_at: string
15
- pivot: {
16
- project_id: string
17
- team_id: string
18
- }
19
- }
20
-
21
- export type Api_Project_Category = {
22
- code: number
23
- display_name: string
24
- name: string
25
- }
26
-
27
- export type Api_Project_Dto = {
28
- id: string
29
- name: string
30
- description: null
31
- image: null
32
- start_date: string
33
- end_date: string
34
- is_archive: boolean
35
- teams: Api_Project_Team[]
36
- category: Api_Project_Category
37
- deleted_at: null
38
- repair: Api_Project_Repair | null
39
- total_tasks: number
40
- }
1
+ export type Api_Project_Repair = {
2
+ id: string
3
+ name: string
4
+ start_date: null | string
5
+ end_date: null | string
6
+ }
7
+
8
+ export type Api_Project_Team = {
9
+ id: string
10
+ name: string
11
+ display_name: string
12
+ description: string
13
+ created_at: string
14
+ updated_at: string
15
+ pivot: {
16
+ project_id: string
17
+ team_id: string
18
+ }
19
+ }
20
+
21
+ export type Api_Project_Category = {
22
+ code: number
23
+ display_name: string
24
+ name: string
25
+ }
26
+
27
+ export type Api_Project_Dto = {
28
+ id: string
29
+ name: string
30
+ description: null
31
+ image: null
32
+ start_date: string
33
+ end_date: string
34
+ is_archive: boolean
35
+ teams: Api_Project_Team[]
36
+ category: Api_Project_Category
37
+ deleted_at: null
38
+ repair: Api_Project_Repair | null
39
+ total_tasks: number
40
+ }
@@ -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
+ }