@7365admin1/layer-common 1.8.0
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.editorconfig +12 -0
- package/.github/workflows/main.yml +17 -0
- package/.github/workflows/publish.yml +39 -0
- package/.nuxtrc +1 -0
- package/.playground/app.vue +41 -0
- package/.playground/eslint.config.mjs +6 -0
- package/.playground/nuxt.config.ts +22 -0
- package/.playground/pages/feedback.vue +30 -0
- package/CHANGELOG.md +263 -0
- package/README.md +73 -0
- package/app.vue +3 -0
- package/components/AccessCardAddForm.vue +363 -0
- package/components/AccessManagement.vue +420 -0
- package/components/Avatar/Main.vue +68 -0
- package/components/BillingMain.vue +66 -0
- package/components/BtnUploadFile.vue +139 -0
- package/components/BuildingForm.vue +303 -0
- package/components/BuildingManagement/buildings.vue +335 -0
- package/components/BuildingManagement/units.vue +350 -0
- package/components/BuildingUnitFormAdd.vue +441 -0
- package/components/BuildingUnitFormEdit.vue +429 -0
- package/components/CameraForm.vue +264 -0
- package/components/CameraMain.vue +352 -0
- package/components/Card/DeleteConfirmation.vue +51 -0
- package/components/Card/MemberInfoSummary.vue +44 -0
- package/components/Card/Toggle.vue +25 -0
- package/components/Chat/Bubbles.vue +53 -0
- package/components/Chat/Information.vue +416 -0
- package/components/Chat/ListCard.vue +62 -0
- package/components/Chat/Message.vue +158 -0
- package/components/Chat/Navigation.vue +150 -0
- package/components/ConfirmDialog.vue +66 -0
- package/components/Container/Standard.vue +33 -0
- package/components/DashboardPlaceholder.vue +1524 -0
- package/components/Dialog/DeleteConfirmation.vue +51 -0
- package/components/Dialog/ReplaceAutofillPrompt.vue +49 -0
- package/components/Dialog/UpdateMoreAction.vue +103 -0
- package/components/DocumentForm.vue +187 -0
- package/components/DocumentManagement.vue +376 -0
- package/components/Editor.vue +95 -0
- package/components/EntryPassMain.vue +518 -0
- package/components/Feedback/Form.vue +173 -0
- package/components/FeedbackDetail.vue +599 -0
- package/components/FeedbackMain.vue +588 -0
- package/components/FormDialog.vue +65 -0
- package/components/ImageCarousel.vue +138 -0
- package/components/Input/Date.vue +177 -0
- package/components/Input/DateTimePicker.vue +131 -0
- package/components/Input/File.vue +236 -0
- package/components/Input/FileV2.vue +234 -0
- package/components/Input/InputPhoneNumberV2.vue +164 -0
- package/components/Input/ListGroupSelection.vue +96 -0
- package/components/Input/NRICNumber.vue +53 -0
- package/components/Input/NewDate.vue +123 -0
- package/components/Input/Number.vue +124 -0
- package/components/Input/Password.vue +22 -0
- package/components/Input/PhoneNumber.vue +188 -0
- package/components/Input/VehicleNumber.vue +49 -0
- package/components/InputLabel.vue +22 -0
- package/components/InvitationForm.vue +359 -0
- package/components/InvitationMain.vue +310 -0
- package/components/Layout/Header.vue +129 -0
- package/components/Layout/NavigationDrawer.vue +44 -0
- package/components/ListItem.vue +35 -0
- package/components/ListView.vue +87 -0
- package/components/LocalPagination.vue +31 -0
- package/components/MemberMain.vue +459 -0
- package/components/NFC/NFCPatrolReportMain.vue +591 -0
- package/components/NFC/NFCPatrolRouteForm.vue +596 -0
- package/components/NFC/NFCPatrolRouteMain.vue +539 -0
- package/components/NFC/NFCTagForm.vue +236 -0
- package/components/NFC/NFCTagMain.vue +337 -0
- package/components/NFC/PatrolSettings.vue +130 -0
- package/components/NavigationItem.vue +83 -0
- package/components/NumberSettingField.vue +107 -0
- package/components/OnlineFormConfigurationForm.vue +290 -0
- package/components/OnlineFormsConfiguration.vue +429 -0
- package/components/PeopleForm.vue +452 -0
- package/components/PlaceholderComponent.vue +34 -0
- package/components/RolePermissionFormCreate.vue +161 -0
- package/components/RolePermissionFormPreviewUpdate.vue +183 -0
- package/components/RolePermissionMain.vue +361 -0
- package/components/SearchVehicleNumberUser.vue +91 -0
- package/components/ServiceProviderFormCreate.vue +154 -0
- package/components/ServiceProviderMain.vue +547 -0
- package/components/SignaturePad.vue +73 -0
- package/components/Snackbar.vue +23 -0
- package/components/SpecificAttr.vue +53 -0
- package/components/SupplyManagement.vue +292 -0
- package/components/SwitchContext.vue +108 -0
- package/components/TableList.vue +150 -0
- package/components/TableListSecondary.vue +164 -0
- package/components/TableMain.vue +142 -0
- package/components/TableWithButton.vue +94 -0
- package/components/VehicleUpdateMoreAction.vue +84 -0
- package/components/VideoPlayer.vue +125 -0
- package/components/VisitorForm.vue +659 -0
- package/components/VisitorFormSelection.vue +53 -0
- package/components/VisitorManagement.vue +490 -0
- package/components/WorkOrder/Create.vue +284 -0
- package/components/WorkOrder/Detail.vue +71 -0
- package/components/WorkOrder/ListView.vue +96 -0
- package/components/WorkOrder/Main.vue +489 -0
- package/components/Workorder.vue +1 -0
- package/composables/useAddress.ts +107 -0
- package/composables/useBuilding.ts +250 -0
- package/composables/useBuildingUnit.ts +116 -0
- package/composables/useCard.ts +46 -0
- package/composables/useCommonPermission.ts +207 -0
- package/composables/useCustomer.ts +113 -0
- package/composables/useCustomerSite.ts +56 -0
- package/composables/useDashboard.ts +31 -0
- package/composables/useDashboardData.ts +425 -0
- package/composables/useDocument.ts +57 -0
- package/composables/useFacility.ts +246 -0
- package/composables/useFeedback.ts +119 -0
- package/composables/useFile.ts +55 -0
- package/composables/useInvoice.ts +18 -0
- package/composables/useLocal.ts +131 -0
- package/composables/useLocalAuth.ts +137 -0
- package/composables/useLocalSetup.ts +13 -0
- package/composables/useMember.ts +111 -0
- package/composables/useNFCPatrolRoute.ts +77 -0
- package/composables/useNFCPatrolSettings.ts +19 -0
- package/composables/useNFCPatrolTag.ts +53 -0
- package/composables/useOnlineForm.ts +67 -0
- package/composables/useOrg.ts +129 -0
- package/composables/usePDFDownload.ts +25 -0
- package/composables/usePaymentMethod.ts +101 -0
- package/composables/usePeople.ts +81 -0
- package/composables/usePermission.ts +54 -0
- package/composables/usePhoneCountries.ts +561 -0
- package/composables/usePrice.ts +15 -0
- package/composables/usePromoCode.ts +36 -0
- package/composables/useRecapPermission.ts +26 -0
- package/composables/useRole.ts +104 -0
- package/composables/useSecurityUtils.ts +18 -0
- package/composables/useServiceProvider.ts +224 -0
- package/composables/useSite.ts +109 -0
- package/composables/useSiteEntryPassSettings.ts +46 -0
- package/composables/useSiteSettings.ts +123 -0
- package/composables/useSubscription.ts +150 -0
- package/composables/useUser.ts +132 -0
- package/composables/useUtils.ts +445 -0
- package/composables/useVerification.ts +34 -0
- package/composables/useVisitor.ts +120 -0
- package/composables/useWorkOrder.ts +85 -0
- package/error.vue +41 -0
- package/layouts/plain.vue +7 -0
- package/middleware/01.auth.ts +20 -0
- package/middleware/02.org.ts +21 -0
- package/middleware/03.customer.ts +13 -0
- package/middleware/member.ts +4 -0
- package/nuxt.config.ts +54 -0
- package/package.json +39 -0
- package/pages/index.vue +3 -0
- package/pages/payment-method-linked.vue +31 -0
- package/pages/require-customer.vue +56 -0
- package/pages/require-organization-membership.vue +47 -0
- package/pages/unauthorized.vue +29 -0
- package/plugins/API.ts +21 -0
- package/plugins/iconify.client.ts +5 -0
- package/plugins/secure-member.client.ts +86 -0
- package/plugins/vuetify.ts +62 -0
- package/public/bg-camera.jpg +0 -0
- package/public/bg-city.jpg +0 -0
- package/public/bg-condo.jpg +0 -0
- package/public/images/icons/delete-icon.png +0 -0
- package/public/sprite.svg +1 -0
- package/tsconfig.json +3 -0
- package/types/address.d.ts +13 -0
- package/types/building.d.ts +27 -0
- package/types/camera.d.ts +31 -0
- package/types/card.d.ts +22 -0
- package/types/customer.d.ts +27 -0
- package/types/document.d.ts +6 -0
- package/types/feedback.d.ts +68 -0
- package/types/local.d.ts +74 -0
- package/types/member.d.ts +21 -0
- package/types/online-form.d.ts +15 -0
- package/types/org.d.ts +13 -0
- package/types/people.d.ts +24 -0
- package/types/permission.d.ts +25 -0
- package/types/phone-number.d.ts +10 -0
- package/types/price.d.ts +17 -0
- package/types/promo-code.d.ts +19 -0
- package/types/role.d.ts +11 -0
- package/types/select.d.ts +4 -0
- package/types/service-provider.d.ts +15 -0
- package/types/site.d.ts +20 -0
- package/types/subscription.d.ts +23 -0
- package/types/user.d.ts +19 -0
- package/types/verification.d.ts +20 -0
- package/types/visitor.d.ts +42 -0
- package/types/work-order.d.ts +42 -0
- package/utils/phoneMasks.ts +1703 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-card width="100%">
|
|
3
|
+
<v-toolbar>
|
|
4
|
+
<v-row no-gutters class="fill-height px-6" align="center">
|
|
5
|
+
<span class="font-weight-bold text-h5 text-capitalize">
|
|
6
|
+
{{ prop.mode }} Access Card
|
|
7
|
+
</span>
|
|
8
|
+
</v-row>
|
|
9
|
+
</v-toolbar>
|
|
10
|
+
<v-card-text style="max-height: 100vh; overflow-y: auto" class="pa-0">
|
|
11
|
+
<v-form v-model="validForm" :disabled="disable">
|
|
12
|
+
<v-row no-gutters class="px-6 pt-4">
|
|
13
|
+
<v-col cols="12" class="px-1">
|
|
14
|
+
<InputLabel
|
|
15
|
+
class="text-capitalize font-weight-bold"
|
|
16
|
+
title="Types of Access Card"
|
|
17
|
+
required
|
|
18
|
+
/>
|
|
19
|
+
<v-select
|
|
20
|
+
v-model.number="card.accessCardType"
|
|
21
|
+
:items="accessCardTypes"
|
|
22
|
+
density="comfortable"
|
|
23
|
+
:rules="[requiredRule]"
|
|
24
|
+
type="text"
|
|
25
|
+
></v-select>
|
|
26
|
+
</v-col>
|
|
27
|
+
<v-col cols="12" class="px-1 pb-5">
|
|
28
|
+
<InputLabel
|
|
29
|
+
class="text-capitalize font-weight-bold"
|
|
30
|
+
:title="`Card No (${cardNoMaxLength} digits)`"
|
|
31
|
+
required
|
|
32
|
+
/>
|
|
33
|
+
<v-text-field
|
|
34
|
+
v-model="card.cardNumber"
|
|
35
|
+
density="compact"
|
|
36
|
+
hide-details
|
|
37
|
+
:rules="[requiredRule]"
|
|
38
|
+
maxlength="10"
|
|
39
|
+
type="number"
|
|
40
|
+
hide-spin-buttons
|
|
41
|
+
>
|
|
42
|
+
</v-text-field>
|
|
43
|
+
</v-col>
|
|
44
|
+
<v-col cols="12" class="px-1">
|
|
45
|
+
<InputLabel
|
|
46
|
+
class="text-capitalize font-weight-bold"
|
|
47
|
+
title="Start Date"
|
|
48
|
+
required
|
|
49
|
+
/>
|
|
50
|
+
<InputDateTimePicker
|
|
51
|
+
ref="startDateRef"
|
|
52
|
+
v-model="card.startDate"
|
|
53
|
+
placeholder="Start Date"
|
|
54
|
+
:rules="[requiredRule]"
|
|
55
|
+
/>
|
|
56
|
+
</v-col>
|
|
57
|
+
<v-col cols="12" class="px-1 pb-4">
|
|
58
|
+
<InputLabel
|
|
59
|
+
class="text-capitalize font-weight-bold"
|
|
60
|
+
title="End Date"
|
|
61
|
+
required
|
|
62
|
+
/>
|
|
63
|
+
<InputDateTimePicker
|
|
64
|
+
ref="endDateRef"
|
|
65
|
+
v-model="card.endDate"
|
|
66
|
+
placeholder="End Date"
|
|
67
|
+
:rules="[requiredRule]"
|
|
68
|
+
/>
|
|
69
|
+
</v-col>
|
|
70
|
+
<v-divider />
|
|
71
|
+
<v-row class="py-8 px-0">
|
|
72
|
+
<v-col cols="12">
|
|
73
|
+
<InputLabel
|
|
74
|
+
class="text-capitalize font-weight-bold"
|
|
75
|
+
title="Doors Location"
|
|
76
|
+
required
|
|
77
|
+
/>
|
|
78
|
+
<v-select
|
|
79
|
+
v-model="card.door"
|
|
80
|
+
density="compact"
|
|
81
|
+
:items="accessLevelItems"
|
|
82
|
+
item-title="name"
|
|
83
|
+
item-value="no"
|
|
84
|
+
hide-details
|
|
85
|
+
:rules="[requiredRule]"
|
|
86
|
+
>
|
|
87
|
+
</v-select>
|
|
88
|
+
</v-col>
|
|
89
|
+
<v-col cols="12">
|
|
90
|
+
<InputLabel
|
|
91
|
+
class="text-capitalize font-weight-bold"
|
|
92
|
+
title="Access Group"
|
|
93
|
+
required
|
|
94
|
+
/>
|
|
95
|
+
<v-select
|
|
96
|
+
v-model="card.accessGroup"
|
|
97
|
+
density="compact"
|
|
98
|
+
:items="accessGroupItems"
|
|
99
|
+
hide-details
|
|
100
|
+
:rules="[requiredRule]"
|
|
101
|
+
multiple
|
|
102
|
+
>
|
|
103
|
+
</v-select>
|
|
104
|
+
</v-col>
|
|
105
|
+
<v-col cols="12">
|
|
106
|
+
<InputLabel
|
|
107
|
+
class="text-capitalize font-weight-bold"
|
|
108
|
+
title="Card Type"
|
|
109
|
+
required
|
|
110
|
+
/>
|
|
111
|
+
<v-select
|
|
112
|
+
v-model="card.cardType"
|
|
113
|
+
density="compact"
|
|
114
|
+
:items="cardTypeItems"
|
|
115
|
+
hide-details
|
|
116
|
+
:rules="[requiredRule]"
|
|
117
|
+
item-title="name"
|
|
118
|
+
item-value="value"
|
|
119
|
+
>
|
|
120
|
+
</v-select>
|
|
121
|
+
</v-col>
|
|
122
|
+
<v-col cols="12">
|
|
123
|
+
<InputLabel
|
|
124
|
+
class="text-capitalize font-weight-bold"
|
|
125
|
+
:title="`Pin No (${cardPinMaxLength} digits)`"
|
|
126
|
+
required
|
|
127
|
+
/>
|
|
128
|
+
<v-text-field
|
|
129
|
+
v-model="card.pinNo"
|
|
130
|
+
density="compact"
|
|
131
|
+
hide-details
|
|
132
|
+
:rules="[requiredRule]"
|
|
133
|
+
maxlength="10"
|
|
134
|
+
type="number"
|
|
135
|
+
hide-spin-buttons
|
|
136
|
+
>
|
|
137
|
+
</v-text-field>
|
|
138
|
+
</v-col>
|
|
139
|
+
<v-col cols="12" class="pt-5">
|
|
140
|
+
<v-btn
|
|
141
|
+
block
|
|
142
|
+
color="primary"
|
|
143
|
+
variant="text"
|
|
144
|
+
class="text-none font-weight-bold"
|
|
145
|
+
text="Use as lift Card"
|
|
146
|
+
@click="card.useAsLiftCard = !card.useAsLiftCard"
|
|
147
|
+
></v-btn>
|
|
148
|
+
</v-col>
|
|
149
|
+
<v-col cols="12" v-if="card.useAsLiftCard">
|
|
150
|
+
<InputLabel
|
|
151
|
+
class="text-capitalize font-weight-bold"
|
|
152
|
+
title="Lift Access Label"
|
|
153
|
+
:required="card.useAsLiftCard"
|
|
154
|
+
/>
|
|
155
|
+
<v-select
|
|
156
|
+
v-model="card.liftAccessLevel"
|
|
157
|
+
density="compact"
|
|
158
|
+
:items="liftAccessLevelItems"
|
|
159
|
+
hide-details
|
|
160
|
+
:rules="card.useAsLiftCard ? [requiredRule] : []"
|
|
161
|
+
item-title="name"
|
|
162
|
+
item-value="value"
|
|
163
|
+
/>
|
|
164
|
+
</v-col>
|
|
165
|
+
<v-col cols="12">
|
|
166
|
+
<div
|
|
167
|
+
class="d-flex justify-space-between align-center rounded px-0"
|
|
168
|
+
>
|
|
169
|
+
<span class="d-flex align-center"
|
|
170
|
+
>Activate
|
|
171
|
+
<v-checkbox
|
|
172
|
+
v-model="card.isActivate"
|
|
173
|
+
label="Yes"
|
|
174
|
+
class="d-flex align-center"
|
|
175
|
+
></v-checkbox
|
|
176
|
+
></span>
|
|
177
|
+
<span class="d-flex align-center">
|
|
178
|
+
Anti Pass Back
|
|
179
|
+
<v-icon class="ml-1" color="grey" size="small"
|
|
180
|
+
>mdi-help-circle</v-icon
|
|
181
|
+
>
|
|
182
|
+
<v-checkbox
|
|
183
|
+
v-model="card.isAntiPassBack"
|
|
184
|
+
label="Yes"
|
|
185
|
+
class="d-flex align-center"
|
|
186
|
+
></v-checkbox>
|
|
187
|
+
</span>
|
|
188
|
+
</div>
|
|
189
|
+
</v-col>
|
|
190
|
+
</v-row>
|
|
191
|
+
</v-row>
|
|
192
|
+
</v-form>
|
|
193
|
+
</v-card-text>
|
|
194
|
+
<v-toolbar density="compact">
|
|
195
|
+
<v-row no-gutters>
|
|
196
|
+
<v-col cols="6">
|
|
197
|
+
<v-btn
|
|
198
|
+
tile
|
|
199
|
+
block
|
|
200
|
+
variant="text"
|
|
201
|
+
class="text-none"
|
|
202
|
+
size="48"
|
|
203
|
+
@click="cancel"
|
|
204
|
+
:disabled="disable"
|
|
205
|
+
>
|
|
206
|
+
Cancel
|
|
207
|
+
</v-btn>
|
|
208
|
+
</v-col>
|
|
209
|
+
|
|
210
|
+
<v-col cols="6">
|
|
211
|
+
<v-btn
|
|
212
|
+
tile
|
|
213
|
+
block
|
|
214
|
+
variant="flat"
|
|
215
|
+
color="black"
|
|
216
|
+
class="text-none"
|
|
217
|
+
size="48"
|
|
218
|
+
:disabled="!validForm || disable"
|
|
219
|
+
@click="submit"
|
|
220
|
+
:loading="disable"
|
|
221
|
+
>
|
|
222
|
+
Submit
|
|
223
|
+
</v-btn>
|
|
224
|
+
</v-col>
|
|
225
|
+
</v-row>
|
|
226
|
+
</v-toolbar>
|
|
227
|
+
</v-card>
|
|
228
|
+
</template>
|
|
229
|
+
<script setup lang="ts">
|
|
230
|
+
const prop = defineProps({
|
|
231
|
+
mode: {
|
|
232
|
+
type: String,
|
|
233
|
+
default: "add",
|
|
234
|
+
},
|
|
235
|
+
card: {
|
|
236
|
+
type: Object as PropType<TCard>,
|
|
237
|
+
default: () => ({
|
|
238
|
+
name: "",
|
|
239
|
+
accessCardType: "",
|
|
240
|
+
// visitorType: "",
|
|
241
|
+
status: "active",
|
|
242
|
+
}),
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
const { add: _addCard, updateById: _updateCardById } = useCard();
|
|
247
|
+
const emit = defineEmits(["cancel", "success"]);
|
|
248
|
+
|
|
249
|
+
const validForm = ref(false);
|
|
250
|
+
const disable = ref(false);
|
|
251
|
+
const message = ref("");
|
|
252
|
+
|
|
253
|
+
const { requiredRule } = useUtils();
|
|
254
|
+
|
|
255
|
+
const card = ref<Record<string, any>>({
|
|
256
|
+
accessCardType: "",
|
|
257
|
+
type: "door-setup",
|
|
258
|
+
cardNumber: "",
|
|
259
|
+
startDate: "",
|
|
260
|
+
endDate: "",
|
|
261
|
+
door: "",
|
|
262
|
+
accessGroup: [],
|
|
263
|
+
cardType: "",
|
|
264
|
+
pinNo: "",
|
|
265
|
+
isActivate: true,
|
|
266
|
+
isAntiPassBack: false,
|
|
267
|
+
useAsLiftCard: false,
|
|
268
|
+
status: "active",
|
|
269
|
+
liftAccessLevel: "",
|
|
270
|
+
org: "",
|
|
271
|
+
site: "",
|
|
272
|
+
unit: "",
|
|
273
|
+
assign: "",
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
if (prop.mode === "edit") {
|
|
277
|
+
card.value.accessCardType = prop.card.accessCardType;
|
|
278
|
+
card.value.type = prop.card.type;
|
|
279
|
+
card.value.cardNumber = prop.card.cardNumber;
|
|
280
|
+
card.value.startDate = prop.card.startDate;
|
|
281
|
+
card.value.endDate = prop.card.endDate;
|
|
282
|
+
card.value.door = prop.card.door;
|
|
283
|
+
card.value.accessGroup = prop.card.accessGroup;
|
|
284
|
+
card.value.cardType = prop.card.cardType;
|
|
285
|
+
card.value.pinNo = prop.card.pinNo;
|
|
286
|
+
card.value.isActivate = prop.card.isActivate;
|
|
287
|
+
card.value.isAntiPassBack = prop.card.isAntiPassBack;
|
|
288
|
+
card.value.useAsLiftCard = prop.card.useAsLiftCard;
|
|
289
|
+
card.value.status = prop.card.status;
|
|
290
|
+
card.value.liftAccessLevel = prop.card.liftAccessLevel;
|
|
291
|
+
card.value.org = prop.card.org;
|
|
292
|
+
card.value.site = prop.card.site;
|
|
293
|
+
card.value.unit = prop.card.unit;
|
|
294
|
+
card.value.assign = prop.card.assign;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const accessCardTypes = ["Physical Access Card", "Non Physical Access Card"];
|
|
298
|
+
const typeOfVisitors = ["Contractor", "Visitor"];
|
|
299
|
+
|
|
300
|
+
const accessLevelItems = ref<{ name: string; no: string }[]>([
|
|
301
|
+
{ name: "All access", no: "1" },
|
|
302
|
+
]);
|
|
303
|
+
const accessGroupItems = ref(["All Access", "Glass Door 1"]);
|
|
304
|
+
const cardTypeItems = ref([
|
|
305
|
+
{
|
|
306
|
+
name: "Normal - Access Card",
|
|
307
|
+
value: "Normal",
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "Special - Arm/Disarm Card",
|
|
311
|
+
value: "Special",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "Master - Master Card",
|
|
315
|
+
value: "Master",
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "Maintenance - Maintenance Card",
|
|
319
|
+
value: "Maintenance",
|
|
320
|
+
},
|
|
321
|
+
]);
|
|
322
|
+
const cardNoMaxLength = ref(10);
|
|
323
|
+
const cardPinMaxLength = ref(6);
|
|
324
|
+
const startDateRef = ref<HTMLInputElement | null>(null);
|
|
325
|
+
const endDateRef = ref<HTMLInputElement | null>(null);
|
|
326
|
+
const liftAccessLevelItems = ref<{ name: string; no: string }[]>([]);
|
|
327
|
+
|
|
328
|
+
const route = useRoute();
|
|
329
|
+
const siteId = route.params.site as string;
|
|
330
|
+
const orgId = route.params.org as string;
|
|
331
|
+
|
|
332
|
+
function cancel() {
|
|
333
|
+
// createMore.value = false;
|
|
334
|
+
message.value = "";
|
|
335
|
+
emit("cancel");
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
async function submit() {
|
|
339
|
+
disable.value = true;
|
|
340
|
+
try {
|
|
341
|
+
if (prop.mode === "add") {
|
|
342
|
+
const payload = {
|
|
343
|
+
...card.value,
|
|
344
|
+
site: siteId,
|
|
345
|
+
org: orgId,
|
|
346
|
+
};
|
|
347
|
+
await _addCard(payload);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (prop.mode === "edit") {
|
|
351
|
+
const payload = {
|
|
352
|
+
...card.value,
|
|
353
|
+
};
|
|
354
|
+
await _updateCardById(prop.card._id ?? "", payload);
|
|
355
|
+
}
|
|
356
|
+
emit("success");
|
|
357
|
+
} catch (error: any) {
|
|
358
|
+
message.value = error.response?._data?.message || "Failed to create card";
|
|
359
|
+
} finally {
|
|
360
|
+
disable.value = false;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
</script>
|