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