@feedmepos/mf-report 5.27.45 → 5.27.46
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-qmp_wTqr.js → App-FfA0Wieg.js} +4 -4
- package/dist/{DateRangeSelect-DTc5W51W.js → DateRangeSelect-C_wtAXY4.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-Rfx_MV5j.js → Default.vue_vue_type_script_setup_true_lang-BwOQeJud.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CgQT7aVu.js → DynamicWidget.vue_vue_type_script_setup_true_lang-eqBy38_k.js} +1691 -1711
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ch8h7LYw.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DvdiNZep.js} +1277 -1162
- package/dist/{InsightView-DTXLQI3y.js → InsightView-Dpn068zp.js} +4 -4
- package/dist/{Integration-jDsdDTJe.js → Integration-CvyPuNQ2.js} +5 -5
- package/dist/{Integrations-Bw_gAgzo.js → Integrations-DGYwGgGf.js} +2 -2
- package/dist/{Layout-KsXHFW6a.js → Layout-DPY4m5oT.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-EX-uYhXm.js → MenuTab.vue_vue_type_script_setup_true_lang-D2fubpyx.js} +4 -4
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CjkhnFr1.js → NavigationTab.vue_vue_type_script_setup_true_lang-DlIBymYj.js} +3 -3
- package/dist/{OverviewView-8gQ9VC5f.js → OverviewView-iZ6v3Dfe.js} +4 -4
- package/dist/{Report-CyxE4Mk6.js → Report-t4NL8ihv.js} +207 -189
- package/dist/{ReportEditor-Bm5k5ZUc.js → ReportEditor-DkRI93tE.js} +6 -6
- package/dist/{ReportView-B_EjiBA3.js → ReportView-DBNFH8B5.js} +6 -6
- package/dist/{Setting-BEUoiP3V.js → Setting-DjS4GUGW.js} +3 -3
- package/dist/{Template-aCg-U8jo.js → Template-x6Hl6z48.js} +3 -3
- package/dist/{TileEditor-BKfGFwLu.js → TileEditor-BwhiEeGn.js} +5 -5
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-C-x_Wda9.js → TilePageStack.vue_vue_type_script_setup_true_lang-DJPeCSDi.js} +2 -2
- package/dist/{TransitionFade-BEJ9_BKt.js → TransitionFade-CYqZ2pPL.js} +4 -4
- package/dist/{app-5pQ-88Qg.js → app-BdUHDzyB.js} +12 -12
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-C93JSHxi.js → formatChartData.worker-3v08gjzr.js} +54 -26
- package/dist/assets/{processTableData.worker-BsZijJg_.js → processTableData.worker-DF65vmST.js} +54 -26
- package/dist/{useRestaurantPermission-BIQpfucB.js → useRestaurantPermission-UY9t-Lef.js} +1 -1
- package/package.json +1 -1
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { u as
|
|
6
|
-
import { a as
|
|
7
|
-
import { useSnackbar as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { c as
|
|
10
|
-
import { useRouter as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { r as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as Ie, ref as Q, watch as de, computed as h, h as d, withModifiers as Fe, resolveComponent as x, createBlock as W, openBlock as J, withCtx as m, createVNode as i, createElementVNode as g, unref as e, normalizeStyle as Oe, normalizeClass as y, withDirectives as fe, createElementBlock as Pe, Fragment as Le, renderList as Ne, toDisplayString as _, createTextVNode as Ve, vShow as ye } from "vue";
|
|
2
|
+
import { storeToRefs as ve } from "pinia";
|
|
3
|
+
import { u as Ae } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DvdiNZep.js";
|
|
4
|
+
import { _ as Je } from "./Default.vue_vue_type_script_setup_true_lang-BwOQeJud.js";
|
|
5
|
+
import { u as ze } from "./message-dialog-UoMWOnil.js";
|
|
6
|
+
import { a as Be } from "./_plugin-vue_export-helper-kkiiQoKl.js";
|
|
7
|
+
import { useSnackbar as Te, useBreakpoints as Ue, components as Ee, FmButtonColorThemeVariant as Ke } from "@feedmepos/ui-library";
|
|
8
|
+
import { _ as Me } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Ckn2p74A.js";
|
|
9
|
+
import { c as Ye, a as ge, h as qe } from "./app-BdUHDzyB.js";
|
|
10
|
+
import { useRouter as je, useRoute as Ge, onBeforeRouteLeave as He } from "vue-router";
|
|
11
|
+
import { useI18n as Qe } from "@feedmepos/mf-common";
|
|
12
|
+
import { r as X } from "./i18n-CI_sQ5d_.js";
|
|
13
|
+
const We = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "w-[343px]" }, Ze = { class: "fm-typo-en-body-md-600" }, dt = /* @__PURE__ */ Ie({
|
|
14
14
|
__name: "Report",
|
|
15
|
-
setup(
|
|
16
|
-
const { t: a, te: z } =
|
|
17
|
-
reports:
|
|
15
|
+
setup(et) {
|
|
16
|
+
const { t: a, te: z } = Qe(), Z = je(), ee = Ge(), f = Ae(), be = Ye(), { business: we } = ve(ge()), {
|
|
17
|
+
reports: p,
|
|
18
18
|
overviewReport: B,
|
|
19
19
|
categories: $,
|
|
20
|
-
pinReport:
|
|
21
|
-
isOpenAddReportDialog:
|
|
22
|
-
scrollPositionY:
|
|
23
|
-
customReportQuota:
|
|
24
|
-
canCreateCustomReport:
|
|
25
|
-
} =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
pinReport: I,
|
|
21
|
+
isOpenAddReportDialog: Re,
|
|
22
|
+
scrollPositionY: te,
|
|
23
|
+
customReportQuota: F,
|
|
24
|
+
canCreateCustomReport: oe
|
|
25
|
+
} = ve(f), { promptMessage: ae } = ze(), { promptLoader: T } = Be(), c = Te(), { breakpoints: u } = Ue(), { canRead: re, canUpdate: ne, canDuplicate: se, canDelete: U, canCreateReport: he } = qe(), b = Q();
|
|
26
|
+
He(() => {
|
|
27
|
+
b.value && (te.value = b.value.$el.children[0].scrollTop);
|
|
28
|
+
}), de(b, () => {
|
|
29
|
+
b.value && setTimeout(() => {
|
|
30
|
+
b.value && (b.value.$el.children[0].scrollTop = te.value);
|
|
31
31
|
}, 200);
|
|
32
32
|
});
|
|
33
|
-
const
|
|
33
|
+
const E = h(() => I.value && p.value ? p.value.filter((o) => {
|
|
34
34
|
var t;
|
|
35
|
-
return (t =
|
|
35
|
+
return (t = I.value) == null ? void 0 : t.includes(o.id);
|
|
36
36
|
}) : []);
|
|
37
|
-
|
|
38
|
-
[() =>
|
|
37
|
+
de(
|
|
38
|
+
[() => we.value],
|
|
39
39
|
() => {
|
|
40
|
-
|
|
40
|
+
f.refreshPinReport();
|
|
41
41
|
},
|
|
42
42
|
{ immediate: !0 }
|
|
43
43
|
);
|
|
44
|
-
const
|
|
45
|
-
(o) =>
|
|
46
|
-
) :
|
|
44
|
+
const le = h(() => E.value.length > 0 ? p.value.filter(
|
|
45
|
+
(o) => E.value.findIndex((t) => t.id === o.id) === -1
|
|
46
|
+
) : p.value), { FmButton: Ce, FmMenu: K, FmMenuItem: C, FmIcon: M, FmChip: Y } = Ee, ce = h(() => [
|
|
47
47
|
{ value: void 0, label: "All" },
|
|
48
48
|
...$.value.map((o) => ({
|
|
49
49
|
value: o.id,
|
|
50
50
|
label: o.name
|
|
51
51
|
}))
|
|
52
|
-
]),
|
|
53
|
-
...
|
|
52
|
+
]), O = Q(ce.value[0]), q = Q(""), S = h(() => le.value.length === 0 || $.value.length === 0 ? [] : [
|
|
53
|
+
...E.value.map((t) => {
|
|
54
54
|
const r = $.value.find((l) => l.id === t.category);
|
|
55
55
|
return {
|
|
56
|
-
name:
|
|
56
|
+
name: X(a, z, t.name, "other"),
|
|
57
57
|
categoryId: (r == null ? void 0 : r.id) ?? "",
|
|
58
58
|
category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
|
|
59
59
|
reportId: t.id,
|
|
60
60
|
editable: t.editable,
|
|
61
61
|
description: t.description || "",
|
|
62
62
|
pin: !0,
|
|
63
|
-
canUpdate:
|
|
64
|
-
canRead:
|
|
63
|
+
canUpdate: ne(t),
|
|
64
|
+
canRead: re(t)
|
|
65
65
|
};
|
|
66
66
|
}),
|
|
67
|
-
...
|
|
67
|
+
...le.value.map((t) => {
|
|
68
68
|
const r = $.value.find((l) => l.id === t.category);
|
|
69
69
|
return {
|
|
70
|
-
name:
|
|
70
|
+
name: X(a, z, t.name, "other"),
|
|
71
71
|
categoryId: (r == null ? void 0 : r.id) ?? "",
|
|
72
72
|
category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
|
|
73
73
|
reportId: t.id,
|
|
74
74
|
editable: t.editable,
|
|
75
75
|
description: t.description || "",
|
|
76
76
|
pin: !1,
|
|
77
|
-
canUpdate:
|
|
78
|
-
canRead:
|
|
77
|
+
canUpdate: ne(t),
|
|
78
|
+
canRead: re(t)
|
|
79
79
|
};
|
|
80
80
|
})
|
|
81
|
-
].filter((t) =>
|
|
82
|
-
() =>
|
|
83
|
-
),
|
|
81
|
+
].filter((t) => O.value.value && t.categoryId !== O.value.value ? !1 : `${(t == null ? void 0 : t.name) || ""}${(t == null ? void 0 : t.description) || ""}`.toLowerCase().indexOf(q.value.toLowerCase()) !== -1)), Se = h(
|
|
82
|
+
() => S.value.map((o) => `${o.name}${o.category}`).toString()
|
|
83
|
+
), xe = h(() => [
|
|
84
84
|
{
|
|
85
85
|
accessorKey: "name",
|
|
86
86
|
header: a("report.common.name"),
|
|
87
87
|
enableSorting: !1,
|
|
88
88
|
cell: (o) => {
|
|
89
89
|
const t = o.row.original;
|
|
90
|
-
return
|
|
90
|
+
return d(
|
|
91
91
|
"span",
|
|
92
92
|
{ class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
|
|
93
93
|
o.getValue()
|
|
@@ -101,8 +101,8 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
101
101
|
meta: {
|
|
102
102
|
width: "100px"
|
|
103
103
|
},
|
|
104
|
-
cell: (o) =>
|
|
105
|
-
|
|
104
|
+
cell: (o) => d(
|
|
105
|
+
Y,
|
|
106
106
|
{
|
|
107
107
|
// grey out chip text when user cannot read report
|
|
108
108
|
class: `${o.getValue() !== a("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${o.row.original.canRead ? "" : "opacity-40 cursor-not-allowed"} fm-typo-en-body-sm-600`,
|
|
@@ -117,7 +117,7 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
117
117
|
enableSorting: !1,
|
|
118
118
|
cell: (o) => {
|
|
119
119
|
const t = o.row.original;
|
|
120
|
-
return
|
|
120
|
+
return d(
|
|
121
121
|
"span",
|
|
122
122
|
{ class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
|
|
123
123
|
o.getValue()
|
|
@@ -132,21 +132,21 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
132
132
|
width: "80px"
|
|
133
133
|
},
|
|
134
134
|
cell: (o) => {
|
|
135
|
-
var
|
|
136
|
-
const t = o.row.original, r = t.reportId, l =
|
|
135
|
+
var w;
|
|
136
|
+
const t = o.row.original, r = t.reportId, l = p.value.find((s) => s.id === r), H = r === ((w = B.value) == null ? void 0 : w.id), V = !t.canRead, D = l ? se(l) : !1, A = l ? U(l) : !1, n = [
|
|
137
137
|
{
|
|
138
138
|
label: a("report.common.duplicate"),
|
|
139
139
|
onClick: () => {
|
|
140
|
-
l &&
|
|
140
|
+
l && D ? me(l) : D || c.open({
|
|
141
141
|
message: a("report.messages.noPermissionDuplicateReport"),
|
|
142
142
|
type: "error"
|
|
143
143
|
});
|
|
144
144
|
},
|
|
145
145
|
variant: "",
|
|
146
|
-
disabled: !
|
|
146
|
+
disabled: !D
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
label: a(
|
|
149
|
+
label: a(H ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
|
|
150
150
|
onClick: async () => {
|
|
151
151
|
l && ie(l);
|
|
152
152
|
},
|
|
@@ -156,36 +156,36 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
156
156
|
{
|
|
157
157
|
label: a("report.common.remove"),
|
|
158
158
|
onClick: () => {
|
|
159
|
-
l && (
|
|
159
|
+
l && (A ? ue(l) : c.open({
|
|
160
160
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
161
161
|
type: "error"
|
|
162
162
|
}));
|
|
163
163
|
},
|
|
164
164
|
variant: "destructive",
|
|
165
|
-
disabled: !t.editable || !
|
|
165
|
+
disabled: !t.editable || !A
|
|
166
166
|
}
|
|
167
167
|
];
|
|
168
|
-
return
|
|
168
|
+
return d(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
class: `flex ${u.value.lg || u.value.md ? "justify-end" : ""} items-center`
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
default: () => [
|
|
175
|
-
|
|
175
|
+
d(
|
|
176
176
|
"button",
|
|
177
177
|
{
|
|
178
|
-
disabled:
|
|
179
|
-
title:
|
|
180
|
-
onClick:
|
|
181
|
-
l &&
|
|
178
|
+
disabled: V,
|
|
179
|
+
title: V ? a("report.messages.noPermission") : void 0,
|
|
180
|
+
onClick: Fe(() => {
|
|
181
|
+
l && pe(l);
|
|
182
182
|
}, ["stop"]),
|
|
183
183
|
class: `text-fm-color-neutral-gray-400 ${t.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
default: () => [
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
d(
|
|
188
|
+
M,
|
|
189
189
|
{
|
|
190
190
|
name: "keep",
|
|
191
191
|
class: "px-12 p-8",
|
|
@@ -197,8 +197,8 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
197
197
|
]
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
d(
|
|
201
|
+
K,
|
|
202
202
|
{
|
|
203
203
|
stopClickPropagation: !0,
|
|
204
204
|
shift: !0,
|
|
@@ -206,7 +206,7 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
default: () => n.map(
|
|
209
|
-
(s) =>
|
|
209
|
+
(s) => d(
|
|
210
210
|
C,
|
|
211
211
|
{
|
|
212
212
|
onClick: s.disabled ? {} : s.onClick,
|
|
@@ -215,17 +215,17 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
215
215
|
disabled: s.disabled
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
|
-
label: () =>
|
|
218
|
+
label: () => d("p", s.label)
|
|
219
219
|
}
|
|
220
220
|
)
|
|
221
221
|
),
|
|
222
|
-
"menu-button": () =>
|
|
223
|
-
|
|
222
|
+
"menu-button": () => d(
|
|
223
|
+
Ce,
|
|
224
224
|
{
|
|
225
225
|
variant: "tertiary",
|
|
226
226
|
size: "md",
|
|
227
227
|
icon: "more_vert",
|
|
228
|
-
iconColor:
|
|
228
|
+
iconColor: Ke.NeutralGray400,
|
|
229
229
|
disabled: !1
|
|
230
230
|
},
|
|
231
231
|
{}
|
|
@@ -243,17 +243,17 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
243
243
|
var t;
|
|
244
244
|
try {
|
|
245
245
|
const r = o.id === ((t = B.value) == null ? void 0 : t.id);
|
|
246
|
-
await
|
|
246
|
+
await f.updateDefaultReport(r ? null : o.id), c.open({
|
|
247
247
|
message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
|
|
248
248
|
type: "success"
|
|
249
249
|
});
|
|
250
250
|
} catch (r) {
|
|
251
|
-
|
|
251
|
+
c.open({ message: JSON.stringify(r), type: "error" });
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
async function
|
|
256
|
-
if (await
|
|
255
|
+
async function ke(o) {
|
|
256
|
+
if (await ae({
|
|
257
257
|
title: a("report.common.duplicate"),
|
|
258
258
|
message: a("report.messages.confirmAction", {
|
|
259
259
|
action: a("report.common.duplicate"),
|
|
@@ -263,86 +263,94 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
263
263
|
const r = JSON.parse(JSON.stringify(o));
|
|
264
264
|
r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, T(async () => {
|
|
265
265
|
try {
|
|
266
|
-
await
|
|
266
|
+
await f.createOrUpdateReport(r), c.open({
|
|
267
267
|
message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
|
|
268
268
|
type: "success"
|
|
269
269
|
});
|
|
270
270
|
} catch (l) {
|
|
271
|
-
|
|
271
|
+
c.open({ message: JSON.stringify(l), type: "error" });
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
function j(o) {
|
|
277
|
+
const t = p.value.find((r) => r.id === o.reportId);
|
|
278
|
+
return !t || !se(t);
|
|
279
|
+
}
|
|
280
|
+
function G(o) {
|
|
281
|
+
const t = p.value.find((r) => r.id === o.reportId);
|
|
282
|
+
return !o.editable || !t || !U(t);
|
|
283
|
+
}
|
|
284
|
+
async function ue(o) {
|
|
285
|
+
if (!U(o)) {
|
|
286
|
+
c.open({
|
|
279
287
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
280
288
|
type: "error"
|
|
281
289
|
});
|
|
282
290
|
return;
|
|
283
291
|
}
|
|
284
|
-
await
|
|
292
|
+
await ae({
|
|
285
293
|
title: a("report.messages.deleteReport"),
|
|
286
294
|
message: a("report.messages.confirmDelete", { name: o.name })
|
|
287
295
|
}) && T(async () => {
|
|
288
296
|
try {
|
|
289
|
-
await
|
|
297
|
+
await f.removeReport(o), c.open({
|
|
290
298
|
message: a("report.messages.deleteSuccess", { name: o.name }),
|
|
291
299
|
type: "success"
|
|
292
300
|
});
|
|
293
301
|
} catch (r) {
|
|
294
|
-
|
|
302
|
+
c.open({ message: JSON.stringify(r), type: "error" });
|
|
295
303
|
}
|
|
296
304
|
});
|
|
297
305
|
}
|
|
298
|
-
async function
|
|
299
|
-
if (
|
|
300
|
-
await
|
|
306
|
+
async function me(o) {
|
|
307
|
+
if (oe.value)
|
|
308
|
+
await ke(o);
|
|
301
309
|
else {
|
|
302
|
-
let t = `Your current plan only support up to ${
|
|
303
|
-
|
|
310
|
+
let t = `Your current plan only support up to ${F.value} custom reports.`;
|
|
311
|
+
F.value === 0 && (t = "Your current plan does not support custom report."), c.open({
|
|
304
312
|
message: t,
|
|
305
313
|
type: "error"
|
|
306
314
|
});
|
|
307
315
|
}
|
|
308
316
|
}
|
|
309
|
-
function
|
|
310
|
-
if (!
|
|
311
|
-
|
|
317
|
+
function De() {
|
|
318
|
+
if (!he.value) {
|
|
319
|
+
c.open({
|
|
312
320
|
message: a("report.messages.noPermission"),
|
|
313
321
|
type: "error"
|
|
314
322
|
});
|
|
315
323
|
return;
|
|
316
324
|
}
|
|
317
|
-
if (
|
|
318
|
-
|
|
325
|
+
if (oe.value)
|
|
326
|
+
Re.value = !0;
|
|
319
327
|
else {
|
|
320
|
-
let o = `Your current plan only support up to ${
|
|
321
|
-
|
|
328
|
+
let o = `Your current plan only support up to ${F.value} custom reports.`;
|
|
329
|
+
F.value === 0 && (o = "Your current plan does not support custom report."), c.open({
|
|
322
330
|
message: o,
|
|
323
331
|
type: "error"
|
|
324
332
|
});
|
|
325
333
|
}
|
|
326
334
|
}
|
|
327
|
-
function
|
|
328
|
-
const t =
|
|
329
|
-
|
|
335
|
+
function pe(o) {
|
|
336
|
+
const t = X(a, z, o.name, "other") ?? "";
|
|
337
|
+
I.value && I.value.includes(o.id) ? (c.open({
|
|
330
338
|
message: `${a("report.common.unpin")} ${t} ${a("report.common.successful")}`,
|
|
331
339
|
type: "success"
|
|
332
|
-
}),
|
|
340
|
+
}), f.clearPinReport(o.id)) : (c.open({
|
|
333
341
|
message: `${a("report.common.pin")} ${t} ${a("report.common.successful")}`,
|
|
334
342
|
type: "success"
|
|
335
|
-
}),
|
|
343
|
+
}), f.cachePinReport(o));
|
|
336
344
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
345
|
+
function _e(o) {
|
|
346
|
+
O.value = o;
|
|
339
347
|
}
|
|
340
|
-
const { selectedLocationIds:
|
|
348
|
+
const { selectedLocationIds: k, dateRange: P, compareDateRange: L, timeRange: v, locations: $e } = ge(), N = h(() => k.length === $e.length);
|
|
341
349
|
return (o, t) => {
|
|
342
|
-
const r =
|
|
343
|
-
return
|
|
350
|
+
const r = x("FmPageHead"), l = x("FmSearch"), H = x("FmForm"), V = x("FmListItem"), D = x("FmList"), A = x("FmTable");
|
|
351
|
+
return J(), W(Je, null, {
|
|
344
352
|
default: m(() => [
|
|
345
|
-
|
|
353
|
+
i(r, {
|
|
346
354
|
title: e(a)("report.common.report", 1),
|
|
347
355
|
class: "h-[68px]",
|
|
348
356
|
actions: [
|
|
@@ -353,208 +361,218 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
353
361
|
prependIcon: "add"
|
|
354
362
|
}
|
|
355
363
|
],
|
|
356
|
-
"onClick:action": t[0] || (t[0] = (n) =>
|
|
364
|
+
"onClick:action": t[0] || (t[0] = (n) => De())
|
|
357
365
|
}, null, 8, ["title", "actions"]),
|
|
358
|
-
|
|
359
|
-
class:
|
|
360
|
-
style:
|
|
366
|
+
g("div", {
|
|
367
|
+
class: y(`overflow-y-hidden flex flex-col gap-8 ${e(u).sm || e(u).xs ? "mb-20" : ""}`),
|
|
368
|
+
style: Oe({ height: `calc(100% - ${e(u).lg || e(u).md ? 72 : 64}px)` })
|
|
361
369
|
}, [
|
|
362
|
-
|
|
363
|
-
class:
|
|
370
|
+
i(H, {
|
|
371
|
+
class: y(`flex items-center gap-2 ${e(u).sm || e(u).xs ? "px-3" : "px-24"}`)
|
|
364
372
|
}, {
|
|
365
373
|
default: m(() => [
|
|
366
|
-
|
|
374
|
+
i(e(K), null, {
|
|
367
375
|
"menu-button": m(() => [
|
|
368
|
-
|
|
376
|
+
i(e(Y), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
|
|
369
377
|
default: m(() => [
|
|
370
|
-
|
|
371
|
-
|
|
378
|
+
g("p", null, _(e(a)(`report.category.${O.value.label}`)), 1),
|
|
379
|
+
i(e(M), { name: "expand_more" })
|
|
372
380
|
]),
|
|
373
381
|
_: 1
|
|
374
382
|
})
|
|
375
383
|
]),
|
|
376
384
|
default: m(() => [
|
|
377
|
-
(
|
|
378
|
-
key:
|
|
385
|
+
(J(!0), Pe(Le, null, Ne(ce.value, (n, w) => (J(), W(e(C), {
|
|
386
|
+
key: w,
|
|
379
387
|
label: e(a)(`report.category.${n.label}`),
|
|
380
|
-
onClick: () =>
|
|
388
|
+
onClick: () => _e(n)
|
|
381
389
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
382
390
|
]),
|
|
383
391
|
_: 1
|
|
384
392
|
}),
|
|
385
|
-
|
|
386
|
-
class:
|
|
393
|
+
g("div", {
|
|
394
|
+
class: y(`flex ${e(u).sm || e(u).xs ? "justify-center items-center" : ""}`)
|
|
387
395
|
}, [
|
|
388
|
-
|
|
396
|
+
g("p", We, _(e(a)("report.common.results", { count: S.value.length })), 1)
|
|
389
397
|
], 2),
|
|
390
|
-
t[3] || (t[3] =
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
modelValue:
|
|
394
|
-
"onUpdate:modelValue": t[1] || (t[1] = (n) =>
|
|
395
|
-
class:
|
|
398
|
+
t[3] || (t[3] = g("div", { class: "grow" }, null, -1)),
|
|
399
|
+
g("div", Xe, [
|
|
400
|
+
i(l, {
|
|
401
|
+
modelValue: q.value,
|
|
402
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => q.value = n),
|
|
403
|
+
class: y(`${e(u).lg || e(u).md ? "grow" : ""}`)
|
|
396
404
|
}, null, 8, ["modelValue", "class"])
|
|
397
405
|
])
|
|
398
406
|
]),
|
|
399
407
|
_: 1
|
|
400
408
|
}, 8, ["class"]),
|
|
401
|
-
|
|
402
|
-
key:
|
|
409
|
+
fe((J(), W(A, {
|
|
410
|
+
key: Se.value,
|
|
403
411
|
ref_key: "table",
|
|
404
|
-
ref:
|
|
405
|
-
class:
|
|
412
|
+
ref: b,
|
|
413
|
+
class: y([e(u).sm || e(u).xs ? "px-0" : "px-24", "report-table"]),
|
|
406
414
|
style: { height: "calc(100% - 40px)" },
|
|
407
|
-
"column-defs":
|
|
408
|
-
"row-data":
|
|
409
|
-
"page-size":
|
|
415
|
+
"column-defs": xe.value,
|
|
416
|
+
"row-data": S.value,
|
|
417
|
+
"page-size": S.value.length,
|
|
410
418
|
"hide-footer": !0,
|
|
411
419
|
"row-class-name": "row",
|
|
412
420
|
onRowClick: t[2] || (t[2] = (n) => {
|
|
413
421
|
if (!n.original.canRead) {
|
|
414
|
-
e(
|
|
422
|
+
e(c).open({
|
|
415
423
|
message: e(a)("report.messages.noPermission"),
|
|
416
424
|
type: "error"
|
|
417
425
|
});
|
|
418
426
|
return;
|
|
419
427
|
}
|
|
420
|
-
e(
|
|
428
|
+
e(be).suppressReportRouteSync = !0, e(f).updateCurrentReportId(n.original.reportId), e(Z).push({
|
|
421
429
|
name: "reportView",
|
|
422
430
|
query: {
|
|
423
|
-
...e(
|
|
431
|
+
...e(ee).query,
|
|
424
432
|
reportId: n.original.reportId,
|
|
425
|
-
startDate: e(
|
|
426
|
-
endDate: e(
|
|
433
|
+
startDate: e(P).startDate,
|
|
434
|
+
endDate: e(P).endDate,
|
|
427
435
|
compareStartDate: e(L).startDate,
|
|
428
436
|
compareEndDate: e(L).endDate,
|
|
429
437
|
timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
|
|
430
438
|
timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
|
|
431
|
-
isAllLocation:
|
|
432
|
-
locationIds:
|
|
439
|
+
isAllLocation: N.value.toString(),
|
|
440
|
+
locationIds: N.value ? void 0 : e(k) ? JSON.stringify(e(k)) : void 0
|
|
433
441
|
}
|
|
434
442
|
});
|
|
435
443
|
})
|
|
436
444
|
}, {
|
|
437
445
|
"list-row": m(({ original: n }) => [
|
|
438
|
-
|
|
446
|
+
i(D, {
|
|
439
447
|
onClick: () => {
|
|
440
448
|
if (!n.canRead) {
|
|
441
|
-
e(
|
|
449
|
+
e(c).open({
|
|
442
450
|
message: e(a)("report.messages.noPermission"),
|
|
443
451
|
type: "error"
|
|
444
452
|
});
|
|
445
453
|
return;
|
|
446
454
|
}
|
|
447
|
-
n.reportId && (e(
|
|
455
|
+
n.reportId && (e(f).updateCurrentReportId(n.reportId), e(Z).push({
|
|
448
456
|
name: "reportView",
|
|
449
457
|
query: {
|
|
450
|
-
...e(
|
|
458
|
+
...e(ee).query,
|
|
451
459
|
reportId: n.reportId,
|
|
452
|
-
startDate: e(
|
|
453
|
-
endDate: e(
|
|
460
|
+
startDate: e(P).startDate,
|
|
461
|
+
endDate: e(P).endDate,
|
|
454
462
|
compareStartDate: e(L).startDate,
|
|
455
463
|
compareEndDate: e(L).endDate,
|
|
456
464
|
timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
|
|
457
465
|
timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
|
|
458
|
-
isAllLocation:
|
|
459
|
-
locationIds:
|
|
466
|
+
isAllLocation: N.value.toString(),
|
|
467
|
+
locationIds: N.value ? void 0 : e(k) ? JSON.stringify(e(k)) : void 0
|
|
460
468
|
}
|
|
461
469
|
}));
|
|
462
470
|
}
|
|
463
471
|
}, {
|
|
464
472
|
default: m(() => [
|
|
465
|
-
|
|
473
|
+
i(V, {
|
|
466
474
|
tag: "label",
|
|
467
|
-
label: n.name,
|
|
468
475
|
clickable: ""
|
|
469
476
|
}, {
|
|
470
477
|
append: m(() => [
|
|
471
|
-
|
|
472
|
-
class:
|
|
473
|
-
n.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"
|
|
474
|
-
),
|
|
478
|
+
i(e(Y), {
|
|
479
|
+
class: y(`${n.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${n.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
|
|
475
480
|
compact: !0
|
|
476
481
|
}, {
|
|
477
482
|
default: m(() => [
|
|
478
|
-
|
|
483
|
+
g("p", Ze, _(n.category), 1)
|
|
479
484
|
]),
|
|
480
485
|
_: 2
|
|
481
486
|
}, 1032, ["class"]),
|
|
482
|
-
|
|
487
|
+
i(e(K), {
|
|
483
488
|
placement: "left",
|
|
484
489
|
"stop-click-propagation": !0
|
|
485
490
|
}, {
|
|
486
491
|
"menu-button": m(() => [
|
|
487
|
-
|
|
492
|
+
i(e(M), {
|
|
488
493
|
name: "more_vert",
|
|
489
494
|
class: "btn-color"
|
|
490
495
|
})
|
|
491
496
|
]),
|
|
492
497
|
default: m(() => {
|
|
493
|
-
var
|
|
498
|
+
var w;
|
|
494
499
|
return [
|
|
495
|
-
|
|
500
|
+
i(e(C), {
|
|
496
501
|
label: n.pin ? "Unpin" : "Pin",
|
|
497
502
|
onClick: () => {
|
|
498
|
-
const s = e(
|
|
499
|
-
(
|
|
503
|
+
const s = e(p).find(
|
|
504
|
+
(R) => R.id === n.reportId
|
|
500
505
|
);
|
|
501
|
-
s &&
|
|
506
|
+
s && pe(s);
|
|
502
507
|
}
|
|
503
508
|
}, null, 8, ["label", "onClick"]),
|
|
504
|
-
|
|
509
|
+
i(e(C), {
|
|
505
510
|
label: e(a)("report.common.duplicate"),
|
|
511
|
+
disabled: j(n),
|
|
512
|
+
class: y(
|
|
513
|
+
j(n) ? "text-fm-color-typo-disabled" : ""
|
|
514
|
+
),
|
|
506
515
|
onClick: () => {
|
|
507
|
-
const s = e(
|
|
508
|
-
(
|
|
516
|
+
const s = e(p).find(
|
|
517
|
+
(R) => R.id === n.reportId
|
|
509
518
|
);
|
|
510
|
-
s &&
|
|
519
|
+
s && !j(n) ? me(s) : e(c).open({
|
|
520
|
+
message: e(a)("report.messages.noPermissionDuplicateReport"),
|
|
521
|
+
type: "error"
|
|
522
|
+
});
|
|
511
523
|
}
|
|
512
|
-
}, null, 8, ["label", "onClick"]),
|
|
513
|
-
|
|
524
|
+
}, null, 8, ["label", "disabled", "class", "onClick"]),
|
|
525
|
+
i(e(C), {
|
|
514
526
|
label: e(a)(
|
|
515
|
-
n.reportId === ((
|
|
527
|
+
n.reportId === ((w = e(B)) == null ? void 0 : w.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
|
|
516
528
|
),
|
|
517
529
|
onClick: () => {
|
|
518
|
-
const s = e(
|
|
519
|
-
(
|
|
530
|
+
const s = e(p).find(
|
|
531
|
+
(R) => R.id === n.reportId
|
|
520
532
|
);
|
|
521
533
|
s && ie(s);
|
|
522
534
|
}
|
|
523
535
|
}, null, 8, ["label", "onClick"]),
|
|
524
|
-
|
|
536
|
+
i(e(C), {
|
|
525
537
|
label: e(a)("report.common.delete"),
|
|
526
|
-
|
|
538
|
+
disabled: G(n),
|
|
539
|
+
class: y(
|
|
540
|
+
G(n) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
|
|
541
|
+
),
|
|
527
542
|
onClick: () => {
|
|
528
|
-
const s = e(
|
|
529
|
-
(
|
|
543
|
+
const s = e(p).find(
|
|
544
|
+
(R) => R.id === n.reportId
|
|
530
545
|
);
|
|
531
|
-
s &&
|
|
546
|
+
s && !G(n) && ue(s);
|
|
532
547
|
}
|
|
533
548
|
}, {
|
|
534
549
|
label: m(() => [
|
|
535
|
-
|
|
550
|
+
Ve(_(e(a)("report.common.delete")), 1)
|
|
536
551
|
]),
|
|
537
552
|
_: 2
|
|
538
|
-
}, 1032, ["label", "onClick"])
|
|
539
|
-
[Q, n.editable]
|
|
540
|
-
])
|
|
553
|
+
}, 1032, ["label", "disabled", "class", "onClick"])
|
|
541
554
|
];
|
|
542
555
|
}),
|
|
543
556
|
_: 2
|
|
544
557
|
}, 1024)
|
|
545
558
|
]),
|
|
559
|
+
default: m(() => [
|
|
560
|
+
g("span", {
|
|
561
|
+
class: y(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", n.canRead ? "" : "opacity-40 cursor-not-allowed"])
|
|
562
|
+
}, _(n.name), 3)
|
|
563
|
+
]),
|
|
546
564
|
_: 2
|
|
547
|
-
},
|
|
565
|
+
}, 1024)
|
|
548
566
|
]),
|
|
549
567
|
_: 2
|
|
550
568
|
}, 1032, ["onClick"])
|
|
551
569
|
]),
|
|
552
570
|
_: 1
|
|
553
571
|
}, 8, ["class", "column-defs", "row-data", "page-size"])), [
|
|
554
|
-
[
|
|
572
|
+
[ye, S.value.length > 0]
|
|
555
573
|
]),
|
|
556
|
-
|
|
557
|
-
[
|
|
574
|
+
fe(i(Me, null, null, 512), [
|
|
575
|
+
[ye, S.value.length === 0]
|
|
558
576
|
])
|
|
559
577
|
], 6)
|
|
560
578
|
]),
|
|
@@ -564,5 +582,5 @@ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe
|
|
|
564
582
|
}
|
|
565
583
|
});
|
|
566
584
|
export {
|
|
567
|
-
|
|
585
|
+
dt as default
|
|
568
586
|
};
|