@agile-team/mach-report 2.10.0 → 2.11.1
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/README.md +6 -2
- package/dist/ExcelBindingWizard-LWX6G1A2.js +1465 -0
- package/dist/ExcelBindingWizard-a4kslPHF.cjs +1 -0
- package/dist/ParamEditor-BLaE5q5W.js +522 -0
- package/dist/ParamEditor-MBBC7lUE.cjs +1 -0
- package/dist/ReportBatchPanel-B5ClP9tm.js +350 -0
- package/dist/ReportBatchPanel-Dc-SDkYA.cjs +1 -0
- package/dist/ReportPreview-DWXROHBP.cjs +6 -0
- package/dist/ReportPreview-DiNXhQI0.js +4138 -0
- package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +1 -0
- package/dist/ReportTemplateLibrary-BZB-XWjj.js +311 -0
- package/dist/RuleEditor-C2QsOHOs.cjs +1 -0
- package/dist/RuleEditor-D9wQHrkf.js +2024 -0
- package/dist/TemplateReviewPanel-BKofGrV9.js +222 -0
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +2 -0
- package/dist/analytics.d.ts +2 -0
- package/dist/analytics.js +29 -29
- package/dist/batch-Bt3Fd27Z.cjs +1 -0
- package/dist/batch-mRqhhhjt.js +364 -0
- package/dist/computed-Bvk0W15F.js +521 -0
- package/dist/computed-CGV2a809.cjs +1 -0
- package/dist/config-B612mw0x.js +525 -0
- package/dist/config-BRoLo2oj.cjs +1 -0
- package/dist/designer.cjs +2 -2
- package/dist/designer.d.cts +730 -9
- package/dist/designer.d.ts +730 -9
- package/dist/designer.js +2093 -1785
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +161 -3
- package/dist/index.d.ts +161 -3
- package/dist/index.js +486 -431
- package/dist/injection-keys-Db_DyLkm.cjs +1 -0
- package/dist/injection-keys-e85udZCp.js +7 -0
- package/dist/list-cell-BuYn4tGF.cjs +1 -0
- package/dist/{list-cell-Dxyi7DOw.js → list-cell-ClFra1zS.js} +54 -40
- package/dist/matrix-DVyWiYsd.cjs +1 -0
- package/dist/matrix-yZsGnldA.js +227 -0
- package/dist/param-validation-BlHHXs6u.js +153 -0
- package/dist/param-validation-DCK039V1.cjs +1 -0
- package/dist/pdf.cjs +25 -25
- package/dist/pdf.d.cts +3 -0
- package/dist/pdf.d.ts +3 -0
- package/dist/pdf.js +677 -677
- package/dist/plugin-BDTU4D94.cjs +1 -0
- package/dist/plugin-Cd5G2QQn.js +22 -0
- package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
- package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
- package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
- package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
- package/dist/server/node.d.cts +5 -2
- package/dist/server/node.d.ts +5 -2
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +87 -87
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +201 -2
- package/dist/server.d.ts +201 -2
- package/dist/server.js +557 -658
- package/dist/style.css +1 -1
- package/dist/template-registry-WNXdkiET.js +506 -0
- package/dist/template-registry-ukBGlm8N.cjs +1 -0
- package/dist/template-review-BXp2oyqg.cjs +1 -0
- package/dist/template-review-BdcXSYbx.js +1616 -0
- package/dist/tree-BX380Rr7.cjs +1 -0
- package/dist/tree-CqcQ99NM.js +172 -0
- package/dist/{validate-UUy9yP4K.js → validate-7s0yn6ii.js} +44 -44
- package/dist/validate-DsRiNw8h.cjs +1 -0
- package/dist/vue/async.d.cts +93 -4
- package/dist/vue/async.d.ts +93 -4
- package/dist/vue/index.d.cts +145 -7
- package/dist/vue/index.d.ts +145 -7
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +116 -113
- package/dist/{workbook-session-B-bW5_yR.js → workbook-session-BKOTwcoq.js} +1 -1
- package/dist/{workbook-session-D7RtdNo0.cjs → workbook-session-CLYLhZWu.cjs} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +5 -2
- package/dist/worker.d.ts +5 -2
- package/dist/worker.js +1 -1
- package/dist/xlsx.cjs +3 -3
- package/dist/xlsx.d.cts +129 -2
- package/dist/xlsx.d.ts +129 -2
- package/dist/xlsx.js +336 -242
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-CF7RplWm.cjs +0 -1
- package/dist/ExcelBindingWizard-qhwEderR.js +0 -842
- package/dist/ReportPreview-BE1tCHqE.js +0 -4604
- package/dist/ReportPreview-QKRKQOe3.cjs +0 -6
- package/dist/RuleEditor-BA36yIV6.js +0 -1723
- package/dist/RuleEditor-CczJ6mJm.cjs +0 -1
- package/dist/TemplateReviewPanel-CHi4Alqa.cjs +0 -1
- package/dist/TemplateReviewPanel-Dz0G5o83.js +0 -217
- package/dist/binding-preview-BWsdf_z2.cjs +0 -2
- package/dist/binding-preview-DILq0-0f.js +0 -649
- package/dist/decimal-CI1OAczk.js +0 -87
- package/dist/decimal-CQA0xJex.cjs +0 -1
- package/dist/list-cell-CyM1ZlRN.cjs +0 -1
- package/dist/matrix-BbXarwyk.js +0 -661
- package/dist/matrix-Cm65WLLP.cjs +0 -1
- package/dist/param-validation-BWNjLcN0.js +0 -116
- package/dist/param-validation-CiTxFeZ8.cjs +0 -1
- package/dist/plugin-CThk42vJ.cjs +0 -1
- package/dist/plugin-tGn7-5oF.js +0 -25
- package/dist/template-registry-CGWTLtIA.cjs +0 -1
- package/dist/template-registry-DzlQs3OF.js +0 -434
- package/dist/template-review-D1RoNCPw.cjs +0 -1
- package/dist/template-review-fnteXRng.js +0 -1473
- package/dist/validate-Bf6ccFr2.cjs +0 -1
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import { ref as A, watch as M, computed as x, defineComponent as G, openBlock as d, createElementBlock as u, toDisplayString as v, createCommentVNode as w, createElementVNode as P, Fragment as I, renderList as D, normalizeClass as _, createTextVNode as W, withKeys as q, unref as j, inject as T, provide as K } from "vue";
|
|
2
|
+
import { ReportParamValidationError as z, ReportSourceError as J, validateReportParams as L } from "@agile-team/mach-report";
|
|
3
|
+
import { _ as X } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
4
|
+
import { a as k } from "./injection-keys-e85udZCp.js";
|
|
5
|
+
class h extends Error {
|
|
6
|
+
constructor(r, n, t) {
|
|
7
|
+
super(n), this.name = "MachReportError", this.code = r, this.cause = t;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function Pe(e) {
|
|
11
|
+
return e instanceof h ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
|
|
12
|
+
}
|
|
13
|
+
function we(e) {
|
|
14
|
+
if (e instanceof h) return e;
|
|
15
|
+
if (e instanceof z) return new h("param", e.message, e);
|
|
16
|
+
if (e instanceof J) return new h(e.code, e.message, e.cause);
|
|
17
|
+
if (e instanceof Error) {
|
|
18
|
+
const r = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, n = e.code;
|
|
19
|
+
if (typeof n == "string" && Object.prototype.hasOwnProperty.call(r, n)) return new h(r[n], e.message, e);
|
|
20
|
+
}
|
|
21
|
+
return new h("fetch", e instanceof Error ? e.message : "预览加载失败", e);
|
|
22
|
+
}
|
|
23
|
+
let Q = 0;
|
|
24
|
+
function Y() {
|
|
25
|
+
return `mrp-params-${++Q}`;
|
|
26
|
+
}
|
|
27
|
+
function N(e, r, n) {
|
|
28
|
+
const t = (Array.isArray(r) ? r.find((l) => l?.field === e.field)?.label : void 0) ?? e.field;
|
|
29
|
+
return e.code === "required" ? n.paramRequired.replace("{label}", t) : (n.paramInvalid ?? "{label}:{message}").replace("{label}", t).replace("{message}", e.message);
|
|
30
|
+
}
|
|
31
|
+
function Me(e) {
|
|
32
|
+
const r = A({}), n = A(!1);
|
|
33
|
+
function t() {
|
|
34
|
+
const f = {};
|
|
35
|
+
for (const g of Array.isArray(e.defs.value) ? e.defs.value : [])
|
|
36
|
+
typeof g?.field == "string" && Object.defineProperty(f, g.field, { value: e.params()[g.field] ?? g.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
|
|
37
|
+
r.value = f, n.value = !1;
|
|
38
|
+
}
|
|
39
|
+
t(), M(e.defs, t), M(e.reportIds, t), M(() => JSON.stringify(e.params()), t);
|
|
40
|
+
const l = x(() => L(e.defs.value, { ...e.params(), ...r.value })), o = x(() => !n.value && l.value.issues.length > 0 && l.value.issues.every((f) => f.code === "required"));
|
|
41
|
+
function m() {
|
|
42
|
+
const f = l.value;
|
|
43
|
+
if (!f.ok) {
|
|
44
|
+
const p = f.issues[0];
|
|
45
|
+
return { quiet: o.value, error: new h(p.code === "definition" ? "config" : "param", N(p, e.defs.value, e.messages()), { issues: f.issues }) };
|
|
46
|
+
}
|
|
47
|
+
const g = { ...f.values }, C = new Set(e.defs.value.filter((p) => p.defaultValue !== void 0).map((p) => p.field));
|
|
48
|
+
for (const [p, R] of Object.entries(g)) R === "" && !C.has(p) && delete g[p];
|
|
49
|
+
return { params: g, quiet: !1 };
|
|
50
|
+
}
|
|
51
|
+
return { values: r, attempted: n, validation: l, pendingRequired: o, reset: t, query: m };
|
|
52
|
+
}
|
|
53
|
+
const Z = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "mrp-params-title"
|
|
56
|
+
}, ee = { class: "mrp-params-grid" }, ae = ["id"], te = {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: "mrp-param-star"
|
|
59
|
+
}, re = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], se = ["disabled", "hidden"], ne = ["value"], le = ["aria-labelledby"], oe = ["value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ie = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ce = ["id"], de = {
|
|
60
|
+
key: 1,
|
|
61
|
+
class: "mrp-params-actions"
|
|
62
|
+
}, ue = ["disabled"], pe = ["disabled"], fe = /* @__PURE__ */ G({
|
|
63
|
+
__name: "ReportParamPanel",
|
|
64
|
+
props: {
|
|
65
|
+
defs: {},
|
|
66
|
+
modelValue: {},
|
|
67
|
+
messages: {},
|
|
68
|
+
attempted: { type: Boolean },
|
|
69
|
+
issues: { default: void 0 },
|
|
70
|
+
showActions: { type: Boolean, default: !0 },
|
|
71
|
+
showTitle: { type: Boolean, default: !0 },
|
|
72
|
+
disabled: { type: Boolean, default: !1 }
|
|
73
|
+
},
|
|
74
|
+
emits: ["update:modelValue", "query", "reset"],
|
|
75
|
+
setup(e, { expose: r, emit: n }) {
|
|
76
|
+
const t = e, l = n, o = A({ ...t.modelValue }), m = A(null), f = Y();
|
|
77
|
+
M(
|
|
78
|
+
() => t.modelValue,
|
|
79
|
+
(s) => {
|
|
80
|
+
o.value = { ...s };
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
const g = x(() => t.issues ?? L(t.defs, o.value).issues), C = x(
|
|
84
|
+
() => (Array.isArray(t.defs) ? t.defs : []).filter((s) => s && typeof s.field == "string").map((s, i) => ({
|
|
85
|
+
def: s,
|
|
86
|
+
id: `${f}-${i}`,
|
|
87
|
+
label: s.label ?? s.field,
|
|
88
|
+
value: o.value[s.field] ?? "",
|
|
89
|
+
error: t.attempted ? g.value.find((a) => a.field === s.field) : void 0
|
|
90
|
+
}))
|
|
91
|
+
);
|
|
92
|
+
function p(s, i) {
|
|
93
|
+
o.value = { ...o.value, [s]: i }, l("update:modelValue", { ...o.value });
|
|
94
|
+
}
|
|
95
|
+
function R(s) {
|
|
96
|
+
return s.type === "number" ? "number" : s.type === "date" || s.type === "month" ? s.type : "text";
|
|
97
|
+
}
|
|
98
|
+
function y(s, i) {
|
|
99
|
+
return s.split("/")[i] ?? "";
|
|
100
|
+
}
|
|
101
|
+
function O(s, i, a) {
|
|
102
|
+
return a ? !!y(s, 0) != !!y(s, 1) ? !y(s, i) || void 0 : !0 : void 0;
|
|
103
|
+
}
|
|
104
|
+
function U(s, i, a) {
|
|
105
|
+
const c = [y(o.value[s] ?? "", 0), y(o.value[s] ?? "", 1)];
|
|
106
|
+
c[i] = a, p(s, c.every((E) => !E) ? "" : c.join("/"));
|
|
107
|
+
}
|
|
108
|
+
function F(s) {
|
|
109
|
+
s.isComposing || l("query");
|
|
110
|
+
}
|
|
111
|
+
function $() {
|
|
112
|
+
m.value?.querySelector('[aria-invalid="true"]')?.focus();
|
|
113
|
+
}
|
|
114
|
+
return r({ focusInvalid: $ }), (s, i) => (d(), u("div", {
|
|
115
|
+
ref_key: "root",
|
|
116
|
+
ref: m,
|
|
117
|
+
class: "mrp-params"
|
|
118
|
+
}, [
|
|
119
|
+
e.showTitle !== !1 ? (d(), u("span", Z, v(e.messages.paramsTitle), 1)) : w("", !0),
|
|
120
|
+
P("div", ee, [
|
|
121
|
+
(d(!0), u(I, null, D(C.value, (a) => (d(), u("label", {
|
|
122
|
+
key: a.id,
|
|
123
|
+
class: _(["mrp-param", { "mrp-param-missing": !!a.error }])
|
|
124
|
+
}, [
|
|
125
|
+
P("span", {
|
|
126
|
+
id: `${a.id}-label`,
|
|
127
|
+
class: "mrp-param-label"
|
|
128
|
+
}, [
|
|
129
|
+
W(v(a.label), 1),
|
|
130
|
+
a.def.required ? (d(), u("i", te, "*")) : w("", !0)
|
|
131
|
+
], 8, ae),
|
|
132
|
+
(a.def.type ?? "text") === "select" ? (d(), u("select", {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: "mrp-param-input",
|
|
135
|
+
value: a.value,
|
|
136
|
+
disabled: e.disabled,
|
|
137
|
+
"aria-labelledby": `${a.id}-label`,
|
|
138
|
+
"aria-invalid": a.error ? !0 : void 0,
|
|
139
|
+
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
140
|
+
"aria-required": a.def.required || void 0,
|
|
141
|
+
onChange: (c) => p(a.def.field, c.target.value),
|
|
142
|
+
onKeydown: q(F, ["enter"])
|
|
143
|
+
}, [
|
|
144
|
+
P("option", {
|
|
145
|
+
value: "",
|
|
146
|
+
disabled: a.def.required,
|
|
147
|
+
hidden: a.def.required
|
|
148
|
+
}, v(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, se),
|
|
149
|
+
(d(!0), u(I, null, D(a.def.options ?? [], (c) => (d(), u("option", {
|
|
150
|
+
key: c.value,
|
|
151
|
+
value: c.value
|
|
152
|
+
}, v(c.label), 9, ne))), 128))
|
|
153
|
+
], 40, re)) : a.def.type === "dateRange" ? (d(), u("div", {
|
|
154
|
+
key: 1,
|
|
155
|
+
class: "mrp-param-range",
|
|
156
|
+
role: "group",
|
|
157
|
+
"aria-labelledby": `${a.id}-label`
|
|
158
|
+
}, [
|
|
159
|
+
(d(!0), u(I, null, D([e.messages.paramRangeStart ?? "开始日期", e.messages.paramRangeEnd ?? "结束日期"], (c, E) => (d(), u("input", {
|
|
160
|
+
key: E,
|
|
161
|
+
class: "mrp-param-input",
|
|
162
|
+
type: "date",
|
|
163
|
+
value: y(a.value, E),
|
|
164
|
+
disabled: e.disabled,
|
|
165
|
+
min: a.def.min,
|
|
166
|
+
max: a.def.max,
|
|
167
|
+
"aria-label": `${a.label} · ${c}`,
|
|
168
|
+
"aria-invalid": O(a.value, E, a.error),
|
|
169
|
+
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
170
|
+
"aria-required": a.def.required || void 0,
|
|
171
|
+
onInput: (V) => U(a.def.field, E, V.target.value),
|
|
172
|
+
onKeydown: q(F, ["enter"])
|
|
173
|
+
}, null, 40, oe))), 128))
|
|
174
|
+
], 8, le)) : (d(), u("input", {
|
|
175
|
+
key: 2,
|
|
176
|
+
class: "mrp-param-input",
|
|
177
|
+
type: R(a.def),
|
|
178
|
+
inputmode: a.def.type === "year" ? "numeric" : void 0,
|
|
179
|
+
maxlength: a.def.type === "year" ? 4 : void 0,
|
|
180
|
+
placeholder: a.def.placeholder ?? (e.messages.paramTextPlaceholder ?? "请输入{label}").replace("{label}", a.label),
|
|
181
|
+
value: a.value,
|
|
182
|
+
disabled: e.disabled,
|
|
183
|
+
min: a.def.min,
|
|
184
|
+
max: a.def.max,
|
|
185
|
+
step: a.def.type === "number" ? "any" : void 0,
|
|
186
|
+
"aria-labelledby": `${a.id}-label`,
|
|
187
|
+
"aria-invalid": a.error ? !0 : void 0,
|
|
188
|
+
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
189
|
+
"aria-required": a.def.required || void 0,
|
|
190
|
+
onInput: (c) => p(a.def.field, c.target.value),
|
|
191
|
+
onKeydown: q(F, ["enter"])
|
|
192
|
+
}, null, 40, ie)),
|
|
193
|
+
a.error ? (d(), u("small", {
|
|
194
|
+
key: 3,
|
|
195
|
+
id: `${a.id}-error`,
|
|
196
|
+
class: "mrp-param-error",
|
|
197
|
+
role: "status"
|
|
198
|
+
}, v(j(N)(a.error, e.defs, e.messages)), 9, ce)) : w("", !0)
|
|
199
|
+
], 2))), 128))
|
|
200
|
+
]),
|
|
201
|
+
e.showActions !== !1 ? (d(), u("div", de, [
|
|
202
|
+
P("button", {
|
|
203
|
+
class: "mrp-nav mrp-param-query",
|
|
204
|
+
type: "button",
|
|
205
|
+
disabled: e.disabled,
|
|
206
|
+
onClick: i[0] || (i[0] = (a) => s.$emit("query"))
|
|
207
|
+
}, v(e.messages.query), 9, ue),
|
|
208
|
+
P("button", {
|
|
209
|
+
class: "mrp-nav",
|
|
210
|
+
type: "button",
|
|
211
|
+
disabled: e.disabled,
|
|
212
|
+
onClick: i[1] || (i[1] = (a) => s.$emit("reset"))
|
|
213
|
+
}, v(e.messages.reset), 9, pe)
|
|
214
|
+
])) : w("", !0)
|
|
215
|
+
], 512));
|
|
216
|
+
}
|
|
217
|
+
}), Se = /* @__PURE__ */ X(fe, [["__scopeId", "data-v-f64e743f"]]), H = {
|
|
218
|
+
calculationTitle: "选区计算",
|
|
219
|
+
calculationLocal: "仅本地分析,不写回实绩、不重算原公式。请选取同一单位与量纲的数值。",
|
|
220
|
+
calculationHint: "点击起点,Shift + 点击终点或方向键扩选。",
|
|
221
|
+
calculationFormula: "计算方式",
|
|
222
|
+
calculationExpression: "组合公式",
|
|
223
|
+
calculationExpressionHint: "支持 SUM、AVERAGE/AVG、MIN、MAX、COUNT、MEDIAN 及 + - * / 和括号,不执行 Excel 公式;采用浮点数,精度仅用于展示。",
|
|
224
|
+
calculationPrecision: "展示小数位",
|
|
225
|
+
calculationRun: "计算选区",
|
|
226
|
+
calculationCancel: "取消计算",
|
|
227
|
+
calculationResult: "计算结果",
|
|
228
|
+
calculationIncluded: "参与数值",
|
|
229
|
+
calculationExcluded: "排除单元格",
|
|
230
|
+
calculationEmpty: "选区没有可计算数值,计数为 0,其余结果为空。",
|
|
231
|
+
calculationNoSelection: "先关闭设置并选择数据,再从底部工具栏打开选区计算。",
|
|
232
|
+
calculationSum: "求和 SUM",
|
|
233
|
+
calculationAverage: "平均值 AVERAGE",
|
|
234
|
+
calculationMin: "最小值 MIN",
|
|
235
|
+
calculationMax: "最大值 MAX",
|
|
236
|
+
calculationCount: "数值计数 COUNT",
|
|
237
|
+
calculationMedian: "中位数 MEDIAN",
|
|
238
|
+
calculationCustom: "组合公式",
|
|
239
|
+
calculationErrorSelection: "请选择同一明细区域中的数据。",
|
|
240
|
+
calculationErrorLimit: "选区超过计算预算,请缩小范围后重试。",
|
|
241
|
+
calculationErrorExpression: "公式无效,请使用支持的摘要名称、运算符与括号。",
|
|
242
|
+
calculationErrorDivision: "除数不能为 0。",
|
|
243
|
+
calculationErrorOverflow: "结果超出有效数值范围。",
|
|
244
|
+
calculationErrorPrecision: "数值超出安全精度,或展示小数位不是 0 至 12 的整数。"
|
|
245
|
+
};
|
|
246
|
+
function Ae(e) {
|
|
247
|
+
const r = { ...H };
|
|
248
|
+
for (const n of Object.keys(r)) {
|
|
249
|
+
const t = e[n];
|
|
250
|
+
typeof t == "string" && (r[n] = t);
|
|
251
|
+
}
|
|
252
|
+
return r;
|
|
253
|
+
}
|
|
254
|
+
const ge = {
|
|
255
|
+
...H,
|
|
256
|
+
exportMenu: "导出",
|
|
257
|
+
exportMenuDescription: "选择文件格式",
|
|
258
|
+
clearSearch: "清除搜索",
|
|
259
|
+
searchHint: "Enter 下一个 · Shift+Enter 上一个",
|
|
260
|
+
searchNoMatches: "没有匹配内容",
|
|
261
|
+
pageJump: "跳至页",
|
|
262
|
+
pageJumpInvalid: "请输入有效页码",
|
|
263
|
+
pageJumpHint: "Enter 跳转",
|
|
264
|
+
pagination: "报表分页",
|
|
265
|
+
columnSearchHint: "输入列名或字段标识",
|
|
266
|
+
columnSearchShortcut: "↑ ↓ 选择 · Enter 定位",
|
|
267
|
+
closeColumnDirectory: "关闭字段目录",
|
|
268
|
+
columnResultsMore: "{count} 个匹配字段,显示前 {limit} 个;继续输入可缩小范围",
|
|
269
|
+
columnCount: "{count} 个字段",
|
|
270
|
+
settingsGeneral: "常规",
|
|
271
|
+
settingsTools: "工具",
|
|
272
|
+
settingsAdvanced: "高级",
|
|
273
|
+
settingsAdvancedDescription: "按需开启分析能力,保持日常阅读简洁。",
|
|
274
|
+
settingsCalculations: "启用选区计算",
|
|
275
|
+
settingsCalculationsDescription: "选取数值后计算求和、平均值或组合公式,仅用于本地分析。",
|
|
276
|
+
title: "报表预览",
|
|
277
|
+
prevPage: "‹ 上一页",
|
|
278
|
+
nextPage: "下一页 ›",
|
|
279
|
+
pageInfo: "{cur} / {total}",
|
|
280
|
+
fitWidth: "适宽",
|
|
281
|
+
exportHtml: "导出 HTML",
|
|
282
|
+
exportPdf: "导出 PDF",
|
|
283
|
+
exportExcel: "导出 Excel",
|
|
284
|
+
exportImage: "导出图片",
|
|
285
|
+
exportWord: "导出 Word",
|
|
286
|
+
exporting: "正在生成 {format}…",
|
|
287
|
+
print: "打印",
|
|
288
|
+
pdfWindow: "PDF 窗口",
|
|
289
|
+
loading: "报表渲染中…",
|
|
290
|
+
empty: "暂无预览数据",
|
|
291
|
+
errorPrefix: "",
|
|
292
|
+
retry: "重试",
|
|
293
|
+
pdfFontUnavailable: "PDF 字体尚未就绪,请联系管理员检查字体配置;预览及其它导出仍可使用。",
|
|
294
|
+
searchPlaceholder: "搜索报表内容",
|
|
295
|
+
matchInfo: "{cur}/{total}",
|
|
296
|
+
prevMatch: "‹",
|
|
297
|
+
nextMatch: "›",
|
|
298
|
+
thumbnails: "缩略图",
|
|
299
|
+
paramsTitle: "查询条件",
|
|
300
|
+
query: "查 询",
|
|
301
|
+
reset: "重 置",
|
|
302
|
+
paramRequired: "请填写{label}",
|
|
303
|
+
paramInvalid: "{label}:{message}",
|
|
304
|
+
paramPrompt: "请先完善查询条件",
|
|
305
|
+
paramPromptDescription: "填写必填条件后点击查询,即可生成报表。",
|
|
306
|
+
paramSelectPlaceholder: "请选择{label}",
|
|
307
|
+
paramTextPlaceholder: "请输入{label}",
|
|
308
|
+
paramRangeStart: "开始日期",
|
|
309
|
+
paramRangeEnd: "结束日期",
|
|
310
|
+
searching: "搜索中…",
|
|
311
|
+
importExcel: "导入 Excel 模板",
|
|
312
|
+
importing: "正在导入 Excel…",
|
|
313
|
+
editCell: "编辑单元格",
|
|
314
|
+
editingHint: "双击单元格编辑 · Enter 确认 · Esc 取消",
|
|
315
|
+
saving: "正在保存修改…",
|
|
316
|
+
editInvalidNumber: "请输入有效数字;清空表示无值",
|
|
317
|
+
editInvalidBoolean: "请输入 true / false、是 / 否或 1 / 0",
|
|
318
|
+
editConflict: "该单元格已变化,请重新打开编辑",
|
|
319
|
+
settings: "设置",
|
|
320
|
+
settingsDisplay: "阅读工具",
|
|
321
|
+
settingsExport: "导出与打印",
|
|
322
|
+
settingsData: "数据操作",
|
|
323
|
+
settingsUnavailable: "需由接入方配置启用",
|
|
324
|
+
settingsReset: "恢复默认",
|
|
325
|
+
settingsClose: "关闭设置",
|
|
326
|
+
search: "内容搜索",
|
|
327
|
+
closeSearch: "关闭搜索",
|
|
328
|
+
prevSearchMatch: "上一个匹配",
|
|
329
|
+
nextSearchMatch: "下一个匹配",
|
|
330
|
+
zoom: "缩放工具",
|
|
331
|
+
settingsLocal: "按需启用工具,仅作用于当前预览。",
|
|
332
|
+
editingLocal: "修改为本地草稿;不会自动写入业务数据库。",
|
|
333
|
+
editingSaved: "修改将通过接入方配置的保存回调提交。",
|
|
334
|
+
importLocal: "导入仅生成本地预览,不自动替换业务数据。",
|
|
335
|
+
emptyDescription: "当前查询没有明细,请调整查询条件后重试。",
|
|
336
|
+
undo: "撤销",
|
|
337
|
+
redo: "重做",
|
|
338
|
+
restoreChanges: "恢复来源值",
|
|
339
|
+
changes: "修改明细",
|
|
340
|
+
changesCount: "{count} 处修改",
|
|
341
|
+
changesEmpty: "尚无修改",
|
|
342
|
+
changesBefore: "来源值",
|
|
343
|
+
changesAfter: "当前值",
|
|
344
|
+
editAtomicRequired: "批量保存需要接入方提供原子 saveBatch 回调;本次未写入任何单元格。",
|
|
345
|
+
clipboardLimit: "单次最多粘贴 10000 个单元格,请分批处理。",
|
|
346
|
+
preferencesError: "偏好存储不可用,设置仍在当前预览中生效。",
|
|
347
|
+
freezeHeaders: "冻结表头",
|
|
348
|
+
frozenColumns: "冻结前列",
|
|
349
|
+
sections: "工作表与章节",
|
|
350
|
+
locateField: "定位字段",
|
|
351
|
+
locateFieldPlaceholder: "输入字段标识,Enter 定位",
|
|
352
|
+
locateFieldMissing: "未找到该字段,请核对字段标识。",
|
|
353
|
+
importSummary: "Excel 导入摘要",
|
|
354
|
+
importPreserved: "已导入 {sheets} 个工作表,保留内容、合并和样式。",
|
|
355
|
+
importWarnings: "兼容性提示",
|
|
356
|
+
importReadOnly: "公式、日期及受保护单元格保持只读;公式不重算。",
|
|
357
|
+
conflicts: "保存冲突",
|
|
358
|
+
editReadOnly: "选区包含只读或无权限单元格,本次修改未应用。",
|
|
359
|
+
editMissing: "选区超出报表范围或缺少业务来源,请重新选择。",
|
|
360
|
+
editRecalculationUnavailable: "此报表缺少重算会话或稳定数据来源,暂不支持编辑;请使用 reports/本地数据源重新加载。",
|
|
361
|
+
editDuplicate: "选区包含同一业务字段的重复单元格,请缩小选区。",
|
|
362
|
+
clipboardInvalid: "剪贴板内容无法识别,请使用矩形表格文本重新粘贴。",
|
|
363
|
+
editSaved: "修改已通过保存回调确认",
|
|
364
|
+
settingsPanes: "冻结窗格",
|
|
365
|
+
columnDirectory: "字段目录",
|
|
366
|
+
columnSearch: "搜索列名或字段",
|
|
367
|
+
columnNoMatches: "未找到匹配字段",
|
|
368
|
+
columnResults: "匹配字段",
|
|
369
|
+
columnGroup: "明细区域",
|
|
370
|
+
discardTitle: "保留当前修改?",
|
|
371
|
+
discardDescription: "当前报表有尚未保存的输入或本地草稿,继续操作将替换这些内容。",
|
|
372
|
+
discardKeep: "继续编辑",
|
|
373
|
+
discardProceed: "放弃修改并继续",
|
|
374
|
+
taskQuery: "正在获取数据…",
|
|
375
|
+
taskValidate: "正在校验数据…",
|
|
376
|
+
taskLayout: "正在生成版式…",
|
|
377
|
+
taskAssets: "正在准备图片和字体…",
|
|
378
|
+
taskEncode: "正在生成文件…",
|
|
379
|
+
taskDownload: "正在准备下载…",
|
|
380
|
+
taskPrint: "正在准备打印…",
|
|
381
|
+
taskCancel: "取消任务",
|
|
382
|
+
taskCancelled: "任务已取消,可重新操作。",
|
|
383
|
+
diagnosticsSearch: "搜索提示、错误码或位置",
|
|
384
|
+
diagnosticsMore: "共 {count} 条匹配,当前展示前 100 条;请搜索缩小范围。",
|
|
385
|
+
diagnosticsTitle: "输出兼容性提示",
|
|
386
|
+
diagnosticsLocate: "定位",
|
|
387
|
+
diagnosticsLocation: "第 {page} 页 · 组件 {component}",
|
|
388
|
+
diagnosticsStrict: "当前格式存在已知内容降级,请查看兼容性提示或选择其他输出格式。",
|
|
389
|
+
diagnosticsDetails: "查看技术详情",
|
|
390
|
+
diagnosticMissingImage: "图片或图表资源尚未准备完成,请重试或联系管理员。",
|
|
391
|
+
diagnosticUnsupported: "当前输出格式会省略此内容,建议选择 PDF 或图片格式。",
|
|
392
|
+
diagnosticUnsupportedStyle: "当前格式无法保留部分样式,请查看位置并选择适合的输出格式。",
|
|
393
|
+
diagnosticImageFormat: "当前图片格式无法直接导出,请转换资源后重试。",
|
|
394
|
+
diagnosticRichText: "文字内容会保留,部分字体与段落样式将简化。",
|
|
395
|
+
diagnosticNested: "单元格中的嵌套内容会省略,单元格文字会保留。",
|
|
396
|
+
diagnosticImageAsync: "图片需要完成加载后才能输出。",
|
|
397
|
+
diagnosticImageDecode: "图片加载失败,请检查资源后重试。",
|
|
398
|
+
diagnosticAssetFailed: "图表或图片生成失败,请重试或联系管理员。",
|
|
399
|
+
diagnosticAssetBudget: "图片资源超出处理范围,请减少资源或缩小报表范围。"
|
|
400
|
+
}, me = {
|
|
401
|
+
emptyAccent: "#79a7e8",
|
|
402
|
+
shellBg: "#f4f7fc",
|
|
403
|
+
shellFg: "#334155",
|
|
404
|
+
toolbarBg: "#ffffff",
|
|
405
|
+
toolbarBorder: "#e4eaf3",
|
|
406
|
+
toolbarFg: "#334155",
|
|
407
|
+
btnFg: "#526078",
|
|
408
|
+
btnBorder: "#dbe3ef",
|
|
409
|
+
btnHoverBg: "#edf3ff",
|
|
410
|
+
btnHoverFg: "#315fba",
|
|
411
|
+
btnActiveBg: "#3569d4"
|
|
412
|
+
};
|
|
413
|
+
function be(e = {}) {
|
|
414
|
+
return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
|
|
415
|
+
}
|
|
416
|
+
function Ce(e) {
|
|
417
|
+
return e;
|
|
418
|
+
}
|
|
419
|
+
const b = {
|
|
420
|
+
showExport: !0,
|
|
421
|
+
showPrint: !0,
|
|
422
|
+
showPdfWindow: !0,
|
|
423
|
+
showSettings: !0,
|
|
424
|
+
showParams: !0,
|
|
425
|
+
gapPx: 18,
|
|
426
|
+
pdfFontUrl: "/simhei.ttf",
|
|
427
|
+
logger: console
|
|
428
|
+
}, Re = { warn: () => {
|
|
429
|
+
}, info: () => {
|
|
430
|
+
} };
|
|
431
|
+
function S(e, r) {
|
|
432
|
+
return {
|
|
433
|
+
...e,
|
|
434
|
+
...r,
|
|
435
|
+
theme: { ...e?.theme, ...r?.theme },
|
|
436
|
+
messages: { ...e?.messages, ...r?.messages },
|
|
437
|
+
preview: { ...e?.preview, ...r?.preview },
|
|
438
|
+
xlsx: { ...e?.xlsx, ...r?.xlsx },
|
|
439
|
+
toolbar: { ...e?.toolbar, ...r?.toolbar },
|
|
440
|
+
interaction: { ...e?.interaction, ...r?.interaction },
|
|
441
|
+
output: { ...e?.output, ...r?.output }
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
function ve(e) {
|
|
445
|
+
return {
|
|
446
|
+
showExport: e.showExport ?? b.showExport,
|
|
447
|
+
showPrint: e.showPrint ?? b.showPrint,
|
|
448
|
+
showPdfWindow: e.showPdfWindow ?? b.showPdfWindow,
|
|
449
|
+
showSettings: e.showSettings ?? b.showSettings,
|
|
450
|
+
showParams: e.showParams ?? b.showParams,
|
|
451
|
+
gapPx: e.gapPx ?? b.gapPx
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
function Fe(e, r) {
|
|
455
|
+
const n = r ? e?.presets?.[r] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, t = S(e?.defaults, n);
|
|
456
|
+
return {
|
|
457
|
+
...ve(t),
|
|
458
|
+
pdfFontUrl: t.pdfFontUrl ?? b.pdfFontUrl,
|
|
459
|
+
theme: { ...me, ...t.theme },
|
|
460
|
+
messages: { ...ge, ...t.messages },
|
|
461
|
+
logger: t.logger ?? b.logger,
|
|
462
|
+
preview: {
|
|
463
|
+
overscanPages: B(t.preview?.overscanPages, 1, 10, !0),
|
|
464
|
+
searchDebounceMs: B(t.preview?.searchDebounceMs, 200, 2e3)
|
|
465
|
+
},
|
|
466
|
+
xlsx: { ...t.xlsx },
|
|
467
|
+
editable: t.editable ?? !1,
|
|
468
|
+
excelImport: t.excelImport ?? !1,
|
|
469
|
+
toolbar: { ...t.toolbar },
|
|
470
|
+
interaction: { ...t.interaction },
|
|
471
|
+
preferences: t.preferences,
|
|
472
|
+
assets: t.assets,
|
|
473
|
+
guardChanges: t.guardChanges ?? !0,
|
|
474
|
+
beforeDiscard: t.beforeDiscard,
|
|
475
|
+
output: { ...t.output }
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
function B(e, r, n, t = !1) {
|
|
479
|
+
if (e == null || !Number.isFinite(e)) return r;
|
|
480
|
+
const l = Math.max(0, Math.min(n, e));
|
|
481
|
+
return t ? Math.floor(l) : l;
|
|
482
|
+
}
|
|
483
|
+
function Ie(e) {
|
|
484
|
+
const r = {};
|
|
485
|
+
return e.emptyAccent != null && (r["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (r["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (r["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (r["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (r["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (r["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (r["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (r["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (r["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (r["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (r["--mrp-btn-active-bg"] = e.btnActiveBg), r;
|
|
486
|
+
}
|
|
487
|
+
function De(e) {
|
|
488
|
+
const r = T(k, null), n = x(() => {
|
|
489
|
+
const t = r?.value ?? null, l = "defaults" in e || "presets" in e || "defaultPreset" in e ? be(e) : { defaults: e, presets: {} };
|
|
490
|
+
if (!t) return l;
|
|
491
|
+
const o = { ...t.presets, ...l.presets };
|
|
492
|
+
for (const m of Object.keys(o))
|
|
493
|
+
o[m] = S(
|
|
494
|
+
S(t.presets[m], l.defaults),
|
|
495
|
+
l.presets[m]
|
|
496
|
+
);
|
|
497
|
+
return {
|
|
498
|
+
defaults: S(t.defaults, l.defaults),
|
|
499
|
+
presets: o,
|
|
500
|
+
defaultPreset: l.defaultPreset ?? t.defaultPreset
|
|
501
|
+
};
|
|
502
|
+
});
|
|
503
|
+
K(k, n);
|
|
504
|
+
}
|
|
505
|
+
function qe() {
|
|
506
|
+
return T(k, x(() => null));
|
|
507
|
+
}
|
|
508
|
+
export {
|
|
509
|
+
H as D,
|
|
510
|
+
h as M,
|
|
511
|
+
Se as R,
|
|
512
|
+
Re as S,
|
|
513
|
+
ge as a,
|
|
514
|
+
me as b,
|
|
515
|
+
Ce as c,
|
|
516
|
+
be as d,
|
|
517
|
+
Fe as e,
|
|
518
|
+
Pe as f,
|
|
519
|
+
Me as g,
|
|
520
|
+
we as n,
|
|
521
|
+
De as p,
|
|
522
|
+
Ae as r,
|
|
523
|
+
Ie as t,
|
|
524
|
+
qe as u
|
|
525
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),y=require("@agile-team/mach-report"),T=require("./_plugin-vue_export-helper-BLmdZLlg.cjs"),C=require("./injection-keys-Db_DyLkm.cjs");class b extends Error{constructor(n,l,r){super(l),this.name="MachReportError",this.code=n,this.cause=r}}function L(e){return e instanceof b?{code:e.code,cause:e.cause}:{code:"render",cause:e}}function N(e){if(e instanceof b)return e;if(e instanceof y.ReportParamValidationError)return new b("param",e.message,e);if(e instanceof y.ReportSourceError)return new b(e.code,e.message,e.cause);if(e instanceof Error){const n={params:"param",config:"config",validate:"validate",fetch:"fetch"},l=e.code;if(typeof l=="string"&&Object.prototype.hasOwnProperty.call(n,l))return new b(n[l],e.message,e)}return new b("fetch",e instanceof Error?e.message:"预览加载失败",e)}let V=0;function O(){return`mrp-params-${++V}`}function S(e,n,l){const r=(Array.isArray(n)?n.find(s=>s?.field===e.field)?.label:void 0)??e.field;return e.code==="required"?l.paramRequired.replace("{label}",r):(l.paramInvalid??"{label}:{message}").replace("{label}",r).replace("{message}",e.message)}function _(e){const n=a.ref({}),l=a.ref(!1);function r(){const p={};for(const f of Array.isArray(e.defs.value)?e.defs.value:[])typeof f?.field=="string"&&Object.defineProperty(p,f.field,{value:e.params()[f.field]??f.defaultValue??"",writable:!0,enumerable:!0,configurable:!0});n.value=p,l.value=!1}r(),a.watch(e.defs,r),a.watch(e.reportIds,r),a.watch(()=>JSON.stringify(e.params()),r);const s=a.computed(()=>y.validateReportParams(e.defs.value,{...e.params(),...n.value})),i=a.computed(()=>!l.value&&s.value.issues.length>0&&s.value.issues.every(p=>p.code==="required"));function g(){const p=s.value;if(!p.ok){const u=p.issues[0];return{quiet:i.value,error:new b(u.code==="definition"?"config":"param",S(u,e.defs.value,e.messages()),{issues:p.issues})}}const f={...p.values},P=new Set(e.defs.value.filter(u=>u.defaultValue!==void 0).map(u=>u.field));for(const[u,x]of Object.entries(f))x===""&&!P.has(u)&&delete f[u];return{params:f,quiet:!1}}return{values:n,attempted:l,validation:s,pendingRequired:i,reset:r,query:g}}const H={key:0,class:"mrp-params-title"},U={class:"mrp-params-grid"},G=["id"],$={key:0,class:"mrp-param-star"},K=["value","disabled","aria-labelledby","aria-invalid","aria-describedby","aria-required","onChange"],j=["disabled","hidden"],W=["value"],z=["aria-labelledby"],J=["value","disabled","min","max","aria-label","aria-invalid","aria-describedby","aria-required","onInput"],Y=["type","inputmode","maxlength","placeholder","value","disabled","min","max","step","aria-labelledby","aria-invalid","aria-describedby","aria-required","onInput"],X=["id"],Q={key:1,class:"mrp-params-actions"},Z=["disabled"],ee=["disabled"],ae=a.defineComponent({__name:"ReportParamPanel",props:{defs:{},modelValue:{},messages:{},attempted:{type:Boolean},issues:{default:void 0},showActions:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","query","reset"],setup(e,{expose:n,emit:l}){const r=e,s=l,i=a.ref({...r.modelValue}),g=a.ref(null),p=O();a.watch(()=>r.modelValue,o=>{i.value={...o}});const f=a.computed(()=>r.issues??y.validateReportParams(r.defs,i.value).issues),P=a.computed(()=>(Array.isArray(r.defs)?r.defs:[]).filter(o=>o&&typeof o.field=="string").map((o,c)=>({def:o,id:`${p}-${c}`,label:o.label??o.field,value:i.value[o.field]??"",error:r.attempted?f.value.find(t=>t.field===o.field):void 0})));function u(o,c){i.value={...i.value,[o]:c},s("update:modelValue",{...i.value})}function x(o){return o.type==="number"?"number":o.type==="date"||o.type==="month"?o.type:"text"}function v(o,c){return o.split("/")[c]??""}function F(o,c,t){return t?!!v(o,0)!=!!v(o,1)?!v(o,c)||void 0:!0:void 0}function D(o,c,t){const d=[v(i.value[o]??"",0),v(i.value[o]??"",1)];d[c]=t,u(o,d.every(h=>!h)?"":d.join("/"))}function w(o){o.isComposing||s("query")}function I(){g.value?.querySelector('[aria-invalid="true"]')?.focus()}return n({focusInvalid:I}),(o,c)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"root",ref:g,class:"mrp-params"},[e.showTitle!==!1?(a.openBlock(),a.createElementBlock("span",H,a.toDisplayString(e.messages.paramsTitle),1)):a.createCommentVNode("",!0),a.createElementVNode("div",U,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(P.value,t=>(a.openBlock(),a.createElementBlock("label",{key:t.id,class:a.normalizeClass(["mrp-param",{"mrp-param-missing":!!t.error}])},[a.createElementVNode("span",{id:`${t.id}-label`,class:"mrp-param-label"},[a.createTextVNode(a.toDisplayString(t.label),1),t.def.required?(a.openBlock(),a.createElementBlock("i",$,"*")):a.createCommentVNode("",!0)],8,G),(t.def.type??"text")==="select"?(a.openBlock(),a.createElementBlock("select",{key:0,class:"mrp-param-input",value:t.value,disabled:e.disabled,"aria-labelledby":`${t.id}-label`,"aria-invalid":t.error?!0:void 0,"aria-describedby":t.error?`${t.id}-error`:void 0,"aria-required":t.def.required||void 0,onChange:d=>u(t.def.field,d.target.value),onKeydown:a.withKeys(w,["enter"])},[a.createElementVNode("option",{value:"",disabled:t.def.required,hidden:t.def.required},a.toDisplayString(t.def.placeholder??(e.messages.paramSelectPlaceholder??"请选择{label}").replace("{label}",t.label)),9,j),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.def.options??[],d=>(a.openBlock(),a.createElementBlock("option",{key:d.value,value:d.value},a.toDisplayString(d.label),9,W))),128))],40,K)):t.def.type==="dateRange"?(a.openBlock(),a.createElementBlock("div",{key:1,class:"mrp-param-range",role:"group","aria-labelledby":`${t.id}-label`},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList([e.messages.paramRangeStart??"开始日期",e.messages.paramRangeEnd??"结束日期"],(d,h)=>(a.openBlock(),a.createElementBlock("input",{key:h,class:"mrp-param-input",type:"date",value:v(t.value,h),disabled:e.disabled,min:t.def.min,max:t.def.max,"aria-label":`${t.label} · ${d}`,"aria-invalid":F(t.value,h,t.error),"aria-describedby":t.error?`${t.id}-error`:void 0,"aria-required":t.def.required||void 0,onInput:q=>D(t.def.field,h,q.target.value),onKeydown:a.withKeys(w,["enter"])},null,40,J))),128))],8,z)):(a.openBlock(),a.createElementBlock("input",{key:2,class:"mrp-param-input",type:x(t.def),inputmode:t.def.type==="year"?"numeric":void 0,maxlength:t.def.type==="year"?4:void 0,placeholder:t.def.placeholder??(e.messages.paramTextPlaceholder??"请输入{label}").replace("{label}",t.label),value:t.value,disabled:e.disabled,min:t.def.min,max:t.def.max,step:t.def.type==="number"?"any":void 0,"aria-labelledby":`${t.id}-label`,"aria-invalid":t.error?!0:void 0,"aria-describedby":t.error?`${t.id}-error`:void 0,"aria-required":t.def.required||void 0,onInput:d=>u(t.def.field,d.target.value),onKeydown:a.withKeys(w,["enter"])},null,40,Y)),t.error?(a.openBlock(),a.createElementBlock("small",{key:3,id:`${t.id}-error`,class:"mrp-param-error",role:"status"},a.toDisplayString(a.unref(S)(t.error,e.defs,e.messages)),9,X)):a.createCommentVNode("",!0)],2))),128))]),e.showActions!==!1?(a.openBlock(),a.createElementBlock("div",Q,[a.createElementVNode("button",{class:"mrp-nav mrp-param-query",type:"button",disabled:e.disabled,onClick:c[0]||(c[0]=t=>o.$emit("query"))},a.toDisplayString(e.messages.query),9,Z),a.createElementVNode("button",{class:"mrp-nav",type:"button",disabled:e.disabled,onClick:c[1]||(c[1]=t=>o.$emit("reset"))},a.toDisplayString(e.messages.reset),9,ee)])):a.createCommentVNode("",!0)],512))}}),te=T._export_sfc(ae,[["__scopeId","data-v-f64e743f"]]),k={calculationTitle:"选区计算",calculationLocal:"仅本地分析,不写回实绩、不重算原公式。请选取同一单位与量纲的数值。",calculationHint:"点击起点,Shift + 点击终点或方向键扩选。",calculationFormula:"计算方式",calculationExpression:"组合公式",calculationExpressionHint:"支持 SUM、AVERAGE/AVG、MIN、MAX、COUNT、MEDIAN 及 + - * / 和括号,不执行 Excel 公式;采用浮点数,精度仅用于展示。",calculationPrecision:"展示小数位",calculationRun:"计算选区",calculationCancel:"取消计算",calculationResult:"计算结果",calculationIncluded:"参与数值",calculationExcluded:"排除单元格",calculationEmpty:"选区没有可计算数值,计数为 0,其余结果为空。",calculationNoSelection:"先关闭设置并选择数据,再从底部工具栏打开选区计算。",calculationSum:"求和 SUM",calculationAverage:"平均值 AVERAGE",calculationMin:"最小值 MIN",calculationMax:"最大值 MAX",calculationCount:"数值计数 COUNT",calculationMedian:"中位数 MEDIAN",calculationCustom:"组合公式",calculationErrorSelection:"请选择同一明细区域中的数据。",calculationErrorLimit:"选区超过计算预算,请缩小范围后重试。",calculationErrorExpression:"公式无效,请使用支持的摘要名称、运算符与括号。",calculationErrorDivision:"除数不能为 0。",calculationErrorOverflow:"结果超出有效数值范围。",calculationErrorPrecision:"数值超出安全精度,或展示小数位不是 0 至 12 的整数。"};function re(e){const n={...k};for(const l of Object.keys(n)){const r=e[l];typeof r=="string"&&(n[l]=r)}return n}const M={...k,exportMenu:"导出",exportMenuDescription:"选择文件格式",clearSearch:"清除搜索",searchHint:"Enter 下一个 · Shift+Enter 上一个",searchNoMatches:"没有匹配内容",pageJump:"跳至页",pageJumpInvalid:"请输入有效页码",pageJumpHint:"Enter 跳转",pagination:"报表分页",columnSearchHint:"输入列名或字段标识",columnSearchShortcut:"↑ ↓ 选择 · Enter 定位",closeColumnDirectory:"关闭字段目录",columnResultsMore:"{count} 个匹配字段,显示前 {limit} 个;继续输入可缩小范围",columnCount:"{count} 个字段",settingsGeneral:"常规",settingsTools:"工具",settingsAdvanced:"高级",settingsAdvancedDescription:"按需开启分析能力,保持日常阅读简洁。",settingsCalculations:"启用选区计算",settingsCalculationsDescription:"选取数值后计算求和、平均值或组合公式,仅用于本地分析。",title:"报表预览",prevPage:"‹ 上一页",nextPage:"下一页 ›",pageInfo:"{cur} / {total}",fitWidth:"适宽",exportHtml:"导出 HTML",exportPdf:"导出 PDF",exportExcel:"导出 Excel",exportImage:"导出图片",exportWord:"导出 Word",exporting:"正在生成 {format}…",print:"打印",pdfWindow:"PDF 窗口",loading:"报表渲染中…",empty:"暂无预览数据",errorPrefix:"",retry:"重试",pdfFontUnavailable:"PDF 字体尚未就绪,请联系管理员检查字体配置;预览及其它导出仍可使用。",searchPlaceholder:"搜索报表内容",matchInfo:"{cur}/{total}",prevMatch:"‹",nextMatch:"›",thumbnails:"缩略图",paramsTitle:"查询条件",query:"查 询",reset:"重 置",paramRequired:"请填写{label}",paramInvalid:"{label}:{message}",paramPrompt:"请先完善查询条件",paramPromptDescription:"填写必填条件后点击查询,即可生成报表。",paramSelectPlaceholder:"请选择{label}",paramTextPlaceholder:"请输入{label}",paramRangeStart:"开始日期",paramRangeEnd:"结束日期",searching:"搜索中…",importExcel:"导入 Excel 模板",importing:"正在导入 Excel…",editCell:"编辑单元格",editingHint:"双击单元格编辑 · Enter 确认 · Esc 取消",saving:"正在保存修改…",editInvalidNumber:"请输入有效数字;清空表示无值",editInvalidBoolean:"请输入 true / false、是 / 否或 1 / 0",editConflict:"该单元格已变化,请重新打开编辑",settings:"设置",settingsDisplay:"阅读工具",settingsExport:"导出与打印",settingsData:"数据操作",settingsUnavailable:"需由接入方配置启用",settingsReset:"恢复默认",settingsClose:"关闭设置",search:"内容搜索",closeSearch:"关闭搜索",prevSearchMatch:"上一个匹配",nextSearchMatch:"下一个匹配",zoom:"缩放工具",settingsLocal:"按需启用工具,仅作用于当前预览。",editingLocal:"修改为本地草稿;不会自动写入业务数据库。",editingSaved:"修改将通过接入方配置的保存回调提交。",importLocal:"导入仅生成本地预览,不自动替换业务数据。",emptyDescription:"当前查询没有明细,请调整查询条件后重试。",undo:"撤销",redo:"重做",restoreChanges:"恢复来源值",changes:"修改明细",changesCount:"{count} 处修改",changesEmpty:"尚无修改",changesBefore:"来源值",changesAfter:"当前值",editAtomicRequired:"批量保存需要接入方提供原子 saveBatch 回调;本次未写入任何单元格。",clipboardLimit:"单次最多粘贴 10000 个单元格,请分批处理。",preferencesError:"偏好存储不可用,设置仍在当前预览中生效。",freezeHeaders:"冻结表头",frozenColumns:"冻结前列",sections:"工作表与章节",locateField:"定位字段",locateFieldPlaceholder:"输入字段标识,Enter 定位",locateFieldMissing:"未找到该字段,请核对字段标识。",importSummary:"Excel 导入摘要",importPreserved:"已导入 {sheets} 个工作表,保留内容、合并和样式。",importWarnings:"兼容性提示",importReadOnly:"公式、日期及受保护单元格保持只读;公式不重算。",conflicts:"保存冲突",editReadOnly:"选区包含只读或无权限单元格,本次修改未应用。",editMissing:"选区超出报表范围或缺少业务来源,请重新选择。",editRecalculationUnavailable:"此报表缺少重算会话或稳定数据来源,暂不支持编辑;请使用 reports/本地数据源重新加载。",editDuplicate:"选区包含同一业务字段的重复单元格,请缩小选区。",clipboardInvalid:"剪贴板内容无法识别,请使用矩形表格文本重新粘贴。",editSaved:"修改已通过保存回调确认",settingsPanes:"冻结窗格",columnDirectory:"字段目录",columnSearch:"搜索列名或字段",columnNoMatches:"未找到匹配字段",columnResults:"匹配字段",columnGroup:"明细区域",discardTitle:"保留当前修改?",discardDescription:"当前报表有尚未保存的输入或本地草稿,继续操作将替换这些内容。",discardKeep:"继续编辑",discardProceed:"放弃修改并继续",taskQuery:"正在获取数据…",taskValidate:"正在校验数据…",taskLayout:"正在生成版式…",taskAssets:"正在准备图片和字体…",taskEncode:"正在生成文件…",taskDownload:"正在准备下载…",taskPrint:"正在准备打印…",taskCancel:"取消任务",taskCancelled:"任务已取消,可重新操作。",diagnosticsSearch:"搜索提示、错误码或位置",diagnosticsMore:"共 {count} 条匹配,当前展示前 100 条;请搜索缩小范围。",diagnosticsTitle:"输出兼容性提示",diagnosticsLocate:"定位",diagnosticsLocation:"第 {page} 页 · 组件 {component}",diagnosticsStrict:"当前格式存在已知内容降级,请查看兼容性提示或选择其他输出格式。",diagnosticsDetails:"查看技术详情",diagnosticMissingImage:"图片或图表资源尚未准备完成,请重试或联系管理员。",diagnosticUnsupported:"当前输出格式会省略此内容,建议选择 PDF 或图片格式。",diagnosticUnsupportedStyle:"当前格式无法保留部分样式,请查看位置并选择适合的输出格式。",diagnosticImageFormat:"当前图片格式无法直接导出,请转换资源后重试。",diagnosticRichText:"文字内容会保留,部分字体与段落样式将简化。",diagnosticNested:"单元格中的嵌套内容会省略,单元格文字会保留。",diagnosticImageAsync:"图片需要完成加载后才能输出。",diagnosticImageDecode:"图片加载失败,请检查资源后重试。",diagnosticAssetFailed:"图表或图片生成失败,请重试或联系管理员。",diagnosticAssetBudget:"图片资源超出处理范围,请减少资源或缩小报表范围。"},R={emptyAccent:"#79a7e8",shellBg:"#f4f7fc",shellFg:"#334155",toolbarBg:"#ffffff",toolbarBorder:"#e4eaf3",toolbarFg:"#334155",btnFg:"#526078",btnBorder:"#dbe3ef",btnHoverBg:"#edf3ff",btnHoverFg:"#315fba",btnActiveBg:"#3569d4"};function A(e={}){return{...e,defaults:e.defaults??{},presets:e.presets??{}}}function ne(e){return e}const m={showExport:!0,showPrint:!0,showPdfWindow:!0,showSettings:!0,showParams:!0,gapPx:18,pdfFontUrl:"/simhei.ttf",logger:console},oe={warn:()=>{},info:()=>{}};function E(e,n){return{...e,...n,theme:{...e?.theme,...n?.theme},messages:{...e?.messages,...n?.messages},preview:{...e?.preview,...n?.preview},xlsx:{...e?.xlsx,...n?.xlsx},toolbar:{...e?.toolbar,...n?.toolbar},interaction:{...e?.interaction,...n?.interaction},output:{...e?.output,...n?.output}}}function le(e){return{showExport:e.showExport??m.showExport,showPrint:e.showPrint??m.showPrint,showPdfWindow:e.showPdfWindow??m.showPdfWindow,showSettings:e.showSettings??m.showSettings,showParams:e.showParams??m.showParams,gapPx:e.gapPx??m.gapPx}}function se(e,n){const l=n?e?.presets?.[n]:e?.defaultPreset?e?.presets?.[e.defaultPreset]:void 0,r=E(e?.defaults,l);return{...le(r),pdfFontUrl:r.pdfFontUrl??m.pdfFontUrl,theme:{...R,...r.theme},messages:{...M,...r.messages},logger:r.logger??m.logger,preview:{overscanPages:B(r.preview?.overscanPages,1,10,!0),searchDebounceMs:B(r.preview?.searchDebounceMs,200,2e3)},xlsx:{...r.xlsx},editable:r.editable??!1,excelImport:r.excelImport??!1,toolbar:{...r.toolbar},interaction:{...r.interaction},preferences:r.preferences,assets:r.assets,guardChanges:r.guardChanges??!0,beforeDiscard:r.beforeDiscard,output:{...r.output}}}function B(e,n,l,r=!1){if(e==null||!Number.isFinite(e))return n;const s=Math.max(0,Math.min(l,e));return r?Math.floor(s):s}function ie(e){const n={};return e.emptyAccent!=null&&(n["--mrp-empty-accent"]=e.emptyAccent),e.shellBg!=null&&(n["--mrp-shell-bg"]=e.shellBg),e.shellFg!=null&&(n["--mrp-shell-fg"]=e.shellFg),e.toolbarBg!=null&&(n["--mrp-toolbar-bg"]=e.toolbarBg),e.toolbarBorder!=null&&(n["--mrp-toolbar-border"]=e.toolbarBorder),e.toolbarFg!=null&&(n["--mrp-toolbar-fg"]=e.toolbarFg),e.btnFg!=null&&(n["--mrp-btn-fg"]=e.btnFg),e.btnBorder!=null&&(n["--mrp-btn-border"]=e.btnBorder),e.btnHoverBg!=null&&(n["--mrp-btn-hover-bg"]=e.btnHoverBg),e.btnHoverFg!=null&&(n["--mrp-btn-hover-fg"]=e.btnHoverFg),e.btnActiveBg!=null&&(n["--mrp-btn-active-bg"]=e.btnActiveBg),n}function ce(e){const n=a.inject(C.MACH_REPORT_CONFIG_KEY,null),l=a.computed(()=>{const r=n?.value??null,s="defaults"in e||"presets"in e||"defaultPreset"in e?A(e):{defaults:e,presets:{}};if(!r)return s;const i={...r.presets,...s.presets};for(const g of Object.keys(i))i[g]=E(E(r.presets[g],s.defaults),s.presets[g]);return{defaults:E(r.defaults,s.defaults),presets:i,defaultPreset:s.defaultPreset??r.defaultPreset}});a.provide(C.MACH_REPORT_CONFIG_KEY,l)}function de(){return a.inject(C.MACH_REPORT_CONFIG_KEY,a.computed(()=>null))}exports.DEFAULT_CALCULATION_MESSAGES=k;exports.DEFAULT_MESSAGES=M;exports.DEFAULT_THEME=R;exports.MachReportError=b;exports.ReportParamPanel=te;exports.SILENT_LOGGER=oe;exports.defineMachReportConfig=A;exports.defineMachReportPreset=ne;exports.normalizeReportLoadError=N;exports.provideMachReportConfig=ce;exports.resolveCalculationMessages=re;exports.resolveConfig=se;exports.themeToCssVars=ie;exports.toErrorDetail=L;exports.useMachReportConfig=de;exports.useReportParams=_;
|