@7365admin1/layer-common 3.1.4-staging.47 → 3.1.4-staging.48
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.
|
@@ -309,7 +309,7 @@
|
|
|
309
309
|
Close
|
|
310
310
|
</v-btn>
|
|
311
311
|
</v-col>
|
|
312
|
-
<v-col cols="6" class="pa-0"
|
|
312
|
+
<v-col cols="6" class="pa-0">
|
|
313
313
|
<v-menu>
|
|
314
314
|
<template #activator="{ props }">
|
|
315
315
|
<v-btn
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
<v-list-item
|
|
337
337
|
:disabled="!isSelectedCardAssignedPhysical"
|
|
338
338
|
@click="emit('replace')"
|
|
339
|
-
v-if="canReplaceAccessCard && isSelectedCardAssignedPhysical"
|
|
339
|
+
v-if="(canUpdate || canReplaceAccessCard) && isSelectedCardAssignedPhysical"
|
|
340
340
|
>
|
|
341
341
|
<v-list-item-title class="text-subtitle-2">
|
|
342
342
|
Replace Card
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
</v-row>
|
|
50
50
|
</v-col>
|
|
51
51
|
|
|
52
|
-
<v-col cols="12">
|
|
52
|
+
<v-col cols="12" v-if="canViewAllQrTagging">
|
|
53
53
|
<v-card
|
|
54
54
|
width="100%"
|
|
55
55
|
variant="outlined"
|
|
@@ -196,6 +196,13 @@ definePageMeta({
|
|
|
196
196
|
memberOnly: true,
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
+
const props = defineProps({
|
|
200
|
+
canViewAllQrTagging: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
default: true,
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
|
|
199
206
|
const tableHeaders = [
|
|
200
207
|
{ title: "", key: "selectGenerate", sortable: false, width: "50px" },
|
|
201
208
|
{ title: "Card", key: "cardNo", sortable: false },
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
variant="tonal"
|
|
20
20
|
size="large"
|
|
21
21
|
@click="assignDialog = true"
|
|
22
|
-
v-if="
|
|
22
|
+
v-if="canUpdateAccessCard && canAssignAccessCard"
|
|
23
23
|
>
|
|
24
24
|
Assign to Unit
|
|
25
25
|
</v-btn>
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
</v-row>
|
|
39
39
|
</v-col>
|
|
40
40
|
<!-- Available Card Stats -->
|
|
41
|
-
<v-col cols="12" class="mb-2">
|
|
41
|
+
<v-col cols="12" class="mb-2" v-if="canViewAllCards">
|
|
42
42
|
<AccessCardAvailableStats ref="statsRef" :site-id="siteId" />
|
|
43
43
|
</v-col>
|
|
44
44
|
|
|
45
|
-
<v-col cols="12">
|
|
45
|
+
<v-col cols="12" v-if="canViewAllCards">
|
|
46
46
|
<v-card
|
|
47
47
|
width="100%"
|
|
48
48
|
variant="outlined"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
v-model="previewDialog"
|
|
108
108
|
:unit="selectedCard"
|
|
109
109
|
v-model:selected-card-in-unit="selectedCardInUnit"
|
|
110
|
-
:can-update="
|
|
110
|
+
:can-update="canUpdateAccessCard"
|
|
111
111
|
:can-replace-access-card="canReplaceAccessCard"
|
|
112
112
|
:can-delete-access-card="canDeleteAccessCard"
|
|
113
113
|
:is-selected-card-assigned-physical="isSelectedCardAssignedPhysical"
|
|
@@ -203,6 +203,10 @@ const props = defineProps({
|
|
|
203
203
|
type: Boolean,
|
|
204
204
|
default: true,
|
|
205
205
|
},
|
|
206
|
+
canUpdateAccessCard: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: true,
|
|
209
|
+
},
|
|
206
210
|
canDeleteAccessCard: {
|
|
207
211
|
type: Boolean,
|
|
208
212
|
default: true,
|
|
@@ -215,6 +219,10 @@ const props = defineProps({
|
|
|
215
219
|
type: Boolean,
|
|
216
220
|
default: true,
|
|
217
221
|
},
|
|
222
|
+
canViewAllCards: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
default: true,
|
|
225
|
+
},
|
|
218
226
|
});
|
|
219
227
|
|
|
220
228
|
// const { headerSearch } = useLocal();
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<template v-slot:activator="{ props }">
|
|
20
20
|
<v-list-item v-bind="props" density="compact">
|
|
21
21
|
<span class="text-capitalize">
|
|
22
|
-
{{ String(permissionKey)
|
|
22
|
+
{{ formatResourceLabel(String(permissionKey)) }}
|
|
23
23
|
</span>
|
|
24
24
|
|
|
25
25
|
<template #prepend>
|
|
@@ -89,6 +89,13 @@ const props = defineProps({
|
|
|
89
89
|
},
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
+
const resourceLabels: Record<string, string> = {
|
|
93
|
+
"access-card-mgmt": "Access Mgmt",
|
|
94
|
+
};
|
|
95
|
+
function formatResourceLabel(key: string): string {
|
|
96
|
+
return resourceLabels[key] ?? key.replace(/-/g, " ");
|
|
97
|
+
}
|
|
98
|
+
|
|
92
99
|
const selectedActionCount = (resource: string) => {
|
|
93
100
|
return selected.value.filter((permission) => permission.startsWith(resource))
|
|
94
101
|
.length;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<span
|
|
78
78
|
class="text-capitalize text-subtitle-2 font-weight-medium"
|
|
79
79
|
>
|
|
80
|
-
{{ String(resourceKey)
|
|
80
|
+
{{ formatResourceLabel(String(resourceKey)) }}
|
|
81
81
|
</span>
|
|
82
82
|
</v-list-item-title>
|
|
83
83
|
<template #append>
|
|
@@ -231,6 +231,14 @@ const permState = shallowRef({
|
|
|
231
231
|
enabled: [] as string[],
|
|
232
232
|
})
|
|
233
233
|
|
|
234
|
+
const resourceLabels: Record<string, string> = {
|
|
235
|
+
"access-card-mgmt": "Access Mgmt",
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
function formatResourceLabel(key: string): string {
|
|
239
|
+
return resourceLabels[key] ?? key.replace(/-/g, " ");
|
|
240
|
+
}
|
|
241
|
+
|
|
234
242
|
function isCategoryEnabled(resource: string) {
|
|
235
243
|
return permState.value.enabled.includes(resource)
|
|
236
244
|
}
|