@7365admin1/layer-common 4.82.1-staging.476 → 4.84.0
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.
- package/CHANGELOG.md +16 -4
- package/assets/css/primitives.css +0 -57
- package/assets/css/screens.css +4 -8
- package/components/AccessCardDetailsDialog.vue +4 -57
- package/components/AccessCardPreviewDialog.vue +50 -291
- package/components/AppSelect.vue +4 -143
- package/components/AttendanceDetailsDialog.vue +1 -48
- package/components/AttendanceMain.vue +10 -104
- package/components/AttendanceSettingsDialog.vue +1 -53
- package/components/BuildingUnitFormEdit.vue +0 -6
- package/components/BulletinBoardView.vue +1 -1
- package/components/Dialog/UpdateMoreAction.vue +1 -11
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidAccessLogDashboard.vue +17 -74
- package/components/HidIntercomManagement.vue +14 -183
- package/components/HidQrCodeConfiguration.vue +195 -17
- package/components/HidReaderManagement.vue +0 -398
- package/components/HidReaderUserRoster.vue +3 -44
- package/components/HidUserEnrollment.vue +250 -1573
- package/components/InventoryMain.vue +2 -11
- package/components/InvitationClientForm.vue +1 -19
- package/components/MyAttendanceMain.vue +2 -60
- package/components/NotificationBell.vue +2 -14
- package/components/TableMain.vue +7 -22
- package/components/VisitorForm.vue +0 -12
- package/components/VisitorManagement.vue +5 -267
- package/composables/useAttendance.ts +0 -53
- package/composables/useAttendancePermission.ts +0 -25
- package/composables/useCleaningPermission.ts +0 -5
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -165
- package/composables/useHidNavigation.ts +1 -25
- package/composables/useLandscapingPermission.ts +0 -5
- package/composables/useMember.ts +0 -12
- package/composables/usePeople.ts +0 -19
- package/composables/usePestControlPermission.ts +0 -5
- package/composables/usePoolMaintenancePermission.ts +0 -5
- package/composables/useSecurityPermission.ts +0 -5
- package/composables/useServiceProvider.ts +2 -40
- package/constants/permissions.ts +0 -1
- package/nuxt.config.ts +0 -18
- package/package.json +2 -4
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
- package/types/attendance.d.ts +1 -13
- package/types/document.d.ts +0 -14
- package/types/facility.d.ts +0 -4
- package/types/member.d.ts +0 -4
- package/types/people.d.ts +1 -28
- package/types/service-provider.d.ts +0 -5
- package/utils/notification-target.ts +4 -43
- package/components/AttendanceProxyDialog.vue +0 -391
- package/components/BuildingUnitManagement.vue +0 -298
- package/components/HidAccessPermissions.vue +0 -424
- package/components/HidProfileQrCode.vue +0 -332
- package/composables/useHidReaderSelection.ts +0 -50
- package/composables/useSiteActions.ts +0 -29
- package/composables/useSiteCategory.ts +0 -45
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
- package/server/plugins/no-powered-by.ts +0 -7
- package/utils/attendance-proxy.ts +0 -110
- package/utils/hid-enrolment-subject.ts +0 -144
- package/utils/hid-permission-assignments.ts +0 -190
- package/utils/hid-reader-selection.ts +0 -52
- package/utils/occupancy-role.ts +0 -109
- package/utils/sanitize-html.ts +0 -16
- package/utils/security-headers.ts +0 -52
- package/utils/service-type.ts +0 -30
- package/utils/site-actions.ts +0 -18
|
@@ -149,9 +149,6 @@ const props = defineProps({
|
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
const movedFromEquipment = useRoute().query.moved === "equipment";
|
|
152
|
-
// A notification link (`?storeId=&tab=`, NotificationBell): open that store on that tab, once.
|
|
153
|
-
const linkQuery = useRoute().query;
|
|
154
|
-
const linked = { storeId: String(linkQuery.storeId ?? ""), tab: String(linkQuery.tab ?? "") };
|
|
155
152
|
|
|
156
153
|
const { getStores, createStore: apiCreateStore, getRequests, getReport } = useInventory();
|
|
157
154
|
const { getSites } = useSite();
|
|
@@ -230,10 +227,7 @@ async function loadStores() {
|
|
|
230
227
|
loadError.value = "";
|
|
231
228
|
try {
|
|
232
229
|
stores.value = (await getStores(props.siteId)) ?? [];
|
|
233
|
-
|
|
234
|
-
linked.storeId = "";
|
|
235
|
-
if (fromLink) storeId.value = fromLink._id;
|
|
236
|
-
else if (!stores.value.some((s) => s._id === storeId.value)) {
|
|
230
|
+
if (!stores.value.some((s) => s._id === storeId.value)) {
|
|
237
231
|
// A service provider working at a property store sees it first.
|
|
238
232
|
storeId.value = stores.value[0]?._id ?? "";
|
|
239
233
|
}
|
|
@@ -301,10 +295,7 @@ async function createStore() {
|
|
|
301
295
|
}
|
|
302
296
|
|
|
303
297
|
watch(storeId, () => {
|
|
304
|
-
|
|
305
|
-
const wanted = linked.tab;
|
|
306
|
-
linked.tab = "";
|
|
307
|
-
tab.value = wanted && tabs.value.some((t) => t.value === wanted) ? wanted : "stock";
|
|
298
|
+
tab.value = "stock";
|
|
308
299
|
refreshCounts();
|
|
309
300
|
probeCompanyUsage();
|
|
310
301
|
});
|
|
@@ -388,27 +388,9 @@ watch(
|
|
|
388
388
|
const roles = ref<any[]>([])
|
|
389
389
|
const { getRoles } = useRole()
|
|
390
390
|
|
|
391
|
-
/*
|
|
392
|
-
* `type` is the ROLE type, not the service the client subscribes to, and the
|
|
393
|
-
* only caller (`ClientMain.vue` "Invite Client") passes no `app` prop -- so
|
|
394
|
-
* this sent `type: ""` and the endpoint applied no type filter at all. The
|
|
395
|
-
* dropdown therefore listed every org-less role of every type, which includes
|
|
396
|
-
* the platform's OWN staff roles (`type: "admin"` -- the two rows the console's
|
|
397
|
-
* `/super-admin/role-permissions` screen edits). Offering a Seven365 console
|
|
398
|
-
* staff role on a CLIENT invitation is the defect.
|
|
399
|
-
*
|
|
400
|
-
* A client admin's role is `type: "organization"`, which is what the client
|
|
401
|
-
* roles screen (`org/[organization]/roles-permissions.vue`) already lists. This
|
|
402
|
-
* narrows to exactly that. It is a narrowing of this one picker only: no role
|
|
403
|
-
* changes, no permission changes, and the org-less `organization` roles that
|
|
404
|
-
* were already being picked are all still offered.
|
|
405
|
-
*
|
|
406
|
-
* Keying off the selected service instead would empty the dropdown -- no
|
|
407
|
-
* org-less role carries a service type -- so `props.app` is not the filter.
|
|
408
|
-
*/
|
|
409
391
|
const { data: roleData, refresh: refreshRoles } = await useLazyAsyncData(
|
|
410
392
|
"roles",
|
|
411
|
-
() => getRoles({ org: org.value?._id, type:
|
|
393
|
+
() => getRoles({ org: org.value?._id, type: props.app, limit: 50 }),
|
|
412
394
|
{ watch: [() => props.app] }
|
|
413
395
|
)
|
|
414
396
|
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-row no-gutters align="center" justify="center">
|
|
3
|
-
<!-- Site device mode is ON for this site: this shared phone can check other
|
|
4
|
-
people in and out (owner request 2026-10-01). -->
|
|
5
|
-
<v-col v-if="siteDeviceMode && canCheckInOut" cols="12" class="mb-4">
|
|
6
|
-
<v-alert
|
|
7
|
-
type="info"
|
|
8
|
-
variant="tonal"
|
|
9
|
-
icon="mdi-cellphone-check"
|
|
10
|
-
data-test="site-device-mode-banner"
|
|
11
|
-
>
|
|
12
|
-
<div class="font-weight-medium">Site device mode is on</div>
|
|
13
|
-
<div class="mb-3">
|
|
14
|
-
This phone can check staff in and out for them: take their photo, type their
|
|
15
|
-
name and NRIC. Only the last 4 characters of the NRIC are saved.
|
|
16
|
-
</div>
|
|
17
|
-
<v-btn
|
|
18
|
-
class="text-none screen-btn-primary"
|
|
19
|
-
size="large"
|
|
20
|
-
variant="flat"
|
|
21
|
-
prepend-icon="mdi-account-clock"
|
|
22
|
-
data-test="attendance-proxy-open-btn"
|
|
23
|
-
@click="dialogShowProxy = true"
|
|
24
|
-
>
|
|
25
|
-
Check in / Check out for someone
|
|
26
|
-
</v-btn>
|
|
27
|
-
</v-alert>
|
|
28
|
-
</v-col>
|
|
29
3
|
<v-col cols="12" lg="12">
|
|
30
4
|
<TableMain
|
|
31
5
|
title="Attendance Records"
|
|
@@ -97,14 +71,6 @@
|
|
|
97
71
|
@close="dialogShowMoreActions = false"
|
|
98
72
|
/>
|
|
99
73
|
|
|
100
|
-
<AttendanceProxyDialog
|
|
101
|
-
v-if="siteDeviceMode"
|
|
102
|
-
v-model="dialogShowProxy"
|
|
103
|
-
:site="props.site"
|
|
104
|
-
:service-type="props.serviceType"
|
|
105
|
-
@saved="onProxySaved"
|
|
106
|
-
/>
|
|
107
|
-
|
|
108
74
|
<Snackbar v-model="messageSnackbar" :text="message" :color="messageColor" />
|
|
109
75
|
</template>
|
|
110
76
|
|
|
@@ -141,31 +107,7 @@ const headers = [
|
|
|
141
107
|
{ title: "Total Hours", value: "totalHours" },
|
|
142
108
|
];
|
|
143
109
|
|
|
144
|
-
const { getMyAttendances, checkIn, checkOut
|
|
145
|
-
|
|
146
|
-
// Site device mode: read once per site. A failed read means OFF (today's flow).
|
|
147
|
-
const siteDeviceMode = ref(false);
|
|
148
|
-
const dialogShowProxy = ref(false);
|
|
149
|
-
watch(
|
|
150
|
-
() => [props.site, props.serviceType],
|
|
151
|
-
async () => {
|
|
152
|
-
siteDeviceMode.value = false;
|
|
153
|
-
if (!props.site) return;
|
|
154
|
-
try {
|
|
155
|
-
const res: any = await getAttendanceSettings(props.site, props.serviceType);
|
|
156
|
-
siteDeviceMode.value = res?.siteDeviceMode === true;
|
|
157
|
-
} catch {
|
|
158
|
-
siteDeviceMode.value = false;
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{ immediate: true }
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
function onProxySaved(text: string) {
|
|
165
|
-
message.value = text;
|
|
166
|
-
messageColor.value = "success";
|
|
167
|
-
messageSnackbar.value = true;
|
|
168
|
-
}
|
|
110
|
+
const { getMyAttendances, checkIn, checkOut } = useAttendance();
|
|
169
111
|
const { formatDate } = useUtils();
|
|
170
112
|
|
|
171
113
|
const dialogShowMoreActions = ref(false);
|
|
@@ -228,7 +170,7 @@ watchEffect(() => {
|
|
|
228
170
|
const today = new Date().toISOString().split("T")[0];
|
|
229
171
|
todayAttendance.value =
|
|
230
172
|
getMyAttendancesReq.value.items.find((item: any) => {
|
|
231
|
-
if (!item.checkInTimestamp
|
|
173
|
+
if (!item.checkInTimestamp) return false;
|
|
232
174
|
const itemDate = new Date(item.checkInTimestamp)
|
|
233
175
|
.toISOString()
|
|
234
176
|
.split("T")[0];
|
|
@@ -127,13 +127,6 @@
|
|
|
127
127
|
<v-btn variant="text" class="text-none" @click="viewFromToast">View</v-btn>
|
|
128
128
|
</template>
|
|
129
129
|
</v-snackbar>
|
|
130
|
-
|
|
131
|
-
<v-snackbar v-model="nowhere.show" location="top right" :timeout="6000" color="surface">
|
|
132
|
-
<div class="d-flex align-center ga-3">
|
|
133
|
-
<v-icon icon="mdi-information-outline" color="primary" />
|
|
134
|
-
<div class="text-body-2">{{ nowhere.text }}</div>
|
|
135
|
-
</div>
|
|
136
|
-
</v-snackbar>
|
|
137
130
|
</div>
|
|
138
131
|
</template>
|
|
139
132
|
|
|
@@ -144,7 +137,7 @@ import {
|
|
|
144
137
|
timeAgo,
|
|
145
138
|
type TInboxItem,
|
|
146
139
|
} from "../utils/notification-inbox";
|
|
147
|
-
import { appUrlsFrom, chooseNavigation,
|
|
140
|
+
import { appUrlsFrom, chooseNavigation, notificationTarget } from "../utils/notification-target";
|
|
148
141
|
|
|
149
142
|
/**
|
|
150
143
|
* The top-bar notification feed for the web, in every signed-in app.
|
|
@@ -187,8 +180,6 @@ const markingAll = ref(false);
|
|
|
187
180
|
const items = ref<Array<Record<string, any>>>([]);
|
|
188
181
|
const unread = ref(0);
|
|
189
182
|
const toast = reactive({ show: false, title: "", body: "" });
|
|
190
|
-
/** Said when a clicked row has no page to open - a click is never a silent nothing. */
|
|
191
|
-
const nowhere = reactive({ show: false, text: "" });
|
|
192
183
|
|
|
193
184
|
const userId = computed(() => String(currentUser.value?._id ?? ""));
|
|
194
185
|
const badgeLabel = computed(() => badgeText(unread.value));
|
|
@@ -350,10 +341,7 @@ async function goToSubject(item: Record<string, any>) {
|
|
|
350
341
|
hasPage: hasLocalPage,
|
|
351
342
|
appUrls: appUrls(),
|
|
352
343
|
});
|
|
353
|
-
if (!nav)
|
|
354
|
-
Object.assign(nowhere, { show: true, text: noTargetMessage(item as any) });
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
344
|
+
if (!nav) return;
|
|
357
345
|
|
|
358
346
|
open.value = false;
|
|
359
347
|
if (nav.type === "href") {
|
package/components/TableMain.vue
CHANGED
|
@@ -59,32 +59,17 @@
|
|
|
59
59
|
>
|
|
60
60
|
{{ createLabel }}
|
|
61
61
|
</v-btn>
|
|
62
|
-
|
|
63
|
-
The design's search field. This was a `v-text-field` with only a
|
|
64
|
-
`max-width`, so inside the actions row it shrank to its minimum
|
|
65
|
-
and showed "Se" and a magnifier, at a different height and
|
|
66
|
-
border from the button beside it. Same `search` model; clearing
|
|
67
|
-
now sets "" instead of Vuetify's null.
|
|
68
|
-
-->
|
|
69
|
-
<AppField
|
|
62
|
+
<v-text-field
|
|
70
63
|
v-if="canSearch"
|
|
71
64
|
v-model="searchInput"
|
|
72
|
-
|
|
65
|
+
density="compact"
|
|
73
66
|
placeholder="Search"
|
|
74
|
-
|
|
67
|
+
clearable
|
|
68
|
+
max-width="300"
|
|
69
|
+
append-inner-icon="mdi-magnify"
|
|
70
|
+
hide-details
|
|
75
71
|
class="table-card__search"
|
|
76
|
-
|
|
77
|
-
<template v-if="searchInput" #trailing>
|
|
78
|
-
<button
|
|
79
|
-
type="button"
|
|
80
|
-
class="app-field__trailing"
|
|
81
|
-
aria-label="Clear search"
|
|
82
|
-
@click="searchInput = ''"
|
|
83
|
-
>
|
|
84
|
-
<v-icon icon="mdi-close" size="16" />
|
|
85
|
-
</button>
|
|
86
|
-
</template>
|
|
87
|
-
</AppField>
|
|
72
|
+
/>
|
|
88
73
|
<!-- Ghost/secondary, as the design specifies for Scan QR Code. -->
|
|
89
74
|
<v-btn
|
|
90
75
|
v-if="canScanVisitorQRCode"
|
|
@@ -910,20 +910,8 @@ const hidQrReaderId = computed(() => (
|
|
|
910
910
|
hidQrConfiguredReaderId.value || String(hidQrReader.value?._id || "")
|
|
911
911
|
));
|
|
912
912
|
|
|
913
|
-
/*
|
|
914
|
-
* Visitor QR passes are hidden at the manager's request (2026-09-23).
|
|
915
|
-
*
|
|
916
|
-
* A flag rather than a deletion: issuing, the preview dialog, printing and the
|
|
917
|
-
* regenerate handler below are all intact and untouched, so bringing the
|
|
918
|
-
* feature back is this one line. Every surface that offers a Visitor QR reads
|
|
919
|
-
* `hidQrCodePassAllowed`, which is why the switch belongs here and not in each
|
|
920
|
-
* of them.
|
|
921
|
-
*/
|
|
922
|
-
const HID_VISITOR_QR_ENABLED = false;
|
|
923
|
-
|
|
924
913
|
const hidQrCodePassAllowed = computed(() => {
|
|
925
914
|
return (
|
|
926
|
-
HID_VISITOR_QR_ENABLED &&
|
|
927
915
|
hidQrCodePassEnabled.value &&
|
|
928
916
|
["guest", "contractor", "walk-in"].includes(prop.type)
|
|
929
917
|
);
|
|
@@ -749,35 +749,11 @@
|
|
|
749
749
|
class="visitor-preview__row"
|
|
750
750
|
>
|
|
751
751
|
<div class="visitor-preview__label">{{ label }}</div>
|
|
752
|
-
<div
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
draw it, is a 14px target - the floor is 24px. So the
|
|
758
|
-
NUMBER is the control and the eye is its affordance:
|
|
759
|
-
the whole masked value is pressable, which makes the
|
|
760
|
-
target the width of the digits rather than of a glyph,
|
|
761
|
-
and being a real `button` it also takes a tab stop,
|
|
762
|
-
which a `v-icon` with a click handler never did. -->
|
|
763
|
-
<button
|
|
764
|
-
type="button"
|
|
765
|
-
class="visitor-preview__reveal"
|
|
766
|
-
:aria-label="showVisitorNric ? 'Hide NRIC' : 'Show NRIC'"
|
|
767
|
-
:aria-pressed="showVisitorNric"
|
|
768
|
-
@click="showVisitorNric = !showVisitorNric"
|
|
769
|
-
>
|
|
770
|
-
<span class="visitor-preview__value">
|
|
771
|
-
{{
|
|
772
|
-
showVisitorNric
|
|
773
|
-
? selectedVisitorObject[key]
|
|
774
|
-
: maskNRIC(selectedVisitorObject[key])
|
|
775
|
-
}}
|
|
776
|
-
</span>
|
|
777
|
-
<v-icon size="16" class="visitor-preview__eye">
|
|
778
|
-
{{ showVisitorNric ? "mdi-eye-off-outline" : "mdi-eye-outline" }}
|
|
779
|
-
</v-icon>
|
|
780
|
-
</button>
|
|
752
|
+
<div
|
|
753
|
+
v-tooltip:top="selectedVisitorObject[key]"
|
|
754
|
+
class="visitor-preview__value"
|
|
755
|
+
>
|
|
756
|
+
{{ maskNRIC(selectedVisitorObject[key]) }}
|
|
781
757
|
</div>
|
|
782
758
|
</div>
|
|
783
759
|
|
|
@@ -827,84 +803,6 @@
|
|
|
827
803
|
</div>
|
|
828
804
|
</div>
|
|
829
805
|
|
|
830
|
-
<!--
|
|
831
|
-
THE CONTRACTOR'S PARTY.
|
|
832
|
-
|
|
833
|
-
The list row has always said `( +2 members)` beside the name
|
|
834
|
-
and then had nowhere to send you for the names themselves. The
|
|
835
|
-
block spans both columns rather than sitting in the 116px
|
|
836
|
-
value track: a member is a record, not a value, and several of
|
|
837
|
-
them in a 250px column is unreadable.
|
|
838
|
-
|
|
839
|
-
Read off `selectedVisitorDataObject` (the raw row) and not
|
|
840
|
-
`selectedVisitorObject`, which filters itself down to
|
|
841
|
-
`typeFieldMap` plus five fixed keys - `members` is on neither
|
|
842
|
-
list, and widening that computed would change what four other
|
|
843
|
-
dialogs on this screen see.
|
|
844
|
-
-->
|
|
845
|
-
<div
|
|
846
|
-
v-else-if="key === 'members' && selectedVisitorMembers.length"
|
|
847
|
-
class="visitor-preview__row visitor-preview__row--block"
|
|
848
|
-
>
|
|
849
|
-
<div class="visitor-preview__label">
|
|
850
|
-
{{ label }} ({{ selectedVisitorMembers.length }})
|
|
851
|
-
</div>
|
|
852
|
-
<div class="visitor-preview__members">
|
|
853
|
-
<div
|
|
854
|
-
v-for="(member, index) in selectedVisitorMembers"
|
|
855
|
-
:key="member?.nric || member?.name || index"
|
|
856
|
-
class="visitor-preview__member"
|
|
857
|
-
>
|
|
858
|
-
<div class="visitor-preview__value">
|
|
859
|
-
{{ member?.name || "N/A" }}
|
|
860
|
-
</div>
|
|
861
|
-
<template v-for="field in memberDetailFields" :key="field.key">
|
|
862
|
-
<div
|
|
863
|
-
v-if="member?.[field.key]"
|
|
864
|
-
class="visitor-preview__member-line"
|
|
865
|
-
>
|
|
866
|
-
<span class="visitor-preview__member-key">
|
|
867
|
-
{{ field.label }}
|
|
868
|
-
</span>
|
|
869
|
-
<!-- A member's NRIC is the same class of data as the
|
|
870
|
-
visitor's, so it gets the same control. Each
|
|
871
|
-
member reveals separately - one toggle for the
|
|
872
|
-
whole card would show three people's NRICs to
|
|
873
|
-
read one. -->
|
|
874
|
-
<button
|
|
875
|
-
v-if="field.key === 'nric'"
|
|
876
|
-
type="button"
|
|
877
|
-
class="visitor-preview__reveal"
|
|
878
|
-
:aria-label="
|
|
879
|
-
isMemberNricShown(index)
|
|
880
|
-
? `Hide NRIC for ${member?.name || 'this member'}`
|
|
881
|
-
: `Show NRIC for ${member?.name || 'this member'}`
|
|
882
|
-
"
|
|
883
|
-
:aria-pressed="isMemberNricShown(index)"
|
|
884
|
-
@click="toggleMemberNric(index)"
|
|
885
|
-
>
|
|
886
|
-
<span>
|
|
887
|
-
{{
|
|
888
|
-
isMemberNricShown(index)
|
|
889
|
-
? member.nric
|
|
890
|
-
: maskNRIC(member.nric)
|
|
891
|
-
}}
|
|
892
|
-
</span>
|
|
893
|
-
<v-icon size="16" class="visitor-preview__eye">
|
|
894
|
-
{{
|
|
895
|
-
isMemberNricShown(index)
|
|
896
|
-
? "mdi-eye-off-outline"
|
|
897
|
-
: "mdi-eye-outline"
|
|
898
|
-
}}
|
|
899
|
-
</v-icon>
|
|
900
|
-
</button>
|
|
901
|
-
<span v-else>{{ member[field.key] }}</span>
|
|
902
|
-
</div>
|
|
903
|
-
</template>
|
|
904
|
-
</div>
|
|
905
|
-
</div>
|
|
906
|
-
</div>
|
|
907
|
-
|
|
908
806
|
<!-- The vehicle number, with Block on its right: the Registered
|
|
909
807
|
tab only, for someone who may add vehicles. It opens the
|
|
910
808
|
Vehicle Mgmt Block Listed form with the category taken from
|
|
@@ -2225,71 +2123,6 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
2225
2123
|
() => selectedVisitorStatus.value === "pending"
|
|
2226
2124
|
);
|
|
2227
2125
|
|
|
2228
|
-
/**
|
|
2229
|
-
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2230
|
-
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2231
|
-
* party has one wherever the screen shows it.
|
|
2232
|
-
*
|
|
2233
|
-
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2234
|
-
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2235
|
-
* no details would otherwise render as a bare inset box.
|
|
2236
|
-
*/
|
|
2237
|
-
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2238
|
-
const members = selectedVisitorDataObject.value?.members;
|
|
2239
|
-
if (!Array.isArray(members)) return [];
|
|
2240
|
-
|
|
2241
|
-
return members.filter(
|
|
2242
|
-
(member: Record<string, any>) =>
|
|
2243
|
-
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2244
|
-
);
|
|
2245
|
-
});
|
|
2246
|
-
|
|
2247
|
-
/**
|
|
2248
|
-
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2249
|
-
*
|
|
2250
|
-
* Per member and not per card, so revealing one person's number does not
|
|
2251
|
-
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2252
|
-
* a preview must not open on the next visitor with the last one's NRIC
|
|
2253
|
-
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2254
|
-
* across if the same row were reopened.
|
|
2255
|
-
*/
|
|
2256
|
-
const showVisitorNric = ref(false);
|
|
2257
|
-
const shownMemberNrics = ref<number[]>([]);
|
|
2258
|
-
|
|
2259
|
-
function isMemberNricShown(index: number) {
|
|
2260
|
-
return shownMemberNrics.value.includes(index);
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
function toggleMemberNric(index: number) {
|
|
2264
|
-
shownMemberNrics.value = isMemberNricShown(index)
|
|
2265
|
-
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2266
|
-
: [...shownMemberNrics.value, index];
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
watch(
|
|
2270
|
-
() => dialog.viewVisitor,
|
|
2271
|
-
(open) => {
|
|
2272
|
-
if (open) return;
|
|
2273
|
-
showVisitorNric.value = false;
|
|
2274
|
-
shownMemberNrics.value = [];
|
|
2275
|
-
}
|
|
2276
|
-
);
|
|
2277
|
-
|
|
2278
|
-
/**
|
|
2279
|
-
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2280
|
-
* because the API returns it on `members[]` even though neither
|
|
2281
|
-
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2282
|
-
* model, name and nric only) declares it - the two types have drifted from the
|
|
2283
|
-
* document and from each other. Reading the key defensively costs nothing and
|
|
2284
|
-
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2285
|
-
* reconcile separately.
|
|
2286
|
-
*/
|
|
2287
|
-
const memberDetailFields = [
|
|
2288
|
-
{ key: "nric", label: "NRIC" },
|
|
2289
|
-
{ key: "contact", label: "Contact" },
|
|
2290
|
-
{ key: "plateNumber", label: "Vehicle" },
|
|
2291
|
-
] as const;
|
|
2292
|
-
|
|
2293
2126
|
const formatType = (item: any) =>
|
|
2294
2127
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
2295
2128
|
|
|
@@ -2303,7 +2136,6 @@ const formattedFields = {
|
|
|
2303
2136
|
level: "Level",
|
|
2304
2137
|
unit: "Unit",
|
|
2305
2138
|
purpose: "Purpose",
|
|
2306
|
-
members: "Members",
|
|
2307
2139
|
checkIn: "Check In",
|
|
2308
2140
|
snapshotEntryImage: "Entry Image",
|
|
2309
2141
|
checkOut: "Check Out",
|
|
@@ -3310,100 +3142,6 @@ watchEffect(async () => {
|
|
|
3310
3142
|
word-break: break-word;
|
|
3311
3143
|
}
|
|
3312
3144
|
|
|
3313
|
-
/* A row whose value is a set of records rather than a value - it drops the
|
|
3314
|
-
two-column grid and runs the full width of the card body. */
|
|
3315
|
-
.visitor-preview__row--block {
|
|
3316
|
-
display: block;
|
|
3317
|
-
}
|
|
3318
|
-
|
|
3319
|
-
.visitor-preview__members {
|
|
3320
|
-
display: flex;
|
|
3321
|
-
flex-direction: column;
|
|
3322
|
-
gap: 8px;
|
|
3323
|
-
margin-top: 8px;
|
|
3324
|
-
}
|
|
3325
|
-
|
|
3326
|
-
/*
|
|
3327
|
-
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3328
|
-
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3329
|
-
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3330
|
-
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3331
|
-
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3332
|
-
* off, so the lines below are set on the scale rather than inherited.
|
|
3333
|
-
*/
|
|
3334
|
-
.visitor-preview__member {
|
|
3335
|
-
padding: 9px 12px;
|
|
3336
|
-
border: 1px solid var(--border);
|
|
3337
|
-
border-radius: var(--r-inner);
|
|
3338
|
-
background: var(--hover);
|
|
3339
|
-
}
|
|
3340
|
-
|
|
3341
|
-
.visitor-preview__member-line {
|
|
3342
|
-
display: flex;
|
|
3343
|
-
gap: 8px;
|
|
3344
|
-
margin-top: 3px;
|
|
3345
|
-
font-size: var(--fs-breadcrumb);
|
|
3346
|
-
color: var(--text2);
|
|
3347
|
-
word-break: break-word;
|
|
3348
|
-
}
|
|
3349
|
-
|
|
3350
|
-
.visitor-preview__member-key {
|
|
3351
|
-
flex: 0 0 52px;
|
|
3352
|
-
color: var(--muted);
|
|
3353
|
-
}
|
|
3354
|
-
|
|
3355
|
-
/*
|
|
3356
|
-
* THE NRIC REVEAL.
|
|
3357
|
-
*
|
|
3358
|
-
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3359
|
-
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3360
|
-
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3361
|
-
* make the NRIC line half again the height of the Contact line under it.
|
|
3362
|
-
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3363
|
-
* rhythm, and reads the right way round: the number is what changes.
|
|
3364
|
-
*
|
|
3365
|
-
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3366
|
-
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3367
|
-
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3368
|
-
* same left edge as every other value in the card.
|
|
3369
|
-
*/
|
|
3370
|
-
.visitor-preview__reveal {
|
|
3371
|
-
display: inline-flex;
|
|
3372
|
-
align-items: center;
|
|
3373
|
-
gap: 6px;
|
|
3374
|
-
margin: -3px -7px;
|
|
3375
|
-
padding: 3px 7px;
|
|
3376
|
-
border: none;
|
|
3377
|
-
border-radius: var(--r-inner-sm);
|
|
3378
|
-
background: transparent;
|
|
3379
|
-
font: inherit;
|
|
3380
|
-
color: inherit;
|
|
3381
|
-
text-align: left;
|
|
3382
|
-
cursor: pointer;
|
|
3383
|
-
transition: background var(--motion) ease;
|
|
3384
|
-
}
|
|
3385
|
-
|
|
3386
|
-
.visitor-preview__reveal:hover {
|
|
3387
|
-
background: var(--hover);
|
|
3388
|
-
}
|
|
3389
|
-
|
|
3390
|
-
.visitor-preview__reveal:focus-visible {
|
|
3391
|
-
outline: 2px solid var(--accent);
|
|
3392
|
-
outline-offset: 1px;
|
|
3393
|
-
}
|
|
3394
|
-
|
|
3395
|
-
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3396
|
-
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3397
|
-
.visitor-preview__eye {
|
|
3398
|
-
color: var(--accent-text);
|
|
3399
|
-
}
|
|
3400
|
-
|
|
3401
|
-
@media (prefers-reduced-motion: reduce) {
|
|
3402
|
-
.visitor-preview__reveal {
|
|
3403
|
-
transition: none;
|
|
3404
|
-
}
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
3145
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
3408
3146
|
.visitor-type-filter {
|
|
3409
3147
|
max-width: 200px;
|
|
@@ -81,60 +81,7 @@ export default function useAttendance() {
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// ---- Site device mode (check in/out for someone on a shared site phone) ----
|
|
85
|
-
|
|
86
|
-
function setSiteDeviceMode(site: string, enabled: boolean, serviceType: string = "") {
|
|
87
|
-
return useNuxtApp().$api<{ message: string; siteDeviceMode: boolean }>(
|
|
88
|
-
`/api/attendance-settings/site/${site}/device-mode`,
|
|
89
|
-
{ method: "PUT", body: { serviceType, enabled } }
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** The person's photo, stored PRIVATELY by the server (never a public URL). */
|
|
94
|
-
function uploadAttendancePhoto(site: string, file: File, serviceType: string = "") {
|
|
95
|
-
const form = new FormData();
|
|
96
|
-
form.append("file", file);
|
|
97
|
-
return useNuxtApp().$api<{ id: string }>(`/api/attendances/site/${site}/photo`, {
|
|
98
|
-
method: "POST",
|
|
99
|
-
query: { serviceType },
|
|
100
|
-
body: form,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function proxyCheckOut(site: string, body: Record<string, any>, serviceType: string = "") {
|
|
105
|
-
return useNuxtApp().$api<{ message: string; id: string }>(
|
|
106
|
-
`/api/attendances/site/${site}/proxy-check-out`,
|
|
107
|
-
{ method: "POST", body: { ...body, serviceType } }
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function getOpenProxyCheckIns(site: string, serviceType: string = "") {
|
|
112
|
-
return useNuxtApp().$api<{ items: Array<Record<string, any>> }>(
|
|
113
|
-
`/api/attendances/site/${site}/proxy-open`,
|
|
114
|
-
{ method: "GET", query: { serviceType } }
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** Path of the private photo; read through $api (session), never a public link. */
|
|
119
|
-
function attendancePhotoPath(id: string, which: "checkIn" | "checkOut") {
|
|
120
|
-
return `/api/attendances/id/${id}/photo/${which}`;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
async function getAttendancePhotoUrl(id: string, which: "checkIn" | "checkOut") {
|
|
124
|
-
const blob = await useNuxtApp().$api<Blob>(attendancePhotoPath(id, which), {
|
|
125
|
-
method: "GET",
|
|
126
|
-
responseType: "blob",
|
|
127
|
-
});
|
|
128
|
-
return URL.createObjectURL(blob);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
84
|
return {
|
|
132
|
-
setSiteDeviceMode,
|
|
133
|
-
uploadAttendancePhoto,
|
|
134
|
-
proxyCheckOut,
|
|
135
|
-
getOpenProxyCheckIns,
|
|
136
|
-
attendancePhotoPath,
|
|
137
|
-
getAttendancePhotoUrl,
|
|
138
85
|
getAttendances,
|
|
139
86
|
getMyAttendances,
|
|
140
87
|
getMyAttendanceById,
|
|
@@ -57,30 +57,6 @@ export function useAttendancePermission() {
|
|
|
57
57
|
);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
// Site device mode switch. Widened, never swapped: the new key OR the existing
|
|
61
|
-
// settings key OR `*` - the same three the server accepts (core
|
|
62
|
-
// `SITE_DEVICE_MODE_PERMISSIONS`), so an admin who manages attendance
|
|
63
|
-
// settings today can use it without a role change.
|
|
64
|
-
const canManageSiteDeviceMode = computed(() => {
|
|
65
|
-
if (!userAppRole.value) return false;
|
|
66
|
-
if (moduleDenied("attendance-mgmt")) return false;
|
|
67
|
-
if (userAppRole.value.permissions.includes("*")) return true;
|
|
68
|
-
return (
|
|
69
|
-
hasPermission(
|
|
70
|
-
userAppRole.value,
|
|
71
|
-
permissions,
|
|
72
|
-
"attendance-mgmt",
|
|
73
|
-
"manage-site-device-mode"
|
|
74
|
-
) ||
|
|
75
|
-
hasPermission(
|
|
76
|
-
userAppRole.value,
|
|
77
|
-
permissions,
|
|
78
|
-
"attendance-mgmt",
|
|
79
|
-
"manage-attendance-settings"
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
60
|
const canViewOwnAttendance = computed(() => {
|
|
85
61
|
if (!userAppRole.value) return false;
|
|
86
62
|
if (moduleDenied("my-attendance")) return false;
|
|
@@ -109,7 +85,6 @@ export function useAttendancePermission() {
|
|
|
109
85
|
canViewAllAttendance,
|
|
110
86
|
canViewAttendanceDetails,
|
|
111
87
|
canManageAttendanceSettings,
|
|
112
|
-
canManageSiteDeviceMode,
|
|
113
88
|
canViewOwnAttendance,
|
|
114
89
|
canCheckInOut,
|
|
115
90
|
};
|
|
@@ -221,11 +221,6 @@ export default function useCleaningPermission() {
|
|
|
221
221
|
description:
|
|
222
222
|
"Allows the user to configure and manage attendance settings.",
|
|
223
223
|
},
|
|
224
|
-
"manage-site-device-mode": {
|
|
225
|
-
check: true,
|
|
226
|
-
description:
|
|
227
|
-
"Allows the user to turn Site device mode on or off: one shared phone at the site checks staff in and out with a photo, their name and the last 4 characters of their NRIC.",
|
|
228
|
-
},
|
|
229
224
|
},
|
|
230
225
|
// my attendance permissions
|
|
231
226
|
"my-attendance": {
|