@feedmepos/mf-report 5.21.29-beta.7 → 5.21.29-beta.8
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/{App-BFFm-mBy.js → App-sbMpp5WT.js} +92 -94
- package/dist/app.js +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { defineComponent as se, resolveComponent as V, createBlock as ie, openBlock as
|
|
2
|
-
import { detectLocale as
|
|
3
|
-
import { u as
|
|
4
|
-
import { storeToRefs as
|
|
1
|
+
import { defineComponent as se, resolveComponent as V, createBlock as ie, openBlock as R, unref as d, isRef as Oe, withCtx as z, createElementVNode as M, createVNode as W, toDisplayString as ee, createTextVNode as we, onMounted as ue, watch as q, ref as A, computed as te, onBeforeMount as Ce, onBeforeUnmount as Ee, createElementBlock as Q, Fragment as ke } from "vue";
|
|
2
|
+
import { detectLocale as N, useCoreStore as j } from "@feedmepos/mf-common";
|
|
3
|
+
import { u as Ae, d as u, a as Ne, b as ne, c as Te, e as Be, f as Fe, s as $e, g as xe } from "./vue-i18n-BdbYuMnB.js";
|
|
4
|
+
import { storeToRefs as L } from "pinia";
|
|
5
5
|
import { u as re, a as Je, b as Ue } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BHDUNZTW.js";
|
|
6
6
|
import { u as ze, _ as Qe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CW6iYOsZ.js";
|
|
7
7
|
import { u as ae } from "./message-dialog-UoMWOnil.js";
|
|
8
8
|
import { useRoute as je, useRouter as Ve } from "vue-router";
|
|
9
9
|
const We = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Pe = /* @__PURE__ */ se({
|
|
10
10
|
__name: "Dialog",
|
|
11
|
-
setup(
|
|
12
|
-
const { t:
|
|
13
|
-
return (
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
modelValue: c
|
|
17
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
11
|
+
setup(_) {
|
|
12
|
+
const { t: i } = Ae(), f = ae(), { isOpened: c, message: S, title: D } = L(ae());
|
|
13
|
+
return (l, g) => {
|
|
14
|
+
const b = V("FmButton"), T = V("FmDialog");
|
|
15
|
+
return R(), ie(T, {
|
|
16
|
+
modelValue: d(c),
|
|
17
|
+
"onUpdate:modelValue": g[0] || (g[0] = (B) => Oe(c) ? c.value = B : null),
|
|
18
18
|
overlay: "",
|
|
19
19
|
"close-button": !1
|
|
20
20
|
}, {
|
|
21
21
|
"dialog-header": z(() => [
|
|
22
|
-
we(ee(
|
|
22
|
+
we(ee(d(D)), 1)
|
|
23
23
|
]),
|
|
24
24
|
default: z(() => [
|
|
25
|
-
M("p", We, ee(
|
|
25
|
+
M("p", We, ee(d(S)), 1)
|
|
26
26
|
]),
|
|
27
27
|
"dialog-footer": z(() => [
|
|
28
28
|
g[1] || (g[1] = M("div", { class: "grow" }, null, -1)),
|
|
29
|
-
W(
|
|
30
|
-
label:
|
|
29
|
+
W(b, {
|
|
30
|
+
label: d(i)("report.common.cancel"),
|
|
31
31
|
variant: "tertiary",
|
|
32
|
-
onClick:
|
|
32
|
+
onClick: d(f).dismiss
|
|
33
33
|
}, null, 8, ["label", "onClick"]),
|
|
34
|
-
W(
|
|
35
|
-
label:
|
|
36
|
-
onClick:
|
|
34
|
+
W(b, {
|
|
35
|
+
label: d(i)("report.common.confirm"),
|
|
36
|
+
onClick: d(f).confirm
|
|
37
37
|
}, null, 8, ["label", "onClick"])
|
|
38
38
|
]),
|
|
39
39
|
_: 1
|
|
40
40
|
}, 8, ["modelValue"]);
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
}), oe = A(
|
|
43
|
+
}), oe = A(N());
|
|
44
44
|
function Ge() {
|
|
45
|
-
const
|
|
46
|
-
switch (oe.value =
|
|
45
|
+
const _ = (i) => {
|
|
46
|
+
switch (oe.value = i, i) {
|
|
47
47
|
case "zh-CN":
|
|
48
48
|
u.locale("zh-cn");
|
|
49
49
|
break;
|
|
@@ -53,26 +53,36 @@ function Ge() {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
return ue(() => {
|
|
56
|
-
|
|
57
|
-
}),
|
|
56
|
+
_(N());
|
|
57
|
+
}), q(() => N(), _, { deep: !0, immediate: !0 }), {
|
|
58
58
|
currentLocale: oe
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
u.locale(
|
|
61
|
+
u.locale(N() === "zh-CN" ? "zh-cn" : "en");
|
|
62
62
|
const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
63
63
|
__name: "App",
|
|
64
|
-
setup(
|
|
65
|
-
const { businessId:
|
|
66
|
-
|
|
67
|
-
[() =>
|
|
64
|
+
setup(_) {
|
|
65
|
+
const { businessId: i, token: f, country: c } = L(Ne()), { sessionUser: S, currentBusiness: D, currentCountry: l, registerSidebarComponent: g } = j(), { getRestaurantAndWarehouse: b, getBusinessSetting: T, beginBusinessLoad: B, completeBusinessLoad: ce } = ne(), { getFeatureFlags: de } = Te(), { version: m } = L(re()), { getSettings: le } = Be(), { promptLoader: fe } = Fe(), n = je(), F = Ve(), I = Je(), P = ze(), r = ne(), me = re(), { suppressReportRouteSync: O } = L(me), pe = te(() => `https://portal-v1.feedmedev.cc/b/${i.value}/report/CLOSE_UP?showHeader=false&country=${c.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), ge = te(() => `https://report-v4.feedmedev.cc?businessId=${i.value}&country=${c.value}&token=${f.value}&reportV3Button=true`);
|
|
66
|
+
q(
|
|
67
|
+
[() => D.value, () => S.value, () => l.value],
|
|
68
68
|
() => {
|
|
69
69
|
var t, a;
|
|
70
|
-
const e = ((t =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
const e = ((t = D.value) == null ? void 0 : t.id) ?? "";
|
|
71
|
+
if (D.value && S.value && l.value) {
|
|
72
|
+
$e(l.value), i.value !== e && (i.value = e);
|
|
73
|
+
let s = !1;
|
|
74
|
+
c.value !== l.value && (c.value = l.value, s = !0), f.value = ((a = S.value) == null ? void 0 : a.token) ?? "", c.value = l.value ?? "", n.query.businessId !== i.value && F.replace({
|
|
75
|
+
name: n.name,
|
|
76
|
+
params: n.params,
|
|
77
|
+
query: {
|
|
78
|
+
...n.query,
|
|
79
|
+
businessId: i.value,
|
|
80
|
+
country: l.value,
|
|
81
|
+
isAllLocation: s ? "true" : "false",
|
|
82
|
+
locationIds: s ? void 0 : n.query.locationIds
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
76
86
|
},
|
|
77
87
|
{ immediate: !0 }
|
|
78
88
|
);
|
|
@@ -80,7 +90,7 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
80
90
|
if (typeof e.data == "string")
|
|
81
91
|
try {
|
|
82
92
|
const t = JSON.parse(e.data);
|
|
83
|
-
(t == null ? void 0 : t.token) !== "" && (t == null ? void 0 : t.token) !== void 0 && (
|
|
93
|
+
(t == null ? void 0 : t.token) !== "" && (t == null ? void 0 : t.token) !== void 0 && (f.value = t.token);
|
|
84
94
|
} catch (t) {
|
|
85
95
|
console.error(t);
|
|
86
96
|
}
|
|
@@ -94,16 +104,16 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
94
104
|
console.error(t);
|
|
95
105
|
}
|
|
96
106
|
}
|
|
97
|
-
|
|
107
|
+
q(m, () => {
|
|
98
108
|
["v3", "v4"].includes(m.value) ? j().hideSidebarToggle(!0) : j().hideSidebarToggle(!1);
|
|
99
|
-
}),
|
|
109
|
+
}), Ce(() => {
|
|
100
110
|
g(Qe);
|
|
101
111
|
}), ue(() => {
|
|
102
|
-
console.log("5.21.29-beta.
|
|
103
|
-
}),
|
|
104
|
-
window.removeEventListener("message", G), window.removeEventListener("message", K),
|
|
112
|
+
console.log("5.21.29-beta.8", !0), window.addEventListener("message", G), window.addEventListener("message", K);
|
|
113
|
+
}), Ee(() => {
|
|
114
|
+
window.removeEventListener("message", G), window.removeEventListener("message", K), I.$dispose(), P.$dispose();
|
|
105
115
|
});
|
|
106
|
-
const { getReports: ye, getOverviewReport: ve, getReportConfig: H, currentReportId: X } =
|
|
116
|
+
const { getReports: ye, getOverviewReport: ve, getReportConfig: H, currentReportId: X } = I, { currentReportId: Se, reports: De } = L(I), { getSchema: Ie } = Ue(), { fetchSchedules: he } = P, { init: Re } = xe(), $ = A("v5"), w = A(!1), x = A(!0);
|
|
107
117
|
function qe(e) {
|
|
108
118
|
try {
|
|
109
119
|
return decodeURIComponent(e);
|
|
@@ -116,14 +126,14 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
116
126
|
const t = e.includes("%") ? [e, qe(e)] : [e];
|
|
117
127
|
for (const a of t)
|
|
118
128
|
try {
|
|
119
|
-
const
|
|
120
|
-
if (typeof
|
|
129
|
+
const s = JSON.parse(a);
|
|
130
|
+
if (typeof s == "string")
|
|
121
131
|
try {
|
|
122
|
-
return JSON.parse(
|
|
132
|
+
return JSON.parse(s);
|
|
123
133
|
} catch {
|
|
124
|
-
return
|
|
134
|
+
return s;
|
|
125
135
|
}
|
|
126
|
-
return
|
|
136
|
+
return s;
|
|
127
137
|
} catch {
|
|
128
138
|
}
|
|
129
139
|
}
|
|
@@ -133,22 +143,22 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
133
143
|
return typeof t.hour == "number" && typeof t.minute == "number";
|
|
134
144
|
}
|
|
135
145
|
function Le() {
|
|
136
|
-
const e = n.query.startDate ? u(n.query.startDate).startOf("day").toISOString() : void 0, t = n.query.endDate ? u(n.query.endDate).endOf("day").toISOString() : void 0, a = typeof n.query.timeStart == "string",
|
|
137
|
-
let
|
|
146
|
+
const e = n.query.startDate ? u(n.query.startDate).startOf("day").toISOString() : void 0, t = n.query.endDate ? u(n.query.endDate).endOf("day").toISOString() : void 0, a = typeof n.query.timeStart == "string", s = typeof n.query.timeEnd == "string", p = C(n.query.timeStart), h = C(n.query.timeEnd), E = Y(p) ? p : null, k = Y(h) ? h : null, J = n.query.compareStartDate ? u(n.query.compareStartDate).startOf("day").toISOString() : void 0, U = n.query.compareEndDate ? u(n.query.compareEndDate).endOf("day").toISOString() : void 0, Z = n.query.isAllLocation === "true";
|
|
147
|
+
let y = [];
|
|
138
148
|
if (Z)
|
|
139
|
-
|
|
149
|
+
y = r.selectedLocationIds;
|
|
140
150
|
else {
|
|
141
151
|
const o = C(n.query.locationIds);
|
|
142
|
-
|
|
152
|
+
y = Array.isArray(o) ? o : [];
|
|
143
153
|
}
|
|
144
|
-
let
|
|
145
|
-
if (De.value.find((o) => o.id ===
|
|
154
|
+
let v = n.query.reportId || X;
|
|
155
|
+
if (De.value.find((o) => o.id === v) || (v = X), v && v !== I.currentReportId && I.updateCurrentReportId(v), e || t) {
|
|
146
156
|
const o = r.dateRange;
|
|
147
157
|
(o.startDate !== e || o.endDate !== t) && r.setDateRange({ startDate: e, endDate: t });
|
|
148
158
|
}
|
|
149
|
-
if (a ||
|
|
159
|
+
if (a || s) {
|
|
150
160
|
const o = r.timeRange;
|
|
151
|
-
(o.start !==
|
|
161
|
+
(o.start !== E || o.end !== k) && r.setTimeRange({ start: E, end: k });
|
|
152
162
|
}
|
|
153
163
|
if (J || U) {
|
|
154
164
|
const o = r.compareDateRange;
|
|
@@ -157,13 +167,13 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
157
167
|
endDate: U
|
|
158
168
|
});
|
|
159
169
|
}
|
|
160
|
-
if (!Z && Array.isArray(
|
|
170
|
+
if (!Z && Array.isArray(y)) {
|
|
161
171
|
const o = r.selectedLocationIds;
|
|
162
|
-
o.length ===
|
|
172
|
+
o.length === y.length && o.every((_e, be) => _e === y[be]) || r.setSelectedLocationIds(y);
|
|
163
173
|
}
|
|
164
174
|
return {
|
|
165
175
|
// TODO: this returned value can used for getBusinessSetting
|
|
166
|
-
reportId:
|
|
176
|
+
reportId: v,
|
|
167
177
|
startDate: n.query.startDate,
|
|
168
178
|
endDate: n.query.endDate,
|
|
169
179
|
timeStart: n.query.timeStart,
|
|
@@ -174,22 +184,10 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
174
184
|
isAllLocation: n.query.isAllLocation
|
|
175
185
|
};
|
|
176
186
|
}
|
|
177
|
-
return
|
|
178
|
-
() =>
|
|
179
|
-
async (e, t) => {
|
|
180
|
-
!e || e === t || (r.setSelectedLocationIds([]), y.value !== void 0 && (y.value = !0), await w.replace({
|
|
181
|
-
name: n.name,
|
|
182
|
-
params: n.params,
|
|
183
|
-
query: {
|
|
184
|
-
...n.query,
|
|
185
|
-
country: e
|
|
186
|
-
}
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
), D(
|
|
190
|
-
() => s.value,
|
|
187
|
+
return q(
|
|
188
|
+
() => i.value,
|
|
191
189
|
async (e) => {
|
|
192
|
-
e !== "" && (
|
|
190
|
+
e !== "" && (w.value = !1, B(e), x.value || (r.setSelectedLocationIds([]), F.replace({
|
|
193
191
|
name: n.name,
|
|
194
192
|
params: n.params,
|
|
195
193
|
query: {
|
|
@@ -197,7 +195,7 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
197
195
|
locationIds: void 0,
|
|
198
196
|
isAllLocation: "true"
|
|
199
197
|
}
|
|
200
|
-
})),
|
|
198
|
+
})), O.value !== void 0 && (O.value = !0), await fe(async () => {
|
|
201
199
|
await Re({
|
|
202
200
|
apiKey: "MaGoXrEWuEJNpWgKTqseee",
|
|
203
201
|
url: "https://flag.feedme.farm/api/v1/",
|
|
@@ -212,21 +210,21 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
212
210
|
ye(),
|
|
213
211
|
Ie(),
|
|
214
212
|
he(),
|
|
215
|
-
|
|
213
|
+
b(
|
|
216
214
|
(() => {
|
|
217
215
|
const a = C(n.query.locationIds);
|
|
218
216
|
return Array.isArray(a) ? a : void 0;
|
|
219
217
|
})()
|
|
220
218
|
),
|
|
221
219
|
le()
|
|
222
|
-
]), await
|
|
223
|
-
}),
|
|
220
|
+
]), await T(), Le(), ce(e);
|
|
221
|
+
}), w.value = !0, x.value && (x.value = !1));
|
|
224
222
|
},
|
|
225
223
|
{
|
|
226
224
|
immediate: !0
|
|
227
225
|
}
|
|
228
|
-
),
|
|
229
|
-
() => (
|
|
226
|
+
), q(
|
|
227
|
+
() => (w.value, {
|
|
230
228
|
reportId: Se.value,
|
|
231
229
|
selectedLocationIds: r.selectedLocationIds,
|
|
232
230
|
dateRange: r.dateRange,
|
|
@@ -234,43 +232,43 @@ const Ke = ["src"], He = ["src"], it = /* @__PURE__ */ se({
|
|
|
234
232
|
compareDateRange: r.compareDateRange
|
|
235
233
|
}),
|
|
236
234
|
(e) => {
|
|
237
|
-
if (!
|
|
238
|
-
if (
|
|
239
|
-
|
|
235
|
+
if (!w.value || !e.reportId) return;
|
|
236
|
+
if (O.value) {
|
|
237
|
+
O.value = !1;
|
|
240
238
|
return;
|
|
241
239
|
}
|
|
242
|
-
const t = e.selectedLocationIds, a = e.dateRange,
|
|
240
|
+
const t = e.selectedLocationIds, a = e.dateRange, s = e.timeRange, p = e.compareDateRange, h = {
|
|
243
241
|
...n.query,
|
|
244
242
|
reportId: e.reportId,
|
|
245
243
|
startDate: a.startDate ? u(a.startDate).startOf("day").toISOString() : void 0,
|
|
246
244
|
endDate: a.endDate ? u(a.endDate).endOf("day").toISOString() : void 0,
|
|
247
|
-
compareStartDate:
|
|
248
|
-
compareEndDate:
|
|
249
|
-
timeStart:
|
|
250
|
-
timeEnd:
|
|
245
|
+
compareStartDate: p.startDate ? u(p.startDate).startOf("day").toISOString() : void 0,
|
|
246
|
+
compareEndDate: p.endDate ? u(p.endDate).endOf("day").toISOString() : void 0,
|
|
247
|
+
timeStart: s.start ? JSON.stringify(s.start) : void 0,
|
|
248
|
+
timeEnd: s.end ? JSON.stringify(s.end) : void 0,
|
|
251
249
|
locationIds: t.length === r.locations.length ? void 0 : t.length > 0 ? JSON.stringify(t) : void 0,
|
|
252
250
|
isAllLocation: String(t.length === r.locations.length)
|
|
253
|
-
},
|
|
254
|
-
|
|
251
|
+
}, E = JSON.stringify(n.query), k = JSON.stringify(h);
|
|
252
|
+
E !== k && F.replace({
|
|
255
253
|
name: n.name,
|
|
256
254
|
params: n.params,
|
|
257
|
-
query:
|
|
255
|
+
query: h
|
|
258
256
|
});
|
|
259
257
|
},
|
|
260
258
|
{ deep: !0 }
|
|
261
259
|
), Ge(), (e, t) => {
|
|
262
260
|
const a = V("router-view");
|
|
263
|
-
return
|
|
261
|
+
return R(), Q(ke, null, [
|
|
264
262
|
W(Pe),
|
|
265
|
-
|
|
263
|
+
d(m) === "v3" ? (R(), Q("iframe", {
|
|
266
264
|
key: 0,
|
|
267
265
|
class: "bg-white h-full w-full",
|
|
268
266
|
src: pe.value
|
|
269
|
-
}, null, 8, Ke)) :
|
|
267
|
+
}, null, 8, Ke)) : d(m) === "v4" ? (R(), Q("iframe", {
|
|
270
268
|
key: 1,
|
|
271
269
|
class: "bg-white h-full w-full",
|
|
272
270
|
src: ge.value
|
|
273
|
-
}, null, 8, He)) : (
|
|
271
|
+
}, null, 8, He)) : (R(), ie(a, { key: 2 }))
|
|
274
272
|
], 64);
|
|
275
273
|
};
|
|
276
274
|
}
|
package/dist/app.js
CHANGED