@feedmepos/mf-report 5.28.4-beta.2 → 5.28.4-beta.3
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-CO0rIxWA.js → App-BNdbl8v-.js} +4 -4
- package/dist/{DateRangeSelect-j_1JPSHY.js → DateRangeSelect-DczITWsu.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-BTRNbPiK.js → Default.vue_vue_type_script_setup_true_lang-BPL7To4C.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-D1MP0Koc.js → DynamicWidget.vue_vue_type_script_setup_true_lang-CenrOQ58.js} +4 -4
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CQgXdnVJ.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Dio9m6Jz.js} +3 -3
- package/dist/{InsightView-D3Cq98b1.js → InsightView-CcE2OQ0R.js} +5 -5
- package/dist/{Integration-D1-45oFB.js → Integration-bZ0kl1l-.js} +3 -3
- package/dist/{Integrations-OQyPdZh-.js → Integrations-CKCjfBSD.js} +2 -2
- package/dist/{Layout-Bbhc8Z8O.js → Layout-_uXqK8iF.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-Bv4_DVSD.js → LocationSelect.vue_vue_type_script_setup_true_lang-Dl8s1Do5.js} +2 -2
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DsWBKmfz.js → MenuTab.vue_vue_type_script_setup_true_lang-B4qIaFPZ.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CplZ_0DK.js → NavigationTab.vue_vue_type_script_setup_true_lang-CPULQ1tP.js} +5 -5
- package/dist/{OverviewView-DAYR_-3O.js → OverviewView-hUv0WWJj.js} +4 -4
- package/dist/{Report-4NU9XLHT.js → Report-fXqGDAk7.js} +172 -155
- package/dist/{ReportCanvasView-B-meSoDE.js → ReportCanvasView-CX21rslR.js} +3 -3
- package/dist/{ReportEditor-E-LrtdYl.js → ReportEditor-BAo9nIf7.js} +7 -7
- package/dist/{ReportView-BOBv-FMc.js → ReportView-OyJkdf8K.js} +6 -6
- package/dist/{ReportViewRoute-B5yL1meP.js → ReportViewRoute-C8XeKxEq.js} +2 -2
- package/dist/{Setting-DIUJFKvF.js → Setting-Xqal_aQw.js} +3 -3
- package/dist/{Template-BXHt9ILt.js → Template-8Us5mNqQ.js} +3 -3
- package/dist/{TileEditor-Dfd00DF1.js → TileEditor-Cqfrs4fd.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-CcGtQ7-x.js → TilePageStack.vue_vue_type_script_setup_true_lang-U0BMLySg.js} +2 -2
- package/dist/{TransitionFade-C0h34wzI.js → TransitionFade-SusB-gSL.js} +5 -5
- package/dist/{app-DCn4N0uO.js → app-CDCDr2QW.js} +12 -12
- package/dist/app.js +1 -1
- package/dist/{report-Dt0VwwmM.js → report-CpnEtrkQ.js} +1 -1
- package/dist/{useRestaurantPermission-BAEw8_HZ.js → useRestaurantPermission-CBDedKqH.js} +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,75 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
import { u as Be, s as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { useSnackbar as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { c as
|
|
10
|
-
import { useRouter as
|
|
11
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as Ue, ref as M, watch as ge, computed as P, h as f, withModifiers as Se, resolveComponent as k, createBlock as Z, openBlock as z, withCtx as d, createVNode as c, createElementVNode as h, unref as t, normalizeStyle as Te, normalizeClass as v, withDirectives as he, createElementBlock as Ae, Fragment as Me, renderList as ze, toDisplayString as _, createTextVNode as Je, vShow as we } from "vue";
|
|
2
|
+
import { storeToRefs as Re } from "pinia";
|
|
3
|
+
import { u as Be, s as Ke } from "./report-CpnEtrkQ.js";
|
|
4
|
+
import { _ as Ee } from "./Default.vue_vue_type_script_setup_true_lang-BPL7To4C.js";
|
|
5
|
+
import { u as Ye } from "./message-dialog-UoMWOnil.js";
|
|
6
|
+
import { u as qe } from "./global-loader-BuxFfehu.js";
|
|
7
|
+
import { useSnackbar as He, useBreakpoints as je, components as Ge, FmButtonColorThemeVariant as Qe } from "@feedmepos/ui-library";
|
|
8
|
+
import { _ as We } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
|
|
9
|
+
import { c as Xe, a as Pe, h as Ze } from "./app-CDCDr2QW.js";
|
|
10
|
+
import { useRouter as et, useRoute as tt, onBeforeRouteLeave as ot } from "vue-router";
|
|
11
|
+
import { useI18n as at } from "@feedmepos/mf-common";
|
|
12
12
|
import { r as ee } from "./i18n-DbyciK4x.js";
|
|
13
|
-
const
|
|
13
|
+
const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = { class: "w-[343px]" }, nt = { class: "fm-typo-en-body-md-600" }, ht = /* @__PURE__ */ Ue({
|
|
14
14
|
__name: "Report",
|
|
15
|
-
setup(
|
|
16
|
-
const { t: a, te:
|
|
17
|
-
reports:
|
|
18
|
-
overviewReport:
|
|
15
|
+
setup(lt) {
|
|
16
|
+
const { t: a, te: J } = at(), te = et(), oe = tt(), b = Be(), Ce = Xe(), { business: Ie } = Re(Pe()), {
|
|
17
|
+
reports: u,
|
|
18
|
+
overviewReport: B,
|
|
19
19
|
categories: $,
|
|
20
20
|
pinReport: O,
|
|
21
|
-
isOpenAddReportDialog:
|
|
21
|
+
isOpenAddReportDialog: ke,
|
|
22
22
|
scrollPositionY: ae,
|
|
23
23
|
customReportQuota: F,
|
|
24
24
|
canCreateCustomReport: se
|
|
25
|
-
} =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
} = Re(b), { promptMessage: re } = Ye(), { promptLoader: K } = qe(), l = He(), { breakpoints: p } = je(), { canRead: ne, canUpdate: le, canDuplicate: ce, canDelete: E, canCreateReport: xe } = Ze(), w = M();
|
|
26
|
+
ot(() => {
|
|
27
|
+
w.value && (ae.value = w.value.$el.children[0].scrollTop);
|
|
28
|
+
}), ge(w, () => {
|
|
29
|
+
w.value && setTimeout(() => {
|
|
30
|
+
w.value && (w.value.$el.children[0].scrollTop = ae.value);
|
|
31
31
|
}, 200);
|
|
32
32
|
});
|
|
33
|
-
const Y =
|
|
33
|
+
const Y = P(() => O.value && u.value ? u.value.filter((o) => {
|
|
34
34
|
var e;
|
|
35
35
|
return (e = O.value) == null ? void 0 : e.includes(o.id);
|
|
36
36
|
}) : []);
|
|
37
|
-
|
|
37
|
+
ge(
|
|
38
38
|
[() => Ie.value],
|
|
39
39
|
() => {
|
|
40
40
|
b.refreshPinReport();
|
|
41
41
|
},
|
|
42
42
|
{ immediate: !0 }
|
|
43
43
|
);
|
|
44
|
-
const
|
|
44
|
+
const ie = P(() => Y.value.length > 0 ? u.value.filter(
|
|
45
45
|
(o) => Y.value.findIndex((e) => e.id === o.id) === -1
|
|
46
|
-
) :
|
|
46
|
+
) : u.value), { FmButton: De, FmMenu: q, FmMenuItem: R, FmIcon: H, FmChip: j, FmTooltip: _e, FmSwitch: pe } = Ge, y = M(/* @__PURE__ */ new Set()), de = /* @__PURE__ */ new Set([
|
|
47
|
+
"closeup",
|
|
48
|
+
"dailySales",
|
|
49
|
+
"hourlySales",
|
|
50
|
+
"productSales",
|
|
51
|
+
"discount",
|
|
52
|
+
"addonSales",
|
|
53
|
+
"userProductSales",
|
|
54
|
+
"categorySales",
|
|
55
|
+
"sourceProductSales",
|
|
56
|
+
"slotSales",
|
|
57
|
+
"drawer",
|
|
58
|
+
"counter",
|
|
59
|
+
"timesheet",
|
|
60
|
+
"void_",
|
|
61
|
+
"refund"
|
|
62
|
+
]), ue = P(() => [
|
|
47
63
|
{ value: void 0, label: "All" },
|
|
48
64
|
...$.value.map((o) => ({
|
|
49
65
|
value: o.id,
|
|
50
66
|
label: o.name
|
|
51
67
|
}))
|
|
52
|
-
]), L =
|
|
68
|
+
]), L = M(ue.value[0]), G = M(""), C = P(() => ie.value.length === 0 || $.value.length === 0 ? [] : [
|
|
53
69
|
...Y.value.map((e) => {
|
|
54
70
|
const r = $.value.find((n) => n.id === e.category);
|
|
55
71
|
return {
|
|
56
|
-
name: ee(a,
|
|
72
|
+
name: ee(a, J, e.name, "other"),
|
|
57
73
|
categoryId: (r == null ? void 0 : r.id) ?? "",
|
|
58
74
|
category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
|
|
59
75
|
reportId: e.id,
|
|
@@ -63,14 +79,14 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
63
79
|
canUpdate: le(e),
|
|
64
80
|
canRead: ne(e),
|
|
65
81
|
isSupportPos: !!e.isSupportPos,
|
|
66
|
-
|
|
82
|
+
isMandatoryPosReport: e.isDefault && de.has(e.permissionKey ?? ""),
|
|
67
83
|
reportType: e.reportType
|
|
68
84
|
};
|
|
69
85
|
}),
|
|
70
|
-
...
|
|
86
|
+
...ie.value.map((e) => {
|
|
71
87
|
const r = $.value.find((n) => n.id === e.category);
|
|
72
88
|
return {
|
|
73
|
-
name: ee(a,
|
|
89
|
+
name: ee(a, J, e.name, "other"),
|
|
74
90
|
categoryId: (r == null ? void 0 : r.id) ?? "",
|
|
75
91
|
category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
|
|
76
92
|
reportId: e.id,
|
|
@@ -80,13 +96,13 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
80
96
|
canUpdate: le(e),
|
|
81
97
|
canRead: ne(e),
|
|
82
98
|
isSupportPos: !!e.isSupportPos,
|
|
83
|
-
|
|
99
|
+
isMandatoryPosReport: e.isDefault && de.has(e.permissionKey ?? ""),
|
|
84
100
|
reportType: e.reportType
|
|
85
101
|
};
|
|
86
102
|
})
|
|
87
|
-
].filter((e) => L.value.value && e.categoryId !== L.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(G.value.toLowerCase()) !== -1)),
|
|
88
|
-
() =>
|
|
89
|
-
),
|
|
103
|
+
].filter((e) => L.value.value && e.categoryId !== L.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(G.value.toLowerCase()) !== -1)), $e = P(
|
|
104
|
+
() => C.value.map((o) => `${o.name}${o.category}`).toString()
|
|
105
|
+
), Oe = P(() => [
|
|
90
106
|
{
|
|
91
107
|
accessorKey: "name",
|
|
92
108
|
header: a("report.common.name"),
|
|
@@ -139,7 +155,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
139
155
|
},
|
|
140
156
|
cell: (o) => {
|
|
141
157
|
var m;
|
|
142
|
-
const e = o.row.original, r = e.reportId, n =
|
|
158
|
+
const e = o.row.original, r = e.reportId, n = u.value.find((g) => g.id === r), X = r === ((m = B.value) == null ? void 0 : m.id), T = !e.canRead, D = n ? ce(n) : !1, A = n ? E(n) : !1, s = !e.canUpdate || e.isMandatoryPosReport || y.value.has(r), I = e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), i = [
|
|
143
159
|
{
|
|
144
160
|
label: a("report.common.duplicate"),
|
|
145
161
|
onClick: () => {
|
|
@@ -154,7 +170,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
154
170
|
{
|
|
155
171
|
label: a(X ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
|
|
156
172
|
onClick: async () => {
|
|
157
|
-
n &&
|
|
173
|
+
n && me(n);
|
|
158
174
|
},
|
|
159
175
|
variant: "",
|
|
160
176
|
disabled: !1
|
|
@@ -162,7 +178,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
162
178
|
{
|
|
163
179
|
label: a("report.common.remove"),
|
|
164
180
|
onClick: () => {
|
|
165
|
-
n && (A ?
|
|
181
|
+
n && (A ? ye(n) : l.open({
|
|
166
182
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
167
183
|
type: "error"
|
|
168
184
|
}));
|
|
@@ -179,18 +195,19 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
179
195
|
{
|
|
180
196
|
default: () => [
|
|
181
197
|
f(
|
|
182
|
-
|
|
183
|
-
{ content:
|
|
198
|
+
_e,
|
|
199
|
+
{ content: I, placement: "bottom", zIndex: 2e3 },
|
|
184
200
|
{
|
|
185
201
|
default: () => f(pe, {
|
|
186
202
|
modelValue: e.isSupportPos,
|
|
187
203
|
disabled: s,
|
|
204
|
+
label: a("report.common.showInPOS"),
|
|
188
205
|
"aria-label": a("report.common.showInPOS"),
|
|
189
|
-
class: "mr-2
|
|
206
|
+
class: "mr-2",
|
|
190
207
|
"onUpdate:modelValue": () => {
|
|
191
|
-
n &&
|
|
208
|
+
n && fe(n);
|
|
192
209
|
},
|
|
193
|
-
onClick:
|
|
210
|
+
onClick: Se(() => {
|
|
194
211
|
}, ["stop"])
|
|
195
212
|
})
|
|
196
213
|
}
|
|
@@ -200,8 +217,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
200
217
|
{
|
|
201
218
|
disabled: T,
|
|
202
219
|
title: T ? a("report.messages.noPermission") : void 0,
|
|
203
|
-
onClick:
|
|
204
|
-
n &&
|
|
220
|
+
onClick: Se(() => {
|
|
221
|
+
n && be(n);
|
|
205
222
|
}, ["stop"]),
|
|
206
223
|
class: `text-fm-color-neutral-gray-400 ${e.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
|
|
207
224
|
},
|
|
@@ -228,9 +245,9 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
228
245
|
disabled: !1
|
|
229
246
|
},
|
|
230
247
|
{
|
|
231
|
-
default: () =>
|
|
248
|
+
default: () => i.map(
|
|
232
249
|
(g) => f(
|
|
233
|
-
|
|
250
|
+
R,
|
|
234
251
|
{
|
|
235
252
|
onClick: g.disabled ? {} : g.onClick,
|
|
236
253
|
label: g.label,
|
|
@@ -243,12 +260,12 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
243
260
|
)
|
|
244
261
|
),
|
|
245
262
|
"menu-button": () => f(
|
|
246
|
-
|
|
263
|
+
De,
|
|
247
264
|
{
|
|
248
265
|
variant: "tertiary",
|
|
249
266
|
size: "md",
|
|
250
267
|
icon: "more_vert",
|
|
251
|
-
iconColor:
|
|
268
|
+
iconColor: Qe.NeutralGray400,
|
|
252
269
|
disabled: !1
|
|
253
270
|
},
|
|
254
271
|
{}
|
|
@@ -261,11 +278,11 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
261
278
|
}
|
|
262
279
|
}
|
|
263
280
|
]);
|
|
264
|
-
async function
|
|
281
|
+
async function me(o) {
|
|
265
282
|
await K(async () => {
|
|
266
283
|
var e;
|
|
267
284
|
try {
|
|
268
|
-
const r = o.id === ((e =
|
|
285
|
+
const r = o.id === ((e = B.value) == null ? void 0 : e.id);
|
|
269
286
|
await b.updateDefaultReport(r ? null : o.id), l.open({
|
|
270
287
|
message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
|
|
271
288
|
type: "success"
|
|
@@ -275,24 +292,24 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
275
292
|
}
|
|
276
293
|
});
|
|
277
294
|
}
|
|
278
|
-
async function
|
|
279
|
-
if (!
|
|
280
|
-
|
|
295
|
+
async function fe(o) {
|
|
296
|
+
if (!y.value.has(o.id)) {
|
|
297
|
+
y.value = new Set(y.value).add(o.id);
|
|
281
298
|
try {
|
|
282
299
|
const e = !o.isSupportPos;
|
|
283
|
-
await
|
|
300
|
+
await Ke(o.id, e), o.isSupportPos = e;
|
|
284
301
|
} catch (e) {
|
|
285
302
|
console.log(e), l.open({
|
|
286
303
|
message: a("report.messages.failedToAction", { action: a("report.common.update") }),
|
|
287
304
|
type: "error"
|
|
288
305
|
});
|
|
289
306
|
} finally {
|
|
290
|
-
const e = new Set(
|
|
291
|
-
e.delete(o.id),
|
|
307
|
+
const e = new Set(y.value);
|
|
308
|
+
e.delete(o.id), y.value = e;
|
|
292
309
|
}
|
|
293
310
|
}
|
|
294
311
|
}
|
|
295
|
-
async function
|
|
312
|
+
async function Fe(o) {
|
|
296
313
|
if (await re({
|
|
297
314
|
title: a("report.common.duplicate"),
|
|
298
315
|
message: a("report.messages.confirmAction", {
|
|
@@ -314,15 +331,15 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
314
331
|
}
|
|
315
332
|
}
|
|
316
333
|
function Q(o) {
|
|
317
|
-
const e =
|
|
318
|
-
return !e || !
|
|
334
|
+
const e = u.value.find((r) => r.id === o.reportId);
|
|
335
|
+
return !e || !ce(e);
|
|
319
336
|
}
|
|
320
337
|
function W(o) {
|
|
321
|
-
const e =
|
|
322
|
-
return !o.editable || !e || !
|
|
338
|
+
const e = u.value.find((r) => r.id === o.reportId);
|
|
339
|
+
return !o.editable || !e || !E(e);
|
|
323
340
|
}
|
|
324
|
-
async function
|
|
325
|
-
if (!
|
|
341
|
+
async function ye(o) {
|
|
342
|
+
if (!E(o)) {
|
|
326
343
|
l.open({
|
|
327
344
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
328
345
|
type: "error"
|
|
@@ -345,7 +362,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
345
362
|
}
|
|
346
363
|
async function ve(o) {
|
|
347
364
|
if (se.value)
|
|
348
|
-
await
|
|
365
|
+
await Fe(o);
|
|
349
366
|
else {
|
|
350
367
|
let e = `Your current plan only support up to ${F.value} custom reports.`;
|
|
351
368
|
F.value === 0 && (e = "Your current plan does not support custom report."), l.open({
|
|
@@ -354,8 +371,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
354
371
|
});
|
|
355
372
|
}
|
|
356
373
|
}
|
|
357
|
-
function
|
|
358
|
-
if (!
|
|
374
|
+
function Le() {
|
|
375
|
+
if (!xe.value) {
|
|
359
376
|
l.open({
|
|
360
377
|
message: a("report.messages.noPermission"),
|
|
361
378
|
type: "error"
|
|
@@ -363,7 +380,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
363
380
|
return;
|
|
364
381
|
}
|
|
365
382
|
if (se.value)
|
|
366
|
-
|
|
383
|
+
ke.value = !0;
|
|
367
384
|
else {
|
|
368
385
|
let o = `Your current plan only support up to ${F.value} custom reports.`;
|
|
369
386
|
F.value === 0 && (o = "Your current plan does not support custom report."), l.open({
|
|
@@ -372,8 +389,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
372
389
|
});
|
|
373
390
|
}
|
|
374
391
|
}
|
|
375
|
-
function
|
|
376
|
-
const e = ee(a,
|
|
392
|
+
function be(o) {
|
|
393
|
+
const e = ee(a, J, o.name, "other") ?? "";
|
|
377
394
|
O.value && O.value.includes(o.id) ? (l.open({
|
|
378
395
|
message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
|
|
379
396
|
type: "success"
|
|
@@ -382,15 +399,15 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
382
399
|
type: "success"
|
|
383
400
|
}), b.cachePinReport(o));
|
|
384
401
|
}
|
|
385
|
-
function
|
|
402
|
+
function Ve(o) {
|
|
386
403
|
L.value = o;
|
|
387
404
|
}
|
|
388
|
-
const { selectedLocationIds: x, dateRange: V, compareDateRange: N, timeRange: S, locations:
|
|
405
|
+
const { selectedLocationIds: x, dateRange: V, compareDateRange: N, timeRange: S, locations: Ne } = Pe(), U = P(() => x.length === Ne.length);
|
|
389
406
|
return (o, e) => {
|
|
390
407
|
const r = k("FmPageHead"), n = k("FmSearch"), X = k("FmForm"), T = k("FmListItem"), D = k("FmList"), A = k("FmTable");
|
|
391
|
-
return
|
|
392
|
-
default:
|
|
393
|
-
|
|
408
|
+
return z(), Z(Ee, null, {
|
|
409
|
+
default: d(() => [
|
|
410
|
+
c(r, {
|
|
394
411
|
title: t(a)("report.common.report", 1),
|
|
395
412
|
class: "h-[68px]",
|
|
396
413
|
actions: [
|
|
@@ -401,60 +418,60 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
401
418
|
prependIcon: "add"
|
|
402
419
|
}
|
|
403
420
|
],
|
|
404
|
-
"onClick:action": e[0] || (e[0] = (s) =>
|
|
421
|
+
"onClick:action": e[0] || (e[0] = (s) => Le())
|
|
405
422
|
}, null, 8, ["title", "actions"]),
|
|
406
|
-
|
|
407
|
-
class:
|
|
408
|
-
style:
|
|
423
|
+
h("div", {
|
|
424
|
+
class: v(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
|
|
425
|
+
style: Te({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
|
|
409
426
|
}, [
|
|
410
|
-
|
|
411
|
-
class:
|
|
427
|
+
c(X, {
|
|
428
|
+
class: v(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
|
|
412
429
|
}, {
|
|
413
|
-
default:
|
|
414
|
-
|
|
415
|
-
"menu-button":
|
|
416
|
-
|
|
417
|
-
default:
|
|
418
|
-
|
|
419
|
-
|
|
430
|
+
default: d(() => [
|
|
431
|
+
c(t(q), null, {
|
|
432
|
+
"menu-button": d(() => [
|
|
433
|
+
c(t(j), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
|
|
434
|
+
default: d(() => [
|
|
435
|
+
h("p", null, _(t(a)(`report.category.${L.value.label}`)), 1),
|
|
436
|
+
c(t(H), { name: "expand_more" })
|
|
420
437
|
]),
|
|
421
438
|
_: 1
|
|
422
439
|
})
|
|
423
440
|
]),
|
|
424
|
-
default:
|
|
425
|
-
(
|
|
426
|
-
key:
|
|
441
|
+
default: d(() => [
|
|
442
|
+
(z(!0), Ae(Me, null, ze(ue.value, (s, I) => (z(), Z(t(R), {
|
|
443
|
+
key: I,
|
|
427
444
|
label: t(a)(`report.category.${s.label}`),
|
|
428
|
-
onClick: () =>
|
|
445
|
+
onClick: () => Ve(s)
|
|
429
446
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
430
447
|
]),
|
|
431
448
|
_: 1
|
|
432
449
|
}),
|
|
433
|
-
|
|
434
|
-
class:
|
|
450
|
+
h("div", {
|
|
451
|
+
class: v(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
|
|
435
452
|
}, [
|
|
436
|
-
|
|
453
|
+
h("p", st, _(t(a)("report.common.results", { count: C.value.length })), 1)
|
|
437
454
|
], 2),
|
|
438
|
-
e[3] || (e[3] =
|
|
439
|
-
|
|
440
|
-
|
|
455
|
+
e[3] || (e[3] = h("div", { class: "grow" }, null, -1)),
|
|
456
|
+
h("div", rt, [
|
|
457
|
+
c(n, {
|
|
441
458
|
modelValue: G.value,
|
|
442
459
|
"onUpdate:modelValue": e[1] || (e[1] = (s) => G.value = s),
|
|
443
|
-
class:
|
|
460
|
+
class: v(`${t(p).lg || t(p).md ? "grow" : ""}`)
|
|
444
461
|
}, null, 8, ["modelValue", "class"])
|
|
445
462
|
])
|
|
446
463
|
]),
|
|
447
464
|
_: 1
|
|
448
465
|
}, 8, ["class"]),
|
|
449
|
-
|
|
450
|
-
key:
|
|
466
|
+
he((z(), Z(A, {
|
|
467
|
+
key: $e.value,
|
|
451
468
|
ref_key: "table",
|
|
452
|
-
ref:
|
|
453
|
-
class:
|
|
469
|
+
ref: w,
|
|
470
|
+
class: v([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
|
|
454
471
|
style: { height: "calc(100% - 40px)" },
|
|
455
|
-
"column-defs":
|
|
456
|
-
"row-data":
|
|
457
|
-
"page-size":
|
|
472
|
+
"column-defs": Oe.value,
|
|
473
|
+
"row-data": C.value,
|
|
474
|
+
"page-size": C.value.length,
|
|
458
475
|
"hide-footer": !0,
|
|
459
476
|
"row-class-name": "row",
|
|
460
477
|
onRowClick: e[2] || (e[2] = (s) => {
|
|
@@ -465,7 +482,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
465
482
|
});
|
|
466
483
|
return;
|
|
467
484
|
}
|
|
468
|
-
t(
|
|
485
|
+
t(Ce).suppressReportRouteSync = !0, t(b).updateCurrentReportId(s.original.reportId), t(te).push({
|
|
469
486
|
name: "reportView",
|
|
470
487
|
query: {
|
|
471
488
|
...t(oe).query,
|
|
@@ -482,8 +499,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
482
499
|
});
|
|
483
500
|
})
|
|
484
501
|
}, {
|
|
485
|
-
"list-row":
|
|
486
|
-
|
|
502
|
+
"list-row": d(({ original: s }) => [
|
|
503
|
+
c(D, {
|
|
487
504
|
onClick: () => {
|
|
488
505
|
if (!s.canRead) {
|
|
489
506
|
t(l).open({
|
|
@@ -509,49 +526,49 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
509
526
|
}));
|
|
510
527
|
}
|
|
511
528
|
}, {
|
|
512
|
-
default:
|
|
513
|
-
|
|
529
|
+
default: d(() => [
|
|
530
|
+
c(T, {
|
|
514
531
|
tag: "label",
|
|
515
532
|
clickable: ""
|
|
516
533
|
}, {
|
|
517
|
-
append:
|
|
518
|
-
|
|
519
|
-
class:
|
|
534
|
+
append: d(() => [
|
|
535
|
+
c(t(j), {
|
|
536
|
+
class: v(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
|
|
520
537
|
compact: !0
|
|
521
538
|
}, {
|
|
522
|
-
default:
|
|
523
|
-
|
|
539
|
+
default: d(() => [
|
|
540
|
+
h("p", nt, _(s.category), 1)
|
|
524
541
|
]),
|
|
525
542
|
_: 2
|
|
526
543
|
}, 1032, ["class"]),
|
|
527
|
-
|
|
544
|
+
c(t(q), {
|
|
528
545
|
placement: "left",
|
|
529
546
|
"stop-click-propagation": !0
|
|
530
547
|
}, {
|
|
531
|
-
"menu-button":
|
|
532
|
-
|
|
548
|
+
"menu-button": d(() => [
|
|
549
|
+
c(t(H), {
|
|
533
550
|
name: "more_vert",
|
|
534
551
|
class: "btn-color"
|
|
535
552
|
})
|
|
536
553
|
]),
|
|
537
|
-
default:
|
|
538
|
-
var
|
|
554
|
+
default: d(() => {
|
|
555
|
+
var I;
|
|
539
556
|
return [
|
|
540
|
-
|
|
557
|
+
c(t(R), {
|
|
541
558
|
label: s.pin ? "Unpin" : "Pin",
|
|
542
559
|
onClick: () => {
|
|
543
|
-
const
|
|
560
|
+
const i = t(u).find(
|
|
544
561
|
(m) => m.id === s.reportId
|
|
545
562
|
);
|
|
546
|
-
|
|
563
|
+
i && be(i);
|
|
547
564
|
}
|
|
548
565
|
}, null, 8, ["label", "onClick"]),
|
|
549
|
-
|
|
566
|
+
c(t(R), {
|
|
550
567
|
label: t(a)("report.common.showInPOS"),
|
|
551
|
-
disabled: !s.canUpdate ||
|
|
552
|
-
"aria-disabled": !s.canUpdate ||
|
|
553
|
-
class:
|
|
554
|
-
!s.canUpdate ||
|
|
568
|
+
disabled: !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
|
|
569
|
+
"aria-disabled": !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
|
|
570
|
+
class: v(
|
|
571
|
+
!s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId) ? "text-fm-color-typo-disabled" : ""
|
|
555
572
|
),
|
|
556
573
|
onClick: () => {
|
|
557
574
|
if (!s.canUpdate) {
|
|
@@ -561,63 +578,63 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
561
578
|
});
|
|
562
579
|
return;
|
|
563
580
|
}
|
|
564
|
-
const
|
|
581
|
+
const i = t(u).find(
|
|
565
582
|
(m) => m.id === s.reportId
|
|
566
583
|
);
|
|
567
|
-
|
|
584
|
+
i && fe(i);
|
|
568
585
|
}
|
|
569
586
|
}, {
|
|
570
|
-
append:
|
|
571
|
-
|
|
587
|
+
append: d(() => [
|
|
588
|
+
c(t(pe), {
|
|
572
589
|
"model-value": s.isSupportPos,
|
|
573
|
-
disabled: !s.canUpdate ||
|
|
590
|
+
disabled: !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
|
|
574
591
|
"aria-label": "Show in POS v8",
|
|
575
592
|
class: "pointer-events-none"
|
|
576
593
|
}, null, 8, ["model-value", "disabled"])
|
|
577
594
|
]),
|
|
578
595
|
_: 2
|
|
579
596
|
}, 1032, ["label", "disabled", "aria-disabled", "class", "onClick"]),
|
|
580
|
-
|
|
597
|
+
c(t(R), {
|
|
581
598
|
label: t(a)("report.common.duplicate"),
|
|
582
599
|
disabled: Q(s),
|
|
583
|
-
class:
|
|
600
|
+
class: v(
|
|
584
601
|
Q(s) ? "text-fm-color-typo-disabled" : ""
|
|
585
602
|
),
|
|
586
603
|
onClick: () => {
|
|
587
|
-
const
|
|
604
|
+
const i = t(u).find(
|
|
588
605
|
(m) => m.id === s.reportId
|
|
589
606
|
);
|
|
590
|
-
|
|
607
|
+
i && !Q(s) ? ve(i) : t(l).open({
|
|
591
608
|
message: t(a)("report.messages.noPermissionDuplicateReport"),
|
|
592
609
|
type: "error"
|
|
593
610
|
});
|
|
594
611
|
}
|
|
595
612
|
}, null, 8, ["label", "disabled", "class", "onClick"]),
|
|
596
|
-
|
|
613
|
+
c(t(R), {
|
|
597
614
|
label: t(a)(
|
|
598
|
-
s.reportId === ((
|
|
615
|
+
s.reportId === ((I = t(B)) == null ? void 0 : I.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
|
|
599
616
|
),
|
|
600
617
|
onClick: () => {
|
|
601
|
-
const
|
|
618
|
+
const i = t(u).find(
|
|
602
619
|
(m) => m.id === s.reportId
|
|
603
620
|
);
|
|
604
|
-
|
|
621
|
+
i && me(i);
|
|
605
622
|
}
|
|
606
623
|
}, null, 8, ["label", "onClick"]),
|
|
607
|
-
|
|
624
|
+
c(t(R), {
|
|
608
625
|
label: t(a)("report.common.delete"),
|
|
609
626
|
disabled: W(s),
|
|
610
|
-
class:
|
|
627
|
+
class: v(
|
|
611
628
|
W(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
|
|
612
629
|
),
|
|
613
630
|
onClick: () => {
|
|
614
|
-
const
|
|
631
|
+
const i = t(u).find(
|
|
615
632
|
(m) => m.id === s.reportId
|
|
616
633
|
);
|
|
617
|
-
|
|
634
|
+
i && !W(s) && ye(i);
|
|
618
635
|
}
|
|
619
636
|
}, {
|
|
620
|
-
label:
|
|
637
|
+
label: d(() => [
|
|
621
638
|
Je(_(t(a)("report.common.delete")), 1)
|
|
622
639
|
]),
|
|
623
640
|
_: 2
|
|
@@ -627,9 +644,9 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
627
644
|
_: 2
|
|
628
645
|
}, 1024)
|
|
629
646
|
]),
|
|
630
|
-
default:
|
|
631
|
-
|
|
632
|
-
class:
|
|
647
|
+
default: d(() => [
|
|
648
|
+
h("span", {
|
|
649
|
+
class: v(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
|
|
633
650
|
}, _(s.name), 3)
|
|
634
651
|
]),
|
|
635
652
|
_: 2
|
|
@@ -640,10 +657,10 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
640
657
|
]),
|
|
641
658
|
_: 1
|
|
642
659
|
}, 8, ["class", "column-defs", "row-data", "page-size"])), [
|
|
643
|
-
[
|
|
660
|
+
[we, C.value.length > 0]
|
|
644
661
|
]),
|
|
645
|
-
|
|
646
|
-
[
|
|
662
|
+
he(c(We, null, null, 512), [
|
|
663
|
+
[we, C.value.length === 0]
|
|
647
664
|
])
|
|
648
665
|
], 6)
|
|
649
666
|
]),
|
|
@@ -653,5 +670,5 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
653
670
|
}
|
|
654
671
|
});
|
|
655
672
|
export {
|
|
656
|
-
|
|
673
|
+
ht as default
|
|
657
674
|
};
|