@agile-team/mach-report 0.5.0 → 0.7.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-CrVeTKu1.cjs +6 -0
- package/dist/ReportPreview-DgsOdO4y.js +559 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/builder/template-builder.d.ts +53 -0
- package/dist/compat/jh4j-template.d.ts +12 -0
- package/dist/defaults.d.ts +27 -0
- package/dist/index.cjs +6 -1663
- package/dist/index.d.cts +13 -344
- package/dist/index.d.ts +13 -344
- package/dist/index.js +744 -1415
- package/dist/layout/paginate.d.ts +51 -0
- package/dist/layout/textwrap.d.ts +36 -0
- package/dist/manager/api.d.ts +45 -0
- package/dist/manager/index.d.ts +2 -0
- package/dist/manager/types.d.ts +50 -0
- package/dist/manager.cjs +1 -122
- package/dist/manager.d.cts +5 -97
- package/dist/manager.d.ts +5 -97
- package/dist/manager.js +66 -81
- package/dist/pdf/font-loader.d.ts +5 -0
- package/dist/pdf/index.d.ts +2 -0
- package/dist/pdf/render-pdf.d.ts +25 -0
- package/dist/pdf.cjs +84 -52530
- package/dist/pdf.d.cts +4 -31
- package/dist/pdf.d.ts +4 -31
- package/dist/pdf.js +22843 -39218
- package/dist/plugin-Cl-IqCqx.cjs +1 -0
- package/dist/plugin-Dp3kKWiQ.js +92 -0
- package/dist/render/canvas.d.ts +61 -0
- package/dist/render/dom.d.ts +10 -0
- package/dist/render/grid-geometry.d.ts +41 -0
- package/dist/render/style.d.ts +33 -0
- package/dist/render/window.d.ts +23 -0
- package/dist/schema/render-plan.d.ts +96 -0
- package/dist/schema/validate.d.ts +15 -0
- package/dist/sql/ast-check.d.ts +14 -0
- package/dist/sql/compile.d.ts +31 -0
- package/dist/sql/expr.d.ts +21 -0
- package/dist/sql/index.d.ts +4 -0
- package/dist/sql/tokenizer.d.ts +25 -0
- package/dist/sql.cjs +68 -45207
- package/dist/sql.d.cts +3 -93
- package/dist/sql.d.ts +3 -93
- package/dist/sql.js +37213 -41613
- package/dist/style-B3vxGDZd.cjs +3 -0
- package/dist/style-B7Xfo5I-.js +255 -0
- package/dist/style.css +1 -0
- package/dist/units.d.ts +11 -0
- package/dist/vue/ReportPreview.d.ts +165 -0
- package/dist/vue/ReportToolbar.d.ts +25 -0
- package/dist/vue/adapters.d.ts +40 -0
- package/dist/vue/async.d.cts +275 -0
- package/dist/vue/async.d.ts +275 -0
- package/dist/vue/composables/usePageWindow.d.ts +28 -0
- package/dist/vue/composables/usePrintExport.d.ts +19 -0
- package/dist/vue/composables/useZoom.d.ts +15 -0
- package/dist/vue/config.d.ts +79 -0
- package/dist/vue/controller.d.ts +24 -0
- package/dist/vue/errors.d.ts +16 -0
- package/dist/vue/index.d.cts +13 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/injection-keys.d.ts +14 -0
- package/dist/vue/local-adapter.d.ts +12 -0
- package/dist/vue/pdf-exporter.d.ts +13 -0
- package/dist/vue/plugin.d.ts +294 -0
- package/dist/vue-async.cjs +1 -0
- package/dist/vue-async.js +17 -0
- package/dist/vue.cjs +1 -0
- package/dist/vue.js +53 -0
- package/package.json +44 -6
- package/dist/textwrap-DWzM7pt1.d.cts +0 -135
- package/dist/textwrap-DWzM7pt1.d.ts +0 -135
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { MachReportPluginOptions } from './plugin';
|
|
2
|
+
/**
|
|
3
|
+
* 异步插件入口(@agile-team/mach-report/vue/async):
|
|
4
|
+
*
|
|
5
|
+
* 首屏敏感页面用异步全局组件代替静态 import——组件与其引擎依赖
|
|
6
|
+
* 拆为独立 chunk,路由级按需加载:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import AsyncMachReportPlugin, { preloadMachReport } from "@agile-team/mach-report/vue/async";
|
|
10
|
+
* app.use(AsyncMachReportPlugin, { baseUrl: "/sub/mach-report" });
|
|
11
|
+
* void preloadMachReport(); // 可选:路由 hover 时预取
|
|
12
|
+
* // 模板:<MachReportPreview temp-id="X" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
/** 全局异步组件(懒加载 ReportPreview 及其引擎分片;与主插件同源共享) */
|
|
16
|
+
export declare const MachReportPreview: {
|
|
17
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
tempId: {
|
|
19
|
+
type: import('vue').PropType<string | string[] | null>;
|
|
20
|
+
default: null;
|
|
21
|
+
};
|
|
22
|
+
furnitureTempId: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
params: {
|
|
27
|
+
type: import('vue').PropType<Record<string, string>>;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
height: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
autoLoad: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
showExport: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
showPrint: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
showPdfWindow: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
gapPx: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
messages: {
|
|
55
|
+
type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
preset: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
fetcher: {
|
|
63
|
+
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
64
|
+
default: null;
|
|
65
|
+
};
|
|
66
|
+
}>> & Readonly<{
|
|
67
|
+
onError?: ((message: string, detail?: {
|
|
68
|
+
code: string;
|
|
69
|
+
cause?: unknown;
|
|
70
|
+
} | undefined) => any) | undefined;
|
|
71
|
+
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
reload: () => Promise<void>;
|
|
74
|
+
print: () => Promise<void>;
|
|
75
|
+
exportAs: (format: string) => void;
|
|
76
|
+
openPdfWindow: () => void;
|
|
77
|
+
gotoPage: (n: number) => void;
|
|
78
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
79
|
+
error: (message: string, detail?: {
|
|
80
|
+
code: string;
|
|
81
|
+
cause?: unknown;
|
|
82
|
+
} | undefined) => any;
|
|
83
|
+
loaded: (pageCount: number) => any;
|
|
84
|
+
}, import('vue').PublicProps, {
|
|
85
|
+
height: string;
|
|
86
|
+
gapPx: number;
|
|
87
|
+
params: Record<string, string>;
|
|
88
|
+
furnitureTempId: string;
|
|
89
|
+
tempId: string | string[] | null;
|
|
90
|
+
showExport: boolean;
|
|
91
|
+
showPrint: boolean;
|
|
92
|
+
showPdfWindow: boolean;
|
|
93
|
+
messages: Partial<import('./config').MachReportMessages>;
|
|
94
|
+
autoLoad: boolean;
|
|
95
|
+
preset: string;
|
|
96
|
+
fetcher: import('./adapters').PlanFetcher | null;
|
|
97
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
98
|
+
viewportRef: HTMLDivElement;
|
|
99
|
+
containerRef: HTMLDivElement;
|
|
100
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
101
|
+
P: {};
|
|
102
|
+
B: {};
|
|
103
|
+
D: {};
|
|
104
|
+
C: {};
|
|
105
|
+
M: {};
|
|
106
|
+
Defaults: {};
|
|
107
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
108
|
+
tempId: {
|
|
109
|
+
type: import('vue').PropType<string | string[] | null>;
|
|
110
|
+
default: null;
|
|
111
|
+
};
|
|
112
|
+
furnitureTempId: {
|
|
113
|
+
type: StringConstructor;
|
|
114
|
+
default: string;
|
|
115
|
+
};
|
|
116
|
+
params: {
|
|
117
|
+
type: import('vue').PropType<Record<string, string>>;
|
|
118
|
+
default: () => {};
|
|
119
|
+
};
|
|
120
|
+
height: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
default: string;
|
|
123
|
+
};
|
|
124
|
+
autoLoad: {
|
|
125
|
+
type: BooleanConstructor;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
128
|
+
showExport: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: undefined;
|
|
131
|
+
};
|
|
132
|
+
showPrint: {
|
|
133
|
+
type: BooleanConstructor;
|
|
134
|
+
default: undefined;
|
|
135
|
+
};
|
|
136
|
+
showPdfWindow: {
|
|
137
|
+
type: BooleanConstructor;
|
|
138
|
+
default: undefined;
|
|
139
|
+
};
|
|
140
|
+
gapPx: {
|
|
141
|
+
type: NumberConstructor;
|
|
142
|
+
default: undefined;
|
|
143
|
+
};
|
|
144
|
+
messages: {
|
|
145
|
+
type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
|
|
146
|
+
default: undefined;
|
|
147
|
+
};
|
|
148
|
+
preset: {
|
|
149
|
+
type: StringConstructor;
|
|
150
|
+
default: undefined;
|
|
151
|
+
};
|
|
152
|
+
fetcher: {
|
|
153
|
+
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
154
|
+
default: null;
|
|
155
|
+
};
|
|
156
|
+
}>> & Readonly<{
|
|
157
|
+
onError?: ((message: string, detail?: {
|
|
158
|
+
code: string;
|
|
159
|
+
cause?: unknown;
|
|
160
|
+
} | undefined) => any) | undefined;
|
|
161
|
+
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
162
|
+
}>, {
|
|
163
|
+
reload: () => Promise<void>;
|
|
164
|
+
print: () => Promise<void>;
|
|
165
|
+
exportAs: (format: string) => void;
|
|
166
|
+
openPdfWindow: () => void;
|
|
167
|
+
gotoPage: (n: number) => void;
|
|
168
|
+
}, {}, {}, {}, {
|
|
169
|
+
height: string;
|
|
170
|
+
gapPx: number;
|
|
171
|
+
params: Record<string, string>;
|
|
172
|
+
furnitureTempId: string;
|
|
173
|
+
tempId: string | string[] | null;
|
|
174
|
+
showExport: boolean;
|
|
175
|
+
showPrint: boolean;
|
|
176
|
+
showPdfWindow: boolean;
|
|
177
|
+
messages: Partial<import('./config').MachReportMessages>;
|
|
178
|
+
autoLoad: boolean;
|
|
179
|
+
preset: string;
|
|
180
|
+
fetcher: import('./adapters').PlanFetcher | null;
|
|
181
|
+
}>;
|
|
182
|
+
__isFragment?: never;
|
|
183
|
+
__isTeleport?: never;
|
|
184
|
+
__isSuspense?: never;
|
|
185
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
186
|
+
tempId: {
|
|
187
|
+
type: import('vue').PropType<string | string[] | null>;
|
|
188
|
+
default: null;
|
|
189
|
+
};
|
|
190
|
+
furnitureTempId: {
|
|
191
|
+
type: StringConstructor;
|
|
192
|
+
default: string;
|
|
193
|
+
};
|
|
194
|
+
params: {
|
|
195
|
+
type: import('vue').PropType<Record<string, string>>;
|
|
196
|
+
default: () => {};
|
|
197
|
+
};
|
|
198
|
+
height: {
|
|
199
|
+
type: StringConstructor;
|
|
200
|
+
default: string;
|
|
201
|
+
};
|
|
202
|
+
autoLoad: {
|
|
203
|
+
type: BooleanConstructor;
|
|
204
|
+
default: boolean;
|
|
205
|
+
};
|
|
206
|
+
showExport: {
|
|
207
|
+
type: BooleanConstructor;
|
|
208
|
+
default: undefined;
|
|
209
|
+
};
|
|
210
|
+
showPrint: {
|
|
211
|
+
type: BooleanConstructor;
|
|
212
|
+
default: undefined;
|
|
213
|
+
};
|
|
214
|
+
showPdfWindow: {
|
|
215
|
+
type: BooleanConstructor;
|
|
216
|
+
default: undefined;
|
|
217
|
+
};
|
|
218
|
+
gapPx: {
|
|
219
|
+
type: NumberConstructor;
|
|
220
|
+
default: undefined;
|
|
221
|
+
};
|
|
222
|
+
messages: {
|
|
223
|
+
type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
|
|
224
|
+
default: undefined;
|
|
225
|
+
};
|
|
226
|
+
preset: {
|
|
227
|
+
type: StringConstructor;
|
|
228
|
+
default: undefined;
|
|
229
|
+
};
|
|
230
|
+
fetcher: {
|
|
231
|
+
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
232
|
+
default: null;
|
|
233
|
+
};
|
|
234
|
+
}>> & Readonly<{
|
|
235
|
+
onError?: ((message: string, detail?: {
|
|
236
|
+
code: string;
|
|
237
|
+
cause?: unknown;
|
|
238
|
+
} | undefined) => any) | undefined;
|
|
239
|
+
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
240
|
+
}>, {
|
|
241
|
+
reload: () => Promise<void>;
|
|
242
|
+
print: () => Promise<void>;
|
|
243
|
+
exportAs: (format: string) => void;
|
|
244
|
+
openPdfWindow: () => void;
|
|
245
|
+
gotoPage: (n: number) => void;
|
|
246
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
247
|
+
error: (message: string, detail?: {
|
|
248
|
+
code: string;
|
|
249
|
+
cause?: unknown;
|
|
250
|
+
} | undefined) => any;
|
|
251
|
+
loaded: (pageCount: number) => any;
|
|
252
|
+
}, string, {
|
|
253
|
+
height: string;
|
|
254
|
+
gapPx: number;
|
|
255
|
+
params: Record<string, string>;
|
|
256
|
+
furnitureTempId: string;
|
|
257
|
+
tempId: string | string[] | null;
|
|
258
|
+
showExport: boolean;
|
|
259
|
+
showPrint: boolean;
|
|
260
|
+
showPdfWindow: boolean;
|
|
261
|
+
messages: Partial<import('./config').MachReportMessages>;
|
|
262
|
+
autoLoad: boolean;
|
|
263
|
+
preset: string;
|
|
264
|
+
fetcher: import('./adapters').PlanFetcher | null;
|
|
265
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
266
|
+
$slots: {
|
|
267
|
+
default?(_: {}): any;
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
/** 预取组件分片(路由 hover / 空闲时调用,正式渲染零等待) */
|
|
271
|
+
export declare function preloadMachReport(): Promise<unknown>;
|
|
272
|
+
export declare const machReportAsyncPlugin: {
|
|
273
|
+
install(app: import('vue').App, options?: MachReportPluginOptions): void;
|
|
274
|
+
};
|
|
275
|
+
export default machReportAsyncPlugin;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { MachReportPluginOptions } from './plugin';
|
|
2
|
+
/**
|
|
3
|
+
* 异步插件入口(@agile-team/mach-report/vue/async):
|
|
4
|
+
*
|
|
5
|
+
* 首屏敏感页面用异步全局组件代替静态 import——组件与其引擎依赖
|
|
6
|
+
* 拆为独立 chunk,路由级按需加载:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import AsyncMachReportPlugin, { preloadMachReport } from "@agile-team/mach-report/vue/async";
|
|
10
|
+
* app.use(AsyncMachReportPlugin, { baseUrl: "/sub/mach-report" });
|
|
11
|
+
* void preloadMachReport(); // 可选:路由 hover 时预取
|
|
12
|
+
* // 模板:<MachReportPreview temp-id="X" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
/** 全局异步组件(懒加载 ReportPreview 及其引擎分片;与主插件同源共享) */
|
|
16
|
+
export declare const MachReportPreview: {
|
|
17
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
tempId: {
|
|
19
|
+
type: import('vue').PropType<string | string[] | null>;
|
|
20
|
+
default: null;
|
|
21
|
+
};
|
|
22
|
+
furnitureTempId: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
params: {
|
|
27
|
+
type: import('vue').PropType<Record<string, string>>;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
height: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
autoLoad: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
showExport: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
showPrint: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
showPdfWindow: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
gapPx: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
messages: {
|
|
55
|
+
type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
preset: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
fetcher: {
|
|
63
|
+
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
64
|
+
default: null;
|
|
65
|
+
};
|
|
66
|
+
}>> & Readonly<{
|
|
67
|
+
onError?: ((message: string, detail?: {
|
|
68
|
+
code: string;
|
|
69
|
+
cause?: unknown;
|
|
70
|
+
} | undefined) => any) | undefined;
|
|
71
|
+
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
reload: () => Promise<void>;
|
|
74
|
+
print: () => Promise<void>;
|
|
75
|
+
exportAs: (format: string) => void;
|
|
76
|
+
openPdfWindow: () => void;
|
|
77
|
+
gotoPage: (n: number) => void;
|
|
78
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
79
|
+
error: (message: string, detail?: {
|
|
80
|
+
code: string;
|
|
81
|
+
cause?: unknown;
|
|
82
|
+
} | undefined) => any;
|
|
83
|
+
loaded: (pageCount: number) => any;
|
|
84
|
+
}, import('vue').PublicProps, {
|
|
85
|
+
height: string;
|
|
86
|
+
gapPx: number;
|
|
87
|
+
params: Record<string, string>;
|
|
88
|
+
furnitureTempId: string;
|
|
89
|
+
tempId: string | string[] | null;
|
|
90
|
+
showExport: boolean;
|
|
91
|
+
showPrint: boolean;
|
|
92
|
+
showPdfWindow: boolean;
|
|
93
|
+
messages: Partial<import('./config').MachReportMessages>;
|
|
94
|
+
autoLoad: boolean;
|
|
95
|
+
preset: string;
|
|
96
|
+
fetcher: import('./adapters').PlanFetcher | null;
|
|
97
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
98
|
+
viewportRef: HTMLDivElement;
|
|
99
|
+
containerRef: HTMLDivElement;
|
|
100
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
101
|
+
P: {};
|
|
102
|
+
B: {};
|
|
103
|
+
D: {};
|
|
104
|
+
C: {};
|
|
105
|
+
M: {};
|
|
106
|
+
Defaults: {};
|
|
107
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
108
|
+
tempId: {
|
|
109
|
+
type: import('vue').PropType<string | string[] | null>;
|
|
110
|
+
default: null;
|
|
111
|
+
};
|
|
112
|
+
furnitureTempId: {
|
|
113
|
+
type: StringConstructor;
|
|
114
|
+
default: string;
|
|
115
|
+
};
|
|
116
|
+
params: {
|
|
117
|
+
type: import('vue').PropType<Record<string, string>>;
|
|
118
|
+
default: () => {};
|
|
119
|
+
};
|
|
120
|
+
height: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
default: string;
|
|
123
|
+
};
|
|
124
|
+
autoLoad: {
|
|
125
|
+
type: BooleanConstructor;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
128
|
+
showExport: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: undefined;
|
|
131
|
+
};
|
|
132
|
+
showPrint: {
|
|
133
|
+
type: BooleanConstructor;
|
|
134
|
+
default: undefined;
|
|
135
|
+
};
|
|
136
|
+
showPdfWindow: {
|
|
137
|
+
type: BooleanConstructor;
|
|
138
|
+
default: undefined;
|
|
139
|
+
};
|
|
140
|
+
gapPx: {
|
|
141
|
+
type: NumberConstructor;
|
|
142
|
+
default: undefined;
|
|
143
|
+
};
|
|
144
|
+
messages: {
|
|
145
|
+
type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
|
|
146
|
+
default: undefined;
|
|
147
|
+
};
|
|
148
|
+
preset: {
|
|
149
|
+
type: StringConstructor;
|
|
150
|
+
default: undefined;
|
|
151
|
+
};
|
|
152
|
+
fetcher: {
|
|
153
|
+
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
154
|
+
default: null;
|
|
155
|
+
};
|
|
156
|
+
}>> & Readonly<{
|
|
157
|
+
onError?: ((message: string, detail?: {
|
|
158
|
+
code: string;
|
|
159
|
+
cause?: unknown;
|
|
160
|
+
} | undefined) => any) | undefined;
|
|
161
|
+
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
162
|
+
}>, {
|
|
163
|
+
reload: () => Promise<void>;
|
|
164
|
+
print: () => Promise<void>;
|
|
165
|
+
exportAs: (format: string) => void;
|
|
166
|
+
openPdfWindow: () => void;
|
|
167
|
+
gotoPage: (n: number) => void;
|
|
168
|
+
}, {}, {}, {}, {
|
|
169
|
+
height: string;
|
|
170
|
+
gapPx: number;
|
|
171
|
+
params: Record<string, string>;
|
|
172
|
+
furnitureTempId: string;
|
|
173
|
+
tempId: string | string[] | null;
|
|
174
|
+
showExport: boolean;
|
|
175
|
+
showPrint: boolean;
|
|
176
|
+
showPdfWindow: boolean;
|
|
177
|
+
messages: Partial<import('./config').MachReportMessages>;
|
|
178
|
+
autoLoad: boolean;
|
|
179
|
+
preset: string;
|
|
180
|
+
fetcher: import('./adapters').PlanFetcher | null;
|
|
181
|
+
}>;
|
|
182
|
+
__isFragment?: never;
|
|
183
|
+
__isTeleport?: never;
|
|
184
|
+
__isSuspense?: never;
|
|
185
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
186
|
+
tempId: {
|
|
187
|
+
type: import('vue').PropType<string | string[] | null>;
|
|
188
|
+
default: null;
|
|
189
|
+
};
|
|
190
|
+
furnitureTempId: {
|
|
191
|
+
type: StringConstructor;
|
|
192
|
+
default: string;
|
|
193
|
+
};
|
|
194
|
+
params: {
|
|
195
|
+
type: import('vue').PropType<Record<string, string>>;
|
|
196
|
+
default: () => {};
|
|
197
|
+
};
|
|
198
|
+
height: {
|
|
199
|
+
type: StringConstructor;
|
|
200
|
+
default: string;
|
|
201
|
+
};
|
|
202
|
+
autoLoad: {
|
|
203
|
+
type: BooleanConstructor;
|
|
204
|
+
default: boolean;
|
|
205
|
+
};
|
|
206
|
+
showExport: {
|
|
207
|
+
type: BooleanConstructor;
|
|
208
|
+
default: undefined;
|
|
209
|
+
};
|
|
210
|
+
showPrint: {
|
|
211
|
+
type: BooleanConstructor;
|
|
212
|
+
default: undefined;
|
|
213
|
+
};
|
|
214
|
+
showPdfWindow: {
|
|
215
|
+
type: BooleanConstructor;
|
|
216
|
+
default: undefined;
|
|
217
|
+
};
|
|
218
|
+
gapPx: {
|
|
219
|
+
type: NumberConstructor;
|
|
220
|
+
default: undefined;
|
|
221
|
+
};
|
|
222
|
+
messages: {
|
|
223
|
+
type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
|
|
224
|
+
default: undefined;
|
|
225
|
+
};
|
|
226
|
+
preset: {
|
|
227
|
+
type: StringConstructor;
|
|
228
|
+
default: undefined;
|
|
229
|
+
};
|
|
230
|
+
fetcher: {
|
|
231
|
+
type: import('vue').PropType<import('./adapters').PlanFetcher | null>;
|
|
232
|
+
default: null;
|
|
233
|
+
};
|
|
234
|
+
}>> & Readonly<{
|
|
235
|
+
onError?: ((message: string, detail?: {
|
|
236
|
+
code: string;
|
|
237
|
+
cause?: unknown;
|
|
238
|
+
} | undefined) => any) | undefined;
|
|
239
|
+
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
240
|
+
}>, {
|
|
241
|
+
reload: () => Promise<void>;
|
|
242
|
+
print: () => Promise<void>;
|
|
243
|
+
exportAs: (format: string) => void;
|
|
244
|
+
openPdfWindow: () => void;
|
|
245
|
+
gotoPage: (n: number) => void;
|
|
246
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
247
|
+
error: (message: string, detail?: {
|
|
248
|
+
code: string;
|
|
249
|
+
cause?: unknown;
|
|
250
|
+
} | undefined) => any;
|
|
251
|
+
loaded: (pageCount: number) => any;
|
|
252
|
+
}, string, {
|
|
253
|
+
height: string;
|
|
254
|
+
gapPx: number;
|
|
255
|
+
params: Record<string, string>;
|
|
256
|
+
furnitureTempId: string;
|
|
257
|
+
tempId: string | string[] | null;
|
|
258
|
+
showExport: boolean;
|
|
259
|
+
showPrint: boolean;
|
|
260
|
+
showPdfWindow: boolean;
|
|
261
|
+
messages: Partial<import('./config').MachReportMessages>;
|
|
262
|
+
autoLoad: boolean;
|
|
263
|
+
preset: string;
|
|
264
|
+
fetcher: import('./adapters').PlanFetcher | null;
|
|
265
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
266
|
+
$slots: {
|
|
267
|
+
default?(_: {}): any;
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
/** 预取组件分片(路由 hover / 空闲时调用,正式渲染零等待) */
|
|
271
|
+
export declare function preloadMachReport(): Promise<unknown>;
|
|
272
|
+
export declare const machReportAsyncPlugin: {
|
|
273
|
+
install(app: import('vue').App, options?: MachReportPluginOptions): void;
|
|
274
|
+
};
|
|
275
|
+
export default machReportAsyncPlugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { PlanPage, RenderPlan } from '@agile-team/mach-report';
|
|
3
|
+
/**
|
|
4
|
+
* 页级视口虚拟化(DOM 后端)。
|
|
5
|
+
*
|
|
6
|
+
* 坐标口径(与 transform: scale 缩放配合):
|
|
7
|
+
* - 页高/间距/占位均在"自然坐标系"(未缩放 px)维护
|
|
8
|
+
* - 视口滚动量与视口高换算回自然系(除以 zoom)后再进 computePageWindow
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePageWindow(plan: Ref<RenderPlan | null>, zoom: Ref<number>, options?: {
|
|
11
|
+
pxPerMm?: number;
|
|
12
|
+
gapPx?: number;
|
|
13
|
+
}): {
|
|
14
|
+
pageHeightsPx: import('vue').ComputedRef<number[]>;
|
|
15
|
+
contentSize: import('vue').ComputedRef<{
|
|
16
|
+
w: number;
|
|
17
|
+
h: number;
|
|
18
|
+
}>;
|
|
19
|
+
windowRange: import('vue').ComputedRef<import('@agile-team/mach-report').PageWindow>;
|
|
20
|
+
visiblePages: import('vue').ComputedRef<{
|
|
21
|
+
page: PlanPage;
|
|
22
|
+
index: number;
|
|
23
|
+
}[]>;
|
|
24
|
+
scrollTop: Ref<number, number>;
|
|
25
|
+
viewportHeight: Ref<number, number>;
|
|
26
|
+
makeScrollHandler: (currentPage: Ref<number>, pageCount: Ref<number>) => (vp: HTMLElement) => void;
|
|
27
|
+
refreshViewport(vp: HTMLElement | null): void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { RenderPlan } from '@agile-team/mach-report';
|
|
3
|
+
import { PdfExporter } from '../pdf-exporter';
|
|
4
|
+
interface PrintHtmlResult {
|
|
5
|
+
head: string;
|
|
6
|
+
pageChunks: string[];
|
|
7
|
+
}
|
|
8
|
+
/** 构建打印文档:head(含按尺寸分组的 @page 规则)+ 每页一段 HTML(供流式写入) */
|
|
9
|
+
export declare function buildPrintDocument(p: RenderPlan): PrintHtmlResult;
|
|
10
|
+
export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
|
|
11
|
+
getPdfExporter: () => PdfExporter;
|
|
12
|
+
onError: (message: string) => void;
|
|
13
|
+
}): {
|
|
14
|
+
print: () => Promise<void>;
|
|
15
|
+
exportAs: (format: string) => void;
|
|
16
|
+
openPdfWindow: () => void;
|
|
17
|
+
releasePrintFrame: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 缩放状态(transform: scale 方案):
|
|
3
|
+
* - fit 模式:按视口宽自适应(clamp 0.3~1)
|
|
4
|
+
* - raw 模式:固定百分比
|
|
5
|
+
* transform 而非 CSS zoom:标准属性、跨浏览器、零重排。
|
|
6
|
+
*/
|
|
7
|
+
export declare function useZoom(getFitInputs: () => {
|
|
8
|
+
viewport: HTMLElement | null;
|
|
9
|
+
pageWidthPx: number;
|
|
10
|
+
} | null): {
|
|
11
|
+
zoom: import('vue').Ref<number, number>;
|
|
12
|
+
zoomMode: import('vue').Ref<"fit" | "raw", "fit" | "raw">;
|
|
13
|
+
applyFitZoom: () => void;
|
|
14
|
+
setZoom: (mode: "fit" | number) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ComputedRef, CSSProperties } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 配置中心(对齐 mach-table 的 defineMachTableConfig 体验):
|
|
4
|
+
* - 应用级:app.use(machReportPlugin, { config: defineMachReportConfig({...}) })
|
|
5
|
+
* - 路由级叠加:provideMachReportConfig(overlay)(响应式,就近覆盖)
|
|
6
|
+
* - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
|
|
7
|
+
*/
|
|
8
|
+
/** 工具栏与状态文案(默认简体中文;出海场景覆写) */
|
|
9
|
+
export interface MachReportMessages {
|
|
10
|
+
title: string;
|
|
11
|
+
prevPage: string;
|
|
12
|
+
nextPage: string;
|
|
13
|
+
/** 页码显示模板,{cur}/{total} 占位 */
|
|
14
|
+
pageInfo: string;
|
|
15
|
+
fitWidth: string;
|
|
16
|
+
exportHtml: string;
|
|
17
|
+
exportPdf: string;
|
|
18
|
+
print: string;
|
|
19
|
+
pdfWindow: string;
|
|
20
|
+
loading: string;
|
|
21
|
+
empty: string;
|
|
22
|
+
errorPrefix: string;
|
|
23
|
+
retry: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const DEFAULT_MESSAGES: MachReportMessages;
|
|
26
|
+
/** 主题变量(组件外壳注入的 --mrp-* CSS 自定义属性) */
|
|
27
|
+
export interface MachReportTheme {
|
|
28
|
+
shellBg: string;
|
|
29
|
+
shellFg: string;
|
|
30
|
+
toolbarBg: string;
|
|
31
|
+
toolbarBorder: string;
|
|
32
|
+
toolbarFg: string;
|
|
33
|
+
btnFg: string;
|
|
34
|
+
btnBorder: string;
|
|
35
|
+
btnHoverBg: string;
|
|
36
|
+
btnHoverFg: string;
|
|
37
|
+
btnActiveBg: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_THEME: MachReportTheme;
|
|
40
|
+
/** defaults 层可配置项(全部可选,均有内置缺省) */
|
|
41
|
+
export interface MachReportDefaults {
|
|
42
|
+
showExport?: boolean;
|
|
43
|
+
showPrint?: boolean;
|
|
44
|
+
showPdfWindow?: boolean;
|
|
45
|
+
/** 页间距 px */
|
|
46
|
+
gapPx?: number;
|
|
47
|
+
/** PDF 导出中文字体 URL */
|
|
48
|
+
pdfFontUrl?: string;
|
|
49
|
+
theme?: Partial<MachReportTheme>;
|
|
50
|
+
messages?: Partial<MachReportMessages>;
|
|
51
|
+
}
|
|
52
|
+
export type MachReportPreset = MachReportDefaults;
|
|
53
|
+
export interface MachReportConfig {
|
|
54
|
+
defaults: MachReportDefaults;
|
|
55
|
+
presets: Record<string, MachReportPreset>;
|
|
56
|
+
/** 默认启用的 preset 名 */
|
|
57
|
+
defaultPreset?: string;
|
|
58
|
+
}
|
|
59
|
+
/** 类型化配置声明(纯类型助手,便于独立 config 文件) */
|
|
60
|
+
export declare function defineMachReportConfig(config: MachReportConfig): MachReportConfig;
|
|
61
|
+
/** 类型化 preset 声明 */
|
|
62
|
+
export declare function defineMachReportPreset(preset: MachReportPreset): MachReportPreset;
|
|
63
|
+
export type ResolvedConfig = Required<Pick<MachReportDefaults, "showExport" | "showPrint" | "showPdfWindow" | "gapPx">> & {
|
|
64
|
+
pdfFontUrl: string;
|
|
65
|
+
theme: MachReportTheme;
|
|
66
|
+
messages: MachReportMessages;
|
|
67
|
+
};
|
|
68
|
+
export declare function resolveConfig(config: MachReportConfig | null | undefined, presetName?: string): ResolvedConfig;
|
|
69
|
+
/** theme 对象 → CSS 自定义属性 style 对象(注入组件外壳) */
|
|
70
|
+
export declare function themeToCssVars(theme: Partial<MachReportTheme>): CSSProperties;
|
|
71
|
+
type ConfigRef = ComputedRef<MachReportConfig | null>;
|
|
72
|
+
/**
|
|
73
|
+
* 路由/布局级响应式叠加:就近提供配置层(如某路由关闭导出按钮)。
|
|
74
|
+
* 与应用级 config 合并(本层 defaults/presets 优先)。
|
|
75
|
+
*/
|
|
76
|
+
export declare function provideMachReportConfig(overlay: MachReportConfig | MachReportDefaults): void;
|
|
77
|
+
/** 组件内部读取当前生效配置层(未提供时返回 null → 走内置缺省) */
|
|
78
|
+
export declare function useMachReportConfig(): ConfigRef;
|
|
79
|
+
export {};
|