@agile-team/mach-report 2.22.0 → 2.23.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 +8 -6
- package/dist/ExcelBindingWizard-BrTmdo7f.cjs +1 -0
- package/dist/ExcelBindingWizard-CcDMLO8Q.js +1486 -0
- package/dist/ParamEditor-BGjovFUe.js +737 -0
- package/dist/ParamEditor-CeNp4_zQ.cjs +1 -0
- package/dist/ReportBatchPanel-CHxBtG9R.cjs +1 -0
- package/dist/ReportBatchPanel-CJB67WNd.js +351 -0
- package/dist/ReportLabelStudio-Tplc1TLJ.js +784 -0
- package/dist/ReportLabelStudio-g8PkqJWn.cjs +1 -0
- package/dist/ReportParamPanel-C7fZTllk.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-GI43aGa0.js} +146 -127
- package/dist/ReportPreview-BoGBGyRr.cjs +6 -0
- package/dist/ReportPreview-QLONCyci.js +6257 -0
- package/dist/ReportTemplateLibrary-BFQIX0sg.cjs +1 -0
- package/dist/ReportTemplateLibrary-KqX4E2sN.js +312 -0
- package/dist/RuleEditor-BZUP9yvL.cjs +1 -0
- package/dist/RuleEditor-OPX1awrH.js +2342 -0
- package/dist/TemplateOutlinePanel-CVYKVLv_.cjs +1 -0
- package/dist/TemplateOutlinePanel-DQS-eOs6.js +97 -0
- package/dist/TemplateReusePanel-CY6O93Zk.cjs +1 -0
- package/dist/TemplateReusePanel-DKXiFTyB.js +389 -0
- package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +1 -0
- package/dist/TemplateReviewPanel-Dijwm9YE.js +593 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-BB99S802.js +257 -0
- package/dist/auto-BrPWo7Xm.cjs +1 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-BZoVWTgl.js +7172 -0
- package/dist/designer-zS2uKJmY.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +105 -45
- package/dist/designer.d.ts +105 -45
- package/dist/designer.js +4 -4
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-7lquyj0w.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CEd-dq9A.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-CNWXomuV.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-D8pI87fL.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-BRnzKudk.js} +763 -776
- package/dist/json-snapshot-DNiIbpOr.cjs +2 -0
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-DmlnL5eB.js → pdf-CJToa81Z.js} +20 -20
- package/dist/{pdf-CARdBcuw.cjs → pdf-DpMkW72B.cjs} +42 -42
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BWTp-X7b.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-_BkUVc2z.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-CWGdnqQd.js} +21 -21
- package/dist/prefill-PaAy6wLk.cjs +1 -0
- package/dist/prepared-CJy_qk7d.js +94 -0
- package/dist/prepared-D0yCSxSO.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-fjaeKkjf.js → protocol-BG16rz6D.js} +3 -3
- package/dist/{protocol-C9ZaylID.cjs → protocol-wzhl1Fim.cjs} +1 -1
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/runtime-DYMOS_gz.cjs +1 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-PiCax9zQ.js} +52 -51
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1676 -1619
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog-CRuZL3pi.js} +17 -17
- package/dist/template-catalog-DtrtT1FY.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/textwrap-D4ZksyMK.js +111 -0
- package/dist/textwrap-DEHqAjKZ.cjs +4 -0
- package/dist/vue/async.d.cts +31 -0
- package/dist/vue/async.d.ts +31 -0
- package/dist/vue/index.d.cts +32 -1
- package/dist/vue/index.d.ts +32 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-CW79I6Gl.cjs +0 -1
- package/dist/ExcelBindingWizard-CZyppD7I.js +0 -1485
- package/dist/ParamEditor-CiYCJI0b.cjs +0 -1
- package/dist/ParamEditor-DQit-Gdf.js +0 -732
- package/dist/ReportBatchPanel-DKTpV7MU.js +0 -350
- package/dist/ReportBatchPanel-Db6TAfG5.cjs +0 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportLabelStudio-BYnRqmje.js +0 -780
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/ReportTemplateLibrary-BZuKn0YK.js +0 -311
- package/dist/ReportTemplateLibrary-DEXH07ND.cjs +0 -1
- package/dist/RuleEditor-CIQn547x.js +0 -2341
- package/dist/RuleEditor-zSUmPjKa.cjs +0 -1
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/TemplateOutlinePanel-D0PgOSQE.js +0 -96
- package/dist/TemplateReusePanel-BKlAEF8-.js +0 -388
- package/dist/TemplateReusePanel-DAy_Hwqz.cjs +0 -1
- package/dist/TemplateReviewPanel-CowmHaQQ.cjs +0 -1
- package/dist/TemplateReviewPanel-div-EH_m.js +0 -592
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-CkGjRFT3.js +0 -110
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { R as y,
|
|
1
|
+
import { R as y, N as R, O as W, P as I, H as T, n as X, J as z, Q as G, o as H } from "./json-snapshot-BRnzKudk.js";
|
|
2
2
|
import { g as M } from "./report-params-D9tBuM9B.js";
|
|
3
|
-
import { l as $, r as
|
|
4
|
-
import { t as P, b as w, D as
|
|
5
|
-
import { b as
|
|
6
|
-
import { T as
|
|
7
|
-
import {
|
|
8
|
-
import { s as S, a as J,
|
|
9
|
-
|
|
3
|
+
import { l as $, r as K, R as Y } from "./param-validation-CnDEd2l-.js";
|
|
4
|
+
import { t as P, b as w, D as Z, v as ee, c as D, R as F } from "./sha256-BDQ1Qk7A.js";
|
|
5
|
+
import { b as te } from "./template-registry-O0hNIOfB.js";
|
|
6
|
+
import { T as se } from "./template-serialization-CWmHq7lX.js";
|
|
7
|
+
import { r as j } from "./assets-T_gDeFaz.js";
|
|
8
|
+
import { b as ae, s as S, a as J, e as re, f as oe, r as ne } from "./prepared-CJy_qk7d.js";
|
|
9
|
+
import { f as ce, P as ie, e as de } from "./record-bindings-DatJZv_e.js";
|
|
10
|
+
function O(e = []) {
|
|
10
11
|
return e.map(({ code: t, message: r, severity: n, pageIndex: s, componentIndex: a }) => ({ code: t, message: r, severity: n, path: a < 0 ? `$.pages.${s}` : `$.pages.${s}.components.${a}` }));
|
|
11
12
|
}
|
|
12
13
|
async function _(e, t, r = Date.now()) {
|
|
13
14
|
const n = e.prepared;
|
|
14
|
-
if (e.fidelity === "strict" && n.diagnostics.some((g) => g.code === "asset-render-failed" || g.code === "asset-budget-exceeded")) throw new y("validate", "严格输出拒绝已有资产渲染降级,请修复组件后重新准备报表。");
|
|
15
|
+
if (ae(e, t), e.fidelity === "strict" && n.diagnostics.some((g) => g.code === "asset-render-failed" || g.code === "asset-budget-exceeded")) throw new y("validate", "严格输出拒绝已有资产渲染降级,请修复组件后重新准备报表。");
|
|
15
16
|
const s = e.format === "pdf" ? await import("@agile-team/mach-report/pdf") : void 0;
|
|
16
17
|
P(e.signal);
|
|
17
18
|
const a = e.pdf?.customFontFaces ?? (e.pdf?.customFontBytes ? { regular: e.pdf.customFontBytes } : void 0), l = s && a ? s.createFontBytesMeasurer(a) : void 0, m = R(e), p = await m.run("encode", async () => {
|
|
@@ -19,12 +20,12 @@ async function _(e, t, r = Date.now()) {
|
|
|
19
20
|
if (e.format === "pdf") {
|
|
20
21
|
P(e.signal);
|
|
21
22
|
const c = await s.renderPlanToPdf(n.plan, { ...e.pdf, ...l ? { measurer: l } : {}, fidelity: e.fidelity, signal: e.signal, onProgress: (f, i) => m.progress("encode", f, i) });
|
|
22
|
-
g = c.bytes, n.diagnostics.push(...
|
|
23
|
+
g = c.bytes, n.diagnostics.push(...O(c.diagnostics)), n.diagnostics.push(...c.fidelityWarnings.map((f) => ({ code: "pdf-fidelity", message: f, severity: "warning" })), ...c.pageErrors.map((f) => ({ code: "pdf-page", message: f, severity: "error" }))), c.unsupportedTextCount && n.diagnostics.push({ code: "pdf-font", message: `${c.unsupportedTextCount} 段文本包含当前字体不支持的字符`, severity: "warning" });
|
|
23
24
|
} else {
|
|
24
25
|
const { renderPlanToXlsx: c } = await import("@agile-team/mach-report/xlsx");
|
|
25
26
|
P(e.signal);
|
|
26
27
|
const f = await c(n.plan, { ...e.xlsx, fidelity: e.fidelity, signal: e.signal, onProgress: (i, v) => m.progress("encode", i, v) });
|
|
27
|
-
g = new Uint8Array(f.buffer), n.diagnostics.push(...
|
|
28
|
+
g = new Uint8Array(f.buffer), n.diagnostics.push(...O(f.diagnostics)), n.diagnostics.push(...f.warnings.map((i) => ({ code: "xlsx-fidelity", message: i, severity: "warning" }))), n.diagnostics.push(...(f.notes ?? []).map((i) => ({ code: "xlsx-snapshot", message: i, severity: "info" })));
|
|
28
29
|
}
|
|
29
30
|
return P(e.signal), g;
|
|
30
31
|
});
|
|
@@ -32,29 +33,29 @@ async function _(e, t, r = Date.now()) {
|
|
|
32
33
|
const { plan: o, ...x } = n;
|
|
33
34
|
return { ...x, bytes: p, format: e.format, contentType: e.format === "pdf" ? "application/pdf" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", stats: { ...x.stats, durationMs: Date.now() - r, outputBytes: p.byteLength } };
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function N(e) {
|
|
36
37
|
return { ...e, reportIds: [...e.reportIds], ...e.params ? { params: { ...e.params } } : {} };
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function A(e, t) {
|
|
39
40
|
if (t.length === 0) throw new y("config", "缺少报表 ID");
|
|
40
41
|
return t.map((r) => {
|
|
41
42
|
if (!Object.prototype.hasOwnProperty.call(e, r)) throw new y("config", `未注册报表 ${r}`);
|
|
42
43
|
return e[r];
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
return e.grid?.cells.reduce((t, r) => t + r.reduce((n, s) => n + (s ? 1 + (s.children?.reduce((a, l) => a +
|
|
46
|
+
function k(e) {
|
|
47
|
+
return e.grid?.cells.reduce((t, r) => t + r.reduce((n, s) => n + (s ? 1 + (s.children?.reduce((a, l) => a + k(l), 0) ?? 0) : 0), 0), 0) ?? 0;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
return e.pages.reduce((n, s) => n + s.components.reduce((a, l) => l.kind !== "list" ? a +
|
|
49
|
+
function pe(e, t, r) {
|
|
50
|
+
return e.pages.reduce((n, s) => n + s.components.reduce((a, l) => l.kind !== "list" ? a + k(l) : a + H(l, t, r), 0), 0);
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
52
|
+
function le(e, t = Object.keys(e)) {
|
|
53
|
+
return A(e, t).map((r, n) => {
|
|
53
54
|
const s = t[n], a = M(e, [s]);
|
|
54
55
|
return {
|
|
55
56
|
id: s,
|
|
56
57
|
params: JSON.parse(JSON.stringify(a)),
|
|
57
|
-
paramsSchema:
|
|
58
|
+
paramsSchema: K(a),
|
|
58
59
|
datasetsSchema: Object.fromEntries(Object.entries(r.dataSchema ?? {}).map(([l, m]) => [l, W(typeof r.template == "function" ? void 0 : r.template, l, m)])),
|
|
59
60
|
capabilities: {
|
|
60
61
|
save: !!r.provider?.save,
|
|
@@ -64,24 +65,24 @@ function pe(e, t = Object.keys(e)) {
|
|
|
64
65
|
};
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
68
|
+
function U(e, t) {
|
|
69
|
+
A(e, t.reportIds);
|
|
69
70
|
const r = $(M(e, t.reportIds), t.params), n = t.reportIds.flatMap((a) => $(M(e, [a]), t.params).issues), s = new Map(n.map((a) => [JSON.stringify(a), a]));
|
|
70
71
|
return { ...r, ok: s.size === 0, issues: [...s.values()] };
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
const r =
|
|
73
|
+
function V(e, t) {
|
|
74
|
+
const r = te(e.plan);
|
|
74
75
|
if (!r.ok) throw new y("validate", `执行器返回无效计划:${r.errors[0]?.path}`);
|
|
75
|
-
const n = e.plan.pages.length, s = e.plan.pages.reduce((a, l) => a + l.components.reduce((m, p) => m +
|
|
76
|
+
const n = e.plan.pages.length, s = e.plan.pages.reduce((a, l) => a + l.components.reduce((m, p) => m + k(p), 0), 0);
|
|
76
77
|
return w(t, "maxRows", e.stats.rows), w(t, "maxPages", n), w(t, "maxCells", s), { ...e, stats: { ...e.stats, pages: n, cells: s } };
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
const r =
|
|
80
|
-
if (!r.ok) throw new
|
|
79
|
+
function q(e, t) {
|
|
80
|
+
const r = U(e.reports, t);
|
|
81
|
+
if (!r.ok) throw new Y(r.issues);
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
const t = { ...
|
|
84
|
-
|
|
83
|
+
function be(e) {
|
|
84
|
+
const t = { ...Z, ...e.budget };
|
|
85
|
+
ee(t);
|
|
85
86
|
const r = async (s, a) => {
|
|
86
87
|
const l = Date.now();
|
|
87
88
|
let m = 0, p = 0;
|
|
@@ -97,9 +98,9 @@ function ve(e) {
|
|
|
97
98
|
try {
|
|
98
99
|
m += z(h, u, { maxRows: t.maxRows, signal: s.signal });
|
|
99
100
|
} catch (b) {
|
|
100
|
-
throw b instanceof
|
|
101
|
+
throw b instanceof se ? new F("budget", b.message, "$.budget.maxRows") : b;
|
|
101
102
|
}
|
|
102
|
-
w(t, "maxRows", m), p +=
|
|
103
|
+
w(t, "maxRows", m), p += pe(h, u, c[d]?.pagination), w(t, "maxCells", p);
|
|
103
104
|
} })({ ...s, params: s.params ?? {}, onWarning: (d) => o.push({ code: "layout", message: d, severity: "warning" }), onQueryResult: (d, u, h = 0) => {
|
|
104
105
|
const b = G(h, d);
|
|
105
106
|
Object.defineProperty(x, d, { value: { revision: u.revision, sourceToken: u.sourceToken }, enumerable: !0, writable: !0 }), g.push({ reportId: d, reportIndex: h, reportScope: b, ...u.revision === void 0 ? {} : { revision: u.revision }, ...u.sourceToken === void 0 ? {} : { sourceToken: u.sourceToken } }), o.push(...(u.diagnostics ?? []).map((C) => ({ ...C, ...C.target ? { target: {
|
|
@@ -108,15 +109,15 @@ function ve(e) {
|
|
|
108
109
|
...C.target.tableId ? { tableId: JSON.stringify([h, d, C.target.tableId]) } : {}
|
|
109
110
|
} } : {} })));
|
|
110
111
|
} }).catch((d) => {
|
|
111
|
-
throw d instanceof y && d.cause instanceof
|
|
112
|
+
throw d instanceof y && d.cause instanceof ce ? new F("budget", d.cause.message, "$.budget.maxPages") : d instanceof y && d.cause instanceof ie ? new F("budget", d.cause.message, "$.budget.maxCells") : d instanceof y && d.cause instanceof de ? new F("budget", d.cause.message, "$.budget.maxChartComponents") : d;
|
|
112
113
|
});
|
|
113
114
|
P(s.signal);
|
|
114
115
|
const v = e.assets ? await R(s).run("assets", () => j(i, { ...e.assets, signal: s.signal })) : { plan: i, diagnostics: [] }, E = v.plan;
|
|
115
|
-
o.push(...
|
|
116
|
-
const L = E.pages.reduce((d, u) => d + u.components.reduce((h, b) => h +
|
|
116
|
+
o.push(...O(v.diagnostics));
|
|
117
|
+
const L = E.pages.reduce((d, u) => d + u.components.reduce((h, b) => h + k(b), 0), 0);
|
|
117
118
|
w(t, "maxPages", E.pages.length), w(t, "maxCells", L);
|
|
118
|
-
const
|
|
119
|
-
return { plan: E, diagnostics: o, revisions: x, sources: g, layout: { textMetrics:
|
|
119
|
+
const B = ne(s.pdf), Q = e.pagination?.measurer || Object.values(e.reports).some((d) => d.pagination?.measurer);
|
|
120
|
+
return { plan: E, diagnostics: o, revisions: x, sources: g, layout: { textMetrics: B ? "font-bytes" : Q ? "provided" : "heuristic", ...B ? { fontFingerprint: B } : {} }, stats: { rows: m, pages: E.pages.length, cells: L, durationMs: Date.now() - l } };
|
|
120
121
|
}, n = async (s) => {
|
|
121
122
|
const a = Date.now();
|
|
122
123
|
if (s.format !== "pdf" && s.format !== "xlsx") throw new y("config", "不支持的报表导出格式");
|
|
@@ -126,11 +127,11 @@ function ve(e) {
|
|
|
126
127
|
return P(s.signal), _({ ...s, prepared: o }, t, a);
|
|
127
128
|
};
|
|
128
129
|
return {
|
|
129
|
-
describe: (s) =>
|
|
130
|
-
validate: (s) =>
|
|
130
|
+
describe: (s) => le(e.reports, s),
|
|
131
|
+
validate: (s) => U(e.reports, s),
|
|
131
132
|
prepare: (s) => D(s.signal, t.maxDurationMs, async (a) => {
|
|
132
|
-
const { signal: l, onEvent: m, ...p } =
|
|
133
|
-
R(g).runSync("validate", () =>
|
|
133
|
+
const { signal: l, onEvent: m, ...p } = N(s), o = { ...p, ...p.pdf ? { pdf: S(p.pdf) } : {}, taskId: p.taskId ?? I() }, x = m ? (v) => T(m, v, a) : void 0, g = { ...o, signal: a, onEvent: x };
|
|
134
|
+
R(g).runSync("validate", () => q(e, o));
|
|
134
135
|
let c;
|
|
135
136
|
const f = o.pdf?.customFontFaces ?? (o.pdf?.customFontBytes ? { regular: o.pdf.customFontBytes } : void 0);
|
|
136
137
|
if (!e.executor && f) {
|
|
@@ -138,33 +139,33 @@ function ve(e) {
|
|
|
138
139
|
P(a), c = v.createFontBytesMeasurer(f);
|
|
139
140
|
}
|
|
140
141
|
const i = e.executor ? await e.executor.prepare(o, a, x) : await r(g, c);
|
|
141
|
-
return
|
|
142
|
+
return V(i, t);
|
|
142
143
|
}),
|
|
143
144
|
exportPrepared: (s) => D(s.signal, t.maxDurationMs, async (a) => {
|
|
144
|
-
const l = Date.now(), { signal: m, onEvent: p, ...o } = s, x =
|
|
145
|
+
const l = Date.now(), { signal: m, onEvent: p, ...o } = s, x = V(re(s.prepared, t.maxPreparedBytes ?? 64e6, a), t), g = { ...o, xlsx: J(o.xlsx), prepared: x, ...o.pdf ? { pdf: S(o.pdf) } : {}, taskId: o.taskId ?? I() };
|
|
145
146
|
if (g.format !== "pdf" && g.format !== "xlsx") throw new y("config", "不支持的报表导出格式");
|
|
146
|
-
const c = p ? (i) =>
|
|
147
|
+
const c = p ? (i) => T(p, i, a) : void 0;
|
|
147
148
|
if (e.executor) {
|
|
148
149
|
if (!e.executor.exportPrepared) throw new y("config", "执行器未实现 exportPrepared;请升级执行器或显式使用本地运行时");
|
|
149
150
|
const i = await e.executor.exportPrepared(g, a, c);
|
|
150
151
|
return w(t, "maxRows", i.stats.rows), w(t, "maxPages", i.stats.pages), w(t, "maxCells", i.stats.cells), w(t, "maxOutputBytes", i.bytes.byteLength), { ...i, stats: { ...i.stats, outputBytes: i.bytes.byteLength } };
|
|
151
152
|
}
|
|
152
153
|
const f = { ...g, signal: a, onEvent: c };
|
|
153
|
-
if (R(f).runSync("validate", () =>
|
|
154
|
+
if (R(f).runSync("validate", () => oe(f)), e.assets) {
|
|
154
155
|
const i = await R(f).run("assets", () => j(x.plan, { ...e.assets, signal: a }));
|
|
155
|
-
x.plan = i.plan, x.diagnostics.push(...
|
|
156
|
+
x.plan = i.plan, x.diagnostics.push(...O(i.diagnostics));
|
|
156
157
|
}
|
|
157
158
|
return _(f, t, l);
|
|
158
159
|
}),
|
|
159
160
|
export: (s) => D(s.signal, t.maxDurationMs, async (a) => {
|
|
160
|
-
const { signal: l, onEvent: m, ...p } =
|
|
161
|
-
if (R(g).runSync("validate", () =>
|
|
161
|
+
const { signal: l, onEvent: m, ...p } = N(s), o = { ...p, xlsx: J(p.xlsx), ...p.pdf ? { pdf: S(p.pdf) } : {}, taskId: p.taskId ?? I() }, x = m ? (f) => T(m, f, a) : void 0, g = { ...o, signal: a, onEvent: x };
|
|
162
|
+
if (R(g).runSync("validate", () => q(e, o)), o.format !== "pdf" && o.format !== "xlsx") throw new y("config", "不支持的报表导出格式");
|
|
162
163
|
const c = e.executor ? await e.executor.export(o, a, x) : await n(g);
|
|
163
164
|
return w(t, "maxRows", c.stats.rows), w(t, "maxPages", c.stats.pages), w(t, "maxCells", c.stats.cells), w(t, "maxOutputBytes", c.bytes.byteLength), { ...c, stats: { ...c.stats, outputBytes: c.bytes.byteLength } };
|
|
164
165
|
})
|
|
165
166
|
};
|
|
166
167
|
}
|
|
167
168
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
be as c,
|
|
170
|
+
V as e
|
|
170
171
|
};
|