@feedmepos/mf-order-setting 0.0.77 → 0.0.78
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/dist/{KioskDevicesView-Dgs5_UoK.js → KioskDevicesView-Db2DyKc2.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Do-EH0Hn.js} +3 -3
- package/dist/{KioskSettingView-BUcPNVTc.js → KioskSettingView-D1JaAjmx.js} +3 -3
- package/dist/KioskView-B0jhv4Zp.js +464 -0
- package/dist/OrderSettingsView-BPNN4jOB.js +35883 -0
- package/dist/{app-BIvt4NBq.js → app-DpdLDlVr.js} +1993 -1954
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-B58_jBg3.js → dayjs.min-Cs3D4xiZ.js} +1 -1
- package/dist/frontend/mf-order/src/app.d.ts +16 -0
- package/dist/frontend/mf-order/src/helpers/map.d.ts +12 -1
- package/dist/frontend/mf-order/src/main.d.ts +16 -0
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +28 -0
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +9 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.d.ts +5 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +6 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-CLS-FSH-.js → index-BZL2Hpkn.js} +2 -2
- package/dist/{index-CahsmFL1.js → index-DXkcRRAu.js} +1 -1
- package/dist/lineman-settings.dto-CtRqCjzQ.js +74920 -0
- package/dist/package/entity/booking/booking.do.d.ts +125 -0
- package/dist/package/entity/delivery/delivery.dto.d.ts +25 -0
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +87 -0
- package/dist/package/entity/member/member.dto.d.ts +38 -0
- package/dist/package/entity/order/order.do.d.ts +90 -0
- package/dist/package/entity/order/order.dto.d.ts +198 -0
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +316 -48
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +1131 -209
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +3 -3
- package/dist/package/entity/order-platform/external/menu/external-menu.enum.d.ts +10 -1
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +80 -36
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +190 -83
- package/dist/package/entity/order-platform/external/order/external-order.enum.d.ts +2 -2
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +18 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +13 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +25 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +25 -0
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +2 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +25 -0
- package/dist/style.css +1 -1
- package/package.json +7 -9
- package/src/helpers/map.ts +24 -0
- package/src/locales/en-US.json +4 -0
- package/src/locales/ja-JP.json +4 -0
- package/src/locales/th-TH.json +4 -0
- package/src/locales/zh-CN.json +4 -0
- package/src/views/kiosk/KioskView.vue +51 -7
- package/src/views/order-settings/OrderSettingsView.vue +2 -2
- package/src/views/order-settings/delivery/DeliverySetting.vue +18 -1
- package/src/views/order-settings/delivery/delivery.ts +37 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +24 -8
- package/src/views/order-settings/delivery/inhouse/ZoneDialog.vue +14 -2
- package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +136 -27
- package/dist/KioskView-DelVMMj4.js +0 -430
- package/dist/OrderSettingsView-DE2U7vqW.js +0 -60930
- package/dist/lineman-settings.dto-DBDThIb0.js +0 -62793
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, openBlock as C, createElementBlock as W, createElementVNode as i, toDisplayString as P, unref as d, ref as v, defineAsyncComponent as k, computed as x, onMounted as ee, watch as ae, resolveComponent as R, createVNode as T, createBlock as D, createCommentVNode as q } from "vue";
|
|
2
|
-
import { u as te, _ as le } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js";
|
|
3
|
-
import { useDialog as ne, useSnackbar as ce } from "@feedmepos/ui-library";
|
|
4
|
-
import { useI18n as X, useCoreStore as re } from "@feedmepos/mf-common";
|
|
5
|
-
import { F as ue, a as oe, S as B } from "./lineman-settings.dto-DBDThIb0.js";
|
|
6
|
-
import { defineStore as se } from "pinia";
|
|
7
|
-
import { O as V } from "./index-CahsmFL1.js";
|
|
8
|
-
import { u as pe } from "./app-BIvt4NBq.js";
|
|
9
|
-
const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body-md-400 block" }, me = { class: "fm-typo-en-title-md-600" }, ye = /* @__PURE__ */ H({
|
|
10
|
-
__name: "KioskOtpDialog",
|
|
11
|
-
props: {
|
|
12
|
-
otp: {}
|
|
13
|
-
},
|
|
14
|
-
setup(e) {
|
|
15
|
-
const { t: a } = X();
|
|
16
|
-
return (n, c) => (C(), W("div", de, [
|
|
17
|
-
i("span", ie, P(d(a)("order.bindDeviceMessage")), 1),
|
|
18
|
-
i("div", me, P(e.otp), 1)
|
|
19
|
-
]));
|
|
20
|
-
}
|
|
21
|
-
}), j = {
|
|
22
|
-
enabled: !1,
|
|
23
|
-
prefix: null,
|
|
24
|
-
padDigit: 0,
|
|
25
|
-
standSlotRange: {
|
|
26
|
-
min: 1,
|
|
27
|
-
max: 10
|
|
28
|
-
},
|
|
29
|
-
enablePaxDialog: !1,
|
|
30
|
-
submitOrderInstruction: {
|
|
31
|
-
payAtCounter: null,
|
|
32
|
-
paid: null
|
|
33
|
-
}
|
|
34
|
-
}, fe = {
|
|
35
|
-
enabled: !1,
|
|
36
|
-
submitOrderInstruction: {
|
|
37
|
-
payAtCounter: null,
|
|
38
|
-
paid: null
|
|
39
|
-
}
|
|
40
|
-
}, G = {
|
|
41
|
-
enabled: !1,
|
|
42
|
-
submitOrderInstruction: {
|
|
43
|
-
payAtCounter: null,
|
|
44
|
-
paid: null
|
|
45
|
-
},
|
|
46
|
-
enablePaxDialog: !1
|
|
47
|
-
}, ve = {
|
|
48
|
-
dineIn: {
|
|
49
|
-
enabled: !1,
|
|
50
|
-
pickUp: G,
|
|
51
|
-
sequenceNumber: ue.parse({}),
|
|
52
|
-
displayStand: j
|
|
53
|
-
},
|
|
54
|
-
takeaway: fe,
|
|
55
|
-
paymentSetting: {
|
|
56
|
-
paymentTypes: [],
|
|
57
|
-
offlinePaymentTypes: [],
|
|
58
|
-
ePaymentTypes: {
|
|
59
|
-
terminal: !1,
|
|
60
|
-
card: {
|
|
61
|
-
terminal: !1,
|
|
62
|
-
nfc: !1
|
|
63
|
-
},
|
|
64
|
-
eWallet: {
|
|
65
|
-
terminalQrPay: !1,
|
|
66
|
-
terminalScanPay: !1,
|
|
67
|
-
qrPay: !1,
|
|
68
|
-
scanPay: !1
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
menuItem: {
|
|
73
|
-
showAllOnly: !1
|
|
74
|
-
},
|
|
75
|
-
coverImageLandscape: null,
|
|
76
|
-
coverImagePortrait: null,
|
|
77
|
-
otaChannel: "",
|
|
78
|
-
autoCloseBill: null,
|
|
79
|
-
printReceiptAfterClose: null
|
|
80
|
-
}, U = {
|
|
81
|
-
payAtCounter: null,
|
|
82
|
-
paid: null
|
|
83
|
-
}, be = (e) => {
|
|
84
|
-
var a;
|
|
85
|
-
return {
|
|
86
|
-
kiosk: _e(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
|
|
87
|
-
};
|
|
88
|
-
}, _e = (e, a) => {
|
|
89
|
-
var n, c, t, l, r, o, s, p, b, f, m;
|
|
90
|
-
return {
|
|
91
|
-
dineIn: Ce(
|
|
92
|
-
a ?? {
|
|
93
|
-
current: 0,
|
|
94
|
-
prefix: "#K"
|
|
95
|
-
},
|
|
96
|
-
(e == null ? void 0 : e.dineIn) ?? void 0
|
|
97
|
-
),
|
|
98
|
-
takeaway: {
|
|
99
|
-
enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
|
|
100
|
-
submitOrderInstruction: (n = e == null ? void 0 : e.takeaway) != null && n.submitOrderInstruction ? {
|
|
101
|
-
payAtCounter: ((l = (t = (c = e == null ? void 0 : e.takeaway) == null ? void 0 : c.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : l.en) ?? null,
|
|
102
|
-
paid: ((s = (o = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : s.en) ?? null
|
|
103
|
-
} : U
|
|
104
|
-
},
|
|
105
|
-
paymentSetting: {
|
|
106
|
-
paymentTypes: ((p = e == null ? void 0 : e.paymentSetting) == null ? void 0 : p.paymentTypes) ?? [],
|
|
107
|
-
offlinePaymentTypes: ((b = e == null ? void 0 : e.paymentSetting) == null ? void 0 : b.offlinePaymentTypes) ?? [],
|
|
108
|
-
ePaymentTypes: ((f = e == null ? void 0 : e.paymentSetting) == null ? void 0 : f.ePaymentTypes) ?? oe.parse({
|
|
109
|
-
card: {
|
|
110
|
-
terminal: !1,
|
|
111
|
-
nfc: !1
|
|
112
|
-
},
|
|
113
|
-
eWallet: {
|
|
114
|
-
qrPay: !1,
|
|
115
|
-
scanPay: !1
|
|
116
|
-
}
|
|
117
|
-
})
|
|
118
|
-
},
|
|
119
|
-
menuItem: {
|
|
120
|
-
showAllOnly: ((m = e == null ? void 0 : e.menuItem) == null ? void 0 : m.showAllOnly) ?? !1
|
|
121
|
-
},
|
|
122
|
-
otaChannel: (e == null ? void 0 : e.otaChannel) ?? "",
|
|
123
|
-
coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
|
|
124
|
-
coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null,
|
|
125
|
-
// Preserve "unset" as null — collapsing to a boolean here is what let an
|
|
126
|
-
// unrelated save overwrite the inherited dineInSettings value.
|
|
127
|
-
autoCloseBill: (e == null ? void 0 : e.autoCloseBill) ?? null,
|
|
128
|
-
printReceiptAfterClose: (e == null ? void 0 : e.printReceiptAfterClose) ?? null
|
|
129
|
-
};
|
|
130
|
-
}, Ce = (e, a) => {
|
|
131
|
-
var n, c, t, l, r, o, s, p;
|
|
132
|
-
return {
|
|
133
|
-
enabled: !!a,
|
|
134
|
-
sequenceNumber: e,
|
|
135
|
-
pickUp: a != null && a.pickUp ? {
|
|
136
|
-
...a.pickUp,
|
|
137
|
-
submitOrderInstruction: a.pickUp.submitOrderInstruction ? {
|
|
138
|
-
payAtCounter: ((c = (n = a.pickUp.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : c.en) ?? null,
|
|
139
|
-
paid: ((l = (t = a.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : l.en) ?? null
|
|
140
|
-
} : U,
|
|
141
|
-
enablePaxDialog: a.pickUp.enablePaxDialog ? a.pickUp.enablePaxDialog : !1
|
|
142
|
-
} : G,
|
|
143
|
-
displayStand: a != null && a.displayStand ? {
|
|
144
|
-
enabled: a.displayStand.enabled,
|
|
145
|
-
standSlotRange: a.displayStand.standSlotRange,
|
|
146
|
-
prefix: a.displayStand.prefix,
|
|
147
|
-
padDigit: a.displayStand.padDigit,
|
|
148
|
-
enablePaxDialog: a.displayStand.enablePaxDialog ?? !1,
|
|
149
|
-
submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
|
|
150
|
-
payAtCounter: ((o = (r = a.displayStand.submitOrderInstruction) == null ? void 0 : r.payAtCounter) == null ? void 0 : o.en) ?? null,
|
|
151
|
-
paid: ((p = (s = a.displayStand.submitOrderInstruction) == null ? void 0 : s.paid) == null ? void 0 : p.en) ?? null
|
|
152
|
-
} : U
|
|
153
|
-
} : j
|
|
154
|
-
};
|
|
155
|
-
}, Pe = (e) => {
|
|
156
|
-
const a = (t) => {
|
|
157
|
-
var l, r, o, s;
|
|
158
|
-
return {
|
|
159
|
-
requiredSlot: !!t.displayStand,
|
|
160
|
-
displayStand: {
|
|
161
|
-
...t.displayStand,
|
|
162
|
-
submitOrderInstruction: {
|
|
163
|
-
payAtCounter: (l = t.displayStand.submitOrderInstruction) != null && l.payAtCounter ? {
|
|
164
|
-
en: t.displayStand.submitOrderInstruction.payAtCounter
|
|
165
|
-
} : null,
|
|
166
|
-
paid: (r = t.displayStand.submitOrderInstruction) != null && r.paid ? {
|
|
167
|
-
en: t.displayStand.submitOrderInstruction.paid
|
|
168
|
-
} : null
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
pickUp: {
|
|
172
|
-
...t.pickUp,
|
|
173
|
-
submitOrderInstruction: {
|
|
174
|
-
payAtCounter: (o = t.pickUp.submitOrderInstruction) != null && o.payAtCounter ? {
|
|
175
|
-
en: t.pickUp.submitOrderInstruction.payAtCounter
|
|
176
|
-
} : null,
|
|
177
|
-
paid: (s = t.pickUp.submitOrderInstruction) != null && s.paid ? {
|
|
178
|
-
en: t.pickUp.submitOrderInstruction.paid
|
|
179
|
-
} : null
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}, n = (t) => ({
|
|
184
|
-
canTakeaway: e.takeaway.enabled,
|
|
185
|
-
dineIn: t,
|
|
186
|
-
menuItem: e.menuItem,
|
|
187
|
-
coverImageLandscape: e.coverImageLandscape,
|
|
188
|
-
coverImagePortrait: e.coverImagePortrait,
|
|
189
|
-
otaChannel: e.otaChannel || void 0,
|
|
190
|
-
// Omit when unset so the backend's `?? config.autoCloseBill` inheritance
|
|
191
|
-
// still applies — sending `false` here would pin it off for good.
|
|
192
|
-
autoCloseBill: e.autoCloseBill ?? void 0,
|
|
193
|
-
printReceiptAfterClose: e.printReceiptAfterClose ?? void 0,
|
|
194
|
-
paymentSetting: c(e.paymentSetting),
|
|
195
|
-
takeaway: e.takeaway.submitOrderInstruction ? {
|
|
196
|
-
submitOrderInstruction: {
|
|
197
|
-
payAtCounter: e.takeaway.submitOrderInstruction.payAtCounter ? {
|
|
198
|
-
en: e.takeaway.submitOrderInstruction.payAtCounter
|
|
199
|
-
} : null,
|
|
200
|
-
paid: e.takeaway.submitOrderInstruction.paid ? {
|
|
201
|
-
en: e.takeaway.submitOrderInstruction.paid
|
|
202
|
-
} : null
|
|
203
|
-
}
|
|
204
|
-
} : void 0
|
|
205
|
-
}), c = (t) => ({
|
|
206
|
-
paymentTypes: t.paymentTypes,
|
|
207
|
-
offlinePaymentTypes: t.offlinePaymentTypes,
|
|
208
|
-
ePaymentTypes: t.ePaymentTypes
|
|
209
|
-
});
|
|
210
|
-
return e.dineIn.enabled ? {
|
|
211
|
-
kioskSettings: n(a(e.dineIn)),
|
|
212
|
-
kioskDineIn: e.dineIn.sequenceNumber
|
|
213
|
-
} : {
|
|
214
|
-
kioskSettings: n()
|
|
215
|
-
};
|
|
216
|
-
}, $ = {
|
|
217
|
-
convertOrderSettingDto: be,
|
|
218
|
-
toOrderKioskSettingsDto: Pe
|
|
219
|
-
}, he = se("orderSetting", () => {
|
|
220
|
-
const e = v({});
|
|
221
|
-
async function a() {
|
|
222
|
-
const l = await V.getOrderSetting();
|
|
223
|
-
c(l);
|
|
224
|
-
}
|
|
225
|
-
async function n() {
|
|
226
|
-
if (e.value.orderSetting && e.value.kiosk) {
|
|
227
|
-
const { _id: l, ...r } = e.value.orderSetting, o = $.toOrderKioskSettingsDto(e.value.kiosk), s = {
|
|
228
|
-
...r,
|
|
229
|
-
kioskSettings: o.kioskSettings
|
|
230
|
-
}, p = await V.updateOrderSetting(s);
|
|
231
|
-
c(p);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
function c(l) {
|
|
235
|
-
e.value.orderSetting = l, e.value.kiosk = $.convertOrderSettingDto(l).kiosk;
|
|
236
|
-
}
|
|
237
|
-
function t(l) {
|
|
238
|
-
e.value.kiosk = l;
|
|
239
|
-
}
|
|
240
|
-
return {
|
|
241
|
-
state: e.value,
|
|
242
|
-
getSetting: a,
|
|
243
|
-
updateKioskSetting: n,
|
|
244
|
-
setKioskOrderSetting: t
|
|
245
|
-
};
|
|
246
|
-
}), we = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ae = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Ie = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), xe = /[^\p{L}\d]+/giu, N = "$1\0$2", M = "";
|
|
247
|
-
function Q(e) {
|
|
248
|
-
let a = e.trim();
|
|
249
|
-
a = a.replace(we, N).replace(Ae, N), a = a.replace(xe, "\0");
|
|
250
|
-
let n = 0, c = a.length;
|
|
251
|
-
for (; a.charAt(n) === "\0"; )
|
|
252
|
-
n++;
|
|
253
|
-
if (n === c)
|
|
254
|
-
return [];
|
|
255
|
-
for (; a.charAt(c - 1) === "\0"; )
|
|
256
|
-
c--;
|
|
257
|
-
return a.slice(n, c).split(/\0/g);
|
|
258
|
-
}
|
|
259
|
-
function Re(e) {
|
|
260
|
-
const a = Q(e);
|
|
261
|
-
for (let n = 0; n < a.length; n++) {
|
|
262
|
-
const c = a[n], t = Ie.exec(c);
|
|
263
|
-
if (t) {
|
|
264
|
-
const l = t.index + (t[1] ?? t[2]).length;
|
|
265
|
-
a.splice(n, 1, c.slice(0, l), c.slice(l));
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return a;
|
|
269
|
-
}
|
|
270
|
-
function Te(e, a) {
|
|
271
|
-
const [n, c, t] = Fe(e, a), l = Ue(a == null ? void 0 : a.locale), r = Le(a == null ? void 0 : a.locale);
|
|
272
|
-
return n + c.map(Ee(l, r)).join(" ") + t;
|
|
273
|
-
}
|
|
274
|
-
function Ue(e) {
|
|
275
|
-
return (a) => a.toLocaleLowerCase(e);
|
|
276
|
-
}
|
|
277
|
-
function Le(e) {
|
|
278
|
-
return (a) => a.toLocaleUpperCase(e);
|
|
279
|
-
}
|
|
280
|
-
function Ee(e, a) {
|
|
281
|
-
return (n) => `${a(n[0])}${e(n.slice(1))}`;
|
|
282
|
-
}
|
|
283
|
-
function Fe(e, a = {}) {
|
|
284
|
-
const n = a.split ?? (a.separateNumbers ? Re : Q), c = a.prefixCharacters ?? M, t = a.suffixCharacters ?? M;
|
|
285
|
-
let l = 0, r = e.length;
|
|
286
|
-
for (; l < e.length; ) {
|
|
287
|
-
const o = e.charAt(l);
|
|
288
|
-
if (!c.includes(o))
|
|
289
|
-
break;
|
|
290
|
-
l++;
|
|
291
|
-
}
|
|
292
|
-
for (; r > l; ) {
|
|
293
|
-
const o = r - 1, s = e.charAt(o);
|
|
294
|
-
if (!t.includes(s))
|
|
295
|
-
break;
|
|
296
|
-
r = o;
|
|
297
|
-
}
|
|
298
|
-
return [
|
|
299
|
-
e.slice(0, l),
|
|
300
|
-
n(e.slice(l, r)),
|
|
301
|
-
e.slice(r)
|
|
302
|
-
];
|
|
303
|
-
}
|
|
304
|
-
const Ke = { class: "py-[1.5rem]" }, De = { class: "px-[1.5rem]" }, qe = { class: "pt-[1.5rem]" }, Be = { class: "flex flex-col gap-10" }, Ve = { class: "flex flex-col gap-2" }, $e = { class: "fm-typo-en-title-sm-600" }, Ne = { class: "fm-typo-en-title-sm-400" }, Je = /* @__PURE__ */ H({
|
|
305
|
-
__name: "KioskView",
|
|
306
|
-
setup(e) {
|
|
307
|
-
var F, K;
|
|
308
|
-
const { t: a } = X(), { canManageOrderSetting: n } = pe(), c = k(
|
|
309
|
-
() => import("./KioskSettingView-BUcPNVTc.js")
|
|
310
|
-
), t = v("device"), l = te(), r = he(), o = ne(), { currentRestaurant: s, restaurants: p, changeRestaurant: b } = re(), f = ce(), m = v(((F = s.value) == null ? void 0 : F._id) ?? void 0), h = v(null), z = x(() => p.value.map((u) => ({
|
|
311
|
-
label: u.profile.name,
|
|
312
|
-
value: u._id
|
|
313
|
-
}))), _ = v(((K = s.value) == null ? void 0 : K._id) ?? "");
|
|
314
|
-
async function L(u) {
|
|
315
|
-
const y = p.value.find((A) => A._id == u);
|
|
316
|
-
await b(y), await E(), m.value = u, _.value = u;
|
|
317
|
-
}
|
|
318
|
-
async function E() {
|
|
319
|
-
if (n.value)
|
|
320
|
-
try {
|
|
321
|
-
await r.getSetting();
|
|
322
|
-
} catch {
|
|
323
|
-
}
|
|
324
|
-
await w();
|
|
325
|
-
}
|
|
326
|
-
async function w() {
|
|
327
|
-
h.value = null;
|
|
328
|
-
try {
|
|
329
|
-
await l.getDevices();
|
|
330
|
-
} catch (u) {
|
|
331
|
-
h.value = u instanceof B && u.status === 403 ? "forbidden" : "error";
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
const J = x(() => {
|
|
335
|
-
const u = [{ label: a("order.deviceBinding"), value: "device" }];
|
|
336
|
-
return n.value && u.push({ label: a("order.settings"), value: "setting" }), u;
|
|
337
|
-
}), Y = x(() => l.state.devices);
|
|
338
|
-
async function Z() {
|
|
339
|
-
try {
|
|
340
|
-
await l.requestOtp();
|
|
341
|
-
} catch (u) {
|
|
342
|
-
f.open({
|
|
343
|
-
title: u instanceof B && u.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
|
|
344
|
-
type: "error"
|
|
345
|
-
});
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
o.open({
|
|
349
|
-
title: Te(a("order.bindDevice")),
|
|
350
|
-
contentComponent: ye,
|
|
351
|
-
contentComponentProps: {
|
|
352
|
-
otp: l.state.otp
|
|
353
|
-
}
|
|
354
|
-
}).onClose(async () => {
|
|
355
|
-
await w();
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
async function O(u) {
|
|
359
|
-
try {
|
|
360
|
-
r.setKioskOrderSetting(u), await r.updateKioskSetting(), f.open({
|
|
361
|
-
title: a("order.kioskSettingSuccess"),
|
|
362
|
-
type: "success"
|
|
363
|
-
});
|
|
364
|
-
} catch {
|
|
365
|
-
f.open({
|
|
366
|
-
title: a("order.kioskSettingFailed"),
|
|
367
|
-
type: "error"
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
return ee(async () => {
|
|
372
|
-
var u;
|
|
373
|
-
(u = s.value) != null && u._id && (_.value = s.value._id, await E());
|
|
374
|
-
}), ae(
|
|
375
|
-
() => p.value.length,
|
|
376
|
-
async (u) => {
|
|
377
|
-
m.value === void 0 && p.value.length > 0 && await L(p.value[0]._id);
|
|
378
|
-
},
|
|
379
|
-
{ immediate: !0 }
|
|
380
|
-
), (u, y) => {
|
|
381
|
-
const A = R("FmPageHead"), g = R("FmTabs"), S = R("FmSelect");
|
|
382
|
-
return C(), W("div", Ke, [
|
|
383
|
-
T(A, {
|
|
384
|
-
title: d(a)("order.kiosk")
|
|
385
|
-
}, null, 8, ["title"]),
|
|
386
|
-
i("div", De, [
|
|
387
|
-
T(g, {
|
|
388
|
-
"model-value": t.value,
|
|
389
|
-
"onUpdate:modelValue": y[0] || (y[0] = (I) => t.value = I),
|
|
390
|
-
items: J.value
|
|
391
|
-
}, null, 8, ["model-value", "items"]),
|
|
392
|
-
i("div", qe, [
|
|
393
|
-
i("div", Be, [
|
|
394
|
-
i("div", Ve, [
|
|
395
|
-
i("span", $e, P(d(a)("order.activateLocation")), 1),
|
|
396
|
-
i("span", Ne, P(d(a)("order.selectRestaurant")) + ": ", 1),
|
|
397
|
-
T(S, {
|
|
398
|
-
class: "w-1/2",
|
|
399
|
-
modelValue: m.value,
|
|
400
|
-
"onUpdate:modelValue": [
|
|
401
|
-
y[1] || (y[1] = (I) => m.value = I),
|
|
402
|
-
L
|
|
403
|
-
],
|
|
404
|
-
items: z.value,
|
|
405
|
-
placeholder: d(a)("order.selectItem")
|
|
406
|
-
}, null, 8, ["modelValue", "items", "placeholder"])
|
|
407
|
-
]),
|
|
408
|
-
t.value == "device" ? (C(), D(le, {
|
|
409
|
-
key: 0,
|
|
410
|
-
devices: Y.value,
|
|
411
|
-
"load-error": h.value,
|
|
412
|
-
onRequestOtp: Z,
|
|
413
|
-
onRetry: w
|
|
414
|
-
}, null, 8, ["devices", "load-error"])) : q("", !0),
|
|
415
|
-
t.value == "setting" && d(n) ? (C(), D(d(c), {
|
|
416
|
-
key: `KioskSettingView-${_.value}`,
|
|
417
|
-
"restaurant-id": _.value,
|
|
418
|
-
onUpdateKioskOrderSetting: O,
|
|
419
|
-
form: d(r).state.kiosk ?? d(ve)
|
|
420
|
-
}, null, 8, ["restaurant-id", "form"])) : q("", !0)
|
|
421
|
-
])
|
|
422
|
-
])
|
|
423
|
-
])
|
|
424
|
-
]);
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
export {
|
|
429
|
-
Je as default
|
|
430
|
-
};
|