@7365admin1/layer-common 1.11.21 → 1.11.23
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/AddPassKeyToVisitor.vue +9 -9
- package/components/AreaMain.vue +10 -8
- package/components/AttendanceMain.vue +6 -6
- package/components/CleaningScheduleMain.vue +8 -7
- package/components/ManageChecklistMain.vue +4 -3
- package/components/MemberInformation.vue +49 -13
- package/components/MyAttendanceMain.vue +6 -3
- package/components/PassInformation.vue +197 -144
- package/components/ScanVisitorQRCode.vue +47 -12
- package/components/ScheduleAreaMain.vue +6 -3
- package/components/ScheduleTaskMain.vue +11 -8
- package/components/UnitMain.vue +10 -8
- package/components/VisitorDataFromScannedQRCodeForm.vue +262 -0
- package/components/VisitorForm.vue +1 -1
- package/components/VisitorManagement.vue +80 -2
- package/components/VisitorPassKeyQRScanner.vue +138 -0
- package/composables/useVisitor.ts +98 -25
- package/package.json +2 -1
- package/types/visitor.d.ts +45 -15
|
@@ -4,7 +4,7 @@ export default function () {
|
|
|
4
4
|
value: TVisitorType;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
const visitorSelection: TVisitorSelection[] =[
|
|
7
|
+
const visitorSelection: TVisitorSelection[] = [
|
|
8
8
|
{ label: "Drive-in", value: "guest" },
|
|
9
9
|
{ label: "Contractor", value: "contractor" },
|
|
10
10
|
{ label: "Walk-In", value: "walk-in" },
|
|
@@ -13,14 +13,62 @@ export default function () {
|
|
|
13
13
|
{ label: "Drop-Off", value: "drop-off" },
|
|
14
14
|
];
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const typeFieldMap: Record<
|
|
17
|
+
TVisitorType,
|
|
18
|
+
(keyof TVisitorPayload | "delivery-company")[]
|
|
19
|
+
> = {
|
|
20
|
+
guest: [
|
|
21
|
+
"name",
|
|
22
|
+
"nric",
|
|
23
|
+
"contact",
|
|
24
|
+
"block",
|
|
25
|
+
"plateNumber",
|
|
26
|
+
"level",
|
|
27
|
+
"unit",
|
|
28
|
+
"unitName",
|
|
29
|
+
"remarks",
|
|
30
|
+
],
|
|
31
|
+
contractor: [
|
|
32
|
+
"contractorType",
|
|
33
|
+
"name",
|
|
34
|
+
"nric",
|
|
35
|
+
"company",
|
|
36
|
+
"contact",
|
|
37
|
+
"plateNumber",
|
|
38
|
+
"block",
|
|
39
|
+
"level",
|
|
40
|
+
"unit",
|
|
41
|
+
"unitName",
|
|
42
|
+
"remarks",
|
|
43
|
+
],
|
|
44
|
+
"walk-in": [
|
|
45
|
+
"name",
|
|
46
|
+
"company",
|
|
47
|
+
"nric",
|
|
48
|
+
"contact",
|
|
49
|
+
"block",
|
|
50
|
+
"level",
|
|
51
|
+
"unit",
|
|
52
|
+
"unitName",
|
|
53
|
+
"remarks",
|
|
54
|
+
],
|
|
55
|
+
delivery: [
|
|
56
|
+
"attachments",
|
|
57
|
+
"name",
|
|
58
|
+
"deliveryType",
|
|
59
|
+
"delivery-company",
|
|
60
|
+
"nric",
|
|
61
|
+
"contact",
|
|
62
|
+
"plateNumber",
|
|
63
|
+
"block",
|
|
64
|
+
"level",
|
|
65
|
+
"unit",
|
|
66
|
+
"unitName",
|
|
67
|
+
"remarks",
|
|
68
|
+
],
|
|
69
|
+
"pick-up": ["plateNumber", "block", "remarks"],
|
|
70
|
+
"drop-off": ["plateNumber", "block", "remarks"],
|
|
71
|
+
};
|
|
24
72
|
|
|
25
73
|
const contractorTypes = [
|
|
26
74
|
{ title: "Estate Contractor", value: "estate-contractor" },
|
|
@@ -29,21 +77,20 @@ export default function () {
|
|
|
29
77
|
{ title: "House Mover", value: "house-mover" },
|
|
30
78
|
];
|
|
31
79
|
|
|
32
|
-
|
|
33
80
|
type GetVisitorsParams = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
81
|
+
page?: number;
|
|
82
|
+
limit?: number;
|
|
83
|
+
order?: "asc" | "desc";
|
|
84
|
+
search?: string;
|
|
85
|
+
org?: string;
|
|
86
|
+
site?: string;
|
|
87
|
+
dateTo?: string;
|
|
88
|
+
dateFrom?: string;
|
|
89
|
+
type?: string;
|
|
90
|
+
status?: string;
|
|
91
|
+
checkedOut?: boolean;
|
|
92
|
+
plateNumber?: string;
|
|
93
|
+
};
|
|
47
94
|
|
|
48
95
|
async function getVisitors({
|
|
49
96
|
page = 1,
|
|
@@ -58,7 +105,7 @@ export default function () {
|
|
|
58
105
|
status = "",
|
|
59
106
|
// status = "registered"
|
|
60
107
|
plateNumber = "",
|
|
61
|
-
checkedOut
|
|
108
|
+
checkedOut,
|
|
62
109
|
}: GetVisitorsParams = {}) {
|
|
63
110
|
return await useNuxtApp().$api<Record<string, any>>(
|
|
64
111
|
"/api/visitor-transactions",
|
|
@@ -76,7 +123,7 @@ export default function () {
|
|
|
76
123
|
status,
|
|
77
124
|
checkedOut,
|
|
78
125
|
plateNumber,
|
|
79
|
-
order
|
|
126
|
+
order,
|
|
80
127
|
},
|
|
81
128
|
}
|
|
82
129
|
);
|
|
@@ -111,6 +158,29 @@ export default function () {
|
|
|
111
158
|
);
|
|
112
159
|
}
|
|
113
160
|
|
|
161
|
+
function validateVisitorQrCode(site: string, id: string) {
|
|
162
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
163
|
+
`/api/visitors/visitor-qr-code/${id}?site=${site}`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function updateVisitorPassKey(_id: string, payload: TPassKeyPayload[]) {
|
|
168
|
+
return await useNuxtApp().$api<Record<string, any>>(
|
|
169
|
+
`/api/visitor-transactions/replace-keys/id/${_id}`,
|
|
170
|
+
{
|
|
171
|
+
method: "PUT",
|
|
172
|
+
body: payload,
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function visitorDataFromScannedQRCodeCheckInOut(payload: any) {
|
|
178
|
+
return useNuxtApp().$api<Record<string, any>>("/api/visitors/update-one", {
|
|
179
|
+
method: "PUT",
|
|
180
|
+
body: payload,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
114
184
|
return {
|
|
115
185
|
typeFieldMap,
|
|
116
186
|
visitorSelection,
|
|
@@ -119,5 +189,8 @@ export default function () {
|
|
|
119
189
|
getVisitors,
|
|
120
190
|
updateVisitor,
|
|
121
191
|
deleteVisitor,
|
|
192
|
+
validateVisitorQrCode,
|
|
193
|
+
updateVisitorPassKey,
|
|
194
|
+
visitorDataFromScannedQRCodeCheckInOut,
|
|
122
195
|
};
|
|
123
196
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.11.
|
|
5
|
+
"version": "1.11.23",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"publishConfig": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@types/qrcode": "^1.5.6",
|
|
35
35
|
"ckeditor5": "^47.2.0",
|
|
36
36
|
"html2pdf.js": "^0.10.2",
|
|
37
|
+
"html5-qrcode": "^2.3.8",
|
|
37
38
|
"moment-timezone": "^0.6.0",
|
|
38
39
|
"nuxt-signature-pad": "^1.8.0",
|
|
39
40
|
"qrcode": "^1.5.4",
|
package/types/visitor.d.ts
CHANGED
|
@@ -16,39 +16,69 @@ declare type TVisitor = {
|
|
|
16
16
|
nric?: string;
|
|
17
17
|
contact?: string;
|
|
18
18
|
remarks?: string;
|
|
19
|
+
purpose?: string;
|
|
19
20
|
attachments: string[];
|
|
20
21
|
org: string;
|
|
21
|
-
site: string
|
|
22
|
+
site: string;
|
|
22
23
|
manualCheckout?: boolean;
|
|
23
24
|
visitorPass?: TPassKeyPayload[];
|
|
24
|
-
passKeys?: TPassKeyPayload[]
|
|
25
|
+
passKeys?: TPassKeyPayload[];
|
|
25
26
|
checkInRemarks?: string;
|
|
26
27
|
checkOutRemarks?: string;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
|
-
declare type TVisitorType =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
declare type TVisitorType =
|
|
31
|
+
| "contractor"
|
|
32
|
+
| "delivery"
|
|
33
|
+
| "walk-in"
|
|
34
|
+
| "pick-up"
|
|
35
|
+
| "drop-off"
|
|
36
|
+
| "guest";
|
|
35
37
|
|
|
38
|
+
declare type TVisitorPayload = Pick<
|
|
39
|
+
TVisitor,
|
|
40
|
+
| "name"
|
|
41
|
+
| "type"
|
|
42
|
+
| "company"
|
|
43
|
+
| "block"
|
|
44
|
+
| "level"
|
|
45
|
+
| "unit"
|
|
46
|
+
| "unitName"
|
|
47
|
+
| "contact"
|
|
48
|
+
| "plateNumber"
|
|
49
|
+
| "checkOut"
|
|
50
|
+
| "contractorType"
|
|
51
|
+
| "deliveryType"
|
|
52
|
+
| "nric"
|
|
53
|
+
| "contact"
|
|
54
|
+
| "remarks"
|
|
55
|
+
| "attachments"
|
|
56
|
+
| "org"
|
|
57
|
+
| "site"
|
|
58
|
+
| "status"
|
|
59
|
+
| "visitorPass"
|
|
60
|
+
| "passKeys"
|
|
61
|
+
| "checkInRemarks"
|
|
62
|
+
| "checkOutRemarks"
|
|
63
|
+
> & {
|
|
64
|
+
members?: TMemberInfo[];
|
|
65
|
+
};
|
|
36
66
|
|
|
37
67
|
declare type TDefaultOptionObj = {
|
|
38
68
|
title: string;
|
|
39
69
|
value: any;
|
|
40
|
-
}
|
|
70
|
+
};
|
|
41
71
|
|
|
42
72
|
declare type TMemberInfo = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
name: string;
|
|
74
|
+
nric: string;
|
|
75
|
+
visitorPass?: { keyId: string }[];
|
|
76
|
+
passKeys?: TPassKeyPayload[];
|
|
77
|
+
contact: string
|
|
48
78
|
}
|
|
49
79
|
|
|
50
80
|
declare type TPassKeyPayload = {
|
|
51
81
|
keyId: string;
|
|
52
82
|
status?: string;
|
|
53
83
|
remarks?: string;
|
|
54
|
-
}
|
|
84
|
+
};
|