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