@agile-team/mach-report 2.3.2 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -5
- package/dist/ReportPreview-BVTpw9Tb.cjs +6 -0
- package/dist/ReportPreview-XF8iSUG1.js +1910 -0
- package/dist/grid-geometry-BNIvw52m.cjs +1 -0
- package/dist/{grid-geometry-Dw7BlENr.js → grid-geometry-C8hGoe9o.js} +10 -10
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +74 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.js +946 -782
- package/dist/number-format-BA_KwrZe.js +55 -0
- package/dist/number-format-CZ2T_5kF.cjs +1 -0
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +6 -0
- package/dist/pdf.d.ts +6 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-5R00MJQs.js → plugin-CKnSVuVe.js} +1 -1
- package/dist/{plugin-2lqgTX26.cjs → plugin-DwKr8oF6.cjs} +1 -1
- package/dist/render-plan-CCTL4F9v.cjs +1 -0
- package/dist/{render-plan-I9AHvQv7.js → render-plan-CXBWRog4.js} +12 -7
- package/dist/style.css +1 -1
- package/dist/vue/async.d.cts +598 -1
- package/dist/vue/async.d.ts +598 -1
- package/dist/vue/index.d.cts +820 -10
- package/dist/vue/index.d.ts +820 -10
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +96 -73
- package/dist/xlsx.cjs +24 -24
- package/dist/xlsx.d.cts +209 -0
- package/dist/xlsx.d.ts +209 -0
- package/dist/xlsx.js +9805 -9284
- package/package.json +1 -1
- package/dist/ReportPreview-B-mwUSk9.cjs +0 -6
- package/dist/ReportPreview-DKjr4cwO.js +0 -1688
- package/dist/defaults-D4o0NCLo.js +0 -9
- package/dist/defaults-DOO1yHwx.cjs +0 -1
- package/dist/grid-geometry-bkciiZ4Q.cjs +0 -1
- package/dist/render-plan-CfJ3wf1l.cjs +0 -1
package/dist/vue/index.d.cts
CHANGED
|
@@ -78,6 +78,14 @@ showParams: {
|
|
|
78
78
|
type: BooleanConstructor;
|
|
79
79
|
default: undefined;
|
|
80
80
|
};
|
|
81
|
+
editable: {
|
|
82
|
+
type: PropType<boolean | ReportEditingOptions>;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
excelImport: {
|
|
86
|
+
type: PropType<boolean | ExcelImportOptions>;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
81
89
|
fetcher: {
|
|
82
90
|
type: PropType<PlanFetcher | null>;
|
|
83
91
|
default: null;
|
|
@@ -90,6 +98,9 @@ openPdfWindow: typeof openPdfWindow;
|
|
|
90
98
|
gotoPage: typeof gotoPage;
|
|
91
99
|
setParams: typeof setParams;
|
|
92
100
|
checkPdfFont: typeof checkPdfFont;
|
|
101
|
+
importExcel: typeof importExcel;
|
|
102
|
+
getPlan: typeof getPlan;
|
|
103
|
+
getChanges: () => ReportCellEdit_2[];
|
|
93
104
|
state: ComputedRef<MachReportState>;
|
|
94
105
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
95
106
|
error: (message: string, detail?: {
|
|
@@ -98,6 +109,8 @@ cause?: unknown;
|
|
|
98
109
|
} | undefined) => any;
|
|
99
110
|
loaded: (pageCount: number) => any;
|
|
100
111
|
warning: (message: string) => any;
|
|
112
|
+
"cell-edit": (edit: ReportCellEdit_2) => any;
|
|
113
|
+
"template-import": (result: ExcelImportResult) => any;
|
|
101
114
|
}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
102
115
|
reportId: {
|
|
103
116
|
type: PropType<string | string[] | null>;
|
|
@@ -158,6 +171,14 @@ showParams: {
|
|
|
158
171
|
type: BooleanConstructor;
|
|
159
172
|
default: undefined;
|
|
160
173
|
};
|
|
174
|
+
editable: {
|
|
175
|
+
type: PropType<boolean | ReportEditingOptions>;
|
|
176
|
+
default: undefined;
|
|
177
|
+
};
|
|
178
|
+
excelImport: {
|
|
179
|
+
type: PropType<boolean | ExcelImportOptions>;
|
|
180
|
+
default: undefined;
|
|
181
|
+
};
|
|
161
182
|
fetcher: {
|
|
162
183
|
type: PropType<PlanFetcher | null>;
|
|
163
184
|
default: null;
|
|
@@ -169,7 +190,10 @@ cause?: unknown;
|
|
|
169
190
|
} | undefined) => any) | undefined;
|
|
170
191
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
171
192
|
onWarning?: ((message: string) => any) | undefined;
|
|
193
|
+
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
194
|
+
"onTemplate-import"?: ((result: ExcelImportResult) => any) | undefined;
|
|
172
195
|
}>, {
|
|
196
|
+
editable: boolean | ReportEditingOptions;
|
|
173
197
|
height: string;
|
|
174
198
|
gapPx: number;
|
|
175
199
|
params: Record<string, string>;
|
|
@@ -180,11 +204,13 @@ showPrint: boolean;
|
|
|
180
204
|
showPdfWindow: boolean;
|
|
181
205
|
showParams: boolean;
|
|
182
206
|
messages: Partial<MachReportMessages>;
|
|
207
|
+
excelImport: boolean | ExcelImportOptions;
|
|
183
208
|
autoLoad: boolean;
|
|
184
209
|
preset: string;
|
|
185
210
|
paramDefs: ReportParamDef[] | undefined;
|
|
186
211
|
fetcher: PlanFetcher | null;
|
|
187
212
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
213
|
+
importInputRef: HTMLInputElement;
|
|
188
214
|
viewportRef: HTMLDivElement;
|
|
189
215
|
containerRef: HTMLDivElement;
|
|
190
216
|
thumbsRef: HTMLElement;
|
|
@@ -207,6 +233,8 @@ declare type __VLS_Props = {
|
|
|
207
233
|
searching?: boolean;
|
|
208
234
|
};
|
|
209
235
|
thumbsVisible: boolean;
|
|
236
|
+
showImport?: boolean;
|
|
237
|
+
busy?: boolean;
|
|
210
238
|
};
|
|
211
239
|
|
|
212
240
|
declare type __VLS_Props_2 = {
|
|
@@ -223,6 +251,7 @@ declare function __VLS_template(): {
|
|
|
223
251
|
default?(_: {}): any;
|
|
224
252
|
};
|
|
225
253
|
refs: {
|
|
254
|
+
importInputRef: HTMLInputElement;
|
|
226
255
|
viewportRef: HTMLDivElement;
|
|
227
256
|
containerRef: HTMLDivElement;
|
|
228
257
|
thumbsRef: HTMLElement;
|
|
@@ -254,6 +283,29 @@ export declare function buildWordHtml(p: RenderPlan): {
|
|
|
254
283
|
/** 检查失败只影响 PDF 诊断,不阻塞预览或其它输出。 */
|
|
255
284
|
declare function checkPdfFont(): Promise<PdfFontCheckResult>;
|
|
256
285
|
|
|
286
|
+
/**
|
|
287
|
+
* 列值格式化(声明式、JSON 可序列化)。
|
|
288
|
+
* 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
|
|
289
|
+
* 三后端(DOM/Canvas/PDF)零改动。
|
|
290
|
+
*
|
|
291
|
+
* 语义约定(v0.9 固化):
|
|
292
|
+
* - number.digits 显式给出 → 精确保留(12.5 + digits:2 → "12.50")
|
|
293
|
+
* - number.thousands 默认 false(千分位显式开启)
|
|
294
|
+
* - date 字符串按"本地时区的日历日"解析(YYYY-MM-DD / YYYY/MM/DD 直取年月日,
|
|
295
|
+
* 不经 Date 字符串构造——后者按 UTC 零点,负时区环境会少一天)
|
|
296
|
+
*/
|
|
297
|
+
declare type ColumnFormat = {
|
|
298
|
+
kind: "number";
|
|
299
|
+
thousands?: boolean;
|
|
300
|
+
digits?: number;
|
|
301
|
+
} | {
|
|
302
|
+
kind: "percent";
|
|
303
|
+
digits?: number;
|
|
304
|
+
} | {
|
|
305
|
+
kind: "date";
|
|
306
|
+
pattern?: string;
|
|
307
|
+
};
|
|
308
|
+
|
|
257
309
|
/**
|
|
258
310
|
* 列值格式化(声明式、JSON 可序列化)。
|
|
259
311
|
* 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
|
|
@@ -266,12 +318,37 @@ declare function checkPdfFont(): Promise<PdfFontCheckResult>;
|
|
|
266
318
|
* 不经 Date 字符串构造——后者按 UTC 零点,负时区环境会少一天)
|
|
267
319
|
*/
|
|
268
320
|
|
|
269
|
-
declare type
|
|
321
|
+
declare type ColumnFormat_2 =
|
|
270
322
|
| { kind: "number"; thousands?: boolean; digits?: number }
|
|
271
323
|
| { kind: "percent"; digits?: number }
|
|
272
324
|
| { kind: "date"; pattern?: string };
|
|
273
325
|
|
|
274
|
-
|
|
326
|
+
/**
|
|
327
|
+
* 列值格式化(声明式、JSON 可序列化)。
|
|
328
|
+
* 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
|
|
329
|
+
* 三后端(DOM/Canvas/PDF)零改动。
|
|
330
|
+
*
|
|
331
|
+
* 语义约定(v0.9 固化):
|
|
332
|
+
* - number.digits 显式给出 → 精确保留(12.5 + digits:2 → "12.50")
|
|
333
|
+
* - number.thousands 默认 false(千分位显式开启)
|
|
334
|
+
* - date 字符串按"本地时区的日历日"解析(YYYY-MM-DD / YYYY/MM/DD 直取年月日,
|
|
335
|
+
* 不经 Date 字符串构造——后者按 UTC 零点,负时区环境会少一天)
|
|
336
|
+
*/
|
|
337
|
+
declare type ColumnFormat_3 = {
|
|
338
|
+
kind: "number";
|
|
339
|
+
thousands?: boolean;
|
|
340
|
+
digits?: number;
|
|
341
|
+
} | {
|
|
342
|
+
kind: "percent";
|
|
343
|
+
digits?: number;
|
|
344
|
+
} | {
|
|
345
|
+
kind: "date";
|
|
346
|
+
pattern?: string;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
declare type ComponentKind = "text" | "image" | "barcode" | "qrcode" | "chart" | "line" | "rect" | "ellipse";
|
|
350
|
+
|
|
351
|
+
declare type ComponentKind_2 =
|
|
275
352
|
| "text"
|
|
276
353
|
| "image"
|
|
277
354
|
| "barcode"
|
|
@@ -281,6 +358,8 @@ declare type ComponentKind =
|
|
|
281
358
|
| "rect"
|
|
282
359
|
| "ellipse";
|
|
283
360
|
|
|
361
|
+
declare type ComponentKind_3 = "text" | "image" | "barcode" | "qrcode" | "chart" | "line" | "rect" | "ellipse";
|
|
362
|
+
|
|
284
363
|
declare interface ComponentStyle {
|
|
285
364
|
fontSizePx?: number;
|
|
286
365
|
fontSize?: number;
|
|
@@ -305,6 +384,54 @@ declare interface ComponentStyle {
|
|
|
305
384
|
rotateDeg?: number;
|
|
306
385
|
}
|
|
307
386
|
|
|
387
|
+
declare interface ComponentStyle_2 {
|
|
388
|
+
fontSizePx?: number;
|
|
389
|
+
fontSize?: number;
|
|
390
|
+
fontFamily?: string;
|
|
391
|
+
bold?: boolean;
|
|
392
|
+
italic?: boolean;
|
|
393
|
+
underline?: boolean;
|
|
394
|
+
color?: string;
|
|
395
|
+
backgroundColor?: string;
|
|
396
|
+
align?: "left" | "center" | "right" | "justify";
|
|
397
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
398
|
+
lineColor?: string;
|
|
399
|
+
borderColor?: string;
|
|
400
|
+
lineWidthPt?: number;
|
|
401
|
+
borderTop?: boolean;
|
|
402
|
+
borderRight?: boolean;
|
|
403
|
+
borderBottom?: boolean;
|
|
404
|
+
borderLeft?: boolean;
|
|
405
|
+
lineHeight?: number;
|
|
406
|
+
letterSpacing?: number;
|
|
407
|
+
opacity?: number;
|
|
408
|
+
rotateDeg?: number;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
declare interface ComponentStyle_3 {
|
|
412
|
+
fontSizePx?: number;
|
|
413
|
+
fontSize?: number;
|
|
414
|
+
fontFamily?: string;
|
|
415
|
+
bold?: boolean;
|
|
416
|
+
italic?: boolean;
|
|
417
|
+
underline?: boolean;
|
|
418
|
+
color?: string;
|
|
419
|
+
backgroundColor?: string;
|
|
420
|
+
align?: "left" | "center" | "right" | "justify";
|
|
421
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
422
|
+
lineColor?: string;
|
|
423
|
+
borderColor?: string;
|
|
424
|
+
lineWidthPt?: number;
|
|
425
|
+
borderTop?: boolean;
|
|
426
|
+
borderRight?: boolean;
|
|
427
|
+
borderBottom?: boolean;
|
|
428
|
+
borderLeft?: boolean;
|
|
429
|
+
lineHeight?: number;
|
|
430
|
+
letterSpacing?: number;
|
|
431
|
+
opacity?: number;
|
|
432
|
+
rotateDeg?: number;
|
|
433
|
+
}
|
|
434
|
+
|
|
308
435
|
declare type ConfigRef = ComputedRef<MachReportConfig | null>;
|
|
309
436
|
|
|
310
437
|
/**
|
|
@@ -344,6 +471,104 @@ export declare function defineMachReportConfig(config?: MachReportConfigInput):
|
|
|
344
471
|
/** 类型化 preset 声明 */
|
|
345
472
|
export declare function defineMachReportPreset(preset: MachReportPreset): MachReportPreset;
|
|
346
473
|
|
|
474
|
+
declare interface ExcelImportedSheet {
|
|
475
|
+
name: string;
|
|
476
|
+
/** Original, one-based workbook position. */
|
|
477
|
+
index: number;
|
|
478
|
+
range: string;
|
|
479
|
+
rowCount: number;
|
|
480
|
+
columnCount: number;
|
|
481
|
+
/** Zero-based index into template.pages. */
|
|
482
|
+
pageStart: number;
|
|
483
|
+
pageCount: number;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
declare interface ExcelImportedSheet_2 {
|
|
487
|
+
name: string;
|
|
488
|
+
/** Original, one-based workbook position. */
|
|
489
|
+
index: number;
|
|
490
|
+
range: string;
|
|
491
|
+
rowCount: number;
|
|
492
|
+
columnCount: number;
|
|
493
|
+
/** Zero-based index into template.pages. */
|
|
494
|
+
pageStart: number;
|
|
495
|
+
pageCount: number;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Limits apply to the selected rectangular ranges, including their empty cells. */
|
|
499
|
+
declare interface ExcelImportLimits {
|
|
500
|
+
/** Compressed input, default 20 MiB. */
|
|
501
|
+
maxFileBytes?: number;
|
|
502
|
+
/** Declared ZIP uncompressed total, default 64 MiB. */
|
|
503
|
+
maxUncompressedBytes?: number;
|
|
504
|
+
/** Total selected cells across sheets, default 250,000; hard ceiling 1,000,000. */
|
|
505
|
+
maxCells?: number;
|
|
506
|
+
/** Rows per selected sheet, default 100,000; hard ceiling 1,048,576. */
|
|
507
|
+
maxRows?: number;
|
|
508
|
+
/** Columns per selected sheet, default 2,048; hard ceiling 16,384. */
|
|
509
|
+
maxColumns?: number;
|
|
510
|
+
/** Workbook sheets, default 32. */
|
|
511
|
+
maxSheets?: number;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/** Limits apply to the selected rectangular ranges, including their empty cells. */
|
|
515
|
+
declare interface ExcelImportLimits_2 {
|
|
516
|
+
/** Compressed input, default 20 MiB. */
|
|
517
|
+
maxFileBytes?: number;
|
|
518
|
+
/** Declared ZIP uncompressed total, default 64 MiB. */
|
|
519
|
+
maxUncompressedBytes?: number;
|
|
520
|
+
/** Total selected cells across sheets, default 250,000; hard ceiling 1,000,000. */
|
|
521
|
+
maxCells?: number;
|
|
522
|
+
/** Rows per selected sheet, default 100,000; hard ceiling 1,048,576. */
|
|
523
|
+
maxRows?: number;
|
|
524
|
+
/** Columns per selected sheet, default 2,048; hard ceiling 16,384. */
|
|
525
|
+
maxColumns?: number;
|
|
526
|
+
/** Workbook sheets, default 32. */
|
|
527
|
+
maxSheets?: number;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
declare interface ExcelImportOptions {
|
|
531
|
+
/** Sheet names or one-based workbook positions. Default: all visible sheets. */
|
|
532
|
+
sheets?: Array<string | number>;
|
|
533
|
+
/** A1 range for every sheet, or ranges keyed by exact sheet name. */
|
|
534
|
+
range?: string | Record<string, string>;
|
|
535
|
+
/** Wide preserves natural column widths. A3/A4 scale the complete width to paper. */
|
|
536
|
+
layout?: "wide" | "a3" | "a4";
|
|
537
|
+
/** Only applies to A3/A4; default landscape. */
|
|
538
|
+
landscape?: boolean;
|
|
539
|
+
/** Vertical preview segment limit, default 80, maximum 200. Merges remain intact. */
|
|
540
|
+
maxRowsPerPage?: number;
|
|
541
|
+
/** Optional resource limits; hard ceilings prevent unbounded allocations. */
|
|
542
|
+
limits?: ExcelImportLimits;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
declare interface ExcelImportOptions_2 {
|
|
546
|
+
/** Sheet names or one-based workbook positions. Default: all visible sheets. */
|
|
547
|
+
sheets?: Array<string | number>;
|
|
548
|
+
/** A1 range for every sheet, or ranges keyed by exact sheet name. */
|
|
549
|
+
range?: string | Record<string, string>;
|
|
550
|
+
/** Wide preserves natural column widths. A3/A4 scale the complete width to paper. */
|
|
551
|
+
layout?: "wide" | "a3" | "a4";
|
|
552
|
+
/** Only applies to A3/A4; default landscape. */
|
|
553
|
+
landscape?: boolean;
|
|
554
|
+
/** Vertical preview segment limit, default 80, maximum 200. Merges remain intact. */
|
|
555
|
+
maxRowsPerPage?: number;
|
|
556
|
+
/** Optional resource limits; hard ceilings prevent unbounded allocations. */
|
|
557
|
+
limits?: ExcelImportLimits_2;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
declare interface ExcelImportResult {
|
|
561
|
+
template: ReportTemplate;
|
|
562
|
+
warnings: string[];
|
|
563
|
+
sheets: ExcelImportedSheet[];
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare interface ExcelImportResult_2 {
|
|
567
|
+
template: ReportTemplate_3;
|
|
568
|
+
warnings: string[];
|
|
569
|
+
sheets: ExcelImportedSheet_2[];
|
|
570
|
+
}
|
|
571
|
+
|
|
347
572
|
declare function exportAs(format: string): Promise<void>;
|
|
348
573
|
|
|
349
574
|
export declare interface FetchRequestOptions {
|
|
@@ -356,6 +581,8 @@ export declare interface FetchRequestOptions {
|
|
|
356
581
|
timeoutMs?: number;
|
|
357
582
|
}
|
|
358
583
|
|
|
584
|
+
declare function getPlan(): RenderPlan | null;
|
|
585
|
+
|
|
359
586
|
declare function gotoPage(n: number): void;
|
|
360
587
|
|
|
361
588
|
declare interface GridCell {
|
|
@@ -365,12 +592,56 @@ declare interface GridCell {
|
|
|
365
592
|
value?: string | number | boolean | null;
|
|
366
593
|
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
367
594
|
numberFormat?: string;
|
|
595
|
+
/** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
|
|
596
|
+
valueType?: "text" | "number" | "boolean";
|
|
597
|
+
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
598
|
+
editable?: boolean;
|
|
599
|
+
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
600
|
+
formula?: string;
|
|
368
601
|
children?: PlanComponent[];
|
|
369
602
|
colSpan?: number;
|
|
370
603
|
rowSpan?: number;
|
|
371
604
|
style?: ComponentStyle;
|
|
372
605
|
}
|
|
373
606
|
|
|
607
|
+
declare interface GridCell_2 {
|
|
608
|
+
text?: string;
|
|
609
|
+
rawText?: string;
|
|
610
|
+
/** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
|
|
611
|
+
value?: string | number | boolean | null;
|
|
612
|
+
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
613
|
+
numberFormat?: string;
|
|
614
|
+
/** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
|
|
615
|
+
valueType?: "text" | "number" | "boolean";
|
|
616
|
+
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
617
|
+
editable?: boolean;
|
|
618
|
+
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
619
|
+
formula?: string;
|
|
620
|
+
children?: PlanComponent_2[];
|
|
621
|
+
colSpan?: number;
|
|
622
|
+
rowSpan?: number;
|
|
623
|
+
style?: ComponentStyle_2;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
declare interface GridCell_3 {
|
|
627
|
+
text?: string;
|
|
628
|
+
rawText?: string;
|
|
629
|
+
/** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
|
|
630
|
+
value?: string | number | boolean | null;
|
|
631
|
+
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
632
|
+
numberFormat?: string;
|
|
633
|
+
/** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
|
|
634
|
+
valueType?: "text" | "number" | "boolean";
|
|
635
|
+
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
636
|
+
editable?: boolean;
|
|
637
|
+
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
638
|
+
formula?: string;
|
|
639
|
+
children?: PlanComponent_3[];
|
|
640
|
+
colSpan?: number;
|
|
641
|
+
rowSpan?: number;
|
|
642
|
+
style?: ComponentStyle_3;
|
|
643
|
+
}
|
|
644
|
+
|
|
374
645
|
/** 通用请求函数签名(可适配 Axios 风格客户端) */
|
|
375
646
|
export declare type HostRequest = (config: {
|
|
376
647
|
url: string;
|
|
@@ -380,11 +651,20 @@ export declare type HostRequest = (config: {
|
|
|
380
651
|
signal?: AbortSignal;
|
|
381
652
|
}) => Promise<unknown>;
|
|
382
653
|
|
|
654
|
+
/** Import is an explicit local replacement; business mapping/storage remains in the host. */
|
|
655
|
+
declare function importExcel(input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions): Promise<ExcelImportResult | null>;
|
|
656
|
+
|
|
383
657
|
export declare function joinReportIds(reportId: ReportIdInput): string;
|
|
384
658
|
|
|
385
659
|
/** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
|
|
386
660
|
declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
|
|
387
661
|
|
|
662
|
+
/** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
|
|
663
|
+
declare type ListAlignment_2 = NonNullable<ComponentStyle_2["align"]> | "auto";
|
|
664
|
+
|
|
665
|
+
/** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
|
|
666
|
+
declare type ListAlignment_3 = NonNullable<ComponentStyle_3["align"]> | "auto";
|
|
667
|
+
|
|
388
668
|
declare interface ListColumn {
|
|
389
669
|
header: string;
|
|
390
670
|
field: string;
|
|
@@ -400,6 +680,52 @@ declare interface ListColumn {
|
|
|
400
680
|
format?: ColumnFormat;
|
|
401
681
|
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
402
682
|
rules?: StyleRule[];
|
|
683
|
+
/** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
|
|
684
|
+
editable?: boolean;
|
|
685
|
+
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
686
|
+
valueType?: GridCell["valueType"];
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
declare interface ListColumn_2 {
|
|
690
|
+
header: string;
|
|
691
|
+
field: string;
|
|
692
|
+
widthMm: number;
|
|
693
|
+
style?: ComponentStyle_2;
|
|
694
|
+
/** 内容对齐,优先于 style.align;数值字符串不会自动判为数字。 */
|
|
695
|
+
align?: ListAlignment_2;
|
|
696
|
+
/** 独立的表头对齐,不改变内容对齐。 */
|
|
697
|
+
headerAlign?: ComponentStyle_2["align"];
|
|
698
|
+
/** 独立的表头样式,优先于列表级表头样式。 */
|
|
699
|
+
headerStyle?: ComponentStyle_2;
|
|
700
|
+
/** 值格式化(声明式):千分位/小数位、百分比、日期 pattern */
|
|
701
|
+
format?: ColumnFormat_2;
|
|
702
|
+
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
703
|
+
rules?: StyleRule_2[];
|
|
704
|
+
/** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
|
|
705
|
+
editable?: boolean;
|
|
706
|
+
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
707
|
+
valueType?: GridCell_2["valueType"];
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
declare interface ListColumn_3 {
|
|
711
|
+
header: string;
|
|
712
|
+
field: string;
|
|
713
|
+
widthMm: number;
|
|
714
|
+
style?: ComponentStyle_3;
|
|
715
|
+
/** 内容对齐,优先于 style.align;数值字符串不会自动判为数字。 */
|
|
716
|
+
align?: ListAlignment_3;
|
|
717
|
+
/** 独立的表头对齐,不改变内容对齐。 */
|
|
718
|
+
headerAlign?: ComponentStyle_3["align"];
|
|
719
|
+
/** 独立的表头样式,优先于列表级表头样式。 */
|
|
720
|
+
headerStyle?: ComponentStyle_3;
|
|
721
|
+
/** 值格式化(声明式):千分位/小数位、百分比、日期 pattern */
|
|
722
|
+
format?: ColumnFormat_3;
|
|
723
|
+
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
724
|
+
rules?: StyleRule_3[];
|
|
725
|
+
/** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
|
|
726
|
+
editable?: boolean;
|
|
727
|
+
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
728
|
+
valueType?: GridCell_3["valueType"];
|
|
403
729
|
}
|
|
404
730
|
|
|
405
731
|
declare interface ListComponent {
|
|
@@ -432,11 +758,85 @@ declare interface ListComponent {
|
|
|
432
758
|
grandTotal?: ListGrandTotal;
|
|
433
759
|
}
|
|
434
760
|
|
|
435
|
-
declare
|
|
761
|
+
declare interface ListComponent_2 {
|
|
762
|
+
kind: "list";
|
|
763
|
+
id?: string;
|
|
764
|
+
/** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
|
|
765
|
+
layout?: "page" | "wide";
|
|
766
|
+
/** 逻辑表名称,供 Excel Sheet 命名;不额外生成标题组件。 */
|
|
767
|
+
title?: string;
|
|
768
|
+
leftMm: number;
|
|
769
|
+
topMm: number;
|
|
770
|
+
widthMm: number;
|
|
771
|
+
dataset: string;
|
|
772
|
+
columns: ListColumn_2[];
|
|
773
|
+
fontSizePt?: number;
|
|
774
|
+
headerBold?: boolean;
|
|
775
|
+
rowHeightMm?: number;
|
|
776
|
+
paddingMm?: number;
|
|
777
|
+
headerEveryPage?: boolean;
|
|
778
|
+
headerBackgroundColor?: string;
|
|
779
|
+
/** 内容默认对齐,列配置可覆盖;低层模板缺省仍为 left。 */
|
|
780
|
+
align?: ListAlignment_2;
|
|
781
|
+
/** 表头默认对齐,列配置可覆盖。 */
|
|
782
|
+
headerAlign?: ComponentStyle_2["align"];
|
|
783
|
+
headerStyle?: ComponentStyle_2;
|
|
784
|
+
border?: boolean;
|
|
785
|
+
/** 分组小计(组头/组尾小计/组头防孤行) */
|
|
786
|
+
groupBy?: ListGroupBy_2;
|
|
787
|
+
/** 末尾总合计行(依赖 groupBy.subtotal 或显式 fields) */
|
|
788
|
+
grandTotal?: ListGrandTotal_2;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
declare interface ListComponent_3 {
|
|
792
|
+
kind: "list";
|
|
793
|
+
id?: string;
|
|
794
|
+
/** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
|
|
795
|
+
layout?: "page" | "wide";
|
|
796
|
+
/** 逻辑表名称,供 Excel Sheet 命名;不额外生成标题组件。 */
|
|
797
|
+
title?: string;
|
|
798
|
+
leftMm: number;
|
|
799
|
+
topMm: number;
|
|
800
|
+
widthMm: number;
|
|
801
|
+
dataset: string;
|
|
802
|
+
columns: ListColumn_3[];
|
|
803
|
+
fontSizePt?: number;
|
|
804
|
+
headerBold?: boolean;
|
|
805
|
+
rowHeightMm?: number;
|
|
806
|
+
paddingMm?: number;
|
|
807
|
+
headerEveryPage?: boolean;
|
|
808
|
+
headerBackgroundColor?: string;
|
|
809
|
+
/** 内容默认对齐,列配置可覆盖;低层模板缺省仍为 left。 */
|
|
810
|
+
align?: ListAlignment_3;
|
|
811
|
+
/** 表头默认对齐,列配置可覆盖。 */
|
|
812
|
+
headerAlign?: ComponentStyle_3["align"];
|
|
813
|
+
headerStyle?: ComponentStyle_3;
|
|
814
|
+
border?: boolean;
|
|
815
|
+
/** 分组小计(组头/组尾小计/组头防孤行) */
|
|
816
|
+
groupBy?: ListGroupBy_3;
|
|
817
|
+
/** 末尾总合计行(依赖 groupBy.subtotal 或显式 fields) */
|
|
818
|
+
grandTotal?: ListGrandTotal_3;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
declare type ListGrandTotal = boolean | {
|
|
822
|
+
label?: string;
|
|
823
|
+
style?: ComponentStyle;
|
|
824
|
+
/** 合计列(缺省沿用 groupBy.subtotal) */
|
|
825
|
+
fields?: string[];
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
declare type ListGrandTotal_2 =
|
|
436
829
|
| boolean
|
|
437
830
|
| {
|
|
438
831
|
label?: string;
|
|
439
|
-
style?:
|
|
832
|
+
style?: ComponentStyle_2;
|
|
833
|
+
/** 合计列(缺省沿用 groupBy.subtotal) */
|
|
834
|
+
fields?: string[];
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
declare type ListGrandTotal_3 = boolean | {
|
|
838
|
+
label?: string;
|
|
839
|
+
style?: ComponentStyle_3;
|
|
440
840
|
/** 合计列(缺省沿用 groupBy.subtotal) */
|
|
441
841
|
fields?: string[];
|
|
442
842
|
};
|
|
@@ -456,8 +856,38 @@ declare interface ListGroupBy {
|
|
|
456
856
|
keepWithNext?: boolean;
|
|
457
857
|
}
|
|
458
858
|
|
|
859
|
+
/** 分组小计配置(声明式,见 ListComponent.groupBy) */
|
|
860
|
+
declare interface ListGroupBy_2 {
|
|
861
|
+
/** 分组字段(值变化即切组) */
|
|
862
|
+
field: string;
|
|
863
|
+
/** 组头文案模板,{value} 占位(默认 "{value}") */
|
|
864
|
+
headerTemplate?: string;
|
|
865
|
+
headerStyle?: ComponentStyle_2;
|
|
866
|
+
/** 需要小计的列字段(组尾输出合计行;数值列求和,其余输出首值/留空) */
|
|
867
|
+
subtotal?: string[];
|
|
868
|
+
subtotalStyle?: ComponentStyle_2;
|
|
869
|
+
subtotalLabel?: string;
|
|
870
|
+
/** 组头防孤行(默认 true:页尾放不下"组头+首行"时整体换页) */
|
|
871
|
+
keepWithNext?: boolean;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/** 分组小计配置(声明式,见 ListComponent.groupBy) */
|
|
875
|
+
declare interface ListGroupBy_3 {
|
|
876
|
+
/** 分组字段(值变化即切组) */
|
|
877
|
+
field: string;
|
|
878
|
+
/** 组头文案模板,{value} 占位(默认 "{value}") */
|
|
879
|
+
headerTemplate?: string;
|
|
880
|
+
headerStyle?: ComponentStyle_3;
|
|
881
|
+
/** 需要小计的列字段(组尾输出合计行;数值列求和,其余输出首值/留空) */
|
|
882
|
+
subtotal?: string[];
|
|
883
|
+
subtotalStyle?: ComponentStyle_3;
|
|
884
|
+
subtotalLabel?: string;
|
|
885
|
+
/** 组头防孤行(默认 true:页尾放不下"组头+首行"时整体换页) */
|
|
886
|
+
keepWithNext?: boolean;
|
|
887
|
+
}
|
|
888
|
+
|
|
459
889
|
export declare interface LocalTemplateEntry {
|
|
460
|
-
template:
|
|
890
|
+
template: ReportTemplate_2;
|
|
461
891
|
datasets?: Record<string, Record<string, unknown>[]>;
|
|
462
892
|
}
|
|
463
893
|
|
|
@@ -502,6 +932,11 @@ export declare interface MachReportController {
|
|
|
502
932
|
setParams(values: Record<string, string>, opts?: {
|
|
503
933
|
reload?: boolean;
|
|
504
934
|
}): Promise<void> | void;
|
|
935
|
+
/** Explicit import does not require the toolbar excelImport option. No host APIs are called. */
|
|
936
|
+
importExcel?(input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions): Promise<ExcelImportResult | null>;
|
|
937
|
+
/** Copies prevent consumers from mutating the preview's current snapshot. */
|
|
938
|
+
getPlan?(): RenderPlan | null;
|
|
939
|
+
getChanges?(): ReportCellEdit_2[];
|
|
505
940
|
}
|
|
506
941
|
|
|
507
942
|
/** defaults 层可配置项(全部可选,均有内置缺省) */
|
|
@@ -522,6 +957,10 @@ export declare interface MachReportDefaults {
|
|
|
522
957
|
preview?: MachReportPreviewOptions;
|
|
523
958
|
/** Excel 出口配置,按字段继承;不配置使用导出器默认值。 */
|
|
524
959
|
xlsx?: XlsxRenderOptions;
|
|
960
|
+
/** 默认关闭;true 为本地草稿,对象可提供权限、校验和保存回调。 */
|
|
961
|
+
editable?: boolean | ReportEditingOptions;
|
|
962
|
+
/** 默认关闭;启用后提供导入按钮。ExcelJS 仅在导入时加载。 */
|
|
963
|
+
excelImport?: boolean | ExcelImportOptions;
|
|
525
964
|
}
|
|
526
965
|
|
|
527
966
|
export declare class MachReportError extends Error {
|
|
@@ -534,7 +973,7 @@ export declare class MachReportError extends Error {
|
|
|
534
973
|
* 结构化错误(code 分类,宿主可按码决定 UX:重试 / 提示 / 降级)。
|
|
535
974
|
* error 事件契约保持 `(message: string)` 不变,新增第二参数 detail(可选)。
|
|
536
975
|
*/
|
|
537
|
-
export declare type MachReportErrorCode = "param" | "fetch" | "validate" | "render" | "pdf" | "print" | "export" | "config";
|
|
976
|
+
export declare type MachReportErrorCode = "param" | "fetch" | "validate" | "render" | "pdf" | "print" | "export" | "edit" | "import" | "config";
|
|
538
977
|
|
|
539
978
|
/** error 事件第二参数的形状(向后兼容:仅监听 message 的旧用法不受影响) */
|
|
540
979
|
export declare interface MachReportErrorDetail {
|
|
@@ -552,6 +991,9 @@ export declare interface MachReportHandle extends MachReportController {
|
|
|
552
991
|
setParams(values: Record<string, string>, opts?: {
|
|
553
992
|
reload?: boolean;
|
|
554
993
|
}): Promise<void>;
|
|
994
|
+
importExcel(input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions): Promise<ExcelImportResult | null>;
|
|
995
|
+
getPlan(): RenderPlan | null;
|
|
996
|
+
getChanges(): ReportCellEdit_2[];
|
|
555
997
|
}
|
|
556
998
|
|
|
557
999
|
/** 日志通道(默认 console;可注入 noop 静默或上报 collector) */
|
|
@@ -604,6 +1046,14 @@ export declare interface MachReportMessages {
|
|
|
604
1046
|
paramRequired: string;
|
|
605
1047
|
/** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
|
|
606
1048
|
searching?: string;
|
|
1049
|
+
importExcel?: string;
|
|
1050
|
+
importing?: string;
|
|
1051
|
+
editCell?: string;
|
|
1052
|
+
editingHint?: string;
|
|
1053
|
+
saving?: string;
|
|
1054
|
+
editInvalidNumber?: string;
|
|
1055
|
+
editInvalidBoolean?: string;
|
|
1056
|
+
editConflict?: string;
|
|
607
1057
|
}
|
|
608
1058
|
|
|
609
1059
|
/**
|
|
@@ -695,6 +1145,14 @@ export declare const MachReportPreview: {
|
|
|
695
1145
|
type: BooleanConstructor;
|
|
696
1146
|
default: undefined;
|
|
697
1147
|
};
|
|
1148
|
+
editable: {
|
|
1149
|
+
type: PropType<boolean | ReportEditingOptions>;
|
|
1150
|
+
default: undefined;
|
|
1151
|
+
};
|
|
1152
|
+
excelImport: {
|
|
1153
|
+
type: PropType<boolean | ExcelImportOptions_2>;
|
|
1154
|
+
default: undefined;
|
|
1155
|
+
};
|
|
698
1156
|
fetcher: {
|
|
699
1157
|
type: PropType<PlanFetcher | null>;
|
|
700
1158
|
default: null;
|
|
@@ -706,6 +1164,8 @@ export declare const MachReportPreview: {
|
|
|
706
1164
|
} | undefined) => any) | undefined;
|
|
707
1165
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
708
1166
|
onWarning?: ((message: string) => any) | undefined;
|
|
1167
|
+
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
1168
|
+
"onTemplate-import"?: ((result: ExcelImportResult_2) => any) | undefined;
|
|
709
1169
|
}>, {
|
|
710
1170
|
reload: () => Promise<void>;
|
|
711
1171
|
print: () => Promise<void>;
|
|
@@ -716,6 +1176,9 @@ export declare const MachReportPreview: {
|
|
|
716
1176
|
reload?: boolean;
|
|
717
1177
|
}) => Promise<void>;
|
|
718
1178
|
checkPdfFont: () => Promise<PdfFontCheckResult>;
|
|
1179
|
+
importExcel: (input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2) => Promise<ExcelImportResult_2 | null>;
|
|
1180
|
+
getPlan: () => RenderPlan | null;
|
|
1181
|
+
getChanges: () => ReportCellEdit_2[];
|
|
719
1182
|
state: ComputedRef<MachReportState>;
|
|
720
1183
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
721
1184
|
error: (message: string, detail?: {
|
|
@@ -724,7 +1187,10 @@ export declare const MachReportPreview: {
|
|
|
724
1187
|
} | undefined) => any;
|
|
725
1188
|
loaded: (pageCount: number) => any;
|
|
726
1189
|
warning: (message: string) => any;
|
|
1190
|
+
"cell-edit": (edit: ReportCellEdit_2) => any;
|
|
1191
|
+
"template-import": (result: ExcelImportResult_2) => any;
|
|
727
1192
|
}, PublicProps, {
|
|
1193
|
+
editable: boolean | ReportEditingOptions;
|
|
728
1194
|
height: string;
|
|
729
1195
|
gapPx: number;
|
|
730
1196
|
params: Record<string, string>;
|
|
@@ -735,11 +1201,13 @@ export declare const MachReportPreview: {
|
|
|
735
1201
|
showPdfWindow: boolean;
|
|
736
1202
|
showParams: boolean;
|
|
737
1203
|
messages: Partial<MachReportMessages>;
|
|
1204
|
+
excelImport: boolean | ExcelImportOptions_2;
|
|
738
1205
|
autoLoad: boolean;
|
|
739
1206
|
preset: string;
|
|
740
1207
|
paramDefs: ReportParamDef[] | undefined;
|
|
741
1208
|
fetcher: PlanFetcher | null;
|
|
742
1209
|
}, true, {}, {}, { [K in keyof GlobalComponents]: GlobalComponents[K] }, { [K in keyof GlobalDirectives]: GlobalDirectives[K] }, string, {
|
|
1210
|
+
importInputRef: HTMLInputElement;
|
|
743
1211
|
viewportRef: HTMLDivElement;
|
|
744
1212
|
containerRef: HTMLDivElement;
|
|
745
1213
|
thumbsRef: HTMLElement;
|
|
@@ -803,6 +1271,14 @@ export declare const MachReportPreview: {
|
|
|
803
1271
|
type: BooleanConstructor;
|
|
804
1272
|
default: undefined;
|
|
805
1273
|
};
|
|
1274
|
+
editable: {
|
|
1275
|
+
type: PropType<boolean | ReportEditingOptions>;
|
|
1276
|
+
default: undefined;
|
|
1277
|
+
};
|
|
1278
|
+
excelImport: {
|
|
1279
|
+
type: PropType<boolean | ExcelImportOptions_2>;
|
|
1280
|
+
default: undefined;
|
|
1281
|
+
};
|
|
806
1282
|
fetcher: {
|
|
807
1283
|
type: PropType<PlanFetcher | null>;
|
|
808
1284
|
default: null;
|
|
@@ -814,6 +1290,8 @@ export declare const MachReportPreview: {
|
|
|
814
1290
|
} | undefined) => any) | undefined;
|
|
815
1291
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
816
1292
|
onWarning?: ((message: string) => any) | undefined;
|
|
1293
|
+
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
1294
|
+
"onTemplate-import"?: ((result: ExcelImportResult_2) => any) | undefined;
|
|
817
1295
|
}>, {
|
|
818
1296
|
reload: () => Promise<void>;
|
|
819
1297
|
print: () => Promise<void>;
|
|
@@ -824,8 +1302,12 @@ export declare const MachReportPreview: {
|
|
|
824
1302
|
reload?: boolean;
|
|
825
1303
|
}) => Promise<void>;
|
|
826
1304
|
checkPdfFont: () => Promise<PdfFontCheckResult>;
|
|
1305
|
+
importExcel: (input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2) => Promise<ExcelImportResult_2 | null>;
|
|
1306
|
+
getPlan: () => RenderPlan | null;
|
|
1307
|
+
getChanges: () => ReportCellEdit_2[];
|
|
827
1308
|
state: ComputedRef<MachReportState>;
|
|
828
1309
|
}, {}, {}, {}, {
|
|
1310
|
+
editable: boolean | ReportEditingOptions;
|
|
829
1311
|
height: string;
|
|
830
1312
|
gapPx: number;
|
|
831
1313
|
params: Record<string, string>;
|
|
@@ -836,6 +1318,7 @@ export declare const MachReportPreview: {
|
|
|
836
1318
|
showPdfWindow: boolean;
|
|
837
1319
|
showParams: boolean;
|
|
838
1320
|
messages: Partial<MachReportMessages>;
|
|
1321
|
+
excelImport: boolean | ExcelImportOptions_2;
|
|
839
1322
|
autoLoad: boolean;
|
|
840
1323
|
preset: string;
|
|
841
1324
|
paramDefs: ReportParamDef[] | undefined;
|
|
@@ -897,6 +1380,14 @@ showParams: {
|
|
|
897
1380
|
type: BooleanConstructor;
|
|
898
1381
|
default: undefined;
|
|
899
1382
|
};
|
|
1383
|
+
editable: {
|
|
1384
|
+
type: PropType<boolean | ReportEditingOptions>;
|
|
1385
|
+
default: undefined;
|
|
1386
|
+
};
|
|
1387
|
+
excelImport: {
|
|
1388
|
+
type: PropType<boolean | ExcelImportOptions_2>;
|
|
1389
|
+
default: undefined;
|
|
1390
|
+
};
|
|
900
1391
|
fetcher: {
|
|
901
1392
|
type: PropType<PlanFetcher | null>;
|
|
902
1393
|
default: null;
|
|
@@ -908,6 +1399,8 @@ cause?: unknown;
|
|
|
908
1399
|
} | undefined) => any) | undefined;
|
|
909
1400
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
910
1401
|
onWarning?: ((message: string) => any) | undefined;
|
|
1402
|
+
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
1403
|
+
"onTemplate-import"?: ((result: ExcelImportResult_2) => any) | undefined;
|
|
911
1404
|
}>, {
|
|
912
1405
|
reload: () => Promise<void>;
|
|
913
1406
|
print: () => Promise<void>;
|
|
@@ -918,6 +1411,9 @@ setParams: (values: Record<string, string>, opts?: {
|
|
|
918
1411
|
reload?: boolean;
|
|
919
1412
|
}) => Promise<void>;
|
|
920
1413
|
checkPdfFont: () => Promise<PdfFontCheckResult>;
|
|
1414
|
+
importExcel: (input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2) => Promise<ExcelImportResult_2 | null>;
|
|
1415
|
+
getPlan: () => RenderPlan | null;
|
|
1416
|
+
getChanges: () => ReportCellEdit_2[];
|
|
921
1417
|
state: ComputedRef<MachReportState>;
|
|
922
1418
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
923
1419
|
error: (message: string, detail?: {
|
|
@@ -926,7 +1422,10 @@ cause?: unknown;
|
|
|
926
1422
|
} | undefined) => any;
|
|
927
1423
|
loaded: (pageCount: number) => any;
|
|
928
1424
|
warning: (message: string) => any;
|
|
1425
|
+
"cell-edit": (edit: ReportCellEdit_2) => any;
|
|
1426
|
+
"template-import": (result: ExcelImportResult_2) => any;
|
|
929
1427
|
}, string, {
|
|
1428
|
+
editable: boolean | ReportEditingOptions;
|
|
930
1429
|
height: string;
|
|
931
1430
|
gapPx: number;
|
|
932
1431
|
params: Record<string, string>;
|
|
@@ -937,6 +1436,7 @@ showPrint: boolean;
|
|
|
937
1436
|
showPdfWindow: boolean;
|
|
938
1437
|
showParams: boolean;
|
|
939
1438
|
messages: Partial<MachReportMessages>;
|
|
1439
|
+
excelImport: boolean | ExcelImportOptions_2;
|
|
940
1440
|
autoLoad: boolean;
|
|
941
1441
|
preset: string;
|
|
942
1442
|
paramDefs: ReportParamDef[] | undefined;
|
|
@@ -968,6 +1468,10 @@ export declare interface MachReportState {
|
|
|
968
1468
|
readonly canPrint: boolean;
|
|
969
1469
|
readonly error: Readonly<MachReportStateError> | null;
|
|
970
1470
|
readonly pdfFont: Readonly<PdfFontCheckResult>;
|
|
1471
|
+
readonly editing?: boolean;
|
|
1472
|
+
readonly saving?: boolean;
|
|
1473
|
+
readonly importing?: boolean;
|
|
1474
|
+
readonly dirty?: boolean;
|
|
971
1475
|
}
|
|
972
1476
|
|
|
973
1477
|
export declare interface MachReportStateError {
|
|
@@ -1046,6 +1550,48 @@ declare interface PlanComponent {
|
|
|
1046
1550
|
fallbackText?: string;
|
|
1047
1551
|
}
|
|
1048
1552
|
|
|
1553
|
+
declare interface PlanComponent_2 {
|
|
1554
|
+
kind: ComponentKind_2;
|
|
1555
|
+
leftMm: number;
|
|
1556
|
+
topMm: number;
|
|
1557
|
+
widthMm: number;
|
|
1558
|
+
heightMm: number;
|
|
1559
|
+
nid?: string;
|
|
1560
|
+
rkey?: string;
|
|
1561
|
+
text?: string;
|
|
1562
|
+
rawText?: string;
|
|
1563
|
+
lines?: string[];
|
|
1564
|
+
richParagraphs?: RichParagraph_2[];
|
|
1565
|
+
imageData?: string;
|
|
1566
|
+
grid?: PlanGrid_2;
|
|
1567
|
+
table?: PlanTableFragment_2;
|
|
1568
|
+
style?: ComponentStyle_2;
|
|
1569
|
+
meta?: Record<string, unknown>;
|
|
1570
|
+
/** MachReport 扩展字段:未知 kind 的兜底渲染标记 */
|
|
1571
|
+
fallbackText?: string;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
declare interface PlanComponent_3 {
|
|
1575
|
+
kind: ComponentKind_3;
|
|
1576
|
+
leftMm: number;
|
|
1577
|
+
topMm: number;
|
|
1578
|
+
widthMm: number;
|
|
1579
|
+
heightMm: number;
|
|
1580
|
+
nid?: string;
|
|
1581
|
+
rkey?: string;
|
|
1582
|
+
text?: string;
|
|
1583
|
+
rawText?: string;
|
|
1584
|
+
lines?: string[];
|
|
1585
|
+
richParagraphs?: RichParagraph_3[];
|
|
1586
|
+
imageData?: string;
|
|
1587
|
+
grid?: PlanGrid_3;
|
|
1588
|
+
table?: PlanTableFragment_3;
|
|
1589
|
+
style?: ComponentStyle_3;
|
|
1590
|
+
meta?: Record<string, unknown>;
|
|
1591
|
+
/** MachReport 扩展字段:未知 kind 的兜底渲染标记 */
|
|
1592
|
+
fallbackText?: string;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1049
1595
|
export declare interface PlanFetcher {
|
|
1050
1596
|
(input: ReportFetchInput): Promise<RenderPlan>;
|
|
1051
1597
|
getParamDefs?: ReportFetcher["getParamDefs"];
|
|
@@ -1061,6 +1607,26 @@ declare interface PlanGrid {
|
|
|
1061
1607
|
paddingMm?: number;
|
|
1062
1608
|
}
|
|
1063
1609
|
|
|
1610
|
+
declare interface PlanGrid_2 {
|
|
1611
|
+
/** 行内允许 null 空位;渲染器按空单元格处理 */
|
|
1612
|
+
cells: (GridCell_2 | null)[][];
|
|
1613
|
+
colWidthsMm?: number[];
|
|
1614
|
+
rowHeightsMm?: number[];
|
|
1615
|
+
gapMm?: number;
|
|
1616
|
+
/** 单元格四边内距;旧静态网格默认 0.5mm,分页列表使用其真实测量内距。 */
|
|
1617
|
+
paddingMm?: number;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
declare interface PlanGrid_3 {
|
|
1621
|
+
/** 行内允许 null 空位;渲染器按空单元格处理 */
|
|
1622
|
+
cells: (GridCell_3 | null)[][];
|
|
1623
|
+
colWidthsMm?: number[];
|
|
1624
|
+
rowHeightsMm?: number[];
|
|
1625
|
+
gapMm?: number;
|
|
1626
|
+
/** 单元格四边内距;旧静态网格默认 0.5mm,分页列表使用其真实测量内距。 */
|
|
1627
|
+
paddingMm?: number;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1064
1630
|
export declare class PlanLoadError extends Error {
|
|
1065
1631
|
constructor(message: string);
|
|
1066
1632
|
}
|
|
@@ -1074,7 +1640,7 @@ declare interface PlanPage {
|
|
|
1074
1640
|
marginBottomMm?: number;
|
|
1075
1641
|
marginLeftMm?: number;
|
|
1076
1642
|
marginRightMm?: number;
|
|
1077
|
-
components:
|
|
1643
|
+
components: PlanComponent_2[];
|
|
1078
1644
|
}
|
|
1079
1645
|
|
|
1080
1646
|
/** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
|
|
@@ -1090,6 +1656,32 @@ declare interface PlanTableFragment {
|
|
|
1090
1656
|
title?: string;
|
|
1091
1657
|
}
|
|
1092
1658
|
|
|
1659
|
+
/** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
|
|
1660
|
+
declare interface PlanTableFragment_2 {
|
|
1661
|
+
/** 在整个计划中唯一的逻辑表身份;同一表的分页片段共享身份。 */
|
|
1662
|
+
id: string;
|
|
1663
|
+
/** 表头固定 -1;其余行(包括组头/小计/总计)从 0 连续递增。 */
|
|
1664
|
+
rowIndex: number;
|
|
1665
|
+
role: "header" | "body" | "group-header" | "subtotal" | "grand-total";
|
|
1666
|
+
/** 按物理列顺序保存字段身份;不以表头显示文本判断列结构。 */
|
|
1667
|
+
columnKeys: string[];
|
|
1668
|
+
layout?: "page" | "wide";
|
|
1669
|
+
title?: string;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
|
|
1673
|
+
declare interface PlanTableFragment_3 {
|
|
1674
|
+
/** 在整个计划中唯一的逻辑表身份;同一表的分页片段共享身份。 */
|
|
1675
|
+
id: string;
|
|
1676
|
+
/** 表头固定 -1;其余行(包括组头/小计/总计)从 0 连续递增。 */
|
|
1677
|
+
rowIndex: number;
|
|
1678
|
+
role: "header" | "body" | "group-header" | "subtotal" | "grand-total";
|
|
1679
|
+
/** 按物理列顺序保存字段身份;不以表头显示文本判断列结构。 */
|
|
1680
|
+
columnKeys: string[];
|
|
1681
|
+
layout?: "page" | "wide";
|
|
1682
|
+
title?: string;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1093
1685
|
declare function print_2(): Promise<void>;
|
|
1094
1686
|
|
|
1095
1687
|
declare interface PrintHtmlResult {
|
|
@@ -1120,9 +1712,78 @@ declare interface RenderPlan {
|
|
|
1120
1712
|
pages: PlanPage[];
|
|
1121
1713
|
}
|
|
1122
1714
|
|
|
1715
|
+
/** 预览中的物理坐标;合并单元格使用左上角坐标。 */
|
|
1716
|
+
declare interface ReportCellAddress {
|
|
1717
|
+
pageIndex: number;
|
|
1718
|
+
componentIndex: number;
|
|
1719
|
+
rowIndex: number;
|
|
1720
|
+
columnIndex: number;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
/** 预览中的物理坐标;合并单元格使用左上角坐标。 */
|
|
1724
|
+
declare interface ReportCellAddress_2 {
|
|
1725
|
+
pageIndex: number;
|
|
1726
|
+
componentIndex: number;
|
|
1727
|
+
rowIndex: number;
|
|
1728
|
+
columnIndex: number;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
declare interface ReportCellContext {
|
|
1732
|
+
address: ReportCellAddress;
|
|
1733
|
+
cell: Readonly<GridCell>;
|
|
1734
|
+
component: Readonly<PlanComponent>;
|
|
1735
|
+
value: ReportCellValue;
|
|
1736
|
+
valueType: ReportCellValueType;
|
|
1737
|
+
table?: ReportCellTableIdentity;
|
|
1738
|
+
editable: boolean;
|
|
1739
|
+
readOnlyReason?: ReportCellReadOnlyReason;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
declare interface ReportCellEdit {
|
|
1743
|
+
address: ReportCellAddress;
|
|
1744
|
+
table?: ReportCellTableIdentity;
|
|
1745
|
+
previousValue: ReportCellValue;
|
|
1746
|
+
previousText: string;
|
|
1747
|
+
value: ReportCellValue;
|
|
1748
|
+
text: string;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
declare interface ReportCellEdit_2 {
|
|
1752
|
+
address: ReportCellAddress_2;
|
|
1753
|
+
table?: ReportCellTableIdentity_2;
|
|
1754
|
+
previousValue: ReportCellValue_2;
|
|
1755
|
+
previousText: string;
|
|
1756
|
+
value: ReportCellValue_2;
|
|
1757
|
+
text: string;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
declare type ReportCellReadOnlyReason = "cell" | "formula" | "complex" | "structure";
|
|
1761
|
+
|
|
1762
|
+
declare interface ReportCellTableIdentity {
|
|
1763
|
+
id: string;
|
|
1764
|
+
/** 逻辑表行索引;跨分页的同一行保持不变。 */
|
|
1765
|
+
rowIndex: number;
|
|
1766
|
+
role: PlanTableFragment["role"];
|
|
1767
|
+
columnKey?: string;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
declare interface ReportCellTableIdentity_2 {
|
|
1771
|
+
id: string;
|
|
1772
|
+
/** 逻辑表行索引;跨分页的同一行保持不变。 */
|
|
1773
|
+
rowIndex: number;
|
|
1774
|
+
role: PlanTableFragment_2["role"];
|
|
1775
|
+
columnKey?: string;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
declare type ReportCellValue = string | number | boolean | null;
|
|
1779
|
+
|
|
1780
|
+
declare type ReportCellValue_2 = string | number | boolean | null;
|
|
1781
|
+
|
|
1782
|
+
declare type ReportCellValueType = NonNullable<GridCell["valueType"]>;
|
|
1783
|
+
|
|
1123
1784
|
declare interface ReportDefinition {
|
|
1124
1785
|
/** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
|
|
1125
|
-
template:
|
|
1786
|
+
template: ReportTemplate_2 | ReportTemplateLoader;
|
|
1126
1787
|
/** 静态数据;load 存在时优先使用 load 的结果。 */
|
|
1127
1788
|
datasets?: DatasetRows;
|
|
1128
1789
|
load?: (context: ReportLoadContext) => DatasetRows | Promise<DatasetRows>;
|
|
@@ -1131,6 +1792,20 @@ declare interface ReportDefinition {
|
|
|
1131
1792
|
pagination?: PaginateOptions;
|
|
1132
1793
|
}
|
|
1133
1794
|
|
|
1795
|
+
/** Opt in with true for local drafts, or provide host validation and persistence. */
|
|
1796
|
+
export declare interface ReportEditingOptions {
|
|
1797
|
+
canEdit?(context: ReportCellContext): boolean;
|
|
1798
|
+
/** Return an error message or throw to reject the edit. */
|
|
1799
|
+
validate?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | string | Promise<void | string>;
|
|
1800
|
+
/** Called before applying the change. A rejection leaves the current report untouched. */
|
|
1801
|
+
save?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | Promise<void>;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
export declare interface ReportEditOperation {
|
|
1805
|
+
/** Reload, another import or unmount aborts the operation. Save adapters should forward this signal. */
|
|
1806
|
+
signal: AbortSignal;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1134
1809
|
/** 保持 Promise<RenderPlan> 契约;元数据为可选,旧业务 fetcher 无需改造。 */
|
|
1135
1810
|
declare interface ReportFetcher {
|
|
1136
1811
|
(input: ReportFetchInput): Promise<RenderPlan>;
|
|
@@ -1168,6 +1843,40 @@ declare interface ReportParamDef {
|
|
|
1168
1843
|
placeholder?: string;
|
|
1169
1844
|
}
|
|
1170
1845
|
|
|
1846
|
+
/** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
|
|
1847
|
+
declare interface ReportParamDef_2 {
|
|
1848
|
+
/** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
|
|
1849
|
+
field: string;
|
|
1850
|
+
/** 显示名(缺省用 field) */
|
|
1851
|
+
label?: string;
|
|
1852
|
+
type?: "text" | "number" | "date" | "select";
|
|
1853
|
+
/** select 选项 */
|
|
1854
|
+
options?: Array<{
|
|
1855
|
+
label: string;
|
|
1856
|
+
value: string;
|
|
1857
|
+
}>;
|
|
1858
|
+
defaultValue?: string;
|
|
1859
|
+
required?: boolean;
|
|
1860
|
+
placeholder?: string;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
/** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
|
|
1864
|
+
declare interface ReportParamDef_3 {
|
|
1865
|
+
/** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
|
|
1866
|
+
field: string;
|
|
1867
|
+
/** 显示名(缺省用 field) */
|
|
1868
|
+
label?: string;
|
|
1869
|
+
type?: "text" | "number" | "date" | "select";
|
|
1870
|
+
/** select 选项 */
|
|
1871
|
+
options?: Array<{
|
|
1872
|
+
label: string;
|
|
1873
|
+
value: string;
|
|
1874
|
+
}>;
|
|
1875
|
+
defaultValue?: string;
|
|
1876
|
+
required?: boolean;
|
|
1877
|
+
placeholder?: string;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1171
1880
|
export declare const ReportParamPanel: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1172
1881
|
reset: () => any;
|
|
1173
1882
|
query: () => any;
|
|
@@ -1185,11 +1894,25 @@ declare type ReportRegistry = Record<string, ReportDefinition>;
|
|
|
1185
1894
|
declare interface ReportTemplate {
|
|
1186
1895
|
schemaVersion?: string;
|
|
1187
1896
|
/** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
|
|
1188
|
-
params?:
|
|
1897
|
+
params?: ReportParamDef_2[];
|
|
1189
1898
|
pages: TemplatePage[];
|
|
1190
1899
|
}
|
|
1191
1900
|
|
|
1192
|
-
declare
|
|
1901
|
+
declare interface ReportTemplate_2 {
|
|
1902
|
+
schemaVersion?: string;
|
|
1903
|
+
/** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
|
|
1904
|
+
params?: ReportParamDef[];
|
|
1905
|
+
pages: TemplatePage_2[];
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
declare interface ReportTemplate_3 {
|
|
1909
|
+
schemaVersion?: string;
|
|
1910
|
+
/** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
|
|
1911
|
+
params?: ReportParamDef_3[];
|
|
1912
|
+
pages: TemplatePage_3[];
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
declare type ReportTemplateLoader = (context: ReportLoadContext) => ReportTemplate_2 | Promise<ReportTemplate_2>;
|
|
1193
1916
|
|
|
1194
1917
|
export declare const ReportToolbar: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1195
1918
|
print: () => any;
|
|
@@ -1201,6 +1924,7 @@ goto: (page: number) => any;
|
|
|
1201
1924
|
"search-nav": (dir: 1 | -1) => any;
|
|
1202
1925
|
"search-toggle": () => any;
|
|
1203
1926
|
"thumbs-toggle": () => any;
|
|
1927
|
+
"import-excel": () => any;
|
|
1204
1928
|
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
1205
1929
|
onPrint?: (() => any) | undefined;
|
|
1206
1930
|
onExport?: ((format: "html" | "png" | "pdf" | "xlsx" | "word") => any) | undefined;
|
|
@@ -1211,6 +1935,7 @@ onGoto?: ((page: number) => any) | undefined;
|
|
|
1211
1935
|
"onSearch-nav"?: ((dir: 1 | -1) => any) | undefined;
|
|
1212
1936
|
"onSearch-toggle"?: (() => any) | undefined;
|
|
1213
1937
|
"onThumbs-toggle"?: (() => any) | undefined;
|
|
1938
|
+
"onImport-excel"?: (() => any) | undefined;
|
|
1214
1939
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
1215
1940
|
searchInputRef: HTMLInputElement;
|
|
1216
1941
|
}, HTMLDivElement>;
|
|
@@ -1224,6 +1949,8 @@ export declare type ResolvedConfig = Required<Pick<MachReportDefaults, "showExpo
|
|
|
1224
1949
|
logger: MachReportLogger;
|
|
1225
1950
|
preview: Required<MachReportPreviewOptions>;
|
|
1226
1951
|
xlsx: XlsxRenderOptions;
|
|
1952
|
+
editable: boolean | ReportEditingOptions;
|
|
1953
|
+
excelImport: boolean | ExcelImportOptions;
|
|
1227
1954
|
};
|
|
1228
1955
|
|
|
1229
1956
|
declare interface RichParagraph {
|
|
@@ -1235,6 +1962,24 @@ declare interface RichParagraph {
|
|
|
1235
1962
|
indentMm?: number;
|
|
1236
1963
|
}
|
|
1237
1964
|
|
|
1965
|
+
declare interface RichParagraph_2 {
|
|
1966
|
+
segments: RichSegment_2[];
|
|
1967
|
+
align?: ComponentStyle_2["align"];
|
|
1968
|
+
lineHeight?: number;
|
|
1969
|
+
spaceBeforeMm?: number;
|
|
1970
|
+
spaceAfterMm?: number;
|
|
1971
|
+
indentMm?: number;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
declare interface RichParagraph_3 {
|
|
1975
|
+
segments: RichSegment_3[];
|
|
1976
|
+
align?: ComponentStyle_3["align"];
|
|
1977
|
+
lineHeight?: number;
|
|
1978
|
+
spaceBeforeMm?: number;
|
|
1979
|
+
spaceAfterMm?: number;
|
|
1980
|
+
indentMm?: number;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1238
1983
|
declare interface RichSegment {
|
|
1239
1984
|
kind?: "text" | "field";
|
|
1240
1985
|
text?: string;
|
|
@@ -1242,6 +1987,20 @@ declare interface RichSegment {
|
|
|
1242
1987
|
style?: ComponentStyle;
|
|
1243
1988
|
}
|
|
1244
1989
|
|
|
1990
|
+
declare interface RichSegment_2 {
|
|
1991
|
+
kind?: "text" | "field";
|
|
1992
|
+
text?: string;
|
|
1993
|
+
field?: string;
|
|
1994
|
+
style?: ComponentStyle_2;
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
declare interface RichSegment_3 {
|
|
1998
|
+
kind?: "text" | "field";
|
|
1999
|
+
text?: string;
|
|
2000
|
+
field?: string;
|
|
2001
|
+
style?: ComponentStyle_3;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
1245
2004
|
/** 控制器注入:后代组件 useReportPreview() 免模板 ref 编程式访问(与 expose 同面) */
|
|
1246
2005
|
/** 编程式设参查询:合并进面板值(面板本地字典经 v-model 同步),可选立即重载 */
|
|
1247
2006
|
declare function setParams(values: Record<string, string>, opts?: {
|
|
@@ -1261,8 +2020,34 @@ declare interface StyleRule {
|
|
|
1261
2020
|
style: Record<string, unknown>;
|
|
1262
2021
|
}
|
|
1263
2022
|
|
|
2023
|
+
/** 条件格式规则求值(声明式,见 ListColumn.rules) */
|
|
2024
|
+
declare interface StyleRule_2 {
|
|
2025
|
+
when: {
|
|
2026
|
+
field: string;
|
|
2027
|
+
op: ">" | ">=" | "<" | "<=" | "==" | "!=";
|
|
2028
|
+
value: number | string;
|
|
2029
|
+
};
|
|
2030
|
+
/** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
|
|
2031
|
+
style: Record<string, unknown>;
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
/** 条件格式规则求值(声明式,见 ListColumn.rules) */
|
|
2035
|
+
declare interface StyleRule_3 {
|
|
2036
|
+
when: {
|
|
2037
|
+
field: string;
|
|
2038
|
+
op: ">" | ">=" | "<" | "<=" | "==" | "!=";
|
|
2039
|
+
value: number | string;
|
|
2040
|
+
};
|
|
2041
|
+
/** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
|
|
2042
|
+
style: Record<string, unknown>;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
1264
2045
|
declare type TemplateComponent = PlanComponent | ListComponent;
|
|
1265
2046
|
|
|
2047
|
+
declare type TemplateComponent_2 = PlanComponent_2 | ListComponent_2;
|
|
2048
|
+
|
|
2049
|
+
declare type TemplateComponent_3 = PlanComponent_3 | ListComponent_3;
|
|
2050
|
+
|
|
1266
2051
|
declare interface TemplatePage {
|
|
1267
2052
|
widthMm: number;
|
|
1268
2053
|
heightMm: number;
|
|
@@ -1275,6 +2060,30 @@ declare interface TemplatePage {
|
|
|
1275
2060
|
components: TemplateComponent[];
|
|
1276
2061
|
}
|
|
1277
2062
|
|
|
2063
|
+
declare interface TemplatePage_2 {
|
|
2064
|
+
widthMm: number;
|
|
2065
|
+
heightMm: number;
|
|
2066
|
+
/** 宽表保持全列自然宽度,页高只控制内部纵向分段。 */
|
|
2067
|
+
layout?: "page" | "wide";
|
|
2068
|
+
marginTopMm?: number;
|
|
2069
|
+
marginBottomMm?: number;
|
|
2070
|
+
marginLeftMm?: number;
|
|
2071
|
+
marginRightMm?: number;
|
|
2072
|
+
components: TemplateComponent_2[];
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
declare interface TemplatePage_3 {
|
|
2076
|
+
widthMm: number;
|
|
2077
|
+
heightMm: number;
|
|
2078
|
+
/** 宽表保持全列自然宽度,页高只控制内部纵向分段。 */
|
|
2079
|
+
layout?: "page" | "wide";
|
|
2080
|
+
marginTopMm?: number;
|
|
2081
|
+
marginBottomMm?: number;
|
|
2082
|
+
marginLeftMm?: number;
|
|
2083
|
+
marginRightMm?: number;
|
|
2084
|
+
components: TemplateComponent_3[];
|
|
2085
|
+
}
|
|
2086
|
+
|
|
1278
2087
|
/**
|
|
1279
2088
|
* 文本测量与折行(分页/Canvas/PDF 共用的唯一折行真相源)。
|
|
1280
2089
|
*
|
|
@@ -1344,6 +2153,7 @@ export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
|
|
|
1344
2153
|
exportImages: () => Promise<void>;
|
|
1345
2154
|
exportWord: () => void;
|
|
1346
2155
|
openPdfWindow: () => void;
|
|
2156
|
+
invalidatePending: () => void;
|
|
1347
2157
|
releasePrintFrame: () => void;
|
|
1348
2158
|
dispose: () => void;
|
|
1349
2159
|
};
|