@agile-team/mach-report 2.26.2 → 2.28.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/README.md +5 -3
- package/dist/{ExcelBindingWizard-CnjjpYxD.cjs → ExcelBindingWizard-CRbGXQYW.cjs} +1 -1
- package/dist/{ExcelBindingWizard-DAprCgn-.js → ExcelBindingWizard-T2bcFFc3.js} +1 -1
- package/dist/{ParamEditor-CiVjpbc-.cjs → ParamEditor-D7L8Hu7O.cjs} +1 -1
- package/dist/{ParamEditor-CY9d8QZD.js → ParamEditor-Dcga4g83.js} +1 -1
- package/dist/{ReportBatchPanel-CDp7xRHp.js → ReportBatchPanel-CVyZXHb9.js} +1 -1
- package/dist/{ReportBatchPanel-0-Oymcdm.cjs → ReportBatchPanel-Chd86xV5.cjs} +1 -1
- package/dist/{ReportLabelStudio-CsyHqBco.cjs → ReportLabelStudio-C7wsAjD7.cjs} +1 -1
- package/dist/{ReportLabelStudio-DtKxk9n0.js → ReportLabelStudio-uZD7cvVh.js} +2 -2
- package/dist/ReportPreview-OoJitdxR.cjs +6 -0
- package/dist/ReportPreview-Saaawtxy.js +7558 -0
- package/dist/{ReportTemplateLibrary-CsUm6edm.cjs → ReportTemplateLibrary-BwEZ7lUD.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-qPQX0Dt_.js → ReportTemplateLibrary-C38-d09l.js} +1 -1
- package/dist/{RuleEditor-CJBibiLY.cjs → RuleEditor-BlEuxdFI.cjs} +1 -1
- package/dist/{RuleEditor-Di-JZ2Lb.js → RuleEditor-DXp8UBmB.js} +1 -1
- package/dist/{TemplateOutlinePanel-D0mKfVWf.js → TemplateOutlinePanel-K18a6dQW.js} +2 -2
- package/dist/{TemplateOutlinePanel-RiRgXnnH.cjs → TemplateOutlinePanel-Yr593Ez_.cjs} +1 -1
- package/dist/{TemplateReusePanel-BdK91T7z.cjs → TemplateReusePanel-fdjbbHvo.cjs} +1 -1
- package/dist/{TemplateReusePanel-J6PvD2Sf.js → TemplateReusePanel-nxeiJPDe.js} +1 -1
- package/dist/{TemplateReviewPanel-B5yUgOgb.cjs → TemplateReviewPanel-H-2EY_uF.cjs} +1 -1
- package/dist/{TemplateReviewPanel-BlUbD2GY.js → TemplateReviewPanel-dpDkIS7U.js} +1 -1
- package/dist/artifact-integrity.json +38 -38
- package/dist/{designer-CZqnLTyE.js → designer-Bin_Iejf.js} +5 -5
- package/dist/{designer-Bc5AXS38.cjs → designer-DlJLAg9U.cjs} +2 -2
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +2 -0
- package/dist/designer.d.ts +2 -0
- package/dist/designer.js +1 -1
- package/dist/dom-CZJvH_q7.cjs +1 -0
- package/dist/{dom-CbOWY7KE.js → dom-or62B5bH.js} +66 -66
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{plugin-BnRcXQzg.js → plugin-BCOSlLgx.js} +1 -1
- package/dist/{plugin-BFBLxfsq.cjs → plugin-DmAYitvB.cjs} +1 -1
- package/dist/sbom.cdx.json +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/style.css +1 -1
- package/dist/vue/async.d.cts +30 -0
- package/dist/vue/async.d.ts +30 -0
- package/dist/vue/index.d.cts +38 -0
- package/dist/vue/index.d.ts +38 -0
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +159 -155
- package/package.json +1 -1
- package/dist/ReportPreview-DJqt40zA.js +0 -7407
- package/dist/ReportPreview-s7c2nrfo.cjs +0 -6
- package/dist/dom-VuLh_fhL.cjs +0 -1
package/dist/vue.js
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
import { createReportSource as le, ReportCellEditError as oe } from "@agile-team/mach-report";
|
|
2
2
|
export * from "@agile-team/mach-report";
|
|
3
|
-
import { c as
|
|
4
|
-
import { d as
|
|
3
|
+
import { c as x, R as fe, a as de, b as ge, P as Y, r as pe } from "./ReportPreview-Saaawtxy.js";
|
|
4
|
+
import { d as vt, e as yt, _ as ht, f as wt, g as Et, h as Pt, i as bt, j as Rt, k as Ct, l as St, m as _t, n as Tt, o as xt, p as At, q as It, s as Ot, t as Dt, u as Mt, v as kt, w as Nt, x as Ft } from "./ReportPreview-Saaawtxy.js";
|
|
5
5
|
import { defineComponent as me, computed as D, shallowRef as j, ref as O, watch as ve, onMounted as ye, onUnmounted as he, openBlock as k, createElementBlock as N, normalizeStyle as we, unref as Ee, createElementVNode as J, toDisplayString as F, createCommentVNode as $, createBlock as Pe, withCtx as X, createVNode as Z, inject as be } from "vue";
|
|
6
6
|
import { a as Re } from "./execution-result-BUPPNlaS.js";
|
|
7
|
-
import { z as T, w as
|
|
8
|
-
import { M as S, u as Se, r as _e, D as Te, t as
|
|
9
|
-
import { a as
|
|
10
|
-
import { s as Q, v as
|
|
11
|
-
import { b as
|
|
7
|
+
import { z as T, w as q, A as Ce } from "./diagnostic-collector-CZ8DV6wA.js";
|
|
8
|
+
import { M as S, u as Se, r as _e, D as Te, t as xe } from "./ReportParamPanel-jKDJVar2.js";
|
|
9
|
+
import { a as Ut, b as jt, c as qt, d as Bt, e as Vt, P as Wt, R as zt, S as Gt, f as Ht, g as Kt, n as Yt, p as Jt, h as $t, i as Xt, j as Zt, s as Qt, k as er } from "./ReportParamPanel-jKDJVar2.js";
|
|
10
|
+
import { s as Q, v as Ae } from "./json-snapshot-DRQmh_k5.js";
|
|
11
|
+
import { b as ae } from "./template-registry-CIaC6qBW.js";
|
|
12
12
|
import { _ as Ie } from "./usePopoverBounds-C3hn7F1s.js";
|
|
13
13
|
import { M as Oe } from "./injection-keys-e85udZCp.js";
|
|
14
|
-
import { a as
|
|
15
|
-
import { M as sr, m as
|
|
14
|
+
import { a as rr, b as nr, c as or } from "./injection-keys-e85udZCp.js";
|
|
15
|
+
import { M as sr, m as ir } from "./plugin-BCOSlLgx.js";
|
|
16
16
|
const De = 3, Me = 8e6, ke = 16e6, Ne = 7;
|
|
17
17
|
function P(e) {
|
|
18
18
|
return new S("validate", e);
|
|
19
19
|
}
|
|
20
20
|
function Fe(e) {
|
|
21
|
-
return !e || ![e.scope, e.id, e.version].every((t) => typeof t == "string" && !!t.trim() && t.length <= 256) || !["building", "complete", "failed"].includes(e.state) || !Number.isSafeInteger(e.pageCount) || e.pageCount < 0 || e.pageCount > 1e5 || e.revision !== e.pageCount + (e.state === "building" ? 0 : 1) || !Number.isSafeInteger(e.bytes) || e.bytes < 0 || !e.plan || "pages" in e.plan || !
|
|
21
|
+
return !e || ![e.scope, e.id, e.version].every((t) => typeof t == "string" && !!t.trim() && t.length <= 256) || !["building", "complete", "failed"].includes(e.state) || !Number.isSafeInteger(e.pageCount) || e.pageCount < 0 || e.pageCount > 1e5 || e.revision !== e.pageCount + (e.state === "building" ? 0 : 1) || !Number.isSafeInteger(e.bytes) || e.bytes < 0 || !e.plan || "pages" in e.plan || !ae({ ...e.plan, pages: [] }).ok ? !1 : e.state !== "failed" || !!e.failure && ["cancelled", "generation"].includes(e.failure.code) && typeof e.failure.message == "string" && e.failure.message.length <= 1024;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function B(e, t) {
|
|
24
24
|
if (Object.is(e, t)) return !0;
|
|
25
25
|
if (!e || !t || typeof e != "object" || typeof t != "object" || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
26
26
|
const o = e, r = t, n = Object.keys(o);
|
|
27
|
-
return n.length === Object.keys(r).length && n.every((
|
|
27
|
+
return n.length === Object.keys(r).length && n.every((s) => Object.prototype.hasOwnProperty.call(r, s) && B(o[s], r[s]));
|
|
28
28
|
}
|
|
29
29
|
function Le(e, t) {
|
|
30
30
|
if (t) {
|
|
31
31
|
if (e.scope !== t.scope || e.id !== t.id || e.version !== t.version) throw P("文档版本已变化,请刷新后重新打开");
|
|
32
32
|
if (e.revision < t.revision || t.state !== "building" && (e.revision !== t.revision || e.state !== t.state)) throw P("文档修订发生回退或终态被修改");
|
|
33
|
-
if (e.pageCount < t.pageCount || e.bytes < t.bytes || !
|
|
34
|
-
if (t.state !== "building" && !
|
|
33
|
+
if (e.pageCount < t.pageCount || e.bytes < t.bytes || !B(e.plan, t.plan)) throw P("文档已提交边界回退或计划头被修改");
|
|
34
|
+
if (t.state !== "building" && !B(e, t)) throw P("终态文档清单被修改");
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
function Ue(e, t, o) {
|
|
38
38
|
const r = Q(e, { maxBytes: Me, check: () => T(t.signal), error: (l, c) => P(c) });
|
|
39
39
|
if (!Fe(r.manifest) || !Array.isArray(r.pages)) throw P("文档页窗口清单无效");
|
|
40
|
-
const { manifest: n, pages:
|
|
40
|
+
const { manifest: n, pages: s, nextPage: E } = r;
|
|
41
41
|
if (Q(n, { maxBytes: 1e6, error: (l, c) => P(c) }), Le(n, o), t.version !== void 0 && t.version !== n.version) throw P("文档返回了不同版本");
|
|
42
42
|
const d = Math.min(t.fromPage, n.pageCount);
|
|
43
|
-
if (
|
|
44
|
-
if (!
|
|
43
|
+
if (s.length > t.limit || E !== d + s.length || E > n.pageCount || d < n.pageCount && s.length === 0) throw P("文档页窗口边界无效");
|
|
44
|
+
if (!ae({ ...n.plan, pages: s }).ok) throw P("文档页内容无效");
|
|
45
45
|
return r;
|
|
46
46
|
}
|
|
47
47
|
function ee(e) {
|
|
48
48
|
const t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
49
|
-
let r, n = 0,
|
|
50
|
-
function d(
|
|
51
|
-
const f = new TextEncoder().encode(JSON.stringify(g)).byteLength, w = t.get(
|
|
52
|
-
for (w && (n -= w.bytes), t.delete(
|
|
49
|
+
let r, n = 0, s = 0, E = !1;
|
|
50
|
+
function d(a, g) {
|
|
51
|
+
const f = new TextEncoder().encode(JSON.stringify(g)).byteLength, w = t.get(a);
|
|
52
|
+
for (w && (n -= w.bytes), t.delete(a), t.set(a, { page: g, bytes: f }), n += f; t.size > Ne || n > ke; ) {
|
|
53
53
|
const m = t.keys().next().value;
|
|
54
54
|
n -= t.get(m).bytes, t.delete(m);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function l(
|
|
58
|
-
const g = o.get(
|
|
57
|
+
function l(a) {
|
|
58
|
+
const g = o.get(a);
|
|
59
59
|
if (g) return g;
|
|
60
|
-
const f = new AbortController(), w =
|
|
61
|
-
if (T(f.signal), w !==
|
|
60
|
+
const f = new AbortController(), w = s, m = { fromPage: a, limit: De, version: r?.version, signal: f.signal }, v = { controller: f, users: 0, promise: q(Promise.resolve().then(() => (T(f.signal), e.load({ ...m }))), f.signal).then((y) => {
|
|
61
|
+
if (T(f.signal), w !== s) throw P("文档加载已被替换");
|
|
62
62
|
const b = Ue(y, m, r);
|
|
63
|
-
return r = b.manifest, b.pages.forEach((_, h) => d(
|
|
63
|
+
return r = b.manifest, b.pages.forEach((_, h) => d(a + h, _)), b;
|
|
64
64
|
}).finally(() => {
|
|
65
|
-
o.get(
|
|
65
|
+
o.get(a) === v && o.delete(a);
|
|
66
66
|
}) };
|
|
67
|
-
return o.set(
|
|
67
|
+
return o.set(a, v), v;
|
|
68
68
|
}
|
|
69
|
-
async function c(
|
|
70
|
-
if (T(g), E || !Number.isSafeInteger(
|
|
71
|
-
const f = t.get(
|
|
69
|
+
async function c(a, g) {
|
|
70
|
+
if (T(g), E || !Number.isSafeInteger(a) || a < 0 || a >= 1e5) throw P("文档页索引无效或预览已关闭");
|
|
71
|
+
const f = t.get(a);
|
|
72
72
|
if (f && r)
|
|
73
|
-
return t.delete(
|
|
74
|
-
const w =
|
|
73
|
+
return t.delete(a), t.set(a, f), x({ manifest: r, page: f.page });
|
|
74
|
+
const w = a, m = l(w);
|
|
75
75
|
m.users++;
|
|
76
76
|
try {
|
|
77
|
-
const v = await
|
|
78
|
-
if (T(g),
|
|
79
|
-
const y = v.pages[
|
|
80
|
-
if (!y &&
|
|
81
|
-
return
|
|
77
|
+
const v = await q(m.promise, g);
|
|
78
|
+
if (T(g), a >= v.manifest.pageCount && (v.manifest.pageCount > 0 || a > 0)) throw P("页码超出文档范围");
|
|
79
|
+
const y = v.pages[a - w];
|
|
80
|
+
if (!y && a < v.manifest.pageCount) throw P("目标页未返回,请缩小页窗口");
|
|
81
|
+
return x({ manifest: v.manifest, ...y ? { page: y } : {} });
|
|
82
82
|
} finally {
|
|
83
83
|
--m.users === 0 && o.get(w) === m && (o.delete(w), m.controller.abort());
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
function p() {
|
|
87
|
-
|
|
88
|
-
for (const
|
|
87
|
+
s++;
|
|
88
|
+
for (const a of o.values()) a.controller.abort();
|
|
89
89
|
o.clear(), t.clear(), n = 0, r = void 0;
|
|
90
90
|
}
|
|
91
91
|
return { load: c, reset: p, dispose: () => {
|
|
@@ -96,10 +96,10 @@ function ee(e) {
|
|
|
96
96
|
return n;
|
|
97
97
|
} };
|
|
98
98
|
}
|
|
99
|
-
const je = ["aria-busy"],
|
|
99
|
+
const je = ["aria-busy"], qe = {
|
|
100
100
|
class: "mrp-document-status",
|
|
101
101
|
role: "status"
|
|
102
|
-
},
|
|
102
|
+
}, Be = {
|
|
103
103
|
key: 0,
|
|
104
104
|
class: "mrp-document-error",
|
|
105
105
|
role: "alert"
|
|
@@ -113,10 +113,10 @@ const je = ["aria-busy"], Be = {
|
|
|
113
113
|
},
|
|
114
114
|
emits: ["loaded", "error", "exported"],
|
|
115
115
|
setup(e, { expose: t, emit: o }) {
|
|
116
|
-
const r = e, n = o,
|
|
116
|
+
const r = e, n = o, s = Se(), E = D(() => _e(s.value, r.preset)), d = D(() => ({ ...Te, ...E.value.messages, ...r.messages })), l = j(), c = j(), p = O(1), a = O(!1), g = O(!1), f = O(""), w = O(!1);
|
|
117
117
|
let m = ee(r.source), v = 0, y = !1, b, _;
|
|
118
|
-
const h = async () =>
|
|
119
|
-
if (
|
|
118
|
+
const h = async () => x(c.value), W = O(""), z = D(() => !!r.source.export && l.value?.state === "complete" && l.value.pageCount > 0 && !w.value), ie = D(() => {
|
|
119
|
+
if (a.value) return d.value.documentLoading;
|
|
120
120
|
const i = l.value;
|
|
121
121
|
return i ? (i.state === "building" ? d.value.documentBuilding : i.state === "failed" ? d.value.documentFailed : d.value.documentComplete).replace("{pages}", String(i.pageCount)) : "";
|
|
122
122
|
});
|
|
@@ -124,38 +124,38 @@ const je = ["aria-busy"], Be = {
|
|
|
124
124
|
f.value = i instanceof Error ? i.message : String(i), n("error", f.value);
|
|
125
125
|
}
|
|
126
126
|
function M() {
|
|
127
|
-
v++, b?.abort(), _?.abort(), b = void 0, _ = void 0,
|
|
127
|
+
v++, b?.abort(), _?.abort(), b = void 0, _ = void 0, a.value = !1, g.value = !1;
|
|
128
128
|
}
|
|
129
129
|
function ce(i) {
|
|
130
|
-
if (i.target instanceof Element && i.target.closest("input,textarea,select,[contenteditable=true]") || i.ctrlKey || i.metaKey || i.altKey ||
|
|
130
|
+
if (i.target instanceof Element && i.target.closest("input,textarea,select,[contenteditable=true]") || i.ctrlKey || i.metaKey || i.altKey || a.value || g.value || !l.value?.pageCount) return;
|
|
131
131
|
const C = { PageDown: p.value + 1, PageUp: p.value - 1, Home: 1, End: l.value.pageCount }[i.key];
|
|
132
|
-
C !== void 0 && (i.preventDefault(), i.stopPropagation(),
|
|
132
|
+
C !== void 0 && (i.preventDefault(), i.stopPropagation(), A(Math.max(1, Math.min(C, l.value.pageCount))));
|
|
133
133
|
}
|
|
134
|
-
async function
|
|
134
|
+
async function A(i) {
|
|
135
135
|
if (!Number.isSafeInteger(i) || i < 1 || l.value && i > l.value.pageCount) throw new S("param", d.value.pageJumpInvalid ?? "请输入有效页码");
|
|
136
136
|
b?.abort();
|
|
137
137
|
const R = new AbortController(), C = ++v;
|
|
138
|
-
b = R,
|
|
138
|
+
b = R, a.value = !0, f.value = "";
|
|
139
139
|
try {
|
|
140
140
|
const u = await m.load(i - 1, R.signal);
|
|
141
141
|
if (T(R.signal), C !== v) return;
|
|
142
|
-
l.value = u.manifest, p.value = i, w.value = !1, c.value = { ...u.manifest.plan, pages: u.page ? [u.page] : [] }, W.value = JSON.stringify([u.manifest.scope, u.manifest.id, u.manifest.version, i]), n("loaded",
|
|
142
|
+
l.value = u.manifest, p.value = i, w.value = !1, c.value = { ...u.manifest.plan, pages: u.page ? [u.page] : [] }, W.value = JSON.stringify([u.manifest.scope, u.manifest.id, u.manifest.version, i]), n("loaded", x(u.manifest));
|
|
143
143
|
} catch (u) {
|
|
144
144
|
!R.signal.aborted && C === v && (w.value = !0, L(u));
|
|
145
145
|
} finally {
|
|
146
|
-
C === v && (
|
|
146
|
+
C === v && (a.value = !1, b = void 0);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
async function
|
|
150
|
-
M(), m.reset(), w.value = !!c.value, l.value = void 0, await
|
|
149
|
+
async function G() {
|
|
150
|
+
M(), m.reset(), w.value = !!c.value, l.value = void 0, await A(1);
|
|
151
151
|
}
|
|
152
152
|
async function H(i) {
|
|
153
153
|
const R = r.source, C = l.value;
|
|
154
|
-
if (!R.export || !C || !
|
|
154
|
+
if (!R.export || !C || !z.value || a.value || g.value) throw new S("export", d.value.documentFullExport);
|
|
155
155
|
const u = new AbortController();
|
|
156
156
|
_ = u, g.value = !0;
|
|
157
157
|
try {
|
|
158
|
-
const I = await
|
|
158
|
+
const I = await q(R.export({ version: C.version, format: i, signal: u.signal }), u.signal);
|
|
159
159
|
if (T(u.signal), Re(I, i), R !== r.source || l.value?.version !== C.version || I.stats.pages !== C.pageCount) throw new S("export", "完整文档导出的版本或页数不一致");
|
|
160
160
|
return n("exported", I), I;
|
|
161
161
|
} finally {
|
|
@@ -174,30 +174,30 @@ const je = ["aria-busy"], Be = {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
return ve(() => r.source, () => {
|
|
177
|
-
M(), m.dispose(), m = ee(r.source), c.value = void 0, l.value = void 0, y &&
|
|
177
|
+
M(), m.dispose(), m = ee(r.source), c.value = void 0, l.value = void 0, y && A(1);
|
|
178
178
|
}), ye(() => {
|
|
179
|
-
y = !0,
|
|
179
|
+
y = !0, A(1);
|
|
180
180
|
}), he(() => {
|
|
181
181
|
y = !1, M(), m.dispose();
|
|
182
|
-
}), t({ reload:
|
|
182
|
+
}), t({ reload: G, gotoPage: A, cancel: M, export: H, state: D(() => x({ manifest: l.value ?? null, currentPage: p.value, loading: a.value, exporting: g.value, error: f.value })) }), (i, R) => (k(), N("section", {
|
|
183
183
|
class: "mrp-document",
|
|
184
|
-
style: we({ ...Ee(
|
|
185
|
-
"aria-busy":
|
|
184
|
+
style: we({ ...Ee(xe)(E.value.theme), height: e.height }),
|
|
185
|
+
"aria-busy": a.value || g.value,
|
|
186
186
|
onKeydownCapture: ce
|
|
187
187
|
}, [
|
|
188
|
-
J("div",
|
|
188
|
+
J("div", qe, [
|
|
189
189
|
J("span", null, F(ie.value), 1),
|
|
190
|
-
|
|
190
|
+
a.value || g.value ? (k(), N("button", {
|
|
191
191
|
key: 0,
|
|
192
192
|
type: "button",
|
|
193
193
|
onClick: M
|
|
194
194
|
}, F(d.value.documentCancel), 1)) : (k(), N("button", {
|
|
195
195
|
key: 1,
|
|
196
196
|
type: "button",
|
|
197
|
-
onClick:
|
|
197
|
+
onClick: G
|
|
198
198
|
}, F(d.value.documentRefresh), 1))
|
|
199
199
|
]),
|
|
200
|
-
f.value ? (k(), N("div",
|
|
200
|
+
f.value ? (k(), N("div", Be, F(f.value), 1)) : $("", !0),
|
|
201
201
|
c.value ? (k(), Pe(fe, {
|
|
202
202
|
key: 1,
|
|
203
203
|
"report-id": W.value,
|
|
@@ -210,7 +210,7 @@ const je = ["aria-busy"], Be = {
|
|
|
210
210
|
prefill: !1,
|
|
211
211
|
"data-comparison": !1,
|
|
212
212
|
"show-params": !1,
|
|
213
|
-
"show-export":
|
|
213
|
+
"show-export": z.value,
|
|
214
214
|
"show-print": !1,
|
|
215
215
|
"show-pdf-window": !1,
|
|
216
216
|
"show-settings": !1,
|
|
@@ -222,7 +222,7 @@ const je = ["aria-busy"], Be = {
|
|
|
222
222
|
Z(ge, {
|
|
223
223
|
messages: d.value,
|
|
224
224
|
formats: ["pdf", "xlsx"],
|
|
225
|
-
busy:
|
|
225
|
+
busy: a.value || g.value,
|
|
226
226
|
onExport: ue
|
|
227
227
|
}, null, 8, ["messages", "busy"])
|
|
228
228
|
]),
|
|
@@ -231,16 +231,16 @@ const je = ["aria-busy"], Be = {
|
|
|
231
231
|
"page-count": l.value?.pageCount ?? 0,
|
|
232
232
|
"current-page": p.value,
|
|
233
233
|
messages: d.value,
|
|
234
|
-
busy:
|
|
235
|
-
onGoto:
|
|
234
|
+
busy: a.value || g.value,
|
|
235
|
+
onGoto: A
|
|
236
236
|
}, null, 8, ["page-count", "current-page", "messages", "busy"])
|
|
237
237
|
]),
|
|
238
238
|
_: 1
|
|
239
239
|
}, 8, ["report-id", "messages", "preset", "show-export"])) : $("", !0)
|
|
240
240
|
], 44, je));
|
|
241
241
|
}
|
|
242
|
-
}),
|
|
243
|
-
function
|
|
242
|
+
}), ut = /* @__PURE__ */ Ie(Ve, [["__scopeId", "data-v-69238bdb"]]);
|
|
243
|
+
function lt(e) {
|
|
244
244
|
const t = le(e), o = async (r) => {
|
|
245
245
|
if (r.reportIds.length === 0) throw new Y("缺少报表 ID");
|
|
246
246
|
for (const n of r.reportIds)
|
|
@@ -250,7 +250,10 @@ function ut(e) {
|
|
|
250
250
|
};
|
|
251
251
|
return o.getParamDefs = t.getParamDefs, o;
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
function We() {
|
|
254
|
+
return Object.freeze({ query: "", searching: !1, matchIndex: 0, matchCount: 0, current: null });
|
|
255
|
+
}
|
|
256
|
+
const ze = Object.freeze({
|
|
254
257
|
loading: !1,
|
|
255
258
|
hasPlan: !1,
|
|
256
259
|
pageCount: 0,
|
|
@@ -262,8 +265,8 @@ const We = Object.freeze({
|
|
|
262
265
|
error: null,
|
|
263
266
|
pdfFont: Object.freeze({ status: "unchecked", fontUrl: "" })
|
|
264
267
|
});
|
|
265
|
-
function
|
|
266
|
-
const e = j(null), t = () => e.value?.state ??
|
|
268
|
+
function ft() {
|
|
269
|
+
const e = j(null), t = () => e.value?.state ?? ze, o = Object.freeze({
|
|
267
270
|
get loading() {
|
|
268
271
|
return t().loading;
|
|
269
272
|
},
|
|
@@ -347,8 +350,8 @@ function lt() {
|
|
|
347
350
|
}
|
|
348
351
|
return {
|
|
349
352
|
ref(n) {
|
|
350
|
-
const
|
|
351
|
-
e.value =
|
|
353
|
+
const s = n;
|
|
354
|
+
e.value = s && typeof s.reload == "function" && typeof s.print == "function" && typeof s.exportAs == "function" && typeof s.openPdfWindow == "function" && typeof s.gotoPage == "function" && typeof s.setParams == "function" ? s : null;
|
|
352
355
|
},
|
|
353
356
|
ready: D(() => e.value !== null),
|
|
354
357
|
state: o,
|
|
@@ -380,13 +383,13 @@ function lt() {
|
|
|
380
383
|
gotoPage(n) {
|
|
381
384
|
r().gotoPage(n);
|
|
382
385
|
},
|
|
383
|
-
async setParams(n,
|
|
384
|
-
await r().setParams(n,
|
|
386
|
+
async setParams(n, s) {
|
|
387
|
+
await r().setParams(n, s);
|
|
385
388
|
},
|
|
386
|
-
async importExcel(n,
|
|
389
|
+
async importExcel(n, s) {
|
|
387
390
|
const E = r();
|
|
388
391
|
if (!E.importExcel) throw new S("config", "旧自定义控制器未提供 Excel 导入");
|
|
389
|
-
return E.importExcel(n,
|
|
392
|
+
return E.importExcel(n, s);
|
|
390
393
|
},
|
|
391
394
|
getPlan() {
|
|
392
395
|
return r().getPlan?.() ?? null;
|
|
@@ -399,36 +402,37 @@ function lt() {
|
|
|
399
402
|
redo: async () => await r().redo?.() ?? !1,
|
|
400
403
|
restoreChanges: async () => await r().restoreChanges?.() ?? !1,
|
|
401
404
|
getSelection: () => r().getSelection?.() ?? null,
|
|
402
|
-
|
|
405
|
+
getSearchState: () => r().getSearchState?.() ?? We(),
|
|
406
|
+
focusCell: async (n, s) => await r().focusCell?.(n, s) ?? !1,
|
|
403
407
|
focusField: async (n) => await r().focusField?.(n) ?? !1,
|
|
404
408
|
copySelection: () => r().copySelection?.() ?? "",
|
|
405
409
|
pasteSelection: async (n) => await r().pasteSelection?.(n) ?? !1
|
|
406
410
|
};
|
|
407
411
|
}
|
|
408
|
-
function
|
|
412
|
+
function dt() {
|
|
409
413
|
return be(Oe, null);
|
|
410
414
|
}
|
|
411
415
|
function V(e) {
|
|
412
416
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
413
417
|
}
|
|
414
418
|
function Ge(e) {
|
|
415
|
-
return Array.isArray(e) && e.every((t) => V(t) && typeof t.code == "string" && typeof t.message == "string" && ["info", "warning", "error"].includes(t.severity) && (t.path === void 0 || typeof t.path == "string") &&
|
|
419
|
+
return Array.isArray(e) && e.every((t) => V(t) && typeof t.code == "string" && typeof t.message == "string" && ["info", "warning", "error"].includes(t.severity) && (t.path === void 0 || typeof t.path == "string") && Ae(t));
|
|
416
420
|
}
|
|
417
|
-
function
|
|
421
|
+
function se(e) {
|
|
418
422
|
return typeof e == "number" && Number.isFinite(e) && (!Number.isInteger(e) || Number.isSafeInteger(e));
|
|
419
423
|
}
|
|
420
|
-
function ze(e) {
|
|
421
|
-
return e == null || typeof e == "string" || typeof e == "boolean" || ae(e);
|
|
422
|
-
}
|
|
423
424
|
function He(e) {
|
|
424
|
-
return e
|
|
425
|
+
return e == null || typeof e == "string" || typeof e == "boolean" || se(e);
|
|
425
426
|
}
|
|
426
|
-
function Ke(e
|
|
427
|
-
return
|
|
427
|
+
function Ke(e) {
|
|
428
|
+
return e === void 0 || typeof e == "string" && !!e.trim() || se(e);
|
|
428
429
|
}
|
|
429
430
|
function Ye(e, t) {
|
|
431
|
+
return Array.isArray(e) && e.every((o) => V(o) && Number.isSafeInteger(o.editIndex) && o.editIndex >= 0 && o.editIndex < t && typeof o.code == "string" && typeof o.message == "string" && He(o.currentValue) && Ke(o.revision));
|
|
432
|
+
}
|
|
433
|
+
function Je(e, t) {
|
|
430
434
|
let o;
|
|
431
|
-
if (!V(e) || typeof e.revision != "string" || !e.revision.trim() ? o = "非空 revision(请先在适配器解包业务响应)" : e.sourceToken !== void 0 && typeof e.sourceToken != "string" ? o = "字符串 sourceToken" : e.diagnostics !== void 0 && !Ge(e.diagnostics) ? o = "结构化 diagnostics" : e.conflicts !== void 0 && !
|
|
435
|
+
if (!V(e) || typeof e.revision != "string" || !e.revision.trim() ? o = "非空 revision(请先在适配器解包业务响应)" : e.sourceToken !== void 0 && typeof e.sourceToken != "string" ? o = "字符串 sourceToken" : e.diagnostics !== void 0 && !Ge(e.diagnostics) ? o = "结构化 diagnostics" : e.conflicts !== void 0 && !Ye(e.conflicts, t) && (o = "有效 editIndex/code/message/currentValue/revision conflicts"), o) throw new S("edit", `ReportProvider.save 必须返回${o};服务器可能已提交,请重新查询确认后再编辑`);
|
|
432
436
|
}
|
|
433
437
|
function te(e) {
|
|
434
438
|
return typeof e == "function" ? e() : e;
|
|
@@ -437,49 +441,49 @@ function re(e, t) {
|
|
|
437
441
|
const o = new Set(e.flatMap((r) => r.source?.[t] === void 0 ? [] : [String(r.source[t])]));
|
|
438
442
|
return o.size === 1 ? [...o][0] : void 0;
|
|
439
443
|
}
|
|
440
|
-
function ne(e, t, o, r, n,
|
|
441
|
-
return typeof e == "function" ? e() :
|
|
444
|
+
function ne(e, t, o, r, n, s = !1) {
|
|
445
|
+
return typeof e == "function" ? e() : s ? r ?? n?.[o] ?? re(t, o) ?? e : re(t, o) ?? r ?? e ?? n?.[o];
|
|
442
446
|
}
|
|
443
|
-
function
|
|
447
|
+
function $e(e, t, o) {
|
|
444
448
|
const r = t.query, n = e.reportId === void 0;
|
|
445
449
|
if (n && (!r || r.reportIds.length !== 1)) throw new S("config", "自动业务保存需要当前成功查询的单个报表上下文");
|
|
446
|
-
const
|
|
447
|
-
if (!
|
|
450
|
+
const s = e.reportId === void 0 ? r.reportIds[0] : te(e.reportId);
|
|
451
|
+
if (!s.trim()) throw new S("config", "业务保存缺少报表 ID");
|
|
448
452
|
if (n && new Set(o.map((c) => c.source?.sourceScope)).size > 1) throw new oe("atomic");
|
|
449
|
-
const E = { ...te(e.params ?? r?.params ?? {}) }, d = r?.sources.filter((c) => c.reportId ===
|
|
453
|
+
const E = { ...te(e.params ?? r?.params ?? {}) }, d = r?.sources.filter((c) => c.reportId === s) ?? [], l = d.length === 1 ? d[0] : void 0;
|
|
450
454
|
return {
|
|
451
|
-
reportId:
|
|
455
|
+
reportId: s,
|
|
452
456
|
params: E,
|
|
453
457
|
source: l,
|
|
454
458
|
automatic: n,
|
|
455
|
-
identity: JSON.stringify([
|
|
459
|
+
identity: JSON.stringify([s, E, r?.queryId, r?.sources])
|
|
456
460
|
};
|
|
457
461
|
}
|
|
458
|
-
function
|
|
462
|
+
function Xe(e) {
|
|
459
463
|
return e.requestId ?? globalThis.crypto?.randomUUID?.() ?? `mr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
460
464
|
}
|
|
461
|
-
function
|
|
465
|
+
function Ze(e, t = {}) {
|
|
462
466
|
if (!e.save) throw new S("config", "ReportProvider.save 未配置,无法启用业务保存");
|
|
463
|
-
let o = "", r, n,
|
|
464
|
-
function E(c, p,
|
|
465
|
-
c.conflicts?.length || p !== o ||
|
|
467
|
+
let o = "", r, n, s = 0;
|
|
468
|
+
function E(c, p, a) {
|
|
469
|
+
c.conflicts?.length || p !== o || a !== s || (r = c.revision, c.sourceToken !== void 0 && (n = c.sourceToken));
|
|
466
470
|
}
|
|
467
471
|
async function d(c, p) {
|
|
468
472
|
if (p.signal.aborted) throw p.signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
469
|
-
const { reportId:
|
|
473
|
+
const { reportId: a, params: g, identity: f, source: w, automatic: m } = $e(t, p, c.edits), v = ++s;
|
|
470
474
|
if (f !== o && (o = f, r = void 0, n = void 0), t.requireSource !== !1 && c.edits.some((h) => !h.source)) throw new oe("missing");
|
|
471
475
|
const y = await e.save({
|
|
472
|
-
reportId:
|
|
476
|
+
reportId: a,
|
|
473
477
|
params: g,
|
|
474
478
|
signal: p.signal,
|
|
475
479
|
requestId: c.requestId,
|
|
476
480
|
action: p.action,
|
|
477
|
-
edits:
|
|
481
|
+
edits: x(c.edits),
|
|
478
482
|
expectedRevision: ne(t.expectedRevision, c.edits, "revision", r, w, m),
|
|
479
483
|
sourceToken: ne(t.sourceToken, c.edits, "sourceToken", n, w, m)
|
|
480
484
|
});
|
|
481
485
|
if (p.signal.aborted) throw p.signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
482
|
-
|
|
486
|
+
Je(y, c.edits.length), y.diagnostics?.forEach((h) => Ce(() => t.onDiagnostic?.(h)));
|
|
483
487
|
const b = y.diagnostics?.filter((h) => h.severity === "error");
|
|
484
488
|
if (b?.length) throw new S("edit", b.map((h) => h.message).join(";"), { diagnostics: b });
|
|
485
489
|
const _ = y.conflicts?.map((h) => ({
|
|
@@ -501,66 +505,66 @@ function Xe(e, t = {}) {
|
|
|
501
505
|
validation: t.validation,
|
|
502
506
|
validateBatch: t.validateBatch,
|
|
503
507
|
saveBatch: d,
|
|
504
|
-
save: (c, p) => d({ requestId:
|
|
508
|
+
save: (c, p) => d({ requestId: Xe(p), edits: [x(c)] }, p)
|
|
505
509
|
};
|
|
506
|
-
return pe(l, () =>
|
|
510
|
+
return pe(l, () => Ze(e, t)), l;
|
|
507
511
|
}
|
|
508
512
|
export {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
513
|
+
Ut as DEFAULT_CALCULATION_MESSAGES,
|
|
514
|
+
jt as DEFAULT_DATA_REVIEW_MESSAGES,
|
|
515
|
+
qt as DEFAULT_MESSAGES,
|
|
512
516
|
Bt as DEFAULT_PRINT_MESSAGES,
|
|
513
|
-
|
|
514
|
-
|
|
517
|
+
Vt as DEFAULT_THEME,
|
|
518
|
+
rr as MACH_REPORT_CONFIG_KEY,
|
|
515
519
|
Oe as MACH_REPORT_CONTROLLER_KEY,
|
|
516
|
-
|
|
517
|
-
|
|
520
|
+
nr as MACH_REPORT_FETCHER_KEY,
|
|
521
|
+
or as MACH_REPORT_PDF_EXPORTER_KEY,
|
|
518
522
|
S as MachReportError,
|
|
519
523
|
sr as MachReportPreview,
|
|
520
|
-
|
|
524
|
+
Wt as PARAM_OPTIONS_MESSAGES,
|
|
521
525
|
Y as PlanLoadError,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
+
vt as REPORT_EXPORT_FORMATS,
|
|
527
|
+
yt as REPORT_PREVIEW_TOOLS,
|
|
528
|
+
ht as ReportDataComparisonPanel,
|
|
529
|
+
ut as ReportDocumentPreview,
|
|
526
530
|
ge as ReportExportMenu,
|
|
527
531
|
de as ReportPagination,
|
|
528
|
-
|
|
529
|
-
|
|
532
|
+
zt as ReportParamPanel,
|
|
533
|
+
wt as ReportPrefillPanel,
|
|
530
534
|
fe as ReportPreview,
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
+
Et as ReportPrintResourceError,
|
|
536
|
+
Pt as ReportTaskStatus,
|
|
537
|
+
bt as ReportToolbar,
|
|
538
|
+
Rt as ReportValidationPanel,
|
|
535
539
|
Gt as SILENT_LOGGER,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
Ct as buildPrintDocument,
|
|
541
|
+
St as buildWordHtml,
|
|
542
|
+
_t as createDefaultPdfExporter,
|
|
543
|
+
Tt as createFetchRequest,
|
|
544
|
+
lt as createLocalFetcher,
|
|
545
|
+
xt as createPrintCalibrationPlan,
|
|
546
|
+
Ze as createProviderEditing,
|
|
543
547
|
At as createReportStoragePreferences,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
548
|
+
Ht as defineMachReportConfig,
|
|
549
|
+
Kt as defineMachReportPreset,
|
|
550
|
+
It as joinReportIds,
|
|
551
|
+
ir as machReportPlugin,
|
|
552
|
+
Ot as normalizeReportIds,
|
|
553
|
+
Yt as normalizeReportLoadError,
|
|
554
|
+
Dt as preparePrintResources,
|
|
555
|
+
Jt as printCalibration,
|
|
556
|
+
Mt as printPlans,
|
|
557
|
+
$t as provideMachReportConfig,
|
|
558
|
+
Xt as resolveCalculationMessages,
|
|
555
559
|
_e as resolveConfig,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
560
|
+
Zt as resolveDataReviewMessages,
|
|
561
|
+
Qt as snapshotPrintOptions,
|
|
562
|
+
xe as themeToCssVars,
|
|
563
|
+
er as toErrorDetail,
|
|
564
|
+
ft as useMachReport,
|
|
561
565
|
Se as useMachReportConfig,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
+
kt as usePageWindow,
|
|
567
|
+
Nt as usePrintExport,
|
|
568
|
+
dt as useReportPreview,
|
|
569
|
+
Ft as useZoom
|
|
566
570
|
};
|