@agile-team/mach-report 0.7.0 → 0.8.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/dist/ReportPreview-BQE0C_37.cjs +6 -0
- package/dist/ReportPreview-D8X75aLV.js +825 -0
- package/dist/format.d.ts +35 -0
- package/dist/grid-geometry-BXpOxznT.cjs +1 -0
- package/dist/grid-geometry-Bs8QXz1X.js +65 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +839 -655
- package/dist/layout/paginate.d.ts +29 -0
- package/dist/pdf.cjs +46 -46
- package/dist/pdf.js +8 -7
- package/dist/{plugin-Cl-IqCqx.cjs → plugin-7W2Zy3Xc.cjs} +1 -1
- package/dist/{plugin-Dp3kKWiQ.js → plugin-Bc6Px9Lq.js} +3 -3
- package/dist/style-6ihHKVCM.js +192 -0
- package/dist/style-Xq08-IsV.cjs +3 -0
- package/dist/style.css +1 -1
- package/dist/vue/ReportPreview.d.ts +13 -0
- package/dist/vue/ReportToolbar.d.ts +15 -0
- package/dist/vue/async.d.cts +16 -0
- package/dist/vue/async.d.ts +16 -0
- package/dist/vue/composables/useHighlight.d.ts +8 -0
- package/dist/vue/composables/usePrintExport.d.ts +7 -0
- package/dist/vue/config.d.ts +9 -0
- package/dist/vue/plugin.d.ts +16 -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 +24 -23
- package/dist/xlsx/render-xlsx.d.ts +20 -0
- package/dist/xlsx.cjs +30 -0
- package/dist/xlsx.d.cts +5 -0
- package/dist/xlsx.d.ts +5 -0
- package/dist/xlsx.js +22647 -0
- package/package.json +13 -2
- package/dist/ReportPreview-CrVeTKu1.cjs +0 -6
- package/dist/ReportPreview-DgsOdO4y.js +0 -559
- package/dist/style-B3vxGDZd.cjs +0 -3
- package/dist/style-B7Xfo5I-.js +0 -255
package/dist/pdf.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { g as L1 } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
2
|
-
import { h as N1, i as U1, c as xo, d as hl, b as dl,
|
|
2
|
+
import { h as N1, i as U1, c as xo, d as hl, b as dl, L as vu, a as Ed, w as z1 } from "./style-6ihHKVCM.js";
|
|
3
|
+
import { r as j1 } from "./grid-geometry-Bs8QXz1X.js";
|
|
3
4
|
var pu = {}, vl;
|
|
4
5
|
function Hn() {
|
|
5
6
|
return vl || (vl = 1, (function(t) {
|
|
@@ -35924,7 +35925,7 @@ function FE(t) {
|
|
|
35924
35925
|
}
|
|
35925
35926
|
return e;
|
|
35926
35927
|
}
|
|
35927
|
-
async function
|
|
35928
|
+
async function OE(t, e = {}) {
|
|
35928
35929
|
const r = await Gn.create();
|
|
35929
35930
|
r.registerFontkit(wi);
|
|
35930
35931
|
const n = [], i = [];
|
|
@@ -35933,7 +35934,7 @@ async function TE(t, e = {}) {
|
|
|
35933
35934
|
subset: !0
|
|
35934
35935
|
}) : void 0) ?? s, l = /* @__PURE__ */ new Map();
|
|
35935
35936
|
function h(w, x, T) {
|
|
35936
|
-
return w ?
|
|
35937
|
+
return w ? z1(w, x, { fontSizePt: T }, o) : [];
|
|
35937
35938
|
}
|
|
35938
35939
|
function d(w) {
|
|
35939
35940
|
const x = l.get(w);
|
|
@@ -35967,7 +35968,7 @@ async function TE(t, e = {}) {
|
|
|
35967
35968
|
});
|
|
35968
35969
|
}
|
|
35969
35970
|
function g(w, x, T, A, R) {
|
|
35970
|
-
const P =
|
|
35971
|
+
const P = j1(x, T.widthMm, T.heightMm), I = hl(T.style), B = xo(T.style), j = ii(B.color, [0.2, 0.2, 0.2]), W = Math.max(0.1, B.widthPt);
|
|
35971
35972
|
for (const N of P.cells) {
|
|
35972
35973
|
const V = N.cell.style?.backgroundColor;
|
|
35973
35974
|
V && w.drawRectangle({
|
|
@@ -36121,7 +36122,7 @@ async function CE(t, e) {
|
|
|
36121
36122
|
}
|
|
36122
36123
|
}
|
|
36123
36124
|
const bf = /* @__PURE__ */ new Map(), wf = /* @__PURE__ */ new Map();
|
|
36124
|
-
async function
|
|
36125
|
+
async function kE(t) {
|
|
36125
36126
|
const e = bf.get(t);
|
|
36126
36127
|
if (e) return e;
|
|
36127
36128
|
const r = wf.get(t);
|
|
@@ -36147,6 +36148,6 @@ async function OE(t) {
|
|
|
36147
36148
|
}
|
|
36148
36149
|
}
|
|
36149
36150
|
export {
|
|
36150
|
-
|
|
36151
|
-
|
|
36151
|
+
kE as loadFontWithCache,
|
|
36152
|
+
OE as renderPlanToPdf
|
|
36152
36153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var O=Object.create;var E=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var U=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of b(e))!F.call(r,n)&&n!==t&&E(r,n,{get:()=>e[n],enumerable:!(o=A(e,n))||o.enumerable});return r};var M=(r,e,t)=>(t=r!=null?O(y(r)):{},U(e||!r||!r.__esModule?E(t,"default",{value:r,enumerable:!0}):t,r));const R=require("vue");function m(r){return r==null?[]:Array.isArray(r)?r.map(String).filter(e=>e!==""):String(r).split(",").map(e=>e.trim()).filter(e=>e!=="")}function j(r){return m(r).join(",")}class s extends Error{constructor(e){super(e),this.name="PlanLoadError"}}function P(r={}){const{baseUrl:e="",headers:t,credentials:o,timeoutMs:n=3e4}=r;return async({url:c,method:i,params:a})=>{const h=a&&Object.keys(a).length>0?`?${new URLSearchParams(a)}`:"",l=new AbortController,f=setTimeout(()=>l.abort(),n);let d;try{d=await fetch(`${e}${c}${h}`,{method:i.toUpperCase(),headers:{Accept:"application/json",...t},credentials:o,signal:l.signal})}catch(u){throw u instanceof DOMException&&u.name==="AbortError"?new s(`请求超时(${n}ms): ${c}`):new s(`请求失败(${c}): ${u instanceof Error?u.message:String(u)}`)}finally{clearTimeout(f)}if(!d.ok)throw new s(`HTTP ${d.status} ${c}`);return d.json()}}function p(r){const{request:e,baseUrl:t=""}=r;return async({tempIds:o,furnitureTempId:n,params:c})=>{if(o.length===0)throw new s("缺少报表模板 ID");const i={tempId:o.join(",")};n&&(i.furnitureTempId=n);for(const[l,f]of Object.entries(c||{}))l&&f!=null&&f!==""&&(i[l]=String(f));const a=await e({url:`${t}/report/codePrintReport/gridPlan`,method:"get",params:i});if(a&&a.code!=null&&a.code!==200)throw new s(String(a.message||"预览加载失败"));const h=a?.data?.pages;return{schemaVersion:"jh4j-compatible",pages:Array.isArray(h)?h:[]}}}function _(r={fontUrl:"/simhei.ttf"}){let e=null;return async t=>{e||(e=await import("@agile-team/mach-report/pdf"));const o=r.fontUrl?await e.loadFontWithCache(r.fontUrl):null,{bytes:n}=await e.renderPlanToPdf(t,o?{customFontBytes:o}:{});return n}}const T="mach-report/fetcher",g="mach-report/pdf-exporter",w="mach-report/config",$="mach-report/controller",C=R.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-
|
|
1
|
+
"use strict";var O=Object.create;var E=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var U=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of b(e))!F.call(r,n)&&n!==t&&E(r,n,{get:()=>e[n],enumerable:!(o=A(e,n))||o.enumerable});return r};var M=(r,e,t)=>(t=r!=null?O(y(r)):{},U(e||!r||!r.__esModule?E(t,"default",{value:r,enumerable:!0}):t,r));const R=require("vue");function m(r){return r==null?[]:Array.isArray(r)?r.map(String).filter(e=>e!==""):String(r).split(",").map(e=>e.trim()).filter(e=>e!=="")}function j(r){return m(r).join(",")}class s extends Error{constructor(e){super(e),this.name="PlanLoadError"}}function P(r={}){const{baseUrl:e="",headers:t,credentials:o,timeoutMs:n=3e4}=r;return async({url:c,method:i,params:a})=>{const h=a&&Object.keys(a).length>0?`?${new URLSearchParams(a)}`:"",l=new AbortController,f=setTimeout(()=>l.abort(),n);let d;try{d=await fetch(`${e}${c}${h}`,{method:i.toUpperCase(),headers:{Accept:"application/json",...t},credentials:o,signal:l.signal})}catch(u){throw u instanceof DOMException&&u.name==="AbortError"?new s(`请求超时(${n}ms): ${c}`):new s(`请求失败(${c}): ${u instanceof Error?u.message:String(u)}`)}finally{clearTimeout(f)}if(!d.ok)throw new s(`HTTP ${d.status} ${c}`);return d.json()}}function p(r){const{request:e,baseUrl:t=""}=r;return async({tempIds:o,furnitureTempId:n,params:c})=>{if(o.length===0)throw new s("缺少报表模板 ID");const i={tempId:o.join(",")};n&&(i.furnitureTempId=n);for(const[l,f]of Object.entries(c||{}))l&&f!=null&&f!==""&&(i[l]=String(f));const a=await e({url:`${t}/report/codePrintReport/gridPlan`,method:"get",params:i});if(a&&a.code!=null&&a.code!==200)throw new s(String(a.message||"预览加载失败"));const h=a?.data?.pages;return{schemaVersion:"jh4j-compatible",pages:Array.isArray(h)?h:[]}}}function _(r={fontUrl:"/simhei.ttf"}){let e=null;return async t=>{e||(e=await import("@agile-team/mach-report/pdf"));const o=r.fontUrl?await e.loadFontWithCache(r.fontUrl):null,{bytes:n}=await e.renderPlanToPdf(t,o?{customFontBytes:o}:{});return n}}const T="mach-report/fetcher",g="mach-report/pdf-exporter",w="mach-report/config",$="mach-report/controller",C=R.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-BQE0C_37.cjs")).then(r=>r.ReportPreview$1)),H={install(r,e={}){const t=e.fetcher??p({request:e.request??P({baseUrl:e.baseUrl}),baseUrl:e.baseUrl});r.provide(T,t);const o=e.pdfFontUrl??e.config?.defaults?.pdfFontUrl??"/simhei.ttf";r.provide(g,e.pdfExporter??_({fontUrl:o})),r.provide(w,R.computed(()=>e.config??null)),e.globalComponent!==!1&&r.component("MachReportPreview",C)}};exports.MACH_REPORT_CONFIG_KEY=w;exports.MACH_REPORT_CONTROLLER_KEY=$;exports.MACH_REPORT_FETCHER_KEY=T;exports.MACH_REPORT_PDF_EXPORTER_KEY=g;exports.MachReportPreview=C;exports.PlanLoadError=s;exports.createDefaultPdfExporter=_;exports.createFetchRequest=P;exports.createJh4jGridPlanFetcher=p;exports.joinTempIds=j;exports.machReportPlugin=H;exports.normalizeTempIds=m;
|
|
@@ -62,7 +62,7 @@ function w(r = { fontUrl: "/simhei.ttf" }) {
|
|
|
62
62
|
return a;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
const R = "mach-report/fetcher", b = "mach-report/pdf-exporter", y = "mach-report/config",
|
|
65
|
+
const R = "mach-report/fetcher", b = "mach-report/pdf-exporter", y = "mach-report/config", A = "mach-report/controller", U = d(() => import("./ReportPreview-D8X75aLV.js").then((r) => r.k)), C = {
|
|
66
66
|
install(r, e = {}) {
|
|
67
67
|
const o = e.fetcher ?? P({
|
|
68
68
|
request: e.request ?? E({ baseUrl: e.baseUrl }),
|
|
@@ -77,7 +77,7 @@ const R = "mach-report/fetcher", b = "mach-report/pdf-exporter", y = "mach-repor
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
A as M,
|
|
81
81
|
u as P,
|
|
82
82
|
y as a,
|
|
83
83
|
R as b,
|
|
@@ -87,6 +87,6 @@ export {
|
|
|
87
87
|
E as f,
|
|
88
88
|
P as g,
|
|
89
89
|
_ as j,
|
|
90
|
-
|
|
90
|
+
C as m,
|
|
91
91
|
g as n
|
|
92
92
|
};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
const C = 1.35, w = 10.5, x = 0.75, M = "#333333", S = "#000000", _ = "1.0.0-mach", R = "mach-local", I = "jh4j-compatible", L = 25.4, D = 96;
|
|
2
|
+
function m(t = 96) {
|
|
3
|
+
return t / 25.4;
|
|
4
|
+
}
|
|
5
|
+
function b(t, e = 96) {
|
|
6
|
+
return (t || 0) * m(e);
|
|
7
|
+
}
|
|
8
|
+
function H(t, e = 96) {
|
|
9
|
+
return t / m(e);
|
|
10
|
+
}
|
|
11
|
+
function P(t, e = 96) {
|
|
12
|
+
return t * e / 72;
|
|
13
|
+
}
|
|
14
|
+
function k(t, e) {
|
|
15
|
+
const r = 10 ** e;
|
|
16
|
+
return Math.round(t * r) / r;
|
|
17
|
+
}
|
|
18
|
+
const N = {
|
|
19
|
+
a3: { widthMm: 297, heightMm: 420 },
|
|
20
|
+
a4: { widthMm: 210, heightMm: 297 },
|
|
21
|
+
a5: { widthMm: 148, heightMm: 210 },
|
|
22
|
+
b4: { widthMm: 250, heightMm: 353 },
|
|
23
|
+
b5: { widthMm: 176, heightMm: 250 }
|
|
24
|
+
}, E = _;
|
|
25
|
+
function O(t) {
|
|
26
|
+
if (t && t.code != null && t.code !== 200)
|
|
27
|
+
throw new Error(String(t.message || "渲染计划加载失败"));
|
|
28
|
+
const e = t?.data?.pages;
|
|
29
|
+
return {
|
|
30
|
+
schemaVersion: E,
|
|
31
|
+
pages: Array.isArray(e) ? e : []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function z(t) {
|
|
35
|
+
return (t.kind === "image" || t.kind === "barcode" || t.kind === "qrcode" || t.kind === "chart") && !!t.imageData;
|
|
36
|
+
}
|
|
37
|
+
function p(t) {
|
|
38
|
+
return t.kind === "text" && Array.isArray(t.richParagraphs) && t.richParagraphs.length > 0;
|
|
39
|
+
}
|
|
40
|
+
const l = /[\u3000-\u9fff\uff00-\uffef]/, f = new Uint8Array(128);
|
|
41
|
+
{
|
|
42
|
+
for (const t of "iljtf.,:;'`|!()[]") f[t.charCodeAt(0)] = 1;
|
|
43
|
+
for (const t of "mwMW@") f[t.charCodeAt(0)] = 2;
|
|
44
|
+
for (let t = 48; t <= 57; t++) f[t] = 3;
|
|
45
|
+
for (let t = 65; t <= 90; t++) f[t] = 4;
|
|
46
|
+
f[32] = 5;
|
|
47
|
+
}
|
|
48
|
+
const T = [0.54, 0.26, 0.95, 0.59, 0.67, 0.3];
|
|
49
|
+
function g(t) {
|
|
50
|
+
const e = t.charCodeAt(0);
|
|
51
|
+
return e < 128 ? T[f[e]] : l.test(t) ? 1 : /[A-Z]/.test(t) ? 0.67 : 0.54;
|
|
52
|
+
}
|
|
53
|
+
const u = {
|
|
54
|
+
measureMm(t, e) {
|
|
55
|
+
const { fontSizePt: r, bold: n = !1, letterSpacingPt: c = 0 } = e, s = 25.4 / 72;
|
|
56
|
+
let i = 0;
|
|
57
|
+
for (const o of t)
|
|
58
|
+
i += g(o);
|
|
59
|
+
return n && (i *= 1.04), (i * r + c * t.length) * s;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function F() {
|
|
63
|
+
return u;
|
|
64
|
+
}
|
|
65
|
+
function j(t, e) {
|
|
66
|
+
return u.measureMm(t, e);
|
|
67
|
+
}
|
|
68
|
+
function v(t) {
|
|
69
|
+
let e;
|
|
70
|
+
return {
|
|
71
|
+
measureMm(r, n) {
|
|
72
|
+
if (e === void 0 && (e = t()), !e) return u.measureMm(r, n);
|
|
73
|
+
const c = n.fontSizePt * 96 / 72;
|
|
74
|
+
return e.font = `${n.bold ? "bold " : ""}${c}px sans-serif`, e.measureText(r).width * 25.4 / 96;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function A(t, e, r) {
|
|
79
|
+
const n = [];
|
|
80
|
+
let c = "", s = 0;
|
|
81
|
+
const i = () => {
|
|
82
|
+
c && (n.push({ text: c, widthMm: s, cjk: !1 }), c = "", s = 0);
|
|
83
|
+
};
|
|
84
|
+
for (const o of t) {
|
|
85
|
+
if (o === `
|
|
86
|
+
`) {
|
|
87
|
+
i(), n.push({ text: `
|
|
88
|
+
`, widthMm: 0, cjk: !1, br: !0 });
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (o === " ") {
|
|
92
|
+
i(), n.push({ text: o, widthMm: r.measureMm(o, e), cjk: !1, space: !0 });
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (l.test(o)) {
|
|
96
|
+
i(), n.push({ text: o, widthMm: r.measureMm(o, e), cjk: !0 });
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
c += o, s += r.measureMm(o, e);
|
|
100
|
+
}
|
|
101
|
+
return i(), n;
|
|
102
|
+
}
|
|
103
|
+
function U(t, e, r, n = u) {
|
|
104
|
+
if (!t) return [""];
|
|
105
|
+
const c = [];
|
|
106
|
+
let s = "", i = 0;
|
|
107
|
+
const o = () => {
|
|
108
|
+
c.push(s), s = "", i = 0;
|
|
109
|
+
};
|
|
110
|
+
for (const a of A(t, r, n)) {
|
|
111
|
+
if (a.br) {
|
|
112
|
+
o();
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (i + a.widthMm <= e) {
|
|
116
|
+
s += a.text, i += a.widthMm;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (a.space) {
|
|
120
|
+
o();
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (a.cjk) {
|
|
124
|
+
s.length > 0 && o(), s = a.text, i = a.widthMm;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (s.length > 0 && o(), a.widthMm <= e) {
|
|
128
|
+
s = a.text, i = a.widthMm;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
for (const h of a.text) {
|
|
132
|
+
const d = n.measureMm(h, r);
|
|
133
|
+
i + d > e && s.length > 0 && o(), s += h, i += d;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return o(), c;
|
|
137
|
+
}
|
|
138
|
+
function B(t, e = 96, r = 10.5) {
|
|
139
|
+
if (t?.fontSizePx != null)
|
|
140
|
+
return { fontSizePt: t.fontSizePx * 72 / e, fontSizePx: t.fontSizePx };
|
|
141
|
+
const n = t?.fontSize ?? r;
|
|
142
|
+
return { fontSizePt: n, fontSizePx: P(n, e) };
|
|
143
|
+
}
|
|
144
|
+
function V(t, e = M) {
|
|
145
|
+
return {
|
|
146
|
+
color: t?.borderColor ?? t?.lineColor ?? e,
|
|
147
|
+
widthPt: t?.lineWidthPt ?? 0.75
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function W(t, e = S) {
|
|
151
|
+
return t?.color ?? e;
|
|
152
|
+
}
|
|
153
|
+
function J(t) {
|
|
154
|
+
return t?.lineHeight ?? 1.35;
|
|
155
|
+
}
|
|
156
|
+
function q(t) {
|
|
157
|
+
const e = t?.borderTop !== !1, r = t?.borderRight !== !1, n = t?.borderBottom !== !1, c = t?.borderLeft !== !1;
|
|
158
|
+
return { top: e, right: r, bottom: n, left: c, inner: e || r || n || c };
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
D as C,
|
|
162
|
+
w as D,
|
|
163
|
+
C as L,
|
|
164
|
+
L as M,
|
|
165
|
+
N as P,
|
|
166
|
+
E as R,
|
|
167
|
+
I as S,
|
|
168
|
+
B as a,
|
|
169
|
+
p as b,
|
|
170
|
+
V as c,
|
|
171
|
+
q as d,
|
|
172
|
+
J as e,
|
|
173
|
+
W as f,
|
|
174
|
+
S as g,
|
|
175
|
+
u as h,
|
|
176
|
+
z as i,
|
|
177
|
+
x as j,
|
|
178
|
+
M as k,
|
|
179
|
+
R as l,
|
|
180
|
+
b as m,
|
|
181
|
+
_ as n,
|
|
182
|
+
g as o,
|
|
183
|
+
P as p,
|
|
184
|
+
v as q,
|
|
185
|
+
k as r,
|
|
186
|
+
F as s,
|
|
187
|
+
j as t,
|
|
188
|
+
m as u,
|
|
189
|
+
H as v,
|
|
190
|
+
U as w,
|
|
191
|
+
O as x
|
|
192
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const m="#333333",M="#000000",T="1.0.0-mach",A="mach-local",C="jh4j-compatible";function h(t=96){return t/25.4}function R(t,e=96){return(t||0)*h(e)}function I(t,e=96){return t/h(e)}function S(t,e=96){return t*e/72}function L(t,e){const r=10**e;return Math.round(t*r)/r}const x={a3:{widthMm:297,heightMm:420},a4:{widthMm:210,heightMm:297},a5:{widthMm:148,heightMm:210},b4:{widthMm:250,heightMm:353},b5:{widthMm:176,heightMm:250}},d=T;function H(t){if(t&&t.code!=null&&t.code!==200)throw new Error(String(t.message||"渲染计划加载失败"));const e=t?.data?.pages;return{schemaVersion:d,pages:Array.isArray(e)?e:[]}}function O(t){return(t.kind==="image"||t.kind==="barcode"||t.kind==="qrcode"||t.kind==="chart")&&!!t.imageData}function g(t){return t.kind==="text"&&Array.isArray(t.richParagraphs)&&t.richParagraphs.length>0}const l=/[\u3000-\u9fff\uff00-\uffef]/,f=new Uint8Array(128);{for(const t of"iljtf.,:;'`|!()[]")f[t.charCodeAt(0)]=1;for(const t of"mwMW@")f[t.charCodeAt(0)]=2;for(let t=48;t<=57;t++)f[t]=3;for(let t=65;t<=90;t++)f[t]=4;f[32]=5}const D=[.54,.26,.95,.59,.67,.3];function P(t){const e=t.charCodeAt(0);return e<128?D[f[e]]:l.test(t)?1:/[A-Z]/.test(t)?.67:.54}const a={measureMm(t,e){const{fontSizePt:r,bold:n=!1,letterSpacingPt:u=0}=e,c=25.4/72;let i=0;for(const o of t)i+=P(o);return n&&(i*=1.04),(i*r+u*t.length)*c}};function N(){return a}function w(t,e){return a.measureMm(t,e)}function F(t){let e;return{measureMm(r,n){if(e===void 0&&(e=t()),!e)return a.measureMm(r,n);const u=n.fontSizePt*96/72;return e.font=`${n.bold?"bold ":""}${u}px sans-serif`,e.measureText(r).width*25.4/96}}}function b(t,e,r){const n=[];let u="",c=0;const i=()=>{u&&(n.push({text:u,widthMm:c,cjk:!1}),u="",c=0)};for(const o of t){if(o===`
|
|
2
|
+
`){i(),n.push({text:`
|
|
3
|
+
`,widthMm:0,cjk:!1,br:!0});continue}if(o===" "){i(),n.push({text:o,widthMm:r.measureMm(o,e),cjk:!1,space:!0});continue}if(l.test(o)){i(),n.push({text:o,widthMm:r.measureMm(o,e),cjk:!0});continue}u+=o,c+=r.measureMm(o,e)}return i(),n}function k(t,e,r,n=a){if(!t)return[""];const u=[];let c="",i=0;const o=()=>{u.push(c),c="",i=0};for(const s of b(t,r,n)){if(s.br){o();continue}if(i+s.widthMm<=e){c+=s.text,i+=s.widthMm;continue}if(s.space){o();continue}if(s.cjk){c.length>0&&o(),c=s.text,i=s.widthMm;continue}if(c.length>0&&o(),s.widthMm<=e){c=s.text,i=s.widthMm;continue}for(const _ of s.text){const E=n.measureMm(_,r);i+E>e&&c.length>0&&o(),c+=_,i+=E}}return o(),u}function p(t,e=96,r=10.5){if(t?.fontSizePx!=null)return{fontSizePt:t.fontSizePx*72/e,fontSizePx:t.fontSizePx};const n=t?.fontSize??r;return{fontSizePt:n,fontSizePx:S(n,e)}}function v(t,e=m){return{color:t?.borderColor??t?.lineColor??e,widthPt:t?.lineWidthPt??.75}}function z(t,e=M){return t?.color??e}function U(t){return t?.lineHeight??1.35}function B(t){const e=t?.borderTop!==!1,r=t?.borderRight!==!1,n=t?.borderBottom!==!1,u=t?.borderLeft!==!1;return{top:e,right:r,bottom:n,left:u,inner:e||r||n||u}}exports.CSS_DPI=96;exports.DEFAULT_BORDER_PT=.75;exports.DEFAULT_FONT_PT=10.5;exports.DEFAULT_STROKE_COLOR=m;exports.DEFAULT_TEXT_COLOR=M;exports.LINE_HEIGHT=1.35;exports.MM_PER_INCH=25.4;exports.PAPER_SIZES=x;exports.RENDER_PLAN_SCHEMA_VERSION=d;exports.SCHEMA_VERSION_JH4J=C;exports.SCHEMA_VERSION_LOCAL=A;exports.SCHEMA_VERSION_MACH=T;exports.charWidthEm=P;exports.createCanvasMeasurer=F;exports.createHeuristicMeasurer=N;exports.heuristicMeasurer=a;exports.isImageBackedComponent=O;exports.isRichText=g;exports.measureTextMm=w;exports.mmToPx=R;exports.mmToPxFactor=h;exports.ptToPx=S;exports.pxToMm=I;exports.resolveBoxBorders=B;exports.resolveFontSize=p;exports.resolveLineHeight=U;exports.resolveStroke=v;exports.resolveTextColor=z;exports.round=L;exports.toRenderPlan=H;exports.wrapText=k;
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mrp-toolbar[data-v-
|
|
1
|
+
.mrp-toolbar[data-v-ad937777]{display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--mrp-toolbar-bg, #323639);border-bottom:1px solid var(--mrp-toolbar-border, #22252a);flex:none;flex-wrap:wrap}.mrp-title[data-v-ad937777]{font-size:13px;font-weight:600;margin-right:8px;color:var(--mrp-toolbar-fg, #e8e8e8)}.mrp-nav[data-v-ad937777]{background:transparent;color:var(--mrp-btn-fg, #cfcfcf);border:1px solid var(--mrp-btn-border, #4a4d52);border-radius:4px;padding:2px 8px;font-size:12px;cursor:pointer;white-space:nowrap}.mrp-nav[data-v-ad937777]:hover:not(:disabled){background:var(--mrp-btn-hover-bg, #414549);color:var(--mrp-btn-hover-fg, #fff)}.mrp-nav[data-v-ad937777]:disabled{opacity:.4;cursor:not-allowed}.mrp-active[data-v-ad937777]{background:var(--mrp-btn-active-bg, #2d5fb8);border-color:var(--mrp-btn-active-bg, #2d5fb8);color:#fff}.mrp-pageinfo[data-v-ad937777]{font-size:12px;min-width:56px;text-align:center;color:var(--mrp-toolbar-fg, #e8e8e8)}.mrp-spacer[data-v-ad937777]{flex:1}.mrp-search[data-v-ad937777]{display:flex;align-items:center;gap:4px}.mrp-search-input[data-v-ad937777]{background:#22252a;color:#e8e8e8;border:1px solid var(--mrp-btn-border, #4a4d52);border-radius:4px;padding:2px 8px;font-size:12px;width:150px;outline:none}.mrp-search-input[data-v-ad937777]:focus{border-color:var(--mrp-btn-active-bg, #2d5fb8)}.mrp-search-count[data-v-ad937777]{font-size:12px;color:var(--mrp-toolbar-fg, #e8e8e8);min-width:42px;text-align:center}.mach-report-preview[data-v-ee759bc4]{--mrp-shell-bg: #525659;--mrp-shell-fg: #e8e8e8;--mrp-toolbar-bg: #323639;--mrp-toolbar-border: #22252a;--mrp-toolbar-fg: #e8e8e8;--mrp-btn-fg: #cfcfcf;--mrp-btn-border: #4a4d52;--mrp-btn-hover-bg: #414549;--mrp-btn-hover-fg: #ffffff;--mrp-btn-active-bg: #2d5fb8;position:relative;display:flex;flex-direction:column;background:var(--mrp-shell-bg);color:var(--mrp-shell-fg);overflow:hidden}.mrp-main[data-v-ee759bc4]{display:flex;flex:1;min-height:0}.mrp-body[data-v-ee759bc4]{flex:1;overflow:auto;padding:24px;outline:none}.mrp-scale[data-v-ee759bc4]{margin:0 auto}.mrp-scale-inner[data-v-ee759bc4]{display:flex;flex-direction:column;align-items:center}.mrp-page-holder[data-v-ee759bc4]{background:#fff;box-shadow:0 2px 8px #00000059;margin-bottom:var(--v30a2b5ba);flex:none}.mrp-state[data-v-ee759bc4]{padding:40px;text-align:center;color:#bfbfbf;font-size:13px}.mrp-error[data-v-ee759bc4]{color:#ff9d9d}.mrp-retry[data-v-ee759bc4]{margin-left:12px;background:transparent;color:#8fb7ff;border:1px solid #5a7fbf;border-radius:4px;padding:1px 10px;cursor:pointer}.mrp-overlay[data-v-ee759bc4]{position:absolute;inset:0;pointer-events:none}.mrp-page-holder[data-v-ee759bc4] mark.mrp-hit{background:#ffe066;color:#7a5c00;border-radius:2px;padding:0 1px}.mrp-thumbs[data-v-ee759bc4]{width:140px;flex:none;overflow-y:auto;border-left:1px solid var(--mrp-toolbar-border);background:var(--mrp-toolbar-bg);padding:8px;display:flex;flex-direction:column;gap:8px}.mrp-thumb[data-v-ee759bc4]{cursor:pointer;text-align:center}.mrp-thumb-box[data-v-ee759bc4]{width:116px;background:#fff;box-shadow:0 1px 4px #0006;overflow:hidden;border:2px solid transparent}.mrp-thumb-active .mrp-thumb-box[data-v-ee759bc4]{border-color:var(--mrp-btn-active-bg)}.mrp-thumb-no[data-v-ee759bc4]{font-size:11px;color:var(--mrp-toolbar-fg)}.mrp-debug[data-v-ee759bc4]{position:absolute;right:8px;bottom:8px;background:#000000c7;color:#7ee787;font:11px/1.6 ui-monospace,monospace;padding:6px 10px;border-radius:6px;pointer-events:none;white-space:pre}
|
|
@@ -11,6 +11,7 @@ declare function __VLS_template(): {
|
|
|
11
11
|
refs: {
|
|
12
12
|
viewportRef: HTMLDivElement;
|
|
13
13
|
containerRef: HTMLDivElement;
|
|
14
|
+
thumbsRef: HTMLElement;
|
|
14
15
|
};
|
|
15
16
|
rootEl: HTMLDivElement;
|
|
16
17
|
};
|
|
@@ -64,6 +65,11 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
64
65
|
type: StringConstructor;
|
|
65
66
|
default: undefined;
|
|
66
67
|
};
|
|
68
|
+
/** 调试面板(也可用 URL ?mrp-debug=1 开启) */
|
|
69
|
+
debug: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
67
73
|
fetcher: {
|
|
68
74
|
type: PropType<PlanFetcher | null>;
|
|
69
75
|
default: null;
|
|
@@ -129,6 +135,11 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
129
135
|
type: StringConstructor;
|
|
130
136
|
default: undefined;
|
|
131
137
|
};
|
|
138
|
+
/** 调试面板(也可用 URL ?mrp-debug=1 开启) */
|
|
139
|
+
debug: {
|
|
140
|
+
type: BooleanConstructor;
|
|
141
|
+
default: boolean;
|
|
142
|
+
};
|
|
132
143
|
fetcher: {
|
|
133
144
|
type: PropType<PlanFetcher | null>;
|
|
134
145
|
default: null;
|
|
@@ -151,10 +162,12 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
151
162
|
messages: Partial<MachReportMessages>;
|
|
152
163
|
autoLoad: boolean;
|
|
153
164
|
preset: string;
|
|
165
|
+
debug: boolean;
|
|
154
166
|
fetcher: PlanFetcher | null;
|
|
155
167
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
156
168
|
viewportRef: HTMLDivElement;
|
|
157
169
|
containerRef: HTMLDivElement;
|
|
170
|
+
thumbsRef: HTMLElement;
|
|
158
171
|
}, HTMLDivElement>;
|
|
159
172
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
160
173
|
export default _default;
|
|
@@ -8,6 +8,13 @@ type __VLS_Props = {
|
|
|
8
8
|
showPrint: boolean;
|
|
9
9
|
showPdfWindow: boolean;
|
|
10
10
|
messages: MachReportMessages;
|
|
11
|
+
search: {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
query: string;
|
|
14
|
+
matchIndex: number;
|
|
15
|
+
matchCount: number;
|
|
16
|
+
};
|
|
17
|
+
thumbsVisible: boolean;
|
|
11
18
|
};
|
|
12
19
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
13
20
|
print: () => any;
|
|
@@ -15,11 +22,19 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
15
22
|
goto: (page: number) => any;
|
|
16
23
|
export: (format: "html" | "pdf") => any;
|
|
17
24
|
"pdf-window": () => any;
|
|
25
|
+
"search-input": (query: string) => any;
|
|
26
|
+
"search-nav": (dir: 1 | -1) => any;
|
|
27
|
+
"search-toggle": () => any;
|
|
28
|
+
"thumbs-toggle": () => any;
|
|
18
29
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
30
|
onPrint?: (() => any) | undefined;
|
|
20
31
|
onZoom?: ((mode: number | "fit") => any) | undefined;
|
|
21
32
|
onGoto?: ((page: number) => any) | undefined;
|
|
22
33
|
onExport?: ((format: "html" | "pdf") => any) | undefined;
|
|
23
34
|
"onPdf-window"?: (() => any) | undefined;
|
|
35
|
+
"onSearch-input"?: ((query: string) => any) | undefined;
|
|
36
|
+
"onSearch-nav"?: ((dir: 1 | -1) => any) | undefined;
|
|
37
|
+
"onSearch-toggle"?: (() => any) | undefined;
|
|
38
|
+
"onThumbs-toggle"?: (() => any) | undefined;
|
|
24
39
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
25
40
|
export default _default;
|
package/dist/vue/async.d.cts
CHANGED
|
@@ -59,6 +59,10 @@ export declare const MachReportPreview: {
|
|
|
59
59
|
type: StringConstructor;
|
|
60
60
|
default: undefined;
|
|
61
61
|
};
|
|
62
|
+
debug: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
62
66
|
fetcher: {
|
|
63
67
|
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
64
68
|
default: null;
|
|
@@ -93,10 +97,12 @@ export declare const MachReportPreview: {
|
|
|
93
97
|
messages: Partial<import('./config').MachReportMessages>;
|
|
94
98
|
autoLoad: boolean;
|
|
95
99
|
preset: string;
|
|
100
|
+
debug: boolean;
|
|
96
101
|
fetcher: import('./adapters').PlanFetcher | null;
|
|
97
102
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
98
103
|
viewportRef: HTMLDivElement;
|
|
99
104
|
containerRef: HTMLDivElement;
|
|
105
|
+
thumbsRef: HTMLElement;
|
|
100
106
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
101
107
|
P: {};
|
|
102
108
|
B: {};
|
|
@@ -149,6 +155,10 @@ export declare const MachReportPreview: {
|
|
|
149
155
|
type: StringConstructor;
|
|
150
156
|
default: undefined;
|
|
151
157
|
};
|
|
158
|
+
debug: {
|
|
159
|
+
type: BooleanConstructor;
|
|
160
|
+
default: boolean;
|
|
161
|
+
};
|
|
152
162
|
fetcher: {
|
|
153
163
|
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
154
164
|
default: null;
|
|
@@ -177,6 +187,7 @@ export declare const MachReportPreview: {
|
|
|
177
187
|
messages: Partial<import('./config').MachReportMessages>;
|
|
178
188
|
autoLoad: boolean;
|
|
179
189
|
preset: string;
|
|
190
|
+
debug: boolean;
|
|
180
191
|
fetcher: import('./adapters').PlanFetcher | null;
|
|
181
192
|
}>;
|
|
182
193
|
__isFragment?: never;
|
|
@@ -227,6 +238,10 @@ export declare const MachReportPreview: {
|
|
|
227
238
|
type: StringConstructor;
|
|
228
239
|
default: undefined;
|
|
229
240
|
};
|
|
241
|
+
debug: {
|
|
242
|
+
type: BooleanConstructor;
|
|
243
|
+
default: boolean;
|
|
244
|
+
};
|
|
230
245
|
fetcher: {
|
|
231
246
|
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
232
247
|
default: null;
|
|
@@ -261,6 +276,7 @@ export declare const MachReportPreview: {
|
|
|
261
276
|
messages: Partial<import('./config').MachReportMessages>;
|
|
262
277
|
autoLoad: boolean;
|
|
263
278
|
preset: string;
|
|
279
|
+
debug: boolean;
|
|
264
280
|
fetcher: import('./adapters').PlanFetcher | null;
|
|
265
281
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
266
282
|
$slots: {
|
package/dist/vue/async.d.ts
CHANGED
|
@@ -59,6 +59,10 @@ export declare const MachReportPreview: {
|
|
|
59
59
|
type: StringConstructor;
|
|
60
60
|
default: undefined;
|
|
61
61
|
};
|
|
62
|
+
debug: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
62
66
|
fetcher: {
|
|
63
67
|
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
64
68
|
default: null;
|
|
@@ -93,10 +97,12 @@ export declare const MachReportPreview: {
|
|
|
93
97
|
messages: Partial<import('./config').MachReportMessages>;
|
|
94
98
|
autoLoad: boolean;
|
|
95
99
|
preset: string;
|
|
100
|
+
debug: boolean;
|
|
96
101
|
fetcher: import('./adapters').PlanFetcher | null;
|
|
97
102
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
98
103
|
viewportRef: HTMLDivElement;
|
|
99
104
|
containerRef: HTMLDivElement;
|
|
105
|
+
thumbsRef: HTMLElement;
|
|
100
106
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
101
107
|
P: {};
|
|
102
108
|
B: {};
|
|
@@ -149,6 +155,10 @@ export declare const MachReportPreview: {
|
|
|
149
155
|
type: StringConstructor;
|
|
150
156
|
default: undefined;
|
|
151
157
|
};
|
|
158
|
+
debug: {
|
|
159
|
+
type: BooleanConstructor;
|
|
160
|
+
default: boolean;
|
|
161
|
+
};
|
|
152
162
|
fetcher: {
|
|
153
163
|
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
154
164
|
default: null;
|
|
@@ -177,6 +187,7 @@ export declare const MachReportPreview: {
|
|
|
177
187
|
messages: Partial<import('./config').MachReportMessages>;
|
|
178
188
|
autoLoad: boolean;
|
|
179
189
|
preset: string;
|
|
190
|
+
debug: boolean;
|
|
180
191
|
fetcher: import('./adapters').PlanFetcher | null;
|
|
181
192
|
}>;
|
|
182
193
|
__isFragment?: never;
|
|
@@ -227,6 +238,10 @@ export declare const MachReportPreview: {
|
|
|
227
238
|
type: StringConstructor;
|
|
228
239
|
default: undefined;
|
|
229
240
|
};
|
|
241
|
+
debug: {
|
|
242
|
+
type: BooleanConstructor;
|
|
243
|
+
default: boolean;
|
|
244
|
+
};
|
|
230
245
|
fetcher: {
|
|
231
246
|
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
232
247
|
default: null;
|
|
@@ -261,6 +276,7 @@ export declare const MachReportPreview: {
|
|
|
261
276
|
messages: Partial<import('./config').MachReportMessages>;
|
|
262
277
|
autoLoad: boolean;
|
|
263
278
|
preset: string;
|
|
279
|
+
debug: boolean;
|
|
264
280
|
fetcher: import('./adapters').PlanFetcher | null;
|
|
265
281
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
266
282
|
$slots: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 预览内文本高亮(搜索命中标记):
|
|
3
|
+
* - highlightTextNodes:TreeWalker 找文本节点,命中片段包 <mark class="mrp-hit">
|
|
4
|
+
* - clearHighlights:拆包还原(避免重复高亮叠加)
|
|
5
|
+
* 纯 DOM 操作,虚拟化窗口外的页不处理(随窗口重建自然清理)。
|
|
6
|
+
*/
|
|
7
|
+
export declare function clearHighlights(root: HTMLElement): void;
|
|
8
|
+
export declare function highlightTextNodes(root: HTMLElement, query: string): number;
|
|
@@ -7,6 +7,13 @@ interface PrintHtmlResult {
|
|
|
7
7
|
}
|
|
8
8
|
/** 构建打印文档:head(含按尺寸分组的 @page 规则)+ 每页一段 HTML(供流式写入) */
|
|
9
9
|
export declare function buildPrintDocument(p: RenderPlan): PrintHtmlResult;
|
|
10
|
+
/**
|
|
11
|
+
* 批量打印(多单连打):把多份计划合并为一个打印文档——
|
|
12
|
+
* named pages 保证混合纸张正确分页,浏览器只弹一次打印对话框。
|
|
13
|
+
*/
|
|
14
|
+
export declare function printPlans(plans: RenderPlan[], options?: {
|
|
15
|
+
onProgress?: (done: number, total: number) => void;
|
|
16
|
+
}): Promise<void>;
|
|
10
17
|
export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
|
|
11
18
|
getPdfExporter: () => PdfExporter;
|
|
12
19
|
onError: (message: string) => void;
|
package/dist/vue/config.d.ts
CHANGED
|
@@ -21,6 +21,15 @@ export interface MachReportMessages {
|
|
|
21
21
|
empty: string;
|
|
22
22
|
errorPrefix: string;
|
|
23
23
|
retry: string;
|
|
24
|
+
/** 搜索框占位文案 */
|
|
25
|
+
searchPlaceholder: string;
|
|
26
|
+
/** 搜索命中计数,{cur}/{total} 占位 */
|
|
27
|
+
matchInfo: string;
|
|
28
|
+
/** 上/下一个命中 */
|
|
29
|
+
prevMatch: string;
|
|
30
|
+
nextMatch: string;
|
|
31
|
+
/** 缩略图侧栏开关 */
|
|
32
|
+
thumbnails: string;
|
|
24
33
|
}
|
|
25
34
|
export declare const DEFAULT_MESSAGES: MachReportMessages;
|
|
26
35
|
/** 主题变量(组件外壳注入的 --mrp-* CSS 自定义属性) */
|
package/dist/vue/plugin.d.ts
CHANGED
|
@@ -52,6 +52,10 @@ export declare const MachReportPreview: {
|
|
|
52
52
|
type: StringConstructor;
|
|
53
53
|
default: undefined;
|
|
54
54
|
};
|
|
55
|
+
debug: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
55
59
|
fetcher: {
|
|
56
60
|
type: import('vue').PropType<PlanFetcher | null>;
|
|
57
61
|
default: null;
|
|
@@ -86,10 +90,12 @@ export declare const MachReportPreview: {
|
|
|
86
90
|
messages: Partial<import('./config').MachReportMessages>;
|
|
87
91
|
autoLoad: boolean;
|
|
88
92
|
preset: string;
|
|
93
|
+
debug: boolean;
|
|
89
94
|
fetcher: PlanFetcher | null;
|
|
90
95
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
91
96
|
viewportRef: HTMLDivElement;
|
|
92
97
|
containerRef: HTMLDivElement;
|
|
98
|
+
thumbsRef: HTMLElement;
|
|
93
99
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
94
100
|
P: {};
|
|
95
101
|
B: {};
|
|
@@ -142,6 +148,10 @@ export declare const MachReportPreview: {
|
|
|
142
148
|
type: StringConstructor;
|
|
143
149
|
default: undefined;
|
|
144
150
|
};
|
|
151
|
+
debug: {
|
|
152
|
+
type: BooleanConstructor;
|
|
153
|
+
default: boolean;
|
|
154
|
+
};
|
|
145
155
|
fetcher: {
|
|
146
156
|
type: import('vue').PropType<PlanFetcher | null>;
|
|
147
157
|
default: null;
|
|
@@ -170,6 +180,7 @@ export declare const MachReportPreview: {
|
|
|
170
180
|
messages: Partial<import('./config').MachReportMessages>;
|
|
171
181
|
autoLoad: boolean;
|
|
172
182
|
preset: string;
|
|
183
|
+
debug: boolean;
|
|
173
184
|
fetcher: PlanFetcher | null;
|
|
174
185
|
}>;
|
|
175
186
|
__isFragment?: never;
|
|
@@ -220,6 +231,10 @@ export declare const MachReportPreview: {
|
|
|
220
231
|
type: StringConstructor;
|
|
221
232
|
default: undefined;
|
|
222
233
|
};
|
|
234
|
+
debug: {
|
|
235
|
+
type: BooleanConstructor;
|
|
236
|
+
default: boolean;
|
|
237
|
+
};
|
|
223
238
|
fetcher: {
|
|
224
239
|
type: import('vue').PropType<PlanFetcher | null>;
|
|
225
240
|
default: null;
|
|
@@ -254,6 +269,7 @@ export declare const MachReportPreview: {
|
|
|
254
269
|
messages: Partial<import('./config').MachReportMessages>;
|
|
255
270
|
autoLoad: boolean;
|
|
256
271
|
preset: string;
|
|
272
|
+
debug: boolean;
|
|
257
273
|
fetcher: PlanFetcher | null;
|
|
258
274
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
259
275
|
$slots: {
|
package/dist/vue-async.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),i=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),i=require("./plugin-7W2Zy3Xc.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-BQE0C_37.cjs")).then(e=>e.ReportPreview$1));function c(){return Promise.resolve().then(()=>require("./ReportPreview-BQE0C_37.cjs")).then(e=>e.ReportPreview$1)}const t={install(e,o={}){i.machReportPlugin.install(e,o),e.component("MachReportPreview",r)}};exports.MachReportPreview=r;exports.default=t;exports.machReportAsyncPlugin=t;exports.preloadMachReport=c;
|
package/dist/vue-async.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineAsyncComponent as e } from "vue";
|
|
2
|
-
import { m as n } from "./plugin-
|
|
3
|
-
const r = e(() => import("./ReportPreview-
|
|
2
|
+
import { m as n } from "./plugin-Bc6Px9Lq.js";
|
|
3
|
+
const r = e(() => import("./ReportPreview-D8X75aLV.js").then((t) => t.k));
|
|
4
4
|
function m() {
|
|
5
|
-
return import("./ReportPreview-
|
|
5
|
+
return import("./ReportPreview-D8X75aLV.js").then((t) => t.k);
|
|
6
6
|
}
|
|
7
7
|
const p = {
|
|
8
8
|
install(t, o = {}) {
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReportPreview-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReportPreview-BQE0C_37.cjs"),r=require("./plugin-7W2Zy3Xc.cjs"),c=require("@agile-team/mach-report"),s=require("vue");function p(R){return async({tempIds:t})=>{if(t.length===0)throw new r.PlanLoadError("缺少报表模板 ID");const a=[];for(const n of t){const o=R[n];if(!o)throw new r.PlanLoadError(`本地模板 ${n} 不存在`);const{plan:E,warnings:i}=c.paginateTemplate(o.template,o.datasets??{});i.length>0&&console.warn("[mach-report] 分页告警:",i),a.push(...E.pages)}return{schemaVersion:"mach-local",pages:a}}}function P(){return s.inject(r.MACH_REPORT_CONTROLLER_KEY,null)}exports.DEFAULT_MESSAGES=e.DEFAULT_MESSAGES;exports.DEFAULT_THEME=e.DEFAULT_THEME;exports.MachReportError=e.MachReportError;exports.ReportPreview=e.ReportPreview;exports.ReportToolbar=e.ReportToolbar;exports.buildPrintDocument=e.buildPrintDocument;exports.defineMachReportConfig=e.defineMachReportConfig;exports.defineMachReportPreset=e.defineMachReportPreset;exports.printPlans=e.printPlans;exports.provideMachReportConfig=e.provideMachReportConfig;exports.resolveConfig=e.resolveConfig;exports.themeToCssVars=e.themeToCssVars;exports.toErrorDetail=e.toErrorDetail;exports.useMachReportConfig=e.useMachReportConfig;exports.usePageWindow=e.usePageWindow;exports.usePrintExport=e.usePrintExport;exports.useZoom=e.useZoom;exports.MACH_REPORT_CONFIG_KEY=r.MACH_REPORT_CONFIG_KEY;exports.MACH_REPORT_CONTROLLER_KEY=r.MACH_REPORT_CONTROLLER_KEY;exports.MACH_REPORT_FETCHER_KEY=r.MACH_REPORT_FETCHER_KEY;exports.MACH_REPORT_PDF_EXPORTER_KEY=r.MACH_REPORT_PDF_EXPORTER_KEY;exports.MachReportPreview=r.MachReportPreview;exports.PlanLoadError=r.PlanLoadError;exports.createDefaultPdfExporter=r.createDefaultPdfExporter;exports.createFetchRequest=r.createFetchRequest;exports.createJh4jGridPlanFetcher=r.createJh4jGridPlanFetcher;exports.joinTempIds=r.joinTempIds;exports.machReportPlugin=r.machReportPlugin;exports.normalizeTempIds=r.normalizeTempIds;exports.createLocalFetcher=p;exports.useReportPreview=P;
|