@agile-team/mach-report 2.3.0 → 2.3.2
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 +20 -3
- package/dist/ReportPreview-B-mwUSk9.cjs +6 -0
- package/dist/{ReportPreview-CwTGfyTq.js → ReportPreview-DKjr4cwO.js} +628 -619
- package/dist/defaults-D4o0NCLo.js +9 -0
- package/dist/defaults-DOO1yHwx.cjs +1 -0
- package/dist/grid-geometry-Dw7BlENr.js +130 -0
- package/dist/grid-geometry-bkciiZ4Q.cjs +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +1067 -995
- package/dist/pdf.cjs +48 -48
- package/dist/pdf.d.cts +2 -0
- package/dist/pdf.d.ts +2 -0
- package/dist/pdf.js +5525 -5478
- package/dist/{plugin-MSh_OhoW.cjs → plugin-2lqgTX26.cjs} +1 -1
- package/dist/{plugin-uoO9VA6O.js → plugin-5R00MJQs.js} +1 -1
- package/dist/render-plan-CfJ3wf1l.cjs +1 -0
- package/dist/render-plan-I9AHvQv7.js +13 -0
- package/dist/sql.cjs +42 -42
- package/dist/sql.js +1366 -1363
- package/dist/style.css +1 -1
- package/dist/textwrap-nH0UYU6D.js +108 -0
- package/dist/textwrap-oD-t4b4B.cjs +4 -0
- package/dist/vue/async.d.cts +5 -3
- package/dist/vue/async.d.ts +5 -3
- package/dist/vue/index.d.cts +6 -4
- package/dist/vue/index.d.ts +6 -4
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +4 -4
- package/dist/xlsx.cjs +23 -23
- package/dist/xlsx.d.cts +2 -0
- package/dist/xlsx.d.ts +2 -0
- package/dist/xlsx.js +6118 -6085
- package/package.json +1 -1
- package/dist/ReportPreview-CLENbOCL.cjs +0 -6
- package/dist/grid-geometry-CWmJ9c9y.js +0 -130
- package/dist/grid-geometry-DBH9ExuY.cjs +0 -1
- package/dist/textwrap-BQyrpYSR.js +0 -117
- package/dist/textwrap-DqiFwAV3.cjs +0 -3
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { computed as k, unref as x, ref as B, onScopeDispose as He, getCurrentScope as Ht, watch as Q, shallowRef as Ie, defineComponent as rt, nextTick as qt, openBlock as P, createElementBlock as $, createElementVNode as F, toDisplayString as
|
|
1
|
+
import { computed as k, unref as x, ref as B, onScopeDispose as He, getCurrentScope as Ht, watch as Q, shallowRef as Ie, defineComponent as rt, nextTick as qt, openBlock as P, createElementBlock as $, createElementVNode as F, toDisplayString as C, Fragment as Ee, createCommentVNode as H, normalizeClass as oe, renderList as We, createTextVNode as et, withKeys as mt, inject as Be, provide as yt, useCssVars as Nt, watchEffect as vt, onMounted as jt, onUnmounted as Ut, normalizeStyle as re, createBlock as Vt, createVNode as Kt, renderSlot as Yt } from "vue";
|
|
2
2
|
import { renderPlanToImages as Zt, renderPage as xt, validateRenderPlan as Jt, ReportSourceError as Gt, renderPlanToCanvas as Xt } from "@agile-team/mach-report";
|
|
3
3
|
import { c as Pt } from "./page-window-index-CIuT4BAv.js";
|
|
4
|
-
import {
|
|
4
|
+
import { i as Qt, a as _t } from "./render-plan-I9AHvQv7.js";
|
|
5
|
+
import { b as tt, c as en, d as tn, a as nn } from "./plugin-5R00MJQs.js";
|
|
5
6
|
function Et(e) {
|
|
6
7
|
return e == null ? [] : Array.isArray(e) ? e.map(String).filter((t) => t !== "") : String(e).split(",").map((t) => t.trim()).filter((t) => t !== "");
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
+
function yr(e) {
|
|
9
10
|
return Et(e).join(",");
|
|
10
11
|
}
|
|
11
12
|
class _e extends Error {
|
|
@@ -13,14 +14,14 @@ class _e extends Error {
|
|
|
13
14
|
super(t), this.name = "PlanLoadError";
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
const { baseUrl: t = "", headers:
|
|
17
|
+
function xr(e = {}) {
|
|
18
|
+
const { baseUrl: t = "", headers: a, credentials: r, timeoutMs: n = 3e4 } = e, o = t.replace(/\/+$/, "");
|
|
18
19
|
return async ({ url: l, method: u, params: p, signal: m }) => {
|
|
19
|
-
let
|
|
20
|
+
let d = `${o}${l}`;
|
|
20
21
|
if (p && Object.keys(p).length > 0) {
|
|
21
|
-
const b =
|
|
22
|
-
for (const [
|
|
23
|
-
|
|
22
|
+
const b = d.indexOf("#"), I = b >= 0 ? d.slice(b) : "", E = b >= 0 ? d.slice(0, b) : d, D = E.indexOf("?"), S = D >= 0 ? E.slice(0, D) : E, M = new URLSearchParams(D >= 0 ? E.slice(D + 1) : "");
|
|
23
|
+
for (const [q, K] of Object.entries(p)) M.set(q, K);
|
|
24
|
+
d = `${S}?${M}${I}`;
|
|
24
25
|
}
|
|
25
26
|
const f = (b, I) => {
|
|
26
27
|
const E = new _e(b);
|
|
@@ -38,10 +39,10 @@ function vr(e = {}) {
|
|
|
38
39
|
h.signal.aborted || (v = "timeout", h.abort());
|
|
39
40
|
}, n);
|
|
40
41
|
try {
|
|
41
|
-
const b = await fetch(
|
|
42
|
+
const b = await fetch(d, {
|
|
42
43
|
method: u.toUpperCase(),
|
|
43
|
-
headers: { Accept: "application/json", ...
|
|
44
|
-
credentials:
|
|
44
|
+
headers: { Accept: "application/json", ...a },
|
|
45
|
+
credentials: r,
|
|
45
46
|
signal: h.signal
|
|
46
47
|
});
|
|
47
48
|
if (!b.ok)
|
|
@@ -54,19 +55,19 @@ function vr(e = {}) {
|
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
const
|
|
58
|
+
function rn(e, t, a = {}) {
|
|
59
|
+
const r = a.pxPerMm ?? 3.7795275590551185, n = k(() => Math.max(0, x(a.gapPx) ?? 18)), o = B(0), l = B(800), u = k(() => {
|
|
59
60
|
const b = e.value?.pages ?? [];
|
|
60
|
-
return Pt(b.map((I) => I.pageHeightMm *
|
|
61
|
+
return Pt(b.map((I) => I.pageHeightMm * r), n.value);
|
|
61
62
|
}), p = k(() => {
|
|
62
63
|
let b = 0;
|
|
63
|
-
for (const I of e.value?.pages ?? []) b = Math.max(b, I.pageWidthMm *
|
|
64
|
+
for (const I of e.value?.pages ?? []) b = Math.max(b, I.pageWidthMm * r);
|
|
64
65
|
return { w: b, h: u.value.totalHeightPx };
|
|
65
66
|
}), m = k(() => u.value.window(
|
|
66
67
|
l.value / t.value,
|
|
67
|
-
|
|
68
|
-
x(
|
|
69
|
-
)),
|
|
68
|
+
o.value / t.value,
|
|
69
|
+
x(a.overscan) ?? 1
|
|
70
|
+
)), d = k(() => {
|
|
70
71
|
const b = e.value;
|
|
71
72
|
if (!b) return [];
|
|
72
73
|
const { start: I, end: E } = m.value;
|
|
@@ -74,7 +75,7 @@ function tn(e, t, s = {}) {
|
|
|
74
75
|
});
|
|
75
76
|
let f = 0, h = !1;
|
|
76
77
|
function v(b) {
|
|
77
|
-
b && (
|
|
78
|
+
b && (o.value = b.scrollTop, l.value = b.clientHeight || 800);
|
|
78
79
|
}
|
|
79
80
|
function A(b, I) {
|
|
80
81
|
return (E) => {
|
|
@@ -91,219 +92,219 @@ function tn(e, t, s = {}) {
|
|
|
91
92
|
return He(W), {
|
|
92
93
|
contentSize: p,
|
|
93
94
|
windowRange: m,
|
|
94
|
-
visiblePages:
|
|
95
|
+
visiblePages: d,
|
|
95
96
|
makeScrollHandler: A,
|
|
96
97
|
refreshViewport: v,
|
|
97
98
|
pageOffsetPx: (b) => u.value.offsetAt(b),
|
|
98
99
|
destroy: W
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
-
const t = B(1),
|
|
103
|
-
let
|
|
102
|
+
function on(e) {
|
|
103
|
+
const t = B(1), a = B("fit");
|
|
104
|
+
let r = 0;
|
|
104
105
|
function n() {
|
|
105
|
-
|
|
106
|
+
r && cancelAnimationFrame(r), r = 0;
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
-
n(),
|
|
109
|
-
if (
|
|
108
|
+
function o() {
|
|
109
|
+
n(), r = requestAnimationFrame(() => {
|
|
110
|
+
if (r = 0, a.value !== "fit") return;
|
|
110
111
|
const u = e();
|
|
111
112
|
!u?.viewport || u.viewport.clientWidth <= 48 || !Number.isFinite(u.pageWidthPx) || (t.value = Math.min(1, (u.viewport.clientWidth - 48) / Math.max(1, u.pageWidthPx)));
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
115
|
function l(u) {
|
|
115
116
|
if (u === "fit")
|
|
116
|
-
|
|
117
|
+
a.value = "fit", o();
|
|
117
118
|
else {
|
|
118
119
|
if (!Number.isFinite(u)) return;
|
|
119
|
-
n(),
|
|
120
|
+
n(), a.value = "raw", t.value = Math.min(3, Math.max(0.3, u / 100));
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
|
-
return Ht() && He(n), { zoom: t, zoomMode:
|
|
123
|
+
return Ht() && He(n), { zoom: t, zoomMode: a, applyFitZoom: o, setZoom: l };
|
|
123
124
|
}
|
|
124
125
|
const Ae = 8;
|
|
125
126
|
function Le() {
|
|
126
127
|
return new Promise((e) => setTimeout(e, 0));
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
return `p${
|
|
129
|
+
function De(e) {
|
|
130
|
+
return `p${e.pageWidthMm}x${e.pageHeightMm}`.replace(/[.+]/g, "_");
|
|
130
131
|
}
|
|
131
132
|
function ot(e) {
|
|
132
133
|
const t = /* @__PURE__ */ new Map();
|
|
133
134
|
return e.pages.forEach((n) => {
|
|
134
|
-
t.has(
|
|
135
|
+
t.has(De(n)) || t.set(De(n), n);
|
|
135
136
|
}), `<!doctype html><html><head><meta charset="utf-8"><style>${`.mr-page{margin:0 auto;page-break-after:always;}
|
|
136
137
|
.mr-page tr{break-inside:avoid;page-break-inside:avoid;}
|
|
137
138
|
.mr-comp{break-inside:avoid;page-break-inside:avoid;}
|
|
138
139
|
${[...t.values()].map(
|
|
139
|
-
(n) => `@page ${
|
|
140
|
+
(n) => `@page ${De(n)}{size:${n.pageWidthMm}mm ${n.pageHeightMm}mm;margin:0;}`
|
|
140
141
|
).join(`
|
|
141
142
|
`)}
|
|
142
143
|
body{margin:0;background:#fff;}`}</style></head><body>`;
|
|
143
144
|
}
|
|
144
145
|
function at(e) {
|
|
145
146
|
const t = xt(e, 96, {}, document);
|
|
146
|
-
return t.style.page =
|
|
147
|
+
return t.style.page = De(e), t.outerHTML;
|
|
147
148
|
}
|
|
148
149
|
function $t(e) {
|
|
149
150
|
return { head: ot(e), pageChunks: e.pages.map(at) };
|
|
150
151
|
}
|
|
151
|
-
async function
|
|
152
|
-
const
|
|
152
|
+
async function Pr(e, t = {}) {
|
|
153
|
+
const a = {
|
|
153
154
|
schemaVersion: "mach-report-batch-print",
|
|
154
155
|
pages: e.flatMap((l) => l.pages)
|
|
155
156
|
};
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
157
|
+
if (a.pages.length === 0) return;
|
|
158
|
+
const r = ot(a), n = document.createElement("iframe");
|
|
158
159
|
n.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;", document.body.appendChild(n);
|
|
159
|
-
let
|
|
160
|
+
let o = !1;
|
|
160
161
|
try {
|
|
161
162
|
const l = n.contentDocument;
|
|
162
|
-
l.open(), l.write(
|
|
163
|
-
for (let u = 0; u <
|
|
164
|
-
l.write(at(
|
|
165
|
-
l.write("</body></html>"), l.close(), await Le(), t.onProgress?.(
|
|
163
|
+
l.open(), l.write(r);
|
|
164
|
+
for (let u = 0; u < a.pages.length; u++)
|
|
165
|
+
l.write(at(a.pages[u])), u % Ae === Ae - 1 && (t.onProgress?.(u + 1, a.pages.length), await Le());
|
|
166
|
+
l.write("</body></html>"), l.close(), await Le(), t.onProgress?.(a.pages.length, a.pages.length), o = !0, n.contentWindow?.focus(), n.contentWindow?.print();
|
|
166
167
|
} catch (l) {
|
|
167
168
|
t.onError?.(l instanceof Error ? `批量打印失败: ${l.message}` : "批量打印失败");
|
|
168
169
|
} finally {
|
|
169
|
-
|
|
170
|
+
o ? setTimeout(() => n.remove(), 6e4) : n.remove();
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
-
const { head: t, pageChunks:
|
|
173
|
+
function an(e) {
|
|
174
|
+
const { head: t, pageChunks: a } = $t(e);
|
|
174
175
|
return {
|
|
175
|
-
html: `${`<!doctype html><html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head><meta charset="utf-8"><!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View><w:Zoom>100</w:Zoom></w:WordDocument></xml><![endif]-->${t.replace(/^<!doctype html><html><head>/, "")}`}${
|
|
176
|
+
html: `${`<!doctype html><html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head><meta charset="utf-8"><!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View><w:Zoom>100</w:Zoom></w:WordDocument></xml><![endif]-->${t.replace(/^<!doctype html><html><head>/, "")}`}${a.join("")}</body></html>`,
|
|
176
177
|
filename: "mach-report.doc"
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
-
let
|
|
180
|
+
function sn(e, t) {
|
|
181
|
+
let a = null, r = !1, n = !1, o = 0;
|
|
181
182
|
const l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
182
|
-
let p = null, m = null,
|
|
183
|
-
function v(
|
|
184
|
-
return !n && e.value ===
|
|
183
|
+
let p = null, m = null, d = null, f = null, h = null;
|
|
184
|
+
function v(s, c) {
|
|
185
|
+
return !n && e.value === s && o === c;
|
|
185
186
|
}
|
|
186
187
|
function A() {
|
|
187
188
|
if (n) return;
|
|
188
|
-
const
|
|
189
|
-
|
|
189
|
+
const s = [...l.values()].reverse().find((c) => v(c.plan, c.epoch))?.format ?? null;
|
|
190
|
+
s !== p && (p = s, t.onBusy?.(s));
|
|
190
191
|
}
|
|
191
|
-
function W(
|
|
192
|
+
function W(s, c, y) {
|
|
192
193
|
const R = {};
|
|
193
|
-
return l.set(R, { plan:
|
|
194
|
+
return l.set(R, { plan: s, epoch: c, format: y }), A(), R;
|
|
194
195
|
}
|
|
195
|
-
function b(
|
|
196
|
-
l.delete(
|
|
196
|
+
function b(s) {
|
|
197
|
+
l.delete(s), A();
|
|
197
198
|
}
|
|
198
199
|
function I() {
|
|
199
|
-
for (const [
|
|
200
|
-
v(
|
|
200
|
+
for (const [s, c] of u)
|
|
201
|
+
v(c.plan, c.epoch) || (s.close(), u.delete(s));
|
|
201
202
|
}
|
|
202
203
|
const E = Q(e, () => {
|
|
203
|
-
|
|
204
|
+
o++, D(), A(), I();
|
|
204
205
|
}, { flush: "sync" });
|
|
205
206
|
function D() {
|
|
206
|
-
|
|
207
|
+
a?.remove(), a = null;
|
|
207
208
|
}
|
|
208
209
|
function S() {
|
|
209
|
-
n = !0,
|
|
210
|
+
n = !0, o++, E(), D(), I(), l.clear(), t.onPrinting?.(!1);
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
-
const y = URL.createObjectURL(
|
|
212
|
+
function M(s, c) {
|
|
213
|
+
const y = URL.createObjectURL(s);
|
|
213
214
|
setTimeout(() => URL.revokeObjectURL(y), 1e4);
|
|
214
215
|
const R = document.createElement("a");
|
|
215
|
-
R.href = y, R.download =
|
|
216
|
+
R.href = y, R.download = c, R.click();
|
|
216
217
|
}
|
|
217
|
-
async function
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
if (n || !
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
const y = ot(
|
|
224
|
-
|
|
225
|
-
const R =
|
|
218
|
+
async function q() {
|
|
219
|
+
if (r) return;
|
|
220
|
+
const s = e.value;
|
|
221
|
+
if (n || !s || s.pages.length === 0) return;
|
|
222
|
+
const c = o;
|
|
223
|
+
r = !0, t.onPrinting?.(!0), D();
|
|
224
|
+
const y = ot(s);
|
|
225
|
+
a = document.createElement("iframe"), a.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;", document.body.appendChild(a);
|
|
226
|
+
const R = a;
|
|
226
227
|
try {
|
|
227
228
|
const T = R.contentDocument;
|
|
228
229
|
T.open(), T.write(y);
|
|
229
|
-
for (let
|
|
230
|
-
if (T.write(at(
|
|
231
|
-
if (T.write("</body></html>"), T.close(), await Le(), !v(
|
|
230
|
+
for (let U = 0; U < s.pages.length; U++)
|
|
231
|
+
if (T.write(at(s.pages[U])), U % Ae === Ae - 1 && await Le(), R !== a) return;
|
|
232
|
+
if (T.write("</body></html>"), T.close(), await Le(), !v(s, c) || R !== a) return;
|
|
232
233
|
R.contentWindow?.focus(), R.contentWindow?.print();
|
|
233
234
|
} catch {
|
|
234
|
-
R ===
|
|
235
|
+
R === a && D(), v(s, c) && t.onError("调用打印失败,请改用导出 PDF", "print");
|
|
235
236
|
} finally {
|
|
236
|
-
|
|
237
|
+
r = !1, n || t.onPrinting?.(!1);
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
-
if (m?.plan ===
|
|
240
|
+
function K(s, c) {
|
|
241
|
+
if (m?.plan === s && m.epoch === c) return m.promise;
|
|
241
242
|
const y = Promise.resolve().then(() => {
|
|
242
|
-
if (!v(
|
|
243
|
-
return t.getPdfExporter()(
|
|
244
|
-
v(
|
|
243
|
+
if (!v(s, c)) throw new Error("报表已切换或卸载");
|
|
244
|
+
return t.getPdfExporter()(s, (R) => {
|
|
245
|
+
v(s, c) && t.onWarning?.(R);
|
|
245
246
|
});
|
|
246
247
|
}).finally(() => {
|
|
247
248
|
m?.promise === y && (m = null);
|
|
248
249
|
});
|
|
249
|
-
return m = { plan:
|
|
250
|
+
return m = { plan: s, epoch: c, promise: y }, y;
|
|
250
251
|
}
|
|
251
|
-
async function
|
|
252
|
-
const
|
|
253
|
-
if (n || !
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
const y = W(
|
|
252
|
+
async function V() {
|
|
253
|
+
const s = e.value;
|
|
254
|
+
if (n || !s || s.pages.length === 0) return;
|
|
255
|
+
const c = o;
|
|
256
|
+
if (d?.plan === s && d.epoch === c) return d.promise;
|
|
257
|
+
const y = W(s, c, "PDF"), R = (async () => {
|
|
257
258
|
try {
|
|
258
|
-
const T = await
|
|
259
|
-
if (!v(
|
|
260
|
-
|
|
259
|
+
const T = await K(s, c);
|
|
260
|
+
if (!v(s, c)) return;
|
|
261
|
+
M(new Blob([T], { type: "application/pdf" }), "mach-report.pdf");
|
|
261
262
|
} catch (T) {
|
|
262
|
-
v(
|
|
263
|
+
v(s, c) && t.onError(T instanceof Error ? `PDF 导出失败: ${T.message}` : "PDF 导出失败", "pdf");
|
|
263
264
|
} finally {
|
|
264
|
-
b(y),
|
|
265
|
+
b(y), d?.token === y && (d = null);
|
|
265
266
|
}
|
|
266
267
|
})();
|
|
267
|
-
return
|
|
268
|
+
return d = { plan: s, epoch: c, promise: R, token: y }, R;
|
|
268
269
|
}
|
|
269
270
|
async function Y() {
|
|
270
|
-
const
|
|
271
|
-
if (n || !
|
|
272
|
-
const
|
|
273
|
-
if (f?.plan ===
|
|
274
|
-
const y = { ...t.getXlsxOptions?.() }, R = W(
|
|
271
|
+
const s = e.value;
|
|
272
|
+
if (n || !s || s.pages.length === 0) return;
|
|
273
|
+
const c = o;
|
|
274
|
+
if (f?.plan === s && f.epoch === c) return f.promise;
|
|
275
|
+
const y = { ...t.getXlsxOptions?.() }, R = W(s, c, "Excel"), T = (async () => {
|
|
275
276
|
try {
|
|
276
|
-
const { renderPlanToXlsx:
|
|
277
|
-
if (!v(
|
|
278
|
-
const { buffer: J, warnings: G } = await
|
|
279
|
-
if (!v(
|
|
280
|
-
|
|
277
|
+
const { renderPlanToXlsx: U } = await import("@agile-team/mach-report/xlsx");
|
|
278
|
+
if (!v(s, c)) return;
|
|
279
|
+
const { buffer: J, warnings: G } = await U(s, y);
|
|
280
|
+
if (!v(s, c) || (G.length > 0 && t.onWarning?.(`Excel 导出有 ${G.length} 条提示:${G.slice(0, 2).join(";")}`), !v(s, c))) return;
|
|
281
|
+
M(new Blob([J], {
|
|
281
282
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
282
283
|
}), "mach-report.xlsx");
|
|
283
|
-
} catch (
|
|
284
|
-
v(
|
|
284
|
+
} catch (U) {
|
|
285
|
+
v(s, c) && t.onError(U instanceof Error ? `Excel 导出失败: ${U.message}` : "Excel 导出失败", "export");
|
|
285
286
|
} finally {
|
|
286
287
|
b(R), f?.token === R && (f = null);
|
|
287
288
|
}
|
|
288
289
|
})();
|
|
289
|
-
return f = { plan:
|
|
290
|
+
return f = { plan: s, epoch: c, promise: T, token: R }, T;
|
|
290
291
|
}
|
|
291
292
|
async function O() {
|
|
292
|
-
const
|
|
293
|
-
if (n || !
|
|
294
|
-
const
|
|
295
|
-
if (h?.plan ===
|
|
296
|
-
const y = W(
|
|
293
|
+
const s = e.value;
|
|
294
|
+
if (n || !s || s.pages.length === 0) return;
|
|
295
|
+
const c = o;
|
|
296
|
+
if (h?.plan === s && h.epoch === c) return h.promise;
|
|
297
|
+
const y = W(s, c, "图片"), R = (async () => {
|
|
297
298
|
try {
|
|
298
|
-
const { blobs: T } = await Zt(
|
|
299
|
+
const { blobs: T } = await Zt(s, {
|
|
299
300
|
dpr: Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1)
|
|
300
301
|
});
|
|
301
|
-
if (!v(
|
|
302
|
-
T.forEach((
|
|
303
|
-
|
|
302
|
+
if (!v(s, c)) return;
|
|
303
|
+
T.forEach((U, J) => {
|
|
304
|
+
M(U, T.length > 1 ? `mach-report-page-${J + 1}.png` : "mach-report.png");
|
|
304
305
|
});
|
|
305
306
|
} catch (T) {
|
|
306
|
-
v(
|
|
307
|
+
v(s, c) && t.onError(
|
|
307
308
|
T instanceof Error ? `图片导出失败: ${T.message}` : "图片导出失败",
|
|
308
309
|
"export"
|
|
309
310
|
);
|
|
@@ -311,201 +312,212 @@ function on(e, t) {
|
|
|
311
312
|
b(y), h?.token === y && (h = null);
|
|
312
313
|
}
|
|
313
314
|
})();
|
|
314
|
-
return h = { plan:
|
|
315
|
+
return h = { plan: s, epoch: c, promise: R, token: y }, R;
|
|
315
316
|
}
|
|
316
317
|
function ae() {
|
|
317
|
-
const
|
|
318
|
-
if (!(n || !
|
|
318
|
+
const s = e.value;
|
|
319
|
+
if (!(n || !s || s.pages.length === 0))
|
|
319
320
|
try {
|
|
320
|
-
const { html:
|
|
321
|
-
|
|
322
|
-
} catch (
|
|
321
|
+
const { html: c, filename: y } = an(s);
|
|
322
|
+
M(new Blob([c], { type: "application/msword;charset=utf-8" }), y);
|
|
323
|
+
} catch (c) {
|
|
323
324
|
t.onError(
|
|
324
|
-
|
|
325
|
+
c instanceof Error ? `Word 导出失败: ${c.message}` : "Word 导出失败",
|
|
325
326
|
"export"
|
|
326
327
|
);
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
|
-
async function ee(
|
|
330
|
-
const
|
|
331
|
-
if (!(n || !
|
|
332
|
-
if (
|
|
333
|
-
await
|
|
330
|
+
async function ee(s) {
|
|
331
|
+
const c = e.value;
|
|
332
|
+
if (!(n || !c || c.pages.length === 0)) {
|
|
333
|
+
if (s === "pdf") {
|
|
334
|
+
await V();
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
336
|
-
if (
|
|
337
|
+
if (s === "xlsx" || s === "excel") {
|
|
337
338
|
await Y();
|
|
338
339
|
return;
|
|
339
340
|
}
|
|
340
|
-
if (
|
|
341
|
+
if (s === "png" || s === "image") {
|
|
341
342
|
await O();
|
|
342
343
|
return;
|
|
343
344
|
}
|
|
344
|
-
if (
|
|
345
|
+
if (s === "word" || s === "doc") {
|
|
345
346
|
ae();
|
|
346
347
|
return;
|
|
347
348
|
}
|
|
348
|
-
if (
|
|
349
|
-
t.onError(`不支持的导出格式:${
|
|
349
|
+
if (s !== "html") {
|
|
350
|
+
t.onError(`不支持的导出格式:${s}`, "export");
|
|
350
351
|
return;
|
|
351
352
|
}
|
|
352
353
|
try {
|
|
353
|
-
const { head: y, pageChunks: R } = $t(
|
|
354
|
-
|
|
354
|
+
const { head: y, pageChunks: R } = $t(c), T = `${y}${R.join("")}</body></html>`;
|
|
355
|
+
M(new Blob([T], { type: "text/html;charset=utf-8" }), "mach-report.html");
|
|
355
356
|
} catch (y) {
|
|
356
357
|
t.onError(y instanceof Error ? `HTML 导出失败: ${y.message}` : "HTML 导出失败", "export");
|
|
357
358
|
}
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
-
const
|
|
362
|
-
if (n || !
|
|
363
|
-
const
|
|
361
|
+
function pe() {
|
|
362
|
+
const s = e.value;
|
|
363
|
+
if (n || !s || s.pages.length === 0) return;
|
|
364
|
+
const c = o, y = window.open("", "_blank");
|
|
364
365
|
if (!y) {
|
|
365
366
|
t.onError("浏览器拦截了弹窗,请允许弹窗后重试", "pdf");
|
|
366
367
|
return;
|
|
367
368
|
}
|
|
368
|
-
u.set(y, { plan:
|
|
369
|
-
const R = W(
|
|
370
|
-
|
|
371
|
-
if (!v(
|
|
369
|
+
u.set(y, { plan: s, epoch: c });
|
|
370
|
+
const R = W(s, c, "PDF");
|
|
371
|
+
K(s, c).then((T) => {
|
|
372
|
+
if (!v(s, c) || y.closed) {
|
|
372
373
|
u.delete(y) && y.close();
|
|
373
374
|
return;
|
|
374
375
|
}
|
|
375
|
-
const
|
|
376
|
-
setTimeout(() => URL.revokeObjectURL(
|
|
376
|
+
const U = URL.createObjectURL(new Blob([T], { type: "application/pdf" }));
|
|
377
|
+
setTimeout(() => URL.revokeObjectURL(U), 6e4);
|
|
377
378
|
const J = y.document;
|
|
378
379
|
J.title = "PDF 预览", J.documentElement.style.height = "100%", J.body.style.cssText = "margin:0;height:100%;";
|
|
379
380
|
const G = J.createElement("iframe");
|
|
380
|
-
G.title = "PDF 预览", G.style.cssText = "display:block;width:100%;height:100%;border:0;", G.src =
|
|
381
|
+
G.title = "PDF 预览", G.style.cssText = "display:block;width:100%;height:100%;border:0;", G.src = U, J.body.replaceChildren(G), u.delete(y);
|
|
381
382
|
}).catch((T) => {
|
|
382
|
-
y.close(), u.delete(y), v(
|
|
383
|
+
y.close(), u.delete(y), v(s, c) && t.onError(T instanceof Error ? `PDF 预览失败: ${T.message}` : "PDF 预览失败", "pdf");
|
|
383
384
|
}).finally(() => b(R));
|
|
384
385
|
}
|
|
385
386
|
return {
|
|
386
|
-
print:
|
|
387
|
+
print: q,
|
|
387
388
|
exportAs: ee,
|
|
388
389
|
exportImages: O,
|
|
389
390
|
exportWord: ae,
|
|
390
|
-
openPdfWindow:
|
|
391
|
+
openPdfWindow: pe,
|
|
391
392
|
releasePrintFrame: D,
|
|
392
393
|
dispose: S
|
|
393
394
|
};
|
|
394
395
|
}
|
|
395
396
|
const kt = "mrp-hit";
|
|
396
|
-
function
|
|
397
|
-
e.querySelectorAll(`mark.${kt}`).forEach((
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
400
|
-
for (;
|
|
401
|
-
|
|
397
|
+
function ln(e) {
|
|
398
|
+
e.querySelectorAll(`mark.${kt}`).forEach((a) => {
|
|
399
|
+
const r = a.parentNode;
|
|
400
|
+
if (r) {
|
|
401
|
+
for (; a.firstChild; ) r.insertBefore(a.firstChild, a);
|
|
402
|
+
a.remove(), r.normalize();
|
|
402
403
|
}
|
|
403
404
|
});
|
|
404
405
|
}
|
|
405
|
-
function
|
|
406
|
-
const
|
|
407
|
-
if (!
|
|
408
|
-
const
|
|
406
|
+
function un(e, t) {
|
|
407
|
+
const a = t.trim();
|
|
408
|
+
if (!a) return 0;
|
|
409
|
+
const r = a.toLowerCase(), n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, {
|
|
409
410
|
acceptNode(u) {
|
|
410
411
|
const p = u.parentElement;
|
|
411
|
-
return !p || p.closest("mark") || /^(SCRIPT|STYLE)$/.test(p.tagName) ? NodeFilter.FILTER_REJECT : (u.nodeValue ?? "").toLowerCase().includes(
|
|
412
|
+
return !p || p.closest("mark") || /^(SCRIPT|STYLE)$/.test(p.tagName) ? NodeFilter.FILTER_REJECT : (u.nodeValue ?? "").toLowerCase().includes(r) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
|
412
413
|
}
|
|
413
|
-
}),
|
|
414
|
-
for (let u = n.nextNode(); u; u = n.nextNode())
|
|
414
|
+
}), o = [];
|
|
415
|
+
for (let u = n.nextNode(); u; u = n.nextNode()) o.push(u);
|
|
415
416
|
let l = 0;
|
|
416
|
-
for (const u of
|
|
417
|
-
const p = u.nodeValue ?? "", m = p.toLowerCase(),
|
|
418
|
-
if (!
|
|
417
|
+
for (const u of o) {
|
|
418
|
+
const p = u.nodeValue ?? "", m = p.toLowerCase(), d = u.parentElement;
|
|
419
|
+
if (!d) continue;
|
|
419
420
|
const f = document.createDocumentFragment();
|
|
420
|
-
let h = 0, v = m.indexOf(
|
|
421
|
+
let h = 0, v = m.indexOf(r);
|
|
421
422
|
for (; v >= 0; ) {
|
|
422
423
|
v > h && f.appendChild(document.createTextNode(p.slice(h, v)));
|
|
423
424
|
const A = document.createElement("mark");
|
|
424
|
-
A.className = kt, A.textContent = p.slice(v, v +
|
|
425
|
+
A.className = kt, A.textContent = p.slice(v, v + a.length), f.appendChild(A), l++, h = v + a.length, v = m.indexOf(r, h);
|
|
425
426
|
}
|
|
426
|
-
h < p.length && f.appendChild(document.createTextNode(p.slice(h))),
|
|
427
|
+
h < p.length && f.appendChild(document.createTextNode(p.slice(h))), d.replaceChild(f, u);
|
|
427
428
|
}
|
|
428
429
|
return l;
|
|
429
430
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
const cn = /* @__PURE__ */ new Set(["line", "rect", "ellipse", "chart"]);
|
|
432
|
+
function* dn(e) {
|
|
433
|
+
for (const t of e.cells ?? [])
|
|
434
|
+
for (const a of t ?? [])
|
|
435
|
+
yield a?.text ?? "", yield* a?.children ?? [];
|
|
436
|
+
}
|
|
437
|
+
function* fn(e) {
|
|
438
|
+
if (_t(e))
|
|
439
|
+
for (const t of e.richParagraphs)
|
|
440
|
+
for (const a of t.segments ?? [])
|
|
441
|
+
yield (a.kind === "field" ? a.field : a.text) ?? "";
|
|
442
|
+
else e.lines?.length ? yield* e.lines : yield e.text ?? "";
|
|
435
443
|
}
|
|
436
|
-
function*
|
|
437
|
-
const t = [
|
|
444
|
+
function* pn(e) {
|
|
445
|
+
const t = [e.values()];
|
|
438
446
|
for (; t.length > 0; ) {
|
|
439
|
-
const
|
|
440
|
-
if (
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
else s.lines?.length ? yield* s.lines : yield s.text ?? "";
|
|
451
|
-
yield "";
|
|
447
|
+
const a = t[t.length - 1].next();
|
|
448
|
+
if (a.done) {
|
|
449
|
+
t.pop();
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
const r = a.value;
|
|
453
|
+
if (typeof r == "string") {
|
|
454
|
+
yield r;
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
yield "", !Qt(r) && (r.kind === "text" ? t.push(fn(r)) : r.grid ? t.push(dn(r.grid)) : cn.has(r.kind) || (yield r.fallbackText ?? ""));
|
|
452
458
|
}
|
|
453
459
|
}
|
|
454
|
-
function*
|
|
460
|
+
function* mn(e) {
|
|
455
461
|
for (let t = 0; t < e.pages.length; t++) {
|
|
456
|
-
for (const
|
|
462
|
+
for (const a of pn(e.pages[t].components)) yield { text: a, pageIndex: t };
|
|
457
463
|
yield { text: "", pageIndex: t };
|
|
458
464
|
}
|
|
459
465
|
}
|
|
460
|
-
function
|
|
461
|
-
const
|
|
462
|
-
let
|
|
466
|
+
function vn(e, t) {
|
|
467
|
+
const a = e.toLowerCase();
|
|
468
|
+
let r = 0;
|
|
469
|
+
for (let n = a.indexOf(t); n >= 0; n = a.indexOf(t, n + t.length)) r++;
|
|
470
|
+
return r;
|
|
471
|
+
}
|
|
472
|
+
function hn(e) {
|
|
473
|
+
const { plan: t, gotoPage: a, highlight: r, clearHighlights: n } = e, o = B(!1), l = B(""), u = B(0), p = B(0), m = B(!1);
|
|
474
|
+
let d = [];
|
|
463
475
|
const f = k(() => {
|
|
464
476
|
if (p.value === 0) return null;
|
|
465
477
|
const S = u.value;
|
|
466
|
-
let
|
|
467
|
-
for (;
|
|
468
|
-
const
|
|
469
|
-
|
|
478
|
+
let M = 0, q = d.length - 1;
|
|
479
|
+
for (; M < q; ) {
|
|
480
|
+
const V = M + q >>> 1;
|
|
481
|
+
d[V].cumulative <= S ? M = V + 1 : q = V;
|
|
470
482
|
}
|
|
471
|
-
const
|
|
472
|
-
return
|
|
483
|
+
const K = d[M];
|
|
484
|
+
return K ? { pageIndex: K.pageIndex, occurrence: S - (d[M - 1]?.cumulative ?? 0) } : null;
|
|
473
485
|
});
|
|
474
486
|
let h = null, v = null, A = 0;
|
|
475
487
|
function W() {
|
|
476
488
|
A++, h && clearTimeout(h), v && clearTimeout(v), h = v = null, m.value = !1;
|
|
477
489
|
}
|
|
478
490
|
function b(S) {
|
|
479
|
-
l.value = S, u.value = 0, p.value = 0,
|
|
480
|
-
const
|
|
481
|
-
if (!
|
|
491
|
+
l.value = S, u.value = 0, p.value = 0, d = [], m.value = !1;
|
|
492
|
+
const M = S.trim().toLowerCase(), q = t.value;
|
|
493
|
+
if (!M || !q) return;
|
|
482
494
|
m.value = !0;
|
|
483
|
-
const
|
|
495
|
+
const K = A, V = mn(q), Y = [];
|
|
484
496
|
let O = 0;
|
|
485
497
|
function ae() {
|
|
486
|
-
if (v = null,
|
|
498
|
+
if (v = null, K !== A || q !== t.value) return;
|
|
487
499
|
const ee = performance.now();
|
|
488
|
-
let
|
|
489
|
-
for (;
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
492
|
-
|
|
500
|
+
let pe = 0;
|
|
501
|
+
for (; pe < 5e3 && performance.now() - ee < 4; ) {
|
|
502
|
+
const s = V.next();
|
|
503
|
+
if (s.done) {
|
|
504
|
+
d = Y, p.value = O, m.value = !1, d[0] && a(d[0].pageIndex + 1);
|
|
493
505
|
return;
|
|
494
506
|
}
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
O +=
|
|
507
|
+
const c = vn(s.value.text, M);
|
|
508
|
+
if (c > 0) {
|
|
509
|
+
O += c;
|
|
498
510
|
const y = Y[Y.length - 1];
|
|
499
|
-
y?.pageIndex ===
|
|
511
|
+
y?.pageIndex === s.value.pageIndex ? y.cumulative = O : Y.push({ pageIndex: s.value.pageIndex, cumulative: O });
|
|
500
512
|
}
|
|
501
|
-
|
|
513
|
+
pe++;
|
|
502
514
|
}
|
|
503
515
|
v = setTimeout(ae, 0);
|
|
504
516
|
}
|
|
505
517
|
ae();
|
|
506
518
|
}
|
|
507
519
|
function I(S) {
|
|
508
|
-
if (W(), l.value = S, u.value = p.value = 0,
|
|
520
|
+
if (W(), l.value = S, u.value = p.value = 0, d = [], !S.trim()) {
|
|
509
521
|
b("");
|
|
510
522
|
return;
|
|
511
523
|
}
|
|
@@ -514,33 +526,29 @@ function dn(e) {
|
|
|
514
526
|
}, Math.max(0, x(e.debounceMs) ?? 200));
|
|
515
527
|
}
|
|
516
528
|
function E(S) {
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
519
|
-
u.value = (u.value + S +
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const q = H + j >>> 1;
|
|
523
|
-
c[q].cumulative <= u.value ? H = q + 1 : j = q;
|
|
524
|
-
}
|
|
525
|
-
s(c[H].pageIndex + 1);
|
|
529
|
+
const M = p.value;
|
|
530
|
+
if (M === 0 || m.value) return;
|
|
531
|
+
u.value = (u.value + S + M) % M;
|
|
532
|
+
const q = f.value;
|
|
533
|
+
q && a(q.pageIndex + 1);
|
|
526
534
|
}
|
|
527
535
|
function D() {
|
|
528
|
-
W(), l.value = "", u.value = p.value = 0,
|
|
536
|
+
W(), l.value = "", u.value = p.value = 0, d = [];
|
|
529
537
|
}
|
|
530
538
|
return Q(t, D, { flush: "sync" }), He(D), {
|
|
531
|
-
visible:
|
|
539
|
+
visible: o,
|
|
532
540
|
query: l,
|
|
533
541
|
matchIndex: u,
|
|
534
542
|
matchCount: p,
|
|
535
543
|
activeMatch: f,
|
|
536
544
|
searching: m,
|
|
537
545
|
toggle: () => {
|
|
538
|
-
|
|
546
|
+
o.value = !o.value;
|
|
539
547
|
},
|
|
540
548
|
onInput: I,
|
|
541
549
|
onNav: E,
|
|
542
550
|
apply: (S) => {
|
|
543
|
-
l.value.trim() &&
|
|
551
|
+
l.value.trim() && r(S, l.value.trim());
|
|
544
552
|
},
|
|
545
553
|
clear: (S) => {
|
|
546
554
|
n(S);
|
|
@@ -548,8 +556,8 @@ function dn(e) {
|
|
|
548
556
|
reset: D
|
|
549
557
|
};
|
|
550
558
|
}
|
|
551
|
-
function
|
|
552
|
-
const
|
|
559
|
+
function gn(e, t) {
|
|
560
|
+
const a = k(() => {
|
|
553
561
|
if (e.value) return !0;
|
|
554
562
|
if (typeof location > "u") return !1;
|
|
555
563
|
try {
|
|
@@ -557,27 +565,27 @@ function fn(e, t) {
|
|
|
557
565
|
} catch {
|
|
558
566
|
return !1;
|
|
559
567
|
}
|
|
560
|
-
}),
|
|
568
|
+
}), r = k(() => !a.value || !t.plan.value ? 0 : Math.round(JSON.stringify(t.plan.value).length / 1024)), n = k(() => !a.value || !t.plan.value ? null : {
|
|
561
569
|
pages: t.pageCount.value,
|
|
562
570
|
window: `${t.windowRange.value.start}-${t.windowRange.value.end}`,
|
|
563
571
|
zoom: `${Math.round(t.zoom.value * 100)}%`,
|
|
564
572
|
loadMs: `${t.loadMs.value}ms`,
|
|
565
|
-
planKB:
|
|
573
|
+
planKB: r.value
|
|
566
574
|
});
|
|
567
|
-
return { enabled:
|
|
575
|
+
return { enabled: a, debugStats: n };
|
|
568
576
|
}
|
|
569
|
-
function
|
|
570
|
-
const { thumbsRoot:
|
|
577
|
+
function bn(e, t) {
|
|
578
|
+
const { thumbsRoot: a, visible: r, renderThumbCanvas: n } = t, o = B(0), l = B(800), u = k(() => (e.value?.pages ?? []).map(
|
|
571
579
|
(E) => Math.round(E.pageHeightMm / E.pageWidthMm * 116)
|
|
572
|
-
)), p = k(() => Pt(u.value.map((E) => E + 20), 8)), m = k(() => p.value.window(l.value,
|
|
573
|
-
if (!
|
|
580
|
+
)), p = k(() => Pt(u.value.map((E) => E + 20), 8)), m = k(() => p.value.window(l.value, o.value, 1)), d = k(() => {
|
|
581
|
+
if (!r.value) return [];
|
|
574
582
|
const { start: E, end: D } = m.value;
|
|
575
|
-
return u.value.slice(E, D + 1).map((S,
|
|
583
|
+
return u.value.slice(E, D + 1).map((S, M) => ({ index: E + M, height: S }));
|
|
576
584
|
});
|
|
577
585
|
let f = 0, h = 0, v = !1;
|
|
578
586
|
function A() {
|
|
579
|
-
const E =
|
|
580
|
-
E && (
|
|
587
|
+
const E = a.value;
|
|
588
|
+
E && (o.value = E.scrollTop, l.value = E.clientHeight || 800);
|
|
581
589
|
}
|
|
582
590
|
function W() {
|
|
583
591
|
v || h || (h = requestAnimationFrame(() => {
|
|
@@ -585,29 +593,29 @@ function pn(e, t) {
|
|
|
585
593
|
}));
|
|
586
594
|
}
|
|
587
595
|
function b() {
|
|
588
|
-
if (
|
|
596
|
+
if (d.value, f && cancelAnimationFrame(f), f = 0, v || !r.value || !e.value || !a.value) return;
|
|
589
597
|
A();
|
|
590
|
-
const E =
|
|
591
|
-
let
|
|
592
|
-
function
|
|
593
|
-
if (f = 0, !(v || !
|
|
594
|
-
for (let
|
|
595
|
-
const
|
|
598
|
+
const E = d.value, D = e.value, S = a.value;
|
|
599
|
+
let M = 0;
|
|
600
|
+
function q() {
|
|
601
|
+
if (f = 0, !(v || !r.value || e.value !== D || a.value !== S)) {
|
|
602
|
+
for (let K = 0; M < E.length && K < 2; K++, M++) {
|
|
603
|
+
const V = E[M].index, Y = S.querySelector(`[data-thumb="${V + 1}"]`);
|
|
596
604
|
if (!Y || Y.childElementCount > 0) continue;
|
|
597
|
-
const O = n(
|
|
605
|
+
const O = n(V);
|
|
598
606
|
O && (O.style.width = "100%", O.style.height = "100%", O.style.display = "block", Y.appendChild(O));
|
|
599
607
|
}
|
|
600
|
-
|
|
608
|
+
M < E.length && (f = requestAnimationFrame(q));
|
|
601
609
|
}
|
|
602
610
|
}
|
|
603
|
-
f = requestAnimationFrame(
|
|
611
|
+
f = requestAnimationFrame(q);
|
|
604
612
|
}
|
|
605
613
|
function I() {
|
|
606
614
|
v = !0, f && cancelAnimationFrame(f), h && cancelAnimationFrame(h), f = h = 0;
|
|
607
615
|
}
|
|
608
|
-
return He(I), { schedule: b, destroy: I, onScroll: W, windowRange: m, visibleThumbs:
|
|
616
|
+
return He(I), { schedule: b, destroy: I, onScroll: W, windowRange: m, visibleThumbs: d };
|
|
609
617
|
}
|
|
610
|
-
function
|
|
618
|
+
function wn() {
|
|
611
619
|
const e = Ie(0);
|
|
612
620
|
return {
|
|
613
621
|
loadMs: e,
|
|
@@ -619,14 +627,14 @@ function mn() {
|
|
|
619
627
|
}
|
|
620
628
|
};
|
|
621
629
|
}
|
|
622
|
-
const
|
|
630
|
+
const yn = { class: "mrp-toolbar" }, xn = { class: "mrp-title" }, Pn = ["disabled"], En = { class: "mrp-pageinfo" }, $n = ["disabled"], kn = {
|
|
623
631
|
key: 1,
|
|
624
632
|
class: "mrp-search"
|
|
625
|
-
},
|
|
633
|
+
}, Cn = ["placeholder", "value"], Mn = {
|
|
626
634
|
key: 0,
|
|
627
635
|
class: "mrp-search-count",
|
|
628
636
|
role: "status"
|
|
629
|
-
},
|
|
637
|
+
}, Fn = ["disabled"], Rn = ["disabled"], Tn = /* @__PURE__ */ rt({
|
|
630
638
|
__name: "ReportToolbar",
|
|
631
639
|
props: {
|
|
632
640
|
pageCount: {},
|
|
@@ -642,141 +650,141 @@ const vn = { class: "mrp-toolbar" }, hn = { class: "mrp-title" }, gn = ["disable
|
|
|
642
650
|
},
|
|
643
651
|
emits: ["goto", "zoom", "export", "print", "pdf-window", "search-input", "search-nav", "search-toggle", "thumbs-toggle"],
|
|
644
652
|
setup(e) {
|
|
645
|
-
const t = e,
|
|
653
|
+
const t = e, a = B(null);
|
|
646
654
|
Q(
|
|
647
655
|
() => t.search.visible,
|
|
648
656
|
(n) => {
|
|
649
|
-
n && qt(() =>
|
|
657
|
+
n && qt(() => a.value?.focus());
|
|
650
658
|
}
|
|
651
659
|
);
|
|
652
|
-
function
|
|
653
|
-
return n.replace("{cur}", String(
|
|
660
|
+
function r(n, o, l) {
|
|
661
|
+
return n.replace("{cur}", String(o)).replace("{total}", String(l));
|
|
654
662
|
}
|
|
655
|
-
return (n,
|
|
656
|
-
F("span",
|
|
663
|
+
return (n, o) => (P(), $("div", yn, [
|
|
664
|
+
F("span", xn, C(e.messages.title), 1),
|
|
657
665
|
e.pageCount > 0 ? (P(), $(Ee, { key: 0 }, [
|
|
658
666
|
F("button", {
|
|
659
667
|
class: "mrp-nav",
|
|
660
668
|
type: "button",
|
|
661
669
|
disabled: e.currentPage <= 1,
|
|
662
|
-
onClick:
|
|
663
|
-
},
|
|
664
|
-
F("span",
|
|
670
|
+
onClick: o[0] || (o[0] = (l) => n.$emit("goto", e.currentPage - 1))
|
|
671
|
+
}, C(e.messages.prevPage), 9, Pn),
|
|
672
|
+
F("span", En, C(r(e.messages.pageInfo, e.currentPage, e.pageCount)), 1),
|
|
665
673
|
F("button", {
|
|
666
674
|
class: "mrp-nav",
|
|
667
675
|
type: "button",
|
|
668
676
|
disabled: e.currentPage >= e.pageCount,
|
|
669
|
-
onClick:
|
|
670
|
-
},
|
|
671
|
-
], 64)) :
|
|
672
|
-
|
|
673
|
-
e.search.visible ? (P(), $("div",
|
|
677
|
+
onClick: o[1] || (o[1] = (l) => n.$emit("goto", e.currentPage + 1))
|
|
678
|
+
}, C(e.messages.nextPage), 9, $n)
|
|
679
|
+
], 64)) : H("", !0),
|
|
680
|
+
o[17] || (o[17] = F("span", { class: "mrp-spacer" }, null, -1)),
|
|
681
|
+
e.search.visible ? (P(), $("div", kn, [
|
|
674
682
|
F("input", {
|
|
675
683
|
ref_key: "searchInputRef",
|
|
676
|
-
ref:
|
|
684
|
+
ref: a,
|
|
677
685
|
class: "mrp-search-input",
|
|
678
686
|
type: "text",
|
|
679
687
|
placeholder: e.messages.searchPlaceholder,
|
|
680
688
|
value: e.search.query,
|
|
681
|
-
onInput:
|
|
682
|
-
}, null, 40,
|
|
683
|
-
e.search.query ? (P(), $("span",
|
|
689
|
+
onInput: o[2] || (o[2] = (l) => n.$emit("search-input", l.target.value))
|
|
690
|
+
}, null, 40, Cn),
|
|
691
|
+
e.search.query ? (P(), $("span", Mn, C(e.search.searching ? e.messages.searching ?? "搜索中…" : r(e.messages.matchInfo, e.search.matchCount > 0 ? e.search.matchIndex + 1 : 0, e.search.matchCount)), 1)) : H("", !0),
|
|
684
692
|
F("button", {
|
|
685
693
|
class: "mrp-nav",
|
|
686
694
|
type: "button",
|
|
687
695
|
disabled: e.search.matchCount === 0,
|
|
688
|
-
onClick:
|
|
689
|
-
},
|
|
696
|
+
onClick: o[3] || (o[3] = (l) => n.$emit("search-nav", -1))
|
|
697
|
+
}, C(e.messages.prevMatch), 9, Fn),
|
|
690
698
|
F("button", {
|
|
691
699
|
class: "mrp-nav",
|
|
692
700
|
type: "button",
|
|
693
701
|
disabled: e.search.matchCount === 0,
|
|
694
|
-
onClick:
|
|
695
|
-
},
|
|
696
|
-
])) :
|
|
702
|
+
onClick: o[4] || (o[4] = (l) => n.$emit("search-nav", 1))
|
|
703
|
+
}, C(e.messages.nextMatch), 9, Rn)
|
|
704
|
+
])) : H("", !0),
|
|
697
705
|
F("button", {
|
|
698
706
|
class: oe(["mrp-nav", { "mrp-active": e.search.visible }]),
|
|
699
707
|
type: "button",
|
|
700
708
|
title: "Ctrl+F",
|
|
701
|
-
onClick:
|
|
709
|
+
onClick: o[5] || (o[5] = (l) => n.$emit("search-toggle"))
|
|
702
710
|
}, " 🔍 ", 2),
|
|
703
711
|
F("button", {
|
|
704
712
|
class: oe(["mrp-nav", { "mrp-active": e.thumbsVisible }]),
|
|
705
713
|
type: "button",
|
|
706
|
-
onClick:
|
|
707
|
-
}, " ▦ " +
|
|
714
|
+
onClick: o[6] || (o[6] = (l) => n.$emit("thumbs-toggle"))
|
|
715
|
+
}, " ▦ " + C(e.messages.thumbnails), 3),
|
|
708
716
|
F("button", {
|
|
709
717
|
class: oe(["mrp-nav", { "mrp-active": e.zoomMode === "fit" }]),
|
|
710
718
|
type: "button",
|
|
711
|
-
onClick:
|
|
712
|
-
},
|
|
719
|
+
onClick: o[7] || (o[7] = (l) => n.$emit("zoom", "fit"))
|
|
720
|
+
}, C(e.messages.fitWidth), 3),
|
|
713
721
|
F("button", {
|
|
714
722
|
class: oe(["mrp-nav", { "mrp-active": e.zoomMode === "raw" && Math.round(e.zoom * 100) === 100 }]),
|
|
715
723
|
type: "button",
|
|
716
|
-
onClick:
|
|
724
|
+
onClick: o[8] || (o[8] = (l) => n.$emit("zoom", 100))
|
|
717
725
|
}, " 100% ", 2),
|
|
718
726
|
F("button", {
|
|
719
727
|
class: oe(["mrp-nav", { "mrp-active": e.zoomMode === "raw" && Math.round(e.zoom * 100) === 150 }]),
|
|
720
728
|
type: "button",
|
|
721
|
-
onClick:
|
|
729
|
+
onClick: o[9] || (o[9] = (l) => n.$emit("zoom", 150))
|
|
722
730
|
}, " 150% ", 2),
|
|
723
731
|
e.showExport ? (P(), $("button", {
|
|
724
732
|
key: 2,
|
|
725
733
|
class: "mrp-nav",
|
|
726
734
|
type: "button",
|
|
727
|
-
onClick:
|
|
728
|
-
},
|
|
735
|
+
onClick: o[10] || (o[10] = (l) => n.$emit("export", "html"))
|
|
736
|
+
}, C(e.messages.exportHtml), 1)) : H("", !0),
|
|
729
737
|
e.showExport ? (P(), $("button", {
|
|
730
738
|
key: 3,
|
|
731
739
|
class: "mrp-nav",
|
|
732
740
|
type: "button",
|
|
733
|
-
onClick:
|
|
734
|
-
},
|
|
741
|
+
onClick: o[11] || (o[11] = (l) => n.$emit("export", "pdf"))
|
|
742
|
+
}, C(e.messages.exportPdf), 1)) : H("", !0),
|
|
735
743
|
e.showExport ? (P(), $("button", {
|
|
736
744
|
key: 4,
|
|
737
745
|
class: "mrp-nav",
|
|
738
746
|
type: "button",
|
|
739
|
-
onClick:
|
|
740
|
-
},
|
|
747
|
+
onClick: o[12] || (o[12] = (l) => n.$emit("export", "xlsx"))
|
|
748
|
+
}, C(e.messages.exportExcel), 1)) : H("", !0),
|
|
741
749
|
e.showExport ? (P(), $("button", {
|
|
742
750
|
key: 5,
|
|
743
751
|
class: "mrp-nav",
|
|
744
752
|
type: "button",
|
|
745
|
-
onClick:
|
|
746
|
-
},
|
|
753
|
+
onClick: o[13] || (o[13] = (l) => n.$emit("export", "png"))
|
|
754
|
+
}, C(e.messages.exportImage), 1)) : H("", !0),
|
|
747
755
|
e.showExport ? (P(), $("button", {
|
|
748
756
|
key: 6,
|
|
749
757
|
class: "mrp-nav",
|
|
750
758
|
type: "button",
|
|
751
|
-
onClick:
|
|
752
|
-
},
|
|
759
|
+
onClick: o[14] || (o[14] = (l) => n.$emit("export", "word"))
|
|
760
|
+
}, C(e.messages.exportWord), 1)) : H("", !0),
|
|
753
761
|
e.showPrint ? (P(), $("button", {
|
|
754
762
|
key: 7,
|
|
755
763
|
class: "mrp-nav",
|
|
756
764
|
type: "button",
|
|
757
|
-
onClick:
|
|
758
|
-
},
|
|
765
|
+
onClick: o[15] || (o[15] = (l) => n.$emit("print"))
|
|
766
|
+
}, C(e.messages.print), 1)) : H("", !0),
|
|
759
767
|
e.showPdfWindow ? (P(), $("button", {
|
|
760
768
|
key: 8,
|
|
761
769
|
class: "mrp-nav",
|
|
762
770
|
type: "button",
|
|
763
|
-
onClick:
|
|
764
|
-
},
|
|
771
|
+
onClick: o[16] || (o[16] = (l) => n.$emit("pdf-window"))
|
|
772
|
+
}, C(e.messages.pdfWindow), 1)) : H("", !0)
|
|
765
773
|
]));
|
|
766
774
|
}
|
|
767
775
|
}), st = (e, t) => {
|
|
768
|
-
const
|
|
769
|
-
for (const [
|
|
770
|
-
|
|
771
|
-
return
|
|
772
|
-
},
|
|
776
|
+
const a = e.__vccOpts || e;
|
|
777
|
+
for (const [r, n] of t)
|
|
778
|
+
a[r] = n;
|
|
779
|
+
return a;
|
|
780
|
+
}, Sn = /* @__PURE__ */ st(Tn, [["__scopeId", "data-v-601f8fa8"]]), In = { class: "mrp-params" }, Dn = { class: "mrp-params-title" }, On = { class: "mrp-params-grid" }, Wn = { class: "mrp-param-label" }, Bn = {
|
|
773
781
|
key: 0,
|
|
774
782
|
class: "mrp-param-star"
|
|
775
|
-
},
|
|
783
|
+
}, An = ["value", "onChange"], Ln = {
|
|
776
784
|
value: "",
|
|
777
785
|
disabled: "",
|
|
778
786
|
hidden: ""
|
|
779
|
-
},
|
|
787
|
+
}, zn = ["value"], Hn = ["type", "placeholder", "value", "onInput"], qn = { class: "mrp-params-actions" }, Nn = /* @__PURE__ */ rt({
|
|
780
788
|
__name: "ReportParamPanel",
|
|
781
789
|
props: {
|
|
782
790
|
defs: {},
|
|
@@ -786,76 +794,76 @@ const vn = { class: "mrp-toolbar" }, hn = { class: "mrp-title" }, gn = ["disable
|
|
|
786
794
|
},
|
|
787
795
|
emits: ["update:modelValue", "query", "reset"],
|
|
788
796
|
setup(e, { emit: t }) {
|
|
789
|
-
const
|
|
797
|
+
const a = e, r = t, n = B({ ...a.modelValue });
|
|
790
798
|
Q(
|
|
791
|
-
() =>
|
|
799
|
+
() => a.modelValue,
|
|
792
800
|
(p) => {
|
|
793
801
|
n.value = { ...p };
|
|
794
802
|
}
|
|
795
803
|
);
|
|
796
|
-
const
|
|
797
|
-
() =>
|
|
804
|
+
const o = k(
|
|
805
|
+
() => a.defs.map((p) => ({
|
|
798
806
|
def: p,
|
|
799
807
|
label: p.label ?? p.field,
|
|
800
808
|
value: n.value[p.field] ?? ""
|
|
801
809
|
}))
|
|
802
810
|
);
|
|
803
811
|
function l(p, m) {
|
|
804
|
-
n.value = { ...n.value, [p]: m },
|
|
812
|
+
n.value = { ...n.value, [p]: m }, r("update:modelValue", { ...n.value });
|
|
805
813
|
}
|
|
806
814
|
function u(p) {
|
|
807
|
-
const m =
|
|
808
|
-
return
|
|
815
|
+
const m = a.defs.find((d) => d.field === p);
|
|
816
|
+
return a.attempted && m?.required === !0 && !(n.value[p] ?? "").trim();
|
|
809
817
|
}
|
|
810
|
-
return (p, m) => (P(), $("div",
|
|
811
|
-
F("span",
|
|
812
|
-
F("div",
|
|
813
|
-
(P(!0), $(Ee, null, We(
|
|
814
|
-
key:
|
|
815
|
-
class: oe(["mrp-param", { "mrp-param-missing": u(
|
|
818
|
+
return (p, m) => (P(), $("div", In, [
|
|
819
|
+
F("span", Dn, C(e.messages.paramsTitle), 1),
|
|
820
|
+
F("div", On, [
|
|
821
|
+
(P(!0), $(Ee, null, We(o.value, (d) => (P(), $("label", {
|
|
822
|
+
key: d.def.field,
|
|
823
|
+
class: oe(["mrp-param", { "mrp-param-missing": u(d.def.field) }])
|
|
816
824
|
}, [
|
|
817
|
-
F("span",
|
|
818
|
-
et(
|
|
819
|
-
|
|
825
|
+
F("span", Wn, [
|
|
826
|
+
et(C(d.label), 1),
|
|
827
|
+
d.def.required ? (P(), $("i", Bn, "*")) : H("", !0)
|
|
820
828
|
]),
|
|
821
|
-
(
|
|
829
|
+
(d.def.type ?? "text") === "select" ? (P(), $("select", {
|
|
822
830
|
key: 0,
|
|
823
831
|
class: "mrp-param-input",
|
|
824
|
-
value:
|
|
825
|
-
onChange: (f) => l(
|
|
832
|
+
value: d.value,
|
|
833
|
+
onChange: (f) => l(d.def.field, f.target.value),
|
|
826
834
|
onKeydown: m[0] || (m[0] = mt((f) => p.$emit("query"), ["enter"]))
|
|
827
835
|
}, [
|
|
828
|
-
F("option",
|
|
829
|
-
(P(!0), $(Ee, null, We(
|
|
836
|
+
F("option", Ln, C(d.def.placeholder ?? `请选择${d.label}`), 1),
|
|
837
|
+
(P(!0), $(Ee, null, We(d.def.options ?? [], (f) => (P(), $("option", {
|
|
830
838
|
key: f.value,
|
|
831
839
|
value: f.value
|
|
832
|
-
},
|
|
833
|
-
], 40,
|
|
840
|
+
}, C(f.label), 9, zn))), 128))
|
|
841
|
+
], 40, An)) : (P(), $("input", {
|
|
834
842
|
key: 1,
|
|
835
843
|
class: "mrp-param-input",
|
|
836
|
-
type:
|
|
837
|
-
placeholder:
|
|
838
|
-
value:
|
|
839
|
-
onInput: (f) => l(
|
|
844
|
+
type: d.def.type === "number" ? "number" : d.def.type === "date" ? "date" : "text",
|
|
845
|
+
placeholder: d.def.placeholder ?? `请输入${d.label}`,
|
|
846
|
+
value: d.value,
|
|
847
|
+
onInput: (f) => l(d.def.field, f.target.value),
|
|
840
848
|
onKeydown: m[1] || (m[1] = mt((f) => p.$emit("query"), ["enter"]))
|
|
841
|
-
}, null, 40,
|
|
849
|
+
}, null, 40, Hn))
|
|
842
850
|
], 2))), 128))
|
|
843
851
|
]),
|
|
844
|
-
F("div",
|
|
852
|
+
F("div", qn, [
|
|
845
853
|
F("button", {
|
|
846
854
|
class: "mrp-nav mrp-param-query",
|
|
847
855
|
type: "button",
|
|
848
|
-
onClick: m[2] || (m[2] = (
|
|
849
|
-
},
|
|
856
|
+
onClick: m[2] || (m[2] = (d) => p.$emit("query"))
|
|
857
|
+
}, C(e.messages.query), 1),
|
|
850
858
|
F("button", {
|
|
851
859
|
class: "mrp-nav",
|
|
852
860
|
type: "button",
|
|
853
|
-
onClick: m[3] || (m[3] = (
|
|
854
|
-
},
|
|
861
|
+
onClick: m[3] || (m[3] = (d) => p.$emit("reset"))
|
|
862
|
+
}, C(e.messages.reset), 1)
|
|
855
863
|
])
|
|
856
864
|
]));
|
|
857
865
|
}
|
|
858
|
-
}),
|
|
866
|
+
}), jn = /* @__PURE__ */ st(Nn, [["__scopeId", "data-v-aafce92d"]]), Un = {
|
|
859
867
|
title: "报表预览",
|
|
860
868
|
prevPage: "‹ 上一页",
|
|
861
869
|
nextPage: "下一页 ›",
|
|
@@ -884,7 +892,7 @@ const vn = { class: "mrp-toolbar" }, hn = { class: "mrp-title" }, gn = ["disable
|
|
|
884
892
|
reset: "重 置",
|
|
885
893
|
paramRequired: "请填写{label}",
|
|
886
894
|
searching: "搜索中…"
|
|
887
|
-
},
|
|
895
|
+
}, Vn = {
|
|
888
896
|
shellBg: "#525659",
|
|
889
897
|
shellFg: "#e8e8e8",
|
|
890
898
|
toolbarBg: "#323639",
|
|
@@ -896,13 +904,13 @@ const vn = { class: "mrp-toolbar" }, hn = { class: "mrp-title" }, gn = ["disable
|
|
|
896
904
|
btnHoverFg: "#ffffff",
|
|
897
905
|
btnActiveBg: "#2d5fb8"
|
|
898
906
|
};
|
|
899
|
-
function
|
|
907
|
+
function Kn(e = {}) {
|
|
900
908
|
return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
|
|
901
909
|
}
|
|
902
|
-
function
|
|
910
|
+
function Er(e) {
|
|
903
911
|
return e;
|
|
904
912
|
}
|
|
905
|
-
const
|
|
913
|
+
const fe = {
|
|
906
914
|
showExport: !0,
|
|
907
915
|
showPrint: !0,
|
|
908
916
|
showPdfWindow: !0,
|
|
@@ -910,10 +918,10 @@ const de = {
|
|
|
910
918
|
gapPx: 18,
|
|
911
919
|
pdfFontUrl: "/simhei.ttf",
|
|
912
920
|
logger: console
|
|
913
|
-
},
|
|
921
|
+
}, $r = { warn: () => {
|
|
914
922
|
}, info: () => {
|
|
915
923
|
} };
|
|
916
|
-
function
|
|
924
|
+
function Oe(e, t) {
|
|
917
925
|
return {
|
|
918
926
|
...e,
|
|
919
927
|
...t,
|
|
@@ -923,56 +931,56 @@ function De(e, t) {
|
|
|
923
931
|
xlsx: { ...e?.xlsx, ...t?.xlsx }
|
|
924
932
|
};
|
|
925
933
|
}
|
|
926
|
-
function
|
|
927
|
-
const
|
|
934
|
+
function Yn(e, t) {
|
|
935
|
+
const a = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, r = Oe(e?.defaults, a);
|
|
928
936
|
return {
|
|
929
|
-
showExport:
|
|
930
|
-
showPrint:
|
|
931
|
-
showPdfWindow:
|
|
932
|
-
showParams:
|
|
933
|
-
gapPx:
|
|
934
|
-
pdfFontUrl:
|
|
935
|
-
theme: { ...
|
|
936
|
-
messages: { ...
|
|
937
|
-
logger:
|
|
937
|
+
showExport: r.showExport ?? fe.showExport,
|
|
938
|
+
showPrint: r.showPrint ?? fe.showPrint,
|
|
939
|
+
showPdfWindow: r.showPdfWindow ?? fe.showPdfWindow,
|
|
940
|
+
showParams: r.showParams ?? fe.showParams,
|
|
941
|
+
gapPx: r.gapPx ?? fe.gapPx,
|
|
942
|
+
pdfFontUrl: r.pdfFontUrl ?? fe.pdfFontUrl,
|
|
943
|
+
theme: { ...Vn, ...r.theme },
|
|
944
|
+
messages: { ...Un, ...r.messages },
|
|
945
|
+
logger: r.logger ?? fe.logger,
|
|
938
946
|
preview: {
|
|
939
|
-
overscanPages: ht(
|
|
940
|
-
searchDebounceMs: ht(
|
|
947
|
+
overscanPages: ht(r.preview?.overscanPages, 1, 10, !0),
|
|
948
|
+
searchDebounceMs: ht(r.preview?.searchDebounceMs, 200, 2e3)
|
|
941
949
|
},
|
|
942
|
-
xlsx: { ...
|
|
950
|
+
xlsx: { ...r.xlsx }
|
|
943
951
|
};
|
|
944
952
|
}
|
|
945
|
-
function ht(e, t,
|
|
953
|
+
function ht(e, t, a, r = !1) {
|
|
946
954
|
if (e == null || !Number.isFinite(e)) return t;
|
|
947
|
-
const n = Math.max(0, Math.min(
|
|
948
|
-
return
|
|
955
|
+
const n = Math.max(0, Math.min(a, e));
|
|
956
|
+
return r ? Math.floor(n) : n;
|
|
949
957
|
}
|
|
950
|
-
function
|
|
958
|
+
function Zn(e) {
|
|
951
959
|
const t = {};
|
|
952
960
|
return e.shellBg != null && (t["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (t["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (t["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (t["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (t["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (t["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (t["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (t["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (t["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (t["--mrp-btn-active-bg"] = e.btnActiveBg), t;
|
|
953
961
|
}
|
|
954
|
-
function
|
|
955
|
-
const t = Be(tt, null),
|
|
956
|
-
const
|
|
957
|
-
if (!
|
|
958
|
-
const
|
|
959
|
-
for (const l of Object.keys(
|
|
960
|
-
|
|
961
|
-
|
|
962
|
+
function kr(e) {
|
|
963
|
+
const t = Be(tt, null), a = k(() => {
|
|
964
|
+
const r = t?.value ?? null, n = "defaults" in e || "presets" in e || "defaultPreset" in e ? Kn(e) : { defaults: e, presets: {} };
|
|
965
|
+
if (!r) return n;
|
|
966
|
+
const o = { ...r.presets, ...n.presets };
|
|
967
|
+
for (const l of Object.keys(o))
|
|
968
|
+
o[l] = Oe(
|
|
969
|
+
Oe(r.presets[l], n.defaults),
|
|
962
970
|
n.presets[l]
|
|
963
971
|
);
|
|
964
972
|
return {
|
|
965
|
-
defaults:
|
|
966
|
-
presets:
|
|
967
|
-
defaultPreset: n.defaultPreset ??
|
|
973
|
+
defaults: Oe(r.defaults, n.defaults),
|
|
974
|
+
presets: o,
|
|
975
|
+
defaultPreset: n.defaultPreset ?? r.defaultPreset
|
|
968
976
|
};
|
|
969
977
|
});
|
|
970
|
-
yt(tt,
|
|
978
|
+
yt(tt, a);
|
|
971
979
|
}
|
|
972
|
-
function
|
|
980
|
+
function Jn() {
|
|
973
981
|
return Be(tt, k(() => null));
|
|
974
982
|
}
|
|
975
|
-
const gt = /* @__PURE__ */ new Map(),
|
|
983
|
+
const gt = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), Gn = 15e3;
|
|
976
984
|
function nt(e, t) {
|
|
977
985
|
return Object.assign(new Error(e), { cause: t });
|
|
978
986
|
}
|
|
@@ -984,11 +992,11 @@ function ze(e) {
|
|
|
984
992
|
const t = nt("PDF 字体检查已取消", e?.reason);
|
|
985
993
|
return t.name = "AbortError", t;
|
|
986
994
|
}
|
|
987
|
-
async function
|
|
988
|
-
let
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
},
|
|
995
|
+
async function Xn(e, t) {
|
|
996
|
+
let a = !1;
|
|
997
|
+
const r = setTimeout(() => {
|
|
998
|
+
a = !0, t.abort();
|
|
999
|
+
}, Gn);
|
|
992
1000
|
try {
|
|
993
1001
|
const n = await fetch(e, { method: "HEAD", signal: t.signal });
|
|
994
1002
|
if (t.signal.aborted) throw ze(t.signal);
|
|
@@ -1002,13 +1010,13 @@ async function Kn(e, t) {
|
|
|
1002
1010
|
const l = new Error(`字体请求返回 HTTP ${n.status}`);
|
|
1003
1011
|
return { status: "error", fontUrl: e, message: Pe(e, l.message), cause: l };
|
|
1004
1012
|
}
|
|
1005
|
-
const
|
|
1006
|
-
if (/text\/html|application\/xhtml\+xml/i.test(
|
|
1013
|
+
const o = n.headers.get("content-type") ?? "";
|
|
1014
|
+
if (/text\/html|application\/xhtml\+xml/i.test(o)) {
|
|
1007
1015
|
const l = new Error("字体 URL 返回 HTML 页面(可能是 SPA 路由回退),不是字体文件");
|
|
1008
1016
|
return { status: "error", fontUrl: e, message: Pe(e, l.message), cause: l };
|
|
1009
1017
|
}
|
|
1010
|
-
if (/^text\//i.test(
|
|
1011
|
-
const l = new Error(`字体 URL 返回 ${
|
|
1018
|
+
if (/^text\//i.test(o) || /(?:\/|\+)json(?:\s*;|$)/i.test(o)) {
|
|
1019
|
+
const l = new Error(`字体 URL 返回 ${o} 文本响应,不是字体文件`);
|
|
1012
1020
|
return { status: "error", fontUrl: e, message: Pe(e, l.message), cause: l };
|
|
1013
1021
|
}
|
|
1014
1022
|
return {
|
|
@@ -1017,103 +1025,103 @@ async function Kn(e, t) {
|
|
|
1017
1025
|
message: "PDF 字体资源可达;文字覆盖范围将在实际导出时校验"
|
|
1018
1026
|
};
|
|
1019
1027
|
} catch (n) {
|
|
1020
|
-
if (t.signal.aborted && !
|
|
1028
|
+
if (t.signal.aborted && !a) throw ze(t.signal);
|
|
1021
1029
|
return {
|
|
1022
1030
|
status: "error",
|
|
1023
1031
|
fontUrl: e,
|
|
1024
|
-
message: Pe(e,
|
|
1032
|
+
message: Pe(e, a ? "字体检查超时,请检查网络或字体服务" : "字体检查失败,请检查网络、字体服务或跨域访问配置"),
|
|
1025
1033
|
cause: n
|
|
1026
1034
|
};
|
|
1027
1035
|
} finally {
|
|
1028
|
-
clearTimeout(
|
|
1036
|
+
clearTimeout(r);
|
|
1029
1037
|
}
|
|
1030
1038
|
}
|
|
1031
|
-
function
|
|
1039
|
+
function Qn(e, t) {
|
|
1032
1040
|
if (t?.aborted) return Promise.reject(ze(t));
|
|
1033
1041
|
if (!e)
|
|
1034
1042
|
return Promise.resolve({ status: "disabled", fontUrl: e, message: "已停用自定义 PDF 字体;内置字体用于西文,其他文字会在导出时校验" });
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1037
|
-
let
|
|
1038
|
-
if (!
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1041
|
-
const l =
|
|
1042
|
-
|
|
1043
|
-
|
|
1043
|
+
const a = gt.get(e);
|
|
1044
|
+
if (a) return Promise.resolve(a);
|
|
1045
|
+
let r = ve.get(e);
|
|
1046
|
+
if (!r) {
|
|
1047
|
+
const o = new AbortController();
|
|
1048
|
+
r = { controller: o, promise: Xn(e, o), subscribers: 0 };
|
|
1049
|
+
const l = r;
|
|
1050
|
+
ve.set(e, l), l.promise = l.promise.then((u) => (!o.signal.aborted && u.status === "available" && gt.set(e, u), u)).finally(() => {
|
|
1051
|
+
ve.get(e) === l && ve.delete(e);
|
|
1044
1052
|
});
|
|
1045
1053
|
}
|
|
1046
|
-
const n =
|
|
1047
|
-
return n.subscribers++, new Promise((
|
|
1054
|
+
const n = r;
|
|
1055
|
+
return n.subscribers++, new Promise((o, l) => {
|
|
1048
1056
|
let u = !1;
|
|
1049
1057
|
const p = () => u ? !1 : (u = !0, n.subscribers--, t?.removeEventListener("abort", m), !0), m = () => {
|
|
1050
|
-
p() && (n.subscribers === 0 && (
|
|
1058
|
+
p() && (n.subscribers === 0 && (ve.get(e) === n && ve.delete(e), n.controller.abort()), l(ze(t)));
|
|
1051
1059
|
};
|
|
1052
1060
|
t?.addEventListener("abort", m, { once: !0 }), n.promise.then(
|
|
1053
|
-
(
|
|
1054
|
-
p() &&
|
|
1061
|
+
(d) => {
|
|
1062
|
+
p() && o(d);
|
|
1055
1063
|
},
|
|
1056
|
-
(
|
|
1057
|
-
p() && l(
|
|
1064
|
+
(d) => {
|
|
1065
|
+
p() && l(d);
|
|
1058
1066
|
}
|
|
1059
1067
|
), t?.aborted && m();
|
|
1060
1068
|
});
|
|
1061
1069
|
}
|
|
1062
|
-
function
|
|
1070
|
+
function _n(e = { fontUrl: "/simhei.ttf" }) {
|
|
1063
1071
|
let t = null;
|
|
1064
|
-
const
|
|
1072
|
+
const a = async (r, n) => {
|
|
1065
1073
|
t || (t = await import("@agile-team/mach-report/pdf"));
|
|
1066
|
-
let
|
|
1074
|
+
let o = null;
|
|
1067
1075
|
if (e.fontUrl)
|
|
1068
1076
|
try {
|
|
1069
|
-
if (
|
|
1077
|
+
if (o = await t.loadFontWithCache(e.fontUrl, { strict: !0 }), !o?.byteLength) throw new Error("字体文件为空或加载失败");
|
|
1070
1078
|
} catch (f) {
|
|
1071
1079
|
const h = f instanceof Error ? f.message : String(f);
|
|
1072
1080
|
throw nt(Pe(e.fontUrl, h), f);
|
|
1073
1081
|
}
|
|
1074
1082
|
let l;
|
|
1075
1083
|
try {
|
|
1076
|
-
l = await t.renderPlanToPdf(
|
|
1084
|
+
l = await t.renderPlanToPdf(r, o ? { customFontBytes: o } : {});
|
|
1077
1085
|
} catch (f) {
|
|
1078
|
-
if (!
|
|
1086
|
+
if (!o) throw f;
|
|
1079
1087
|
const h = f instanceof Error ? f.message : String(f);
|
|
1080
1088
|
throw nt(`PDF 生成失败:${h}。当前字体 URL 为 ${JSON.stringify(e.fontUrl)};请确认该文件是有效字体,或重新配置 pdfFontUrl`, f);
|
|
1081
1089
|
}
|
|
1082
|
-
const { bytes: u, unsupportedTextCount: p, pageErrors: m, fidelityWarnings:
|
|
1090
|
+
const { bytes: u, unsupportedTextCount: p, pageErrors: m, fidelityWarnings: d } = l;
|
|
1083
1091
|
if (p > 0)
|
|
1084
1092
|
throw new Error(`PDF 中有 ${p} 行文字无法编码;请部署支持所用文字的字体并配置 pdfFontUrl`);
|
|
1085
1093
|
if (m.length > 0)
|
|
1086
1094
|
throw new Error(`PDF 有 ${m.length} 页渲染失败:${m[0]}`);
|
|
1087
|
-
return
|
|
1095
|
+
return d.length > 0 && n?.(`PDF 有 ${d.length} 处版式降级:${d.slice(0, 2).join(";")}`), u;
|
|
1088
1096
|
};
|
|
1089
|
-
return
|
|
1097
|
+
return a.checkFont = (r) => Qn(e.fontUrl, r), a;
|
|
1090
1098
|
}
|
|
1091
|
-
class
|
|
1092
|
-
constructor(t,
|
|
1093
|
-
super(
|
|
1099
|
+
class he extends Error {
|
|
1100
|
+
constructor(t, a, r) {
|
|
1101
|
+
super(a), this.name = "MachReportError", this.code = t, this.cause = r;
|
|
1094
1102
|
}
|
|
1095
1103
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return e instanceof
|
|
1104
|
+
function er(e) {
|
|
1105
|
+
return e instanceof he ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
|
|
1098
1106
|
}
|
|
1099
|
-
const
|
|
1107
|
+
const tr = {
|
|
1100
1108
|
key: 2,
|
|
1101
1109
|
class: "mrp-export-notice mrp-export-warning",
|
|
1102
1110
|
role: "status"
|
|
1103
|
-
},
|
|
1111
|
+
}, nr = { class: "mrp-main" }, rr = {
|
|
1104
1112
|
key: 0,
|
|
1105
1113
|
class: "mrp-state"
|
|
1106
|
-
},
|
|
1114
|
+
}, or = {
|
|
1107
1115
|
key: 1,
|
|
1108
1116
|
class: "mrp-state mrp-error"
|
|
1109
|
-
},
|
|
1117
|
+
}, ar = {
|
|
1110
1118
|
key: 2,
|
|
1111
1119
|
class: "mrp-state"
|
|
1112
|
-
},
|
|
1120
|
+
}, sr = ["data-page"], lr = ["onClick"], ir = ["data-thumb"], ur = { class: "mrp-thumb-no" }, cr = { class: "mrp-overlay" }, dr = {
|
|
1113
1121
|
key: 3,
|
|
1114
1122
|
class: "mrp-debug",
|
|
1115
1123
|
"aria-hidden": "true"
|
|
1116
|
-
}, Se = 96 / 25.4, bt = "mach-report:ui", wt = "mach-report:ui:wide",
|
|
1124
|
+
}, Se = 96 / 25.4, bt = "mach-report:ui", wt = "mach-report:ui:wide", fr = /* @__PURE__ */ rt({
|
|
1117
1125
|
__name: "ReportPreview",
|
|
1118
1126
|
props: {
|
|
1119
1127
|
reportId: {
|
|
@@ -1151,192 +1159,193 @@ const Gn = {
|
|
|
1151
1159
|
}
|
|
1152
1160
|
},
|
|
1153
1161
|
emits: ["loaded", "error", "warning"],
|
|
1154
|
-
setup(e, { expose: t, emit:
|
|
1162
|
+
setup(e, { expose: t, emit: a }) {
|
|
1155
1163
|
Nt((i) => ({
|
|
1156
|
-
|
|
1164
|
+
v8eb72344: S.value + "px"
|
|
1157
1165
|
}));
|
|
1158
|
-
const
|
|
1159
|
-
let
|
|
1160
|
-
const
|
|
1166
|
+
const r = e, n = a, o = Ie(null), l = B(!1), u = B(""), p = Ie(null), m = B(null), d = B(!1), f = Ie(Object.freeze({ status: "unchecked", fontUrl: "" })), h = B(null), v = B(1), A = B(null), W = B(null), b = B(null), I = B(!1), E = wn(), D = k(() => !!o.value?.pages.length && o.value.pages.every((i) => i.layout === "wide")), S = k(() => Math.max(0, U.value));
|
|
1167
|
+
let M = bt;
|
|
1168
|
+
const q = Be(en, null), K = Be(tn, null), V = k(() => Et(r.reportId)), Y = k(() => r.fetcher ?? q), O = k(() => o.value?.pages.length ?? 0), ae = k(() => Object.freeze({
|
|
1161
1169
|
loading: l.value,
|
|
1162
1170
|
hasPlan: O.value > 0,
|
|
1163
1171
|
pageCount: O.value,
|
|
1164
1172
|
currentPage: v.value,
|
|
1165
1173
|
exporting: m.value,
|
|
1166
|
-
printing:
|
|
1174
|
+
printing: d.value,
|
|
1167
1175
|
canExport: !l.value && O.value > 0 && m.value === null,
|
|
1168
|
-
canPrint: !l.value && O.value > 0 && !
|
|
1176
|
+
canPrint: !l.value && O.value > 0 && !d.value,
|
|
1169
1177
|
error: p.value,
|
|
1170
1178
|
pdfFont: f.value
|
|
1171
1179
|
}));
|
|
1172
1180
|
function ee(i, g, w) {
|
|
1173
1181
|
p.value = Object.freeze({ message: i, code: g, cause: w }), n("error", i, { code: g, cause: w });
|
|
1174
1182
|
}
|
|
1175
|
-
const
|
|
1176
|
-
...
|
|
1177
|
-
...
|
|
1178
|
-
})), y = k(() =>
|
|
1183
|
+
const pe = Jn(), s = k(() => Yn(pe.value, r.preset)), c = k(() => ({
|
|
1184
|
+
...s.value.messages,
|
|
1185
|
+
...r.messages
|
|
1186
|
+
})), y = k(() => r.showExport ?? s.value.showExport), R = k(() => r.showPrint ?? s.value.showPrint), T = k(() => r.showPdfWindow ?? s.value.showPdfWindow), U = k(() => r.gapPx ?? (D.value ? 0 : s.value.gapPx)), J = k(() => r.showParams ?? s.value.showParams);
|
|
1179
1187
|
let G = null, qe = null;
|
|
1180
1188
|
function lt() {
|
|
1181
|
-
if (
|
|
1182
|
-
const i =
|
|
1183
|
-
return (!qe || G !== i) && (G = i, qe =
|
|
1189
|
+
if (K) return K;
|
|
1190
|
+
const i = s.value.pdfFontUrl;
|
|
1191
|
+
return (!qe || G !== i) && (G = i, qe = _n({ fontUrl: i })), qe;
|
|
1184
1192
|
}
|
|
1185
|
-
let $e = 0,
|
|
1193
|
+
let $e = 0, ge = null, ke = null, se = !1;
|
|
1186
1194
|
function Ne() {
|
|
1187
|
-
$e++,
|
|
1195
|
+
$e++, ge?.abort(), ge = null;
|
|
1188
1196
|
}
|
|
1189
|
-
async function
|
|
1190
|
-
if (
|
|
1197
|
+
async function Ce() {
|
|
1198
|
+
if (se) throw new he("config", "报表预览已卸载");
|
|
1191
1199
|
Ne();
|
|
1192
1200
|
const i = $e, g = new AbortController();
|
|
1193
|
-
|
|
1194
|
-
const w =
|
|
1201
|
+
ge = g;
|
|
1202
|
+
const w = s.value.pdfFontUrl;
|
|
1195
1203
|
f.value = Object.freeze({ status: "checking", fontUrl: w });
|
|
1196
1204
|
try {
|
|
1197
|
-
const
|
|
1198
|
-
return !
|
|
1199
|
-
} catch (
|
|
1200
|
-
if (g.signal.aborted) throw
|
|
1201
|
-
const
|
|
1205
|
+
const N = lt(), j = N.checkFont ? await N.checkFont(g.signal) : { status: "unverified", fontUrl: "", message: "自定义 PDF 导出器未提供字体预检查;字体由宿主确认" };
|
|
1206
|
+
return !se && i === $e && !g.signal.aborted && (f.value = Object.freeze({ ...j })), j;
|
|
1207
|
+
} catch (N) {
|
|
1208
|
+
if (g.signal.aborted) throw N;
|
|
1209
|
+
const j = {
|
|
1202
1210
|
status: "error",
|
|
1203
1211
|
fontUrl: w,
|
|
1204
|
-
message:
|
|
1205
|
-
cause:
|
|
1212
|
+
message: N instanceof Error ? N.message : "PDF 字体检查失败",
|
|
1213
|
+
cause: N
|
|
1206
1214
|
};
|
|
1207
|
-
return !
|
|
1215
|
+
return !se && i === $e && (f.value = Object.freeze(j)), j;
|
|
1208
1216
|
} finally {
|
|
1209
|
-
|
|
1217
|
+
ge === g && (ge = null);
|
|
1210
1218
|
}
|
|
1211
1219
|
}
|
|
1212
|
-
function
|
|
1213
|
-
|
|
1220
|
+
function Ct() {
|
|
1221
|
+
Ce().catch(() => {
|
|
1214
1222
|
});
|
|
1215
1223
|
}
|
|
1216
1224
|
Q(
|
|
1217
|
-
[
|
|
1225
|
+
[o, () => s.value.pdfFontUrl, y, T],
|
|
1218
1226
|
() => {
|
|
1219
|
-
const i = f.value.fontUrl ===
|
|
1220
|
-
Ne(), (!i || f.value.status === "checking") && (f.value = Object.freeze({ status: "unchecked", fontUrl:
|
|
1227
|
+
const i = f.value.fontUrl === s.value.pdfFontUrl;
|
|
1228
|
+
Ne(), (!i || f.value.status === "checking") && (f.value = Object.freeze({ status: "unchecked", fontUrl: s.value.pdfFontUrl })), !se && O.value > 0 && (y.value || T.value) && Ce().catch(() => {
|
|
1221
1229
|
});
|
|
1222
1230
|
},
|
|
1223
1231
|
{ immediate: !0 }
|
|
1224
1232
|
);
|
|
1225
|
-
const
|
|
1226
|
-
() =>
|
|
1227
|
-
),
|
|
1233
|
+
const le = k(
|
|
1234
|
+
() => r.paramDefs ?? Y.value?.getParamDefs?.(V.value) ?? []
|
|
1235
|
+
), ce = B({}), je = B(!1);
|
|
1228
1236
|
function be(i) {
|
|
1229
1237
|
const g = {};
|
|
1230
1238
|
for (const w of i)
|
|
1231
|
-
g[w.field] =
|
|
1232
|
-
|
|
1239
|
+
g[w.field] = r.params[w.field] ?? w.defaultValue ?? "";
|
|
1240
|
+
ce.value = g, je.value = !1;
|
|
1233
1241
|
}
|
|
1234
|
-
be(
|
|
1235
|
-
const
|
|
1236
|
-
const i = { ...
|
|
1237
|
-
for (const [g, w] of Object.entries(
|
|
1242
|
+
be(le.value), Q(le, (i) => be(i)), Q(V, () => be(le.value)), Q(() => JSON.stringify(r.params), () => be(le.value));
|
|
1243
|
+
const Mt = k(() => {
|
|
1244
|
+
const i = { ...r.params };
|
|
1245
|
+
for (const [g, w] of Object.entries(ce.value))
|
|
1238
1246
|
w === "" ? delete i[g] : i[g] = w;
|
|
1239
1247
|
return i;
|
|
1240
1248
|
});
|
|
1241
1249
|
function Ft() {
|
|
1242
|
-
return
|
|
1243
|
-
(i) => i.required === !0 && !(
|
|
1250
|
+
return le.value.filter(
|
|
1251
|
+
(i) => i.required === !0 && !(ce.value[i.field] ?? "").trim()
|
|
1244
1252
|
);
|
|
1245
1253
|
}
|
|
1246
1254
|
function Rt() {
|
|
1247
1255
|
je.value = !0;
|
|
1248
1256
|
const i = Ft();
|
|
1249
1257
|
if (i.length > 0) {
|
|
1250
|
-
const g = i[0].label ?? i[0].field, w =
|
|
1258
|
+
const g = i[0].label ?? i[0].field, w = c.value.paramRequired.replace("{label}", g);
|
|
1251
1259
|
u.value = w, ee(w, "param");
|
|
1252
1260
|
return;
|
|
1253
1261
|
}
|
|
1254
|
-
|
|
1262
|
+
de();
|
|
1255
1263
|
}
|
|
1256
1264
|
function Tt() {
|
|
1257
|
-
be(
|
|
1265
|
+
be(le.value);
|
|
1258
1266
|
}
|
|
1259
1267
|
const St = k(() => ({
|
|
1260
|
-
height:
|
|
1261
|
-
...
|
|
1262
|
-
})), { zoom: Z, zoomMode: we, applyFitZoom: it, setZoom: ye } =
|
|
1268
|
+
height: r.height,
|
|
1269
|
+
...Zn(s.value.theme)
|
|
1270
|
+
})), { zoom: Z, zoomMode: we, applyFitZoom: it, setZoom: ye } = on(() => ({
|
|
1263
1271
|
viewport: W.value,
|
|
1264
1272
|
pageWidthPx: Ue.contentSize.value.w || 210 * Se
|
|
1265
|
-
})), Ue =
|
|
1273
|
+
})), Ue = rn(o, Z, {
|
|
1266
1274
|
pxPerMm: Se,
|
|
1267
|
-
gapPx:
|
|
1268
|
-
overscan: k(() =>
|
|
1269
|
-
}), { contentSize: Ve, windowRange: xe, visiblePages: ut, makeScrollHandler: It, refreshViewport: Ke } = Ue,
|
|
1275
|
+
gapPx: U,
|
|
1276
|
+
overscan: k(() => s.value.preview.overscanPages)
|
|
1277
|
+
}), { contentSize: Ve, windowRange: xe, visiblePages: ut, makeScrollHandler: It, refreshViewport: Ke } = Ue, Dt = It(v, O);
|
|
1270
1278
|
function Ye(i) {
|
|
1271
1279
|
ye(i * 100);
|
|
1272
1280
|
}
|
|
1273
|
-
function
|
|
1274
|
-
|
|
1281
|
+
function Me() {
|
|
1282
|
+
Ot(), o.value = null, v.value = 1, L.reset();
|
|
1275
1283
|
}
|
|
1276
|
-
let
|
|
1277
|
-
async function
|
|
1278
|
-
|
|
1284
|
+
let ie = 0, te = null;
|
|
1285
|
+
async function de() {
|
|
1286
|
+
if (se) return;
|
|
1287
|
+
const i = ++ie;
|
|
1279
1288
|
te?.abort(), te = null;
|
|
1280
1289
|
const g = Y.value;
|
|
1281
|
-
if (l.value = !1, p.value = null,
|
|
1282
|
-
u.value = "缺少报表 ID",
|
|
1290
|
+
if (l.value = !1, p.value = null, V.value.length === 0) {
|
|
1291
|
+
u.value = "缺少报表 ID", Me(), ee(u.value, "param");
|
|
1283
1292
|
return;
|
|
1284
1293
|
}
|
|
1285
1294
|
if (!g) {
|
|
1286
|
-
u.value = "未提供渲染数据源 fetcher",
|
|
1295
|
+
u.value = "未提供渲染数据源 fetcher", Me(), ee(u.value, "config");
|
|
1287
1296
|
return;
|
|
1288
1297
|
}
|
|
1289
|
-
l.value = !0, u.value = "", h.value = null,
|
|
1290
|
-
const w = E.start(),
|
|
1291
|
-
te =
|
|
1292
|
-
const
|
|
1298
|
+
l.value = !0, u.value = "", h.value = null, Me();
|
|
1299
|
+
const w = E.start(), N = new AbortController();
|
|
1300
|
+
te = N;
|
|
1301
|
+
const j = /* @__PURE__ */ new Set();
|
|
1293
1302
|
function Re(z) {
|
|
1294
|
-
i !==
|
|
1303
|
+
i !== ie || N.signal.aborted || j.has(z) || (j.add(z), s.value.logger.warn("[mach-report] 报表告警:", z), n("warning", z));
|
|
1295
1304
|
}
|
|
1296
1305
|
try {
|
|
1297
1306
|
const z = await g({
|
|
1298
|
-
reportIds:
|
|
1299
|
-
params: { ...
|
|
1300
|
-
signal:
|
|
1307
|
+
reportIds: V.value,
|
|
1308
|
+
params: { ...Mt.value },
|
|
1309
|
+
signal: N.signal,
|
|
1301
1310
|
onWarning: Re
|
|
1302
1311
|
});
|
|
1303
|
-
if (i !==
|
|
1312
|
+
if (i !== ie) return;
|
|
1304
1313
|
const X = Jt(z);
|
|
1305
1314
|
if (!X.ok) {
|
|
1306
1315
|
const Te = X.errors.slice(0, 3).map((pt) => `${pt.path}: ${pt.message}`).join("; ");
|
|
1307
|
-
throw new
|
|
1316
|
+
throw new he(
|
|
1308
1317
|
"validate",
|
|
1309
1318
|
`渲染计划校验失败(${X.errors.length} 处): ${Te}`
|
|
1310
1319
|
);
|
|
1311
1320
|
}
|
|
1312
|
-
if (X.warnings.forEach((Te) => Re(`${Te.path}: ${Te.message}`)), i !==
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1321
|
+
if (X.warnings.forEach((Te) => Re(`${Te.path}: ${Te.message}`)), i !== ie || N.signal.aborted) return;
|
|
1322
|
+
o.value = z, v.value = 1, E.end(w), W.value && (W.value.scrollTop = 0, W.value.scrollLeft = 0);
|
|
1323
|
+
const ue = D.value ? wt : bt;
|
|
1324
|
+
ue !== M && (M = ue, ft()), we.value === "fit" && it(), n("loaded", z.pages.length);
|
|
1316
1325
|
} catch (z) {
|
|
1317
|
-
if (i !==
|
|
1318
|
-
const X = z instanceof
|
|
1326
|
+
if (i !== ie) return;
|
|
1327
|
+
const X = z instanceof he ? z : z instanceof Gt ? new he(z.code, z.message, z.cause) : new he(
|
|
1319
1328
|
"fetch",
|
|
1320
1329
|
z instanceof Error ? z.message : "预览加载失败",
|
|
1321
1330
|
z
|
|
1322
1331
|
);
|
|
1323
1332
|
u.value = X.message;
|
|
1324
|
-
const
|
|
1325
|
-
ee(X.message,
|
|
1333
|
+
const ue = er(X);
|
|
1334
|
+
ee(X.message, ue.code, ue.cause);
|
|
1326
1335
|
} finally {
|
|
1327
|
-
i ===
|
|
1336
|
+
i === ie && (l.value = !1), te === N && (te = null);
|
|
1328
1337
|
}
|
|
1329
1338
|
}
|
|
1330
1339
|
function ne(i) {
|
|
1331
|
-
if (O.value <= 0) return;
|
|
1340
|
+
if (se || O.value <= 0) return;
|
|
1332
1341
|
const g = Math.max(1, Math.min(O.value, i));
|
|
1333
1342
|
v.value = g;
|
|
1334
1343
|
const w = W.value;
|
|
1335
1344
|
w && (w.scrollTop = Ue.pageOffsetPx(g - 1) * Z.value, Ke(w));
|
|
1336
1345
|
}
|
|
1337
|
-
const Fe =
|
|
1346
|
+
const Fe = sn(o, {
|
|
1338
1347
|
getPdfExporter: lt,
|
|
1339
|
-
getXlsxOptions: () =>
|
|
1348
|
+
getXlsxOptions: () => s.value.xlsx,
|
|
1340
1349
|
onError: (i, g) => {
|
|
1341
1350
|
h.value = { kind: "error", message: i }, ee(i, g ?? "print");
|
|
1342
1351
|
},
|
|
@@ -1346,13 +1355,13 @@ const Gn = {
|
|
|
1346
1355
|
onBusy: (i) => {
|
|
1347
1356
|
m.value = i, i ? h.value = {
|
|
1348
1357
|
kind: "progress",
|
|
1349
|
-
message:
|
|
1358
|
+
message: c.value.exporting.replace("{format}", i)
|
|
1350
1359
|
} : h.value?.kind === "progress" && (h.value = null);
|
|
1351
1360
|
},
|
|
1352
1361
|
onPrinting: (i) => {
|
|
1353
|
-
|
|
1362
|
+
d.value = i;
|
|
1354
1363
|
}
|
|
1355
|
-
}), { releasePrintFrame:
|
|
1364
|
+
}), { releasePrintFrame: Ot, dispose: Wt } = Fe;
|
|
1356
1365
|
async function Ze() {
|
|
1357
1366
|
p.value = null, await Fe.print();
|
|
1358
1367
|
}
|
|
@@ -1363,26 +1372,26 @@ const Gn = {
|
|
|
1363
1372
|
p.value = null, Fe.openPdfWindow();
|
|
1364
1373
|
}
|
|
1365
1374
|
async function ct(i, g = {}) {
|
|
1366
|
-
|
|
1375
|
+
se || (ce.value = { ...ce.value, ...i }, g.reload !== !1 && await de());
|
|
1367
1376
|
}
|
|
1368
|
-
yt(
|
|
1369
|
-
reload:
|
|
1377
|
+
yt(nn, {
|
|
1378
|
+
reload: de,
|
|
1370
1379
|
print: Ze,
|
|
1371
1380
|
exportAs: Je,
|
|
1372
1381
|
openPdfWindow: Ge,
|
|
1373
1382
|
gotoPage: ne,
|
|
1374
1383
|
setParams: ct,
|
|
1375
|
-
checkPdfFont:
|
|
1384
|
+
checkPdfFont: Ce,
|
|
1376
1385
|
get state() {
|
|
1377
1386
|
return ae.value;
|
|
1378
1387
|
}
|
|
1379
1388
|
});
|
|
1380
|
-
const L =
|
|
1381
|
-
plan:
|
|
1389
|
+
const L = hn({
|
|
1390
|
+
plan: o,
|
|
1382
1391
|
gotoPage: ne,
|
|
1383
|
-
debounceMs: k(() =>
|
|
1384
|
-
highlight:
|
|
1385
|
-
clearHighlights:
|
|
1392
|
+
debounceMs: k(() => s.value.preview.searchDebounceMs),
|
|
1393
|
+
highlight: un,
|
|
1394
|
+
clearHighlights: ln
|
|
1386
1395
|
});
|
|
1387
1396
|
function Bt(i) {
|
|
1388
1397
|
i.ctrlKey && (i.preventDefault(), Ye(Z.value * (i.deltaY < 0 ? 1.1 : 1 / 1.1)));
|
|
@@ -1417,7 +1426,7 @@ const Gn = {
|
|
|
1417
1426
|
function Lt() {
|
|
1418
1427
|
try {
|
|
1419
1428
|
localStorage.setItem(
|
|
1420
|
-
|
|
1429
|
+
M,
|
|
1421
1430
|
JSON.stringify({ zoomMode: we.value === "fit" ? "fit" : Math.round(Z.value * 100) })
|
|
1422
1431
|
);
|
|
1423
1432
|
} catch {
|
|
@@ -1430,41 +1439,41 @@ const Gn = {
|
|
|
1430
1439
|
if (!D.value || !g) return;
|
|
1431
1440
|
const w = `${L.query.value}:${L.matchIndex.value}:${g.pageIndex}`;
|
|
1432
1441
|
if (!i && w === Xe) return;
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1442
|
+
const j = A.value?.querySelector(`[data-page="${g.pageIndex + 1}"]`)?.querySelectorAll("mark.mrp-hit")[g.occurrence];
|
|
1443
|
+
j && (j.scrollIntoView?.({ block: "nearest", inline: "nearest" }), Xe = w);
|
|
1435
1444
|
}
|
|
1436
1445
|
vt(() => {
|
|
1437
|
-
const i =
|
|
1446
|
+
const i = o.value;
|
|
1438
1447
|
if (!i) return;
|
|
1439
1448
|
const g = L.activeMatch.value;
|
|
1440
1449
|
L.matchIndex.value, g || (Xe = ""), ut.value;
|
|
1441
1450
|
const w = A.value;
|
|
1442
1451
|
if (!w) return;
|
|
1443
|
-
w.querySelectorAll(".mrp-page-holder").forEach((
|
|
1444
|
-
const Re = Number(
|
|
1445
|
-
if (!z ||
|
|
1446
|
-
if (
|
|
1447
|
-
const
|
|
1448
|
-
L.clear(
|
|
1452
|
+
w.querySelectorAll(".mrp-page-holder").forEach((j) => {
|
|
1453
|
+
const Re = Number(j.dataset.page ?? 0) - 1, z = i.pages[Re];
|
|
1454
|
+
if (!z || j.childElementCount > 0) {
|
|
1455
|
+
if (j.firstElementChild) {
|
|
1456
|
+
const ue = j.firstElementChild;
|
|
1457
|
+
L.clear(ue), L.apply(ue);
|
|
1449
1458
|
}
|
|
1450
1459
|
return;
|
|
1451
1460
|
}
|
|
1452
|
-
|
|
1461
|
+
j.style.width = `${z.pageWidthMm * Se}px`;
|
|
1453
1462
|
const X = xt(z, 96, {}, document);
|
|
1454
|
-
L.apply(X),
|
|
1463
|
+
L.apply(X), j.appendChild(X);
|
|
1455
1464
|
}), dt();
|
|
1456
1465
|
}, { flush: "post" }), Q(() => L.query.value, (i) => {
|
|
1457
1466
|
i || A.value?.querySelectorAll(".mrp-page-holder").forEach((g) => {
|
|
1458
1467
|
L.clear(g);
|
|
1459
1468
|
});
|
|
1460
1469
|
});
|
|
1461
|
-
const _ =
|
|
1470
|
+
const _ = bn(o, {
|
|
1462
1471
|
thumbsRoot: b,
|
|
1463
1472
|
visible: I,
|
|
1464
1473
|
renderThumbCanvas: (i) => {
|
|
1465
1474
|
try {
|
|
1466
|
-
const g =
|
|
1467
|
-
return
|
|
1475
|
+
const g = o.value.pages[i], w = Math.min(0.2, 116 / Math.max(1, g.pageWidthMm * Se)), { canvases: N } = Xt(o.value, { start: i, end: i, dpr: w });
|
|
1476
|
+
return N[0] ?? null;
|
|
1468
1477
|
} catch {
|
|
1469
1478
|
return null;
|
|
1470
1479
|
}
|
|
@@ -1473,8 +1482,8 @@ const Gn = {
|
|
|
1473
1482
|
vt(() => {
|
|
1474
1483
|
_.schedule();
|
|
1475
1484
|
}, { flush: "post" });
|
|
1476
|
-
const zt = k(() =>
|
|
1477
|
-
plan:
|
|
1485
|
+
const zt = k(() => r.debug), { debugStats: me } = gn(zt, {
|
|
1486
|
+
plan: o,
|
|
1478
1487
|
pageCount: O,
|
|
1479
1488
|
windowRange: xe,
|
|
1480
1489
|
zoom: Z,
|
|
@@ -1484,41 +1493,41 @@ const Gn = {
|
|
|
1484
1493
|
Ke(W.value), _.schedule(), we.value === "fit" && it(), dt(!0);
|
|
1485
1494
|
}
|
|
1486
1495
|
function ft() {
|
|
1487
|
-
ye(
|
|
1496
|
+
ye(M === wt ? 100 : "fit");
|
|
1488
1497
|
try {
|
|
1489
|
-
const i = JSON.parse(localStorage.getItem(
|
|
1498
|
+
const i = JSON.parse(localStorage.getItem(M) ?? "{}");
|
|
1490
1499
|
i.zoomMode === "fit" ? ye("fit") : typeof i.zoomMode == "number" && ye(i.zoomMode);
|
|
1491
1500
|
} catch {
|
|
1492
1501
|
}
|
|
1493
1502
|
}
|
|
1494
1503
|
return jt(() => {
|
|
1495
|
-
window.addEventListener("resize", Qe), typeof ResizeObserver < "u" && W.value && (ke = new ResizeObserver(Qe), ke.observe(W.value)), Ke(W.value), ft(),
|
|
1504
|
+
window.addEventListener("resize", Qe), typeof ResizeObserver < "u" && W.value && (ke = new ResizeObserver(Qe), ke.observe(W.value)), Ke(W.value), ft(), r.autoLoad && de();
|
|
1496
1505
|
}), Ut(() => {
|
|
1497
|
-
|
|
1506
|
+
se = !0, Ne(), ie++, te?.abort(), te = null, window.removeEventListener("resize", Qe), ke?.disconnect(), ke = null, _.destroy(), L.reset(), Wt();
|
|
1498
1507
|
}), Q(
|
|
1499
|
-
() => [JSON.stringify(
|
|
1508
|
+
() => [JSON.stringify(V.value), JSON.stringify(r.params), Y.value],
|
|
1500
1509
|
() => {
|
|
1501
|
-
if (
|
|
1502
|
-
|
|
1510
|
+
if (r.autoLoad) {
|
|
1511
|
+
de();
|
|
1503
1512
|
return;
|
|
1504
1513
|
}
|
|
1505
|
-
|
|
1514
|
+
ie++, te?.abort(), te = null, l.value = !1, u.value = "", p.value = null, h.value = null, Me();
|
|
1506
1515
|
}
|
|
1507
|
-
), t({ reload:
|
|
1516
|
+
), t({ reload: de, print: Ze, exportAs: Je, openPdfWindow: Ge, gotoPage: ne, setParams: ct, checkPdfFont: Ce, state: ae }), (i, g) => (P(), $("div", {
|
|
1508
1517
|
class: oe(["mach-report-preview", { "mrp-wide-report": D.value }]),
|
|
1509
1518
|
style: re(St.value)
|
|
1510
1519
|
}, [
|
|
1511
|
-
J.value &&
|
|
1520
|
+
J.value && le.value.length > 0 ? (P(), Vt(jn, {
|
|
1512
1521
|
key: 0,
|
|
1513
|
-
defs:
|
|
1514
|
-
modelValue:
|
|
1515
|
-
"onUpdate:modelValue": g[0] || (g[0] = (w) =>
|
|
1516
|
-
messages:
|
|
1522
|
+
defs: le.value,
|
|
1523
|
+
modelValue: ce.value,
|
|
1524
|
+
"onUpdate:modelValue": g[0] || (g[0] = (w) => ce.value = w),
|
|
1525
|
+
messages: c.value,
|
|
1517
1526
|
attempted: je.value,
|
|
1518
1527
|
onQuery: Rt,
|
|
1519
1528
|
onReset: Tt
|
|
1520
|
-
}, null, 8, ["defs", "modelValue", "messages", "attempted"])) :
|
|
1521
|
-
Kt(
|
|
1529
|
+
}, null, 8, ["defs", "modelValue", "messages", "attempted"])) : H("", !0),
|
|
1530
|
+
Kt(Sn, {
|
|
1522
1531
|
"page-count": O.value,
|
|
1523
1532
|
"current-page": v.value,
|
|
1524
1533
|
"zoom-mode": x(we),
|
|
@@ -1526,7 +1535,7 @@ const Gn = {
|
|
|
1526
1535
|
"show-export": y.value,
|
|
1527
1536
|
"show-print": R.value,
|
|
1528
1537
|
"show-pdf-window": T.value,
|
|
1529
|
-
messages:
|
|
1538
|
+
messages: c.value,
|
|
1530
1539
|
search: { visible: x(L).visible.value, query: x(L).query.value, matchIndex: x(L).matchIndex.value, matchCount: x(L).matchCount.value, searching: x(L).searching.value },
|
|
1531
1540
|
"thumbs-visible": I.value,
|
|
1532
1541
|
onGoto: ne,
|
|
@@ -1543,15 +1552,15 @@ const Gn = {
|
|
|
1543
1552
|
key: 1,
|
|
1544
1553
|
class: oe(["mrp-export-notice", `mrp-export-${h.value.kind}`]),
|
|
1545
1554
|
role: "alert"
|
|
1546
|
-
},
|
|
1547
|
-
f.value.status === "error" && (y.value || T.value) ? (P(), $("div",
|
|
1548
|
-
et(
|
|
1555
|
+
}, C(h.value.message), 3)) : H("", !0),
|
|
1556
|
+
f.value.status === "error" && (y.value || T.value) ? (P(), $("div", tr, [
|
|
1557
|
+
et(C(c.value.pdfFontUnavailable) + " ", 1),
|
|
1549
1558
|
F("button", {
|
|
1550
1559
|
type: "button",
|
|
1551
|
-
onClick:
|
|
1552
|
-
},
|
|
1553
|
-
])) :
|
|
1554
|
-
F("div",
|
|
1560
|
+
onClick: Ct
|
|
1561
|
+
}, C(c.value.retry), 1)
|
|
1562
|
+
])) : H("", !0),
|
|
1563
|
+
F("div", nr, [
|
|
1555
1564
|
F("div", {
|
|
1556
1565
|
ref_key: "viewportRef",
|
|
1557
1566
|
ref: W,
|
|
@@ -1559,16 +1568,16 @@ const Gn = {
|
|
|
1559
1568
|
tabindex: "0",
|
|
1560
1569
|
onWheel: Bt,
|
|
1561
1570
|
onKeydown: At,
|
|
1562
|
-
onScrollPassive: g[3] || (g[3] = (w) => x(
|
|
1571
|
+
onScrollPassive: g[3] || (g[3] = (w) => x(Dt)(w.target))
|
|
1563
1572
|
}, [
|
|
1564
|
-
l.value ? (P(), $("div",
|
|
1565
|
-
et(
|
|
1573
|
+
l.value ? (P(), $("div", rr, C(c.value.loading), 1)) : u.value ? (P(), $("div", or, [
|
|
1574
|
+
et(C(u.value) + " ", 1),
|
|
1566
1575
|
F("button", {
|
|
1567
1576
|
class: "mrp-retry",
|
|
1568
1577
|
type: "button",
|
|
1569
|
-
onClick:
|
|
1570
|
-
},
|
|
1571
|
-
])) : !
|
|
1578
|
+
onClick: de
|
|
1579
|
+
}, C(c.value.retry), 1)
|
|
1580
|
+
])) : !o.value || O.value === 0 ? (P(), $("div", ar, C(c.value.empty), 1)) : (P(), $("div", {
|
|
1572
1581
|
key: 3,
|
|
1573
1582
|
class: "mrp-scale",
|
|
1574
1583
|
style: re({ width: `${x(Ve).w * x(Z)}px`, height: `${x(Ve).h * x(Z)}px` })
|
|
@@ -1584,18 +1593,18 @@ const Gn = {
|
|
|
1584
1593
|
class: "mrp-spacer-top",
|
|
1585
1594
|
style: re({ height: `${x(xe).padTopPx}px` }),
|
|
1586
1595
|
"aria-hidden": "true"
|
|
1587
|
-
}, null, 4)) :
|
|
1596
|
+
}, null, 4)) : H("", !0),
|
|
1588
1597
|
(P(!0), $(Ee, null, We(x(ut), (w) => (P(), $("div", {
|
|
1589
1598
|
key: w.index,
|
|
1590
1599
|
class: "mrp-page-holder",
|
|
1591
1600
|
"data-page": w.index + 1
|
|
1592
|
-
}, null, 8,
|
|
1601
|
+
}, null, 8, sr))), 128)),
|
|
1593
1602
|
x(xe).padBottomPx > 0 ? (P(), $("div", {
|
|
1594
1603
|
key: 1,
|
|
1595
1604
|
class: "mrp-spacer-bottom",
|
|
1596
1605
|
style: re({ height: `${x(xe).padBottomPx}px` }),
|
|
1597
1606
|
"aria-hidden": "true"
|
|
1598
|
-
}, null, 4)) :
|
|
1607
|
+
}, null, 4)) : H("", !0)
|
|
1599
1608
|
], 4)
|
|
1600
1609
|
], 4))
|
|
1601
1610
|
], 544),
|
|
@@ -1612,68 +1621,68 @@ const Gn = {
|
|
|
1612
1621
|
class: "mrp-thumb-spacer",
|
|
1613
1622
|
style: re({ height: `${x(_).windowRange.value.padTopPx}px` }),
|
|
1614
1623
|
"aria-hidden": "true"
|
|
1615
|
-
}, null, 4)) :
|
|
1624
|
+
}, null, 4)) : H("", !0),
|
|
1616
1625
|
(P(!0), $(Ee, null, We(x(_).visibleThumbs.value, (w) => (P(), $("div", {
|
|
1617
1626
|
key: w.index,
|
|
1618
1627
|
class: oe(["mrp-thumb", { "mrp-thumb-active": w.index + 1 === v.value }]),
|
|
1619
1628
|
style: re({ height: `${w.height + 20}px` }),
|
|
1620
|
-
onClick: (
|
|
1629
|
+
onClick: (N) => ne(w.index + 1)
|
|
1621
1630
|
}, [
|
|
1622
1631
|
F("div", {
|
|
1623
1632
|
class: "mrp-thumb-box",
|
|
1624
1633
|
"data-thumb": w.index + 1,
|
|
1625
1634
|
style: re({ height: `${w.height}px` })
|
|
1626
|
-
}, null, 12,
|
|
1627
|
-
F("span",
|
|
1628
|
-
], 14,
|
|
1635
|
+
}, null, 12, ir),
|
|
1636
|
+
F("span", ur, C(w.index + 1), 1)
|
|
1637
|
+
], 14, lr))), 128)),
|
|
1629
1638
|
x(_).windowRange.value.padBottomPx > 0 ? (P(), $("div", {
|
|
1630
1639
|
key: 1,
|
|
1631
1640
|
class: "mrp-thumb-spacer",
|
|
1632
1641
|
style: re({ height: `${x(_).windowRange.value.padBottomPx}px` }),
|
|
1633
1642
|
"aria-hidden": "true"
|
|
1634
|
-
}, null, 4)) :
|
|
1635
|
-
], 544)) :
|
|
1643
|
+
}, null, 4)) : H("", !0)
|
|
1644
|
+
], 544)) : H("", !0)
|
|
1636
1645
|
]),
|
|
1637
|
-
F("div",
|
|
1646
|
+
F("div", cr, [
|
|
1638
1647
|
Yt(i.$slots, "default", {}, void 0, !0)
|
|
1639
1648
|
]),
|
|
1640
|
-
x(
|
|
1649
|
+
x(me) ? (P(), $("div", dr, [
|
|
1641
1650
|
g[5] || (g[5] = F("div", null, "mach-report debug", -1)),
|
|
1642
|
-
F("div", null, "pages: " +
|
|
1643
|
-
F("div", null, "zoom: " +
|
|
1644
|
-
F("div", null, "plan: " +
|
|
1645
|
-
])) :
|
|
1651
|
+
F("div", null, "pages: " + C(x(me).pages) + " | window: [" + C(x(me).window) + "]", 1),
|
|
1652
|
+
F("div", null, "zoom: " + C(x(me).zoom) + " | load: " + C(x(me).loadMs), 1),
|
|
1653
|
+
F("div", null, "plan: " + C(x(me).planKB) + "KB", 1)
|
|
1654
|
+
])) : H("", !0)
|
|
1646
1655
|
], 6));
|
|
1647
1656
|
}
|
|
1648
|
-
}),
|
|
1657
|
+
}), pr = /* @__PURE__ */ st(fr, [["__scopeId", "data-v-48919dc8"]]), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1649
1658
|
__proto__: null,
|
|
1650
|
-
default:
|
|
1659
|
+
default: pr
|
|
1651
1660
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1652
1661
|
export {
|
|
1653
|
-
|
|
1654
|
-
|
|
1662
|
+
Un as D,
|
|
1663
|
+
he as M,
|
|
1655
1664
|
_e as P,
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1665
|
+
jn as R,
|
|
1666
|
+
$r as S,
|
|
1667
|
+
Vn as a,
|
|
1668
|
+
pr as b,
|
|
1669
|
+
Sn as c,
|
|
1661
1670
|
$t as d,
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
+
an as e,
|
|
1672
|
+
_n as f,
|
|
1673
|
+
xr as g,
|
|
1674
|
+
Kn as h,
|
|
1675
|
+
Er as i,
|
|
1676
|
+
yr as j,
|
|
1677
|
+
kr as k,
|
|
1678
|
+
er as l,
|
|
1679
|
+
rn as m,
|
|
1671
1680
|
Et as n,
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1681
|
+
sn as o,
|
|
1682
|
+
Pr as p,
|
|
1683
|
+
on as q,
|
|
1684
|
+
Yn as r,
|
|
1685
|
+
Cr as s,
|
|
1686
|
+
Zn as t,
|
|
1687
|
+
Jn as u
|
|
1679
1688
|
};
|