@feedmepos/mf-order-setting 0.0.73-dev → 0.0.74-prod
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-Dztw-Q35.js → KioskDevicesView-B1LidTLZ.js} +1 -1
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-CjIl1Sc5.js +762 -0
- package/dist/{KioskSettingView-BUHmoxyO.js → KioskSettingView-daW9hMlu.js} +4 -4
- package/dist/KioskView-CTEmbuK8.js +362 -0
- package/dist/{OrderSettingsView-C5PK8CKZ.js → OrderSettingsView-kLQU765J.js} +13 -10
- package/dist/app-BGvpo6ui.js +20750 -0
- package/dist/app.js +3 -3
- package/dist/{dayjs.min-B3nOmXcs.js → dayjs.min-Bc3gp2Hd.js} +1 -1
- package/dist/frontend/mf-order/src/api/index.d.ts +3 -1
- package/dist/frontend/mf-order/src/app.d.ts +160 -152
- package/dist/frontend/mf-order/src/composables/useKioskPermission.d.ts +11 -0
- package/dist/frontend/mf-order/src/composables/useOrderSettingPermission.d.ts +13 -0
- package/dist/frontend/mf-order/src/main.d.ts +160 -152
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +3 -3
- package/dist/frontend/mf-order/src/views/kiosk/KioskStatePanel.vue.d.ts +19 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +7 -1
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-B4XxBqiV.js → index-BjzjNVWj.js} +7 -7
- package/dist/{index-6PQJ07gD.js → index-DiMaKxik.js} +2 -2
- package/dist/{lineman-settings.dto-DcYJFu0U.js → lineman-settings.dto-5k_e6DR3.js} +18974 -18109
- package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +6 -6
- package/dist/package/entity/order-setting/order-setting.do.d.ts +4 -4
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +8 -8
- package/dist/package/entity/order-setting/sms/sms.do.d.ts +2 -2
- package/dist/package/entity/order-setting/sms/sms.dto.d.ts +2 -2
- package/package.json +3 -2
- package/src/api/index.ts +5 -2
- package/src/composables/useKioskPermission.ts +41 -0
- package/src/composables/useOrderSettingPermission.ts +34 -0
- package/src/locales/en-US.json +429 -421
- package/src/main.ts +9 -6
- package/src/router/routes.ts +34 -5
- package/src/views/kiosk/KioskStatePanel.vue +31 -0
- package/src/views/kiosk/KioskView.vue +100 -62
- package/src/views/kiosk/devices/KioskDeviceCard.vue +4 -0
- package/src/views/kiosk/devices/KioskDevicesView.vue +42 -9
- package/src/views/order-settings/OrderSettingsView.vue +8 -5
- package/src/views/order-settings/delivery/delivery.ts +1 -1
- package/vite.config.ts +5 -2
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-Ol419NZh.js +0 -707
- package/dist/KioskView-B8j77zMA.js +0 -343
- package/dist/app-C2_s0fkK.js +0 -18792
|
@@ -1,707 +0,0 @@
|
|
|
1
|
-
import { ref as P, defineComponent as re, resolveComponent as D, openBlock as p, createElementBlock as y, createElementVNode as a, toDisplayString as i, unref as s, createVNode as m, computed as T, watch as de, createCommentVNode as $, withCtx as J, Fragment as G, renderList as Q, normalizeClass as _e, createBlock as ae, createTextVNode as z } from "vue";
|
|
2
|
-
import { useI18n as ie } from "@feedmepos/mf-common";
|
|
3
|
-
import { defineStore as xe } from "pinia";
|
|
4
|
-
import { r as H, g as ue } from "./lineman-settings.dto-DcYJFu0U.js";
|
|
5
|
-
import { useDialog as Ie, useSnackbar as Te } from "@feedmepos/ui-library";
|
|
6
|
-
import { d as oe } from "./dayjs.min-B3nOmXcs.js";
|
|
7
|
-
import { g as we, c as Ae } from "./app-C2_s0fkK.js";
|
|
8
|
-
async function Pe() {
|
|
9
|
-
const n = await H().get("/kiosk/otp");
|
|
10
|
-
return ue(n);
|
|
11
|
-
}
|
|
12
|
-
async function De() {
|
|
13
|
-
const n = await H().get("/kiosk/devices");
|
|
14
|
-
return ue(n);
|
|
15
|
-
}
|
|
16
|
-
async function Se(n) {
|
|
17
|
-
await H().delete(`/kiosk/unbind/${n}`);
|
|
18
|
-
}
|
|
19
|
-
async function Ce(n, e) {
|
|
20
|
-
await H().put(`/kiosk/updateDevicePin/${e}`, { pinInfo: n });
|
|
21
|
-
}
|
|
22
|
-
async function Fe(n, e) {
|
|
23
|
-
await H().put(`/kiosk/updateDevicePin/${e}`, { remarkInfo: n });
|
|
24
|
-
}
|
|
25
|
-
const q = {
|
|
26
|
-
requestOtp: Pe,
|
|
27
|
-
getDevices: De,
|
|
28
|
-
unbind: Se,
|
|
29
|
-
updateDevicePin: Ce,
|
|
30
|
-
updateDeviceRemark: Fe
|
|
31
|
-
}, Me = (n) => ({
|
|
32
|
-
name: n.name ?? "N/A",
|
|
33
|
-
machineId: n.machineId,
|
|
34
|
-
config: {
|
|
35
|
-
scannerInfo: n.scannerInfo ?? void 0,
|
|
36
|
-
printerInfo: n.printerInfo ?? void 0,
|
|
37
|
-
terminalInfo: n.terminalInfo ?? void 0
|
|
38
|
-
},
|
|
39
|
-
activatedAt: Ve(n.token),
|
|
40
|
-
deviceAppType: n.deviceAppType ?? void 0,
|
|
41
|
-
remarkInfo: n.remarkInfo ?? void 0,
|
|
42
|
-
slotInfo: n.slotInfo ?? void 0,
|
|
43
|
-
pinInfo: n.pinInfo ?? void 0,
|
|
44
|
-
deviceAppVersion: n.deviceAppVersion ?? void 0,
|
|
45
|
-
deviceAppOTAVersion: n.deviceAppOTAVersion ?? void 0,
|
|
46
|
-
webviewVersion: n.webviewVersion ?? void 0,
|
|
47
|
-
operatingSystem: n.operatingSystem ?? void 0,
|
|
48
|
-
osVersion: n.osVersion ?? void 0,
|
|
49
|
-
lastStartup: n.lastStartup ? new Date(n.lastStartup) : void 0
|
|
50
|
-
});
|
|
51
|
-
function Ve(n) {
|
|
52
|
-
const e = n.substring(0, 8), f = parseInt(e, 16);
|
|
53
|
-
return new Date(f * 1e3);
|
|
54
|
-
}
|
|
55
|
-
const Ee = {
|
|
56
|
-
toMfKioskDevice: Me
|
|
57
|
-
}, Be = xe("kiosk", () => {
|
|
58
|
-
const n = P({
|
|
59
|
-
otp: "",
|
|
60
|
-
devices: []
|
|
61
|
-
});
|
|
62
|
-
async function e() {
|
|
63
|
-
const o = await q.requestOtp();
|
|
64
|
-
n.value.otp = o.otp;
|
|
65
|
-
}
|
|
66
|
-
async function f() {
|
|
67
|
-
const o = await q.getDevices();
|
|
68
|
-
n.value.devices = o.map((l) => Ee.toMfKioskDevice(l));
|
|
69
|
-
}
|
|
70
|
-
async function v(o) {
|
|
71
|
-
await q.unbind(o), await f();
|
|
72
|
-
}
|
|
73
|
-
async function d(o, l) {
|
|
74
|
-
await q.updateDevicePin(o, l), await f();
|
|
75
|
-
}
|
|
76
|
-
async function h(o, l) {
|
|
77
|
-
await q.updateDeviceRemark(o, l), await f();
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
state: n.value,
|
|
81
|
-
requestOtp: e,
|
|
82
|
-
getDevices: f,
|
|
83
|
-
unbind: v,
|
|
84
|
-
updateDevicePin: d,
|
|
85
|
-
updateDeviceRemark: h
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
var pe = { exports: {} };
|
|
89
|
-
(function(n, e) {
|
|
90
|
-
(function(f, v) {
|
|
91
|
-
n.exports = v();
|
|
92
|
-
})(Ae, function() {
|
|
93
|
-
return function(f, v, d) {
|
|
94
|
-
f = f || {};
|
|
95
|
-
var h = v.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
96
|
-
function l(r, u, w, F) {
|
|
97
|
-
return h.fromToBase(r, u, w, F);
|
|
98
|
-
}
|
|
99
|
-
d.en.relativeTime = o, h.fromToBase = function(r, u, w, F, k) {
|
|
100
|
-
for (var S, M, V, E = w.$locale().relativeTime || o, O = f.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], X = O.length, B = 0; B < X; B += 1) {
|
|
101
|
-
var C = O[B];
|
|
102
|
-
C.d && (S = F ? d(r).diff(w, C.d, !0) : w.diff(r, C.d, !0));
|
|
103
|
-
var A = (f.rounding || Math.round)(Math.abs(S));
|
|
104
|
-
if (V = S > 0, A <= C.r || !C.r) {
|
|
105
|
-
A <= 1 && B > 0 && (C = O[B - 1]);
|
|
106
|
-
var R = E[C.l];
|
|
107
|
-
k && (A = k("" + A)), M = typeof R == "string" ? R.replace("%d", A) : R(A, u, C.l, V);
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (u) return M;
|
|
112
|
-
var N = V ? E.future : E.past;
|
|
113
|
-
return typeof N == "function" ? N(M) : N.replace("%s", M);
|
|
114
|
-
}, h.to = function(r, u) {
|
|
115
|
-
return l(r, u, this, !0);
|
|
116
|
-
}, h.from = function(r, u) {
|
|
117
|
-
return l(r, u, this);
|
|
118
|
-
};
|
|
119
|
-
var c = function(r) {
|
|
120
|
-
return r.$u ? d.utc() : d();
|
|
121
|
-
};
|
|
122
|
-
h.toNow = function(r) {
|
|
123
|
-
return this.to(c(this), r);
|
|
124
|
-
}, h.fromNow = function(r) {
|
|
125
|
-
return this.from(c(this), r);
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
});
|
|
129
|
-
})(pe);
|
|
130
|
-
var Re = pe.exports;
|
|
131
|
-
const $e = /* @__PURE__ */ we(Re), Oe = /* @__PURE__ */ re({
|
|
132
|
-
__name: "KioskUnbindConfirm",
|
|
133
|
-
props: {
|
|
134
|
-
machineId: {}
|
|
135
|
-
},
|
|
136
|
-
emits: ["update:modelValue"],
|
|
137
|
-
setup(n, { emit: e }) {
|
|
138
|
-
const { t: f } = ie(), v = e, d = P("");
|
|
139
|
-
function h(o) {
|
|
140
|
-
v("update:modelValue", o);
|
|
141
|
-
}
|
|
142
|
-
return (o, l) => {
|
|
143
|
-
const c = D("FmTextField");
|
|
144
|
-
return p(), y("div", null, [
|
|
145
|
-
a("span", null, i(s(f)("order.unbindKioskDeviceWarning", { machineId: n.machineId })), 1),
|
|
146
|
-
m(c, {
|
|
147
|
-
"model-value": d.value,
|
|
148
|
-
"onUpdate:modelValue": h,
|
|
149
|
-
placeholder: n.machineId
|
|
150
|
-
}, null, 8, ["model-value", "placeholder"])
|
|
151
|
-
]);
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
}), Ne = { class: "border fm-corner-radius-lg p-12 hover:bg-fm-color-neutral-gray-50 transition-colors" }, Le = { class: "flex items-center justify-between mb-2" }, Ue = { class: "flex items-center gap-2" }, Ke = { class: "px-2 py-1 fm-corner-radius-md fm-typo-en-body-sm-600 uppercase bg-fm-color-neutral-gray-200 text-fm-color-typo-secondary" }, je = {
|
|
155
|
-
key: 0,
|
|
156
|
-
class: "fm-typo-en-body-md-600 text-fm-color-typo-primary"
|
|
157
|
-
}, qe = { class: "flex items-center gap-1" }, He = {
|
|
158
|
-
key: 0,
|
|
159
|
-
class: "py-[0.5rem] flex flex-col gap-[1.5rem] pr-2"
|
|
160
|
-
}, We = {
|
|
161
|
-
key: 0,
|
|
162
|
-
class: "w-full border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4"
|
|
163
|
-
}, Ye = { class: "fm-typo-en-title-sm-600 mb-3" }, ze = { class: "grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4" }, Ge = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Qe = { class: "flex flex-col gap-2" }, Je = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Xe = { class: "flex items-center justify-between gap-2" }, Ze = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, tt = {
|
|
164
|
-
key: 1,
|
|
165
|
-
class: "w-full border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4"
|
|
166
|
-
}, nt = { class: "fm-typo-en-title-sm-600" }, ot = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, at = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary break-all" }, it = { key: 1 }, st = { class: "py-[1rem] flex flex-col gap-6 text-center items-center" }, lt = { class: "flex flex-col gap-1 mb-2" }, ct = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, dt = { class: "mt-5 block" }, ut = ["title"], pt = ["title"], mt = ["title"], vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary font-mono" }, ft = { class: "flex items-center gap-3 flex-wrap fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, yt = { class: "flex items-center gap-1" }, ht = {
|
|
167
|
-
key: 0,
|
|
168
|
-
class: "flex items-center gap-1"
|
|
169
|
-
}, bt = { class: "flex items-center gap-1" }, kt = ["title"], gt = /* @__PURE__ */ re({
|
|
170
|
-
__name: "KioskDeviceCard",
|
|
171
|
-
props: {
|
|
172
|
-
device: {}
|
|
173
|
-
},
|
|
174
|
-
setup(n) {
|
|
175
|
-
oe.extend($e);
|
|
176
|
-
const { t: e } = ie(), f = Ie(), v = Te(), d = Be(), h = P(!1), o = n, l = P(""), c = T(() => {
|
|
177
|
-
var t;
|
|
178
|
-
return ((t = o.device) == null ? void 0 : t.deviceAppType) === "TABLET_APP" ? e("order.tabletOnly") : e("order.kioskOnly");
|
|
179
|
-
}), r = T(() => {
|
|
180
|
-
const t = [], b = w(), _ = F();
|
|
181
|
-
return b.length > 0 && t.push({
|
|
182
|
-
key: "scannerInfo",
|
|
183
|
-
title: e("order.scannerInfo"),
|
|
184
|
-
entries: b
|
|
185
|
-
}), _.length > 0 && t.push({
|
|
186
|
-
key: "printerInfo",
|
|
187
|
-
title: e("order.printerInfo"),
|
|
188
|
-
entries: _
|
|
189
|
-
}), t;
|
|
190
|
-
}), u = T(() => r.value.length > 0);
|
|
191
|
-
function w() {
|
|
192
|
-
var _;
|
|
193
|
-
const t = o.device.config.scannerInfo;
|
|
194
|
-
if (!t || o.device.deviceAppType === "TABLET_APP")
|
|
195
|
-
return [];
|
|
196
|
-
const b = [
|
|
197
|
-
{
|
|
198
|
-
label: "Type",
|
|
199
|
-
value: k(t.type)
|
|
200
|
-
}
|
|
201
|
-
];
|
|
202
|
-
return t.type === "CAPACITOR" && t.lensFacing && b.push({
|
|
203
|
-
label: "Lens Facing",
|
|
204
|
-
value: t.lensFacing === "FRONT" ? "Front" : "Back"
|
|
205
|
-
}), t.type === "SUNMI" && b.push({
|
|
206
|
-
label: "Connection",
|
|
207
|
-
value: ((_ = t.connection) == null ? void 0 : _.type) ?? "-"
|
|
208
|
-
}), b;
|
|
209
|
-
}
|
|
210
|
-
function F() {
|
|
211
|
-
var K, Y;
|
|
212
|
-
const t = o.device.config.printerInfo;
|
|
213
|
-
if (!t)
|
|
214
|
-
return [];
|
|
215
|
-
const b = ((K = t.id) == null ? void 0 : K.trim()) ?? "", _ = ((Y = t.name) == null ? void 0 : Y.trim()) ?? "";
|
|
216
|
-
if (!b || !_)
|
|
217
|
-
return [];
|
|
218
|
-
const g = [
|
|
219
|
-
{ label: "Name", value: _ },
|
|
220
|
-
{ label: "Printer ID", value: b }
|
|
221
|
-
], x = t.hardware;
|
|
222
|
-
switch (g.push({ label: "Connection Type", value: x.connection.type }), x.connection.type) {
|
|
223
|
-
case "IP":
|
|
224
|
-
case "BLUETOOTH":
|
|
225
|
-
case "DRIVER":
|
|
226
|
-
g.push({ label: "Path", value: x.connection.path });
|
|
227
|
-
break;
|
|
228
|
-
case "STAR":
|
|
229
|
-
g.push({ label: "Port Name", value: x.connection.portName }), g.push({ label: "Emulation Mode", value: x.connection.emulationMode });
|
|
230
|
-
break;
|
|
231
|
-
case "USB":
|
|
232
|
-
g.push({ label: "Vendor ID", value: x.connection.vendorId }), g.push({ label: "Product ID", value: x.connection.productId });
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
return g.push({ label: "Encoder Type", value: x.encoderConfig.type }), g.push({ label: "DPI", value: String(x.encoderConfig.dpi) }), g.push({ label: "Paper Width (mm)", value: String(x.encoderConfig.paperWidthInMm) }), x.encoderConfig.type === "TSPL" && g.push({ label: "Paper Height (mm)", value: String(x.encoderConfig.paperHeightInMm) }), t.backup && (g.push({ label: "Backup Type", value: t.backup.type }), t.backup.type === "PRINTER_ID" && g.push({ label: "Backup Printer ID", value: t.backup.printerId })), g;
|
|
236
|
-
}
|
|
237
|
-
function k(t) {
|
|
238
|
-
switch (t) {
|
|
239
|
-
case "IMIN":
|
|
240
|
-
return "IMIN";
|
|
241
|
-
case "SUNMI":
|
|
242
|
-
return "SUNMI";
|
|
243
|
-
case "CAPACITOR":
|
|
244
|
-
return "Camera (Capacitor)";
|
|
245
|
-
case "KEYBOARD":
|
|
246
|
-
return "Keyboard";
|
|
247
|
-
default:
|
|
248
|
-
return t;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
const S = T(() => {
|
|
252
|
-
var t;
|
|
253
|
-
return ((t = o.device) == null ? void 0 : t.deviceAppType) === "TABLET_APP";
|
|
254
|
-
}), M = T(() => {
|
|
255
|
-
const t = o.device.machineId;
|
|
256
|
-
return !t || t.length <= 16 ? t : `${t.slice(0, 8)}...${t.slice(-4)}`;
|
|
257
|
-
});
|
|
258
|
-
async function V() {
|
|
259
|
-
try {
|
|
260
|
-
await navigator.clipboard.writeText(o.device.machineId), v.open({
|
|
261
|
-
type: "success",
|
|
262
|
-
message: e("order.machineIdCopied"),
|
|
263
|
-
position: "bottom"
|
|
264
|
-
});
|
|
265
|
-
} catch {
|
|
266
|
-
v.open({
|
|
267
|
-
type: "error",
|
|
268
|
-
message: e("order.copyFailed"),
|
|
269
|
-
position: "bottom"
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
function E(t) {
|
|
274
|
-
return oe(t).fromNow();
|
|
275
|
-
}
|
|
276
|
-
function O(t) {
|
|
277
|
-
return oe(t).format("DD MMM YYYY HH:mm:ss");
|
|
278
|
-
}
|
|
279
|
-
function X() {
|
|
280
|
-
l.value = "", f.open({
|
|
281
|
-
title: e("order.unbindKioskDevice"),
|
|
282
|
-
contentComponent: Oe,
|
|
283
|
-
contentComponentProps: {
|
|
284
|
-
machineId: o.device.machineId,
|
|
285
|
-
"onUpdate:modelValue": (t) => {
|
|
286
|
-
l.value = t;
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
dismissAway: !1,
|
|
290
|
-
primaryActions: {
|
|
291
|
-
text: e("order.unbind"),
|
|
292
|
-
variant: "destructive",
|
|
293
|
-
close: !1
|
|
294
|
-
},
|
|
295
|
-
secondaryActions: {
|
|
296
|
-
text: e("order.cancel"),
|
|
297
|
-
variant: "tertiary",
|
|
298
|
-
close: !0
|
|
299
|
-
}
|
|
300
|
-
}).onPrimary(async () => {
|
|
301
|
-
l.value == o.device.machineId ? (await ge(), v.open({
|
|
302
|
-
type: "success",
|
|
303
|
-
message: e("order.unbindSuccess"),
|
|
304
|
-
position: "bottom"
|
|
305
|
-
}), f.close()) : v.open({
|
|
306
|
-
type: "warning",
|
|
307
|
-
message: e("order.unbindWarning"),
|
|
308
|
-
position: "bottom"
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
const B = T(() => {
|
|
313
|
-
var t;
|
|
314
|
-
return (t = o.device) == null ? void 0 : t.pinInfo;
|
|
315
|
-
}), C = T(() => A.value ? e("order.reEnterNewPin") : e("order.enterNewPin")), A = P(!1), R = P(), N = P(), Z = P(!1), U = P(o.device.remarkInfo ?? ""), L = P("app"), me = T(() => {
|
|
316
|
-
const t = [
|
|
317
|
-
{
|
|
318
|
-
label: e("order.deviceAppInfo"),
|
|
319
|
-
value: "app"
|
|
320
|
-
}
|
|
321
|
-
];
|
|
322
|
-
return u.value && t.push({
|
|
323
|
-
label: e("order.other"),
|
|
324
|
-
value: "other"
|
|
325
|
-
}), t;
|
|
326
|
-
}), W = T(() => {
|
|
327
|
-
var t;
|
|
328
|
-
return ((t = o.device.remarkInfo) == null ? void 0 : t.trim()) ?? "";
|
|
329
|
-
}), ve = T(() => {
|
|
330
|
-
const t = [
|
|
331
|
-
{
|
|
332
|
-
label: e("order.deviceType"),
|
|
333
|
-
value: c.value
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
label: e("order.machineId"),
|
|
337
|
-
value: o.device.machineId,
|
|
338
|
-
isMono: !0
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
label: e("order.version"),
|
|
342
|
-
value: o.device.deviceAppVersion ?? "Below 0.0.42"
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
label: e("order.deviceOtaVersion"),
|
|
346
|
-
value: o.device.deviceAppOTAVersion ?? e("order.notSet")
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
label: e("order.devicePinCode"),
|
|
350
|
-
value: B.value ? e("order.pinSet") : e("order.noPin")
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
label: e("order.activatedDate"),
|
|
354
|
-
value: O(o.device.activatedAt)
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
label: e("order.webviewVersion"),
|
|
358
|
-
value: o.device.webviewVersion || e("order.notSet")
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
label: e("order.operatingSystem"),
|
|
362
|
-
value: o.device.operatingSystem || e("order.notSet")
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
label: e("order.osVersion"),
|
|
366
|
-
value: o.device.osVersion || e("order.notSet")
|
|
367
|
-
}
|
|
368
|
-
];
|
|
369
|
-
return S.value && t.push({
|
|
370
|
-
label: e("order.deviceSlot"),
|
|
371
|
-
value: o.device.slotInfo || e("order.notSet")
|
|
372
|
-
}), o.device.lastStartup && t.push({
|
|
373
|
-
label: e("order.lastStartupAt"),
|
|
374
|
-
value: O(o.device.lastStartup)
|
|
375
|
-
}), t;
|
|
376
|
-
}), ee = T(() => U.value.trim()), se = T(() => ee.value !== W.value);
|
|
377
|
-
de(
|
|
378
|
-
() => o.device.remarkInfo,
|
|
379
|
-
(t) => {
|
|
380
|
-
U.value = t ?? "";
|
|
381
|
-
}
|
|
382
|
-
), de(
|
|
383
|
-
() => u.value,
|
|
384
|
-
(t) => {
|
|
385
|
-
!t && L.value === "other" && (L.value = "app");
|
|
386
|
-
}
|
|
387
|
-
);
|
|
388
|
-
function fe() {
|
|
389
|
-
h.value = !0;
|
|
390
|
-
}
|
|
391
|
-
function te() {
|
|
392
|
-
A.value = !1, R.value = null, N.value = null, h.value = !1, L.value = "app";
|
|
393
|
-
}
|
|
394
|
-
function le(t) {
|
|
395
|
-
A.value ? (N.value = t, ye()) : (R.value = t, A.value = !0);
|
|
396
|
-
}
|
|
397
|
-
async function ye() {
|
|
398
|
-
R.value === N.value ? (await ke(), v.open({
|
|
399
|
-
type: "success",
|
|
400
|
-
message: "Successfuly update device PIN",
|
|
401
|
-
position: "top"
|
|
402
|
-
})) : v.open({
|
|
403
|
-
type: "error",
|
|
404
|
-
message: "Entered PIN not the same, please try again",
|
|
405
|
-
position: "top"
|
|
406
|
-
}), te();
|
|
407
|
-
}
|
|
408
|
-
function he(t) {
|
|
409
|
-
U.value = t.slice(0, 50);
|
|
410
|
-
}
|
|
411
|
-
async function be() {
|
|
412
|
-
if (se.value) {
|
|
413
|
-
Z.value = !0;
|
|
414
|
-
try {
|
|
415
|
-
await d.updateDeviceRemark(ee.value === "" ? null : ee.value, o.device.machineId), v.open({
|
|
416
|
-
type: "success",
|
|
417
|
-
message: e("order.deviceRemarkUpdated"),
|
|
418
|
-
position: "top"
|
|
419
|
-
});
|
|
420
|
-
} catch {
|
|
421
|
-
v.open({
|
|
422
|
-
type: "error",
|
|
423
|
-
message: e("order.deviceRemarkUpdateFailed"),
|
|
424
|
-
position: "top"
|
|
425
|
-
});
|
|
426
|
-
} finally {
|
|
427
|
-
Z.value = !1;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
async function ke() {
|
|
432
|
-
await d.updateDevicePin(R.value, o.device.machineId);
|
|
433
|
-
}
|
|
434
|
-
async function ge() {
|
|
435
|
-
await d.unbind(o.device.machineId);
|
|
436
|
-
}
|
|
437
|
-
return (t, b) => {
|
|
438
|
-
const _ = D("FmButton"), g = D("FmTabs"), x = D("FmTextField"), K = D("FmPinField"), Y = D("FmSideSheet"), j = D("FmIcon");
|
|
439
|
-
return p(), y("div", Ne, [
|
|
440
|
-
a("div", Le, [
|
|
441
|
-
a("div", Ue, [
|
|
442
|
-
a("span", Ke, i(S.value ? "Tablet" : "Kiosk"), 1),
|
|
443
|
-
S.value && n.device.slotInfo ? (p(), y("span", je, i(n.device.slotInfo), 1)) : $("", !0)
|
|
444
|
-
]),
|
|
445
|
-
a("div", qe, [
|
|
446
|
-
m(Y, {
|
|
447
|
-
header: n.device.name,
|
|
448
|
-
"dismiss-away": "",
|
|
449
|
-
maxWidth: 700,
|
|
450
|
-
"onOn:clickedAway": te
|
|
451
|
-
}, {
|
|
452
|
-
"side-sheet-button": J(() => [
|
|
453
|
-
m(_, {
|
|
454
|
-
variant: "tertiary",
|
|
455
|
-
icon: "more_vert"
|
|
456
|
-
})
|
|
457
|
-
]),
|
|
458
|
-
default: J(() => {
|
|
459
|
-
var ce;
|
|
460
|
-
return [
|
|
461
|
-
h.value ? (p(), y("div", it, [
|
|
462
|
-
a("div", st, [
|
|
463
|
-
a("div", lt, [
|
|
464
|
-
a("span", ct, i(C.value), 1),
|
|
465
|
-
a("span", dt, [
|
|
466
|
-
A.value ? $("", !0) : (p(), ae(K, {
|
|
467
|
-
key: 0,
|
|
468
|
-
length: 4,
|
|
469
|
-
onComplete: b[1] || (b[1] = (I) => le(I))
|
|
470
|
-
})),
|
|
471
|
-
A.value ? (p(), ae(K, {
|
|
472
|
-
key: 1,
|
|
473
|
-
length: 4,
|
|
474
|
-
onComplete: b[2] || (b[2] = (I) => le(I))
|
|
475
|
-
})) : $("", !0)
|
|
476
|
-
])
|
|
477
|
-
]),
|
|
478
|
-
m(_, {
|
|
479
|
-
class: "w-1/3",
|
|
480
|
-
variant: "secondary",
|
|
481
|
-
label: s(e)("order.cancelResetPin"),
|
|
482
|
-
onClick: te
|
|
483
|
-
}, null, 8, ["label"])
|
|
484
|
-
])
|
|
485
|
-
])) : (p(), y("div", He, [
|
|
486
|
-
a("div", null, [
|
|
487
|
-
m(g, {
|
|
488
|
-
"model-value": L.value,
|
|
489
|
-
"onUpdate:modelValue": b[0] || (b[0] = (I) => L.value = I),
|
|
490
|
-
items: me.value,
|
|
491
|
-
showMoreAt: 99
|
|
492
|
-
}, null, 8, ["model-value", "items"])
|
|
493
|
-
]),
|
|
494
|
-
L.value === "app" ? (p(), y("div", We, [
|
|
495
|
-
a("span", Ye, i(s(e)("order.deviceAppInfo")), 1),
|
|
496
|
-
a("div", ze, [
|
|
497
|
-
(p(!0), y(G, null, Q(ve.value, (I) => (p(), y("div", {
|
|
498
|
-
key: I.label,
|
|
499
|
-
class: "flex flex-col gap-1"
|
|
500
|
-
}, [
|
|
501
|
-
a("span", Ge, i(I.label), 1),
|
|
502
|
-
a("span", {
|
|
503
|
-
class: _e(["fm-typo-en-body-md-600 text-fm-color-typo-primary break-all", I.isMono ? "font-mono text-sm" : ""])
|
|
504
|
-
}, i(I.value), 3)
|
|
505
|
-
]))), 128))
|
|
506
|
-
]),
|
|
507
|
-
a("div", Qe, [
|
|
508
|
-
a("span", Je, i(s(e)("order.deviceRemark")), 1),
|
|
509
|
-
m(x, {
|
|
510
|
-
"model-value": U.value,
|
|
511
|
-
placeholder: s(e)("order.deviceRemarkPlaceholder"),
|
|
512
|
-
"onUpdate:modelValue": he
|
|
513
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
514
|
-
a("div", Xe, [
|
|
515
|
-
a("span", Ze, i(U.value.length) + "/50 ", 1),
|
|
516
|
-
m(_, {
|
|
517
|
-
class: "w-auto",
|
|
518
|
-
variant: "secondary",
|
|
519
|
-
label: s(e)("order.saveDeviceRemark"),
|
|
520
|
-
disabled: !se.value || Z.value,
|
|
521
|
-
onClick: be
|
|
522
|
-
}, null, 8, ["label", "disabled"])
|
|
523
|
-
]),
|
|
524
|
-
a("span", et, i(s(e)("order.current")) + ": " + i(W.value || s(e)("order.notSet")), 1)
|
|
525
|
-
]),
|
|
526
|
-
m(_, {
|
|
527
|
-
class: "w-full",
|
|
528
|
-
variant: "primary",
|
|
529
|
-
label: (ce = n.device) != null && ce.pinInfo ? s(e)("order.resetDevicePin") : s(e)("order.setDevicePin"),
|
|
530
|
-
onClick: fe
|
|
531
|
-
}, null, 8, ["label"])
|
|
532
|
-
])) : L.value === "other" && u.value ? (p(), y("div", tt, [
|
|
533
|
-
a("span", nt, i(s(e)("order.other")), 1),
|
|
534
|
-
(p(!0), y(G, null, Q(r.value, (I) => (p(), y("div", {
|
|
535
|
-
key: I.key,
|
|
536
|
-
class: "flex flex-col gap-2"
|
|
537
|
-
}, [
|
|
538
|
-
a("span", ot, i(I.title), 1),
|
|
539
|
-
(p(!0), y(G, null, Q(I.entries, (ne) => (p(), y("div", {
|
|
540
|
-
key: ne.label,
|
|
541
|
-
class: "flex flex-col gap-1"
|
|
542
|
-
}, [
|
|
543
|
-
a("span", at, i(ne.label), 1),
|
|
544
|
-
a("span", rt, i(ne.value), 1)
|
|
545
|
-
]))), 128))
|
|
546
|
-
]))), 128))
|
|
547
|
-
])) : $("", !0)
|
|
548
|
-
]))
|
|
549
|
-
];
|
|
550
|
-
}),
|
|
551
|
-
_: 1
|
|
552
|
-
}, 8, ["header"]),
|
|
553
|
-
m(_, {
|
|
554
|
-
variant: "plain",
|
|
555
|
-
icon: "link_off",
|
|
556
|
-
class: "text-fm-color-system-error-300",
|
|
557
|
-
onClick: X
|
|
558
|
-
})
|
|
559
|
-
])
|
|
560
|
-
]),
|
|
561
|
-
a("div", {
|
|
562
|
-
class: "fm-typo-en-body-md-600 text-fm-color-typo-primary mb-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
563
|
-
title: n.device.name
|
|
564
|
-
}, i(n.device.name), 9, ut),
|
|
565
|
-
a("div", {
|
|
566
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
567
|
-
title: W.value || s(e)("order.notSet")
|
|
568
|
-
}, i(s(e)("order.deviceRemark")) + ": " + i(W.value || s(e)("order.notSet")), 9, pt),
|
|
569
|
-
a("div", {
|
|
570
|
-
class: "flex items-center gap-1 mb-2 cursor-pointer group",
|
|
571
|
-
onClick: V,
|
|
572
|
-
title: s(e)("order.clickToCopy")
|
|
573
|
-
}, [
|
|
574
|
-
a("span", vt, i(M.value), 1),
|
|
575
|
-
m(j, {
|
|
576
|
-
name: "content_copy",
|
|
577
|
-
class: "text-fm-color-typo-tertiary opacity-0 group-hover:opacity-100 transition-opacity"
|
|
578
|
-
})
|
|
579
|
-
], 8, mt),
|
|
580
|
-
a("div", ft, [
|
|
581
|
-
a("span", yt, [
|
|
582
|
-
m(j, { name: "smartphone" }),
|
|
583
|
-
z(" v" + i(n.device.deviceAppVersion ?? "?"), 1)
|
|
584
|
-
]),
|
|
585
|
-
n.device.deviceAppOTAVersion ? (p(), y("span", ht, [
|
|
586
|
-
m(j, { name: "system_update" }),
|
|
587
|
-
z(" " + i(n.device.deviceAppOTAVersion), 1)
|
|
588
|
-
])) : $("", !0),
|
|
589
|
-
a("span", bt, [
|
|
590
|
-
m(j, { name: "lock" }),
|
|
591
|
-
z(" " + i(B.value ? s(e)("order.pinSet") : s(e)("order.noPin")), 1)
|
|
592
|
-
]),
|
|
593
|
-
n.device.lastStartup ? (p(), y("span", {
|
|
594
|
-
key: 1,
|
|
595
|
-
class: "flex items-center gap-1",
|
|
596
|
-
title: O(n.device.lastStartup)
|
|
597
|
-
}, [
|
|
598
|
-
m(j, { name: "schedule" }),
|
|
599
|
-
z(" " + i(E(n.device.lastStartup)), 1)
|
|
600
|
-
], 8, kt)) : $("", !0)
|
|
601
|
-
])
|
|
602
|
-
]);
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
}), _t = { class: "flex flex-col gap-4" }, xt = { class: "flex items-center justify-between" }, It = { class: "flex flex-col gap-2" }, Tt = { class: "fm-typo-en-title-sm-600 block" }, wt = { class: "fm-typo-en-body-md-400 block" }, At = { class: "flex items-center gap-3 flex-wrap" }, Pt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, Dt = { class: "grid grid-cols-2 gap-2 py-8" }, St = {
|
|
606
|
-
key: 0,
|
|
607
|
-
class: "text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400 col-span-2"
|
|
608
|
-
}, Ct = {
|
|
609
|
-
key: 1,
|
|
610
|
-
class: "text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400 col-span-2"
|
|
611
|
-
}, Ot = /* @__PURE__ */ re({
|
|
612
|
-
__name: "KioskDevicesView",
|
|
613
|
-
props: {
|
|
614
|
-
devices: {}
|
|
615
|
-
},
|
|
616
|
-
emits: ["requestOtp"],
|
|
617
|
-
setup(n) {
|
|
618
|
-
const { t: e } = ie(), f = n, v = P(""), d = P("all"), h = T(() => {
|
|
619
|
-
switch (d.value) {
|
|
620
|
-
case "tablet":
|
|
621
|
-
return e("order.tabletOnly");
|
|
622
|
-
case "kiosk":
|
|
623
|
-
return e("order.kioskOnly");
|
|
624
|
-
default:
|
|
625
|
-
return e("order.allTypes");
|
|
626
|
-
}
|
|
627
|
-
}), o = T(() => {
|
|
628
|
-
let l = f.devices;
|
|
629
|
-
d.value === "tablet" ? l = l.filter((r) => r.deviceAppType === "TABLET_APP") : d.value === "kiosk" && (l = l.filter((r) => r.deviceAppType !== "TABLET_APP"));
|
|
630
|
-
const c = v.value.toLowerCase().trim();
|
|
631
|
-
return c && (l = l.filter((r) => {
|
|
632
|
-
var S, M, V, E;
|
|
633
|
-
const u = ((S = r.name) == null ? void 0 : S.toLowerCase()) || "", w = ((M = r.machineId) == null ? void 0 : M.toLowerCase()) || "", F = ((V = r.slotInfo) == null ? void 0 : V.toLowerCase()) || "", k = ((E = r.remarkInfo) == null ? void 0 : E.toLowerCase()) || "";
|
|
634
|
-
return u.includes(c) || w.includes(c) || F.includes(c) || k.includes(c);
|
|
635
|
-
})), l.sort((r, u) => r.deviceAppType === "TABLET_APP" && u.deviceAppType !== "TABLET_APP" ? -1 : r.deviceAppType !== "TABLET_APP" && u.deviceAppType === "TABLET_APP" ? 1 : r.deviceAppType === "TABLET_APP" && u.deviceAppType === "TABLET_APP" ? (r.slotInfo || "").localeCompare(u.slotInfo || "") : (r.name || "").localeCompare(u.name || ""));
|
|
636
|
-
});
|
|
637
|
-
return (l, c) => {
|
|
638
|
-
const r = D("FmButton"), u = D("FmSearch"), w = D("FmMenuItem"), F = D("FmMenu");
|
|
639
|
-
return p(), y("div", null, [
|
|
640
|
-
a("div", _t, [
|
|
641
|
-
a("div", xt, [
|
|
642
|
-
a("div", It, [
|
|
643
|
-
a("span", Tt, i(s(e)("order.kioskDisplay")), 1),
|
|
644
|
-
a("span", wt, i(s(e)("order.kioskDisplayDescription")), 1)
|
|
645
|
-
]),
|
|
646
|
-
m(r, {
|
|
647
|
-
variant: "primary",
|
|
648
|
-
label: s(e)("order.bindDevice"),
|
|
649
|
-
size: "md",
|
|
650
|
-
"prepend-icon": "link",
|
|
651
|
-
onClick: c[0] || (c[0] = (k) => l.$emit("requestOtp"))
|
|
652
|
-
}, null, 8, ["label"])
|
|
653
|
-
]),
|
|
654
|
-
a("div", At, [
|
|
655
|
-
m(u, {
|
|
656
|
-
"model-value": v.value,
|
|
657
|
-
"onUpdate:modelValue": c[1] || (c[1] = (k) => v.value = k),
|
|
658
|
-
class: "flex-1 min-w-[200px] max-w-[400px]",
|
|
659
|
-
placeholder: s(e)("order.searchDevices")
|
|
660
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
661
|
-
m(F, null, {
|
|
662
|
-
"menu-button": J(() => [
|
|
663
|
-
m(r, {
|
|
664
|
-
variant: "tertiary",
|
|
665
|
-
"prepend-icon": "filter_list",
|
|
666
|
-
label: h.value,
|
|
667
|
-
class: "fm-typo-en-body-md-600"
|
|
668
|
-
}, null, 8, ["label"])
|
|
669
|
-
]),
|
|
670
|
-
default: J(() => [
|
|
671
|
-
m(w, {
|
|
672
|
-
"model-value": d.value === "all",
|
|
673
|
-
label: s(e)("order.allTypes"),
|
|
674
|
-
onClick: c[2] || (c[2] = (k) => d.value = "all")
|
|
675
|
-
}, null, 8, ["model-value", "label"]),
|
|
676
|
-
m(w, {
|
|
677
|
-
"model-value": d.value === "tablet",
|
|
678
|
-
label: s(e)("order.tabletOnly"),
|
|
679
|
-
onClick: c[3] || (c[3] = (k) => d.value = "tablet")
|
|
680
|
-
}, null, 8, ["model-value", "label"]),
|
|
681
|
-
m(w, {
|
|
682
|
-
"model-value": d.value === "kiosk",
|
|
683
|
-
label: s(e)("order.kioskOnly"),
|
|
684
|
-
onClick: c[4] || (c[4] = (k) => d.value = "kiosk")
|
|
685
|
-
}, null, 8, ["model-value", "label"])
|
|
686
|
-
]),
|
|
687
|
-
_: 1
|
|
688
|
-
}),
|
|
689
|
-
a("span", Pt, i(s(e)("order.showingDevices", { count: o.value.length, total: n.devices.length })), 1)
|
|
690
|
-
]),
|
|
691
|
-
a("div", Dt, [
|
|
692
|
-
(p(!0), y(G, null, Q(o.value, (k) => (p(), ae(gt, {
|
|
693
|
-
key: k.machineId,
|
|
694
|
-
device: k
|
|
695
|
-
}, null, 8, ["device"]))), 128)),
|
|
696
|
-
o.value.length === 0 && n.devices.length > 0 ? (p(), y("div", St, i(s(e)("order.noDevicesMatch")), 1)) : $("", !0),
|
|
697
|
-
n.devices.length === 0 ? (p(), y("div", Ct, i(s(e)("order.noDevicesBound")), 1)) : $("", !0)
|
|
698
|
-
])
|
|
699
|
-
])
|
|
700
|
-
]);
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
export {
|
|
705
|
-
Ot as _,
|
|
706
|
-
Be as u
|
|
707
|
-
};
|