@feedmepos/mf-report 5.27.13 → 5.27.14-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-BlHs_KyM.js → App-CcdMlfSd.js} +96 -95
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-OQRT1HAp.js +389 -0
- package/dist/{Default.vue_vue_type_script_setup_true_lang-CxR3luuJ.js → Default.vue_vue_type_script_setup_true_lang-BoZCI7kN.js} +1 -1
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DJTZFtNV.js +5079 -0
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-oCAIT-ax.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-faQ1wSGW.js} +5193 -4810
- package/dist/{InsightView-N5Lzz_b4.js → InsightView-B7hXryQe.js} +4 -4
- package/dist/{Integration-BotRTI4i.js → Integration-Cm0DNd94.js} +3 -3
- package/dist/{Integrations-B26o5QXd.js → Integrations-s2XnL_lQ.js} +2 -2
- package/dist/{Layout-6NKUqxol.js → Layout-BaxsdPkO.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BijCez3Y.js → MenuTab.vue_vue_type_script_setup_true_lang-D-uVoZ83.js} +4 -4
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CA9MugVT.js → NavigationTab.vue_vue_type_script_setup_true_lang-40Mxqpsi.js} +2795 -2779
- package/dist/{OverviewView-vdfq-4MN.js → OverviewView-YYCDda7Z.js} +4 -4
- package/dist/{Report-Dz8mKOpQ.js → Report-fQv1rMXB.js} +3 -3
- package/dist/ReportEditor-BQi5vZ5G.js +1828 -0
- package/dist/{ReportView-DHNMt0BV.js → ReportView-CePzSNVf.js} +6 -6
- package/dist/{Setting-Cpy5DtfI.js → Setting-DA1IUerO.js} +14 -14
- package/dist/{Template-6U_iB8qy.js → Template-BNwoCMjJ.js} +3 -3
- package/dist/TileEditor-EBbG7Odu.js +4064 -0
- package/dist/TileGrid.vue_vue_type_script_setup_true_lang-BseyYYvj.js +154 -0
- package/dist/{TransitionFade-C7B6bWjS.js → TransitionFade-vNYa-qkr.js} +760 -828
- package/dist/{app-Dz4qiCQj.js → app-D2QVuN8P.js} +388 -291
- package/dist/app.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useRestaurantPermission-DDTn3OLP.js → useRestaurantPermission-qFfSh5xv.js} +1 -1
- package/package.json +1 -1
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-B9yWyW2A.js +0 -383
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-BZdgw5zR.js +0 -4922
- package/dist/ReportEditor-CSq4R2KR.js +0 -1826
- package/dist/TileEditor-REt2Wbx9.js +0 -4036
- package/dist/TileGrid.vue_vue_type_script_setup_true_lang-D0rrgUXG.js +0 -152
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as ue, resolveComponent as H, createBlock as
|
|
2
|
-
import { detectLocale as U, useCoreStore as
|
|
3
|
-
import { d as u, u as
|
|
1
|
+
import { defineComponent as ue, resolveComponent as H, createBlock as de, openBlock as E, unref as d, isRef as ke, withCtx as W, createElementVNode as ne, createVNode as X, toDisplayString as ae, createTextVNode as Te, onMounted as le, watch as C, ref as Q, computed as oe, onBeforeMount as Ne, onBeforeUnmount as qe, createElementBlock as K, Fragment as Fe } from "vue";
|
|
2
|
+
import { detectLocale as U, useCoreStore as P } from "@feedmepos/mf-common";
|
|
3
|
+
import { d as u, u as $e, a as re, b as Be, c as se, e as xe, f as Je, s as Qe, t as G } from "./app-D2QVuN8P.js";
|
|
4
4
|
import { storeToRefs as k } from "pinia";
|
|
5
5
|
import { u as Ue, a as ze } from "./_plugin-vue_export-helper-onplcgja.js";
|
|
6
|
-
import { u as je, a as Ve } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { u as
|
|
6
|
+
import { u as je, a as Ve } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-faQ1wSGW.js";
|
|
7
|
+
import { u as We, _ as Ke } from "./NavigationTab.vue_vue_type_script_setup_true_lang-40Mxqpsi.js";
|
|
8
8
|
import { u as ie } from "./message-dialog-UoMWOnil.js";
|
|
9
|
-
import { useRoute as
|
|
9
|
+
import { useRoute as Pe, useRouter as Ge } from "vue-router";
|
|
10
10
|
const He = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Xe = /* @__PURE__ */ ue({
|
|
11
11
|
__name: "Dialog",
|
|
12
12
|
setup(T) {
|
|
13
13
|
const { t: c } = Ue(), p = ie(), { isOpened: g, message: _, title: L } = k(ie());
|
|
14
14
|
return (O, I) => {
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
modelValue:
|
|
15
|
+
const N = H("FmButton"), z = H("FmDialog");
|
|
16
|
+
return E(), de(z, {
|
|
17
|
+
modelValue: d(g),
|
|
18
18
|
"onUpdate:modelValue": I[0] || (I[0] = (j) => ke(g) ? g.value = j : null),
|
|
19
19
|
overlay: "",
|
|
20
20
|
"close-button": !1,
|
|
21
21
|
"z-index": 3e3
|
|
22
22
|
}, {
|
|
23
|
-
"dialog-header":
|
|
24
|
-
Te(ae(
|
|
23
|
+
"dialog-header": W(() => [
|
|
24
|
+
Te(ae(d(L)), 1)
|
|
25
25
|
]),
|
|
26
|
-
default:
|
|
27
|
-
ne("p", He, ae(
|
|
26
|
+
default: W(() => [
|
|
27
|
+
ne("p", He, ae(d(_)), 1)
|
|
28
28
|
]),
|
|
29
|
-
"dialog-footer":
|
|
29
|
+
"dialog-footer": W(() => [
|
|
30
30
|
I[1] || (I[1] = ne("div", { class: "grow" }, null, -1)),
|
|
31
|
-
X(
|
|
32
|
-
label:
|
|
31
|
+
X(N, {
|
|
32
|
+
label: d(c)("report.common.cancel"),
|
|
33
33
|
variant: "tertiary",
|
|
34
|
-
onClick:
|
|
34
|
+
onClick: d(p).dismiss
|
|
35
35
|
}, null, 8, ["label", "onClick"]),
|
|
36
|
-
X(
|
|
37
|
-
label:
|
|
38
|
-
onClick:
|
|
36
|
+
X(N, {
|
|
37
|
+
label: d(c)("report.common.confirm"),
|
|
38
|
+
onClick: d(p).confirm
|
|
39
39
|
}, null, 8, ["label", "onClick"])
|
|
40
40
|
]),
|
|
41
41
|
_: 1
|
|
@@ -54,18 +54,18 @@ function Ye() {
|
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
return
|
|
57
|
+
return le(() => {
|
|
58
58
|
T(U());
|
|
59
|
-
}),
|
|
59
|
+
}), C(() => U(), T, { deep: !0, immediate: !0 }), {
|
|
60
60
|
currentLocale: ce
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
u.locale(U() === "zh-CN" ? "zh-cn" : "en");
|
|
64
|
-
const Ze = ["src"], Me = ["src"],
|
|
64
|
+
const Ze = ["src"], Me = ["src"], mt = /* @__PURE__ */ ue({
|
|
65
65
|
__name: "App",
|
|
66
66
|
setup(T) {
|
|
67
|
-
const { businessId: c, token: p, country: g } = k(
|
|
68
|
-
|
|
67
|
+
const { businessId: c, token: p, country: g } = k($e()), { sessionUser: _, currentBusiness: L, currentCountry: O, registerSidebarComponent: I } = P(), { getRestaurantAndWarehouse: N, getBusinessSetting: z, beginBusinessLoad: j, completeBusinessLoad: me } = re(), fe = Be(), { getFeatureFlags: pe } = fe, { version: v } = k(se()), { getSettings: ge } = xe(), { promptLoader: ve } = ze(), a = Pe(), q = Ge(), w = je(), Y = We(), o = re(), b = se(), { suppressReportRouteSync: F } = k(b), { getReports: ye, getOverviewReport: Se, getReportConfig: De, currentReportId: Z } = w, { currentReportId: Ie, reports: he } = k(w), { getSchema: Re } = Ve(), { fetchSchedules: _e } = Y, { init: Le } = Je(), V = Q("v5"), $ = Q(!1), B = Q(!0), Oe = oe(() => `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`), we = oe(() => `https://report-v4.feedmedev.cc?businessId=${c.value}&country=${g.value}&token=${p.value}&reportV3Button=true`);
|
|
68
|
+
C(
|
|
69
69
|
[() => L.value, () => _.value, () => O.value],
|
|
70
70
|
() => {
|
|
71
71
|
var e, n;
|
|
@@ -92,13 +92,13 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
92
92
|
console.error(e);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
["v3", "v4"].includes(v.value) ?
|
|
97
|
-
}), Fe(() => {
|
|
98
|
-
I(Ge);
|
|
99
|
-
}), de(() => {
|
|
100
|
-
console.log("5.27.13", !0), window.addEventListener("message", M), window.addEventListener("message", ee);
|
|
95
|
+
C(v, () => {
|
|
96
|
+
["v3", "v4"].includes(v.value) ? P().hideSidebarToggle(!0) : P().hideSidebarToggle(!1);
|
|
101
97
|
}), Ne(() => {
|
|
98
|
+
I(Ke);
|
|
99
|
+
}), le(() => {
|
|
100
|
+
console.log("5.27.14-beta.0", !0), window.addEventListener("message", M), window.addEventListener("message", ee);
|
|
101
|
+
}), qe(() => {
|
|
102
102
|
window.removeEventListener("message", M), window.removeEventListener("message", ee), w.$dispose(), Y.$dispose();
|
|
103
103
|
});
|
|
104
104
|
function be(t) {
|
|
@@ -113,14 +113,14 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
113
113
|
const e = t.includes("%") ? [t, be(t)] : [t];
|
|
114
114
|
for (const n of e)
|
|
115
115
|
try {
|
|
116
|
-
const
|
|
117
|
-
if (typeof
|
|
116
|
+
const r = JSON.parse(n);
|
|
117
|
+
if (typeof r == "string")
|
|
118
118
|
try {
|
|
119
|
-
return JSON.parse(
|
|
119
|
+
return JSON.parse(r);
|
|
120
120
|
} catch {
|
|
121
|
-
return
|
|
121
|
+
return r;
|
|
122
122
|
}
|
|
123
|
-
return
|
|
123
|
+
return r;
|
|
124
124
|
} catch {
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -130,33 +130,33 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
130
130
|
return typeof e.hour == "number" && typeof e.minute == "number";
|
|
131
131
|
}
|
|
132
132
|
function Ae(t = a.query) {
|
|
133
|
-
const e = t, n = e.startDate ? u(e.startDate).startOf("day").toISOString() : void 0,
|
|
133
|
+
const e = t, n = e.startDate ? u(e.startDate).startOf("day").toISOString() : void 0, r = e.endDate ? u(e.endDate).endOf("day").toISOString() : void 0, l = typeof e.timeStart == "string", i = typeof e.timeEnd == "string", m = x(e.timeStart), y = x(e.timeEnd), f = te(m) ? m : null, J = te(y) ? y : null, A = 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;
|
|
134
134
|
let D = [];
|
|
135
135
|
if (h)
|
|
136
|
-
D =
|
|
136
|
+
D = o.selectedLocationIds ?? [];
|
|
137
137
|
else {
|
|
138
|
-
const
|
|
139
|
-
D = Array.isArray(
|
|
138
|
+
const s = x(e.locationIds);
|
|
139
|
+
D = Array.isArray(s) ? s : [];
|
|
140
140
|
}
|
|
141
141
|
let R = e.reportId || Z;
|
|
142
|
-
if (he.value.find((
|
|
143
|
-
const
|
|
144
|
-
(
|
|
142
|
+
if (he.value.find((s) => s.id === R) || (R = Z), R && R !== w.currentReportId && w.updateCurrentReportId(R), n || r) {
|
|
143
|
+
const s = o.dateRange;
|
|
144
|
+
(s.startDate !== n || s.endDate !== r) && o.setDateRange({ startDate: n, endDate: r });
|
|
145
145
|
}
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
(
|
|
146
|
+
if (l || i) {
|
|
147
|
+
const s = o.timeRange;
|
|
148
|
+
(s.start !== f || s.end !== J) && o.setTimeRange({ start: f, end: J });
|
|
149
149
|
}
|
|
150
150
|
if (A || S) {
|
|
151
|
-
const
|
|
152
|
-
(
|
|
151
|
+
const s = o.compareDateRange;
|
|
152
|
+
(s.startDate !== A || s.endDate !== S) && o.setCompareDateRange({
|
|
153
153
|
startDate: A,
|
|
154
154
|
endDate: S
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
if (!h) {
|
|
158
|
-
const
|
|
159
|
-
|
|
158
|
+
const s = o.selectedLocationIds;
|
|
159
|
+
s.length === D.length && s.every((Ee, Ce) => Ee === D[Ce]) || o.setSelectedLocationIds(D);
|
|
160
160
|
}
|
|
161
161
|
return {
|
|
162
162
|
// TODO: this returned value can used for getBusinessSetting
|
|
@@ -171,63 +171,63 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
171
171
|
isAllLocation: e.isAllLocation
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
return
|
|
174
|
+
return C(
|
|
175
175
|
() => c.value,
|
|
176
176
|
async (t, e) => {
|
|
177
177
|
if (t !== "") {
|
|
178
|
-
|
|
179
|
-
const n = "mf-report-prev-business-id",
|
|
178
|
+
$.value = !1, j(t);
|
|
179
|
+
const n = "mf-report-prev-business-id", r = (() => {
|
|
180
180
|
try {
|
|
181
181
|
return sessionStorage.getItem(n);
|
|
182
182
|
} catch {
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
|
-
})(),
|
|
186
|
-
let i = { ...a.query },
|
|
187
|
-
if (!B.value || e !== void 0 ||
|
|
188
|
-
|
|
189
|
-
const { locationIds: y, ...
|
|
185
|
+
})(), l = !!r && r !== t;
|
|
186
|
+
let i = { ...a.query }, m = !1;
|
|
187
|
+
if (!B.value || e !== void 0 || l) {
|
|
188
|
+
o.setSelectedLocationIds([]);
|
|
189
|
+
const { locationIds: y, ...f } = a.query;
|
|
190
190
|
i = {
|
|
191
|
-
...
|
|
191
|
+
...f,
|
|
192
192
|
isAllLocation: "true"
|
|
193
|
-
},
|
|
193
|
+
}, m = !0, await q.replace({
|
|
194
194
|
name: a.name,
|
|
195
195
|
params: a.params,
|
|
196
196
|
query: i
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
F.value !== void 0 && (F.value = !0), await ve(async () => {
|
|
200
200
|
await Le({
|
|
201
|
-
apiKey: "
|
|
201
|
+
apiKey: "MaGoXrEWuEJNpWgKTqseee",
|
|
202
202
|
url: "https://flag.feedme.farm/api/v1/",
|
|
203
203
|
enableAnalytics: !1,
|
|
204
204
|
cacheFlags: !1
|
|
205
205
|
});
|
|
206
206
|
const y = await De();
|
|
207
|
-
V.value = y.version, v.value = V.value, await pe(), a.name === "template" && !b.canAccessTemplate() && await
|
|
207
|
+
V.value = y.version, v.value = V.value, await pe(), a.name === "template" && !b.canAccessTemplate() && await q.replace({
|
|
208
208
|
name: "reports",
|
|
209
209
|
query: a.query
|
|
210
210
|
});
|
|
211
|
-
const
|
|
212
|
-
|
|
211
|
+
const f = b.canAccess(
|
|
212
|
+
G.report_accessOverview
|
|
213
213
|
), J = b.canAccess(
|
|
214
|
-
|
|
214
|
+
G.report_accessSetting
|
|
215
215
|
), A = b.canAccess(
|
|
216
|
-
|
|
216
|
+
G.report_accessIntegration
|
|
217
217
|
), S = [
|
|
218
218
|
Re(),
|
|
219
219
|
_e(),
|
|
220
220
|
ye(),
|
|
221
|
-
|
|
221
|
+
N(
|
|
222
222
|
(() => {
|
|
223
223
|
const h = x(i.locationIds);
|
|
224
224
|
return Array.isArray(h) ? h : void 0;
|
|
225
225
|
})()
|
|
226
226
|
)
|
|
227
227
|
];
|
|
228
|
-
if (
|
|
228
|
+
if (f && S.push(Se()), A && S.push(ge()), await Promise.all(S), J && await z(), Ae(i), m) {
|
|
229
229
|
const { locationIds: h, ...D } = a.query;
|
|
230
|
-
(a.query.locationIds !== void 0 || a.query.isAllLocation !== "true") && await
|
|
230
|
+
(a.query.locationIds !== void 0 || a.query.isAllLocation !== "true") && await q.replace({
|
|
231
231
|
name: a.name,
|
|
232
232
|
params: a.params,
|
|
233
233
|
query: {
|
|
@@ -236,44 +236,45 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
me(t);
|
|
240
240
|
try {
|
|
241
241
|
sessionStorage.setItem(n, t);
|
|
242
242
|
} catch {
|
|
243
243
|
}
|
|
244
|
-
}),
|
|
244
|
+
}), $.value = !0, B.value && (B.value = !1);
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
248
|
immediate: !0
|
|
249
249
|
}
|
|
250
|
-
),
|
|
251
|
-
() => (
|
|
250
|
+
), C(
|
|
251
|
+
() => ($.value, {
|
|
252
252
|
reportId: Ie.value,
|
|
253
|
-
selectedLocationIds:
|
|
254
|
-
dateRange:
|
|
255
|
-
timeRange:
|
|
256
|
-
compareDateRange:
|
|
253
|
+
selectedLocationIds: o.selectedLocationIds,
|
|
254
|
+
dateRange: o.dateRange,
|
|
255
|
+
timeRange: o.timeRange,
|
|
256
|
+
compareDateRange: o.compareDateRange,
|
|
257
|
+
timezone: o.timezone
|
|
257
258
|
}),
|
|
258
259
|
(t) => {
|
|
259
|
-
if (
|
|
260
|
-
if (
|
|
261
|
-
|
|
260
|
+
if (!$.value || !t.reportId || B.value) return;
|
|
261
|
+
if (F.value) {
|
|
262
|
+
F.value = !1;
|
|
262
263
|
return;
|
|
263
264
|
}
|
|
264
|
-
const e = t.selectedLocationIds, n = t.dateRange,
|
|
265
|
+
const e = t.selectedLocationIds, n = t.dateRange, r = t.timeRange, l = t.compareDateRange, i = {
|
|
265
266
|
...a.query,
|
|
266
267
|
reportId: t.reportId,
|
|
267
268
|
startDate: n.startDate ? u(n.startDate).startOf("day").toISOString() : void 0,
|
|
268
269
|
endDate: n.endDate ? u(n.endDate).endOf("day").toISOString() : void 0,
|
|
269
|
-
compareStartDate:
|
|
270
|
-
compareEndDate:
|
|
271
|
-
timeStart:
|
|
272
|
-
timeEnd:
|
|
273
|
-
},
|
|
274
|
-
i.isAllLocation = String(
|
|
275
|
-
const y = JSON.stringify(a.query),
|
|
276
|
-
y !==
|
|
270
|
+
compareStartDate: l.startDate ? u(l.startDate).startOf("day").toISOString() : void 0,
|
|
271
|
+
compareEndDate: l.endDate ? u(l.endDate).endOf("day").toISOString() : void 0,
|
|
272
|
+
timeStart: r.start ? JSON.stringify(r.start) : void 0,
|
|
273
|
+
timeEnd: r.end ? JSON.stringify(r.end) : void 0
|
|
274
|
+
}, m = e.length === o.locations.length;
|
|
275
|
+
i.isAllLocation = String(m), m ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
|
|
276
|
+
const y = JSON.stringify(a.query), f = JSON.stringify(i);
|
|
277
|
+
y !== f && q.replace({
|
|
277
278
|
name: a.name,
|
|
278
279
|
params: a.params,
|
|
279
280
|
query: i
|
|
@@ -282,21 +283,21 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
282
283
|
{ deep: !0 }
|
|
283
284
|
), Ye(), (t, e) => {
|
|
284
285
|
const n = H("router-view");
|
|
285
|
-
return
|
|
286
|
+
return E(), K(Fe, null, [
|
|
286
287
|
X(Xe),
|
|
287
|
-
|
|
288
|
+
d(v) === "v3" ? (E(), K("iframe", {
|
|
288
289
|
key: 0,
|
|
289
290
|
class: "bg-white h-full w-full",
|
|
290
291
|
src: Oe.value
|
|
291
|
-
}, null, 8, Ze)) :
|
|
292
|
+
}, null, 8, Ze)) : d(v) === "v4" ? (E(), K("iframe", {
|
|
292
293
|
key: 1,
|
|
293
294
|
class: "bg-white h-full w-full",
|
|
294
295
|
src: we.value
|
|
295
|
-
}, null, 8, Me)) : (
|
|
296
|
+
}, null, 8, Me)) : (E(), de(n, { key: 2 }))
|
|
296
297
|
], 64);
|
|
297
298
|
};
|
|
298
299
|
}
|
|
299
300
|
});
|
|
300
301
|
export {
|
|
301
|
-
|
|
302
|
+
mt as default
|
|
302
303
|
};
|