@7365admin1/layer-common 1.10.5 → 1.10.7
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 +12 -0
- package/components/AccessCardDetailsDialog.vue +144 -0
- package/components/AccessCardPreviewDialog.vue +7 -2
- package/components/AccessCardQrTagging.vue +314 -34
- package/components/AccessCardQrTaggingPrintQr.vue +75 -0
- package/components/AccessManagement.vue +5 -1
- package/components/AreaChecklistHistoryLogs.vue +9 -0
- package/components/BuildingForm.vue +36 -5
- package/components/BuildingManagement/buildings.vue +18 -9
- package/components/BuildingManagement/units.vue +12 -114
- package/components/BuildingUnitFormAdd.vue +39 -30
- package/components/BuildingUnitFormEdit.vue +265 -116
- package/components/CleaningScheduleMain.vue +60 -13
- package/components/Dialog/DeleteConfirmation.vue +2 -2
- package/components/Dialog/UpdateMoreAction.vue +2 -2
- package/components/EntryPassInformation.vue +215 -0
- package/components/Input/InputPhoneNumberV2.vue +11 -0
- package/components/ManageChecklistMain.vue +29 -3
- package/components/PlateNumberDisplay.vue +9 -1
- package/components/ScheduleAreaMain.vue +56 -0
- package/components/TableHygiene.vue +265 -113
- package/components/UnitPersonCard.vue +63 -0
- package/components/VehicleAddSelection.vue +2 -2
- package/components/VehicleForm.vue +169 -47
- package/components/VehicleManagement.vue +169 -43
- package/components/VisitorForm.vue +19 -0
- package/components/VisitorManagement.vue +1 -1
- package/components/WorkOrder/Main.vue +2 -1
- package/composables/useAccessManagement.ts +63 -0
- package/composables/useFeedback.ts +2 -2
- package/composables/usePeople.ts +14 -3
- package/composables/useVehicle.ts +15 -1
- package/composables/useWorkOrder.ts +2 -2
- package/package.json +3 -2
- package/types/cleaner-schedule.d.ts +1 -0
- package/types/html2pdf.d.ts +19 -0
- package/types/people.d.ts +4 -0
- package/types/site.d.ts +8 -0
- package/types/vehicle.d.ts +3 -4
- package/.playground/app.vue +0 -41
- package/.playground/eslint.config.mjs +0 -6
- package/.playground/nuxt.config.ts +0 -22
- package/.playground/pages/feedback.vue +0 -30
- package/components/AccessCardHistoryDialog.vue +0 -133
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare module "html2pdf.js" {
|
|
2
|
+
interface Html2PdfOptions {
|
|
3
|
+
margin?: number | number[];
|
|
4
|
+
filename?: string;
|
|
5
|
+
image?: { type?: string; quality?: number };
|
|
6
|
+
html2canvas?: Record<string, any>;
|
|
7
|
+
jsPDF?: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Html2Pdf {
|
|
11
|
+
set(options: Html2PdfOptions): Html2Pdf;
|
|
12
|
+
from(element: HTMLElement): Html2Pdf;
|
|
13
|
+
save(): Promise<void>;
|
|
14
|
+
output(type: string): Promise<any>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function html2pdf(): Html2Pdf;
|
|
18
|
+
export default html2pdf;
|
|
19
|
+
}
|
package/types/people.d.ts
CHANGED
|
@@ -16,8 +16,12 @@ declare type TPeople = {
|
|
|
16
16
|
org?: string;
|
|
17
17
|
site?: string,
|
|
18
18
|
type?: TPeopleType;
|
|
19
|
+
plates?: TPlateNumber[]
|
|
20
|
+
email?: string;
|
|
19
21
|
};
|
|
20
22
|
|
|
23
|
+
declare type TPlateNumber = { plateNumber: string, recNo: string, _id?: string, status: "active" | "deleted" | "pending", type: TVehicleType };
|
|
24
|
+
|
|
21
25
|
|
|
22
26
|
declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type">
|
|
23
27
|
|
package/types/site.d.ts
CHANGED
package/types/vehicle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare type TVehicle = {
|
|
2
2
|
plateNumber: string;
|
|
3
|
-
|
|
3
|
+
plates?: TPlateNumber[]; // For display purposes, the API will return an array of plate numbers if there are multiple associated with the same vehicle record
|
|
4
4
|
type: TVehicleType;
|
|
5
5
|
category: "resident" | "visitor";
|
|
6
6
|
direction: "entry" | "exit" | "both" | "none";
|
|
@@ -20,11 +20,10 @@ declare type TVehicle = {
|
|
|
20
20
|
recNo?: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
declare type TVehicleType = "whitelist" | "blocklist"
|
|
23
|
+
declare type TVehicleType = "whitelist" | "blocklist";
|
|
24
24
|
|
|
25
25
|
declare type TVehiclePayload = Pick<
|
|
26
26
|
TVehicle,
|
|
27
|
-
| "plateNumber"
|
|
28
27
|
| "type"
|
|
29
28
|
| "category"
|
|
30
29
|
| "direction"
|
|
@@ -40,4 +39,4 @@ declare type TVehiclePayload = Pick<
|
|
|
40
39
|
| "end"
|
|
41
40
|
| "site"
|
|
42
41
|
| "org"
|
|
43
|
-
|
|
42
|
+
> & { plateNumber: string[] };
|
package/.playground/app.vue
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-app>
|
|
3
|
-
<LayoutHeader />
|
|
4
|
-
|
|
5
|
-
<LayoutNavigationDrawer :navigation-items="navigationItems" />
|
|
6
|
-
|
|
7
|
-
<v-main>
|
|
8
|
-
<NuxtLayout> <NuxtPage /> </NuxtLayout>
|
|
9
|
-
</v-main>
|
|
10
|
-
</v-app>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
const navigationItems = computed(() => {
|
|
15
|
-
const items: Array<TNavigationItem> = [];
|
|
16
|
-
items.push(
|
|
17
|
-
{
|
|
18
|
-
title: "Create new request",
|
|
19
|
-
route: { name: "index" },
|
|
20
|
-
icon: "mdi-plus",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
title: "Requests",
|
|
24
|
-
route: { name: "index" },
|
|
25
|
-
icon: "mdi-account-circle",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
title: "Draft",
|
|
29
|
-
route: { name: "index" },
|
|
30
|
-
icon: "mdi-account-circle",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
title: "Feedback",
|
|
34
|
-
route: { name: "feedback" },
|
|
35
|
-
icon: "mdi-account-circle",
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return items;
|
|
40
|
-
});
|
|
41
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export default defineNuxtConfig({
|
|
2
|
-
extends: [".."],
|
|
3
|
-
modules: ["@nuxt/eslint"],
|
|
4
|
-
compatibilityDate: "2024-11-03",
|
|
5
|
-
|
|
6
|
-
runtimeConfig: {
|
|
7
|
-
public: {
|
|
8
|
-
cookieConfig: {
|
|
9
|
-
domain: (process.env.DOMAIN as string) ?? "localhost",
|
|
10
|
-
secure: true,
|
|
11
|
-
maxAge: 30 * 24 * 60 * 60,
|
|
12
|
-
},
|
|
13
|
-
APP_NAME: (process.env.APP_NAME as string) ?? "App",
|
|
14
|
-
APP_NAME_ROUTE: (process.env.APP_NAME_ROUTE as string) ?? "index",
|
|
15
|
-
APP_ACCOUNT: (process.env.APP_ACCOUNT as string) ?? "",
|
|
16
|
-
API_DO_STORAGE_ENDPOINT:
|
|
17
|
-
(process.env.API_DO_STORAGE_ENDPOINT as string) ?? "",
|
|
18
|
-
APP_ADMIN: (process.env.APP_ADMIN as string) ?? "",
|
|
19
|
-
APP_CBA_RECAP: (process.env.APP_CBA_RECAP as string) ?? "",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-row class="no-gutters" align="center" justify="center">
|
|
3
|
-
<v-col cols="12" md="10" lg="10">
|
|
4
|
-
<FeedbackListView @click:create="showCreateDialog = true" />
|
|
5
|
-
</v-col>
|
|
6
|
-
|
|
7
|
-
<v-dialog
|
|
8
|
-
v-model="showCreateDialog"
|
|
9
|
-
fullscreen
|
|
10
|
-
transition="dialog-right-transition"
|
|
11
|
-
persistent
|
|
12
|
-
>
|
|
13
|
-
<v-card
|
|
14
|
-
class="ml-auto"
|
|
15
|
-
style="
|
|
16
|
-
height: 100vh;
|
|
17
|
-
width: 400px;
|
|
18
|
-
border-top-left-radius: 12px;
|
|
19
|
-
border-bottom-left-radius: 12px;
|
|
20
|
-
"
|
|
21
|
-
>
|
|
22
|
-
<FeedbackFormCreate @close="showCreateDialog = false" />
|
|
23
|
-
</v-card>
|
|
24
|
-
</v-dialog>
|
|
25
|
-
</v-row>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script lang="ts" setup>
|
|
29
|
-
const showCreateDialog = ref(false);
|
|
30
|
-
</script>
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-dialog :model-value="modelValue" width="480" persistent>
|
|
3
|
-
<v-card width="100%">
|
|
4
|
-
<v-toolbar density="compact" color="black">
|
|
5
|
-
<v-toolbar-title class="text-subtitle-1 font-weight-medium">
|
|
6
|
-
Card History — {{ card?.cardNo ?? "N/A" }}
|
|
7
|
-
</v-toolbar-title>
|
|
8
|
-
<v-btn icon @click="emit('update:modelValue', false)">
|
|
9
|
-
<v-icon>mdi-close</v-icon>
|
|
10
|
-
</v-btn>
|
|
11
|
-
</v-toolbar>
|
|
12
|
-
|
|
13
|
-
<v-card-text style="max-height: 70vh; overflow-y: auto" class="pa-4">
|
|
14
|
-
<div v-if="pending" class="d-flex justify-center align-center py-8">
|
|
15
|
-
<v-progress-circular indeterminate color="black" />
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div v-else-if="!history.length" class="text-center text-grey py-8">
|
|
19
|
-
No history available.
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<v-timeline v-else side="end" density="compact" truncate-line="both">
|
|
23
|
-
<v-timeline-item
|
|
24
|
-
v-for="(item, index) in history"
|
|
25
|
-
:key="index"
|
|
26
|
-
:dot-color="actionColor(item.action)"
|
|
27
|
-
size="small"
|
|
28
|
-
>
|
|
29
|
-
<template #icon>
|
|
30
|
-
<v-icon size="14" color="white">{{ actionIcon(item.action) }}</v-icon>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<div class="mb-4">
|
|
34
|
-
<div class="d-flex align-center ga-2 mb-1">
|
|
35
|
-
<v-chip
|
|
36
|
-
:color="actionColor(item.action)"
|
|
37
|
-
variant="flat"
|
|
38
|
-
size="x-small"
|
|
39
|
-
class="text-capitalize font-weight-medium"
|
|
40
|
-
>
|
|
41
|
-
{{ actionLabel(item.action) }}
|
|
42
|
-
</v-chip>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="text-body-2">{{ item.performedBy?.name ?? "N/A" }}</div>
|
|
45
|
-
<div class="text-caption text-grey">{{ formatDate(item.date) }}</div>
|
|
46
|
-
</div>
|
|
47
|
-
</v-timeline-item>
|
|
48
|
-
</v-timeline>
|
|
49
|
-
</v-card-text>
|
|
50
|
-
</v-card>
|
|
51
|
-
</v-dialog>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<script setup lang="ts">
|
|
55
|
-
const props = defineProps({
|
|
56
|
-
modelValue: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
card: {
|
|
61
|
-
type: Object as PropType<Record<string, any> | null>,
|
|
62
|
-
default: null,
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const emit = defineEmits<{
|
|
67
|
-
"update:modelValue": [value: boolean];
|
|
68
|
-
}>();
|
|
69
|
-
|
|
70
|
-
const { getCardHistory } = useAccessManagement();
|
|
71
|
-
|
|
72
|
-
const history = ref<Record<string, any>[]>([]);
|
|
73
|
-
const pending = ref(false);
|
|
74
|
-
|
|
75
|
-
watch(
|
|
76
|
-
() => props.modelValue,
|
|
77
|
-
async (val) => {
|
|
78
|
-
if (val && props.card?._id) {
|
|
79
|
-
pending.value = true;
|
|
80
|
-
try {
|
|
81
|
-
const data = await getCardHistory(props.card._id);
|
|
82
|
-
history.value = Array.isArray(data) ? data : [];
|
|
83
|
-
} finally {
|
|
84
|
-
pending.value = false;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
history.value = [];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
function actionLabel(action: string) {
|
|
93
|
-
const map: Record<string, string> = {
|
|
94
|
-
available: "Created",
|
|
95
|
-
assign: "Assigned",
|
|
96
|
-
replace: "Replaced",
|
|
97
|
-
deleted: "Deleted",
|
|
98
|
-
};
|
|
99
|
-
return map[action] ?? action;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function actionColor(action: string) {
|
|
103
|
-
const map: Record<string, string> = {
|
|
104
|
-
available: "success",
|
|
105
|
-
assign: "primary",
|
|
106
|
-
replace: "orange",
|
|
107
|
-
deleted: "error",
|
|
108
|
-
};
|
|
109
|
-
return map[action] ?? "grey";
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function actionIcon(action: string) {
|
|
113
|
-
const map: Record<string, string> = {
|
|
114
|
-
available: "mdi-plus",
|
|
115
|
-
assign: "mdi-account-check",
|
|
116
|
-
replace: "mdi-swap-horizontal",
|
|
117
|
-
deleted: "mdi-delete",
|
|
118
|
-
};
|
|
119
|
-
return map[action] ?? "mdi-circle-small";
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function formatDate(date: string) {
|
|
123
|
-
if (!date) return "N/A";
|
|
124
|
-
return new Intl.DateTimeFormat("en-GB", {
|
|
125
|
-
day: "2-digit",
|
|
126
|
-
month: "short",
|
|
127
|
-
year: "numeric",
|
|
128
|
-
hour: "2-digit",
|
|
129
|
-
minute: "2-digit",
|
|
130
|
-
hour12: true,
|
|
131
|
-
}).format(new Date(date));
|
|
132
|
-
}
|
|
133
|
-
</script>
|