@7365admin1/layer-common 1.11.20 → 1.11.22
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 +117 -56
- package/components/AreaMain.vue +10 -8
- package/components/BulletinBoardView.vue +158 -16
- package/components/OvernightParkingAvailability.vue +286 -151
- package/components/ScanVisitorQRCode.vue +157 -0
- package/components/SiteSettings.vue +303 -243
- package/components/TableMain.vue +72 -21
- package/components/UnitMain.vue +10 -8
- package/components/VisitorForm.vue +1 -1
- package/components/VisitorManagement.vue +598 -229
- package/composables/useOrg.ts +16 -0
- package/composables/useVisitor.ts +12 -0
- package/package.json +1 -1
- package/plugins/html5-qrcode.client.js +8 -0
- package/types/overnight-parking.d.ts +3 -2
package/components/TableMain.vue
CHANGED
|
@@ -1,29 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-row no-gutters>
|
|
3
3
|
<!-- Top Actions -->
|
|
4
|
-
<v-col cols="12" class="mb-2" v-if="
|
|
4
|
+
<v-col cols="12" class="mb-2" v-if="canCreate || $slots.actions">
|
|
5
5
|
<v-row no-gutters>
|
|
6
6
|
<slot name="actions">
|
|
7
7
|
<v-col cols="12">
|
|
8
|
-
<v-row no-gutters
|
|
9
|
-
<v-btn
|
|
10
|
-
|
|
8
|
+
<v-row no-gutters>
|
|
9
|
+
<v-btn
|
|
10
|
+
v-if="canCreate"
|
|
11
|
+
class="text-none"
|
|
12
|
+
rounded="pill"
|
|
13
|
+
variant="tonal"
|
|
14
|
+
size="large"
|
|
15
|
+
@click="emits('create')"
|
|
16
|
+
>
|
|
11
17
|
{{ createLabel }}
|
|
12
18
|
</v-btn>
|
|
13
|
-
<v-text-field
|
|
14
|
-
|
|
19
|
+
<v-text-field
|
|
20
|
+
v-if="canSearch"
|
|
21
|
+
v-model="searchInput"
|
|
22
|
+
density="compact"
|
|
23
|
+
placeholder="Search"
|
|
24
|
+
clearable
|
|
25
|
+
max-width="300"
|
|
26
|
+
append-inner-icon="mdi-magnify"
|
|
27
|
+
hide-details
|
|
28
|
+
/>
|
|
29
|
+
<v-btn
|
|
30
|
+
v-if="canScanVisitorQRCode"
|
|
31
|
+
text="Scan QR Code"
|
|
32
|
+
class="text-none ml-2"
|
|
33
|
+
rounded="pill"
|
|
34
|
+
variant="tonal"
|
|
35
|
+
size="large"
|
|
36
|
+
@click="emits('scan')"
|
|
37
|
+
/>
|
|
15
38
|
</v-row>
|
|
16
39
|
</v-col>
|
|
17
40
|
</slot>
|
|
18
|
-
|
|
19
41
|
</v-row>
|
|
20
42
|
</v-col>
|
|
21
43
|
|
|
22
44
|
<!-- Table Card -->
|
|
23
45
|
<v-col cols="12">
|
|
24
|
-
<v-card
|
|
46
|
+
<v-card
|
|
47
|
+
width="100%"
|
|
48
|
+
variant="outlined"
|
|
49
|
+
border="thin"
|
|
50
|
+
rounded="lg"
|
|
51
|
+
:loading="loading"
|
|
52
|
+
>
|
|
25
53
|
<!-- Toolbar -->
|
|
26
|
-
<v-toolbar
|
|
54
|
+
<v-toolbar
|
|
55
|
+
density="compact"
|
|
56
|
+
color="grey-lighten-4"
|
|
57
|
+
:extension-height="extensionHeight"
|
|
58
|
+
>
|
|
27
59
|
<template #prepend>
|
|
28
60
|
<v-btn fab icon density="comfortable" @click="emits('refresh')">
|
|
29
61
|
<v-icon>mdi-refresh</v-icon>
|
|
@@ -36,8 +68,11 @@
|
|
|
36
68
|
<span class="mr-2 text-caption text-fontgray">
|
|
37
69
|
{{ pageRange }}
|
|
38
70
|
</span>
|
|
39
|
-
<local-pagination
|
|
40
|
-
|
|
71
|
+
<local-pagination
|
|
72
|
+
v-model="internalPage"
|
|
73
|
+
:length="pages"
|
|
74
|
+
@update:value="emits('update:page', internalPage)"
|
|
75
|
+
/>
|
|
41
76
|
</v-row>
|
|
42
77
|
</template>
|
|
43
78
|
|
|
@@ -46,12 +81,18 @@
|
|
|
46
81
|
</template>
|
|
47
82
|
</v-toolbar>
|
|
48
83
|
|
|
49
|
-
|
|
50
84
|
<!-- Data Table -->
|
|
51
|
-
<v-data-table
|
|
52
|
-
|
|
85
|
+
<v-data-table
|
|
86
|
+
:headers="headers"
|
|
87
|
+
:items="items"
|
|
88
|
+
:item-value="itemValue"
|
|
89
|
+
:items-per-page="itemsPerPage"
|
|
90
|
+
fixed-header
|
|
91
|
+
hide-default-footer
|
|
92
|
+
:hide-default-header="!showHeader"
|
|
53
93
|
@click:row="(_: any, data: any) => emits('row-click', data)"
|
|
54
|
-
:style="`max-height: calc(100vh - (${offset}px))`"
|
|
94
|
+
:style="`max-height: calc(100vh - (${offset}px))`"
|
|
95
|
+
>
|
|
55
96
|
<template v-for="(_, slotName) in $slots" #[slotName]="slotProps">
|
|
56
97
|
<slot :name="slotName" v-bind="slotProps" />
|
|
57
98
|
</template>
|
|
@@ -80,6 +121,10 @@ const props = defineProps({
|
|
|
80
121
|
type: Boolean,
|
|
81
122
|
default: false,
|
|
82
123
|
},
|
|
124
|
+
canScanVisitorQRCode: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false,
|
|
127
|
+
},
|
|
83
128
|
canSearch: {
|
|
84
129
|
type: Boolean,
|
|
85
130
|
default: false,
|
|
@@ -110,21 +155,27 @@ const props = defineProps({
|
|
|
110
155
|
},
|
|
111
156
|
showHeader: {
|
|
112
157
|
type: Boolean,
|
|
113
|
-
default: false
|
|
158
|
+
default: false,
|
|
114
159
|
},
|
|
115
160
|
extensionHeight: {
|
|
116
161
|
type: Number,
|
|
117
|
-
default: 50
|
|
162
|
+
default: 50,
|
|
118
163
|
},
|
|
119
164
|
offset: {
|
|
120
165
|
type: Number,
|
|
121
|
-
default: 200
|
|
122
|
-
}
|
|
166
|
+
default: 200,
|
|
167
|
+
},
|
|
123
168
|
});
|
|
124
169
|
|
|
125
|
-
const emits = defineEmits([
|
|
170
|
+
const emits = defineEmits([
|
|
171
|
+
"create",
|
|
172
|
+
"scan",
|
|
173
|
+
"refresh",
|
|
174
|
+
"update:page",
|
|
175
|
+
"row-click",
|
|
176
|
+
]);
|
|
126
177
|
|
|
127
|
-
const searchInput = defineModel(
|
|
178
|
+
const searchInput = defineModel("search", { default: "" });
|
|
128
179
|
|
|
129
180
|
const internalPage = ref(props.page);
|
|
130
181
|
watch(
|
package/components/UnitMain.vue
CHANGED
|
@@ -209,7 +209,6 @@
|
|
|
209
209
|
</template>
|
|
210
210
|
|
|
211
211
|
<script setup lang="ts">
|
|
212
|
-
import { useUnitPermission } from "../composables/useUnitPermission";
|
|
213
212
|
import useUnits from "../composables/useUnits";
|
|
214
213
|
import useUtils from "../composables/useUtils";
|
|
215
214
|
|
|
@@ -217,6 +216,11 @@ const props = defineProps({
|
|
|
217
216
|
orgId: { type: String, default: "" },
|
|
218
217
|
site: { type: String, default: "" },
|
|
219
218
|
serviceType: { type: String, default: "", required: true },
|
|
219
|
+
canViewUnits: { type: Boolean, default: true },
|
|
220
|
+
canCreateUnit: { type: Boolean, default: false },
|
|
221
|
+
canUpdateUnit: { type: Boolean, default: false },
|
|
222
|
+
canDeleteUnit: { type: Boolean, default: false },
|
|
223
|
+
canImportUnit: { type: Boolean, default: false },
|
|
220
224
|
});
|
|
221
225
|
|
|
222
226
|
const items = ref<Array<Record<string, any>>>([]);
|
|
@@ -299,13 +303,11 @@ function showMessage(msg: string, color: string = "error") {
|
|
|
299
303
|
messageSnackbar.value = true;
|
|
300
304
|
}
|
|
301
305
|
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
canImportUnit,
|
|
308
|
-
} = useUnitPermission();
|
|
306
|
+
const canViewUnits = computed(() => props.canViewUnits);
|
|
307
|
+
const canCreateUnit = computed(() => props.canCreateUnit);
|
|
308
|
+
const canUpdateUnit = computed(() => props.canUpdateUnit);
|
|
309
|
+
const canDeleteUnit = computed(() => props.canDeleteUnit);
|
|
310
|
+
const canImportUnit = computed(() => props.canImportUnit);
|
|
309
311
|
|
|
310
312
|
async function handleDownloadExcel() {
|
|
311
313
|
try {
|
|
@@ -1012,7 +1012,7 @@ const membersFieldIncomplete = computed(() => {
|
|
|
1012
1012
|
});
|
|
1013
1013
|
|
|
1014
1014
|
onMounted(() => {
|
|
1015
|
-
contractorStep.value =
|
|
1015
|
+
contractorStep.value = 1;
|
|
1016
1016
|
currentAutofillSource.value = null;
|
|
1017
1017
|
|
|
1018
1018
|
if (prop.mode === 'register' && prop.visitorData) {
|