@agile-team/mach-report 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -12
- package/dist/ReportPreview-BWrQCj9M.js +1643 -0
- package/dist/ReportPreview-DY0PGGqF.cjs +6 -0
- package/dist/grid-geometry-DBH9ExuY.cjs +1 -0
- package/dist/grid-geometry-DONcjshk.js +130 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +79 -11
- package/dist/index.d.ts +79 -11
- package/dist/index.js +1039 -712
- package/dist/page-window-index-CIuT4BAv.js +43 -0
- package/dist/page-window-index-DEjnM6IB.cjs +1 -0
- package/dist/pdf.cjs +46 -46
- package/dist/pdf.d.cts +4 -0
- package/dist/pdf.d.ts +4 -0
- package/dist/pdf.js +6 -6
- package/dist/{plugin-Bl00j_CP.cjs → plugin-BMoMUxrw.cjs} +1 -1
- package/dist/{plugin-DVScnZ4C.js → plugin-CAcNe0FT.js} +2 -2
- package/dist/report-params-B3Fia6JO.js +10 -0
- package/dist/report-params-D1gZ1DME.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/textwrap-DdaewxAd.js +117 -0
- package/dist/textwrap-DqiFwAV3.cjs +3 -0
- package/dist/vue/async.d.cts +53 -2
- package/dist/vue/async.d.ts +53 -2
- package/dist/vue/index.d.cts +65 -12
- package/dist/vue/index.d.ts +65 -12
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +4 -4
- package/dist/xlsx.cjs +14 -14
- package/dist/xlsx.d.cts +8 -0
- package/dist/xlsx.d.ts +8 -0
- package/dist/xlsx.js +1087 -1053
- package/package.json +3 -2
- package/dist/ReportPreview-Dwdsyk9b.js +0 -1558
- package/dist/ReportPreview-VHAIfsz1.cjs +0 -6
- package/dist/grid-geometry-BXpOxznT.cjs +0 -1
- package/dist/grid-geometry-Bs8QXz1X.js +0 -65
- package/dist/report-params-BB85g7mg.js +0 -10
- package/dist/report-params-D1NeY-eR.cjs +0 -1
- package/dist/style-CFZ-HE2s.cjs +0 -3
- package/dist/style-DnmtG7Gl.js +0 -180
package/dist/vue/index.d.cts
CHANGED
|
@@ -204,6 +204,7 @@ declare type __VLS_Props = {
|
|
|
204
204
|
query: string;
|
|
205
205
|
matchIndex: number;
|
|
206
206
|
matchCount: number;
|
|
207
|
+
searching?: boolean;
|
|
207
208
|
};
|
|
208
209
|
thumbsVisible: boolean;
|
|
209
210
|
};
|
|
@@ -324,7 +325,7 @@ export declare function createFetchRequest(options?: FetchRequestOptions): HostR
|
|
|
324
325
|
* 本地渲染适配器:模板 + 数据 → core 分页引擎 → RenderPlan。
|
|
325
326
|
* 用于本地预览、离线场景和单测。
|
|
326
327
|
*/
|
|
327
|
-
export declare function createLocalFetcher(entries: Record<string, LocalTemplateEntry>): PlanFetcher;
|
|
328
|
+
export declare function createLocalFetcher(entries: Record<string, LocalTemplateEntry> | ReportRegistry): PlanFetcher;
|
|
328
329
|
|
|
329
330
|
declare type DatasetRows = Record<string, Record<string, unknown>[]>;
|
|
330
331
|
|
|
@@ -360,6 +361,10 @@ declare function gotoPage(n: number): void;
|
|
|
360
361
|
declare interface GridCell {
|
|
361
362
|
text?: string;
|
|
362
363
|
rawText?: string;
|
|
364
|
+
/** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
|
|
365
|
+
value?: string | number | boolean | null;
|
|
366
|
+
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
367
|
+
numberFormat?: string;
|
|
363
368
|
children?: PlanComponent[];
|
|
364
369
|
colSpan?: number;
|
|
365
370
|
rowSpan?: number;
|
|
@@ -377,11 +382,20 @@ export declare type HostRequest = (config: {
|
|
|
377
382
|
|
|
378
383
|
export declare function joinReportIds(reportId: ReportIdInput): string;
|
|
379
384
|
|
|
385
|
+
/** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
|
|
386
|
+
declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
|
|
387
|
+
|
|
380
388
|
declare interface ListColumn {
|
|
381
389
|
header: string;
|
|
382
390
|
field: string;
|
|
383
391
|
widthMm: number;
|
|
384
392
|
style?: ComponentStyle;
|
|
393
|
+
/** 内容对齐,优先于 style.align;数值字符串不会自动判为数字。 */
|
|
394
|
+
align?: ListAlignment;
|
|
395
|
+
/** 独立的表头对齐,不改变内容对齐。 */
|
|
396
|
+
headerAlign?: ComponentStyle["align"];
|
|
397
|
+
/** 独立的表头样式,优先于列表级表头样式。 */
|
|
398
|
+
headerStyle?: ComponentStyle;
|
|
385
399
|
/** 值格式化(声明式):千分位/小数位、百分比、日期 pattern */
|
|
386
400
|
format?: ColumnFormat;
|
|
387
401
|
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
@@ -402,6 +416,11 @@ declare interface ListComponent {
|
|
|
402
416
|
paddingMm?: number;
|
|
403
417
|
headerEveryPage?: boolean;
|
|
404
418
|
headerBackgroundColor?: string;
|
|
419
|
+
/** 内容默认对齐,列配置可覆盖;低层模板缺省仍为 left。 */
|
|
420
|
+
align?: ListAlignment;
|
|
421
|
+
/** 表头默认对齐,列配置可覆盖。 */
|
|
422
|
+
headerAlign?: ComponentStyle["align"];
|
|
423
|
+
headerStyle?: ComponentStyle;
|
|
405
424
|
border?: boolean;
|
|
406
425
|
/** 分组小计(组头/组尾小计/组头防孤行) */
|
|
407
426
|
groupBy?: ListGroupBy;
|
|
@@ -496,6 +515,9 @@ export declare interface MachReportDefaults {
|
|
|
496
515
|
messages?: Partial<MachReportMessages>;
|
|
497
516
|
/** 校验告警等内部日志通道(默认 console;静默传 { warn: () => {}, info: () => {} }) */
|
|
498
517
|
logger?: MachReportLogger;
|
|
518
|
+
preview?: MachReportPreviewOptions;
|
|
519
|
+
/** Excel 出口配置,按字段继承;不配置使用导出器默认值。 */
|
|
520
|
+
xlsx?: XlsxRenderOptions;
|
|
499
521
|
}
|
|
500
522
|
|
|
501
523
|
export declare class MachReportError extends Error {
|
|
@@ -576,6 +598,8 @@ export declare interface MachReportMessages {
|
|
|
576
598
|
reset: string;
|
|
577
599
|
/** 必填缺失提示({label} 占位) */
|
|
578
600
|
paramRequired: string;
|
|
601
|
+
/** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
|
|
602
|
+
searching?: string;
|
|
579
603
|
}
|
|
580
604
|
|
|
581
605
|
/**
|
|
@@ -919,6 +943,14 @@ fetcher: PlanFetcher | null;
|
|
|
919
943
|
};
|
|
920
944
|
});
|
|
921
945
|
|
|
946
|
+
/** 预览按需调优;默认已经启用正文/缩略图虚拟化及可取消的分片搜索。 */
|
|
947
|
+
export declare interface MachReportPreviewOptions {
|
|
948
|
+
/** 视口前后额外保留的正文页数,默认 1,归一化到 0~10 的整数。 */
|
|
949
|
+
overscanPages?: number;
|
|
950
|
+
/** 搜索输入防抖毫秒,默认 200,归一化到 0~2000。 */
|
|
951
|
+
searchDebounceMs?: number;
|
|
952
|
+
}
|
|
953
|
+
|
|
922
954
|
/** 只读快照,由组件的同一套状态驱动;无需通过事件另建状态。 */
|
|
923
955
|
export declare interface MachReportState {
|
|
924
956
|
readonly loading: boolean;
|
|
@@ -1067,11 +1099,12 @@ declare interface RenderPlan {
|
|
|
1067
1099
|
}
|
|
1068
1100
|
|
|
1069
1101
|
declare interface ReportDefinition {
|
|
1070
|
-
|
|
1102
|
+
/** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
|
|
1103
|
+
template: ReportTemplate | ReportTemplateLoader;
|
|
1071
1104
|
/** 静态数据;load 存在时优先使用 load 的结果。 */
|
|
1072
1105
|
datasets?: DatasetRows;
|
|
1073
1106
|
load?: (context: ReportLoadContext) => DatasetRows | Promise<DatasetRows>;
|
|
1074
|
-
/**
|
|
1107
|
+
/** 覆盖模板参数定义;动态模板应在此声明查询面板元数据,避免查询前先请求模板。 */
|
|
1075
1108
|
params?: ReportParamDef[];
|
|
1076
1109
|
pagination?: PaginateOptions;
|
|
1077
1110
|
}
|
|
@@ -1134,6 +1167,8 @@ declare interface ReportTemplate {
|
|
|
1134
1167
|
pages: TemplatePage[];
|
|
1135
1168
|
}
|
|
1136
1169
|
|
|
1170
|
+
declare type ReportTemplateLoader = (context: ReportLoadContext) => ReportTemplate | Promise<ReportTemplate>;
|
|
1171
|
+
|
|
1137
1172
|
export declare const ReportToolbar: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1138
1173
|
print: () => any;
|
|
1139
1174
|
export: (format: "html" | "png" | "pdf" | "xlsx" | "word") => any;
|
|
@@ -1165,6 +1200,8 @@ export declare type ResolvedConfig = Required<Pick<MachReportDefaults, "showExpo
|
|
|
1165
1200
|
theme: MachReportTheme;
|
|
1166
1201
|
messages: MachReportMessages;
|
|
1167
1202
|
logger: MachReportLogger;
|
|
1203
|
+
preview: Required<MachReportPreviewOptions>;
|
|
1204
|
+
xlsx: XlsxRenderOptions;
|
|
1168
1205
|
};
|
|
1169
1206
|
|
|
1170
1207
|
declare interface RichParagraph {
|
|
@@ -1248,16 +1285,11 @@ export declare function useMachReport(): MachReportHandle;
|
|
|
1248
1285
|
/** 组件内部读取当前生效配置层(未提供时返回 null → 走内置缺省) */
|
|
1249
1286
|
export declare function useMachReportConfig(): ConfigRef;
|
|
1250
1287
|
|
|
1251
|
-
/**
|
|
1252
|
-
* 页级视口虚拟化(DOM 后端)。
|
|
1253
|
-
*
|
|
1254
|
-
* 坐标口径(与 transform: scale 缩放配合):
|
|
1255
|
-
* - 页高/间距/占位均在"自然坐标系"(未缩放 px)维护
|
|
1256
|
-
* - 视口滚动量与视口高换算回自然系(除以 zoom)后再进 computePageWindow
|
|
1257
|
-
*/
|
|
1288
|
+
/** 页级虚拟化;页几何按计划引用缓存,滚动仅更新坐标,不遍历整个计划。 */
|
|
1258
1289
|
export declare function usePageWindow(plan: Ref<RenderPlan | null>, zoom: Ref<number>, options?: {
|
|
1259
1290
|
pxPerMm?: number;
|
|
1260
1291
|
gapPx?: number | Ref<number>;
|
|
1292
|
+
overscan?: number | Ref<number>;
|
|
1261
1293
|
}): {
|
|
1262
1294
|
contentSize: ComputedRef< {
|
|
1263
1295
|
w: number;
|
|
@@ -1269,10 +1301,14 @@ export declare function usePageWindow(plan: Ref<RenderPlan | null>, zoom: Ref<nu
|
|
|
1269
1301
|
index: number;
|
|
1270
1302
|
}[]>;
|
|
1271
1303
|
makeScrollHandler: (currentPage: Ref<number>, pageCount: Ref<number>) => (vp: HTMLElement) => void;
|
|
1272
|
-
refreshViewport(vp: HTMLElement | null)
|
|
1304
|
+
refreshViewport: (vp: HTMLElement | null) => void;
|
|
1305
|
+
pageOffsetPx: (index: number) => number;
|
|
1306
|
+
destroy: () => void;
|
|
1273
1307
|
};
|
|
1274
1308
|
|
|
1275
1309
|
export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
|
|
1310
|
+
/** 按导出开始时的配置快照处理,避免输出过程中跟随路由配置变化。 */
|
|
1311
|
+
getXlsxOptions?: () => XlsxRenderOptions;
|
|
1276
1312
|
getPdfExporter: () => PdfExporter;
|
|
1277
1313
|
onError: (message: string, code?: string) => void;
|
|
1278
1314
|
onWarning?: (message: string) => void;
|
|
@@ -1313,9 +1349,26 @@ export declare function useZoom(getFitInputs: () => {
|
|
|
1313
1349
|
pageWidthPx: number;
|
|
1314
1350
|
} | null): {
|
|
1315
1351
|
zoom: Ref<number, number>;
|
|
1316
|
-
zoomMode: Ref<"
|
|
1352
|
+
zoomMode: Ref<"raw" | "fit", "raw" | "fit">;
|
|
1317
1353
|
applyFitZoom: () => void;
|
|
1318
1354
|
setZoom: (mode: "fit" | number) => void;
|
|
1319
1355
|
};
|
|
1320
1356
|
|
|
1357
|
+
/**
|
|
1358
|
+
* RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
|
|
1359
|
+
* - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
|
|
1360
|
+
* 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
|
|
1361
|
+
* - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
|
|
1362
|
+
* 目标是"财务能直接用的对账表"而非复刻版面)
|
|
1363
|
+
* - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
|
|
1364
|
+
*/
|
|
1365
|
+
declare interface XlsxRenderOptions {
|
|
1366
|
+
/** 工作表命名(默认 "Sheet1" 起序) */
|
|
1367
|
+
sheetName?: (pageIndex: number) => string;
|
|
1368
|
+
/** 默认 text 保留显示文本;raw 使用列表自动保留的原始数值、布尔、文本与空值。 */
|
|
1369
|
+
valueMode?: "text" | "raw";
|
|
1370
|
+
/** 默认 auto 按计划识别 A3/A4/A5;自定义尺寸回退 A4 并返回告警。 */
|
|
1371
|
+
paperSize?: "auto" | "a3" | "a4" | "a5";
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1321
1374
|
export { }
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -204,6 +204,7 @@ declare type __VLS_Props = {
|
|
|
204
204
|
query: string;
|
|
205
205
|
matchIndex: number;
|
|
206
206
|
matchCount: number;
|
|
207
|
+
searching?: boolean;
|
|
207
208
|
};
|
|
208
209
|
thumbsVisible: boolean;
|
|
209
210
|
};
|
|
@@ -324,7 +325,7 @@ export declare function createFetchRequest(options?: FetchRequestOptions): HostR
|
|
|
324
325
|
* 本地渲染适配器:模板 + 数据 → core 分页引擎 → RenderPlan。
|
|
325
326
|
* 用于本地预览、离线场景和单测。
|
|
326
327
|
*/
|
|
327
|
-
export declare function createLocalFetcher(entries: Record<string, LocalTemplateEntry>): PlanFetcher;
|
|
328
|
+
export declare function createLocalFetcher(entries: Record<string, LocalTemplateEntry> | ReportRegistry): PlanFetcher;
|
|
328
329
|
|
|
329
330
|
declare type DatasetRows = Record<string, Record<string, unknown>[]>;
|
|
330
331
|
|
|
@@ -360,6 +361,10 @@ declare function gotoPage(n: number): void;
|
|
|
360
361
|
declare interface GridCell {
|
|
361
362
|
text?: string;
|
|
362
363
|
rawText?: string;
|
|
364
|
+
/** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
|
|
365
|
+
value?: string | number | boolean | null;
|
|
366
|
+
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
367
|
+
numberFormat?: string;
|
|
363
368
|
children?: PlanComponent[];
|
|
364
369
|
colSpan?: number;
|
|
365
370
|
rowSpan?: number;
|
|
@@ -377,11 +382,20 @@ export declare type HostRequest = (config: {
|
|
|
377
382
|
|
|
378
383
|
export declare function joinReportIds(reportId: ReportIdInput): string;
|
|
379
384
|
|
|
385
|
+
/** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
|
|
386
|
+
declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
|
|
387
|
+
|
|
380
388
|
declare interface ListColumn {
|
|
381
389
|
header: string;
|
|
382
390
|
field: string;
|
|
383
391
|
widthMm: number;
|
|
384
392
|
style?: ComponentStyle;
|
|
393
|
+
/** 内容对齐,优先于 style.align;数值字符串不会自动判为数字。 */
|
|
394
|
+
align?: ListAlignment;
|
|
395
|
+
/** 独立的表头对齐,不改变内容对齐。 */
|
|
396
|
+
headerAlign?: ComponentStyle["align"];
|
|
397
|
+
/** 独立的表头样式,优先于列表级表头样式。 */
|
|
398
|
+
headerStyle?: ComponentStyle;
|
|
385
399
|
/** 值格式化(声明式):千分位/小数位、百分比、日期 pattern */
|
|
386
400
|
format?: ColumnFormat;
|
|
387
401
|
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
@@ -402,6 +416,11 @@ declare interface ListComponent {
|
|
|
402
416
|
paddingMm?: number;
|
|
403
417
|
headerEveryPage?: boolean;
|
|
404
418
|
headerBackgroundColor?: string;
|
|
419
|
+
/** 内容默认对齐,列配置可覆盖;低层模板缺省仍为 left。 */
|
|
420
|
+
align?: ListAlignment;
|
|
421
|
+
/** 表头默认对齐,列配置可覆盖。 */
|
|
422
|
+
headerAlign?: ComponentStyle["align"];
|
|
423
|
+
headerStyle?: ComponentStyle;
|
|
405
424
|
border?: boolean;
|
|
406
425
|
/** 分组小计(组头/组尾小计/组头防孤行) */
|
|
407
426
|
groupBy?: ListGroupBy;
|
|
@@ -496,6 +515,9 @@ export declare interface MachReportDefaults {
|
|
|
496
515
|
messages?: Partial<MachReportMessages>;
|
|
497
516
|
/** 校验告警等内部日志通道(默认 console;静默传 { warn: () => {}, info: () => {} }) */
|
|
498
517
|
logger?: MachReportLogger;
|
|
518
|
+
preview?: MachReportPreviewOptions;
|
|
519
|
+
/** Excel 出口配置,按字段继承;不配置使用导出器默认值。 */
|
|
520
|
+
xlsx?: XlsxRenderOptions;
|
|
499
521
|
}
|
|
500
522
|
|
|
501
523
|
export declare class MachReportError extends Error {
|
|
@@ -576,6 +598,8 @@ export declare interface MachReportMessages {
|
|
|
576
598
|
reset: string;
|
|
577
599
|
/** 必填缺失提示({label} 占位) */
|
|
578
600
|
paramRequired: string;
|
|
601
|
+
/** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
|
|
602
|
+
searching?: string;
|
|
579
603
|
}
|
|
580
604
|
|
|
581
605
|
/**
|
|
@@ -919,6 +943,14 @@ fetcher: PlanFetcher | null;
|
|
|
919
943
|
};
|
|
920
944
|
});
|
|
921
945
|
|
|
946
|
+
/** 预览按需调优;默认已经启用正文/缩略图虚拟化及可取消的分片搜索。 */
|
|
947
|
+
export declare interface MachReportPreviewOptions {
|
|
948
|
+
/** 视口前后额外保留的正文页数,默认 1,归一化到 0~10 的整数。 */
|
|
949
|
+
overscanPages?: number;
|
|
950
|
+
/** 搜索输入防抖毫秒,默认 200,归一化到 0~2000。 */
|
|
951
|
+
searchDebounceMs?: number;
|
|
952
|
+
}
|
|
953
|
+
|
|
922
954
|
/** 只读快照,由组件的同一套状态驱动;无需通过事件另建状态。 */
|
|
923
955
|
export declare interface MachReportState {
|
|
924
956
|
readonly loading: boolean;
|
|
@@ -1067,11 +1099,12 @@ declare interface RenderPlan {
|
|
|
1067
1099
|
}
|
|
1068
1100
|
|
|
1069
1101
|
declare interface ReportDefinition {
|
|
1070
|
-
|
|
1102
|
+
/** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
|
|
1103
|
+
template: ReportTemplate | ReportTemplateLoader;
|
|
1071
1104
|
/** 静态数据;load 存在时优先使用 load 的结果。 */
|
|
1072
1105
|
datasets?: DatasetRows;
|
|
1073
1106
|
load?: (context: ReportLoadContext) => DatasetRows | Promise<DatasetRows>;
|
|
1074
|
-
/**
|
|
1107
|
+
/** 覆盖模板参数定义;动态模板应在此声明查询面板元数据,避免查询前先请求模板。 */
|
|
1075
1108
|
params?: ReportParamDef[];
|
|
1076
1109
|
pagination?: PaginateOptions;
|
|
1077
1110
|
}
|
|
@@ -1134,6 +1167,8 @@ declare interface ReportTemplate {
|
|
|
1134
1167
|
pages: TemplatePage[];
|
|
1135
1168
|
}
|
|
1136
1169
|
|
|
1170
|
+
declare type ReportTemplateLoader = (context: ReportLoadContext) => ReportTemplate | Promise<ReportTemplate>;
|
|
1171
|
+
|
|
1137
1172
|
export declare const ReportToolbar: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1138
1173
|
print: () => any;
|
|
1139
1174
|
export: (format: "html" | "png" | "pdf" | "xlsx" | "word") => any;
|
|
@@ -1165,6 +1200,8 @@ export declare type ResolvedConfig = Required<Pick<MachReportDefaults, "showExpo
|
|
|
1165
1200
|
theme: MachReportTheme;
|
|
1166
1201
|
messages: MachReportMessages;
|
|
1167
1202
|
logger: MachReportLogger;
|
|
1203
|
+
preview: Required<MachReportPreviewOptions>;
|
|
1204
|
+
xlsx: XlsxRenderOptions;
|
|
1168
1205
|
};
|
|
1169
1206
|
|
|
1170
1207
|
declare interface RichParagraph {
|
|
@@ -1248,16 +1285,11 @@ export declare function useMachReport(): MachReportHandle;
|
|
|
1248
1285
|
/** 组件内部读取当前生效配置层(未提供时返回 null → 走内置缺省) */
|
|
1249
1286
|
export declare function useMachReportConfig(): ConfigRef;
|
|
1250
1287
|
|
|
1251
|
-
/**
|
|
1252
|
-
* 页级视口虚拟化(DOM 后端)。
|
|
1253
|
-
*
|
|
1254
|
-
* 坐标口径(与 transform: scale 缩放配合):
|
|
1255
|
-
* - 页高/间距/占位均在"自然坐标系"(未缩放 px)维护
|
|
1256
|
-
* - 视口滚动量与视口高换算回自然系(除以 zoom)后再进 computePageWindow
|
|
1257
|
-
*/
|
|
1288
|
+
/** 页级虚拟化;页几何按计划引用缓存,滚动仅更新坐标,不遍历整个计划。 */
|
|
1258
1289
|
export declare function usePageWindow(plan: Ref<RenderPlan | null>, zoom: Ref<number>, options?: {
|
|
1259
1290
|
pxPerMm?: number;
|
|
1260
1291
|
gapPx?: number | Ref<number>;
|
|
1292
|
+
overscan?: number | Ref<number>;
|
|
1261
1293
|
}): {
|
|
1262
1294
|
contentSize: ComputedRef< {
|
|
1263
1295
|
w: number;
|
|
@@ -1269,10 +1301,14 @@ export declare function usePageWindow(plan: Ref<RenderPlan | null>, zoom: Ref<nu
|
|
|
1269
1301
|
index: number;
|
|
1270
1302
|
}[]>;
|
|
1271
1303
|
makeScrollHandler: (currentPage: Ref<number>, pageCount: Ref<number>) => (vp: HTMLElement) => void;
|
|
1272
|
-
refreshViewport(vp: HTMLElement | null)
|
|
1304
|
+
refreshViewport: (vp: HTMLElement | null) => void;
|
|
1305
|
+
pageOffsetPx: (index: number) => number;
|
|
1306
|
+
destroy: () => void;
|
|
1273
1307
|
};
|
|
1274
1308
|
|
|
1275
1309
|
export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
|
|
1310
|
+
/** 按导出开始时的配置快照处理,避免输出过程中跟随路由配置变化。 */
|
|
1311
|
+
getXlsxOptions?: () => XlsxRenderOptions;
|
|
1276
1312
|
getPdfExporter: () => PdfExporter;
|
|
1277
1313
|
onError: (message: string, code?: string) => void;
|
|
1278
1314
|
onWarning?: (message: string) => void;
|
|
@@ -1313,9 +1349,26 @@ export declare function useZoom(getFitInputs: () => {
|
|
|
1313
1349
|
pageWidthPx: number;
|
|
1314
1350
|
} | null): {
|
|
1315
1351
|
zoom: Ref<number, number>;
|
|
1316
|
-
zoomMode: Ref<"
|
|
1352
|
+
zoomMode: Ref<"raw" | "fit", "raw" | "fit">;
|
|
1317
1353
|
applyFitZoom: () => void;
|
|
1318
1354
|
setZoom: (mode: "fit" | number) => void;
|
|
1319
1355
|
};
|
|
1320
1356
|
|
|
1357
|
+
/**
|
|
1358
|
+
* RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
|
|
1359
|
+
* - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
|
|
1360
|
+
* 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
|
|
1361
|
+
* - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
|
|
1362
|
+
* 目标是"财务能直接用的对账表"而非复刻版面)
|
|
1363
|
+
* - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
|
|
1364
|
+
*/
|
|
1365
|
+
declare interface XlsxRenderOptions {
|
|
1366
|
+
/** 工作表命名(默认 "Sheet1" 起序) */
|
|
1367
|
+
sheetName?: (pageIndex: number) => string;
|
|
1368
|
+
/** 默认 text 保留显示文本;raw 使用列表自动保留的原始数值、布尔、文本与空值。 */
|
|
1369
|
+
valueMode?: "text" | "raw";
|
|
1370
|
+
/** 默认 auto 按计划识别 A3/A4/A5;自定义尺寸回退 A4 并返回告警。 */
|
|
1371
|
+
paperSize?: "auto" | "a3" | "a4" | "a5";
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1321
1374
|
export { }
|
package/dist/vue-async.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-BMoMUxrw.cjs");function i(){return Promise.resolve().then(()=>require("./ReportPreview-DY0PGGqF.cjs")).then(e=>e.ReportPreview$1)}const t={install(e,o={}){r.machReportPlugin.install(e,o)}};exports.MachReportPreview=r.MachReportPreview;exports.default=t;exports.machReportAsyncPlugin=t;exports.preloadMachReport=i;
|
package/dist/vue-async.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as o } from "./plugin-
|
|
2
|
-
import { M as l } from "./plugin-
|
|
1
|
+
import { m as o } from "./plugin-CAcNe0FT.js";
|
|
2
|
+
import { M as l } from "./plugin-CAcNe0FT.js";
|
|
3
3
|
function a() {
|
|
4
|
-
return import("./ReportPreview-
|
|
4
|
+
return import("./ReportPreview-BWrQCj9M.js").then((t) => t.s);
|
|
5
5
|
}
|
|
6
6
|
const n = {
|
|
7
7
|
install(t, r = {}) {
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@agile-team/mach-report"),e=require("./ReportPreview-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@agile-team/mach-report"),e=require("./ReportPreview-DY0PGGqF.cjs"),c=require("./plugin-BMoMUxrw.cjs"),s=require("vue");function p(r){const o=u.createReportSource(r),i=async n=>{if(n.reportIds.length===0)throw new e.PlanLoadError("缺少报表 ID");for(const t of n.reportIds)if(!Object.prototype.hasOwnProperty.call(r,t)||!r[t])throw new e.PlanLoadError(`本地模板 ${t} 不存在`);return o(n)};return i.getParamDefs=o.getParamDefs,i}const l=Object.freeze({loading:!1,hasPlan:!1,pageCount:0,currentPage:1,exporting:null,printing:!1,canExport:!1,canPrint:!1,error:null,pdfFont:Object.freeze({status:"unchecked",fontUrl:""})});function P(){const r=s.shallowRef(null),o=()=>r.value?.state??l,i=Object.freeze({get loading(){return o().loading},get hasPlan(){return o().hasPlan},get pageCount(){return o().pageCount},get currentPage(){return o().currentPage},get exporting(){return o().exporting},get printing(){return o().printing},get canExport(){return o().canExport},get canPrint(){return o().canPrint},get error(){return o().error},get pdfFont(){return o().pdfFont}});function n(){if(!r.value)throw new e.MachReportError("config","报表预览尚未挂载,请在 ready 后调用控制器");return r.value}return{ref(t){const a=t;r.value=a&&typeof a.reload=="function"&&typeof a.print=="function"&&typeof a.exportAs=="function"&&typeof a.openPdfWindow=="function"&&typeof a.gotoPage=="function"&&typeof a.setParams=="function"?a:null},ready:s.computed(()=>r.value!==null),state:i,async checkPdfFont(){const t=n();return t.checkPdfFont?t.checkPdfFont():{status:"unverified",fontUrl:"",message:"旧自定义控制器未提供字体检查,请由宿主确认字体配置"}},async reload(){await n().reload()},async print(){await n().print()},async exportAs(t){await n().exportAs(t)},openPdfWindow(){n().openPdfWindow()},gotoPage(t){n().gotoPage(t)},async setParams(t,a){await n().setParams(t,a)}}}function f(){return s.inject(c.MACH_REPORT_CONTROLLER_KEY,null)}exports.DEFAULT_MESSAGES=e.DEFAULT_MESSAGES;exports.DEFAULT_THEME=e.DEFAULT_THEME;exports.MachReportError=e.MachReportError;exports.PlanLoadError=e.PlanLoadError;exports.ReportParamPanel=e.ReportParamPanel;exports.ReportPreview=e.ReportPreview;exports.ReportToolbar=e.ReportToolbar;exports.SILENT_LOGGER=e.SILENT_LOGGER;exports.buildPrintDocument=e.buildPrintDocument;exports.buildWordHtml=e.buildWordHtml;exports.createDefaultPdfExporter=e.createDefaultPdfExporter;exports.createFetchRequest=e.createFetchRequest;exports.defineMachReportConfig=e.defineMachReportConfig;exports.defineMachReportPreset=e.defineMachReportPreset;exports.joinReportIds=e.joinReportIds;exports.normalizeReportIds=e.normalizeReportIds;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=c.MACH_REPORT_CONFIG_KEY;exports.MACH_REPORT_CONTROLLER_KEY=c.MACH_REPORT_CONTROLLER_KEY;exports.MACH_REPORT_FETCHER_KEY=c.MACH_REPORT_FETCHER_KEY;exports.MACH_REPORT_PDF_EXPORTER_KEY=c.MACH_REPORT_PDF_EXPORTER_KEY;exports.MachReportPreview=c.MachReportPreview;exports.machReportPlugin=c.machReportPlugin;exports.createLocalFetcher=p;exports.useMachReport=P;exports.useReportPreview=f;Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>u[r]})});
|
package/dist/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createReportSource as c } from "@agile-team/mach-report";
|
|
2
2
|
export * from "@agile-team/mach-report";
|
|
3
|
-
import { P as s, M as i } from "./ReportPreview-
|
|
4
|
-
import { D as M, a as T, R as x, b as O, c as F, S as v, d as A, e as D, f as b, g as L, h as S, i as j, j as H, n as I, p as k, k as W, r as Y, t as z, l as G, u as K, m as U, o as N, q } from "./ReportPreview-
|
|
5
|
-
import { a as f } from "./plugin-
|
|
6
|
-
import { b as X, c as Z, d as $, M as B, m as J } from "./plugin-
|
|
3
|
+
import { P as s, M as i } from "./ReportPreview-BWrQCj9M.js";
|
|
4
|
+
import { D as M, a as T, R as x, b as O, c as F, S as v, d as A, e as D, f as b, g as L, h as S, i as j, j as H, n as I, p as k, k as W, r as Y, t as z, l as G, u as K, m as U, o as N, q } from "./ReportPreview-BWrQCj9M.js";
|
|
5
|
+
import { a as f } from "./plugin-CAcNe0FT.js";
|
|
6
|
+
import { b as X, c as Z, d as $, M as B, m as J } from "./plugin-CAcNe0FT.js";
|
|
7
7
|
import { shallowRef as u, computed as p, inject as l } from "vue";
|
|
8
8
|
function m(n) {
|
|
9
9
|
const t = c(n), a = async (r) => {
|