@agile-team/mach-report 1.2.2 → 2.1.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.
Files changed (88) hide show
  1. package/LICENSE +2 -4
  2. package/LICENSING.md +15 -0
  3. package/README.md +240 -92
  4. package/dist/ReportPreview-Dwdsyk9b.js +1558 -0
  5. package/dist/ReportPreview-VHAIfsz1.cjs +6 -0
  6. package/dist/index.cjs +5 -5
  7. package/dist/index.d.cts +738 -14
  8. package/dist/index.d.ts +738 -14
  9. package/dist/index.js +858 -805
  10. package/dist/pdf.cjs +47 -47
  11. package/dist/pdf.d.cts +155 -6
  12. package/dist/pdf.d.ts +155 -6
  13. package/dist/pdf.js +3542 -3466
  14. package/dist/plugin-Bl00j_CP.cjs +1 -0
  15. package/dist/plugin-DVScnZ4C.js +25 -0
  16. package/dist/report-params-BB85g7mg.js +10 -0
  17. package/dist/report-params-D1NeY-eR.cjs +1 -0
  18. package/dist/sql.cjs +65 -64
  19. package/dist/sql.d.cts +109 -5
  20. package/dist/sql.d.ts +109 -5
  21. package/dist/sql.js +7947 -7922
  22. package/dist/style-CFZ-HE2s.cjs +3 -0
  23. package/dist/{style-6ihHKVCM.js → style-DnmtG7Gl.js} +69 -81
  24. package/dist/style.css +1 -1
  25. package/dist/vue/async.d.cts +769 -335
  26. package/dist/vue/async.d.ts +769 -335
  27. package/dist/vue/index.d.cts +1321 -14
  28. package/dist/vue/index.d.ts +1321 -14
  29. package/dist/vue-async.cjs +1 -1
  30. package/dist/vue-async.js +11 -12
  31. package/dist/vue.cjs +1 -1
  32. package/dist/vue.js +130 -50
  33. package/dist/xlsx.cjs +20 -20
  34. package/dist/xlsx.d.cts +2292 -5
  35. package/dist/xlsx.d.ts +2292 -5
  36. package/dist/xlsx.js +5452 -5443
  37. package/package.json +7 -13
  38. package/dist/ReportPreview-CJLvkTVn.cjs +0 -6
  39. package/dist/ReportPreview-mZiGtf0L.js +0 -1231
  40. package/dist/builder/template-builder.d.ts +0 -69
  41. package/dist/compat/jh4j-template.d.ts +0 -12
  42. package/dist/defaults.d.ts +0 -27
  43. package/dist/format.d.ts +0 -48
  44. package/dist/layout/paginate.d.ts +0 -97
  45. package/dist/layout/textwrap.d.ts +0 -36
  46. package/dist/manager/api.d.ts +0 -45
  47. package/dist/manager/index.d.ts +0 -2
  48. package/dist/manager/types.d.ts +0 -50
  49. package/dist/manager.cjs +0 -1
  50. package/dist/manager.d.cts +0 -5
  51. package/dist/manager.d.ts +0 -5
  52. package/dist/manager.js +0 -104
  53. package/dist/pdf/font-loader.d.ts +0 -6
  54. package/dist/pdf/index.d.ts +0 -2
  55. package/dist/pdf/render-pdf.d.ts +0 -25
  56. package/dist/plugin-C4qpbdMJ.cjs +0 -1
  57. package/dist/plugin-DcmAPK_K.js +0 -85
  58. package/dist/render/canvas.d.ts +0 -76
  59. package/dist/render/dom.d.ts +0 -10
  60. package/dist/render/grid-geometry.d.ts +0 -41
  61. package/dist/render/style.d.ts +0 -33
  62. package/dist/render/window.d.ts +0 -23
  63. package/dist/schema/render-plan.d.ts +0 -96
  64. package/dist/schema/validate.d.ts +0 -15
  65. package/dist/sql/ast-check.d.ts +0 -14
  66. package/dist/sql/compile.d.ts +0 -31
  67. package/dist/sql/expr.d.ts +0 -21
  68. package/dist/sql/index.d.ts +0 -4
  69. package/dist/sql/tokenizer.d.ts +0 -25
  70. package/dist/style-Xq08-IsV.cjs +0 -3
  71. package/dist/units.d.ts +0 -11
  72. package/dist/vue/ReportParamPanel.d.ts +0 -19
  73. package/dist/vue/ReportPreview.d.ts +0 -209
  74. package/dist/vue/ReportToolbar.d.ts +0 -42
  75. package/dist/vue/adapters.d.ts +0 -40
  76. package/dist/vue/composables/useHighlight.d.ts +0 -8
  77. package/dist/vue/composables/usePageWindow.d.ts +0 -25
  78. package/dist/vue/composables/usePrintExport.d.ts +0 -40
  79. package/dist/vue/composables/useReportSearch.d.ts +0 -73
  80. package/dist/vue/composables/useZoom.d.ts +0 -15
  81. package/dist/vue/config.d.ts +0 -108
  82. package/dist/vue/controller.d.ts +0 -29
  83. package/dist/vue/errors.d.ts +0 -16
  84. package/dist/vue/injection-keys.d.ts +0 -14
  85. package/dist/vue/local-adapter.d.ts +0 -12
  86. package/dist/vue/pdf-exporter.d.ts +0 -13
  87. package/dist/vue/plugin.d.ts +0 -354
  88. package/dist/xlsx/render-xlsx.d.ts +0 -20
@@ -1,42 +0,0 @@
1
- import { MachReportMessages } from './config';
2
- type __VLS_Props = {
3
- pageCount: number;
4
- currentPage: number;
5
- zoomMode: "fit" | "raw";
6
- zoom: number;
7
- showExport: boolean;
8
- showPrint: boolean;
9
- showPdfWindow: boolean;
10
- messages: MachReportMessages;
11
- search: {
12
- visible: boolean;
13
- query: string;
14
- matchIndex: number;
15
- matchCount: number;
16
- };
17
- thumbsVisible: boolean;
18
- };
19
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
- export: (format: "html" | "png" | "pdf" | "xlsx" | "word") => any;
21
- zoom: (mode: number | "fit") => any;
22
- print: () => any;
23
- goto: (page: number) => any;
24
- "pdf-window": () => any;
25
- "search-input": (query: string) => any;
26
- "search-nav": (dir: 1 | -1) => any;
27
- "search-toggle": () => any;
28
- "thumbs-toggle": () => any;
29
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
30
- onExport?: ((format: "html" | "png" | "pdf" | "xlsx" | "word") => any) | undefined;
31
- onZoom?: ((mode: number | "fit") => any) | undefined;
32
- onPrint?: (() => any) | undefined;
33
- onGoto?: ((page: number) => any) | undefined;
34
- "onPdf-window"?: (() => any) | undefined;
35
- "onSearch-input"?: ((query: string) => any) | undefined;
36
- "onSearch-nav"?: ((dir: 1 | -1) => any) | undefined;
37
- "onSearch-toggle"?: (() => any) | undefined;
38
- "onThumbs-toggle"?: (() => any) | undefined;
39
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
40
- searchInputRef: HTMLInputElement;
41
- }, HTMLDivElement>;
42
- export default _default;
@@ -1,40 +0,0 @@
1
- import { RenderPlan } from '@agile-team/mach-report';
2
- export type TempIdInput = string | string[] | null | undefined;
3
- export interface PlanFetcher {
4
- (input: {
5
- tempIds: string[];
6
- furnitureTempId?: string;
7
- params: Record<string, string>;
8
- }): Promise<RenderPlan>;
9
- }
10
- export declare function normalizeTempIds(tempId: TempIdInput): string[];
11
- export declare function joinTempIds(tempId: TempIdInput): string;
12
- export declare class PlanLoadError extends Error {
13
- constructor(message: string);
14
- }
15
- /** 宿主请求函数签名(axios 风格;createJh4jGridPlanFetcher 消费) */
16
- export type HostRequest = (config: {
17
- url: string;
18
- method: string;
19
- params?: Record<string, string>;
20
- }) => Promise<unknown>;
21
- export interface FetchRequestOptions {
22
- /** 网关前缀(默认空 = 同源) */
23
- baseUrl?: string;
24
- /** 附加请求头(如鉴权 token) */
25
- headers?: Record<string, string>;
26
- credentials?: RequestCredentials;
27
- /** 超时毫秒(默认 30000;超时抛 PlanLoadError) */
28
- timeoutMs?: number;
29
- }
30
- /**
31
- * 零依赖请求适配器:用全局 fetch 实现 HostRequest 签名,
32
- * 让宿主无需引入 axios 或手写胶水代码即可接上 jh4j 数据面。
33
- * 内置超时(AbortController)与网络/HTTP 错误语义。
34
- */
35
- export declare function createFetchRequest(options?: FetchRequestOptions): HostRequest;
36
- export declare function createJh4jGridPlanFetcher(options: {
37
- request: HostRequest;
38
- /** 网关前缀,默认空(同域) */
39
- baseUrl?: string;
40
- }): PlanFetcher;
@@ -1,8 +0,0 @@
1
- /**
2
- * 预览内文本高亮(搜索命中标记):
3
- * - highlightTextNodes:TreeWalker 找文本节点,命中片段包 <mark class="mrp-hit">
4
- * - clearHighlights:拆包还原(避免重复高亮叠加)
5
- * 纯 DOM 操作,虚拟化窗口外的页不处理(随窗口重建自然清理)。
6
- */
7
- export declare function clearHighlights(root: HTMLElement): void;
8
- export declare function highlightTextNodes(root: HTMLElement, query: string): number;
@@ -1,25 +0,0 @@
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 | Ref<number>;
13
- }): {
14
- contentSize: import('vue').ComputedRef<{
15
- w: number;
16
- h: number;
17
- }>;
18
- windowRange: import('vue').ComputedRef<import('@agile-team/mach-report').PageWindow>;
19
- visiblePages: import('vue').ComputedRef<{
20
- page: PlanPage;
21
- index: number;
22
- }[]>;
23
- makeScrollHandler: (currentPage: Ref<number>, pageCount: Ref<number>) => (vp: HTMLElement) => void;
24
- refreshViewport(vp: HTMLElement | null): void;
25
- };
@@ -1,40 +0,0 @@
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
- /** 供 HTML/Word 导出的完整文档;打印路径逐页渲染,避免预先生成所有页。 */
9
- export declare function buildPrintDocument(p: RenderPlan): PrintHtmlResult;
10
- /**
11
- * 批量打印(多单连打):把多份计划合并为一个打印文档——
12
- * named pages 保证混合纸张正确分页,浏览器只弹一次打印对话框。
13
- */
14
- export declare function printPlans(plans: RenderPlan[], options?: {
15
- onProgress?: (done: number, total: number) => void;
16
- onError?: (message: string) => void;
17
- }): Promise<void>;
18
- /**
19
- * Word 导出(Word 兼容 HTML,.doc MIME):
20
- * 复用打印文档构建(同一样式与 named pages 分页规则),套 Word 命名空间头。
21
- * Word 2003+ 可直接打开编辑——覆盖"导出可编辑单据"场景,零后端。
22
- */
23
- export declare function buildWordHtml(p: RenderPlan): {
24
- html: string;
25
- filename: string;
26
- };
27
- export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
28
- getPdfExporter: () => PdfExporter;
29
- onError: (message: string, code?: string) => void;
30
- onWarning?: (message: string) => void;
31
- onBusy?: (format: string | null) => void;
32
- }): {
33
- print: () => Promise<void>;
34
- exportAs: (format: string) => void;
35
- exportImages: () => Promise<void>;
36
- exportWord: () => void;
37
- openPdfWindow: () => void;
38
- releasePrintFrame: () => void;
39
- };
40
- export {};
@@ -1,73 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { RenderPlan } from '@agile-team/mach-report';
3
- /**
4
- * 预览交互 composables 集合(本文件包含四件):
5
- *
6
- * - useReportSearch:搜索(防抖索引 → 跳页导航 → 命中页高亮)
7
- * - useDebugPanel:调试面板(?mrp-debug=1;planKB 按 plan 引用缓存)
8
- * - useThumbs:缩略图侧栏(IntersectionObserver 懒渲染小画布)
9
- * - useLoadTiming:加载耗时计时(performance 不可用时降级为 0)
10
- */
11
- export interface ReportSearchState {
12
- visible: Ref<boolean>;
13
- query: Ref<string>;
14
- matchIndex: Ref<number>;
15
- matchCount: Ref<number>;
16
- toggle(): void;
17
- onInput(query: string): void;
18
- onNav(dir: 1 | -1): void;
19
- /** 页面元素高亮(查询为空时为 no-op) */
20
- apply(pageEl: HTMLElement): void;
21
- clear(pageEl: HTMLElement): void;
22
- /** 换单据/清空时的整体复位 */
23
- reset(): void;
24
- }
25
- export interface ReportSearchOptions {
26
- plan: Ref<RenderPlan | null>;
27
- gotoPage(page: number): void;
28
- debounceMs?: number;
29
- highlight: (pageEl: HTMLElement, query: string) => number;
30
- clearHighlights: (pageEl: HTMLElement) => void;
31
- }
32
- export declare function useReportSearch(options: ReportSearchOptions): ReportSearchState;
33
- /**
34
- * 调试面板状态:?mrp-debug=1 或 debug prop。
35
- * planKB 按 plan 引用缓存(滚动/缩放不触发全量 JSON 序列化)。
36
- */
37
- export declare function useDebugPanel(debug: Ref<boolean>, stats: {
38
- plan: Ref<RenderPlan | null>;
39
- pageCount: Ref<number>;
40
- windowRange: Ref<{
41
- start: number;
42
- end: number;
43
- }>;
44
- zoom: Ref<number>;
45
- loadMs: Ref<number>;
46
- }): {
47
- enabled: import('vue').ComputedRef<boolean>;
48
- debugStats: import('vue').ComputedRef<{
49
- pages: number;
50
- window: string;
51
- zoom: string;
52
- loadMs: string;
53
- planKB: number;
54
- } | null>;
55
- };
56
- /**
57
- * 缩略图侧栏:懒渲染小画布(IntersectionObserver + 低 dpr)。
58
- * 无 2D 环境(SSR/测试)保留占位框,不抛错。
59
- */
60
- export declare function useThumbs(plan: Ref<RenderPlan | null>, opts: {
61
- thumbsRoot: Ref<HTMLElement | null>;
62
- visible: Ref<boolean>;
63
- renderThumbCanvas: (pageIndex: number) => HTMLCanvasElement | null;
64
- }): {
65
- schedule: () => void;
66
- destroy: () => void;
67
- };
68
- /** 加载耗时计时(performance 不可用时为 0) */
69
- export declare function useLoadTiming(): {
70
- loadMs: Ref<number>;
71
- start(): number;
72
- end(t0: number): void;
73
- };
@@ -1,15 +0,0 @@
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
- };
@@ -1,108 +0,0 @@
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
- exportExcel: string;
19
- exportImage: string;
20
- exportWord: string;
21
- /** 导出进行中提示,{format} 占位 */
22
- exporting: string;
23
- print: string;
24
- pdfWindow: string;
25
- loading: string;
26
- empty: string;
27
- /** @deprecated 未被组件消费,将在下个大版本移除(保留仅为类型兼容) */
28
- errorPrefix: string;
29
- retry: string;
30
- /** 搜索框占位文案 */
31
- searchPlaceholder: string;
32
- /** 搜索命中计数,{cur}/{total} 占位 */
33
- matchInfo: string;
34
- /** 上/下一个命中 */
35
- prevMatch: string;
36
- nextMatch: string;
37
- /** 缩略图侧栏开关 */
38
- thumbnails: string;
39
- /** 参数面板 */
40
- paramsTitle: string;
41
- query: string;
42
- reset: string;
43
- /** 必填缺失提示({label} 占位) */
44
- paramRequired: string;
45
- }
46
- export declare const DEFAULT_MESSAGES: MachReportMessages;
47
- /** 主题变量(组件外壳注入的 --mrp-* CSS 自定义属性) */
48
- export interface MachReportTheme {
49
- shellBg: string;
50
- shellFg: string;
51
- toolbarBg: string;
52
- toolbarBorder: string;
53
- toolbarFg: string;
54
- btnFg: string;
55
- btnBorder: string;
56
- btnHoverBg: string;
57
- btnHoverFg: string;
58
- btnActiveBg: string;
59
- }
60
- export declare const DEFAULT_THEME: MachReportTheme;
61
- /** 日志通道(默认 console;可注入 noop 静默或上报 collector) */
62
- export type MachReportLogger = Pick<Console, "warn" | "info">;
63
- /** defaults 层可配置项(全部可选,均有内置缺省) */
64
- export interface MachReportDefaults {
65
- showExport?: boolean;
66
- showPrint?: boolean;
67
- showPdfWindow?: boolean;
68
- /** 参数面板显隐(有参数定义且未显式关闭时显示;缺省 true) */
69
- showParams?: boolean;
70
- /** 页间距 px */
71
- gapPx?: number;
72
- /** PDF 导出中文字体 URL */
73
- pdfFontUrl?: string;
74
- theme?: Partial<MachReportTheme>;
75
- messages?: Partial<MachReportMessages>;
76
- /** 校验告警等内部日志通道(默认 console;静默传 { warn: () => {}, info: () => {} }) */
77
- logger?: MachReportLogger;
78
- }
79
- export type MachReportPreset = MachReportDefaults;
80
- export interface MachReportConfig {
81
- defaults: MachReportDefaults;
82
- presets: Record<string, MachReportPreset>;
83
- /** 默认启用的 preset 名 */
84
- defaultPreset?: string;
85
- }
86
- /** 类型化配置声明(纯类型助手,便于独立 config 文件) */
87
- export declare function defineMachReportConfig(config: MachReportConfig): MachReportConfig;
88
- /** 类型化 preset 声明 */
89
- export declare function defineMachReportPreset(preset: MachReportPreset): MachReportPreset;
90
- export type ResolvedConfig = Required<Pick<MachReportDefaults, "showExport" | "showPrint" | "showPdfWindow" | "showParams" | "gapPx">> & {
91
- pdfFontUrl: string;
92
- theme: MachReportTheme;
93
- messages: MachReportMessages;
94
- logger: MachReportLogger;
95
- };
96
- declare const SILENT_LOGGER: MachReportLogger;
97
- export { SILENT_LOGGER };
98
- export declare function resolveConfig(config: MachReportConfig | null | undefined, presetName?: string): ResolvedConfig;
99
- /** theme 对象 → CSS 自定义属性 style 对象(注入组件外壳) */
100
- export declare function themeToCssVars(theme: Partial<MachReportTheme>): CSSProperties;
101
- type ConfigRef = ComputedRef<MachReportConfig | null>;
102
- /**
103
- * 路由/布局级响应式叠加:就近提供配置层(如某路由关闭导出按钮)。
104
- * 与应用级 config 合并(本层 defaults/presets 优先)。
105
- */
106
- export declare function provideMachReportConfig(overlay: MachReportConfig | MachReportDefaults): void;
107
- /** 组件内部读取当前生效配置层(未提供时返回 null → 走内置缺省) */
108
- export declare function useMachReportConfig(): ConfigRef;
@@ -1,29 +0,0 @@
1
- /**
2
- * ReportPreview 的编程式控制器(与组件 ref 方法同面):
3
- * reload / print / exportAs / openPdfWindow / gotoPage / setParams。
4
- */
5
- export interface MachReportController {
6
- reload(): Promise<void>;
7
- print(): Promise<void>;
8
- /** 支持 html/pdf/xlsx/png/word(excel/image/doc 为兼容别名);未知格式报 export 错误。 */
9
- exportAs(format: string): void;
10
- openPdfWindow(): void;
11
- gotoPage(page: number): void;
12
- /** 编程式设置参数并查询(合并进面板值;opts.reload=false 仅设值不重载) */
13
- setParams(values: Record<string, string>, opts?: {
14
- reload?: boolean;
15
- }): void;
16
- }
17
- /**
18
- * 在 ReportPreview 的任意后代组件中获取控制器(免模板 ref):
19
- *
20
- * ```vue
21
- * <script setup>
22
- * import { useReportPreview } from "@agile-team/mach-report/vue";
23
- * const preview = useReportPreview();
24
- * </script>
25
- * <template><button @click="preview?.print()">打印本单</button></template>
26
- *
27
- * 不在预览组件内调用时返回 null(不抛错,便于条件渲染场景)。
28
- */
29
- export declare function useReportPreview(): MachReportController | null;
@@ -1,16 +0,0 @@
1
- /**
2
- * 结构化错误(code 分类,宿主可按码决定 UX:重试 / 提示 / 降级)。
3
- * error 事件契约保持 `(message: string)` 不变,新增第二参数 detail(可选)。
4
- */
5
- export type MachReportErrorCode = "param" | "fetch" | "validate" | "render" | "pdf" | "print" | "export" | "config";
6
- export declare class MachReportError extends Error {
7
- readonly code: MachReportErrorCode;
8
- readonly cause?: unknown;
9
- constructor(code: MachReportErrorCode, message: string, cause?: unknown);
10
- }
11
- /** error 事件第二参数的形状(向后兼容:仅监听 message 的旧用法不受影响) */
12
- export interface MachReportErrorDetail {
13
- code: MachReportErrorCode;
14
- cause?: unknown;
15
- }
16
- export declare function toErrorDetail(error: unknown): MachReportErrorDetail;
@@ -1,14 +0,0 @@
1
- import { ComputedRef, InjectionKey } from 'vue';
2
- import { PlanFetcher } from './adapters';
3
- import { PdfExporter } from './pdf-exporter';
4
- import { MachReportConfig } from './config';
5
- import { MachReportController } from './controller';
6
- /**
7
- * 注入 key 全部为字符串(而非裸 Symbol):跨模块联邦边界时宿主与远程
8
- * 各自打包会生成不同的 Symbol 实例导致 inject 失效;字符串恒等。
9
- * 保留 InjectionKey 类型以获得类型提示。
10
- */
11
- export declare const MACH_REPORT_FETCHER_KEY: InjectionKey<PlanFetcher>;
12
- export declare const MACH_REPORT_PDF_EXPORTER_KEY: InjectionKey<PdfExporter>;
13
- export declare const MACH_REPORT_CONFIG_KEY: InjectionKey<ComputedRef<MachReportConfig | null>>;
14
- export declare const MACH_REPORT_CONTROLLER_KEY: InjectionKey<MachReportController>;
@@ -1,12 +0,0 @@
1
- import { ReportTemplate } from '@agile-team/mach-report';
2
- import { PlanFetcher } from './adapters';
3
- export interface LocalTemplateEntry {
4
- tempId: string;
5
- template: ReportTemplate;
6
- datasets?: Record<string, Record<string, unknown>[]>;
7
- }
8
- /**
9
- * 本地渲染适配器:模板 + 数据 → core 分页引擎 → RenderPlan。
10
- * 用于离线预览、单测与 jh4j 后端不可用场景(单真相源验证)。
11
- */
12
- export declare function createLocalFetcher(entries: Record<string, LocalTemplateEntry>): PlanFetcher;
@@ -1,13 +0,0 @@
1
- import { RenderPlan } from '@agile-team/mach-report';
2
- /** PDF 导出器:RenderPlan → PDF 字节;第二参数可上报非致命保真告警。 */
3
- export type PdfExporter = (plan: RenderPlan, onWarning?: (message: string) => void) => Promise<Uint8Array>;
4
- export interface DefaultPdfExporterOptions {
5
- /** 中文字体 URL(浏览器 fetch);空串跳过字体加载(西文报表) */
6
- fontUrl: string;
7
- }
8
- /**
9
- * 默认 PDF 导出器:
10
- * - 懒加载 @agile-team/mach-report/pdf(含 pdf-lib,只在首次导出时进 bundle)
11
- * - 字体走 IndexedDB 持久缓存(loadFontWithCache,二次导出零网络)
12
- */
13
- export declare function createDefaultPdfExporter(options?: DefaultPdfExporterOptions): PdfExporter;