shared-ritm 1.2.79 → 1.2.81

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 (56) hide show
  1. package/README.md +103 -103
  2. package/dist/index.css +1 -1
  3. package/dist/shared-ritm.es.js +9409 -8849
  4. package/dist/shared-ritm.umd.js +520 -520
  5. package/dist/types/api/services/UserService.d.ts +10 -1
  6. package/dist/types/api/types/Api_Service.d.ts +1 -1
  7. package/dist/types/api/types/Api_User.d.ts +11 -0
  8. package/dist/types/common/app-table/controllers/useTableModel.d.ts +1 -1
  9. package/dist/types/index.d.ts +3 -2
  10. package/package.json +64 -64
  11. package/src/api/services/PhotoService.ts +137 -137
  12. package/src/api/services/RepairsService.ts +119 -119
  13. package/src/api/services/UserService.ts +32 -19
  14. package/src/api/types/Api_Controls.ts +72 -72
  15. package/src/api/types/Api_Files.ts +1 -1
  16. package/src/api/types/Api_Instruments.ts +98 -98
  17. package/src/api/types/Api_Projects.ts +55 -55
  18. package/src/api/types/Api_Repairs.ts +115 -115
  19. package/src/api/types/Api_Service.ts +1 -1
  20. package/src/api/types/Api_User.ts +57 -44
  21. package/src/common/app-checkbox/AppCheckbox.vue +26 -26
  22. package/src/common/app-datepicker/AppDatepicker.vue +165 -165
  23. package/src/common/app-dialogs/AppConfirmDialog.vue +99 -99
  24. package/src/common/app-dropdown/AppDropdown.vue +31 -31
  25. package/src/common/app-input/AppInput.vue +148 -148
  26. package/src/common/app-input-new/AppInputNew.vue +152 -152
  27. package/src/common/app-select/AppSelect.vue +157 -157
  28. package/src/common/app-sheet/AppSheet.vue +120 -120
  29. package/src/common/app-sheet-new/AppSheetNew.vue +255 -0
  30. package/src/common/app-sidebar/components/SidebarMenuItem.vue +148 -148
  31. package/src/common/app-table/AppTable.vue +301 -297
  32. package/src/common/app-table/AppTableLayout.vue +126 -111
  33. package/src/common/app-table/components/ModalSelect.vue +270 -270
  34. package/src/common/app-table/components/TableModal.vue +329 -329
  35. package/src/common/app-table/components/TablePagination.vue +152 -152
  36. package/src/common/app-table/components/TableSearch.vue +76 -76
  37. package/src/common/app-table/controllers/useBaseTable.ts +42 -42
  38. package/src/common/app-table/controllers/useColumnSelector.ts +38 -38
  39. package/src/common/app-table/controllers/useTableModel.ts +93 -93
  40. package/src/common/app-toggle/AppToggle.vue +24 -24
  41. package/src/common/app-wrapper/AppWrapper.vue +28 -28
  42. package/src/icons/components/table-filter-icon.vue +30 -30
  43. package/src/icons/dialogs/RemoveIcon.vue +12 -12
  44. package/src/icons/dialogs/SafetyIcon.vue +12 -12
  45. package/src/icons/task/attention-icon.vue +13 -13
  46. package/src/icons/task/clock-icon.vue +10 -10
  47. package/src/icons/task/delete-icon.vue +10 -10
  48. package/src/icons/task/fire-icon.vue +16 -16
  49. package/src/index.ts +3 -1
  50. package/src/main.ts +28 -28
  51. package/src/shared/styles/general.css +125 -125
  52. package/src/styles/variables.sass +12 -12
  53. package/src/utils/confirm.ts +12 -12
  54. package/src/utils/helpers.ts +58 -58
  55. package/src/utils/notification.ts +9 -9
  56. package/dist/types/api/types/Api_Users.d.ts +0 -43
@@ -1,119 +1,119 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
3
- import {
4
- Api_Create_Repair_With_Equipments,
5
- Api_Create_Repair_With_Template,
6
- Api_Equipment_Full_Dto,
7
- Api_Repair_Dto,
8
- Api_Repair_Template,
9
- Api_Update_Repair,
10
- OptionFilters,
11
- } from '@/api/types/Api_Repairs'
12
-
13
- class RepairsService extends ApiService {
14
- public fetchFilters(fullParams: string): Promise<OptionFilters> {
15
- return this.get(`get_list_repair?smart=1&${fullParams}`)
16
- }
17
-
18
- public fetchRepairs(
19
- isQuery: boolean,
20
- queries?: string,
21
- hasTeams?: boolean | string,
22
- teamsFilter?: string,
23
- typeFilter?: string,
24
- ): Promise<ResponseApi<Api_Repair_Dto[]>> {
25
- return this.get(
26
- 'get_list_repair' +
27
- (isQuery
28
- ? `${queries}&per_page=100000${typeFilter ? '&' + typeFilter : ''}&${!hasTeams ? teamsFilter : ''}`
29
- : `?per_page=100000${typeFilter ? '&' + typeFilter : ''}&${teamsFilter}`),
30
- )
31
- }
32
-
33
- public fetchRepairTemplates({
34
- equipmentId,
35
- categoryCode,
36
- }: {
37
- equipmentId?: string
38
- categoryCode?: string
39
- }): Promise<ResponseApi<Api_Repair_Template[]>> {
40
- return this.get(
41
- `repairs/get_repair_template_list?per_page=100000&categoryCodeList[0]=${categoryCode}&equipmentIdList[0]=${equipmentId}`,
42
- )
43
- }
44
-
45
- public fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
46
- return this.get('repairs/equipment/list?per_page=100000')
47
- }
48
-
49
- public createRepair(payload: Api_Create_Repair_With_Equipments) {
50
- return this.post<Api_Create_Repair_With_Equipments, any>('/repairs/equipments', payload)
51
- }
52
-
53
- public createRepairFromTemplate(payload: Api_Create_Repair_With_Template) {
54
- return this.post<Api_Create_Repair_With_Template, any>('/repairs/create_repair_from_repair_template', payload)
55
- }
56
-
57
- public startRepair(id: string): Promise<void> {
58
- return this.post<null, void>(`/repairs/${id}/start`, null)
59
- }
60
-
61
- public finishRepair(id: string) {
62
- return this.post<any, void>(`/repairs/complete_repair_list`, {
63
- repairIdList: [id],
64
- })
65
- }
66
-
67
- public finishPreparationProject(id: string) {
68
- return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
69
- }
70
-
71
- public moveRepairToCurrent(id: string) {
72
- return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
73
- repairs: [id],
74
- })
75
- }
76
-
77
- public moveArchiveToCurrent(id: string) {
78
- return this.post<any, void>(`/repairs/transfer_repair_archive_to_current`, {
79
- repairs_ids: [id],
80
- })
81
- }
82
-
83
- public moveRepairToApr(id: string) {
84
- return this.post<any, void>(`/repairs/transfer_repair_current_to_plan`, {
85
- repairs: [id],
86
- })
87
- }
88
-
89
- public moveRepairToArchive(id: string) {
90
- return this.post<any, void>(`/repairs/transfer_repair_current_to_archive`, {
91
- repairs_ids: [id],
92
- })
93
- }
94
-
95
- public restoreRepair(id: string) {
96
- return this.post<any, void>(`/restore_repair`, {
97
- repairs_ids: [id],
98
- })
99
- }
100
-
101
- public updateRepair(payload: Api_Update_Repair, id: string) {
102
- return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
103
- }
104
-
105
- public copyRepair(id: string) {
106
- return this.post<null, any>(`/repairs/${id}/clone`, null)
107
- }
108
-
109
- public deleteRepair(id: string) {
110
- return this.delete<any>(`/repairs/${id}`)
111
- }
112
- }
113
-
114
- let api: RepairsService
115
-
116
- export default function useRepairsService() {
117
- if (!api) api = new RepairsService()
118
- return api
119
- }
1
+ import ApiService from '@/api/settings/ApiService'
2
+ import { ResponseApi } from '@/api/types/Api_Service'
3
+ import {
4
+ Api_Create_Repair_With_Equipments,
5
+ Api_Create_Repair_With_Template,
6
+ Api_Equipment_Full_Dto,
7
+ Api_Repair_Dto,
8
+ Api_Repair_Template,
9
+ Api_Update_Repair,
10
+ OptionFilters,
11
+ } from '@/api/types/Api_Repairs'
12
+
13
+ class RepairsService extends ApiService {
14
+ public fetchFilters(fullParams: string): Promise<OptionFilters> {
15
+ return this.get(`get_list_repair?smart=1&${fullParams}`)
16
+ }
17
+
18
+ public fetchRepairs(
19
+ isQuery: boolean,
20
+ queries?: string,
21
+ hasTeams?: boolean | string,
22
+ teamsFilter?: string,
23
+ typeFilter?: string,
24
+ ): Promise<ResponseApi<Api_Repair_Dto[]>> {
25
+ return this.get(
26
+ 'get_list_repair' +
27
+ (isQuery
28
+ ? `${queries}&per_page=100000${typeFilter ? '&' + typeFilter : ''}&${!hasTeams ? teamsFilter : ''}`
29
+ : `?per_page=100000${typeFilter ? '&' + typeFilter : ''}&${teamsFilter}`),
30
+ )
31
+ }
32
+
33
+ public fetchRepairTemplates({
34
+ equipmentId,
35
+ categoryCode,
36
+ }: {
37
+ equipmentId?: string
38
+ categoryCode?: string
39
+ }): Promise<ResponseApi<Api_Repair_Template[]>> {
40
+ return this.get(
41
+ `repairs/get_repair_template_list?per_page=100000&categoryCodeList[0]=${categoryCode}&equipmentIdList[0]=${equipmentId}`,
42
+ )
43
+ }
44
+
45
+ public fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
46
+ return this.get('repairs/equipment/list?per_page=100000')
47
+ }
48
+
49
+ public createRepair(payload: Api_Create_Repair_With_Equipments) {
50
+ return this.post<Api_Create_Repair_With_Equipments, any>('/repairs/equipments', payload)
51
+ }
52
+
53
+ public createRepairFromTemplate(payload: Api_Create_Repair_With_Template) {
54
+ return this.post<Api_Create_Repair_With_Template, any>('/repairs/create_repair_from_repair_template', payload)
55
+ }
56
+
57
+ public startRepair(id: string): Promise<void> {
58
+ return this.post<null, void>(`/repairs/${id}/start`, null)
59
+ }
60
+
61
+ public finishRepair(id: string) {
62
+ return this.post<any, void>(`/repairs/complete_repair_list`, {
63
+ repairIdList: [id],
64
+ })
65
+ }
66
+
67
+ public finishPreparationProject(id: string) {
68
+ return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
69
+ }
70
+
71
+ public moveRepairToCurrent(id: string) {
72
+ return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
73
+ repairs: [id],
74
+ })
75
+ }
76
+
77
+ public moveArchiveToCurrent(id: string) {
78
+ return this.post<any, void>(`/repairs/transfer_repair_archive_to_current`, {
79
+ repairs_ids: [id],
80
+ })
81
+ }
82
+
83
+ public moveRepairToApr(id: string) {
84
+ return this.post<any, void>(`/repairs/transfer_repair_current_to_plan`, {
85
+ repairs: [id],
86
+ })
87
+ }
88
+
89
+ public moveRepairToArchive(id: string) {
90
+ return this.post<any, void>(`/repairs/transfer_repair_current_to_archive`, {
91
+ repairs_ids: [id],
92
+ })
93
+ }
94
+
95
+ public restoreRepair(id: string) {
96
+ return this.post<any, void>(`/restore_repair`, {
97
+ repairs_ids: [id],
98
+ })
99
+ }
100
+
101
+ public updateRepair(payload: Api_Update_Repair, id: string) {
102
+ return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
103
+ }
104
+
105
+ public copyRepair(id: string) {
106
+ return this.post<null, any>(`/repairs/${id}/clone`, null)
107
+ }
108
+
109
+ public deleteRepair(id: string) {
110
+ return this.delete<any>(`/repairs/${id}`)
111
+ }
112
+ }
113
+
114
+ let api: RepairsService
115
+
116
+ export default function useRepairsService() {
117
+ if (!api) api = new RepairsService()
118
+ return api
119
+ }
@@ -1,19 +1,32 @@
1
- import ApiService from '@/api/settings/ApiService'
2
- import { Api_User } from '@/api/types/Api_User'
3
-
4
- class UserService extends ApiService {
5
- public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
6
- return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
7
- }
8
-
9
- public async getUser(id: string): Promise<Api_User> {
10
- return await this.get<Api_User>(`/admin/users/${id}`)
11
- }
12
- }
13
-
14
- let api: UserService
15
-
16
- export default function useUserService() {
17
- if (!api) api = new UserService()
18
- return api
19
- }
1
+ import ApiService from '@/api/settings/ApiService'
2
+ import { Api_User, Api_User_Role } from '@/api/types/Api_User'
3
+ import { ResponseApi } from '@/api/types/Api_Service'
4
+
5
+ class UserService extends ApiService {
6
+ public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
7
+ return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
8
+ }
9
+
10
+ public async getUser(id: string): Promise<Api_User> {
11
+ return await this.get<Api_User>(`/admin/users/${id}`)
12
+ }
13
+
14
+ public async createUser(model: Partial<Api_User>): Promise<Api_User> {
15
+ return await this.post<Partial<Api_User>, Api_User>('/admin/users', model)
16
+ }
17
+
18
+ public async deleteUser(id: string): Promise<{ data: boolean; status: number }> {
19
+ return await this.delete(`/admin/users/${id}`)
20
+ }
21
+
22
+ public getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
23
+ return this.get('/search/roles', { params })
24
+ }
25
+ }
26
+
27
+ let api: UserService
28
+
29
+ export default function useUserService() {
30
+ if (!api) api = new UserService()
31
+ return api
32
+ }
@@ -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
+ }
@@ -1 +1 @@
1
- export type Api_Files_Responsible_Dto = unknown
1
+ export type Api_Files_Responsible_Dto = unknown
@@ -1,98 +1,98 @@
1
- import { Api_User } from '@/api/types/Api_User'
2
-
3
- export type Api_Instrument_Storage = {
4
- id: string
5
- created_at: string
6
- deleted_at: string | null
7
- updated_at: string
8
- description: string
9
- name: string
10
- title: string
11
- parent: unknown | null
12
- parents: unknown[]
13
- state_id: unknown | null
14
- }
15
-
16
- export type Api_Instrument_Type = {
17
- id: string
18
- name: string
19
- created_at: string
20
- updated_at: string
21
- deleted_at: string | null
22
- icon: string
23
- storage_id: string
24
- storage: Api_Instrument_Storage
25
- }
26
-
27
- export type Api_Instrument_Location = {
28
- id: string
29
- name: string
30
- title: string
31
- description: string
32
- created_at: string
33
- updated_at: string
34
- deleted_at: string | null
35
- state_id: unknown | null
36
- }
37
-
38
- export type Api_Instrument_Status = {
39
- id: string
40
- description: string
41
- name: string
42
- title: string
43
- created_at: string
44
- updated_at: string
45
- deleted_at: string | null
46
- }
47
-
48
- export type Api_Instrument = {
49
- id: string
50
- RFID: string | null
51
- instrument_id: string
52
- arrival_at: string
53
- created_at: string
54
- supply_at: string
55
- updated_at: string
56
- deleted_at: string | null
57
- inventory_number: string
58
- instrument_type: Api_Instrument_Type
59
- invoice_ref_key: string
60
- last_status_updated_at: string
61
- location_id: string
62
- location: Api_Instrument_Location
63
- misplacement: boolean
64
- module: string | null
65
- module_id: string | null
66
- name: string
67
- pressure: unknown | null
68
- registry_module_id: string
69
- responsible_id: string
70
- responsible: Api_User
71
- status: Api_Instrument_Status
72
- status_id: string
73
- storage: Api_Instrument_Storage
74
- supervisor: unknown | null
75
- supervisor_id: string
76
- type: unknown | null
77
- weight: unknown | null
78
- }
79
-
80
- export type Api_instruments_HistoryResponse = {
81
- data: Api_Instrument[]
82
- from: number
83
- to: number
84
- total: number
85
- per_page: number
86
- current_page: number
87
- last_page: number
88
- last_page_url: string
89
- first_page_url: string
90
- next_page_url: string | null
91
- prev_page_url: string | null
92
- path: string
93
- links: {
94
- label: string
95
- url: string
96
- active: boolean
97
- }[]
98
- }
1
+ import { Api_User } from '@/api/types/Api_User'
2
+
3
+ export type Api_Instrument_Storage = {
4
+ id: string
5
+ created_at: string
6
+ deleted_at: string | null
7
+ updated_at: string
8
+ description: string
9
+ name: string
10
+ title: string
11
+ parent: unknown | null
12
+ parents: unknown[]
13
+ state_id: unknown | null
14
+ }
15
+
16
+ export type Api_Instrument_Type = {
17
+ id: string
18
+ name: string
19
+ created_at: string
20
+ updated_at: string
21
+ deleted_at: string | null
22
+ icon: string
23
+ storage_id: string
24
+ storage: Api_Instrument_Storage
25
+ }
26
+
27
+ export type Api_Instrument_Location = {
28
+ id: string
29
+ name: string
30
+ title: string
31
+ description: string
32
+ created_at: string
33
+ updated_at: string
34
+ deleted_at: string | null
35
+ state_id: unknown | null
36
+ }
37
+
38
+ export type Api_Instrument_Status = {
39
+ id: string
40
+ description: string
41
+ name: string
42
+ title: string
43
+ created_at: string
44
+ updated_at: string
45
+ deleted_at: string | null
46
+ }
47
+
48
+ export type Api_Instrument = {
49
+ id: string
50
+ RFID: string | null
51
+ instrument_id: string
52
+ arrival_at: string
53
+ created_at: string
54
+ supply_at: string
55
+ updated_at: string
56
+ deleted_at: string | null
57
+ inventory_number: string
58
+ instrument_type: Api_Instrument_Type
59
+ invoice_ref_key: string
60
+ last_status_updated_at: string
61
+ location_id: string
62
+ location: Api_Instrument_Location
63
+ misplacement: boolean
64
+ module: string | null
65
+ module_id: string | null
66
+ name: string
67
+ pressure: unknown | null
68
+ registry_module_id: string
69
+ responsible_id: string
70
+ responsible: Api_User
71
+ status: Api_Instrument_Status
72
+ status_id: string
73
+ storage: Api_Instrument_Storage
74
+ supervisor: unknown | null
75
+ supervisor_id: string
76
+ type: unknown | null
77
+ weight: unknown | null
78
+ }
79
+
80
+ export type Api_instruments_HistoryResponse = {
81
+ data: Api_Instrument[]
82
+ from: number
83
+ to: number
84
+ total: number
85
+ per_page: number
86
+ current_page: number
87
+ last_page: number
88
+ last_page_url: string
89
+ first_page_url: string
90
+ next_page_url: string | null
91
+ prev_page_url: string | null
92
+ path: string
93
+ links: {
94
+ label: string
95
+ url: string
96
+ active: boolean
97
+ }[]
98
+ }