vxe-pc-ui 4.20.34 → 4.20.35
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/all.esm.js +45718 -45038
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +307 -1
- package/dist/style.mini.css +1 -1
- package/es/alert/src/alert.js +117 -114
- package/es/anchor/src/anchor-link.js +110 -107
- package/es/anchor/src/anchor.js +212 -209
- package/es/avatar/src/avatar.js +132 -129
- package/es/backtop/src/backtop.js +267 -264
- package/es/badge/src/badge.js +102 -99
- package/es/breadcrumb/src/breadcrumb-item.js +104 -101
- package/es/breadcrumb/src/breadcrumb.js +70 -67
- package/es/button/src/button-group.js +88 -85
- package/es/calendar/src/calendar.js +1371 -1368
- package/es/card/src/card.js +235 -232
- package/es/carousel/src/carousel-item.js +78 -75
- package/es/carousel/src/carousel.js +392 -389
- package/es/cascader/src/cascader.js +1667 -1664
- package/es/checkbox/src/button.js +198 -195
- package/es/checkbox/src/checkbox.js +181 -178
- package/es/checkbox/src/group.js +210 -207
- package/es/collapse/src/collapse-pane.js +98 -95
- package/es/collapse/src/collapse.js +340 -337
- package/es/color-picker/src/color-picker.js +1116 -1113
- package/es/components.d.ts +1 -0
- package/es/components.js +3 -0
- package/es/context-menu/src/context-menu.js +601 -598
- package/es/countdown/src/countdown.js +224 -221
- package/es/date-panel/src/date-panel.js +1905 -1902
- package/es/date-picker/src/date-picker.js +1537 -1534
- package/es/date-range-picker/src/date-range-picker.js +1412 -1409
- package/es/divider/src/divider.js +80 -77
- package/es/drawer/src/drawer.js +778 -775
- package/es/empty/src/empty.js +100 -97
- package/es/form/src/form-group.js +74 -71
- package/es/form/src/form-item.js +76 -73
- package/es/form/src/form.js +789 -786
- package/es/icon/src/icon.js +59 -56
- package/es/icon/style.css +1 -1
- package/es/icon/style.mini.css +1 -1
- package/es/icon-picker/src/icon-picker.js +719 -716
- package/es/image/src/group.js +130 -127
- package/es/image/src/image.js +243 -240
- package/es/image/src/preview.js +627 -624
- package/es/index.esm.js +2 -0
- package/es/index.js +2 -0
- package/es/input/src/input.js +2700 -2697
- package/es/layout-aside/src/layout-aside.js +138 -135
- package/es/layout-body/src/layout-body.js +145 -142
- package/es/layout-container/src/layout-container.js +71 -68
- package/es/layout-footer/src/layout-footer.js +60 -57
- package/es/layout-header/src/layout-header.js +58 -55
- package/es/link/src/link.js +131 -128
- package/es/list/src/list.js +2174 -2171
- package/es/loading/src/loading.js +141 -138
- package/es/mention/src/mention.js +49 -46
- package/es/menu/src/menu.js +799 -796
- package/es/modal/src/modal.js +1519 -1527
- package/es/notice-bar/src/notice-bar.js +168 -165
- package/es/number-input/src/number-input.js +1094 -1091
- package/es/pager/src/pager.js +767 -764
- package/es/password-input/src/password-input.js +431 -428
- package/es/print/src/page-break.js +63 -60
- package/es/print/src/print.js +303 -300
- package/es/pulldown/src/pulldown.js +403 -400
- package/es/radio/src/button.js +214 -211
- package/es/radio/src/group.js +195 -192
- package/es/radio/src/radio.js +194 -191
- package/es/rate/src/rate.js +164 -161
- package/es/result/src/result.js +116 -113
- package/es/row/src/col.js +133 -130
- package/es/row/src/row.js +111 -108
- package/es/scrollbar/src/scrollbar.js +518 -515
- package/es/segmented/src/segmented.js +240 -237
- package/es/select/src/optgroup.js +44 -41
- package/es/select/src/option.js +39 -36
- package/es/select/src/select.js +1914 -1896
- package/es/slider/src/slider.js +419 -416
- package/es/space/src/space.js +190 -187
- package/es/splitter/src/splitter-panel.js +146 -143
- package/es/splitter/src/splitter.js +917 -914
- package/es/step-item/index.d.ts +76 -0
- package/es/step-item/index.js +17 -0
- package/es/steps/index.d.ts +288 -34
- package/es/steps/src/step-info.d.ts +6 -0
- package/es/steps/src/step-info.js +20 -0
- package/es/steps/src/step-item.d.ts +14 -0
- package/es/steps/src/step-item.js +39 -0
- package/es/steps/src/steps.d.ts +68 -8
- package/es/steps/src/steps.js +299 -47
- package/es/steps/src/util.d.ts +7 -0
- package/es/steps/src/util.js +44 -0
- package/es/steps/style.css +297 -0
- package/es/steps/style.mini.css +1 -0
- package/es/style.css +307 -1
- package/es/style.mini.css +1 -1
- package/es/switch/src/switch.js +228 -225
- package/es/table-select/src/table-select.js +865 -862
- package/es/table-transfer/src/table-transfer.js +61 -58
- package/es/tabs/src/tab-pane.js +102 -99
- package/es/tabs/src/tabs.js +936 -933
- package/es/tag/src/tag.js +163 -160
- package/es/text/src/text.js +232 -229
- package/es/text-ellipsis/src/text-ellipsis.js +252 -249
- package/es/textarea/src/textarea.js +434 -431
- package/es/timeline/src/timeline.js +74 -36
- package/es/timeline/src/util.js +7 -4
- package/es/tip/src/tip.js +117 -114
- package/es/tooltip/src/tooltip.js +552 -549
- package/es/tour/src/tour.js +49 -46
- package/es/transfer/src/transfer.js +95 -92
- package/es/tree/src/tree.js +3379 -3376
- package/es/tree-select/src/tree-select.js +969 -966
- package/es/ui/index.js +8 -2
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +1791 -1788
- package/es/vxe-icon/style.css +1 -1
- package/es/vxe-icon/style.mini.css +1 -1
- package/es/vxe-steps/style.css +297 -0
- package/es/vxe-steps/style.mini.css +1 -0
- package/es/watermark/src/watermark.js +158 -155
- package/lib/alert/src/alert.js +117 -114
- package/lib/anchor/src/anchor-link.js +110 -107
- package/lib/anchor/src/anchor.js +212 -209
- package/lib/avatar/src/avatar.js +132 -129
- package/lib/backtop/src/backtop.js +267 -264
- package/lib/badge/src/badge.js +102 -99
- package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
- package/lib/breadcrumb/src/breadcrumb.js +70 -67
- package/lib/button/src/button-group.js +88 -85
- package/lib/calendar/src/calendar.js +1371 -1368
- package/lib/card/src/card.js +235 -232
- package/lib/carousel/src/carousel-item.js +78 -75
- package/lib/carousel/src/carousel.js +392 -389
- package/lib/cascader/src/cascader.js +1665 -1662
- package/lib/checkbox/src/button.js +198 -195
- package/lib/checkbox/src/checkbox.js +181 -178
- package/lib/checkbox/src/group.js +210 -207
- package/lib/collapse/src/collapse-pane.js +98 -95
- package/lib/collapse/src/collapse.js +340 -337
- package/lib/color-picker/src/color-picker.js +1116 -1113
- package/lib/components.js +3 -0
- package/lib/context-menu/src/context-menu.js +601 -598
- package/lib/countdown/src/countdown.js +224 -221
- package/lib/date-panel/src/date-panel.js +1905 -1902
- package/lib/date-picker/src/date-picker.js +1537 -1534
- package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
- package/lib/divider/src/divider.js +80 -77
- package/lib/drawer/src/drawer.js +778 -775
- package/lib/empty/src/empty.js +100 -97
- package/lib/form/src/form-group.js +74 -71
- package/lib/form/src/form-item.js +76 -73
- package/lib/form/src/form.js +789 -786
- package/lib/icon/src/icon.js +59 -56
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.mini.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +719 -716
- package/lib/image/src/group.js +130 -127
- package/lib/image/src/image.js +243 -240
- package/lib/image/src/preview.js +627 -624
- package/lib/index.common.js +2 -0
- package/lib/index.js +2 -0
- package/lib/index.umd.js +47411 -46732
- package/lib/index.umd.min.js +3 -3
- package/lib/input/src/input.js +2700 -2697
- package/lib/layout-aside/src/layout-aside.js +138 -135
- package/lib/layout-body/src/layout-body.js +145 -142
- package/lib/layout-container/src/layout-container.js +71 -68
- package/lib/layout-footer/src/layout-footer.js +60 -57
- package/lib/layout-header/src/layout-header.js +58 -55
- package/lib/link/src/link.js +131 -128
- package/lib/list/src/list.js +2173 -2170
- package/lib/loading/src/loading.js +141 -138
- package/lib/mention/src/mention.js +49 -46
- package/lib/menu/src/menu.js +799 -796
- package/lib/modal/src/modal.js +1519 -1527
- package/lib/notice-bar/src/notice-bar.js +168 -165
- package/lib/number-input/src/number-input.js +1094 -1091
- package/lib/pager/src/pager.js +767 -764
- package/lib/password-input/src/password-input.js +431 -428
- package/lib/print/src/page-break.js +63 -60
- package/lib/print/src/print.js +303 -300
- package/lib/pulldown/src/pulldown.js +403 -400
- package/lib/radio/src/button.js +214 -211
- package/lib/radio/src/group.js +195 -192
- package/lib/radio/src/radio.js +194 -191
- package/lib/rate/src/rate.js +164 -161
- package/lib/result/src/result.js +116 -113
- package/lib/row/src/col.js +133 -130
- package/lib/row/src/row.js +111 -108
- package/lib/scrollbar/src/scrollbar.js +518 -515
- package/lib/segmented/src/segmented.js +240 -237
- package/lib/select/src/optgroup.js +44 -41
- package/lib/select/src/option.js +39 -36
- package/lib/select/src/select.js +1915 -1897
- package/lib/slider/src/slider.js +419 -416
- package/lib/space/src/space.js +190 -187
- package/lib/splitter/src/splitter-panel.js +146 -143
- package/lib/splitter/src/splitter.js +917 -914
- package/lib/step-item/index.js +47 -0
- package/lib/steps/src/step-info.js +49 -0
- package/lib/steps/src/step-item.js +59 -0
- package/lib/steps/src/steps.js +298 -46
- package/lib/steps/src/util.js +74 -0
- package/lib/steps/style/style.css +297 -0
- package/lib/steps/style/style.mini.css +1 -0
- package/lib/style.css +307 -1
- package/lib/style.mini.css +1 -1
- package/lib/switch/src/switch.js +228 -225
- package/lib/table-select/src/table-select.js +865 -862
- package/lib/table-transfer/src/table-transfer.js +61 -58
- package/lib/tabs/src/tab-pane.js +102 -99
- package/lib/tabs/src/tabs.js +936 -933
- package/lib/tag/src/tag.js +163 -160
- package/lib/text/src/text.js +232 -229
- package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
- package/lib/textarea/src/textarea.js +434 -431
- package/lib/timeline/src/timeline.js +74 -36
- package/lib/timeline/src/util.js +7 -4
- package/lib/tip/src/tip.js +117 -114
- package/lib/tooltip/src/tooltip.js +552 -549
- package/lib/tour/src/tour.js +49 -46
- package/lib/transfer/src/transfer.js +95 -92
- package/lib/tree/src/tree.js +3379 -3376
- package/lib/tree-select/src/tree-select.js +969 -966
- package/lib/ui/index.js +8 -2
- package/lib/ui/src/log.js +1 -1
- package/lib/upload/src/upload.js +1788 -1785
- package/lib/vxe-icon/style/style.css +1 -1
- package/lib/vxe-icon/style/style.mini.css +1 -1
- package/lib/vxe-steps/style/style.css +297 -0
- package/lib/vxe-steps/style/style.mini.css +1 -0
- package/lib/watermark/src/watermark.js +158 -155
- package/package.json +1 -1
- package/packages/alert/src/alert.ts +2 -2
- package/packages/anchor/src/anchor-link.ts +2 -2
- package/packages/anchor/src/anchor.ts +2 -2
- package/packages/avatar/src/avatar.ts +2 -2
- package/packages/backtop/src/backtop.ts +2 -2
- package/packages/badge/src/badge.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb.ts +2 -2
- package/packages/button/src/button-group.ts +2 -2
- package/packages/calendar/src/calendar.ts +2 -2
- package/packages/card/src/card.ts +2 -2
- package/packages/carousel/src/carousel-item.ts +2 -2
- package/packages/carousel/src/carousel.ts +2 -2
- package/packages/cascader/src/cascader.ts +2 -2
- package/packages/checkbox/src/button.ts +3 -15
- package/packages/checkbox/src/checkbox.ts +2 -2
- package/packages/checkbox/src/group.ts +2 -2
- package/packages/collapse/src/collapse-pane.ts +2 -2
- package/packages/collapse/src/collapse.ts +2 -2
- package/packages/color-picker/src/color-picker.ts +2 -2
- package/packages/components.ts +3 -0
- package/packages/context-menu/src/context-menu.ts +3 -16
- package/packages/countdown/src/countdown.ts +2 -2
- package/packages/date-panel/src/date-panel.ts +2 -2
- package/packages/date-picker/src/date-picker.ts +2 -2
- package/packages/date-range-picker/src/date-range-picker.ts +2 -2
- package/packages/divider/src/divider.ts +2 -2
- package/packages/drawer/src/drawer.ts +2 -2
- package/packages/empty/src/empty.ts +2 -2
- package/packages/form/src/form-group.ts +2 -2
- package/packages/form/src/form-item.ts +2 -2
- package/packages/form/src/form.ts +2 -2
- package/packages/icon/src/icon.ts +2 -2
- package/packages/icon-picker/src/icon-picker.ts +2 -2
- package/packages/image/src/group.ts +2 -2
- package/packages/image/src/image.ts +2 -2
- package/packages/image/src/preview.ts +3 -16
- package/packages/index.ts +2 -2
- package/packages/input/src/input.ts +2 -2
- package/packages/layout-aside/src/layout-aside.ts +2 -2
- package/packages/layout-body/src/layout-body.ts +2 -2
- package/packages/layout-container/src/layout-container.ts +3 -14
- package/packages/layout-footer/src/layout-footer.ts +2 -2
- package/packages/layout-header/src/layout-header.ts +2 -2
- package/packages/link/src/link.ts +2 -2
- package/packages/list/src/list.ts +2 -2
- package/packages/loading/src/loading.ts +2 -2
- package/packages/mention/src/mention.ts +2 -2
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +5 -20
- package/packages/notice-bar/src/notice-bar.ts +2 -2
- package/packages/number-input/src/number-input.ts +3 -17
- package/packages/pager/src/pager.ts +2 -2
- package/packages/password-input/src/password-input.ts +2 -2
- package/packages/print/src/page-break.ts +2 -2
- package/packages/print/src/print.ts +2 -2
- package/packages/pulldown/src/pulldown.ts +2 -2
- package/packages/radio/src/button.ts +3 -16
- package/packages/radio/src/group.ts +3 -17
- package/packages/radio/src/radio.ts +2 -2
- package/packages/rate/src/rate.ts +2 -2
- package/packages/result/src/result.ts +2 -2
- package/packages/row/src/col.ts +2 -2
- package/packages/row/src/row.ts +2 -2
- package/packages/scrollbar/src/scrollbar.ts +3 -4
- package/packages/segmented/src/segmented.ts +2 -2
- package/packages/select/src/optgroup.ts +2 -2
- package/packages/select/src/option.ts +2 -2
- package/packages/select/src/select.ts +33 -19
- package/packages/slider/src/slider.ts +2 -2
- package/packages/space/src/space.ts +2 -2
- package/packages/splitter/src/splitter-panel.ts +2 -2
- package/packages/splitter/src/splitter.ts +2 -2
- package/packages/step-item/index.ts +16 -0
- package/packages/steps/src/step-info.ts +18 -0
- package/packages/steps/src/step-item.ts +41 -0
- package/packages/steps/src/steps.ts +273 -13
- package/packages/steps/src/util.ts +44 -0
- package/packages/switch/src/switch.ts +2 -2
- package/packages/table-select/src/table-select.ts +2 -2
- package/packages/table-transfer/src/table-transfer.ts +3 -15
- package/packages/tabs/src/tab-pane.ts +2 -2
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tag/src/tag.ts +2 -2
- package/packages/text/src/text.ts +2 -2
- package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
- package/packages/textarea/src/textarea.ts +2 -2
- package/packages/timeline/src/timeline-info.ts +17 -17
- package/packages/timeline/src/timeline.ts +93 -49
- package/packages/timeline/src/util.ts +44 -41
- package/packages/tip/src/tip.ts +2 -2
- package/packages/tooltip/src/tooltip.ts +2 -2
- package/packages/tour/src/tour.ts +2 -2
- package/packages/transfer/src/transfer.ts +2 -2
- package/packages/tree/src/tree.ts +2 -2
- package/packages/tree-select/src/tree-select.ts +2 -2
- package/packages/ui/index.ts +8 -1
- package/packages/upload/src/upload.ts +2 -2
- package/packages/watermark/src/watermark.ts +2 -2
- package/styles/all.scss +1 -0
- package/styles/components/step-item.scss +0 -0
- package/styles/components/steps.scss +354 -0
- package/styles/theme/base.scss +9 -0
- package/types/all.d.ts +3 -0
- package/types/components/gantt.d.ts +1 -3
- package/types/components/select.d.ts +1 -13
- package/types/components/step-item.d.ts +72 -0
- package/types/components/steps.d.ts +67 -8
- package/types/components/table.d.ts +7 -66
- package/types/handles/form-design.d.ts +1 -4
- package/types/ui/global-config.d.ts +2 -0
- package/types/ui/global-icon.d.ts +7 -0
- /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
package/es/print/src/print.js
CHANGED
|
@@ -5,321 +5,324 @@ import { VxeUI } from "@vxe-ui/core";
|
|
|
5
5
|
import { printHtml, trimHtml } from "./util";
|
|
6
6
|
import { getSlotVNs } from "../../ui/src/vn";
|
|
7
7
|
const { getConfig, createEvent, renderEmptyElement } = VxeUI;
|
|
8
|
-
var print_default =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
var print_default = (
|
|
9
|
+
/* define-vxe-component start */
|
|
10
|
+
defineVxeComponent({
|
|
11
|
+
name: "VxePrint",
|
|
12
|
+
props: {
|
|
13
|
+
align: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: () => getConfig().print.align
|
|
16
|
+
},
|
|
17
|
+
title: String,
|
|
18
|
+
headerAlign: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: () => getConfig().print.headerAlign
|
|
21
|
+
},
|
|
22
|
+
footerAlign: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: () => getConfig().print.footerAlign
|
|
25
|
+
},
|
|
26
|
+
showPageNumber: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: () => getConfig().print.showPageNumber
|
|
29
|
+
},
|
|
30
|
+
customLayout: Boolean,
|
|
31
|
+
pageBreaks: Array,
|
|
32
|
+
content: String,
|
|
33
|
+
html: String,
|
|
34
|
+
headerHtml: String,
|
|
35
|
+
footerHtml: String,
|
|
36
|
+
leftHtml: String,
|
|
37
|
+
rightHtml: String,
|
|
38
|
+
showAllPageTitle: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: () => getConfig().print.showAllPageTitle
|
|
41
|
+
},
|
|
42
|
+
pageStyle: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: () => getConfig().print.pageStyle
|
|
45
|
+
},
|
|
46
|
+
customStyle: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: () => getConfig().print.customStyle
|
|
49
|
+
},
|
|
50
|
+
styleUrls: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => getConfig().print.styleUrls
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* 请使用 beforePrintMethod
|
|
56
|
+
* @deprecated
|
|
57
|
+
*/
|
|
58
|
+
beforeMethod: Function,
|
|
59
|
+
beforePrintMethod: Function,
|
|
60
|
+
printMethod: Function,
|
|
61
|
+
afterPrintMethod: Function
|
|
14
62
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
default: () => getConfig().print.customStyle
|
|
47
|
-
},
|
|
48
|
-
styleUrls: {
|
|
49
|
-
type: Array,
|
|
50
|
-
default: () => getConfig().print.styleUrls
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* 请使用 beforePrintMethod
|
|
54
|
-
* @deprecated
|
|
55
|
-
*/
|
|
56
|
-
beforeMethod: Function,
|
|
57
|
-
beforePrintMethod: Function,
|
|
58
|
-
printMethod: Function,
|
|
59
|
-
afterPrintMethod: Function
|
|
60
|
-
},
|
|
61
|
-
emits: [],
|
|
62
|
-
setup(props, context) {
|
|
63
|
-
const { slots, emit } = context;
|
|
64
|
-
const xID = XEUtils.uniqueId();
|
|
65
|
-
const refElem = ref();
|
|
66
|
-
const reactData = reactive({
|
|
67
|
-
staticPageBreaks: []
|
|
68
|
-
});
|
|
69
|
-
const refMaps = {
|
|
70
|
-
refElem
|
|
71
|
-
};
|
|
72
|
-
const computeMaps = {};
|
|
73
|
-
const $xePrint = {
|
|
74
|
-
xID,
|
|
75
|
-
props,
|
|
76
|
-
context,
|
|
77
|
-
reactData,
|
|
78
|
-
getRefMaps: () => refMaps,
|
|
79
|
-
getComputeMaps: () => computeMaps
|
|
80
|
-
};
|
|
81
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
82
|
-
emit(type, createEvent(evnt, { $print: $xePrint }, params));
|
|
83
|
-
};
|
|
84
|
-
const printMethods = {
|
|
85
|
-
dispatchEvent,
|
|
86
|
-
print() {
|
|
87
|
-
const { align, title, headerAlign, footerAlign, showPageNumber, customLayout, pageBreaks, content, headerHtml, footerHtml, leftHtml, rightHtml, showAllPageTitle, pageStyle, customStyle, styleUrls, beforeMethod, beforePrintMethod, printMethod, afterPrintMethod } = props;
|
|
88
|
-
const elem = refElem.value;
|
|
89
|
-
return printHtml(
|
|
90
|
-
Object.assign(
|
|
91
|
-
{},
|
|
92
|
-
{
|
|
93
|
-
align,
|
|
94
|
-
title,
|
|
95
|
-
headerAlign,
|
|
96
|
-
footerAlign,
|
|
97
|
-
showPageNumber,
|
|
98
|
-
customLayout,
|
|
99
|
-
pageBreaks,
|
|
100
|
-
content,
|
|
101
|
-
headerHtml,
|
|
102
|
-
footerHtml,
|
|
103
|
-
leftHtml,
|
|
104
|
-
rightHtml,
|
|
105
|
-
showAllPageTitle,
|
|
106
|
-
pageStyle,
|
|
107
|
-
customStyle,
|
|
108
|
-
styleUrls,
|
|
109
|
-
beforeMethod,
|
|
110
|
-
beforePrintMethod,
|
|
111
|
-
printMethod,
|
|
112
|
-
afterPrintMethod
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
_pageBreaks: !!reactData.staticPageBreaks.length,
|
|
116
|
-
html: trimHtml(elem ? elem.outerHTML : "") || props.html || props.content || ""
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const printPrivateMethods = {};
|
|
123
|
-
Object.assign($xePrint, printMethods, printPrivateMethods);
|
|
124
|
-
const renderPageConfigLayouts = () => {
|
|
125
|
-
const { title, showPageNumber, showAllPageTitle, align, headerAlign, footerAlign } = props;
|
|
126
|
-
const pageBreaks = props.pageBreaks || [];
|
|
127
|
-
const pageCount = pageBreaks.length;
|
|
128
|
-
return pageBreaks.map((item, index) => {
|
|
129
|
-
const bodyHtml = item.bodyHtml;
|
|
130
|
-
const headerHtml = item.headerHtml || props.headerHtml;
|
|
131
|
-
const footerHtml = item.footerHtml || props.footerHtml;
|
|
132
|
-
const leftHtml = item.leftHtml || props.leftHtml;
|
|
133
|
-
const rightHtml = item.rightHtml || props.rightHtml;
|
|
134
|
-
const currentPage = index + 1;
|
|
135
|
-
const params = {
|
|
136
|
-
currentPage,
|
|
137
|
-
pageCount
|
|
138
|
-
};
|
|
139
|
-
return h(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
class: ["vxe-print-page-break", align ? `align--${align}` : ""]
|
|
143
|
-
},
|
|
144
|
-
[
|
|
145
|
-
h(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
class: ["vxe-print-page-break--header", headerAlign ? `align--${headerAlign}` : ""]
|
|
149
|
-
},
|
|
150
|
-
headerHtml ? `${XEUtils.isFunction(headerHtml) ? headerHtml(params) : headerHtml || ""}` : [
|
|
151
|
-
title && (showAllPageTitle || !index) ? h(
|
|
152
|
-
"div",
|
|
153
|
-
{
|
|
154
|
-
class: "vxe-print-page-break--header-title"
|
|
155
|
-
},
|
|
156
|
-
`${title || ""}`
|
|
157
|
-
) : renderEmptyElement($xePrint)
|
|
158
|
-
]
|
|
159
|
-
),
|
|
160
|
-
h(
|
|
161
|
-
"div",
|
|
63
|
+
emits: [],
|
|
64
|
+
setup(props, context) {
|
|
65
|
+
const { slots, emit } = context;
|
|
66
|
+
const xID = XEUtils.uniqueId();
|
|
67
|
+
const refElem = ref();
|
|
68
|
+
const reactData = reactive({
|
|
69
|
+
staticPageBreaks: []
|
|
70
|
+
});
|
|
71
|
+
const refMaps = {
|
|
72
|
+
refElem
|
|
73
|
+
};
|
|
74
|
+
const computeMaps = {};
|
|
75
|
+
const $xePrint = {
|
|
76
|
+
xID,
|
|
77
|
+
props,
|
|
78
|
+
context,
|
|
79
|
+
reactData,
|
|
80
|
+
getRefMaps: () => refMaps,
|
|
81
|
+
getComputeMaps: () => computeMaps
|
|
82
|
+
};
|
|
83
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
84
|
+
emit(type, createEvent(evnt, { $print: $xePrint }, params));
|
|
85
|
+
};
|
|
86
|
+
const printMethods = {
|
|
87
|
+
dispatchEvent,
|
|
88
|
+
print() {
|
|
89
|
+
const { align, title, headerAlign, footerAlign, showPageNumber, customLayout, pageBreaks, content, headerHtml, footerHtml, leftHtml, rightHtml, showAllPageTitle, pageStyle, customStyle, styleUrls, beforeMethod, beforePrintMethod, printMethod, afterPrintMethod } = props;
|
|
90
|
+
const elem = refElem.value;
|
|
91
|
+
return printHtml(
|
|
92
|
+
Object.assign(
|
|
93
|
+
{},
|
|
162
94
|
{
|
|
163
|
-
|
|
95
|
+
align,
|
|
96
|
+
title,
|
|
97
|
+
headerAlign,
|
|
98
|
+
footerAlign,
|
|
99
|
+
showPageNumber,
|
|
100
|
+
customLayout,
|
|
101
|
+
pageBreaks,
|
|
102
|
+
content,
|
|
103
|
+
headerHtml,
|
|
104
|
+
footerHtml,
|
|
105
|
+
leftHtml,
|
|
106
|
+
rightHtml,
|
|
107
|
+
showAllPageTitle,
|
|
108
|
+
pageStyle,
|
|
109
|
+
customStyle,
|
|
110
|
+
styleUrls,
|
|
111
|
+
beforeMethod,
|
|
112
|
+
beforePrintMethod,
|
|
113
|
+
printMethod,
|
|
114
|
+
afterPrintMethod
|
|
164
115
|
},
|
|
165
|
-
[
|
|
166
|
-
h(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
class: "vxe-print-page-break--left"
|
|
170
|
-
},
|
|
171
|
-
`${XEUtils.isFunction(leftHtml) ? leftHtml(params) : leftHtml || ""}`
|
|
172
|
-
),
|
|
173
|
-
h(
|
|
174
|
-
"div",
|
|
175
|
-
{
|
|
176
|
-
class: "vxe-print-page-break--content"
|
|
177
|
-
},
|
|
178
|
-
`${XEUtils.isFunction(bodyHtml) ? bodyHtml(params) : bodyHtml || ""}`
|
|
179
|
-
),
|
|
180
|
-
h(
|
|
181
|
-
"div",
|
|
182
|
-
{
|
|
183
|
-
class: "vxe-print-page-break--right"
|
|
184
|
-
},
|
|
185
|
-
`${XEUtils.isFunction(rightHtml) ? rightHtml(params) : rightHtml || ""}`
|
|
186
|
-
)
|
|
187
|
-
]
|
|
188
|
-
),
|
|
189
|
-
h(
|
|
190
|
-
"div",
|
|
191
116
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
showPageNumber ? h(
|
|
196
|
-
"div",
|
|
197
|
-
{
|
|
198
|
-
class: "vxe-print-page-break--footer-page-number"
|
|
199
|
-
},
|
|
200
|
-
`${currentPage}/${pageCount}`
|
|
201
|
-
) : renderEmptyElement($xePrint)
|
|
202
|
-
]
|
|
117
|
+
_pageBreaks: !!reactData.staticPageBreaks.length,
|
|
118
|
+
html: trimHtml(elem ? elem.outerHTML : "") || props.html || props.content || ""
|
|
119
|
+
}
|
|
203
120
|
)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const printPrivateMethods = {};
|
|
125
|
+
Object.assign($xePrint, printMethods, printPrivateMethods);
|
|
126
|
+
const renderPageConfigLayouts = () => {
|
|
127
|
+
const { title, showPageNumber, showAllPageTitle, align, headerAlign, footerAlign } = props;
|
|
128
|
+
const pageBreaks = props.pageBreaks || [];
|
|
129
|
+
const pageCount = pageBreaks.length;
|
|
130
|
+
return pageBreaks.map((item, index) => {
|
|
131
|
+
const bodyHtml = item.bodyHtml;
|
|
132
|
+
const headerHtml = item.headerHtml || props.headerHtml;
|
|
133
|
+
const footerHtml = item.footerHtml || props.footerHtml;
|
|
134
|
+
const leftHtml = item.leftHtml || props.leftHtml;
|
|
135
|
+
const rightHtml = item.rightHtml || props.rightHtml;
|
|
136
|
+
const currentPage = index + 1;
|
|
137
|
+
const params = {
|
|
138
|
+
currentPage,
|
|
139
|
+
pageCount
|
|
140
|
+
};
|
|
141
|
+
return h(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
class: ["vxe-print-page-break", align ? `align--${align}` : ""]
|
|
145
|
+
},
|
|
146
|
+
[
|
|
147
|
+
h(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
class: ["vxe-print-page-break--header", headerAlign ? `align--${headerAlign}` : ""]
|
|
151
|
+
},
|
|
152
|
+
headerHtml ? `${XEUtils.isFunction(headerHtml) ? headerHtml(params) : headerHtml || ""}` : [
|
|
153
|
+
title && (showAllPageTitle || !index) ? h(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
class: "vxe-print-page-break--header-title"
|
|
157
|
+
},
|
|
158
|
+
`${title || ""}`
|
|
159
|
+
) : renderEmptyElement($xePrint)
|
|
160
|
+
]
|
|
161
|
+
),
|
|
162
|
+
h(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
class: "vxe-print-page-break--body"
|
|
166
|
+
},
|
|
167
|
+
[
|
|
168
|
+
h(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
class: "vxe-print-page-break--left"
|
|
172
|
+
},
|
|
173
|
+
`${XEUtils.isFunction(leftHtml) ? leftHtml(params) : leftHtml || ""}`
|
|
174
|
+
),
|
|
175
|
+
h(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
class: "vxe-print-page-break--content"
|
|
179
|
+
},
|
|
180
|
+
`${XEUtils.isFunction(bodyHtml) ? bodyHtml(params) : bodyHtml || ""}`
|
|
181
|
+
),
|
|
182
|
+
h(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
class: "vxe-print-page-break--right"
|
|
186
|
+
},
|
|
187
|
+
`${XEUtils.isFunction(rightHtml) ? rightHtml(params) : rightHtml || ""}`
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
),
|
|
191
|
+
h(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
class: ["vxe-print-page-break--footer", footerAlign ? `align--${footerAlign}` : ""]
|
|
195
|
+
},
|
|
196
|
+
footerHtml ? `${XEUtils.isFunction(footerHtml) ? footerHtml(params) : footerHtml || ""}` : [
|
|
197
|
+
showPageNumber ? h(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
class: "vxe-print-page-break--footer-page-number"
|
|
201
|
+
},
|
|
202
|
+
`${currentPage}/${pageCount}`
|
|
203
|
+
) : renderEmptyElement($xePrint)
|
|
204
|
+
]
|
|
205
|
+
)
|
|
206
|
+
]
|
|
207
|
+
);
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
const renderPageStaticLayouts = () => {
|
|
211
|
+
const { title, showPageNumber, showAllPageTitle, align, headerAlign, footerAlign } = props;
|
|
212
|
+
const { staticPageBreaks } = reactData;
|
|
213
|
+
const pageCount = staticPageBreaks.length;
|
|
214
|
+
return staticPageBreaks.map((item, index) => {
|
|
215
|
+
const itemSlots = item.slots || {};
|
|
216
|
+
const currentPage = index + 1;
|
|
217
|
+
const defaultSlot = itemSlots.default;
|
|
218
|
+
const headerSlot = itemSlots.header || slots.header;
|
|
219
|
+
const footerSlot = itemSlots.footer || slots.footer;
|
|
220
|
+
const leftSlot = itemSlots.left || slots.left;
|
|
221
|
+
const rightSlot = itemSlots.right || slots.right;
|
|
222
|
+
const params = {
|
|
223
|
+
currentPage,
|
|
224
|
+
pageCount
|
|
225
|
+
};
|
|
226
|
+
return h(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
class: ["vxe-print-page-break", align ? `align--${align}` : ""]
|
|
230
|
+
},
|
|
231
|
+
[
|
|
232
|
+
h(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
class: ["vxe-print-page-break--header", headerAlign ? `align--${headerAlign}` : ""]
|
|
236
|
+
},
|
|
237
|
+
headerSlot ? getSlotVNs(headerSlot(params)) : [
|
|
238
|
+
title && (showAllPageTitle || !index) ? h(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
class: "vxe-print-page-break--header-title"
|
|
242
|
+
},
|
|
243
|
+
`${title || ""}`
|
|
244
|
+
) : renderEmptyElement($xePrint)
|
|
245
|
+
]
|
|
246
|
+
),
|
|
247
|
+
h(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
class: "vxe-print-page-break--body"
|
|
251
|
+
},
|
|
252
|
+
[
|
|
253
|
+
h(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
class: "vxe-print-page-break--left"
|
|
257
|
+
},
|
|
258
|
+
leftSlot ? getSlotVNs(leftSlot(params)) : []
|
|
259
|
+
),
|
|
260
|
+
h(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
class: "vxe-print-page-break--content"
|
|
264
|
+
},
|
|
265
|
+
defaultSlot ? getSlotVNs(defaultSlot(params)) : []
|
|
266
|
+
),
|
|
267
|
+
h(
|
|
268
|
+
"div",
|
|
269
|
+
{
|
|
270
|
+
class: "vxe-print-page-break--right"
|
|
271
|
+
},
|
|
272
|
+
rightSlot ? getSlotVNs(rightSlot(params)) : []
|
|
273
|
+
)
|
|
274
|
+
]
|
|
275
|
+
),
|
|
276
|
+
h(
|
|
277
|
+
"div",
|
|
278
|
+
{
|
|
279
|
+
class: ["vxe-print-page-break--footer", footerAlign ? `align--${footerAlign}` : ""]
|
|
280
|
+
},
|
|
281
|
+
footerSlot ? getSlotVNs(footerSlot(params)) : [
|
|
282
|
+
showPageNumber ? h(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
class: "vxe-print-page-break--footer-page-number"
|
|
286
|
+
},
|
|
287
|
+
`${currentPage}/${pageCount}`
|
|
288
|
+
) : renderEmptyElement($xePrint)
|
|
289
|
+
]
|
|
290
|
+
)
|
|
291
|
+
]
|
|
292
|
+
);
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
const renderVN = () => {
|
|
296
|
+
const { customLayout } = props;
|
|
297
|
+
const { staticPageBreaks } = reactData;
|
|
298
|
+
const defaultSlot = slots.default;
|
|
224
299
|
return h(
|
|
225
300
|
"div",
|
|
226
301
|
{
|
|
227
|
-
|
|
302
|
+
ref: refElem,
|
|
303
|
+
class: ["vxe-print"]
|
|
228
304
|
},
|
|
229
|
-
[
|
|
305
|
+
customLayout ? defaultSlot ? getSlotVNs(defaultSlot({})) : [] : [
|
|
230
306
|
h(
|
|
231
307
|
"div",
|
|
232
308
|
{
|
|
233
|
-
|
|
309
|
+
key: "slot",
|
|
310
|
+
class: "vxe-print-slots"
|
|
234
311
|
},
|
|
235
|
-
|
|
236
|
-
title && (showAllPageTitle || !index) ? h(
|
|
237
|
-
"div",
|
|
238
|
-
{
|
|
239
|
-
class: "vxe-print-page-break--header-title"
|
|
240
|
-
},
|
|
241
|
-
`${title || ""}`
|
|
242
|
-
) : renderEmptyElement($xePrint)
|
|
243
|
-
]
|
|
244
|
-
),
|
|
245
|
-
h(
|
|
246
|
-
"div",
|
|
247
|
-
{
|
|
248
|
-
class: "vxe-print-page-break--body"
|
|
249
|
-
},
|
|
250
|
-
[
|
|
251
|
-
h(
|
|
252
|
-
"div",
|
|
253
|
-
{
|
|
254
|
-
class: "vxe-print-page-break--left"
|
|
255
|
-
},
|
|
256
|
-
leftSlot ? getSlotVNs(leftSlot(params)) : []
|
|
257
|
-
),
|
|
258
|
-
h(
|
|
259
|
-
"div",
|
|
260
|
-
{
|
|
261
|
-
class: "vxe-print-page-break--content"
|
|
262
|
-
},
|
|
263
|
-
defaultSlot ? getSlotVNs(defaultSlot(params)) : []
|
|
264
|
-
),
|
|
265
|
-
h(
|
|
266
|
-
"div",
|
|
267
|
-
{
|
|
268
|
-
class: "vxe-print-page-break--right"
|
|
269
|
-
},
|
|
270
|
-
rightSlot ? getSlotVNs(rightSlot(params)) : []
|
|
271
|
-
)
|
|
272
|
-
]
|
|
273
|
-
),
|
|
274
|
-
h(
|
|
275
|
-
"div",
|
|
276
|
-
{
|
|
277
|
-
class: ["vxe-print-page-break--footer", footerAlign ? `align--${footerAlign}` : ""]
|
|
278
|
-
},
|
|
279
|
-
footerSlot ? getSlotVNs(footerSlot(params)) : [
|
|
280
|
-
showPageNumber ? h(
|
|
281
|
-
"div",
|
|
282
|
-
{
|
|
283
|
-
class: "vxe-print-page-break--footer-page-number"
|
|
284
|
-
},
|
|
285
|
-
`${currentPage}/${pageCount}`
|
|
286
|
-
) : renderEmptyElement($xePrint)
|
|
287
|
-
]
|
|
312
|
+
defaultSlot ? getSlotVNs(defaultSlot({})) : []
|
|
288
313
|
)
|
|
289
|
-
]
|
|
314
|
+
].concat(staticPageBreaks.length ? renderPageStaticLayouts() : renderPageConfigLayouts())
|
|
290
315
|
);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
class: ["vxe-print"]
|
|
302
|
-
},
|
|
303
|
-
customLayout ? defaultSlot ? getSlotVNs(defaultSlot({})) : [] : [
|
|
304
|
-
h(
|
|
305
|
-
"div",
|
|
306
|
-
{
|
|
307
|
-
key: "slot",
|
|
308
|
-
class: "vxe-print-slots"
|
|
309
|
-
},
|
|
310
|
-
defaultSlot ? getSlotVNs(defaultSlot({})) : []
|
|
311
|
-
)
|
|
312
|
-
].concat(staticPageBreaks.length ? renderPageStaticLayouts() : renderPageConfigLayouts())
|
|
313
|
-
);
|
|
314
|
-
};
|
|
315
|
-
$xePrint.renderVN = renderVN;
|
|
316
|
-
provide("$xePrint", $xePrint);
|
|
317
|
-
return $xePrint;
|
|
318
|
-
},
|
|
319
|
-
render() {
|
|
320
|
-
return this.renderVN();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
316
|
+
};
|
|
317
|
+
$xePrint.renderVN = renderVN;
|
|
318
|
+
provide("$xePrint", $xePrint);
|
|
319
|
+
return $xePrint;
|
|
320
|
+
},
|
|
321
|
+
render() {
|
|
322
|
+
return this.renderVN();
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
);
|
|
323
326
|
export {
|
|
324
327
|
print_default as default
|
|
325
328
|
};
|