@borurio-print/print-designer 1.0.29 → 1.0.31
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 +1 -1
- package/dist-lib/PrintDesigner.vue.d.ts +20 -2
- package/dist-lib/{canvasPdfGenerator-Bf9bdKit.js → canvasPdfGenerator-9ENwDoOM.js} +2 -2
- package/dist-lib/components/BpdButton.vue.d.ts +1 -1
- package/dist-lib/components/BpdDialog.vue.d.ts +1 -1
- package/dist-lib/core/printPagination.d.ts +2 -1
- package/dist-lib/core/templatePrintTypes.d.ts +3 -2
- package/dist-lib/core/types.d.ts +18 -2
- package/dist-lib/{index-DbutHW7U.js → index-B-atwtG_.js} +4800 -4720
- package/dist-lib/index.d.ts +6 -1
- package/dist-lib/{index.es-Bvb0KVUH.js → index.es-BnOcr22f.js} +2 -2
- package/dist-lib/index.js +1 -1
- package/dist-lib/style.css +1 -1
- package/dist-lib/views/print-designer/components/ComponentPanel.vue.d.ts +1 -0
- package/dist-lib/views/print-designer/components/TemplateInfoDialog.vue.d.ts +14 -1
- package/dist-lib/views/print-designer/components/TemplateInfoPanel.vue.d.ts +17 -1
- package/dist-lib/views/print-designer/components/properties/TableConfigProperty.vue.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -209,7 +209,7 @@ const fieldGroups: BusinessFieldGroup[] = [
|
|
|
209
209
|
- 从业务字段添加的页码在没有显式页码字段值时,自动显示当前业务记录内部的 `1/N`;基础组件中的页码仍显示整个打印任务的全局页码。
|
|
210
210
|
|
|
211
211
|
调用时一条原始面单对应一条根记录:
|
|
212
|
-
|
|
212
|
+
办事处里面其他动物的元素应该替换成猫咪的元素,然后办事处这个场景图是否应该把这两个人物放上去,因为后续他们可能是各种各样的姿态出现的,有可能趴在桌子上睡觉,有可能两个人在说悄悄话
|
|
213
213
|
```ts
|
|
214
214
|
const requestId = crypto.randomUUID()
|
|
215
215
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BusinessFieldGroup, PrintRequest, PrintResult, PrintTemplate, PrintDesignerTheme } from '@/core/types';
|
|
1
|
+
import type { BusinessFieldGroup, PrintRequest, PrintResult, PrintTemplate, PrintDesignerTheme, TemplateInfo } from '@/core/types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/**
|
|
4
4
|
* 由业务系统提供的可打印字段目录。
|
|
@@ -7,6 +7,8 @@ type __VLS_Props = {
|
|
|
7
7
|
fieldGroups?: readonly BusinessFieldGroup[];
|
|
8
8
|
/** 当前设计器实例使用的主色主题。 */
|
|
9
9
|
theme?: PrintDesignerTheme;
|
|
10
|
+
allowCustomTable?: boolean;
|
|
11
|
+
beforeTemplateInfoConfirm?: () => boolean | Promise<boolean>;
|
|
10
12
|
};
|
|
11
13
|
declare function getTemplate(): PrintTemplate;
|
|
12
14
|
declare function loadTemplate(template: PrintTemplate): void;
|
|
@@ -14,17 +16,33 @@ declare function loadTemplate(template: PrintTemplate): void;
|
|
|
14
16
|
declare function generatePdf(request: PrintRequest): Promise<void>;
|
|
15
17
|
/** 供业务系统打开 PDF 预览,结果统一通过 print-result 事件通知。 */
|
|
16
18
|
declare function previewPdf(request: PrintRequest): Promise<void>;
|
|
17
|
-
declare
|
|
19
|
+
declare var __VLS_13: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
'template-info-extra'?: (props: typeof __VLS_13) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
18
24
|
getTemplate: typeof getTemplate;
|
|
19
25
|
loadTemplate: typeof loadTemplate;
|
|
20
26
|
generatePdf: typeof generatePdf;
|
|
21
27
|
previewPdf: typeof previewPdf;
|
|
28
|
+
openTemplateInfo: () => void | undefined;
|
|
22
29
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
30
|
"print-result": (result: PrintResult) => any;
|
|
31
|
+
"template-info-open": (value: TemplateInfo) => any;
|
|
32
|
+
"template-info-confirm": (value: TemplateInfo) => any;
|
|
24
33
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
34
|
"onPrint-result"?: (result: PrintResult) => any;
|
|
35
|
+
"onTemplate-info-open"?: (value: TemplateInfo) => any;
|
|
36
|
+
"onTemplate-info-confirm"?: (value: TemplateInfo) => any;
|
|
26
37
|
}>, {
|
|
27
38
|
fieldGroups: readonly BusinessFieldGroup[];
|
|
39
|
+
allowCustomTable: boolean;
|
|
28
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
42
|
declare const _default: typeof __VLS_export;
|
|
30
43
|
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Mc, a as Ic, f as Bs, g as Rs, r as Ec, b as Cc, c as zu, d as Fc, e as jc, h as Oc, J as Bc, Q as Rc, l as Tc, j as Dc, k as nf, T as qc, m as Uc, n as zc } from "./index-
|
|
1
|
+
import { i as Mc, a as Ic, f as Bs, g as Rs, r as Ec, b as Cc, c as zu, d as Fc, e as jc, h as Oc, J as Bc, Q as Rc, l as Tc, j as Dc, k as nf, T as qc, m as Uc, n as zc } from "./index-B-atwtG_.js";
|
|
2
2
|
function xe(r) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return xe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
@@ -8800,7 +8800,7 @@ endobj\r
|
|
|
8800
8800
|
var d = c.getContext("2d");
|
|
8801
8801
|
d.fillStyle = "#fff", d.fillRect(0, 0, c.width, c.height);
|
|
8802
8802
|
var g = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, x = this;
|
|
8803
|
-
return (Jt.canvg ? Promise.resolve(Jt.canvg) : import("./index.es-
|
|
8803
|
+
return (Jt.canvg ? Promise.resolve(Jt.canvg) : import("./index.es-BnOcr22f.js")).catch(function(N) {
|
|
8804
8804
|
return Promise.reject(new Error("Could not load canvg: " + N));
|
|
8805
8805
|
}).then(function(N) {
|
|
8806
8806
|
return N.default ? N.default : N;
|
|
@@ -11,8 +11,8 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
default?: (props: typeof __VLS_1) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
-
link: boolean;
|
|
15
14
|
type: "primary" | "danger" | "default" | string;
|
|
15
|
+
link: boolean;
|
|
16
16
|
loading: boolean;
|
|
17
17
|
plain: boolean;
|
|
18
18
|
disabled: boolean;
|
|
@@ -22,8 +22,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
22
22
|
"onUpdate:modelValue"?: (value: boolean) => any;
|
|
23
23
|
onOpen?: () => any;
|
|
24
24
|
}>, {
|
|
25
|
-
width: string | number;
|
|
26
25
|
title: string;
|
|
26
|
+
width: string | number;
|
|
27
27
|
modalClass: string;
|
|
28
28
|
closeOnClickModal: boolean;
|
|
29
29
|
closeOnPressEscape: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { DesignerElement, PrintRenderPage, TemplateMode } from './types';
|
|
1
|
+
import type { DesignerElement, PrintRenderPage, TemplateMode, PrintRequest } from './types';
|
|
2
2
|
interface PaginationOptions {
|
|
3
3
|
templateMode: TemplateMode;
|
|
4
4
|
firstElements: DesignerElement[];
|
|
5
5
|
continuationElements: DesignerElement[];
|
|
6
6
|
}
|
|
7
|
+
export declare function buildRequestedPrintPages(request: PrintRequest, options: PaginationOptions): PrintRenderPage[];
|
|
7
8
|
export declare function buildPrintRenderPages(data: unknown, options: PaginationOptions): PrintRenderPage[];
|
|
8
9
|
export declare function buildRepeatedPrintPages(pageCount: number, options: PaginationOptions): PrintRenderPage[];
|
|
9
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PrinterSetting, PrintPluginProps } from './localPrintTypes';
|
|
2
|
-
import type { PrintDesignerTheme, PrintResult, PrintTemplate } from './types';
|
|
2
|
+
import type { ExplicitPrintPage, PrintDesignerTheme, PrintResult, PrintTemplate } from './types';
|
|
3
3
|
/** 业务系统传给统一打印弹窗的模板选项。 */
|
|
4
4
|
export interface TemplatePrintOption {
|
|
5
5
|
id: string | number;
|
|
@@ -9,7 +9,8 @@ export interface TemplatePrintOption {
|
|
|
9
9
|
}
|
|
10
10
|
/** 每次打开统一打印弹窗时传入的任务数据。 */
|
|
11
11
|
export interface TemplatePrintDialogOpenOptions {
|
|
12
|
-
data
|
|
12
|
+
data?: unknown;
|
|
13
|
+
pages?: ExplicitPrintPage[];
|
|
13
14
|
defaultTemplateId?: string | number;
|
|
14
15
|
/** 调用方可指定任务 ID;缺少时由组件生成。 */
|
|
15
16
|
requestId?: string;
|
package/dist-lib/core/types.d.ts
CHANGED
|
@@ -50,10 +50,15 @@ export interface PrintRenderOptions {
|
|
|
50
50
|
pageConcurrency?: number;
|
|
51
51
|
}
|
|
52
52
|
/** 业务系统发起一次 PDF 生成或预览的请求。 */
|
|
53
|
+
export interface ExplicitPrintPage {
|
|
54
|
+
templatePage: TemplatePage;
|
|
55
|
+
data: Record<string, unknown>;
|
|
56
|
+
}
|
|
53
57
|
export interface PrintRequest<T = unknown> {
|
|
54
58
|
/** 由调用方生成,用于将异步结果与请求一一对应。 */
|
|
55
59
|
requestId: string;
|
|
56
|
-
data
|
|
60
|
+
data?: T;
|
|
61
|
+
pages?: ExplicitPrintPage[];
|
|
57
62
|
/** 只有显式需要获取 PDF 文件时才设置为 true。 */
|
|
58
63
|
returnBlob?: boolean;
|
|
59
64
|
/** 可选的打印性能参数;未传时使用组件内置默认值。 */
|
|
@@ -72,7 +77,7 @@ export interface PrintResult {
|
|
|
72
77
|
};
|
|
73
78
|
}
|
|
74
79
|
/** 业务字段允许在标签中使用的初始展示方式。 */
|
|
75
|
-
export type FieldElementType = 'text' | 'textBox' | 'qrcode' | 'barcode' | 'pageNumber' | 'pdf';
|
|
80
|
+
export type FieldElementType = 'text' | 'textBox' | 'qrcode' | 'barcode' | 'pageNumber' | 'pdf' | 'table';
|
|
76
81
|
/**
|
|
77
82
|
* 由业务系统传给设计器的字段定义。
|
|
78
83
|
*
|
|
@@ -87,6 +92,15 @@ export interface BusinessField {
|
|
|
87
92
|
currentPageField?: string;
|
|
88
93
|
/** type 为 pageNumber 时,从当前业务记录读取总页数的字段路径。 */
|
|
89
94
|
totalPageField?: string;
|
|
95
|
+
/** 表格字段在添加时复制此配置,此后与预设相互独立。 */
|
|
96
|
+
tableConfig?: BusinessTablePreset;
|
|
97
|
+
}
|
|
98
|
+
export interface BusinessTablePreset {
|
|
99
|
+
mode?: TableMode;
|
|
100
|
+
groupField?: string;
|
|
101
|
+
detailField?: string;
|
|
102
|
+
columns: readonly (Partial<TableColumn> & Pick<TableColumn, 'type' | 'title'>)[];
|
|
103
|
+
groupHeaderCells?: readonly Partial<TableGroupHeaderCell>[];
|
|
90
104
|
}
|
|
91
105
|
/** 左侧字段列表的分组;不同业务系统可以传入完全不同的分组和字段。 */
|
|
92
106
|
export interface BusinessFieldGroup {
|
|
@@ -304,6 +318,8 @@ export interface TableConfigValue {
|
|
|
304
318
|
/** 表格作为单个元素拖动和缩放,内部列配置由右侧属性面板维护。 */
|
|
305
319
|
export interface TableDesignerElement extends BaseDesignerElement {
|
|
306
320
|
type: 'table';
|
|
321
|
+
/** 业务预设表格锁定字段映射及列结构。 */
|
|
322
|
+
bindingLocked?: boolean;
|
|
307
323
|
mode: TableMode;
|
|
308
324
|
/** 打印控件后续从业务数据中读取表格数组的字段路径。 */
|
|
309
325
|
field?: string;
|