ele-admin-plus 1.1.6-beta.1 → 1.1.6-beta.2
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/es/ele-app/types/components.d.ts +2 -2
- package/es/ele-app/types/index.d.ts +2 -0
- package/es/ele-config-provider/index.d.ts +2 -2
- package/es/ele-config-provider/index.js +6 -6
- package/es/ele-config-provider/props.d.ts +2 -2
- package/es/ele-config-provider/props.js +3 -3
- package/es/ele-config-provider/receiver.d.ts +3 -3
- package/es/ele-config-provider/receiver.js +103 -99
- package/es/ele-config-provider/types/index.d.ts +5 -7
- package/es/ele-data-table/index.d.ts +11 -13
- package/es/ele-data-table/index.js +1 -1
- package/es/ele-data-table/props.d.ts +5 -5
- package/es/ele-data-table/style/index.scss +6 -1
- package/es/ele-file-list/components/file-grid-item.js +5 -3
- package/es/ele-file-list/components/file-grid.d.ts +1 -0
- package/es/ele-file-list/components/file-grid.js +8 -1
- package/es/ele-file-list/components/file-table-item.js +5 -3
- package/es/ele-file-list/components/file-table.d.ts +1 -0
- package/es/ele-file-list/components/file-table.js +8 -1
- package/es/ele-modal/index.d.ts +1 -1
- package/es/ele-modal/index.js +37 -13
- package/es/ele-popconfirm/index.d.ts +8 -11
- package/es/ele-popconfirm/props.d.ts +5 -6
- package/es/ele-popover/index.d.ts +12 -15
- package/es/ele-popover/props.d.ts +4 -5
- package/es/ele-popover/props.js +1 -1
- package/es/ele-printer/index.d.ts +5 -3
- package/es/ele-printer/index.js +4 -3
- package/es/ele-printer/props.d.ts +4 -2
- package/es/ele-printer/props.js +3 -1
- package/es/ele-printer/types/index.d.ts +5 -1
- package/es/ele-printer/util.d.ts +6 -0
- package/es/ele-printer/util.js +11 -3
- package/es/ele-pro-layout/components/pro-header.js +8 -3
- package/es/ele-pro-layout/components/pro-sidebar.js +6 -5
- package/es/ele-pro-layout/components/pro-sidebox.js +6 -5
- package/es/ele-pro-layout/components/tab-dropdown.js +4 -3
- package/es/ele-pro-layout/index.d.ts +20 -22
- package/es/ele-pro-layout/index.js +51 -4
- package/es/ele-pro-layout/props.js +1 -1
- package/es/ele-pro-layout/style/layout-mobile.scss +4 -0
- package/es/ele-pro-table/index.d.ts +11 -11
- package/es/ele-pro-table/props.d.ts +5 -5
- package/es/ele-tabs/components/tab-title.js +6 -5
- package/es/ele-virtual-table/props.d.ts +5 -5
- package/lib/ele-app/types/components.d.ts +2 -2
- package/lib/ele-app/types/index.d.ts +2 -0
- package/lib/ele-config-provider/index.d.ts +2 -2
- package/lib/ele-config-provider/index.js +6 -6
- package/lib/ele-config-provider/props.d.ts +2 -2
- package/lib/ele-config-provider/props.js +3 -3
- package/lib/ele-config-provider/receiver.d.ts +3 -3
- package/lib/ele-config-provider/receiver.js +2 -2
- package/lib/ele-config-provider/types/index.d.ts +5 -7
- package/lib/ele-data-table/index.d.ts +11 -13
- package/lib/ele-data-table/index.js +1 -1
- package/lib/ele-data-table/props.d.ts +5 -5
- package/lib/ele-data-table/style/index.scss +6 -1
- package/lib/ele-file-list/components/file-grid-item.js +5 -3
- package/lib/ele-file-list/components/file-grid.d.ts +1 -0
- package/lib/ele-file-list/components/file-grid.js +8 -1
- package/lib/ele-file-list/components/file-table-item.js +5 -3
- package/lib/ele-file-list/components/file-table.d.ts +1 -0
- package/lib/ele-file-list/components/file-table.js +8 -1
- package/lib/ele-modal/index.d.ts +1 -1
- package/lib/ele-modal/index.js +36 -12
- package/lib/ele-popconfirm/index.d.ts +8 -11
- package/lib/ele-popconfirm/props.d.ts +5 -6
- package/lib/ele-popover/index.d.ts +12 -15
- package/lib/ele-popover/props.d.ts +4 -5
- package/lib/ele-popover/props.js +1 -1
- package/lib/ele-printer/index.d.ts +5 -3
- package/lib/ele-printer/index.js +3 -2
- package/lib/ele-printer/props.d.ts +4 -2
- package/lib/ele-printer/props.js +3 -1
- package/lib/ele-printer/types/index.d.ts +5 -1
- package/lib/ele-printer/util.d.ts +6 -0
- package/lib/ele-printer/util.js +11 -3
- package/lib/ele-pro-layout/components/pro-header.js +8 -3
- package/lib/ele-pro-layout/components/pro-sidebar.js +5 -4
- package/lib/ele-pro-layout/components/pro-sidebox.js +5 -4
- package/lib/ele-pro-layout/components/tab-dropdown.js +4 -3
- package/lib/ele-pro-layout/index.d.ts +20 -22
- package/lib/ele-pro-layout/index.js +51 -4
- package/lib/ele-pro-layout/props.js +1 -1
- package/lib/ele-pro-layout/style/layout-mobile.scss +4 -0
- package/lib/ele-pro-table/index.d.ts +11 -11
- package/lib/ele-pro-table/props.d.ts +5 -5
- package/lib/ele-tabs/components/tab-title.js +6 -5
- package/lib/ele-virtual-table/props.d.ts +5 -5
- package/package.json +1 -1
|
@@ -181,11 +181,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
181
181
|
], 4);
|
|
182
182
|
}), 128))
|
|
183
183
|
], 32),
|
|
184
|
-
_ctx.contextMenus || _ctx.$slots.contextMenu ? (openBlock(), createBlock(_component_EleDropdown, mergeProps({
|
|
184
|
+
_ctx.contextMenus || _ctx.$slots.contextMenu ? (openBlock(), createBlock(_component_EleDropdown, mergeProps({
|
|
185
|
+
key: 0,
|
|
186
|
+
placement: "bottom-start",
|
|
187
|
+
popperClass: "ele-file-list-item-context"
|
|
188
|
+
}, _ctx.contextMenuProps, {
|
|
185
189
|
ref: "dropdownRef",
|
|
186
190
|
trigger: "click",
|
|
187
|
-
placement: "bottom-start",
|
|
188
|
-
popperClass: "ele-file-list-item-context",
|
|
189
191
|
class: "ele-file-list-item-dropdown",
|
|
190
192
|
items: _ctx.contextMenus,
|
|
191
193
|
onCommand: _ctx.onItemContextMenu,
|
|
@@ -38,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
38
38
|
}, {
|
|
39
39
|
itemRefs: Ref<TableItemInstance[]>;
|
|
40
40
|
tableCols: import("vue").ComputedRef<ColumnItem[]>;
|
|
41
|
+
getContextMenus: (item: FileItem) => import("../../ele-dropdown/types").DropdownItem[] | undefined;
|
|
41
42
|
onCheckAllChange: () => void;
|
|
42
43
|
onItemClick: (item: FileItem) => void;
|
|
43
44
|
onItemCheckChange: (item: FileItem) => void;
|
|
@@ -73,6 +73,12 @@ const _sfc_main = defineComponent({
|
|
|
73
73
|
];
|
|
74
74
|
return cols;
|
|
75
75
|
});
|
|
76
|
+
const getContextMenus = (item) => {
|
|
77
|
+
if (typeof props.contextMenus === "function") {
|
|
78
|
+
return props.contextMenus(item);
|
|
79
|
+
}
|
|
80
|
+
return props.contextMenus;
|
|
81
|
+
};
|
|
76
82
|
const onCheckAllChange = () => {
|
|
77
83
|
emit("checkAllChange");
|
|
78
84
|
};
|
|
@@ -106,6 +112,7 @@ const _sfc_main = defineComponent({
|
|
|
106
112
|
return {
|
|
107
113
|
itemRefs,
|
|
108
114
|
tableCols,
|
|
115
|
+
getContextMenus,
|
|
109
116
|
onCheckAllChange,
|
|
110
117
|
onItemClick,
|
|
111
118
|
onItemCheckChange,
|
|
@@ -200,7 +207,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
200
207
|
current: _ctx.current,
|
|
201
208
|
icons: _ctx.icons,
|
|
202
209
|
columns: _ctx.tableCols,
|
|
203
|
-
contextMenus:
|
|
210
|
+
contextMenus: _ctx.getContextMenus(item),
|
|
204
211
|
contextMenuProps: _ctx.contextMenuProps,
|
|
205
212
|
onClick: _ctx.onItemClick,
|
|
206
213
|
onCheckChange: _ctx.onItemCheckChange,
|
package/es/ele-modal/index.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
89
|
dialogRef: import("vue").Ref<ElDialogInstance>;
|
|
90
90
|
container: import("vue").Ref<Element>;
|
|
91
91
|
isFullscreen: import("vue").Ref<boolean>;
|
|
92
|
-
|
|
92
|
+
enable: import("vue").Ref<boolean>;
|
|
93
93
|
dialogProps: import("vue").ComputedRef<ElDialogProps>;
|
|
94
94
|
updateModelValue: (modelValue: boolean) => void;
|
|
95
95
|
toggleFullscreen: (fullscreen?: boolean) => void;
|
package/es/ele-modal/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, unref, watch, onActivated, onDeactivated, nextTick, resolveComponent, openBlock, createBlock, Teleport, createVNode, mergeProps, createSlots, withCtx, createElementVNode, normalizeStyle, renderSlot, createTextVNode, toDisplayString,
|
|
1
|
+
import { defineComponent, ref, computed, unref, watch, onActivated, onDeactivated, nextTick, resolveComponent, openBlock, createBlock, Teleport, createVNode, mergeProps, createSlots, withCtx, createElementVNode, normalizeStyle, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
import { ElDialog, ElIcon } from "element-plus";
|
|
3
3
|
import { Close } from "@element-plus/icons-vue";
|
|
4
4
|
import { CompressOutlined, ExpandOutlined } from "../icons";
|
|
@@ -19,7 +19,9 @@ const _sfc_main = defineComponent({
|
|
|
19
19
|
const container = ref(getModalContainer());
|
|
20
20
|
const isFullscreen = ref(props.fullscreen ?? false);
|
|
21
21
|
const isActivated = ref(true);
|
|
22
|
-
const
|
|
22
|
+
const enable = ref(
|
|
23
|
+
props.destroyOnClose && !props.modelValue ? false : true
|
|
24
|
+
);
|
|
23
25
|
const dialogClass = computed(() => {
|
|
24
26
|
const layoutState = unref(layoutProvide);
|
|
25
27
|
const classes = [wrapperClass];
|
|
@@ -93,6 +95,7 @@ const _sfc_main = defineComponent({
|
|
|
93
95
|
showClose: false,
|
|
94
96
|
draggable: false,
|
|
95
97
|
alignCenter: false,
|
|
98
|
+
destroyOnClose: false,
|
|
96
99
|
modalClass: dialogClass.value
|
|
97
100
|
};
|
|
98
101
|
return Object.assign({}, attrs, pick(props, dialogPropKeys), opt);
|
|
@@ -123,6 +126,9 @@ const _sfc_main = defineComponent({
|
|
|
123
126
|
if (props.resetOnClose || props.destroyOnClose) {
|
|
124
127
|
isFullscreen.value = props.fullscreen ?? false;
|
|
125
128
|
}
|
|
129
|
+
if (!enable.value) {
|
|
130
|
+
enable.value = true;
|
|
131
|
+
}
|
|
126
132
|
nextTick(() => {
|
|
127
133
|
const modalEl = getModalEl();
|
|
128
134
|
if (props.resetOnClose) {
|
|
@@ -156,6 +162,9 @@ const _sfc_main = defineComponent({
|
|
|
156
162
|
emit("close");
|
|
157
163
|
};
|
|
158
164
|
const onClosed = () => {
|
|
165
|
+
if (enable.value) {
|
|
166
|
+
enable.value = false;
|
|
167
|
+
}
|
|
159
168
|
emit("closed");
|
|
160
169
|
};
|
|
161
170
|
const onOpenAutoFocus = () => {
|
|
@@ -184,6 +193,18 @@ const _sfc_main = defineComponent({
|
|
|
184
193
|
}
|
|
185
194
|
}
|
|
186
195
|
);
|
|
196
|
+
watch(
|
|
197
|
+
() => props.destroyOnClose,
|
|
198
|
+
(destroyOnClose) => {
|
|
199
|
+
if (destroyOnClose) {
|
|
200
|
+
if (!props.modelValue && enable.value) {
|
|
201
|
+
enable.value = false;
|
|
202
|
+
}
|
|
203
|
+
} else if (!enable.value) {
|
|
204
|
+
enable.value = true;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
);
|
|
187
208
|
onActivated(() => {
|
|
188
209
|
isActivated.value = true;
|
|
189
210
|
});
|
|
@@ -194,7 +215,7 @@ const _sfc_main = defineComponent({
|
|
|
194
215
|
dialogRef,
|
|
195
216
|
container,
|
|
196
217
|
isFullscreen,
|
|
197
|
-
|
|
218
|
+
enable,
|
|
198
219
|
dialogProps,
|
|
199
220
|
updateModelValue,
|
|
200
221
|
toggleFullscreen,
|
|
@@ -240,7 +261,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
240
261
|
class: "ele-modal-header",
|
|
241
262
|
style: normalizeStyle(_ctx.headerStyle)
|
|
242
263
|
}, [
|
|
243
|
-
|
|
264
|
+
_ctx.enable ? (openBlock(), createElementBlock("div", {
|
|
265
|
+
key: 0,
|
|
244
266
|
class: "ele-modal-title",
|
|
245
267
|
style: normalizeStyle(_ctx.titleStyle)
|
|
246
268
|
}, [
|
|
@@ -251,9 +273,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
251
273
|
}, () => [
|
|
252
274
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
253
275
|
])
|
|
254
|
-
], 4),
|
|
255
|
-
_ctx.maxable ? (openBlock(), createElementBlock("div", {
|
|
256
|
-
key:
|
|
276
|
+
], 4)) : createCommentVNode("", true),
|
|
277
|
+
_ctx.enable && _ctx.maxable ? (openBlock(), createElementBlock("div", {
|
|
278
|
+
key: 1,
|
|
257
279
|
class: "ele-modal-tool",
|
|
258
280
|
style: normalizeStyle(_ctx.fullscreenBtnStyle),
|
|
259
281
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggleFullscreen())
|
|
@@ -267,8 +289,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
267
289
|
})
|
|
268
290
|
])
|
|
269
291
|
], 4)) : createCommentVNode("", true),
|
|
270
|
-
_ctx.showClose ? (openBlock(), createElementBlock("div", {
|
|
271
|
-
key:
|
|
292
|
+
_ctx.enable && _ctx.showClose ? (openBlock(), createElementBlock("div", {
|
|
293
|
+
key: 2,
|
|
272
294
|
class: "ele-modal-tool",
|
|
273
295
|
style: normalizeStyle(_ctx.closeBtnStyle),
|
|
274
296
|
onClick: close
|
|
@@ -285,24 +307,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
285
307
|
], 4)
|
|
286
308
|
]),
|
|
287
309
|
default: withCtx(() => [
|
|
288
|
-
|
|
310
|
+
_ctx.enable ? (openBlock(), createElementBlock("div", {
|
|
311
|
+
key: 0,
|
|
289
312
|
class: "ele-modal-body",
|
|
290
313
|
style: normalizeStyle(_ctx.bodyStyle)
|
|
291
314
|
}, [
|
|
292
315
|
renderSlot(_ctx.$slots, "default")
|
|
293
|
-
], 4)
|
|
316
|
+
], 4)) : createCommentVNode("", true)
|
|
294
317
|
]),
|
|
295
318
|
_: 2
|
|
296
319
|
}, [
|
|
297
320
|
_ctx.$slots.footer ? {
|
|
298
321
|
name: "footer",
|
|
299
322
|
fn: withCtx(() => [
|
|
300
|
-
|
|
323
|
+
_ctx.enable ? (openBlock(), createElementBlock("div", {
|
|
324
|
+
key: 0,
|
|
301
325
|
class: "ele-modal-footer",
|
|
302
326
|
style: normalizeStyle(_ctx.footerStyle)
|
|
303
327
|
}, [
|
|
304
328
|
renderSlot(_ctx.$slots, "footer")
|
|
305
|
-
], 4)
|
|
329
|
+
], 4)) : createCommentVNode("", true)
|
|
306
330
|
]),
|
|
307
331
|
key: "0"
|
|
308
332
|
} : void 0
|
|
@@ -73,12 +73,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
73
|
title: StringConstructor;
|
|
74
74
|
width: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
|
|
75
75
|
popperClass: StringConstructor;
|
|
76
|
-
bg: StringConstructor;
|
|
77
|
-
arrowBg: StringConstructor; /** 文字提示属性 */
|
|
78
|
-
isPopover: BooleanConstructor;
|
|
79
76
|
id: StringConstructor;
|
|
80
77
|
role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "menu" | "group" | "listbox" | "grid" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
|
|
81
78
|
strategy: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "fixed" | "absolute", unknown, "absolute", boolean>;
|
|
79
|
+
bg: StringConstructor;
|
|
82
80
|
arrowOffset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
83
81
|
triggerKeys: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
|
|
84
82
|
virtualRef: {
|
|
@@ -95,8 +93,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
95
93
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
96
94
|
__epPropKey: true;
|
|
97
95
|
};
|
|
98
|
-
rawContent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
99
96
|
ariaLabel: StringConstructor;
|
|
97
|
+
className: StringConstructor;
|
|
100
98
|
pure: BooleanConstructor;
|
|
101
99
|
focusOnShow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
102
100
|
trapping: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -117,7 +115,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
117
115
|
boundariesPadding: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
118
116
|
fallbackPlacements: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | ((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]))[], unknown, unknown, undefined, boolean>;
|
|
119
117
|
gpuAcceleration: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
120
|
-
|
|
118
|
+
arrowBg: StringConstructor;
|
|
119
|
+
isPopover: BooleanConstructor;
|
|
121
120
|
}, {
|
|
122
121
|
tooltipRef: import("vue").Ref<EleTooltipInstance>;
|
|
123
122
|
tooltipProps: import("vue").ComputedRef<Partial<TooltipProps>>;
|
|
@@ -212,12 +211,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
212
211
|
title: StringConstructor;
|
|
213
212
|
width: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
|
|
214
213
|
popperClass: StringConstructor;
|
|
215
|
-
bg: StringConstructor;
|
|
216
|
-
arrowBg: StringConstructor; /** 文字提示属性 */
|
|
217
|
-
isPopover: BooleanConstructor;
|
|
218
214
|
id: StringConstructor;
|
|
219
215
|
role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "menu" | "group" | "listbox" | "grid" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
|
|
220
216
|
strategy: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "fixed" | "absolute", unknown, "absolute", boolean>;
|
|
217
|
+
bg: StringConstructor;
|
|
221
218
|
arrowOffset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
222
219
|
triggerKeys: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
|
|
223
220
|
virtualRef: {
|
|
@@ -234,8 +231,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
234
231
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
235
232
|
__epPropKey: true;
|
|
236
233
|
};
|
|
237
|
-
rawContent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
238
234
|
ariaLabel: StringConstructor;
|
|
235
|
+
className: StringConstructor;
|
|
239
236
|
pure: BooleanConstructor;
|
|
240
237
|
focusOnShow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
241
238
|
trapping: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -256,7 +253,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
256
253
|
boundariesPadding: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
257
254
|
fallbackPlacements: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | ((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]))[], unknown, unknown, undefined, boolean>;
|
|
258
255
|
gpuAcceleration: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
259
|
-
|
|
256
|
+
arrowBg: StringConstructor;
|
|
257
|
+
isPopover: BooleanConstructor;
|
|
260
258
|
}>> & {
|
|
261
259
|
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
262
260
|
onConfirm?: ((_e: MouseEvent) => any) | undefined;
|
|
@@ -282,7 +280,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
282
280
|
virtualTriggering: boolean;
|
|
283
281
|
open: boolean;
|
|
284
282
|
content: string;
|
|
285
|
-
rawContent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
286
283
|
persistent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
287
284
|
visible: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => boolean) | (() => boolean | null) | ((new (...args: any[]) => boolean) | (() => boolean | null))[], unknown, unknown>;
|
|
288
285
|
transition: string;
|
|
@@ -88,13 +88,11 @@ export declare const popconfirmProps: {
|
|
|
88
88
|
autoClose: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
89
89
|
title: StringConstructor;
|
|
90
90
|
width: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
|
|
91
|
-
popperClass: StringConstructor;
|
|
92
|
-
bg: StringConstructor;
|
|
93
|
-
arrowBg: StringConstructor;
|
|
94
|
-
isPopover: BooleanConstructor;
|
|
91
|
+
popperClass: StringConstructor; /** 确认按钮类型 */
|
|
95
92
|
id: StringConstructor;
|
|
96
93
|
role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "menu" | "group" | "listbox" | "grid" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
|
|
97
94
|
strategy: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "fixed" | "absolute", unknown, "absolute", boolean>;
|
|
95
|
+
bg: StringConstructor;
|
|
98
96
|
arrowOffset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
99
97
|
triggerKeys: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
|
|
100
98
|
virtualRef: {
|
|
@@ -111,8 +109,8 @@ export declare const popconfirmProps: {
|
|
|
111
109
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
112
110
|
__epPropKey: true;
|
|
113
111
|
};
|
|
114
|
-
rawContent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
115
112
|
ariaLabel: StringConstructor;
|
|
113
|
+
className: StringConstructor;
|
|
116
114
|
pure: BooleanConstructor;
|
|
117
115
|
focusOnShow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
118
116
|
trapping: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -133,7 +131,8 @@ export declare const popconfirmProps: {
|
|
|
133
131
|
boundariesPadding: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
134
132
|
fallbackPlacements: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | ((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]))[], unknown, unknown, undefined, boolean>;
|
|
135
133
|
gpuAcceleration: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
136
|
-
|
|
134
|
+
arrowBg: StringConstructor;
|
|
135
|
+
isPopover: BooleanConstructor;
|
|
137
136
|
};
|
|
138
137
|
export type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>;
|
|
139
138
|
/**
|
|
@@ -3,8 +3,8 @@ import { EleTooltipInstance } from '../ele-app/types/components';
|
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
transition: {
|
|
5
5
|
type: StringConstructor;
|
|
6
|
-
default: string;
|
|
7
|
-
};
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
8
|
bodyClass: StringConstructor;
|
|
9
9
|
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
10
10
|
titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
@@ -46,12 +46,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
46
|
title: StringConstructor;
|
|
47
47
|
width: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
|
|
48
48
|
popperClass: StringConstructor;
|
|
49
|
-
bg: StringConstructor;
|
|
50
|
-
arrowBg: StringConstructor;
|
|
51
|
-
isPopover: BooleanConstructor;
|
|
52
49
|
id: StringConstructor;
|
|
53
50
|
role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "menu" | "group" | "listbox" | "grid" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
|
|
54
51
|
strategy: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "fixed" | "absolute", unknown, "absolute", boolean>;
|
|
52
|
+
bg: StringConstructor;
|
|
55
53
|
arrowOffset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
56
54
|
triggerKeys: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
|
|
57
55
|
virtualRef: {
|
|
@@ -68,8 +66,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
66
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
69
67
|
__epPropKey: true;
|
|
70
68
|
};
|
|
71
|
-
rawContent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
72
69
|
ariaLabel: StringConstructor;
|
|
70
|
+
className: StringConstructor;
|
|
73
71
|
pure: BooleanConstructor;
|
|
74
72
|
focusOnShow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
75
73
|
trapping: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -90,7 +88,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
88
|
boundariesPadding: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
91
89
|
fallbackPlacements: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | ((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]))[], unknown, unknown, undefined, boolean>;
|
|
92
90
|
gpuAcceleration: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
93
|
-
|
|
91
|
+
arrowBg: StringConstructor;
|
|
92
|
+
isPopover: BooleanConstructor;
|
|
94
93
|
}, {
|
|
95
94
|
tooltipRef: import("vue").Ref<EleTooltipInstance>;
|
|
96
95
|
tooltipProps: import("vue").ComputedRef<Partial<TooltipProps>>;
|
|
@@ -109,8 +108,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
109
108
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
110
109
|
transition: {
|
|
111
110
|
type: StringConstructor;
|
|
112
|
-
default: string;
|
|
113
|
-
};
|
|
111
|
+
default: string;
|
|
112
|
+
};
|
|
114
113
|
bodyClass: StringConstructor;
|
|
115
114
|
bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
116
115
|
titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
@@ -152,12 +151,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
152
151
|
title: StringConstructor;
|
|
153
152
|
width: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
|
|
154
153
|
popperClass: StringConstructor;
|
|
155
|
-
bg: StringConstructor;
|
|
156
|
-
arrowBg: StringConstructor;
|
|
157
|
-
isPopover: BooleanConstructor;
|
|
158
154
|
id: StringConstructor;
|
|
159
155
|
role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "menu" | "group" | "listbox" | "grid" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
|
|
160
156
|
strategy: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "fixed" | "absolute", unknown, "absolute", boolean>;
|
|
157
|
+
bg: StringConstructor;
|
|
161
158
|
arrowOffset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
162
159
|
triggerKeys: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
|
|
163
160
|
virtualRef: {
|
|
@@ -174,8 +171,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
174
171
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
175
172
|
__epPropKey: true;
|
|
176
173
|
};
|
|
177
|
-
rawContent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
178
174
|
ariaLabel: StringConstructor;
|
|
175
|
+
className: StringConstructor;
|
|
179
176
|
pure: BooleanConstructor;
|
|
180
177
|
focusOnShow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
181
178
|
trapping: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -196,7 +193,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
196
193
|
boundariesPadding: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
197
194
|
fallbackPlacements: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | ((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]))[], unknown, unknown, undefined, boolean>;
|
|
198
195
|
gpuAcceleration: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
199
|
-
|
|
196
|
+
arrowBg: StringConstructor;
|
|
197
|
+
isPopover: BooleanConstructor;
|
|
200
198
|
}>> & {
|
|
201
199
|
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
202
200
|
"onBefore-enter"?: (() => any) | undefined;
|
|
@@ -220,7 +218,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
220
218
|
virtualTriggering: boolean;
|
|
221
219
|
open: boolean;
|
|
222
220
|
content: string;
|
|
223
|
-
rawContent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
224
221
|
persistent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
225
222
|
visible: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => boolean) | (() => boolean | null) | ((new (...args: any[]) => boolean) | (() => boolean | null))[], unknown, unknown>;
|
|
226
223
|
transition: string;
|
|
@@ -52,12 +52,10 @@ export declare const popoverProps: {
|
|
|
52
52
|
title: StringConstructor;
|
|
53
53
|
width: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
|
|
54
54
|
popperClass: StringConstructor;
|
|
55
|
-
bg: StringConstructor;
|
|
56
|
-
arrowBg: StringConstructor;
|
|
57
|
-
isPopover: BooleanConstructor;
|
|
58
55
|
id: StringConstructor;
|
|
59
56
|
role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "menu" | "group" | "listbox" | "grid" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
|
|
60
57
|
strategy: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "fixed" | "absolute", unknown, "absolute", boolean>;
|
|
58
|
+
bg: StringConstructor;
|
|
61
59
|
arrowOffset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
62
60
|
triggerKeys: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
|
|
63
61
|
virtualRef: {
|
|
@@ -74,8 +72,8 @@ export declare const popoverProps: {
|
|
|
74
72
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
75
73
|
__epPropKey: true;
|
|
76
74
|
};
|
|
77
|
-
rawContent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
78
75
|
ariaLabel: StringConstructor;
|
|
76
|
+
className: StringConstructor;
|
|
79
77
|
pure: BooleanConstructor;
|
|
80
78
|
focusOnShow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
81
79
|
trapping: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -96,7 +94,8 @@ export declare const popoverProps: {
|
|
|
96
94
|
boundariesPadding: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
97
95
|
fallbackPlacements: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | ((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]))[], unknown, unknown, undefined, boolean>;
|
|
98
96
|
gpuAcceleration: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
99
|
-
|
|
97
|
+
arrowBg: StringConstructor;
|
|
98
|
+
isPopover: BooleanConstructor;
|
|
100
99
|
};
|
|
101
100
|
export type PopoverProps = ExtractPropTypes<typeof popoverProps>;
|
|
102
101
|
/**
|
package/es/ele-popover/props.js
CHANGED
|
@@ -3,7 +3,7 @@ import { omit } from "../utils/core";
|
|
|
3
3
|
import { tooltipProps } from "../ele-tooltip/props";
|
|
4
4
|
const normalizeProps = omit(popoverProps$1, ["onUpdate:visible"]);
|
|
5
5
|
const popoverProps = {
|
|
6
|
-
...tooltipProps,
|
|
6
|
+
...omit(tooltipProps, ["rawContent"]),
|
|
7
7
|
popperClass: String,
|
|
8
8
|
...normalizeProps,
|
|
9
9
|
transition: {
|
|
@@ -5,15 +5,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5
5
|
footerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
6
6
|
title: StringConstructor;
|
|
7
7
|
margin: (StringConstructor | NumberConstructor)[];
|
|
8
|
-
direction: import("vue").PropType<
|
|
8
|
+
direction: import("vue").PropType<string | null>;
|
|
9
9
|
orientation: import("vue").PropType<import("./types").PrintOrientation | null>;
|
|
10
10
|
target: import("vue").PropType<import("./types").PrintTarget | null>;
|
|
11
11
|
static: BooleanConstructor;
|
|
12
|
+
options: ObjectConstructor; /** 是否显示 */
|
|
12
13
|
}, {
|
|
13
14
|
container: import("vue").ShallowRef<Element>;
|
|
14
15
|
visible: import("vue").Ref<boolean>;
|
|
15
16
|
isStatic: import("vue").ComputedRef<boolean>;
|
|
16
|
-
print: () => void;
|
|
17
|
+
print: (options?: any) => void;
|
|
17
18
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
19
|
'update:modelValue': (_value: boolean) => boolean;
|
|
19
20
|
done: () => boolean;
|
|
@@ -24,10 +25,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
25
|
footerStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
|
|
25
26
|
title: StringConstructor;
|
|
26
27
|
margin: (StringConstructor | NumberConstructor)[];
|
|
27
|
-
direction: import("vue").PropType<
|
|
28
|
+
direction: import("vue").PropType<string | null>;
|
|
28
29
|
orientation: import("vue").PropType<import("./types").PrintOrientation | null>;
|
|
29
30
|
target: import("vue").PropType<import("./types").PrintTarget | null>;
|
|
30
31
|
static: BooleanConstructor;
|
|
32
|
+
options: ObjectConstructor; /** 是否显示 */
|
|
31
33
|
}>> & {
|
|
32
34
|
"onUpdate:modelValue"?: ((_value: boolean) => any) | undefined;
|
|
33
35
|
onDone?: (() => any) | undefined;
|
package/es/ele-printer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, ref, computed, watch, nextTick, openBlock, createBlock, Teleport, createElementVNode, normalizeClass, createElementBlock, normalizeStyle, renderSlot, createCommentVNode } from "vue";
|
|
2
2
|
import { useLicense } from "../ele-config-provider/receiver";
|
|
3
|
-
import { usePrinter, getPrintContainer, doPrintOnFrame, doPrint } from "./util";
|
|
3
|
+
import { usePrinter, getPrintContainer, mergeOptions, doPrintOnFrame, doPrint } from "./util";
|
|
4
4
|
import { printerProps, printerEmits } from "./props";
|
|
5
5
|
const _sfc_main = defineComponent({
|
|
6
6
|
name: "ElePrinter",
|
|
@@ -17,7 +17,7 @@ const _sfc_main = defineComponent({
|
|
|
17
17
|
const isStatic = computed(() => {
|
|
18
18
|
return props.static;
|
|
19
19
|
});
|
|
20
|
-
const print = () => {
|
|
20
|
+
const print = (options) => {
|
|
21
21
|
if (!authenticated.value) {
|
|
22
22
|
updateModelValue(false);
|
|
23
23
|
return;
|
|
@@ -29,7 +29,8 @@ const _sfc_main = defineComponent({
|
|
|
29
29
|
title: props.title,
|
|
30
30
|
margin: props.margin,
|
|
31
31
|
direction: props.direction,
|
|
32
|
-
orientation: props.orientation
|
|
32
|
+
orientation: props.orientation,
|
|
33
|
+
options: mergeOptions(props.options, options)
|
|
33
34
|
};
|
|
34
35
|
if (props.target === "_iframe") {
|
|
35
36
|
doPrintOnFrame(option);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PrintOrientation, PrintTarget } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* 属性
|
|
5
5
|
*/
|
|
@@ -17,13 +17,15 @@ export declare const printerProps: {
|
|
|
17
17
|
/** 页间距 */
|
|
18
18
|
margin: (StringConstructor | NumberConstructor)[];
|
|
19
19
|
/** 纸张方向 */
|
|
20
|
-
direction: PropType<
|
|
20
|
+
direction: PropType<string | null>;
|
|
21
21
|
/** 纸张旋转 */
|
|
22
22
|
orientation: PropType<PrintOrientation | null>;
|
|
23
23
|
/** 打印位置 */
|
|
24
24
|
target: PropType<PrintTarget | null>;
|
|
25
25
|
/** 是否显示在文档流中 */
|
|
26
26
|
static: BooleanConstructor;
|
|
27
|
+
/** 打印方法参数 */
|
|
28
|
+
options: ObjectConstructor;
|
|
27
29
|
};
|
|
28
30
|
export type PrinterProps = ExtractPropTypes<typeof printerProps>;
|
|
29
31
|
/**
|
package/es/ele-printer/props.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 纸张方向
|
|
3
3
|
*/
|
|
4
|
-
export type PrintDirection = 'landscape' | 'portrait';
|
|
4
|
+
export type PrintDirection = 'landscape' | 'portrait' | string;
|
|
5
5
|
/**
|
|
6
6
|
* 纸张旋转
|
|
7
7
|
*/
|
|
@@ -24,6 +24,8 @@ export interface PrintOption {
|
|
|
24
24
|
direction?: string | null;
|
|
25
25
|
/** 纸张旋转 */
|
|
26
26
|
orientation?: string | null;
|
|
27
|
+
/** 打印方法参数 */
|
|
28
|
+
options?: any;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* pdf 打印参数
|
|
@@ -37,4 +39,6 @@ export interface PrintPdfOption {
|
|
|
37
39
|
done?: () => void;
|
|
38
40
|
/** 错误回调 */
|
|
39
41
|
error?: (status: number, result: string) => void;
|
|
42
|
+
/** 打印方法参数 */
|
|
43
|
+
options?: any;
|
|
40
44
|
}
|
package/es/ele-printer/util.d.ts
CHANGED
|
@@ -26,6 +26,12 @@ export declare function removePrintFrame(): void;
|
|
|
26
26
|
* 生成打印设置的样式
|
|
27
27
|
*/
|
|
28
28
|
export declare function getOptionCss(opt: PrintOption): string;
|
|
29
|
+
/**
|
|
30
|
+
* 合并打印方法参数
|
|
31
|
+
* @param options 参数
|
|
32
|
+
* @param userOptions 自定义参数
|
|
33
|
+
*/
|
|
34
|
+
export declare function mergeOptions(options?: any, userOptions?: any): any;
|
|
29
35
|
/**
|
|
30
36
|
* usePrinter
|
|
31
37
|
*/
|
package/es/ele-printer/util.js
CHANGED
|
@@ -26,7 +26,7 @@ function doPrint(option) {
|
|
|
26
26
|
if (option.title != null && option.title !== "") {
|
|
27
27
|
document.title = option.title;
|
|
28
28
|
}
|
|
29
|
-
window.print();
|
|
29
|
+
window.print(option.options);
|
|
30
30
|
$html.classList.remove(printingClass);
|
|
31
31
|
document.body.removeChild(elem);
|
|
32
32
|
if (option.title != null) {
|
|
@@ -53,6 +53,7 @@ function doPrintOnFrame(opt) {
|
|
|
53
53
|
el.setAttribute("value", el.value);
|
|
54
54
|
});
|
|
55
55
|
pDoc.open();
|
|
56
|
+
const printOption = opt.options ? `JSON.parse('${JSON.stringify(opt.options)}')` : "";
|
|
56
57
|
const optHtml = `
|
|
57
58
|
<style type="text/css" media="print">
|
|
58
59
|
${getOptionCss(opt)}
|
|
@@ -66,7 +67,7 @@ function doPrintOnFrame(opt) {
|
|
|
66
67
|
if(${opt.title == null ? 0 : 1}) {
|
|
67
68
|
document.title = '${opt.title}';
|
|
68
69
|
}
|
|
69
|
-
window.print();
|
|
70
|
+
window.print(${printOption});
|
|
70
71
|
window.parent.postMessage('elePrintDone_${opt.printId}', '*');
|
|
71
72
|
};
|
|
72
73
|
<\/script>
|
|
@@ -110,6 +111,12 @@ function getOptionCss(opt) {
|
|
|
110
111
|
css.push("}");
|
|
111
112
|
return css.join(" ");
|
|
112
113
|
}
|
|
114
|
+
function mergeOptions(options, userOptions) {
|
|
115
|
+
if (options == null) {
|
|
116
|
+
return userOptions;
|
|
117
|
+
}
|
|
118
|
+
return Object.assign({}, options, userOptions);
|
|
119
|
+
}
|
|
113
120
|
function usePrinter(done) {
|
|
114
121
|
const printId = uuid(8);
|
|
115
122
|
const onMessage = (e) => {
|
|
@@ -129,7 +136,7 @@ function printPdf(option) {
|
|
|
129
136
|
pFrame.onload = () => {
|
|
130
137
|
if (!!pFrame.getAttribute("src")) {
|
|
131
138
|
pFrame.focus();
|
|
132
|
-
pFrame.contentWindow && pFrame.contentWindow.print();
|
|
139
|
+
pFrame.contentWindow && pFrame.contentWindow.print(option.options);
|
|
133
140
|
option.done && option.done();
|
|
134
141
|
}
|
|
135
142
|
};
|
|
@@ -165,6 +172,7 @@ export {
|
|
|
165
172
|
getOptionCss,
|
|
166
173
|
getPrintContainer,
|
|
167
174
|
getPrintFrame,
|
|
175
|
+
mergeOptions,
|
|
168
176
|
printContainerId,
|
|
169
177
|
printFrameId,
|
|
170
178
|
printPdf,
|