@feedmepos/mf-report 5.28.4-beta.1 → 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-TTaomYWJ.js → App-BNdbl8v-.js} +4 -4
- package/dist/{DateRangeSelect-CDWvx37Z.js → DateRangeSelect-DczITWsu.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-B4GS0LAe.js → Default.vue_vue_type_script_setup_true_lang-BPL7To4C.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BXb30lZS.js → DynamicWidget.vue_vue_type_script_setup_true_lang-CenrOQ58.js} +4 -4
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Mkp4Nbem.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Dio9m6Jz.js} +3 -3
- package/dist/{InsightView-DNJahikW.js → InsightView-CcE2OQ0R.js} +5 -5
- package/dist/{Integration-BeErYlGf.js → Integration-bZ0kl1l-.js} +3 -3
- package/dist/{Integrations-DFuALsa_.js → Integrations-CKCjfBSD.js} +2 -2
- package/dist/{Layout-BSfIs3TK.js → Layout-_uXqK8iF.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-C-DhURYX.js → LocationSelect.vue_vue_type_script_setup_true_lang-Dl8s1Do5.js} +2 -2
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-By-I-Ye-.js → MenuTab.vue_vue_type_script_setup_true_lang-B4qIaFPZ.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-BWLE2D5s.js → NavigationTab.vue_vue_type_script_setup_true_lang-CPULQ1tP.js} +5 -5
- package/dist/{OverviewView-C6bc-nyW.js → OverviewView-hUv0WWJj.js} +4 -4
- package/dist/{Report-Cgrz4IUu.js → Report-fXqGDAk7.js} +170 -154
- package/dist/{ReportCanvasView-6ratBE_J.js → ReportCanvasView-CX21rslR.js} +3 -3
- package/dist/{ReportEditor-ChllQ8e0.js → ReportEditor-BAo9nIf7.js} +7 -7
- package/dist/{ReportView-wesF2Wbp.js → ReportView-OyJkdf8K.js} +6 -6
- package/dist/{ReportViewRoute-BgYwRrL6.js → ReportViewRoute-C8XeKxEq.js} +2 -2
- package/dist/{Setting-DiWyp9vo.js → Setting-Xqal_aQw.js} +3 -3
- package/dist/{Template-Ce-SmgVJ.js → Template-8Us5mNqQ.js} +3 -3
- package/dist/{TileEditor-BBNuA1AB.js → TileEditor-Cqfrs4fd.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-nTBw3Jmd.js → TilePageStack.vue_vue_type_script_setup_true_lang-U0BMLySg.js} +2 -2
- package/dist/{TransitionFade-CDVNSlPY.js → TransitionFade-SusB-gSL.js} +5 -5
- package/dist/{app-DI6EG74T.js → app-CDCDr2QW.js} +12 -12
- package/dist/app.js +1 -1
- package/dist/{report-CFFZa-VL.js → report-CpnEtrkQ.js} +1 -1
- package/dist/{useRestaurantPermission-CmkLx2Hj.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
|
-
|
|
38
|
-
[() =>
|
|
37
|
+
ge(
|
|
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"),
|
|
@@ -135,11 +151,11 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
135
151
|
id: "Action",
|
|
136
152
|
header: a("report.common.actions"),
|
|
137
153
|
meta: {
|
|
138
|
-
width: "
|
|
154
|
+
width: "140px"
|
|
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,19 +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
|
-
|
|
198
|
+
_e,
|
|
183
199
|
{ content: I, placement: "bottom", zIndex: 2e3 },
|
|
184
200
|
{
|
|
185
201
|
default: () => f(pe, {
|
|
186
202
|
modelValue: e.isSupportPos,
|
|
187
203
|
disabled: s,
|
|
188
|
-
label: "
|
|
204
|
+
label: a("report.common.showInPOS"),
|
|
189
205
|
"aria-label": a("report.common.showInPOS"),
|
|
190
206
|
class: "mr-2",
|
|
191
207
|
"onUpdate:modelValue": () => {
|
|
192
|
-
n &&
|
|
208
|
+
n && fe(n);
|
|
193
209
|
},
|
|
194
|
-
onClick:
|
|
210
|
+
onClick: Se(() => {
|
|
195
211
|
}, ["stop"])
|
|
196
212
|
})
|
|
197
213
|
}
|
|
@@ -201,8 +217,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
201
217
|
{
|
|
202
218
|
disabled: T,
|
|
203
219
|
title: T ? a("report.messages.noPermission") : void 0,
|
|
204
|
-
onClick:
|
|
205
|
-
n &&
|
|
220
|
+
onClick: Se(() => {
|
|
221
|
+
n && be(n);
|
|
206
222
|
}, ["stop"]),
|
|
207
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`
|
|
208
224
|
},
|
|
@@ -229,9 +245,9 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
229
245
|
disabled: !1
|
|
230
246
|
},
|
|
231
247
|
{
|
|
232
|
-
default: () =>
|
|
248
|
+
default: () => i.map(
|
|
233
249
|
(g) => f(
|
|
234
|
-
|
|
250
|
+
R,
|
|
235
251
|
{
|
|
236
252
|
onClick: g.disabled ? {} : g.onClick,
|
|
237
253
|
label: g.label,
|
|
@@ -244,12 +260,12 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
244
260
|
)
|
|
245
261
|
),
|
|
246
262
|
"menu-button": () => f(
|
|
247
|
-
|
|
263
|
+
De,
|
|
248
264
|
{
|
|
249
265
|
variant: "tertiary",
|
|
250
266
|
size: "md",
|
|
251
267
|
icon: "more_vert",
|
|
252
|
-
iconColor:
|
|
268
|
+
iconColor: Qe.NeutralGray400,
|
|
253
269
|
disabled: !1
|
|
254
270
|
},
|
|
255
271
|
{}
|
|
@@ -262,11 +278,11 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
262
278
|
}
|
|
263
279
|
}
|
|
264
280
|
]);
|
|
265
|
-
async function
|
|
281
|
+
async function me(o) {
|
|
266
282
|
await K(async () => {
|
|
267
283
|
var e;
|
|
268
284
|
try {
|
|
269
|
-
const r = o.id === ((e =
|
|
285
|
+
const r = o.id === ((e = B.value) == null ? void 0 : e.id);
|
|
270
286
|
await b.updateDefaultReport(r ? null : o.id), l.open({
|
|
271
287
|
message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
|
|
272
288
|
type: "success"
|
|
@@ -276,24 +292,24 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
276
292
|
}
|
|
277
293
|
});
|
|
278
294
|
}
|
|
279
|
-
async function
|
|
280
|
-
if (!
|
|
281
|
-
|
|
295
|
+
async function fe(o) {
|
|
296
|
+
if (!y.value.has(o.id)) {
|
|
297
|
+
y.value = new Set(y.value).add(o.id);
|
|
282
298
|
try {
|
|
283
299
|
const e = !o.isSupportPos;
|
|
284
|
-
await
|
|
300
|
+
await Ke(o.id, e), o.isSupportPos = e;
|
|
285
301
|
} catch (e) {
|
|
286
302
|
console.log(e), l.open({
|
|
287
303
|
message: a("report.messages.failedToAction", { action: a("report.common.update") }),
|
|
288
304
|
type: "error"
|
|
289
305
|
});
|
|
290
306
|
} finally {
|
|
291
|
-
const e = new Set(
|
|
292
|
-
e.delete(o.id),
|
|
307
|
+
const e = new Set(y.value);
|
|
308
|
+
e.delete(o.id), y.value = e;
|
|
293
309
|
}
|
|
294
310
|
}
|
|
295
311
|
}
|
|
296
|
-
async function
|
|
312
|
+
async function Fe(o) {
|
|
297
313
|
if (await re({
|
|
298
314
|
title: a("report.common.duplicate"),
|
|
299
315
|
message: a("report.messages.confirmAction", {
|
|
@@ -315,15 +331,15 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
315
331
|
}
|
|
316
332
|
}
|
|
317
333
|
function Q(o) {
|
|
318
|
-
const e =
|
|
319
|
-
return !e || !
|
|
334
|
+
const e = u.value.find((r) => r.id === o.reportId);
|
|
335
|
+
return !e || !ce(e);
|
|
320
336
|
}
|
|
321
337
|
function W(o) {
|
|
322
|
-
const e =
|
|
323
|
-
return !o.editable || !e || !
|
|
338
|
+
const e = u.value.find((r) => r.id === o.reportId);
|
|
339
|
+
return !o.editable || !e || !E(e);
|
|
324
340
|
}
|
|
325
|
-
async function
|
|
326
|
-
if (!
|
|
341
|
+
async function ye(o) {
|
|
342
|
+
if (!E(o)) {
|
|
327
343
|
l.open({
|
|
328
344
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
329
345
|
type: "error"
|
|
@@ -346,7 +362,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
346
362
|
}
|
|
347
363
|
async function ve(o) {
|
|
348
364
|
if (se.value)
|
|
349
|
-
await
|
|
365
|
+
await Fe(o);
|
|
350
366
|
else {
|
|
351
367
|
let e = `Your current plan only support up to ${F.value} custom reports.`;
|
|
352
368
|
F.value === 0 && (e = "Your current plan does not support custom report."), l.open({
|
|
@@ -355,8 +371,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
355
371
|
});
|
|
356
372
|
}
|
|
357
373
|
}
|
|
358
|
-
function
|
|
359
|
-
if (!
|
|
374
|
+
function Le() {
|
|
375
|
+
if (!xe.value) {
|
|
360
376
|
l.open({
|
|
361
377
|
message: a("report.messages.noPermission"),
|
|
362
378
|
type: "error"
|
|
@@ -364,7 +380,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
364
380
|
return;
|
|
365
381
|
}
|
|
366
382
|
if (se.value)
|
|
367
|
-
|
|
383
|
+
ke.value = !0;
|
|
368
384
|
else {
|
|
369
385
|
let o = `Your current plan only support up to ${F.value} custom reports.`;
|
|
370
386
|
F.value === 0 && (o = "Your current plan does not support custom report."), l.open({
|
|
@@ -373,8 +389,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
373
389
|
});
|
|
374
390
|
}
|
|
375
391
|
}
|
|
376
|
-
function
|
|
377
|
-
const e = ee(a,
|
|
392
|
+
function be(o) {
|
|
393
|
+
const e = ee(a, J, o.name, "other") ?? "";
|
|
378
394
|
O.value && O.value.includes(o.id) ? (l.open({
|
|
379
395
|
message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
|
|
380
396
|
type: "success"
|
|
@@ -383,15 +399,15 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
383
399
|
type: "success"
|
|
384
400
|
}), b.cachePinReport(o));
|
|
385
401
|
}
|
|
386
|
-
function
|
|
402
|
+
function Ve(o) {
|
|
387
403
|
L.value = o;
|
|
388
404
|
}
|
|
389
|
-
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);
|
|
390
406
|
return (o, e) => {
|
|
391
407
|
const r = k("FmPageHead"), n = k("FmSearch"), X = k("FmForm"), T = k("FmListItem"), D = k("FmList"), A = k("FmTable");
|
|
392
|
-
return
|
|
393
|
-
default:
|
|
394
|
-
|
|
408
|
+
return z(), Z(Ee, null, {
|
|
409
|
+
default: d(() => [
|
|
410
|
+
c(r, {
|
|
395
411
|
title: t(a)("report.common.report", 1),
|
|
396
412
|
class: "h-[68px]",
|
|
397
413
|
actions: [
|
|
@@ -402,60 +418,60 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
402
418
|
prependIcon: "add"
|
|
403
419
|
}
|
|
404
420
|
],
|
|
405
|
-
"onClick:action": e[0] || (e[0] = (s) =>
|
|
421
|
+
"onClick:action": e[0] || (e[0] = (s) => Le())
|
|
406
422
|
}, null, 8, ["title", "actions"]),
|
|
407
|
-
|
|
408
|
-
class:
|
|
409
|
-
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)` })
|
|
410
426
|
}, [
|
|
411
|
-
|
|
412
|
-
class:
|
|
427
|
+
c(X, {
|
|
428
|
+
class: v(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
|
|
413
429
|
}, {
|
|
414
|
-
default:
|
|
415
|
-
|
|
416
|
-
"menu-button":
|
|
417
|
-
|
|
418
|
-
default:
|
|
419
|
-
|
|
420
|
-
|
|
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" })
|
|
421
437
|
]),
|
|
422
438
|
_: 1
|
|
423
439
|
})
|
|
424
440
|
]),
|
|
425
|
-
default:
|
|
426
|
-
(
|
|
441
|
+
default: d(() => [
|
|
442
|
+
(z(!0), Ae(Me, null, ze(ue.value, (s, I) => (z(), Z(t(R), {
|
|
427
443
|
key: I,
|
|
428
444
|
label: t(a)(`report.category.${s.label}`),
|
|
429
|
-
onClick: () =>
|
|
445
|
+
onClick: () => Ve(s)
|
|
430
446
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
431
447
|
]),
|
|
432
448
|
_: 1
|
|
433
449
|
}),
|
|
434
|
-
|
|
435
|
-
class:
|
|
450
|
+
h("div", {
|
|
451
|
+
class: v(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
|
|
436
452
|
}, [
|
|
437
|
-
|
|
453
|
+
h("p", st, _(t(a)("report.common.results", { count: C.value.length })), 1)
|
|
438
454
|
], 2),
|
|
439
|
-
e[3] || (e[3] =
|
|
440
|
-
|
|
441
|
-
|
|
455
|
+
e[3] || (e[3] = h("div", { class: "grow" }, null, -1)),
|
|
456
|
+
h("div", rt, [
|
|
457
|
+
c(n, {
|
|
442
458
|
modelValue: G.value,
|
|
443
459
|
"onUpdate:modelValue": e[1] || (e[1] = (s) => G.value = s),
|
|
444
|
-
class:
|
|
460
|
+
class: v(`${t(p).lg || t(p).md ? "grow" : ""}`)
|
|
445
461
|
}, null, 8, ["modelValue", "class"])
|
|
446
462
|
])
|
|
447
463
|
]),
|
|
448
464
|
_: 1
|
|
449
465
|
}, 8, ["class"]),
|
|
450
|
-
|
|
451
|
-
key:
|
|
466
|
+
he((z(), Z(A, {
|
|
467
|
+
key: $e.value,
|
|
452
468
|
ref_key: "table",
|
|
453
|
-
ref:
|
|
454
|
-
class:
|
|
469
|
+
ref: w,
|
|
470
|
+
class: v([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
|
|
455
471
|
style: { height: "calc(100% - 40px)" },
|
|
456
|
-
"column-defs":
|
|
457
|
-
"row-data":
|
|
458
|
-
"page-size":
|
|
472
|
+
"column-defs": Oe.value,
|
|
473
|
+
"row-data": C.value,
|
|
474
|
+
"page-size": C.value.length,
|
|
459
475
|
"hide-footer": !0,
|
|
460
476
|
"row-class-name": "row",
|
|
461
477
|
onRowClick: e[2] || (e[2] = (s) => {
|
|
@@ -466,7 +482,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
466
482
|
});
|
|
467
483
|
return;
|
|
468
484
|
}
|
|
469
|
-
t(
|
|
485
|
+
t(Ce).suppressReportRouteSync = !0, t(b).updateCurrentReportId(s.original.reportId), t(te).push({
|
|
470
486
|
name: "reportView",
|
|
471
487
|
query: {
|
|
472
488
|
...t(oe).query,
|
|
@@ -483,8 +499,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
483
499
|
});
|
|
484
500
|
})
|
|
485
501
|
}, {
|
|
486
|
-
"list-row":
|
|
487
|
-
|
|
502
|
+
"list-row": d(({ original: s }) => [
|
|
503
|
+
c(D, {
|
|
488
504
|
onClick: () => {
|
|
489
505
|
if (!s.canRead) {
|
|
490
506
|
t(l).open({
|
|
@@ -510,49 +526,49 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
510
526
|
}));
|
|
511
527
|
}
|
|
512
528
|
}, {
|
|
513
|
-
default:
|
|
514
|
-
|
|
529
|
+
default: d(() => [
|
|
530
|
+
c(T, {
|
|
515
531
|
tag: "label",
|
|
516
532
|
clickable: ""
|
|
517
533
|
}, {
|
|
518
|
-
append:
|
|
519
|
-
|
|
520
|
-
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"}`),
|
|
521
537
|
compact: !0
|
|
522
538
|
}, {
|
|
523
|
-
default:
|
|
524
|
-
|
|
539
|
+
default: d(() => [
|
|
540
|
+
h("p", nt, _(s.category), 1)
|
|
525
541
|
]),
|
|
526
542
|
_: 2
|
|
527
543
|
}, 1032, ["class"]),
|
|
528
|
-
|
|
544
|
+
c(t(q), {
|
|
529
545
|
placement: "left",
|
|
530
546
|
"stop-click-propagation": !0
|
|
531
547
|
}, {
|
|
532
|
-
"menu-button":
|
|
533
|
-
|
|
548
|
+
"menu-button": d(() => [
|
|
549
|
+
c(t(H), {
|
|
534
550
|
name: "more_vert",
|
|
535
551
|
class: "btn-color"
|
|
536
552
|
})
|
|
537
553
|
]),
|
|
538
|
-
default:
|
|
554
|
+
default: d(() => {
|
|
539
555
|
var I;
|
|
540
556
|
return [
|
|
541
|
-
|
|
557
|
+
c(t(R), {
|
|
542
558
|
label: s.pin ? "Unpin" : "Pin",
|
|
543
559
|
onClick: () => {
|
|
544
|
-
const
|
|
560
|
+
const i = t(u).find(
|
|
545
561
|
(m) => m.id === s.reportId
|
|
546
562
|
);
|
|
547
|
-
|
|
563
|
+
i && be(i);
|
|
548
564
|
}
|
|
549
565
|
}, null, 8, ["label", "onClick"]),
|
|
550
|
-
|
|
566
|
+
c(t(R), {
|
|
551
567
|
label: t(a)("report.common.showInPOS"),
|
|
552
|
-
disabled: !s.canUpdate ||
|
|
553
|
-
"aria-disabled": !s.canUpdate ||
|
|
554
|
-
class:
|
|
555
|
-
!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" : ""
|
|
556
572
|
),
|
|
557
573
|
onClick: () => {
|
|
558
574
|
if (!s.canUpdate) {
|
|
@@ -562,63 +578,63 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
562
578
|
});
|
|
563
579
|
return;
|
|
564
580
|
}
|
|
565
|
-
const
|
|
581
|
+
const i = t(u).find(
|
|
566
582
|
(m) => m.id === s.reportId
|
|
567
583
|
);
|
|
568
|
-
|
|
584
|
+
i && fe(i);
|
|
569
585
|
}
|
|
570
586
|
}, {
|
|
571
|
-
append:
|
|
572
|
-
|
|
587
|
+
append: d(() => [
|
|
588
|
+
c(t(pe), {
|
|
573
589
|
"model-value": s.isSupportPos,
|
|
574
|
-
disabled: !s.canUpdate ||
|
|
590
|
+
disabled: !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
|
|
575
591
|
"aria-label": "Show in POS v8",
|
|
576
592
|
class: "pointer-events-none"
|
|
577
593
|
}, null, 8, ["model-value", "disabled"])
|
|
578
594
|
]),
|
|
579
595
|
_: 2
|
|
580
596
|
}, 1032, ["label", "disabled", "aria-disabled", "class", "onClick"]),
|
|
581
|
-
|
|
597
|
+
c(t(R), {
|
|
582
598
|
label: t(a)("report.common.duplicate"),
|
|
583
599
|
disabled: Q(s),
|
|
584
|
-
class:
|
|
600
|
+
class: v(
|
|
585
601
|
Q(s) ? "text-fm-color-typo-disabled" : ""
|
|
586
602
|
),
|
|
587
603
|
onClick: () => {
|
|
588
|
-
const
|
|
604
|
+
const i = t(u).find(
|
|
589
605
|
(m) => m.id === s.reportId
|
|
590
606
|
);
|
|
591
|
-
|
|
607
|
+
i && !Q(s) ? ve(i) : t(l).open({
|
|
592
608
|
message: t(a)("report.messages.noPermissionDuplicateReport"),
|
|
593
609
|
type: "error"
|
|
594
610
|
});
|
|
595
611
|
}
|
|
596
612
|
}, null, 8, ["label", "disabled", "class", "onClick"]),
|
|
597
|
-
|
|
613
|
+
c(t(R), {
|
|
598
614
|
label: t(a)(
|
|
599
|
-
s.reportId === ((I = t(
|
|
615
|
+
s.reportId === ((I = t(B)) == null ? void 0 : I.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
|
|
600
616
|
),
|
|
601
617
|
onClick: () => {
|
|
602
|
-
const
|
|
618
|
+
const i = t(u).find(
|
|
603
619
|
(m) => m.id === s.reportId
|
|
604
620
|
);
|
|
605
|
-
|
|
621
|
+
i && me(i);
|
|
606
622
|
}
|
|
607
623
|
}, null, 8, ["label", "onClick"]),
|
|
608
|
-
|
|
624
|
+
c(t(R), {
|
|
609
625
|
label: t(a)("report.common.delete"),
|
|
610
626
|
disabled: W(s),
|
|
611
|
-
class:
|
|
627
|
+
class: v(
|
|
612
628
|
W(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
|
|
613
629
|
),
|
|
614
630
|
onClick: () => {
|
|
615
|
-
const
|
|
631
|
+
const i = t(u).find(
|
|
616
632
|
(m) => m.id === s.reportId
|
|
617
633
|
);
|
|
618
|
-
|
|
634
|
+
i && !W(s) && ye(i);
|
|
619
635
|
}
|
|
620
636
|
}, {
|
|
621
|
-
label:
|
|
637
|
+
label: d(() => [
|
|
622
638
|
Je(_(t(a)("report.common.delete")), 1)
|
|
623
639
|
]),
|
|
624
640
|
_: 2
|
|
@@ -628,9 +644,9 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
628
644
|
_: 2
|
|
629
645
|
}, 1024)
|
|
630
646
|
]),
|
|
631
|
-
default:
|
|
632
|
-
|
|
633
|
-
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"])
|
|
634
650
|
}, _(s.name), 3)
|
|
635
651
|
]),
|
|
636
652
|
_: 2
|
|
@@ -641,10 +657,10 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
641
657
|
]),
|
|
642
658
|
_: 1
|
|
643
659
|
}, 8, ["class", "column-defs", "row-data", "page-size"])), [
|
|
644
|
-
[
|
|
660
|
+
[we, C.value.length > 0]
|
|
645
661
|
]),
|
|
646
|
-
|
|
647
|
-
[
|
|
662
|
+
he(c(We, null, null, 512), [
|
|
663
|
+
[we, C.value.length === 0]
|
|
648
664
|
])
|
|
649
665
|
], 6)
|
|
650
666
|
]),
|
|
@@ -654,5 +670,5 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
|
|
|
654
670
|
}
|
|
655
671
|
});
|
|
656
672
|
export {
|
|
657
|
-
|
|
673
|
+
ht as default
|
|
658
674
|
};
|