@borurio-print/print-designer 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/PrintPlugin.vue.d.ts +36 -1
- package/dist-lib/TemplatePrintDialog.vue.d.ts +54 -0
- package/dist-lib/core/localPrintTypes.d.ts +4 -0
- package/dist-lib/core/templatePrintTypes.d.ts +42 -0
- package/dist-lib/{index-HlbmrwAc.js → index-DYvfnjEs.js} +4626 -4314
- package/dist-lib/index.d.ts +3 -0
- package/dist-lib/{index.es-BORqmi60.js → index.es-B_TZpMDV.js} +2 -2
- package/dist-lib/index.js +8 -7
- package/dist-lib/{pdfGenerator-DdAc3h0P.js → pdfGenerator-BGRa3H-4.js} +1 -1
- package/dist-lib/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,45 @@
|
|
|
1
1
|
import type { PrintResult } from './core/types';
|
|
2
2
|
import type { LocalPrintConnectionState, LocalPrintEvent, LocalPrintPdfRequest, LocalPrintUrlRequest, PrintPluginProps, PrinterSetting } from './core/localPrintTypes';
|
|
3
3
|
declare function disconnect(): void;
|
|
4
|
+
declare function setDraftPrinter(value: string): void;
|
|
5
|
+
declare function setDraftPaper(value: string): void;
|
|
4
6
|
declare function connectPrint(): Promise<void>;
|
|
5
7
|
declare function refreshPrinters(): Promise<void>;
|
|
6
8
|
declare function showEdit(): void;
|
|
7
9
|
declare function hideEdit(): void;
|
|
10
|
+
declare function reconnect(): void;
|
|
11
|
+
declare function saveSettings(): void;
|
|
8
12
|
declare function getPrintData(): PrinterSetting & {
|
|
9
13
|
printVersion: number;
|
|
10
14
|
};
|
|
11
15
|
declare function setPrintUrl(request: LocalPrintUrlRequest): string;
|
|
12
16
|
declare function printPdf(request: LocalPrintPdfRequest): string;
|
|
13
|
-
declare
|
|
17
|
+
declare var __VLS_1: {
|
|
18
|
+
connection: LocalPrintConnectionState;
|
|
19
|
+
printers: {
|
|
20
|
+
name: string;
|
|
21
|
+
isDefault?: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
papers: {
|
|
24
|
+
name: string;
|
|
25
|
+
width?: number;
|
|
26
|
+
height?: number;
|
|
27
|
+
}[];
|
|
28
|
+
printer: string;
|
|
29
|
+
paper: string;
|
|
30
|
+
version: number;
|
|
31
|
+
ipAddress: string;
|
|
32
|
+
errorMessage: string;
|
|
33
|
+
saving: boolean;
|
|
34
|
+
setPrinter: typeof setDraftPrinter;
|
|
35
|
+
setPaper: typeof setDraftPaper;
|
|
36
|
+
saveSettings: typeof saveSettings;
|
|
37
|
+
reconnect: typeof reconnect;
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Slots = {} & {
|
|
40
|
+
default?: (props: typeof __VLS_1) => any;
|
|
41
|
+
};
|
|
42
|
+
declare const __VLS_base: import("vue").DefineComponent<PrintPluginProps, {
|
|
14
43
|
connectPrint: typeof connectPrint;
|
|
15
44
|
disconnect: typeof disconnect;
|
|
16
45
|
showEdit: typeof showEdit;
|
|
@@ -42,5 +71,11 @@ declare const __VLS_export: import("vue").DefineComponent<PrintPluginProps, {
|
|
|
42
71
|
defaultPrinter: string;
|
|
43
72
|
defaultPaper: string;
|
|
44
73
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
74
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
75
|
declare const _default: typeof __VLS_export;
|
|
46
76
|
export default _default;
|
|
77
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
78
|
+
new (): {
|
|
79
|
+
$slots: S;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { LocalPrintConnectionState } from './core/localPrintTypes';
|
|
2
|
+
import type { TemplatePrintDialogOpenOptions, TemplatePrintOption } from './core/templatePrintTypes';
|
|
3
|
+
import type { PrintDesignerTheme, PrintResult } from './core/types';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
templates: readonly TemplatePrintOption[];
|
|
6
|
+
defaultTemplateId?: string | number;
|
|
7
|
+
endpoint?: string;
|
|
8
|
+
sceneKey?: string;
|
|
9
|
+
client?: string;
|
|
10
|
+
autoConnect?: boolean;
|
|
11
|
+
connectTimeoutMs?: number;
|
|
12
|
+
printTimeoutMs?: number;
|
|
13
|
+
maxPdfBytes?: number;
|
|
14
|
+
persistSettings?: boolean;
|
|
15
|
+
defaultPrinter?: string;
|
|
16
|
+
defaultPaper?: string;
|
|
17
|
+
persistTemplateSelection?: boolean;
|
|
18
|
+
allowBrowserPreview?: boolean;
|
|
19
|
+
allowPrinterPrint?: boolean;
|
|
20
|
+
closeOnSuccess?: boolean;
|
|
21
|
+
theme?: PrintDesignerTheme;
|
|
22
|
+
};
|
|
23
|
+
declare function open(options: TemplatePrintDialogOpenOptions): void;
|
|
24
|
+
declare function close(): void;
|
|
25
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
26
|
+
open: typeof open;
|
|
27
|
+
close: typeof close;
|
|
28
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
"print-result": (result: PrintResult) => any;
|
|
30
|
+
"connection-change": (state: LocalPrintConnectionState) => any;
|
|
31
|
+
"loading-change": (loading: boolean) => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
+
"onPrint-result"?: (result: PrintResult) => any;
|
|
34
|
+
"onConnection-change"?: (state: LocalPrintConnectionState) => any;
|
|
35
|
+
"onLoading-change"?: (loading: boolean) => any;
|
|
36
|
+
}>, {
|
|
37
|
+
endpoint: string;
|
|
38
|
+
sceneKey: string;
|
|
39
|
+
client: string;
|
|
40
|
+
autoConnect: boolean;
|
|
41
|
+
connectTimeoutMs: number;
|
|
42
|
+
printTimeoutMs: number;
|
|
43
|
+
maxPdfBytes: number;
|
|
44
|
+
persistSettings: boolean;
|
|
45
|
+
defaultPrinter: string;
|
|
46
|
+
defaultPaper: string;
|
|
47
|
+
defaultTemplateId: string | number;
|
|
48
|
+
persistTemplateSelection: boolean;
|
|
49
|
+
allowBrowserPreview: boolean;
|
|
50
|
+
allowPrinterPrint: boolean;
|
|
51
|
+
closeOnSuccess: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
export default _default;
|
|
@@ -28,6 +28,10 @@ export interface LocalPrintPdfRequest {
|
|
|
28
28
|
requestId?: string;
|
|
29
29
|
copies?: number;
|
|
30
30
|
orientation?: 'portrait' | 'landscape';
|
|
31
|
+
/** 本次任务显式指定打印机;缺少时使用组件已保存设置。 */
|
|
32
|
+
printer?: string;
|
|
33
|
+
/** 本次任务显式指定纸张;缺少时使用组件已保存设置。 */
|
|
34
|
+
paper?: string;
|
|
31
35
|
}
|
|
32
36
|
export interface PrintPluginProps {
|
|
33
37
|
endpoint?: string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PrintPluginProps } from './localPrintTypes';
|
|
2
|
+
import type { PrintDesignerTheme, PrintResult, PrintTemplate } from './types';
|
|
3
|
+
/** 业务系统传给统一打印弹窗的模板选项。 */
|
|
4
|
+
export interface TemplatePrintOption {
|
|
5
|
+
id: string | number;
|
|
6
|
+
label: string;
|
|
7
|
+
/** 可以直接传模板对象,也可以传后端保存的 JSON 字符串。 */
|
|
8
|
+
template: PrintTemplate | string;
|
|
9
|
+
}
|
|
10
|
+
/** 每次打开统一打印弹窗时传入的任务数据。 */
|
|
11
|
+
export interface TemplatePrintDialogOpenOptions {
|
|
12
|
+
data: unknown;
|
|
13
|
+
defaultTemplateId?: string | number;
|
|
14
|
+
/** 调用方可指定任务 ID;缺少时由组件生成。 */
|
|
15
|
+
requestId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TemplatePrintDialogProps {
|
|
18
|
+
templates: readonly TemplatePrintOption[];
|
|
19
|
+
defaultTemplateId?: string | number;
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
sceneKey?: string;
|
|
22
|
+
client?: string;
|
|
23
|
+
autoConnect?: boolean;
|
|
24
|
+
connectTimeoutMs?: number;
|
|
25
|
+
printTimeoutMs?: number;
|
|
26
|
+
maxPdfBytes?: number;
|
|
27
|
+
persistSettings?: boolean;
|
|
28
|
+
defaultPrinter?: string;
|
|
29
|
+
defaultPaper?: string;
|
|
30
|
+
persistTemplateSelection?: boolean;
|
|
31
|
+
allowBrowserPreview?: boolean;
|
|
32
|
+
allowPrinterPrint?: boolean;
|
|
33
|
+
closeOnSuccess?: boolean;
|
|
34
|
+
theme?: PrintDesignerTheme;
|
|
35
|
+
onPrintResult?: (result: PrintResult) => void;
|
|
36
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
37
|
+
onConnectionChange?: PrintPluginProps['onConnectionChange'];
|
|
38
|
+
}
|
|
39
|
+
export interface TemplatePrintDialogExpose {
|
|
40
|
+
open: (options: TemplatePrintDialogOpenOptions) => void;
|
|
41
|
+
close: () => void;
|
|
42
|
+
}
|