@7365admin1/layer-common 1.10.0 → 1.10.2
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/AcceptDialog.vue +44 -0
- package/components/AccessCard/AvailableStats.vue +55 -0
- package/components/AccessCardAddForm.vue +284 -19
- package/components/AccessCardAssignToUnitForm.vue +440 -0
- package/components/AccessManagement.vue +218 -85
- package/components/AddSupplyForm.vue +165 -0
- package/components/AreaChecklistHistoryLogs.vue +235 -0
- package/components/AreaChecklistHistoryMain.vue +176 -0
- package/components/AreaFormDialog.vue +266 -0
- package/components/AreaMain.vue +863 -0
- package/components/AttendanceCheckInOutDialog.vue +416 -0
- package/components/AttendanceDetailsDialog.vue +184 -0
- package/components/AttendanceMain.vue +155 -0
- package/components/AttendanceMapSearchDialog.vue +393 -0
- package/components/AttendanceSettingsDialog.vue +398 -0
- package/components/BuildingManagement/buildings.vue +5 -5
- package/components/BuildingManagement/units.vue +5 -5
- package/components/BulletinBoardManagement.vue +322 -0
- package/components/ChecklistItemRow.vue +54 -0
- package/components/CheckoutItemMain.vue +705 -0
- package/components/CleaningScheduleMain.vue +271 -0
- package/components/DocumentManagement.vue +4 -0
- package/components/EntryPass/QrTemplatePreview.vue +104 -0
- package/components/EntryPassMain.vue +252 -200
- package/components/HygieneUpdateMoreAction.vue +238 -0
- package/components/ManageChecklistMain.vue +384 -0
- package/components/MemberMain.vue +48 -20
- package/components/MyAttendanceMain.vue +224 -0
- package/components/OnlineFormsConfiguration.vue +9 -2
- package/components/PhotoUpload.vue +410 -0
- package/components/ScheduleAreaMain.vue +313 -0
- package/components/ScheduleTaskAreaFormDialog.vue +144 -0
- package/components/ScheduleTaskAreaUpdateMoreAction.vue +109 -0
- package/components/ScheduleTaskForm.vue +471 -0
- package/components/ScheduleTaskMain.vue +345 -0
- package/components/ScheduleTastTicketMain.vue +182 -0
- package/components/SignaturePad.vue +17 -5
- package/components/StockCard.vue +191 -0
- package/components/SupplyManagementMain.vue +557 -0
- package/components/TableHygiene.vue +617 -0
- package/components/UnitMain.vue +451 -0
- package/components/VisitorManagement.vue +28 -15
- package/composables/useAccessManagement.ts +163 -0
- package/composables/useAreaPermission.ts +51 -0
- package/composables/useAreas.ts +99 -0
- package/composables/useAttendance.ts +89 -0
- package/composables/useAttendancePermission.ts +68 -0
- package/composables/useBuilding.ts +2 -2
- package/composables/useBuildingUnit.ts +2 -2
- package/composables/useBulletin.ts +82 -0
- package/composables/useCard.ts +2 -0
- package/composables/useCheckout.ts +61 -0
- package/composables/useCheckoutPermission.ts +80 -0
- package/composables/useCleaningPermission.ts +229 -0
- package/composables/useCleaningSchedulePermission.ts +58 -0
- package/composables/useCleaningSchedules.ts +233 -0
- package/composables/useCountry.ts +8 -0
- package/composables/useDashboardData.ts +2 -2
- package/composables/useFeedback.ts +1 -1
- package/composables/useLocation.ts +78 -0
- package/composables/useOnlineForm.ts +16 -9
- package/composables/usePeople.ts +87 -72
- package/composables/useQR.ts +29 -0
- package/composables/useScheduleTask.ts +89 -0
- package/composables/useScheduleTaskArea.ts +85 -0
- package/composables/useScheduleTaskPermission.ts +68 -0
- package/composables/useSiteEntryPassSettings.ts +4 -15
- package/composables/useStock.ts +45 -0
- package/composables/useSupply.ts +63 -0
- package/composables/useSupplyPermission.ts +92 -0
- package/composables/useUnitPermission.ts +51 -0
- package/composables/useUnits.ts +82 -0
- package/composables/useWebUsb.ts +389 -0
- package/composables/useWorkOrder.ts +1 -1
- package/nuxt.config.ts +3 -0
- package/package.json +4 -1
- package/types/area.d.ts +22 -0
- package/types/attendance.d.ts +38 -0
- package/types/checkout-item.d.ts +27 -0
- package/types/cleaner-schedule.d.ts +54 -0
- package/types/location.d.ts +42 -0
- package/types/schedule-task.d.ts +18 -0
- package/types/stock.d.ts +16 -0
- package/types/supply.d.ts +11 -0
- package/utils/acm-crypto.ts +30 -0
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.10.
|
|
5
|
+
"version": "1.10.2",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"publishConfig": {
|
|
@@ -30,8 +30,11 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
32
32
|
"@iconify/vue": "^5.0.0",
|
|
33
|
+
"qrcode.vue": "^3.4.1",
|
|
33
34
|
"@mdi/font": "^7.4.47",
|
|
35
|
+
"@types/qrcode": "^1.5.6",
|
|
34
36
|
"ckeditor5": "^47.2.0",
|
|
37
|
+
"qrcode": "^1.5.4",
|
|
35
38
|
"sass": "^1.80.6",
|
|
36
39
|
"vue3-signature": "^0.2.4",
|
|
37
40
|
"zod": "^3.24.2"
|
package/types/area.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare type TArea = {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
checklist: TAreaChecklist[];
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare type TAreaChecklist = {
|
|
10
|
+
_id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
declare type TAreaCreate = {
|
|
15
|
+
name: string;
|
|
16
|
+
set: number;
|
|
17
|
+
type: string;
|
|
18
|
+
units: Array<{
|
|
19
|
+
unit: string;
|
|
20
|
+
name: string;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare type TAttendance = {
|
|
2
|
+
_id: string;
|
|
3
|
+
teamMember: string;
|
|
4
|
+
checkIn?: string;
|
|
5
|
+
checkOut?: string;
|
|
6
|
+
totalHours?: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare type TAttendanceCheckIn = {
|
|
12
|
+
checkIn: {
|
|
13
|
+
timestamp: string;
|
|
14
|
+
location: TAttendanceLocation;
|
|
15
|
+
img?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
declare type TAttendanceCheckOut = {
|
|
20
|
+
checkOut: {
|
|
21
|
+
timestamp: string;
|
|
22
|
+
location: TAttendanceLocation;
|
|
23
|
+
img?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare type TAttendanceLocation = {
|
|
28
|
+
latitude: number;
|
|
29
|
+
longitude: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare type TAttendanceSettings = {
|
|
33
|
+
site: string;
|
|
34
|
+
isLocationEnabled: boolean;
|
|
35
|
+
location?: TAttendanceLocation;
|
|
36
|
+
isGeofencingEnabled?: boolean;
|
|
37
|
+
mile?: number;
|
|
38
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare type TCheckoutItemApi = {
|
|
2
|
+
_id: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
name: string;
|
|
5
|
+
status: string;
|
|
6
|
+
supply: string;
|
|
7
|
+
qty: number;
|
|
8
|
+
unitOfMeasurement: string;
|
|
9
|
+
remarks?: string;
|
|
10
|
+
attachment?: string[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare type TCheckoutItemCreate = {
|
|
14
|
+
items: Array<{
|
|
15
|
+
supply: string;
|
|
16
|
+
qty: number;
|
|
17
|
+
attachment?: string[];
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare type TCheckoutItem = {
|
|
22
|
+
supply: string;
|
|
23
|
+
supplyName: string;
|
|
24
|
+
qty: number;
|
|
25
|
+
photos: string[];
|
|
26
|
+
photoIds: string[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare type TCleanerChecklist = {
|
|
2
|
+
_id: string;
|
|
3
|
+
date: string;
|
|
4
|
+
status: TCleanerChecklistStatus[];
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
attachments: string[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare type TCleanerChecklistStatus = {
|
|
11
|
+
type: string;
|
|
12
|
+
site: string;
|
|
13
|
+
status: string;
|
|
14
|
+
completedAt: string;
|
|
15
|
+
createdByName: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
declare type TAreaRejectChecklist = {
|
|
19
|
+
attachments: string[];
|
|
20
|
+
remarks: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare type TAreaChecklistHistory = {
|
|
24
|
+
_id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
status: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
endedAt: string;
|
|
29
|
+
acceptedByName: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare type TUnitChecklistItem = {
|
|
33
|
+
unit: string;
|
|
34
|
+
name: string;
|
|
35
|
+
status: string;
|
|
36
|
+
remarks: string;
|
|
37
|
+
completedByName?: string;
|
|
38
|
+
timestamp?: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
declare type TChecklistSet = {
|
|
42
|
+
units: TUnitChecklistItem[];
|
|
43
|
+
set: number;
|
|
44
|
+
remarks?: string;
|
|
45
|
+
attachments?: string[];
|
|
46
|
+
completedByName?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
declare type TFlattenedUnitItem = TUnitChecklistItem & {
|
|
50
|
+
set: number;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
declare type TScheduleAreaStatus = "All" | "Ready" | "Ongoing" | "Completed";
|
|
54
|
+
declare type TAreaType = "all" | "common" | "toilet";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare type TLocationData = {
|
|
2
|
+
latitude: number;
|
|
3
|
+
longitude: number;
|
|
4
|
+
address?: string;
|
|
5
|
+
city?: string;
|
|
6
|
+
country?: string;
|
|
7
|
+
postalCode?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare type TLocationFormData = {
|
|
11
|
+
country: string;
|
|
12
|
+
postalCode: string;
|
|
13
|
+
city: string;
|
|
14
|
+
address: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare type TLocationFieldState = {
|
|
18
|
+
country: boolean;
|
|
19
|
+
city: boolean;
|
|
20
|
+
address: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare type TNominatimResult = {
|
|
24
|
+
lat: string;
|
|
25
|
+
lon: string;
|
|
26
|
+
display_name: string;
|
|
27
|
+
address?: {
|
|
28
|
+
city?: string;
|
|
29
|
+
town?: string;
|
|
30
|
+
village?: string;
|
|
31
|
+
state?: string;
|
|
32
|
+
country?: string;
|
|
33
|
+
postcode?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
declare type TLocationSearchParams = {
|
|
38
|
+
postalCode: string;
|
|
39
|
+
city?: string;
|
|
40
|
+
address?: string;
|
|
41
|
+
country?: string;
|
|
42
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type TScheduleTask = {
|
|
2
|
+
_id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
// replaced frequency-based recurrence with explicit date range
|
|
5
|
+
startDate?: string; // YYYY-MM-DD
|
|
6
|
+
endDate?: string; // YYYY-MM-DD
|
|
7
|
+
time?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
areas: { name: string; value: string }[];
|
|
10
|
+
site: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
declare type TScheduleTaskForm = Pick<
|
|
16
|
+
TScheduleTask,
|
|
17
|
+
"title" | "startDate" | "endDate" | "time" | "description" | "areas"
|
|
18
|
+
>;
|
package/types/stock.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare type TStock = {
|
|
2
|
+
_id?: string;
|
|
3
|
+
site: string;
|
|
4
|
+
supply: string;
|
|
5
|
+
in?: number;
|
|
6
|
+
out?: number;
|
|
7
|
+
balance: number;
|
|
8
|
+
qty: number;
|
|
9
|
+
remarks?: string;
|
|
10
|
+
status?: string;
|
|
11
|
+
createdAt?: string;
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
deletedAt?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare type TStockCreate = Pick<TStock, "qty" | "remarks">;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
|
|
3
|
+
const ALGORITHM = "aes-256-gcm";
|
|
4
|
+
const IV_LENGTH = 12;
|
|
5
|
+
const SECRET_KEY = crypto.createSecretKey(
|
|
6
|
+
new Uint8Array(crypto.createHash("sha256").update("acm-secret-key").digest())
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
// encrypting entrypass url for security purpose
|
|
10
|
+
export function encryptAcmUrl(entrypassUrl: string) {
|
|
11
|
+
const iv = crypto.randomBytes(IV_LENGTH);
|
|
12
|
+
const cipher = crypto.createCipheriv(
|
|
13
|
+
ALGORITHM,
|
|
14
|
+
SECRET_KEY,
|
|
15
|
+
new Uint8Array(iv)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const encrypted = Buffer.concat([
|
|
19
|
+
cipher.update(entrypassUrl, "utf8"),
|
|
20
|
+
cipher.final() as any,
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const authTag = cipher.getAuthTag();
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
iv.toString("base64"),
|
|
27
|
+
authTag.toString("base64"),
|
|
28
|
+
encrypted.toString("base64"),
|
|
29
|
+
].join(":");
|
|
30
|
+
}
|