@feedmepos/mf-report 5.18.2-beta.6 → 5.18.2-beta.7
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-CMeRHKED.js → App-BUVxeHtS.js} +81 -78
- package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-DLAmjLpT.js → BaseDialog.vue_vue_type_script_setup_true_lang-CosfLSAK.js} +206 -205
- package/dist/{Default.vue_vue_type_script_setup_true_lang-az465cWp.js → Default.vue_vue_type_script_setup_true_lang-B8mqpG-f.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-Cg9Q0Alk.js → DynamicWidget.vue_vue_type_script_setup_true_lang-D1AmPGmI.js} +1 -1
- package/dist/{InsightView-C580gT_F.js → InsightView-2B4zxc6S.js} +2 -2
- package/dist/{Layout-Cg6B3_PB.js → Layout-DH5761CT.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-mevBIWGb.js → MenuTab.vue_vue_type_script_setup_true_lang-103BmSWV.js} +2 -2
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CbS3wT-Z.js → NavigationTab.vue_vue_type_script_setup_true_lang-BOYdr23L.js} +1 -1
- package/dist/{OverviewView-DPlvHfbM.js → OverviewView-DWhYeQ5V.js} +4 -4
- package/dist/{Report-CYFbRFXI.js → Report-DMCHIIqx.js} +106 -106
- package/dist/{ReportEditor-CDdWFzYL.js → ReportEditor-WH2wUATq.js} +3 -3
- package/dist/{ReportView-vZTFkb70.js → ReportView-Cu2AUgIO.js} +5 -5
- package/dist/{Setting-B31bz7Ok.js → Setting-DL_36mI4.js} +2 -2
- package/dist/{TileEditor-C_hRfM-H.js → TileEditor-BKO4E-sg.js} +3 -3
- package/dist/{TransitionFade-K0ZfP5kz.js → TransitionFade--t2l2y8W.js} +2 -2
- package/dist/app.js +9 -9
- package/package.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as M, resolveComponent as x, createBlock as ee, openBlock as h, unref as u, isRef as ye, withCtx as F, createElementVNode as G, createVNode as J, toDisplayString as K, createTextVNode as Se, onMounted as te, watch as R, ref as A, computed as P, onBeforeMount as De, onBeforeUnmount as Ie, createElementBlock as $, Fragment as he } from "vue";
|
|
2
2
|
import { detectLocale as C, useCoreStore as B } from "@feedmepos/mf-common";
|
|
3
|
-
import { u as
|
|
4
|
-
import { storeToRefs as
|
|
5
|
-
import { u as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { u as
|
|
8
|
-
import { useRoute as
|
|
9
|
-
const
|
|
3
|
+
import { u as Re, d as i, a as qe, b as H, c as Oe, e as _e, f as we, s as Le, g as be } from "./vue-i18n-Cjs2Btd-.js";
|
|
4
|
+
import { storeToRefs as q } from "pinia";
|
|
5
|
+
import { u as X, a as Ce, b as Ee } from "./BaseDialog.vue_vue_type_script_setup_true_lang-CosfLSAK.js";
|
|
6
|
+
import { _ as ke, u as Ne } from "./NavigationTab.vue_vue_type_script_setup_true_lang-BOYdr23L.js";
|
|
7
|
+
import { u as Y } from "./message-dialog-UoMWOnil.js";
|
|
8
|
+
import { useRoute as Fe, useRouter as $e } from "vue-router";
|
|
9
|
+
const Be = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, xe = /* @__PURE__ */ M({
|
|
10
10
|
__name: "Dialog",
|
|
11
|
-
setup(
|
|
12
|
-
const { t: r } =
|
|
13
|
-
return (
|
|
14
|
-
const
|
|
15
|
-
return h(),
|
|
11
|
+
setup(O) {
|
|
12
|
+
const { t: r } = Re(), f = Y(), { isOpened: c, message: S, title: D } = q(Y());
|
|
13
|
+
return (_, g) => {
|
|
14
|
+
const w = x("FmButton"), E = x("FmDialog");
|
|
15
|
+
return h(), ee(E, {
|
|
16
16
|
modelValue: u(c),
|
|
17
|
-
"onUpdate:modelValue": g[0] || (g[0] = (k) =>
|
|
17
|
+
"onUpdate:modelValue": g[0] || (g[0] = (k) => ye(c) ? c.value = k : null),
|
|
18
18
|
overlay: "",
|
|
19
19
|
"close-button": !1
|
|
20
20
|
}, {
|
|
21
21
|
"dialog-header": F(() => [
|
|
22
|
-
|
|
22
|
+
Se(K(u(D)), 1)
|
|
23
23
|
]),
|
|
24
24
|
default: F(() => [
|
|
25
|
-
|
|
25
|
+
G("p", Be, K(u(S)), 1)
|
|
26
26
|
]),
|
|
27
27
|
"dialog-footer": F(() => [
|
|
28
|
-
g[1] || (g[1] =
|
|
29
|
-
J(
|
|
28
|
+
g[1] || (g[1] = G("div", { class: "grow" }, null, -1)),
|
|
29
|
+
J(w, {
|
|
30
30
|
label: u(r)("report.common.cancel"),
|
|
31
31
|
variant: "tertiary",
|
|
32
32
|
onClick: u(f).dismiss
|
|
33
33
|
}, null, 8, ["label", "onClick"]),
|
|
34
|
-
J(
|
|
34
|
+
J(w, {
|
|
35
35
|
label: u(r)("report.common.confirm"),
|
|
36
36
|
onClick: u(f).confirm
|
|
37
37
|
}, null, 8, ["label", "onClick"])
|
|
@@ -40,10 +40,10 @@ const Fe = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, $e
|
|
|
40
40
|
}, 8, ["modelValue"]);
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
switch (
|
|
43
|
+
}), Z = A(C());
|
|
44
|
+
function Je() {
|
|
45
|
+
const O = (r) => {
|
|
46
|
+
switch (Z.value = r, r) {
|
|
47
47
|
case "zh-CN":
|
|
48
48
|
i.locale("zh-cn");
|
|
49
49
|
break;
|
|
@@ -52,23 +52,23 @@ function Be() {
|
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
}), R(() => C(),
|
|
58
|
-
currentLocale:
|
|
55
|
+
return te(() => {
|
|
56
|
+
O(C());
|
|
57
|
+
}), R(() => C(), O, { deep: !0, immediate: !0 }), {
|
|
58
|
+
currentLocale: Z
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
i.locale(C() === "zh-CN" ? "zh-cn" : "en");
|
|
62
|
-
const
|
|
62
|
+
const Ae = ["src"], Te = ["src"], Ye = /* @__PURE__ */ M({
|
|
63
63
|
__name: "App",
|
|
64
|
-
setup(
|
|
65
|
-
const { businessId: r, token: f, country: c } =
|
|
64
|
+
setup(O) {
|
|
65
|
+
const { businessId: r, token: f, country: c } = q(qe()), { sessionUser: S, currentBusiness: D, currentCountry: _, registerSidebarComponent: g } = B(), { getRestaurantAndWarehouse: w, getBusinessSetting: E } = H(), { getFeatureFlags: k } = Oe(), { version: p } = q(X()), { getSettings: ae } = _e(), { promptLoader: ne } = we(), e = Fe(), T = $e(), re = X(), { suppressReportRouteSync: U } = q(re), oe = P(() => `https://portal-v1.feedmedev.cc/b/${r.value}/report/CLOSE_UP?showHeader=false&country=${c.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), se = P(() => `https://report-v4.feedmedev.cc?businessId=${r.value}&country=${c.value}&token=${f.value}&reportV3Button=true`);
|
|
66
66
|
R(
|
|
67
|
-
[() => D.value, () => S.value, () =>
|
|
67
|
+
[() => D.value, () => S.value, () => _.value],
|
|
68
68
|
() => {
|
|
69
69
|
var t, o;
|
|
70
70
|
const a = ((t = D.value) == null ? void 0 : t.id) ?? "";
|
|
71
|
-
D.value && S.value &&
|
|
71
|
+
D.value && S.value && _.value && (Le(c.value), r.value !== a && (r.value = a), f.value = ((o = S.value) == null ? void 0 : o.token) ?? "", c.value = _.value ?? "", e.query.businessId !== r.value && T.replace({
|
|
72
72
|
name: e.name,
|
|
73
73
|
params: e.params,
|
|
74
74
|
query: { ...e.query, businessId: r.value }
|
|
@@ -76,7 +76,7 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
76
76
|
},
|
|
77
77
|
{ immediate: !0 }
|
|
78
78
|
);
|
|
79
|
-
function
|
|
79
|
+
function z(a) {
|
|
80
80
|
if (typeof a.data == "string")
|
|
81
81
|
try {
|
|
82
82
|
const t = JSON.parse(a.data);
|
|
@@ -85,7 +85,7 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
85
85
|
console.error(t);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Q(a) {
|
|
89
89
|
if (typeof a.data == "string")
|
|
90
90
|
try {
|
|
91
91
|
const t = JSON.parse(a.data);
|
|
@@ -96,22 +96,22 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
96
96
|
}
|
|
97
97
|
R(p, () => {
|
|
98
98
|
["v3", "v4"].includes(p.value) ? B().hideSidebarToggle(!0) : B().hideSidebarToggle(!1);
|
|
99
|
-
}),
|
|
100
|
-
g(
|
|
101
|
-
}),
|
|
102
|
-
console.log("5.18.2-beta.
|
|
99
|
+
}), De(() => {
|
|
100
|
+
g(ke);
|
|
101
|
+
}), te(() => {
|
|
102
|
+
console.log("5.18.2-beta.7", !0), window.addEventListener("message", z), window.addEventListener("message", Q);
|
|
103
103
|
});
|
|
104
|
-
const I =
|
|
105
|
-
|
|
106
|
-
window.removeEventListener("message",
|
|
104
|
+
const I = Ce(), V = Ne(), n = H();
|
|
105
|
+
Ie(() => {
|
|
106
|
+
window.removeEventListener("message", z), window.removeEventListener("message", Q), I.$dispose(), V.$dispose();
|
|
107
107
|
});
|
|
108
|
-
const { getReports:
|
|
109
|
-
function
|
|
110
|
-
const a = e.query.startDate ? i(e.query.startDate).startOf("day").toISOString() : void 0, t = e.query.endDate ? i(e.query.endDate).endOf("day").toISOString() : void 0, o = e.query.timeStart ? JSON.parse(e.query.timeStart) : void 0, l = e.query.timeEnd ? JSON.parse(e.query.timeEnd) : void 0, d = e.query.compareStartDate ? i(e.query.compareStartDate).startOf("day").toISOString() : void 0,
|
|
108
|
+
const { getReports: ie, getOverviewReport: ue, getReportConfig: j, currentReportId: W } = I, { currentReportId: ce, reports: le } = q(I), { getSchema: de } = Ee(), { fetchSchedules: me } = V, { init: fe } = be(), N = A("v5"), L = A(!1);
|
|
109
|
+
function pe() {
|
|
110
|
+
const a = e.query.startDate ? i(e.query.startDate).startOf("day").toISOString() : void 0, t = e.query.endDate ? i(e.query.endDate).endOf("day").toISOString() : void 0, o = e.query.timeStart ? JSON.parse(e.query.timeStart) : void 0, l = e.query.timeEnd ? JSON.parse(e.query.timeEnd) : void 0, d = e.query.compareStartDate ? i(e.query.compareStartDate).startOf("day").toISOString() : void 0, v = e.query.compareEndDate ? i(e.query.compareEndDate).endOf("day").toISOString() : void 0, b = e.query.isAllLocation === "true";
|
|
111
111
|
let m = [];
|
|
112
|
-
|
|
113
|
-
let
|
|
114
|
-
if (
|
|
112
|
+
b ? m = n.selectedLocationIds : m = e.query.locationIds ? JSON.parse(e.query.locationIds) : void 0;
|
|
113
|
+
let y = e.query.reportId || W;
|
|
114
|
+
if (le.value.find((s) => s.id === y) || (y = W), y && y !== I.currentReportId && I.updateCurrentReportId(y), a || t) {
|
|
115
115
|
const s = n.dateRange;
|
|
116
116
|
(s.startDate !== a || s.endDate !== t) && n.setDateRange({ startDate: a, endDate: t });
|
|
117
117
|
}
|
|
@@ -119,20 +119,20 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
119
119
|
const s = n.timeRange;
|
|
120
120
|
(s.start !== o || s.end !== l) && n.setTimeRange({ start: o, end: l });
|
|
121
121
|
}
|
|
122
|
-
if (d ||
|
|
122
|
+
if (d || v) {
|
|
123
123
|
const s = n.compareDateRange;
|
|
124
|
-
(s.startDate !== d || s.endDate !==
|
|
124
|
+
(s.startDate !== d || s.endDate !== v) && n.setCompareDateRange({
|
|
125
125
|
startDate: d,
|
|
126
|
-
endDate:
|
|
126
|
+
endDate: v
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
if (!
|
|
129
|
+
if (!b && Array.isArray(m)) {
|
|
130
130
|
const s = n.selectedLocationIds;
|
|
131
|
-
s.length === m.length && s.every((
|
|
131
|
+
s.length === m.length && s.every((ge, ve) => ge === m[ve]) || n.setSelectedLocationIds(m);
|
|
132
132
|
}
|
|
133
133
|
return {
|
|
134
134
|
// TODO: this returned value can used for getBusinessSetting
|
|
135
|
-
reportId:
|
|
135
|
+
reportId: y,
|
|
136
136
|
startDate: e.query.startDate,
|
|
137
137
|
endDate: e.query.endDate,
|
|
138
138
|
timeStart: e.query.timeStart,
|
|
@@ -146,8 +146,8 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
146
146
|
return R(
|
|
147
147
|
() => r.value,
|
|
148
148
|
async (a) => {
|
|
149
|
-
a !== "" && (
|
|
150
|
-
await
|
|
149
|
+
a !== "" && (L.value = !1, await ne(async () => {
|
|
150
|
+
await fe({
|
|
151
151
|
apiKey: "MaGoXrEWuEJNpWgKTqseee",
|
|
152
152
|
url: "https://flag.feedme.farm/api/v1/",
|
|
153
153
|
enableAnalytics: !1,
|
|
@@ -157,32 +157,35 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
157
157
|
N.value = t.version, p.value = N.value, await Promise.all([
|
|
158
158
|
k(),
|
|
159
159
|
j(),
|
|
160
|
-
oe(),
|
|
161
|
-
re(),
|
|
162
160
|
ue(),
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
ie(),
|
|
162
|
+
de(),
|
|
163
|
+
me(),
|
|
164
|
+
w(
|
|
165
165
|
e.query.locationIds ? JSON.parse(e.query.locationIds) : null
|
|
166
166
|
),
|
|
167
|
-
|
|
168
|
-
]), await E(),
|
|
169
|
-
}),
|
|
167
|
+
ae()
|
|
168
|
+
]), await E(), pe();
|
|
169
|
+
}), L.value = !0);
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
immediate: !0
|
|
173
173
|
}
|
|
174
174
|
), R(
|
|
175
|
-
() => (
|
|
176
|
-
reportId:
|
|
175
|
+
() => (L.value, {
|
|
176
|
+
reportId: ce.value,
|
|
177
177
|
selectedLocationIds: n.selectedLocationIds,
|
|
178
178
|
dateRange: n.dateRange,
|
|
179
179
|
timeRange: n.timeRange,
|
|
180
180
|
compareDateRange: n.compareDateRange
|
|
181
181
|
}),
|
|
182
182
|
(a) => {
|
|
183
|
-
if (!
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
if (!L.value || !a.reportId) return;
|
|
184
|
+
if (U.value) {
|
|
185
|
+
U.value = !1;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const t = a.selectedLocationIds, o = a.dateRange, l = a.timeRange, d = a.compareDateRange, v = {
|
|
186
189
|
...e.query,
|
|
187
190
|
reportId: a.reportId,
|
|
188
191
|
startDate: o.startDate ? i(o.startDate).startOf("day").toISOString() : void 0,
|
|
@@ -193,31 +196,31 @@ const xe = ["src"], Je = ["src"], He = /* @__PURE__ */ Y({
|
|
|
193
196
|
timeEnd: l.end ? JSON.stringify(l.end) : void 0,
|
|
194
197
|
locationIds: t.length === n.locations.length ? null : t.length > 0 ? JSON.stringify(t) : void 0,
|
|
195
198
|
isAllLocation: String(t.length === n.locations.length)
|
|
196
|
-
},
|
|
197
|
-
|
|
199
|
+
}, b = JSON.stringify(e.query), m = JSON.stringify(v);
|
|
200
|
+
b !== m && T.replace({
|
|
198
201
|
name: e.name,
|
|
199
202
|
params: e.params,
|
|
200
|
-
query:
|
|
203
|
+
query: v
|
|
201
204
|
});
|
|
202
205
|
},
|
|
203
206
|
{ deep: !0 }
|
|
204
|
-
),
|
|
207
|
+
), Je(), (a, t) => {
|
|
205
208
|
const o = x("router-view");
|
|
206
|
-
return h(), $(
|
|
207
|
-
J(
|
|
209
|
+
return h(), $(he, null, [
|
|
210
|
+
J(xe),
|
|
208
211
|
u(p) === "v3" ? (h(), $("iframe", {
|
|
209
212
|
key: 0,
|
|
210
213
|
class: "bg-white h-full w-full",
|
|
211
|
-
src:
|
|
212
|
-
}, null, 8,
|
|
214
|
+
src: oe.value
|
|
215
|
+
}, null, 8, Ae)) : u(p) === "v4" ? (h(), $("iframe", {
|
|
213
216
|
key: 1,
|
|
214
217
|
class: "bg-white h-full w-full",
|
|
215
|
-
src:
|
|
216
|
-
}, null, 8,
|
|
218
|
+
src: se.value
|
|
219
|
+
}, null, 8, Te)) : (h(), ee(o, { key: 2 }))
|
|
217
220
|
], 64);
|
|
218
221
|
};
|
|
219
222
|
}
|
|
220
223
|
});
|
|
221
224
|
export {
|
|
222
|
-
|
|
225
|
+
Ye as default
|
|
223
226
|
};
|