@feedmepos/mf-report 5.18.2-beta.2 → 5.18.2-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.
|
@@ -99,7 +99,7 @@ const be = ["src"], we = ["src"], Le = /* @__PURE__ */ x({
|
|
|
99
99
|
}), ee(() => {
|
|
100
100
|
l(pe);
|
|
101
101
|
}), z(() => {
|
|
102
|
-
console.log("5.18.2-beta.
|
|
102
|
+
console.log("5.18.2-beta.3", !0), window.addEventListener("message", R), window.addEventListener("message", E);
|
|
103
103
|
});
|
|
104
104
|
const I = de(), L = fe();
|
|
105
105
|
te(() => {
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { defineComponent as ee, computed as c, watch as J, resolveComponent as te, createBlock as I, openBlock as v, withCtx as ae, createVNode as E, createElementVNode as L, unref as n, normalizeStyle as re, normalizeClass as N, createElementBlock as $, Fragment as oe, renderList as ne } from "vue";
|
|
2
|
+
import { _ as ie } from "./MenuTab.vue_vue_type_script_setup_true_lang-C8oiHuOX.js";
|
|
3
|
+
import { _ as se } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-DKA5lLXB.js";
|
|
4
|
+
import { useRouter as le, useRoute as ue } from "vue-router";
|
|
5
|
+
import { _ as ce } from "./Default.vue_vue_type_script_setup_true_lang-DpSgAipe.js";
|
|
6
|
+
import { a as de } from "./BaseDialog.vue_vue_type_script_setup_true_lang-djyc20Cp.js";
|
|
7
|
+
import { storeToRefs as _ } from "pinia";
|
|
8
|
+
import { b as pe, c as me, u as fe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CDxb2Mjg.js";
|
|
9
|
+
import { _ as ge } from "./NoData.vue_vue_type_script_setup_true_lang-Divo8W18.js";
|
|
10
|
+
import { useSnackbar as ve, useBreakpoints as ye } from "@feedmepos/ui-library";
|
|
11
|
+
import { u as De, b as Se, f as be, d, e as Re } from "./vue-i18n-CTLGxUiF.js";
|
|
12
|
+
import { u as _e } from "./message-dialog-UoMWOnil.js";
|
|
13
|
+
import { r as Ie } from "./i18n-Cif1I9J2.js";
|
|
14
|
+
const Ce = { class: "sticky top-0 z-10 bg-white" }, Ae = /* @__PURE__ */ ee({
|
|
15
|
+
__name: "ReportView",
|
|
16
|
+
setup(Oe) {
|
|
17
|
+
const { t: i, te: P } = De(), y = le(), t = ue(), m = ve(), { promptMessage: M } = _e(), f = de(), C = pe(), l = Se(), { promptLoader: A } = be(), { breakpoints: u } = ye(), {
|
|
18
|
+
currentReport: r,
|
|
19
|
+
currentReportId: O,
|
|
20
|
+
isOpenDownloadDialog: T,
|
|
21
|
+
isOpenEmailDialog: F,
|
|
22
|
+
editingReport: j,
|
|
23
|
+
canCreateCustomReport: B,
|
|
24
|
+
customReportQuota: q
|
|
25
|
+
} = _(f), D = c(() => t.query.reportId || O.value), S = c(() => ({
|
|
26
|
+
startDate: t.query.startDate ? d(t.query.startDate).startOf("day").toISOString() : void 0,
|
|
27
|
+
endDate: t.query.endDate ? d(t.query.endDate).endOf("day").toISOString() : void 0
|
|
28
|
+
})), b = c(() => ({
|
|
29
|
+
startDate: t.query.compareStartDate ? d(t.query.compareStartDate).startOf("day").toISOString() : void 0,
|
|
30
|
+
endDate: t.query.compareEndDate ? d(t.query.compareEndDate).endOf("day").toISOString() : void 0
|
|
31
|
+
})), R = c(() => ({
|
|
32
|
+
start: t.query.timeStart ? JSON.parse(t.query.timeStart) : void 0,
|
|
33
|
+
end: t.query.timeEnd ? JSON.parse(t.query.timeEnd) : void 0
|
|
34
|
+
})), k = c(() => t.query.isAllLocation === "true"), Q = c(() => k.value ? l.selectedLocationIds : t.query.locationIds ? JSON.parse(t.query.locationIds) : void 0);
|
|
35
|
+
J(
|
|
36
|
+
() => f.reports.length,
|
|
37
|
+
(a) => {
|
|
38
|
+
if (a > 0) {
|
|
39
|
+
const e = D.value;
|
|
40
|
+
e && e !== O.value && (f.updateCurrentReportId(e), (S.value.startDate || S.value.endDate) && l.setDateRange({
|
|
41
|
+
startDate: S.value.startDate,
|
|
42
|
+
endDate: S.value.endDate
|
|
43
|
+
}), (b.value.startDate || b.value.endDate) && l.setCompareDateRange({
|
|
44
|
+
startDate: b.value.startDate,
|
|
45
|
+
endDate: b.value.endDate
|
|
46
|
+
}), (R.value.start || R.value.end) && l.setTimeRange({
|
|
47
|
+
start: R.value.start,
|
|
48
|
+
end: R.value.end
|
|
49
|
+
}), k.value || l.setSelectedLocationIds(Q.value));
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{ immediate: !0 }
|
|
53
|
+
), J(
|
|
54
|
+
() => ({
|
|
55
|
+
selectedLocationIds: l.selectedLocationIds,
|
|
56
|
+
dateRange: l.dateRange,
|
|
57
|
+
timeRange: l.timeRange,
|
|
58
|
+
compareDateRange: l.compareDateRange
|
|
59
|
+
}),
|
|
60
|
+
(a) => {
|
|
61
|
+
console.log(a);
|
|
62
|
+
const e = a.selectedLocationIds, s = a.dateRange, p = a.timeRange, o = a.compareDateRange;
|
|
63
|
+
if (!r.value) return;
|
|
64
|
+
const g = {
|
|
65
|
+
...t.query,
|
|
66
|
+
reportId: r.value.id,
|
|
67
|
+
startDate: s.startDate ? d(s.startDate).format("YYYY-MM-DD") : void 0,
|
|
68
|
+
endDate: s.endDate ? d(s.endDate).format("YYYY-MM-DD") : void 0,
|
|
69
|
+
compareStartDate: o.startDate ? d(o.startDate).format("YYYY-MM-DD") : void 0,
|
|
70
|
+
compareEndDate: o.endDate ? d(o.endDate).format("YYYY-MM-DD") : void 0,
|
|
71
|
+
timeStart: p.start ? JSON.stringify(p.start) : void 0,
|
|
72
|
+
timeEnd: p.end ? JSON.stringify(p.end) : void 0,
|
|
73
|
+
locationIds: e.length === l.locations.length ? null : e.length > 0 ? JSON.stringify(e) : void 0,
|
|
74
|
+
isAllLocation: String(e.length === l.locations.length)
|
|
75
|
+
}, X = JSON.stringify(t.query), Z = JSON.stringify(g);
|
|
76
|
+
X !== Z && y.replace({
|
|
77
|
+
name: t.name,
|
|
78
|
+
params: t.params,
|
|
79
|
+
query: g
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
{ deep: !0 }
|
|
83
|
+
);
|
|
84
|
+
const { isOpenAccountingDialog: z } = _(me()), { isOpenScheduleDialog: h } = _(fe()), { disabled: H } = _(Re()), G = c(() => {
|
|
85
|
+
const a = [
|
|
86
|
+
{
|
|
87
|
+
icon: "mail",
|
|
88
|
+
label: i("report.common.emailSchedule"),
|
|
89
|
+
onClick: () => {
|
|
90
|
+
h.value = !0;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
// {
|
|
94
|
+
// icon: "article",
|
|
95
|
+
// label: "Set as Default",
|
|
96
|
+
// onClick: async () => {
|
|
97
|
+
// await promptLoader(async () => {
|
|
98
|
+
// if (currentReport.value) {
|
|
99
|
+
// try {
|
|
100
|
+
// await reportStore.updateDefaultReport(currentReport.value.id)
|
|
101
|
+
// snackbar.open({
|
|
102
|
+
// message: `Set ${currentReport.value.name} as default successful`,
|
|
103
|
+
// type: "success"
|
|
104
|
+
// })
|
|
105
|
+
// } catch (err) {
|
|
106
|
+
// snackbar.open({ message: JSON.stringify(err), type: "error" })
|
|
107
|
+
// }
|
|
108
|
+
// }
|
|
109
|
+
// })
|
|
110
|
+
// }
|
|
111
|
+
// },
|
|
112
|
+
{
|
|
113
|
+
icon: "content_copy",
|
|
114
|
+
label: i("report.common.copyID"),
|
|
115
|
+
onClick: () => {
|
|
116
|
+
r.value && (navigator.clipboard.writeText(D.value), m.open({ message: i("report.messages.copiedReportIdToClipboard"), type: "success" }));
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
icon: "report_jobs",
|
|
121
|
+
label: i("report.common.reportStatus"),
|
|
122
|
+
onClick: () => {
|
|
123
|
+
w();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
return H.value || a.splice(1, 0, {
|
|
128
|
+
icon: "download",
|
|
129
|
+
label: i("report.common.accountingExport"),
|
|
130
|
+
onClick: x
|
|
131
|
+
}), a;
|
|
132
|
+
});
|
|
133
|
+
async function w() {
|
|
134
|
+
C.isOpenJobDialog = !0, await C.getJobs();
|
|
135
|
+
}
|
|
136
|
+
function U() {
|
|
137
|
+
j.value = JSON.parse(JSON.stringify(r.value)), y.push({
|
|
138
|
+
name: "reportEditor",
|
|
139
|
+
query: t.query
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
async function W() {
|
|
143
|
+
if (!B.value) {
|
|
144
|
+
let e = `Your current plan only support up to ${q.value} custom reports.`;
|
|
145
|
+
q.value === 0 && (e = "Your current plan does not support custom report."), m.open({
|
|
146
|
+
message: e,
|
|
147
|
+
type: "error"
|
|
148
|
+
});
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (!r.value) {
|
|
152
|
+
m.open({ message: "No Widget", type: "error" });
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (await M({
|
|
156
|
+
title: `${i("report.messages.saveReport")}`,
|
|
157
|
+
message: i("report.messages.confirmAction", {
|
|
158
|
+
action: i("report.common.duplicate"),
|
|
159
|
+
name: r.value.name
|
|
160
|
+
})
|
|
161
|
+
}) && r.value) {
|
|
162
|
+
const e = JSON.parse(JSON.stringify(r.value));
|
|
163
|
+
e.editable = !0, e.id = "", e.name = `${e.name} duplicate`;
|
|
164
|
+
try {
|
|
165
|
+
await A(async () => {
|
|
166
|
+
const s = await f.createOrUpdateReport(e);
|
|
167
|
+
f.updateCurrentReportId(s.id), y.push({
|
|
168
|
+
name: "reportView",
|
|
169
|
+
params: { reportId: s.id, ...t.params },
|
|
170
|
+
query: t.query
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
} catch (s) {
|
|
174
|
+
console.log(s), m.open({ message: "Failed to clone report", type: "error" });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function x() {
|
|
179
|
+
z.value = !0;
|
|
180
|
+
}
|
|
181
|
+
function K() {
|
|
182
|
+
r.value && (navigator.clipboard.writeText(D.value), m.open({ message: "Copied report ID to clipboard", type: "success" }));
|
|
183
|
+
}
|
|
184
|
+
const Y = c(() => r.value ? r.value.tiles : []), V = c(() => {
|
|
185
|
+
var e;
|
|
186
|
+
let a = [
|
|
187
|
+
(e = r == null ? void 0 : r.value) != null && e.editable ? { label: i("report.common.edit"), value: "edit", isPrimary: !1 } : {
|
|
188
|
+
label: i("report.common.duplicate"),
|
|
189
|
+
value: "duplicate",
|
|
190
|
+
isPrimary: !1
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
label: i("report.common.download"),
|
|
194
|
+
value: "download",
|
|
195
|
+
isPrimary: !0,
|
|
196
|
+
prependIcon: "download"
|
|
197
|
+
},
|
|
198
|
+
{ label: i("report.schedule.sendEmail"), value: "email", isPrimary: !0 }
|
|
199
|
+
];
|
|
200
|
+
return u.value.xs && (a = [
|
|
201
|
+
...a,
|
|
202
|
+
{ label: "Send Email", value: "email", isPrimary: !1 },
|
|
203
|
+
{ label: "Job Delivery Status", value: "report_jobs", isPrimary: !1 },
|
|
204
|
+
{ label: "Email schedule", value: "schedule_email", isPrimary: !1 },
|
|
205
|
+
{ label: "Accounting export", value: "export", isPrimary: !1 },
|
|
206
|
+
{ label: "Copy ID", value: "content_copy", isPrimary: !1 }
|
|
207
|
+
], a = a.filter((s) => s.value !== "edit")), a;
|
|
208
|
+
});
|
|
209
|
+
return (a, e) => {
|
|
210
|
+
const s = te("FmPageHead");
|
|
211
|
+
return v(), I(ce, null, {
|
|
212
|
+
default: ae(() => {
|
|
213
|
+
var p;
|
|
214
|
+
return [
|
|
215
|
+
E(s, {
|
|
216
|
+
title: n(Ie)(n(i), n(P), (p = n(r)) == null ? void 0 : p.name, "other"),
|
|
217
|
+
"back-button": !0,
|
|
218
|
+
actions: V.value,
|
|
219
|
+
"onClick:back": e[0] || (e[0] = (o) => n(y).push({ name: "reports", query: n(t).query })),
|
|
220
|
+
"onClick:action": e[1] || (e[1] = (o) => {
|
|
221
|
+
o === "duplicate" && W(), o === "download" && (T.value = !0), o === "email" && (F.value = !0), o === "edit" && U(), o === "schedule_email" && (h.value = !0), o === "content_copy" && K(), o === "export" && x(), o === "report_jobs" && w();
|
|
222
|
+
})
|
|
223
|
+
}, null, 8, ["title", "actions"]),
|
|
224
|
+
L("div", {
|
|
225
|
+
class: N(`flex flex-col overflow-y-auto ${n(u).xs || n(u).sm ? "pb-20" : ""}`),
|
|
226
|
+
style: re({ height: `calc(100% - ${n(u).lg || n(u).md ? 72 : 64}px)` })
|
|
227
|
+
}, [
|
|
228
|
+
L("div", Ce, [
|
|
229
|
+
E(ie, {
|
|
230
|
+
"model-value": n(u).lg || n(u).md ? G.value : []
|
|
231
|
+
}, null, 8, ["model-value"])
|
|
232
|
+
]),
|
|
233
|
+
n(r) && Y.value.length > 0 ? (v(), $("div", {
|
|
234
|
+
key: 0,
|
|
235
|
+
class: N(["grid grid-cols-12", n(u).sm || n(u).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
|
|
236
|
+
}, [
|
|
237
|
+
(v(!0), $(oe, null, ne(Y.value, (o, g) => (v(), I(se, {
|
|
238
|
+
key: `widget_${D.value}_${g}`,
|
|
239
|
+
"model-value": o,
|
|
240
|
+
index: g
|
|
241
|
+
}, null, 8, ["model-value", "index"]))), 128))
|
|
242
|
+
], 2)) : (v(), I(ge, { key: 1 }))
|
|
243
|
+
], 6)
|
|
244
|
+
];
|
|
245
|
+
}),
|
|
246
|
+
_: 1
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
export {
|
|
252
|
+
Ae as default
|
|
253
|
+
};
|
package/dist/app.js
CHANGED
|
@@ -4975,7 +4975,7 @@ const a = {
|
|
|
4975
4975
|
{
|
|
4976
4976
|
path: "/report-view",
|
|
4977
4977
|
name: "reportView",
|
|
4978
|
-
component: () => import("./ReportView-
|
|
4978
|
+
component: () => import("./ReportView-Dzu_N8KD.js")
|
|
4979
4979
|
},
|
|
4980
4980
|
{
|
|
4981
4981
|
path: "/report-editor",
|
|
@@ -5028,7 +5028,7 @@ const u = {
|
|
|
5028
5028
|
"zh-CN": m,
|
|
5029
5029
|
"th-TH": c,
|
|
5030
5030
|
"zh-Hant": p
|
|
5031
|
-
}, h = e(() => import("./App-
|
|
5031
|
+
}, h = e(() => import("./App-CTE1eUtj.js"));
|
|
5032
5032
|
export {
|
|
5033
5033
|
h as FmApp,
|
|
5034
5034
|
u as i18nMessages,
|
package/package.json
CHANGED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, computed as c, onMounted as X, watch as Z, resolveComponent as ee, createBlock as I, openBlock as f, withCtx as te, createVNode as E, createElementVNode as J, unref as n, normalizeStyle as ae, normalizeClass as L, createElementBlock as N, Fragment as re, renderList as oe } from "vue";
|
|
2
|
-
import { _ as ne } from "./MenuTab.vue_vue_type_script_setup_true_lang-C8oiHuOX.js";
|
|
3
|
-
import { _ as se } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-DKA5lLXB.js";
|
|
4
|
-
import { useRouter as ie, useRoute as le } from "vue-router";
|
|
5
|
-
import { _ as ue } from "./Default.vue_vue_type_script_setup_true_lang-DpSgAipe.js";
|
|
6
|
-
import { a as ce } from "./BaseDialog.vue_vue_type_script_setup_true_lang-djyc20Cp.js";
|
|
7
|
-
import { storeToRefs as _ } from "pinia";
|
|
8
|
-
import { b as de, c as pe, u as me } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CDxb2Mjg.js";
|
|
9
|
-
import { _ as fe } from "./NoData.vue_vue_type_script_setup_true_lang-Divo8W18.js";
|
|
10
|
-
import { useSnackbar as ge, useBreakpoints as ve } from "@feedmepos/ui-library";
|
|
11
|
-
import { u as ye, b as De, f as Se, d, e as be } from "./vue-i18n-CTLGxUiF.js";
|
|
12
|
-
import { u as Re } from "./message-dialog-UoMWOnil.js";
|
|
13
|
-
import { r as _e } from "./i18n-Cif1I9J2.js";
|
|
14
|
-
const Ie = { class: "sticky top-0 z-10 bg-white" }, Pe = /* @__PURE__ */ K({
|
|
15
|
-
__name: "ReportView",
|
|
16
|
-
setup(Ce) {
|
|
17
|
-
const { t: s, te: $ } = ye(), g = ie(), e = le(), m = ge(), { promptMessage: M } = Re(), v = ce(), C = de(), l = De(), { promptLoader: P } = Se(), { breakpoints: u } = ve(), {
|
|
18
|
-
currentReport: r,
|
|
19
|
-
currentReportId: k,
|
|
20
|
-
isOpenDownloadDialog: A,
|
|
21
|
-
isOpenEmailDialog: T,
|
|
22
|
-
editingReport: F,
|
|
23
|
-
canCreateCustomReport: j,
|
|
24
|
-
customReportQuota: q
|
|
25
|
-
} = _(v), y = c(() => e.query.reportId || k.value), D = c(() => ({
|
|
26
|
-
startDate: e.query.startDate ? d(e.query.startDate).startOf("day").toISOString() : void 0,
|
|
27
|
-
endDate: e.query.endDate ? d(e.query.endDate).endOf("day").toISOString() : void 0
|
|
28
|
-
})), S = c(() => ({
|
|
29
|
-
startDate: e.query.compareStartDate ? d(e.query.compareStartDate).startOf("day").toISOString() : void 0,
|
|
30
|
-
endDate: e.query.compareEndDate ? d(e.query.compareEndDate).endOf("day").toISOString() : void 0
|
|
31
|
-
})), b = c(() => ({
|
|
32
|
-
start: e.query.timeStart ? JSON.parse(e.query.timeStart) : void 0,
|
|
33
|
-
end: e.query.timeEnd ? JSON.parse(e.query.timeEnd) : void 0
|
|
34
|
-
})), O = c(() => e.query.isAllLocation === "true"), B = c(() => O.value ? l.selectedLocationIds : e.query.locationIds ? JSON.parse(e.query.locationIds) : void 0);
|
|
35
|
-
X(() => {
|
|
36
|
-
const a = y.value;
|
|
37
|
-
a && a !== k.value && (v.updateCurrentReportId(a), (D.value.startDate || D.value.endDate) && l.setDateRange({
|
|
38
|
-
startDate: D.value.startDate,
|
|
39
|
-
endDate: D.value.endDate
|
|
40
|
-
}), (S.value.startDate || S.value.endDate) && l.setCompareDateRange({
|
|
41
|
-
startDate: S.value.startDate,
|
|
42
|
-
endDate: S.value.endDate
|
|
43
|
-
}), (b.value.start || b.value.end) && l.setTimeRange({
|
|
44
|
-
start: b.value.start,
|
|
45
|
-
end: b.value.end
|
|
46
|
-
}), O.value || l.setSelectedLocationIds(B.value));
|
|
47
|
-
}), Z(
|
|
48
|
-
() => ({
|
|
49
|
-
selectedLocationIds: l.selectedLocationIds,
|
|
50
|
-
dateRange: l.dateRange,
|
|
51
|
-
timeRange: l.timeRange,
|
|
52
|
-
compareDateRange: l.compareDateRange
|
|
53
|
-
}),
|
|
54
|
-
(a) => {
|
|
55
|
-
const t = a.selectedLocationIds, i = a.dateRange, p = a.timeRange, o = a.compareDateRange;
|
|
56
|
-
if (!r.value) return;
|
|
57
|
-
const R = {
|
|
58
|
-
...e.query,
|
|
59
|
-
reportId: r.value.id,
|
|
60
|
-
startDate: i.startDate ? d(i.startDate).format("YYYY-MM-DD") : void 0,
|
|
61
|
-
endDate: i.endDate ? d(i.endDate).format("YYYY-MM-DD") : void 0,
|
|
62
|
-
compareStartDate: o.startDate ? d(o.startDate).format("YYYY-MM-DD") : void 0,
|
|
63
|
-
compareEndDate: o.endDate ? d(o.endDate).format("YYYY-MM-DD") : void 0,
|
|
64
|
-
timeStart: p.start ? JSON.stringify(p.start) : void 0,
|
|
65
|
-
timeEnd: p.end ? JSON.stringify(p.end) : void 0,
|
|
66
|
-
locationIds: t.length === l.locations.length ? null : t.length > 0 ? JSON.stringify(t) : void 0,
|
|
67
|
-
isAllLocation: String(t.length === l.locations.length)
|
|
68
|
-
};
|
|
69
|
-
g.replace({
|
|
70
|
-
name: e.name,
|
|
71
|
-
params: e.params,
|
|
72
|
-
query: R
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
{ deep: !0 }
|
|
76
|
-
);
|
|
77
|
-
const { isOpenAccountingDialog: z } = _(pe()), { isOpenScheduleDialog: w } = _(me()), { disabled: H } = _(be()), Q = c(() => {
|
|
78
|
-
const a = [
|
|
79
|
-
{
|
|
80
|
-
icon: "mail",
|
|
81
|
-
label: s("report.common.emailSchedule"),
|
|
82
|
-
onClick: () => {
|
|
83
|
-
w.value = !0;
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
// {
|
|
87
|
-
// icon: "article",
|
|
88
|
-
// label: "Set as Default",
|
|
89
|
-
// onClick: async () => {
|
|
90
|
-
// await promptLoader(async () => {
|
|
91
|
-
// if (currentReport.value) {
|
|
92
|
-
// try {
|
|
93
|
-
// await reportStore.updateDefaultReport(currentReport.value.id)
|
|
94
|
-
// snackbar.open({
|
|
95
|
-
// message: `Set ${currentReport.value.name} as default successful`,
|
|
96
|
-
// type: "success"
|
|
97
|
-
// })
|
|
98
|
-
// } catch (err) {
|
|
99
|
-
// snackbar.open({ message: JSON.stringify(err), type: "error" })
|
|
100
|
-
// }
|
|
101
|
-
// }
|
|
102
|
-
// })
|
|
103
|
-
// }
|
|
104
|
-
// },
|
|
105
|
-
{
|
|
106
|
-
icon: "content_copy",
|
|
107
|
-
label: s("report.common.copyID"),
|
|
108
|
-
onClick: () => {
|
|
109
|
-
r.value && (navigator.clipboard.writeText(y.value), m.open({ message: s("report.messages.copiedReportIdToClipboard"), type: "success" }));
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
icon: "report_jobs",
|
|
114
|
-
label: s("report.common.reportStatus"),
|
|
115
|
-
onClick: () => {
|
|
116
|
-
h();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
];
|
|
120
|
-
return H.value || a.splice(1, 0, {
|
|
121
|
-
icon: "download",
|
|
122
|
-
label: s("report.common.accountingExport"),
|
|
123
|
-
onClick: x
|
|
124
|
-
}), a;
|
|
125
|
-
});
|
|
126
|
-
async function h() {
|
|
127
|
-
C.isOpenJobDialog = !0, await C.getJobs();
|
|
128
|
-
}
|
|
129
|
-
function G() {
|
|
130
|
-
F.value = JSON.parse(JSON.stringify(r.value)), g.push({
|
|
131
|
-
name: "reportEditor",
|
|
132
|
-
query: e.query
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
async function U() {
|
|
136
|
-
if (!j.value) {
|
|
137
|
-
let t = `Your current plan only support up to ${q.value} custom reports.`;
|
|
138
|
-
q.value === 0 && (t = "Your current plan does not support custom report."), m.open({
|
|
139
|
-
message: t,
|
|
140
|
-
type: "error"
|
|
141
|
-
});
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (!r.value) {
|
|
145
|
-
m.open({ message: "No Widget", type: "error" });
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (await M({
|
|
149
|
-
title: `${s("report.messages.saveReport")}`,
|
|
150
|
-
message: s("report.messages.confirmAction", {
|
|
151
|
-
action: s("report.common.duplicate"),
|
|
152
|
-
name: r.value.name
|
|
153
|
-
})
|
|
154
|
-
}) && r.value) {
|
|
155
|
-
const t = JSON.parse(JSON.stringify(r.value));
|
|
156
|
-
t.editable = !0, t.id = "", t.name = `${t.name} duplicate`;
|
|
157
|
-
try {
|
|
158
|
-
await P(async () => {
|
|
159
|
-
const i = await v.createOrUpdateReport(t);
|
|
160
|
-
v.updateCurrentReportId(i.id), g.push({
|
|
161
|
-
name: "reportView",
|
|
162
|
-
params: { reportId: i.id, ...e.params },
|
|
163
|
-
query: e.query
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
} catch (i) {
|
|
167
|
-
console.log(i), m.open({ message: "Failed to clone report", type: "error" });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function x() {
|
|
172
|
-
z.value = !0;
|
|
173
|
-
}
|
|
174
|
-
function V() {
|
|
175
|
-
r.value && (navigator.clipboard.writeText(y.value), m.open({ message: "Copied report ID to clipboard", type: "success" }));
|
|
176
|
-
}
|
|
177
|
-
const Y = c(() => r.value ? r.value.tiles : []), W = c(() => {
|
|
178
|
-
var t;
|
|
179
|
-
let a = [
|
|
180
|
-
(t = r == null ? void 0 : r.value) != null && t.editable ? { label: s("report.common.edit"), value: "edit", isPrimary: !1 } : {
|
|
181
|
-
label: s("report.common.duplicate"),
|
|
182
|
-
value: "duplicate",
|
|
183
|
-
isPrimary: !1
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
label: s("report.common.download"),
|
|
187
|
-
value: "download",
|
|
188
|
-
isPrimary: !0,
|
|
189
|
-
prependIcon: "download"
|
|
190
|
-
},
|
|
191
|
-
{ label: s("report.schedule.sendEmail"), value: "email", isPrimary: !0 }
|
|
192
|
-
];
|
|
193
|
-
return u.value.xs && (a = [
|
|
194
|
-
...a,
|
|
195
|
-
{ label: "Send Email", value: "email", isPrimary: !1 },
|
|
196
|
-
{ label: "Job Delivery Status", value: "report_jobs", isPrimary: !1 },
|
|
197
|
-
{ label: "Email schedule", value: "schedule_email", isPrimary: !1 },
|
|
198
|
-
{ label: "Accounting export", value: "export", isPrimary: !1 },
|
|
199
|
-
{ label: "Copy ID", value: "content_copy", isPrimary: !1 }
|
|
200
|
-
], a = a.filter((i) => i.value !== "edit")), a;
|
|
201
|
-
});
|
|
202
|
-
return (a, t) => {
|
|
203
|
-
const i = ee("FmPageHead");
|
|
204
|
-
return f(), I(ue, null, {
|
|
205
|
-
default: te(() => {
|
|
206
|
-
var p;
|
|
207
|
-
return [
|
|
208
|
-
E(i, {
|
|
209
|
-
title: n(_e)(n(s), n($), (p = n(r)) == null ? void 0 : p.name, "other"),
|
|
210
|
-
"back-button": !0,
|
|
211
|
-
actions: W.value,
|
|
212
|
-
"onClick:back": t[0] || (t[0] = (o) => n(g).push({ name: "reports", query: n(e).query })),
|
|
213
|
-
"onClick:action": t[1] || (t[1] = (o) => {
|
|
214
|
-
o === "duplicate" && U(), o === "download" && (A.value = !0), o === "email" && (T.value = !0), o === "edit" && G(), o === "schedule_email" && (w.value = !0), o === "content_copy" && V(), o === "export" && x(), o === "report_jobs" && h();
|
|
215
|
-
})
|
|
216
|
-
}, null, 8, ["title", "actions"]),
|
|
217
|
-
J("div", {
|
|
218
|
-
class: L(`flex flex-col overflow-y-auto ${n(u).xs || n(u).sm ? "pb-20" : ""}`),
|
|
219
|
-
style: ae({ height: `calc(100% - ${n(u).lg || n(u).md ? 72 : 64}px)` })
|
|
220
|
-
}, [
|
|
221
|
-
J("div", Ie, [
|
|
222
|
-
E(ne, {
|
|
223
|
-
"model-value": n(u).lg || n(u).md ? Q.value : []
|
|
224
|
-
}, null, 8, ["model-value"])
|
|
225
|
-
]),
|
|
226
|
-
n(r) && Y.value.length > 0 ? (f(), N("div", {
|
|
227
|
-
key: 0,
|
|
228
|
-
class: L(["grid grid-cols-12", n(u).sm || n(u).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
|
|
229
|
-
}, [
|
|
230
|
-
(f(!0), N(re, null, oe(Y.value, (o, R) => (f(), I(se, {
|
|
231
|
-
key: `widget_${y.value}_${R}`,
|
|
232
|
-
"model-value": o,
|
|
233
|
-
index: R
|
|
234
|
-
}, null, 8, ["model-value", "index"]))), 128))
|
|
235
|
-
], 2)) : (f(), I(fe, { key: 1 }))
|
|
236
|
-
], 6)
|
|
237
|
-
];
|
|
238
|
-
}),
|
|
239
|
-
_: 1
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
export {
|
|
245
|
-
Pe as default
|
|
246
|
-
};
|