@7365admin1/layer-common 3.0.7 → 3.0.9
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 +13 -0
- package/components/CameraMain.vue +17 -1
- package/components/DashboardMain.vue +1854 -848
- package/components/EntryPassInformation.vue +60 -0
- package/components/HidAccessLogDashboard.vue +1691 -0
- package/components/HidEnabledGate.vue +51 -0
- package/components/HidIdentityMapping.vue +975 -0
- package/components/HidQrCodeConfiguration.vue +618 -0
- package/components/HidReaderForm.vue +246 -0
- package/components/HidReaderManagement.vue +1233 -0
- package/components/HidServiceSettingsPanel.vue +150 -0
- package/components/HidUserEnrollment.vue +1274 -0
- package/components/Layout/NavigationDrawer.vue +31 -1
- package/components/MemberInformation.vue +23 -15
- package/components/NavigationItem.vue +11 -4
- package/components/OnlineFormFill.vue +34 -0
- package/components/PassInformation.vue +73 -34
- package/components/SiteSettings.vue +60 -116
- package/components/VisitorForm.vue +815 -290
- package/components/VisitorFormSelection.vue +12 -2
- package/components/VisitorManagement.vue +652 -205
- package/composables/useCommonPermission.ts +59 -0
- package/composables/useDashboard.ts +46 -1
- package/composables/useHidAmico.ts +152 -0
- package/composables/useHidNavigation.ts +106 -0
- package/composables/useMember.ts +7 -1
- package/composables/useOptionalServices.ts +118 -0
- package/composables/useSettingsPermission.ts +138 -0
- package/composables/useSiteSettings.ts +1 -1
- package/composables/useUser.ts +1 -2
- package/nuxt.config.ts +1 -1
- package/package.json +3 -2
- package/pages/[org]/[site]/access-mgmt/access-logs/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/hid-users/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/identity-mapping/index.vue +21 -0
- package/types/local.d.ts +2 -1
- package/types/visitor.d.ts +4 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { useCommonPermissions } from "./useCommonPermission";
|
|
2
|
+
|
|
3
|
+
export function useSettingsPermission() {
|
|
4
|
+
const { hasPermission } = usePermission();
|
|
5
|
+
const { siteSettingsPermissions: permissions } = useCommonPermissions();
|
|
6
|
+
const { userAppRole } = useLocalSetup();
|
|
7
|
+
|
|
8
|
+
const canManageSiteInformation = computed(() => {
|
|
9
|
+
if (!userAppRole.value) return true;
|
|
10
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
11
|
+
return hasPermission(
|
|
12
|
+
userAppRole.value,
|
|
13
|
+
permissions,
|
|
14
|
+
"site-settings",
|
|
15
|
+
"manage-site-information",
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
const canManageANPRCamera = computed(() => {
|
|
19
|
+
if (!userAppRole.value) return true;
|
|
20
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
21
|
+
return hasPermission(
|
|
22
|
+
userAppRole.value,
|
|
23
|
+
permissions,
|
|
24
|
+
"site-settings",
|
|
25
|
+
"manage-anpr-camera",
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
const canManageCCTVCamera = computed(() => {
|
|
29
|
+
if (!userAppRole.value) return true;
|
|
30
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
31
|
+
return hasPermission(
|
|
32
|
+
userAppRole.value,
|
|
33
|
+
permissions,
|
|
34
|
+
"site-settings",
|
|
35
|
+
"manage-cctv-camera",
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
const canManageDeliveryCompanies = computed(() => {
|
|
39
|
+
if (!userAppRole.value) return true;
|
|
40
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
41
|
+
return hasPermission(
|
|
42
|
+
userAppRole.value,
|
|
43
|
+
permissions,
|
|
44
|
+
"site-settings",
|
|
45
|
+
"manage-delivery-companies",
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
const canManageResidentVisitors = computed(() => {
|
|
49
|
+
if (!userAppRole.value) return true;
|
|
50
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
51
|
+
return hasPermission(
|
|
52
|
+
userAppRole.value,
|
|
53
|
+
permissions,
|
|
54
|
+
"site-settings",
|
|
55
|
+
"manage-resident-visitors",
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
const canManageWorkOrderSettings = computed(() => {
|
|
59
|
+
if (!userAppRole.value) return true;
|
|
60
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
61
|
+
return hasPermission(
|
|
62
|
+
userAppRole.value,
|
|
63
|
+
permissions,
|
|
64
|
+
"site-settings",
|
|
65
|
+
"manage-work-order-settings",
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
const canManageBillingAndSOAConfiguration = computed(() => {
|
|
69
|
+
if (!userAppRole.value) return true;
|
|
70
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
71
|
+
return hasPermission(
|
|
72
|
+
userAppRole.value,
|
|
73
|
+
permissions,
|
|
74
|
+
"site-settings",
|
|
75
|
+
"manage-billing-and-soa-configuration",
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
const canManageNFCManagement = computed(() => {
|
|
79
|
+
if (!userAppRole.value) return true;
|
|
80
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
81
|
+
return hasPermission(
|
|
82
|
+
userAppRole.value,
|
|
83
|
+
permissions,
|
|
84
|
+
"site-settings",
|
|
85
|
+
"manage-nfc-management",
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
const canManageNFCPatrolSettings = computed(() => {
|
|
89
|
+
if (!userAppRole.value) return true;
|
|
90
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
91
|
+
return hasPermission(
|
|
92
|
+
userAppRole.value,
|
|
93
|
+
permissions,
|
|
94
|
+
"site-settings",
|
|
95
|
+
"manage-nfc-patrol-settings",
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
const canManageEntryPass = computed(() => {
|
|
99
|
+
if (!userAppRole.value) return true;
|
|
100
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
101
|
+
return hasPermission(
|
|
102
|
+
userAppRole.value,
|
|
103
|
+
permissions,
|
|
104
|
+
"site-settings",
|
|
105
|
+
"manage-entry-pass",
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
const canManageRedDotSettings = computed(() => {
|
|
109
|
+
if (!userAppRole.value) return true;
|
|
110
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
111
|
+
return hasPermission(
|
|
112
|
+
userAppRole.value,
|
|
113
|
+
permissions,
|
|
114
|
+
"site-settings",
|
|
115
|
+
"manage-red-dot-settings",
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const canManageSiteSettings = computed(() => {
|
|
120
|
+
return canManageSiteInformation.value || canManageANPRCamera.value || canManageCCTVCamera.value || canManageDeliveryCompanies.value || canManageResidentVisitors.value || canManageWorkOrderSettings.value || canManageBillingAndSOAConfiguration.value || canManageNFCManagement.value || canManageNFCPatrolSettings.value || canManageEntryPass.value || canManageRedDotSettings.value
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
canManageSiteInformation,
|
|
125
|
+
canManageANPRCamera,
|
|
126
|
+
canManageCCTVCamera,
|
|
127
|
+
canManageDeliveryCompanies,
|
|
128
|
+
canManageResidentVisitors,
|
|
129
|
+
canManageWorkOrderSettings,
|
|
130
|
+
canManageBillingAndSOAConfiguration,
|
|
131
|
+
canManageNFCManagement,
|
|
132
|
+
canManageNFCPatrolSettings,
|
|
133
|
+
canManageEntryPass,
|
|
134
|
+
canManageRedDotSettings,
|
|
135
|
+
canManageSiteSettings
|
|
136
|
+
|
|
137
|
+
};
|
|
138
|
+
}
|
|
@@ -38,7 +38,7 @@ export default function () {
|
|
|
38
38
|
}
|
|
39
39
|
async function updateSitebyId(
|
|
40
40
|
siteId: string,
|
|
41
|
-
payload:
|
|
41
|
+
payload: Record<string, any>
|
|
42
42
|
) {
|
|
43
43
|
return await useNuxtApp().$api<Record<string, any>>(
|
|
44
44
|
`/api/sites/id/${siteId}`,
|
package/composables/useUser.ts
CHANGED
|
@@ -123,13 +123,12 @@ export default function useUser() {
|
|
|
123
123
|
|
|
124
124
|
function getUsers({
|
|
125
125
|
status = "active",
|
|
126
|
-
type = "",
|
|
127
126
|
search = "",
|
|
128
127
|
page = 1,
|
|
129
128
|
} = {}) {
|
|
130
129
|
return useNuxtApp().$api<Record<string, any>>("/api/users", {
|
|
131
130
|
method: "GET",
|
|
132
|
-
query: { status, search, page
|
|
131
|
+
query: { status, search, page },
|
|
133
132
|
});
|
|
134
133
|
}
|
|
135
134
|
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.9",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"publishConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@iconify/vue": "^5.0.0",
|
|
33
33
|
"@mdi/font": "^7.4.47",
|
|
34
34
|
"@types/qrcode": "^1.5.6",
|
|
35
|
-
"ckeditor5": "
|
|
35
|
+
"ckeditor5": "47.4.0",
|
|
36
36
|
"html2pdf.js": "^0.10.2",
|
|
37
37
|
"html5-qrcode": "^2.3.8",
|
|
38
38
|
"moment-timezone": "^0.6.0",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"zod": "^3.24.2"
|
|
47
47
|
},
|
|
48
48
|
"resolutions": {
|
|
49
|
+
"lodash-es": "4.17.21",
|
|
49
50
|
"rollup-plugin-visualizer": "6.0.11"
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid>
|
|
3
|
+
<HidEnabledGate
|
|
4
|
+
:site="siteId"
|
|
5
|
+
:org="orgId"
|
|
6
|
+
message="Enable HID as a service for this site before viewing access logs."
|
|
7
|
+
>
|
|
8
|
+
<HidAccessLogDashboard :site="siteId" />
|
|
9
|
+
</HidEnabledGate>
|
|
10
|
+
</v-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
definePageMeta({
|
|
15
|
+
layout: "default",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const siteId = computed(() => String(route.params.site ?? ""));
|
|
20
|
+
const orgId = computed(() => String(route.params.org ?? ""));
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid>
|
|
3
|
+
<HidEnabledGate
|
|
4
|
+
:site="siteId"
|
|
5
|
+
:org="orgId"
|
|
6
|
+
message="Enable HID as a service for this site before managing HID administrators."
|
|
7
|
+
>
|
|
8
|
+
<HidUserEnrollment :site="siteId" identity-type="admin" />
|
|
9
|
+
</HidEnabledGate>
|
|
10
|
+
</v-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
definePageMeta({
|
|
15
|
+
layout: "default",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const siteId = computed(() => String(route.params.site ?? ""));
|
|
20
|
+
const orgId = computed(() => String(route.params.org ?? ""));
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid>
|
|
3
|
+
<HidEnabledGate
|
|
4
|
+
:site="siteId"
|
|
5
|
+
:org="orgId"
|
|
6
|
+
message="Enable HID as a service for this site before managing HID readers."
|
|
7
|
+
>
|
|
8
|
+
<HidReaderManagement :site="siteId" />
|
|
9
|
+
</HidEnabledGate>
|
|
10
|
+
</v-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
definePageMeta({
|
|
15
|
+
layout: "default",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const siteId = computed(() => String(route.params.site ?? ""));
|
|
20
|
+
const orgId = computed(() => String(route.params.org ?? ""));
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid>
|
|
3
|
+
<HidEnabledGate
|
|
4
|
+
:site="siteId"
|
|
5
|
+
:org="orgId"
|
|
6
|
+
message="Enable HID as a service for this site before managing HID users."
|
|
7
|
+
>
|
|
8
|
+
<HidUserEnrollment :site="siteId" />
|
|
9
|
+
</HidEnabledGate>
|
|
10
|
+
</v-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
definePageMeta({
|
|
15
|
+
layout: "default",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const siteId = computed(() => String(route.params.site ?? ""));
|
|
20
|
+
const orgId = computed(() => String(route.params.org ?? ""));
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid>
|
|
3
|
+
<HidEnabledGate
|
|
4
|
+
:site="siteId"
|
|
5
|
+
:org="orgId"
|
|
6
|
+
message="Enable HID as a service for this site before mapping identities."
|
|
7
|
+
>
|
|
8
|
+
<HidIdentityMapping :site="siteId" :org="orgId" />
|
|
9
|
+
</HidEnabledGate>
|
|
10
|
+
</v-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
definePageMeta({
|
|
15
|
+
layout: "default",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const siteId = computed(() => String(route.params.site ?? ""));
|
|
20
|
+
const orgId = computed(() => String(route.params.org ?? ""));
|
|
21
|
+
</script>
|
package/types/local.d.ts
CHANGED
package/types/visitor.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare type TVisitor = {
|
|
|
31
31
|
passKeys?: TPassKeyPayload[];
|
|
32
32
|
checkInRemarks?: string;
|
|
33
33
|
checkOutRemarks?: string;
|
|
34
|
+
createdBy?: string;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
declare type TVisitorType =
|
|
@@ -66,6 +67,7 @@ declare type TVisitorPayload = Pick<
|
|
|
66
67
|
| "passKeys"
|
|
67
68
|
| "checkInRemarks"
|
|
68
69
|
| "checkOutRemarks"
|
|
70
|
+
| "createdBy"
|
|
69
71
|
> & {
|
|
70
72
|
members?: TMemberInfo[];
|
|
71
73
|
};
|
|
@@ -80,8 +82,8 @@ declare type TMemberInfo = {
|
|
|
80
82
|
nric: string;
|
|
81
83
|
visitorPass?: { keyId: string }[];
|
|
82
84
|
passKeys?: TPassKeyPayload[];
|
|
83
|
-
contact: string
|
|
84
|
-
}
|
|
85
|
+
contact: string;
|
|
86
|
+
};
|
|
85
87
|
|
|
86
88
|
declare type TPassKeyPayload = {
|
|
87
89
|
keyId: string;
|