@7365admin1/layer-common 1.9.0 → 1.10.1

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 (93) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/components/AcceptDialog.vue +44 -0
  3. package/components/AccessCardAddForm.vue +101 -13
  4. package/components/AccessManagement.vue +130 -47
  5. package/components/AddSupplyForm.vue +165 -0
  6. package/components/AreaChecklistHistoryLogs.vue +235 -0
  7. package/components/AreaChecklistHistoryMain.vue +176 -0
  8. package/components/AreaFormDialog.vue +266 -0
  9. package/components/AreaMain.vue +841 -0
  10. package/components/AttendanceCheckInOutDialog.vue +416 -0
  11. package/components/AttendanceDetailsDialog.vue +184 -0
  12. package/components/AttendanceMain.vue +155 -0
  13. package/components/AttendanceMapSearchDialog.vue +393 -0
  14. package/components/AttendanceSettingsDialog.vue +398 -0
  15. package/components/BuildingManagement/buildings.vue +5 -5
  16. package/components/BuildingManagement/units.vue +5 -5
  17. package/components/ChecklistItemRow.vue +54 -0
  18. package/components/CheckoutItemMain.vue +705 -0
  19. package/components/CleaningScheduleMain.vue +271 -0
  20. package/components/DocumentManagement.vue +8 -9
  21. package/components/EntryPass/QrTemplatePreview.vue +104 -0
  22. package/components/EntryPassMain.vue +252 -200
  23. package/components/HygieneUpdateMoreAction.vue +238 -0
  24. package/components/IncidentReport/Authorities.vue +226 -0
  25. package/components/IncidentReport/IncidentInformation.vue +258 -0
  26. package/components/IncidentReport/affectedEntities.vue +167 -0
  27. package/components/InvitationMain.vue +19 -17
  28. package/components/ManageChecklistMain.vue +384 -0
  29. package/components/MemberMain.vue +48 -20
  30. package/components/MyAttendanceMain.vue +224 -0
  31. package/components/OnlineFormsConfiguration.vue +9 -2
  32. package/components/PasswordConfirmation.vue +95 -0
  33. package/components/PhotoUpload.vue +410 -0
  34. package/components/RolePermissionMain.vue +17 -15
  35. package/components/ScheduleAreaMain.vue +313 -0
  36. package/components/ScheduleTaskAreaFormDialog.vue +144 -0
  37. package/components/ScheduleTaskAreaUpdateMoreAction.vue +109 -0
  38. package/components/ScheduleTaskForm.vue +471 -0
  39. package/components/ScheduleTaskMain.vue +345 -0
  40. package/components/ScheduleTastTicketMain.vue +182 -0
  41. package/components/ServiceProviderMain.vue +27 -7
  42. package/components/StockCard.vue +191 -0
  43. package/components/SupplyManagementMain.vue +557 -0
  44. package/components/TableHygiene.vue +617 -0
  45. package/components/UnitMain.vue +451 -0
  46. package/components/VisitorManagement.vue +28 -15
  47. package/composables/useAccessManagement.ts +90 -0
  48. package/composables/useAreaPermission.ts +51 -0
  49. package/composables/useAreas.ts +99 -0
  50. package/composables/useAttendance.ts +89 -0
  51. package/composables/useAttendancePermission.ts +68 -0
  52. package/composables/useBuilding.ts +2 -2
  53. package/composables/useBuildingUnit.ts +2 -2
  54. package/composables/useCard.ts +2 -0
  55. package/composables/useCheckout.ts +61 -0
  56. package/composables/useCheckoutPermission.ts +80 -0
  57. package/composables/useCleaningPermission.ts +229 -0
  58. package/composables/useCleaningSchedulePermission.ts +58 -0
  59. package/composables/useCleaningSchedules.ts +233 -0
  60. package/composables/useCountry.ts +8 -0
  61. package/composables/useDOBEntries.ts +13 -0
  62. package/composables/useDashboardData.ts +2 -2
  63. package/composables/useDocument.ts +3 -2
  64. package/composables/useFeedback.ts +1 -1
  65. package/composables/useFile.ts +4 -6
  66. package/composables/useLocation.ts +78 -0
  67. package/composables/useOnlineForm.ts +16 -9
  68. package/composables/usePeople.ts +87 -72
  69. package/composables/useQR.ts +29 -0
  70. package/composables/useRole.ts +3 -2
  71. package/composables/useScheduleTask.ts +89 -0
  72. package/composables/useScheduleTaskArea.ts +85 -0
  73. package/composables/useScheduleTaskPermission.ts +68 -0
  74. package/composables/useSiteEntryPassSettings.ts +4 -15
  75. package/composables/useStock.ts +45 -0
  76. package/composables/useSupply.ts +63 -0
  77. package/composables/useSupplyPermission.ts +92 -0
  78. package/composables/useUnitPermission.ts +51 -0
  79. package/composables/useUnits.ts +82 -0
  80. package/composables/useWebUsb.ts +389 -0
  81. package/composables/useWorkOrder.ts +1 -1
  82. package/nuxt.config.ts +3 -0
  83. package/package.json +4 -1
  84. package/types/area.d.ts +22 -0
  85. package/types/attendance.d.ts +38 -0
  86. package/types/checkout-item.d.ts +27 -0
  87. package/types/cleaner-schedule.d.ts +54 -0
  88. package/types/location.d.ts +42 -0
  89. package/types/schedule-task.d.ts +18 -0
  90. package/types/stock.d.ts +16 -0
  91. package/types/supply.d.ts +11 -0
  92. package/types/verification.d.ts +1 -1
  93. package/utils/acm-crypto.ts +30 -0
@@ -0,0 +1,258 @@
1
+ <template>
2
+ <v-row no-gutters class="px-5 pt-4">
3
+ <!-- Site Information -->
4
+ <v-col cols="12" class="border-b pb-3 mb-5">
5
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
6
+ Site Information
7
+ </p>
8
+ <v-row no-gutters class="mt-5">
9
+ <v-col cols="12" sm="6" md="3">
10
+ <InputLabel class="text-capitalize" title="Site" />
11
+ <p class="my-1 text-h6">{{ siteName || "NA" }}</p>
12
+ </v-col>
13
+ <v-col cols="12" sm="6" md="3">
14
+ <InputLabel
15
+ class="text-capitalize"
16
+ title="Incident Reference Number"
17
+ />
18
+ <p class="my-1 text-h6">
19
+ {{ incidentInformation?.siteInfo?.irNumber || "NA" }}
20
+ </p>
21
+ </v-col>
22
+ <v-col cols="12" sm="6" md="3">
23
+ <InputLabel class="text-capitalize" title="Submitted By" />
24
+ <p class="my-1 text-h6 text-capitalize">
25
+ {{ incidentInformation?.siteInfo?.submittedBy || "NA" }}
26
+ </p>
27
+ </v-col>
28
+ <v-col cols="12" sm="6" md="3">
29
+ <InputLabel class="text-capitalize" title="Designation" />
30
+ <p class="my-1 text-h6 text-capitalize">
31
+ {{ incidentInformation?.siteInfo?.designation || "NA" }}
32
+ </p>
33
+ </v-col>
34
+ </v-row>
35
+ </v-col>
36
+
37
+ <!-- Place of Incident -->
38
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
39
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
40
+ Place of Incident
41
+ </p>
42
+ <p class="my-1 text-h6 text-capitalize">
43
+ {{ incidentInformation?.placeOfIncident?.incidentLocation || "NA" }}
44
+ </p>
45
+ </v-col>
46
+
47
+ <!-- Incident Type / Time -->
48
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
49
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
50
+ Incident Type / Time
51
+ </p>
52
+ <v-row no-gutters class="mt-5">
53
+ <v-col cols="12" sm="3" md="3">
54
+ <InputLabel class="text-capitalize" title="Type of Incident" />
55
+ <p class="my-1 text-h6 text-capitalize">
56
+ {{
57
+ incidentInformation?.incidentTypeAndTime?.typeOfIncident || "NA"
58
+ }}
59
+ </p>
60
+ </v-col>
61
+ <v-col cols="12" sm="3" md="3">
62
+ <InputLabel class="text-capitalize" title="Incident Date" />
63
+ <p class="my-1 text-h6">
64
+ {{
65
+ toLocalDate(
66
+ incidentInformation?.incidentTypeAndTime?.dateOfIncident,
67
+ ) || "NA"
68
+ }}
69
+ </p>
70
+ </v-col>
71
+ <v-col cols="12" sm="3" md="3">
72
+ <InputLabel class="text-capitalize" title="Incident Start" />
73
+ <p class="my-1 text-h6">
74
+ {{
75
+ incidentInformation?.incidentTypeAndTime?.incidentStart || "NA"
76
+ }}
77
+ </p>
78
+ </v-col>
79
+ <v-col cols="12" sm="3" md="3">
80
+ <v-row no-gutters class="d-flex align-center">
81
+ <v-col cols="10">
82
+ <InputLabel class="text-capitalize" title="Incident End" />
83
+ <p class="my-1 text-h6">
84
+ {{
85
+ incidentInformation?.incidentTypeAndTime?.incidentEnd || "NA"
86
+ }}
87
+ </p>
88
+ </v-col>
89
+ </v-row>
90
+ </v-col>
91
+ </v-row>
92
+ </v-col>
93
+
94
+ <!-- Response/Submission From (1st Contact) -->
95
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
96
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
97
+ Response/Submission From (1st Contact)
98
+ </p>
99
+ <v-row no-gutters class="mt-5">
100
+ <v-col cols="12" sm="4" md="3">
101
+ <InputLabel class="text-capitalize" title="Time" />
102
+ <p class="my-1 text-h6">
103
+ {{ incidentInformation?.submissionForm?.time || "NA" }}
104
+ </p>
105
+ </v-col>
106
+ <v-col cols="12" sm="4" md="3">
107
+ <InputLabel
108
+ class="text-capitalize"
109
+ title="Time of Report Submission"
110
+ />
111
+ <p class="my-1 text-h6">
112
+ {{ incidentInformation?.submissionForm?.timeOfResponse || "NA" }}
113
+ </p>
114
+ </v-col>
115
+ <v-col cols="12" sm="4" md="3">
116
+ <InputLabel class="text-capitalize" title="Date" />
117
+ <p class="my-1 text-h6">
118
+ {{
119
+ toLocalDate(incidentInformation?.submissionForm?.dateOfReport) ||
120
+ "NA"
121
+ }}
122
+ </p>
123
+ </v-col>
124
+ </v-row>
125
+ </v-col>
126
+
127
+ <!-- Name of Informant/Complainant Information -->
128
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
129
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
130
+ Name of Informant/Complainant Information
131
+ </p>
132
+ <v-row no-gutters class="d-flex align-center mt-5">
133
+ <v-col cols="12" sm="4" md="3">
134
+ <InputLabel class="text-capitalize" title="Name" />
135
+ <p class="my-1 text-h6 text-capitalize">
136
+ {{ incidentInformation?.complaintInfo?.complainant || "NA" }}
137
+ </p>
138
+ </v-col>
139
+ <v-col cols="12" sm="4" md="3">
140
+ <InputLabel class="text-capitalize" title="NRIC/WP Number" />
141
+ <p class="my-1 text-h6 text-capitalize">
142
+ {{ incidentInformation?.complaintInfo?.nric || "NA" }}
143
+ </p>
144
+ </v-col>
145
+ <v-col cols="12" sm="4" md="3">
146
+ <InputLabel class="text-capitalize" title="Contact Number" />
147
+ <p class="my-1 text-h6 text-capitalize">
148
+ {{ incidentInformation?.complaintInfo?.contact || "NA" }}
149
+ </p>
150
+ </v-col>
151
+ </v-row>
152
+ </v-col>
153
+
154
+ <!-- Name of Recipient of Complaint (1st Contact) -->
155
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
156
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
157
+ Name of Recipient of Complaint (1st Contact)
158
+ </p>
159
+ <v-row no-gutters class="d-flex align-center mt-5">
160
+ <v-col cols="12" sm="4" md="3">
161
+ <InputLabel class="text-capitalize" title="Name" />
162
+ <p class="my-1 text-h6 text-capitalize">
163
+ {{ incidentInformation?.recipientOfComplaint?.recipient || "NA" }}
164
+ </p>
165
+ </v-col>
166
+ <v-col cols="12" sm="4" md="3">
167
+ <InputLabel class="text-capitalize" title="NRIC/WP Number" />
168
+ <p class="my-1 text-h6 text-capitalize">
169
+ {{ incidentInformation?.recipientOfComplaint?.nric || "NA" }}
170
+ </p>
171
+ </v-col>
172
+ <v-col cols="12" sm="4" md="3">
173
+ <InputLabel class="text-capitalize" title="Contact Number" />
174
+ <p class="my-1 text-h6 text-capitalize">
175
+ {{ incidentInformation?.recipientOfComplaint?.contact || "NA" }}
176
+ </p>
177
+ </v-col>
178
+ </v-row>
179
+ </v-col>
180
+
181
+ <!-- Complaint Received through -->
182
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
183
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
184
+ Complaint Received through
185
+ </p>
186
+ <v-col cols="12">
187
+ <InputLabel class="text-capitalize" title="Received through" />
188
+ <p
189
+ v-if="
190
+ incidentInformation?.complaintReceivedTo?.receivedVia != 'others'
191
+ "
192
+ class="my-1 text-h6 text-capitalize"
193
+ >
194
+ {{ incidentInformation?.complaintReceivedTo?.receivedVia || "NA" }}
195
+ </p>
196
+
197
+ <p v-else class="my-1 text-h6">
198
+ {{
199
+ incidentInformation?.complaintReceivedTo?.otherDescription || "NA"
200
+ }}
201
+ </p>
202
+ </v-col>
203
+ </v-col>
204
+
205
+ <!-- Brief Description -->
206
+ <v-col cols="12" class="mb-10">
207
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
208
+ Brief Description
209
+ </p>
210
+ <p class="mt-5 text-h6 text-capitalize">
211
+ {{ incidentInformation?.complaintReceivedTo?.briefDescription || "NA" }}
212
+ </p>
213
+ </v-col>
214
+ </v-row>
215
+ </template>
216
+
217
+ <script lang="ts" setup>
218
+ definePageMeta({
219
+ middleware: ["01-auth", "02-org"],
220
+ memberOnly: true,
221
+ });
222
+
223
+ // props
224
+ const props = defineProps({
225
+ incidentInformation: {
226
+ type: Object as PropType<Record<string, any> | null>,
227
+ required: true,
228
+ },
229
+ });
230
+
231
+ // utilities
232
+ const { getSiteById } = useSiteSettings();
233
+
234
+ // state
235
+ const siteName = ref("");
236
+
237
+ const siteId = computed(() => props.incidentInformation?.siteInfo?.site );
238
+
239
+ watch(
240
+ siteId,
241
+ async (newSiteId) => {
242
+ if (!newSiteId) return;
243
+
244
+ const siteDataValue = await getSiteById(newSiteId);
245
+
246
+ siteName.value = siteDataValue?.name ?? "";
247
+ },
248
+ { immediate: true }
249
+ );
250
+
251
+ function toLocalDate(utcString: string) {
252
+ return new Date(utcString).toLocaleString("en-US", {
253
+ year: "numeric",
254
+ month: "2-digit",
255
+ day: "2-digit",
256
+ });
257
+ }
258
+ </script>
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <v-row no-gutters class="px-5 pt-4">
3
+ <!-- Any unit affected -->
4
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
5
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
6
+ Any unit affected?
7
+ </p>
8
+ <p
9
+ v-if="affectedEntities?.anyUnitAffectedValue == 'no'"
10
+ class="mt-2 text-h6 text-capitalize"
11
+ >
12
+ {{ affectedEntities?.anyUnitAffectedValue }}
13
+ </p>
14
+ <!-- Block Level Unit Section -->
15
+ <v-row v-else no-gutters class="d-flex align-center mt-5">
16
+ <v-row
17
+ v-if="affectedEntities?.affectedUnit.hasOwnProperty('block')"
18
+ no-gutters
19
+ >
20
+ <v-col cols="12" sm="4">
21
+ <InputLabel class="text-capitalize" title="Block" />
22
+ <p class="my-1 text-h6">
23
+ {{ affectedEntities?.affectedUnit?.block }}
24
+ </p>
25
+ </v-col>
26
+ <v-col cols="12" sm="4">
27
+ <InputLabel class="text-capitalize" title="Level" />
28
+ <p class="my-1 text-h6">
29
+ {{ affectedEntities?.affectedUnit?.level }}
30
+ </p>
31
+ </v-col>
32
+ <v-col cols="12" sm="4">
33
+ <InputLabel class="text-capitalize" title="Unit" />
34
+ <p class="my-1 text-h6">
35
+ {{ affectedEntities?.affectedUnit?.unit }}
36
+ </p>
37
+ </v-col>
38
+ </v-row>
39
+
40
+ <v-col v-else cols="12" class="px-1 mb-0">
41
+ <InputLabel class="text-capitalize" title="Location" />
42
+ <p class="my-1 text-h6 text-capitalize">
43
+ {{ affectedEntities?.affectedUnit?.other }}
44
+ </p>
45
+ </v-col>
46
+
47
+ <v-col cols="12" class="px-1 mb-0 mt-5">
48
+ <InputLabel class="text-capitalize" title="Remarks" />
49
+ <p class="my-1 text-h6 text-capitalize">
50
+ {{ affectedEntities?.affectedUnit?.remarks }}
51
+ </p>
52
+ </v-col>
53
+ </v-row>
54
+ </v-col>
55
+
56
+ <!-- Anyone affected/injured -->
57
+ <v-col cols="12" class="border-b pb-5 mb-5 mt-1">
58
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
59
+ Anyone affected/injured?
60
+ </p>
61
+ <p
62
+ v-if="affectedEntities?.anyoneAffectedValue == 'no'"
63
+ class="my-1 text-h6 text-capitalize"
64
+ >
65
+ {{ affectedEntities?.anyoneAffectedValue }}
66
+ </p>
67
+
68
+ <v-data-table
69
+ v-else
70
+ :headers="injuredTableHeader"
71
+ :items="affectedEntities?.affectedInjured"
72
+ fixed-header
73
+ hide-default-footer
74
+ :hide-default-header="false"
75
+ items-per-page="100"
76
+ style="max-height: calc(100vh - (200px))"
77
+ class="border mt-5"
78
+ >
79
+ </v-data-table>
80
+ </v-col>
81
+
82
+ <!-- Anyone damage to property -->
83
+ <v-col cols="12" class="pb-5 mb-5 mt-1">
84
+ <p class="mb-2" style="font-size: 17px; font-weight: 600">
85
+ Anyone damage to property?
86
+ </p>
87
+ <p
88
+ v-if="affectedEntities?.anyUnitAffectedValue == 'no'"
89
+ class="my-1 text-h6 text-capitalize"
90
+ >
91
+ {{ affectedEntities?.anyUnitAffectedValue }}
92
+ </p>
93
+
94
+ <v-data-table
95
+ v-else
96
+ :headers="damagePropertyTableHeader"
97
+ :items="affectedEntities?.anyoneDamageToProperty"
98
+ fixed-header
99
+ hide-default-footer
100
+ :hide-default-header="false"
101
+ items-per-page="100"
102
+ style="max-height: calc(100vh - (200px))"
103
+ class="border mt-5"
104
+ >
105
+ </v-data-table>
106
+ </v-col>
107
+ </v-row>
108
+ </template>
109
+
110
+ <script lang="ts" setup>
111
+ definePageMeta({
112
+ middleware: ["01-auth", "02-org"],
113
+ memberOnly: true,
114
+ });
115
+
116
+ // imports
117
+
118
+ // utilities
119
+
120
+ // props
121
+ const props = defineProps({
122
+ affectedEntities: {
123
+ type: Object as PropType<Record<string, any> | null>,
124
+ required: true,
125
+ },
126
+ });
127
+
128
+ // emits
129
+
130
+ // state
131
+ const injuredTableHeader = [
132
+ {
133
+ title: "Name",
134
+ value: "name",
135
+ },
136
+ {
137
+ title: "NRIC/WP No.",
138
+ value: "nric",
139
+ },
140
+ {
141
+ title: "Contact Number",
142
+ value: "contact",
143
+ },
144
+ ];
145
+ const damagePropertyTableHeader = [
146
+ {
147
+ title: "Description",
148
+ value: "description",
149
+ },
150
+ {
151
+ title: "Block / Level / Unit",
152
+ value: "blkLevelUnit",
153
+ },
154
+ {
155
+ title: "Name",
156
+ value: "name",
157
+ },
158
+ {
159
+ title: "Contact Number",
160
+ value: "contact",
161
+ },
162
+ {
163
+ title: "Action",
164
+ value: "action",
165
+ },
166
+ ];
167
+ </script>
@@ -93,7 +93,7 @@
93
93
  <v-icon v-bind="props">mdi-dots-horizontal</v-icon>
94
94
  </template>
95
95
  <v-list>
96
- <v-list-item @click="openConfirmDialog(item._id ?? '')">
96
+ <v-list-item @click="openConfirmDialog(item._id ?? '')" v-if="item.status === 'pending'">
97
97
  Cancel Invite
98
98
  </v-list-item>
99
99
  </v-list>
@@ -118,21 +118,23 @@
118
118
  </p>
119
119
  </template>
120
120
  <template #footer>
121
- <v-btn
122
- variant="text"
123
- @click="confirmDialog = false"
124
- :disabled="cancelLoading"
125
- >
126
- Close
127
- </v-btn>
128
- <v-btn
129
- color="primary"
130
- variant="flat"
131
- @click="onConfirmCancel"
132
- :loading="cancelLoading"
133
- >
134
- Cancel Invite
135
- </v-btn>
121
+ <div class="d-flex justify-center ga-3 w-100">
122
+ <v-btn
123
+ variant="text"
124
+ @click="confirmDialog = false"
125
+ :disabled="cancelLoading"
126
+ >
127
+ Close
128
+ </v-btn>
129
+ <v-btn
130
+ color="primary"
131
+ variant="flat"
132
+ @click="onConfirmCancel"
133
+ :loading="cancelLoading"
134
+ >
135
+ Cancel Invite
136
+ </v-btn>
137
+ </div>
136
138
  </template>
137
139
  </ConfirmDialog>
138
140
  <Snackbar v-model="messageSnackbar" :text="message" :color="messageColor" />
@@ -245,7 +247,7 @@ const {
245
247
  status: props.status,
246
248
  search: headerSearch.value,
247
249
  type: "user-invite,member-invite",
248
- app: props.app
250
+ app: props.app,
249
251
  })
250
252
  );
251
253