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/lib/image/src/preview.js
CHANGED
|
@@ -37,189 +37,192 @@ var import_core = require("@vxe-ui/core");
|
|
|
37
37
|
var import_xe_utils = __toESM(require("xe-utils"));
|
|
38
38
|
var import_dom = require("../../ui/src/dom");
|
|
39
39
|
const { getConfig, createEvent, getIcon, globalEvents, GLOBAL_EVENT_KEYS, getI18n, renderEmptyElement } = import_core.VxeUI;
|
|
40
|
-
var preview_default = (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
var preview_default = (
|
|
41
|
+
/* define-vxe-component start */
|
|
42
|
+
(0, import_comp.defineVxeComponent)({
|
|
43
|
+
name: "VxeImagePreview",
|
|
44
|
+
props: {
|
|
45
|
+
modelValue: Number,
|
|
46
|
+
urlList: Array,
|
|
47
|
+
urlField: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: () => getConfig().imagePreview.urlField
|
|
50
|
+
},
|
|
51
|
+
maskClosable: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: () => getConfig().imagePreview.maskClosable
|
|
54
|
+
},
|
|
55
|
+
marginSize: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: () => getConfig().imagePreview.marginSize
|
|
58
|
+
},
|
|
59
|
+
showPrintButton: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: () => getConfig().imagePreview.showPrintButton
|
|
62
|
+
},
|
|
63
|
+
showDownloadButton: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: () => getConfig().imagePreview.showDownloadButton
|
|
66
|
+
},
|
|
67
|
+
zIndex: Number,
|
|
68
|
+
toolbarConfig: Object,
|
|
69
|
+
beforeDownloadMethod: Function,
|
|
70
|
+
downloadMethod: Function
|
|
48
71
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
default: () => getConfig().imagePreview.showPrintButton
|
|
60
|
-
},
|
|
61
|
-
showDownloadButton: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: () => getConfig().imagePreview.showDownloadButton
|
|
64
|
-
},
|
|
65
|
-
zIndex: Number,
|
|
66
|
-
toolbarConfig: Object,
|
|
67
|
-
beforeDownloadMethod: Function,
|
|
68
|
-
downloadMethod: Function
|
|
69
|
-
},
|
|
70
|
-
emits: ["update:modelValue", "change", "download", "download-fail", "rotate", "close"],
|
|
71
|
-
setup(props, context) {
|
|
72
|
-
const { emit } = context;
|
|
73
|
-
const xID = import_xe_utils.default.uniqueId();
|
|
74
|
-
const refElem = (0, import_vue.ref)();
|
|
75
|
-
const refMaps = {
|
|
76
|
-
refElem
|
|
77
|
-
};
|
|
78
|
-
const reactData = (0, import_vue.reactive)({
|
|
79
|
-
activeIndex: props.modelValue || 0,
|
|
80
|
-
offsetPct11: false,
|
|
81
|
-
offsetScale: 0,
|
|
82
|
-
offsetRotate: 0,
|
|
83
|
-
offsetLeft: 0,
|
|
84
|
-
offsetTop: 0
|
|
85
|
-
});
|
|
86
|
-
const computeUrlProp = (0, import_vue.computed)(() => {
|
|
87
|
-
return props.urlField || "url";
|
|
88
|
-
});
|
|
89
|
-
const computeMarginSize = (0, import_vue.computed)(() => {
|
|
90
|
-
return import_xe_utils.default.toNumber(props.marginSize || 0) || 16;
|
|
91
|
-
});
|
|
92
|
-
const computeToolbarOpts = (0, import_vue.computed)(() => {
|
|
93
|
-
return Object.assign({}, getConfig().imagePreview.toolbarConfig, props.toolbarConfig);
|
|
94
|
-
});
|
|
95
|
-
const computeRotateText = (0, import_vue.computed)(() => {
|
|
96
|
-
const { offsetRotate } = reactData;
|
|
97
|
-
if (offsetRotate) {
|
|
98
|
-
return `${offsetRotate}°`;
|
|
99
|
-
}
|
|
100
|
-
return "0°";
|
|
101
|
-
});
|
|
102
|
-
const computeScaleText = (0, import_vue.computed)(() => {
|
|
103
|
-
const { offsetScale } = reactData;
|
|
104
|
-
if (offsetScale) {
|
|
105
|
-
return `${import_xe_utils.default.ceil((1 + offsetScale) * 100)}%`;
|
|
106
|
-
}
|
|
107
|
-
return "100%";
|
|
108
|
-
});
|
|
109
|
-
const computeImgList = (0, import_vue.computed)(() => {
|
|
110
|
-
const { urlList } = props;
|
|
111
|
-
const urlProp = computeUrlProp.value;
|
|
112
|
-
if (urlList && urlList.length) {
|
|
113
|
-
return urlList.map((item) => {
|
|
114
|
-
if (import_xe_utils.default.isString(item)) {
|
|
115
|
-
return item;
|
|
116
|
-
}
|
|
117
|
-
if (item[urlProp]) {
|
|
118
|
-
return item[urlProp];
|
|
119
|
-
}
|
|
120
|
-
return "";
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
return [];
|
|
124
|
-
});
|
|
125
|
-
const computeImgTransform = (0, import_vue.computed)(() => {
|
|
126
|
-
let { offsetScale, offsetRotate, offsetLeft, offsetTop } = reactData;
|
|
127
|
-
const stys = [];
|
|
128
|
-
let targetScale = 1;
|
|
129
|
-
if (offsetScale) {
|
|
130
|
-
targetScale = 1 + offsetScale;
|
|
131
|
-
stys.push(`scale(${targetScale})`);
|
|
132
|
-
}
|
|
133
|
-
if (offsetRotate) {
|
|
134
|
-
stys.push(`rotate(${offsetRotate}deg)`);
|
|
135
|
-
}
|
|
136
|
-
if (offsetLeft || offsetTop) {
|
|
137
|
-
offsetLeft /= targetScale;
|
|
138
|
-
offsetTop /= targetScale;
|
|
139
|
-
let targetOffsetLeft = offsetLeft;
|
|
140
|
-
let targetOffsetTop = offsetTop;
|
|
141
|
-
if (offsetRotate) {
|
|
142
|
-
switch (offsetRotate % 360) {
|
|
143
|
-
case 90:
|
|
144
|
-
case -270:
|
|
145
|
-
targetOffsetLeft = offsetTop;
|
|
146
|
-
targetOffsetTop = -offsetLeft;
|
|
147
|
-
break;
|
|
148
|
-
case 180:
|
|
149
|
-
case -180:
|
|
150
|
-
targetOffsetLeft = -offsetLeft;
|
|
151
|
-
targetOffsetTop = -offsetTop;
|
|
152
|
-
break;
|
|
153
|
-
case 270:
|
|
154
|
-
case -90:
|
|
155
|
-
targetOffsetLeft = -offsetTop;
|
|
156
|
-
targetOffsetTop = offsetLeft;
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
stys.push(`translate(${targetOffsetLeft}px, ${targetOffsetTop}px)`);
|
|
161
|
-
}
|
|
162
|
-
return stys.length ? stys.join(" ") : "";
|
|
163
|
-
});
|
|
164
|
-
const computeMaps = {
|
|
165
|
-
computeImgList
|
|
166
|
-
};
|
|
167
|
-
const $xeImagePreview = {
|
|
168
|
-
xID,
|
|
169
|
-
props,
|
|
170
|
-
context,
|
|
171
|
-
reactData,
|
|
172
|
-
getRefMaps: () => refMaps,
|
|
173
|
-
getComputeMaps: () => computeMaps
|
|
174
|
-
};
|
|
175
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
176
|
-
emit(type, createEvent(evnt, { $imagePreview: $xeImagePreview }, params));
|
|
177
|
-
};
|
|
178
|
-
const imagePreviewMethods = {
|
|
179
|
-
dispatchEvent
|
|
180
|
-
};
|
|
181
|
-
const emitModel = (value) => {
|
|
182
|
-
reactData.activeIndex = value;
|
|
183
|
-
emit("update:modelValue", value);
|
|
184
|
-
};
|
|
185
|
-
const handleCloseEvent = (evnt) => {
|
|
186
|
-
dispatchEvent("close", {}, evnt);
|
|
187
|
-
};
|
|
188
|
-
const imagePreviewPrivateMethods = {};
|
|
189
|
-
const resetStyle = () => {
|
|
190
|
-
const elem = refElem.value;
|
|
191
|
-
(0, import_dom.removeClass)(elem, "is--move");
|
|
192
|
-
Object.assign(reactData, {
|
|
72
|
+
emits: ["update:modelValue", "change", "download", "download-fail", "rotate", "close"],
|
|
73
|
+
setup(props, context) {
|
|
74
|
+
const { emit } = context;
|
|
75
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
76
|
+
const refElem = (0, import_vue.ref)();
|
|
77
|
+
const refMaps = {
|
|
78
|
+
refElem
|
|
79
|
+
};
|
|
80
|
+
const reactData = (0, import_vue.reactive)({
|
|
81
|
+
activeIndex: props.modelValue || 0,
|
|
193
82
|
offsetPct11: false,
|
|
194
83
|
offsetScale: 0,
|
|
195
84
|
offsetRotate: 0,
|
|
196
85
|
offsetLeft: 0,
|
|
197
86
|
offsetTop: 0
|
|
198
87
|
});
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
88
|
+
const computeUrlProp = (0, import_vue.computed)(() => {
|
|
89
|
+
return props.urlField || "url";
|
|
90
|
+
});
|
|
91
|
+
const computeMarginSize = (0, import_vue.computed)(() => {
|
|
92
|
+
return import_xe_utils.default.toNumber(props.marginSize || 0) || 16;
|
|
93
|
+
});
|
|
94
|
+
const computeToolbarOpts = (0, import_vue.computed)(() => {
|
|
95
|
+
return Object.assign({}, getConfig().imagePreview.toolbarConfig, props.toolbarConfig);
|
|
96
|
+
});
|
|
97
|
+
const computeRotateText = (0, import_vue.computed)(() => {
|
|
98
|
+
const { offsetRotate } = reactData;
|
|
99
|
+
if (offsetRotate) {
|
|
100
|
+
return `${offsetRotate}°`;
|
|
101
|
+
}
|
|
102
|
+
return "0°";
|
|
103
|
+
});
|
|
104
|
+
const computeScaleText = (0, import_vue.computed)(() => {
|
|
105
|
+
const { offsetScale } = reactData;
|
|
106
|
+
if (offsetScale) {
|
|
107
|
+
return `${import_xe_utils.default.ceil((1 + offsetScale) * 100)}%`;
|
|
108
|
+
}
|
|
109
|
+
return "100%";
|
|
110
|
+
});
|
|
111
|
+
const computeImgList = (0, import_vue.computed)(() => {
|
|
112
|
+
const { urlList } = props;
|
|
113
|
+
const urlProp = computeUrlProp.value;
|
|
114
|
+
if (urlList && urlList.length) {
|
|
115
|
+
return urlList.map((item) => {
|
|
116
|
+
if (import_xe_utils.default.isString(item)) {
|
|
117
|
+
return item;
|
|
118
|
+
}
|
|
119
|
+
if (item[urlProp]) {
|
|
120
|
+
return item[urlProp];
|
|
121
|
+
}
|
|
122
|
+
return "";
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return [];
|
|
126
|
+
});
|
|
127
|
+
const computeImgTransform = (0, import_vue.computed)(() => {
|
|
128
|
+
let { offsetScale, offsetRotate, offsetLeft, offsetTop } = reactData;
|
|
129
|
+
const stys = [];
|
|
130
|
+
let targetScale = 1;
|
|
131
|
+
if (offsetScale) {
|
|
132
|
+
targetScale = 1 + offsetScale;
|
|
133
|
+
stys.push(`scale(${targetScale})`);
|
|
134
|
+
}
|
|
135
|
+
if (offsetRotate) {
|
|
136
|
+
stys.push(`rotate(${offsetRotate}deg)`);
|
|
137
|
+
}
|
|
138
|
+
if (offsetLeft || offsetTop) {
|
|
139
|
+
offsetLeft /= targetScale;
|
|
140
|
+
offsetTop /= targetScale;
|
|
141
|
+
let targetOffsetLeft = offsetLeft;
|
|
142
|
+
let targetOffsetTop = offsetTop;
|
|
143
|
+
if (offsetRotate) {
|
|
144
|
+
switch (offsetRotate % 360) {
|
|
145
|
+
case 90:
|
|
146
|
+
case -270:
|
|
147
|
+
targetOffsetLeft = offsetTop;
|
|
148
|
+
targetOffsetTop = -offsetLeft;
|
|
149
|
+
break;
|
|
150
|
+
case 180:
|
|
151
|
+
case -180:
|
|
152
|
+
targetOffsetLeft = -offsetLeft;
|
|
153
|
+
targetOffsetTop = -offsetTop;
|
|
154
|
+
break;
|
|
155
|
+
case 270:
|
|
156
|
+
case -90:
|
|
157
|
+
targetOffsetLeft = -offsetTop;
|
|
158
|
+
targetOffsetTop = offsetLeft;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
stys.push(`translate(${targetOffsetLeft}px, ${targetOffsetTop}px)`);
|
|
163
|
+
}
|
|
164
|
+
return stys.length ? stys.join(" ") : "";
|
|
165
|
+
});
|
|
166
|
+
const computeMaps = {
|
|
167
|
+
computeImgList
|
|
168
|
+
};
|
|
169
|
+
const $xeImagePreview = {
|
|
170
|
+
xID,
|
|
171
|
+
props,
|
|
172
|
+
context,
|
|
173
|
+
reactData,
|
|
174
|
+
getRefMaps: () => refMaps,
|
|
175
|
+
getComputeMaps: () => computeMaps
|
|
176
|
+
};
|
|
177
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
178
|
+
emit(type, createEvent(evnt, { $imagePreview: $xeImagePreview }, params));
|
|
179
|
+
};
|
|
180
|
+
const imagePreviewMethods = {
|
|
181
|
+
dispatchEvent
|
|
182
|
+
};
|
|
183
|
+
const emitModel = (value) => {
|
|
184
|
+
reactData.activeIndex = value;
|
|
185
|
+
emit("update:modelValue", value);
|
|
186
|
+
};
|
|
187
|
+
const handleCloseEvent = (evnt) => {
|
|
188
|
+
dispatchEvent("close", {}, evnt);
|
|
189
|
+
};
|
|
190
|
+
const imagePreviewPrivateMethods = {};
|
|
191
|
+
const resetStyle = () => {
|
|
192
|
+
const elem = refElem.value;
|
|
193
|
+
(0, import_dom.removeClass)(elem, "is--move");
|
|
194
|
+
Object.assign(reactData, {
|
|
195
|
+
offsetPct11: false,
|
|
196
|
+
offsetScale: 0,
|
|
197
|
+
offsetRotate: 0,
|
|
198
|
+
offsetLeft: 0,
|
|
199
|
+
offsetTop: 0
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
const getOffsetZoomStep = () => {
|
|
203
|
+
const { offsetScale } = reactData;
|
|
204
|
+
let stepNum = 0.02;
|
|
205
|
+
if (offsetScale >= -0.6) {
|
|
206
|
+
stepNum = 0.04;
|
|
207
|
+
if (offsetScale >= -0.4) {
|
|
208
|
+
stepNum = 0.07;
|
|
209
|
+
if (offsetScale >= 0) {
|
|
210
|
+
stepNum = 0.1;
|
|
211
|
+
if (offsetScale >= 3) {
|
|
212
|
+
stepNum = 0.25;
|
|
213
|
+
if (offsetScale >= 8) {
|
|
214
|
+
stepNum = 0.4;
|
|
215
|
+
if (offsetScale >= 16) {
|
|
216
|
+
stepNum = 0.6;
|
|
217
|
+
if (offsetScale >= 24) {
|
|
218
|
+
stepNum = 0.9;
|
|
219
|
+
if (offsetScale >= 32) {
|
|
220
|
+
stepNum = 1.3;
|
|
221
|
+
if (offsetScale >= 39) {
|
|
222
|
+
stepNum = 1.9;
|
|
223
|
+
if (offsetScale >= 45) {
|
|
224
|
+
stepNum = 2.5;
|
|
225
|
+
}
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
228
|
}
|
|
@@ -229,473 +232,473 @@ var preview_default = (0, import_comp.defineVxeComponent)({
|
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
reactData.offsetScale = Number(Math.min(49, offsetScale + stepNum).toFixed(2));
|
|
240
|
-
} else {
|
|
241
|
-
reactData.offsetScale = Number(Math.max(-0.9, offsetScale - stepNum).toFixed(2));
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
const handleChangeEvent = (evnt, isNext) => {
|
|
245
|
-
let activeIndex = reactData.activeIndex || 0;
|
|
246
|
-
const imgList = computeImgList.value;
|
|
247
|
-
if (isNext) {
|
|
248
|
-
if (activeIndex >= imgList.length - 1) {
|
|
249
|
-
activeIndex = 0;
|
|
235
|
+
return stepNum;
|
|
236
|
+
};
|
|
237
|
+
const handleZoom = (isAdd) => {
|
|
238
|
+
const { offsetScale } = reactData;
|
|
239
|
+
const stepNum = getOffsetZoomStep();
|
|
240
|
+
if (isAdd) {
|
|
241
|
+
reactData.offsetScale = Number(Math.min(49, offsetScale + stepNum).toFixed(2));
|
|
250
242
|
} else {
|
|
251
|
-
|
|
243
|
+
reactData.offsetScale = Number(Math.max(-0.9, offsetScale - stepNum).toFixed(2));
|
|
252
244
|
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
245
|
+
};
|
|
246
|
+
const handleChangeEvent = (evnt, isNext) => {
|
|
247
|
+
let activeIndex = reactData.activeIndex || 0;
|
|
248
|
+
const imgList = computeImgList.value;
|
|
249
|
+
if (isNext) {
|
|
250
|
+
if (activeIndex >= imgList.length - 1) {
|
|
251
|
+
activeIndex = 0;
|
|
252
|
+
} else {
|
|
253
|
+
activeIndex++;
|
|
254
|
+
}
|
|
256
255
|
} else {
|
|
257
|
-
activeIndex
|
|
256
|
+
if (activeIndex <= 0) {
|
|
257
|
+
activeIndex = imgList.length - 1;
|
|
258
|
+
} else {
|
|
259
|
+
activeIndex--;
|
|
260
|
+
}
|
|
258
261
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
]
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
const handleDownloadEvent = (evnt, imgUrl) => {
|
|
299
|
-
dispatchEvent("download", { url: imgUrl }, evnt);
|
|
300
|
-
};
|
|
301
|
-
const handleDefaultDownload = (evnt, imgUrl) => {
|
|
302
|
-
if (import_core.VxeUI.saveFile) {
|
|
303
|
-
fetch(imgUrl).then((res) => {
|
|
304
|
-
return res.blob().then((blob) => {
|
|
305
|
-
import_core.VxeUI.saveFile({
|
|
306
|
-
filename: imgUrl,
|
|
307
|
-
content: blob
|
|
308
|
-
});
|
|
309
|
-
handleDownloadEvent(evnt, imgUrl);
|
|
262
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
263
|
+
reactData.activeIndex = activeIndex;
|
|
264
|
+
resetStyle();
|
|
265
|
+
emitModel(activeIndex);
|
|
266
|
+
dispatchEvent("change", { url: imgUrl, activeIndex }, evnt);
|
|
267
|
+
};
|
|
268
|
+
const handleRotateImgEvent = (evnt, isRight) => {
|
|
269
|
+
const imgList = computeImgList.value;
|
|
270
|
+
const { activeIndex } = reactData;
|
|
271
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
272
|
+
let offsetRotate = reactData.offsetRotate;
|
|
273
|
+
if (isRight) {
|
|
274
|
+
offsetRotate += 90;
|
|
275
|
+
} else {
|
|
276
|
+
offsetRotate -= 90;
|
|
277
|
+
}
|
|
278
|
+
reactData.offsetRotate = offsetRotate;
|
|
279
|
+
dispatchEvent("rotate", { url: imgUrl, rotateValue: offsetRotate }, evnt);
|
|
280
|
+
};
|
|
281
|
+
const handlePct11 = () => {
|
|
282
|
+
resetStyle();
|
|
283
|
+
reactData.offsetPct11 = true;
|
|
284
|
+
};
|
|
285
|
+
const handlePrintImg = () => {
|
|
286
|
+
const { activeIndex } = reactData;
|
|
287
|
+
const imgList = computeImgList.value;
|
|
288
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
289
|
+
if (import_core.VxeUI.print) {
|
|
290
|
+
import_core.VxeUI.print({
|
|
291
|
+
align: "center",
|
|
292
|
+
pageBreaks: [
|
|
293
|
+
{
|
|
294
|
+
bodyHtml: `<img src="${imgUrl}" style="max-width:100%;max-height:100%;">`
|
|
295
|
+
}
|
|
296
|
+
]
|
|
310
297
|
});
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
const handleDownloadEvent = (evnt, imgUrl) => {
|
|
301
|
+
dispatchEvent("download", { url: imgUrl }, evnt);
|
|
302
|
+
};
|
|
303
|
+
const handleDefaultDownload = (evnt, imgUrl) => {
|
|
304
|
+
if (import_core.VxeUI.saveFile) {
|
|
305
|
+
fetch(imgUrl).then((res) => {
|
|
306
|
+
return res.blob().then((blob) => {
|
|
307
|
+
import_core.VxeUI.saveFile({
|
|
308
|
+
filename: imgUrl,
|
|
309
|
+
content: blob
|
|
310
|
+
});
|
|
311
|
+
handleDownloadEvent(evnt, imgUrl);
|
|
316
312
|
});
|
|
313
|
+
}).catch(() => {
|
|
314
|
+
if (import_core.VxeUI.modal) {
|
|
315
|
+
import_core.VxeUI.modal.message({
|
|
316
|
+
content: getI18n("vxe.error.downErr"),
|
|
317
|
+
status: "error"
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
const handleDownloadImg = (evnt) => {
|
|
324
|
+
const { activeIndex } = reactData;
|
|
325
|
+
const toolbarOpts = computeToolbarOpts.value;
|
|
326
|
+
const btnConf = toolbarOpts.download;
|
|
327
|
+
const btnOpts = import_xe_utils.default.isBoolean(btnConf) ? {} : btnConf ? Object.assign({}, btnConf) : {};
|
|
328
|
+
const imgList = computeImgList.value;
|
|
329
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
330
|
+
const beforeDownloadFn = props.beforeDownloadMethod || btnOpts.beforeDownloadMethod || getConfig().imagePreview.beforeDownloadMethod;
|
|
331
|
+
const downloadFn = props.downloadMethod || btnOpts.downloadMethod || getConfig().imagePreview.downloadMethod;
|
|
332
|
+
Promise.resolve(
|
|
333
|
+
beforeDownloadFn ? beforeDownloadFn({
|
|
334
|
+
$imagePreview: $xeImagePreview,
|
|
335
|
+
url: imgUrl,
|
|
336
|
+
index: activeIndex || 0
|
|
337
|
+
}) : true
|
|
338
|
+
).then((status) => {
|
|
339
|
+
if (status) {
|
|
340
|
+
if (downloadFn) {
|
|
341
|
+
Promise.resolve(
|
|
342
|
+
downloadFn({
|
|
343
|
+
$imagePreview: $xeImagePreview,
|
|
344
|
+
url: imgUrl,
|
|
345
|
+
index: activeIndex || 0
|
|
346
|
+
})
|
|
347
|
+
).then(() => {
|
|
348
|
+
handleDownloadEvent(evnt, imgUrl);
|
|
349
|
+
}).catch((e) => e);
|
|
350
|
+
} else {
|
|
351
|
+
handleDefaultDownload(evnt, imgUrl);
|
|
352
|
+
}
|
|
317
353
|
}
|
|
318
354
|
});
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
355
|
+
};
|
|
356
|
+
const handleOperationBtn = (evnt, code) => {
|
|
357
|
+
const { activeIndex } = reactData;
|
|
358
|
+
const imgList = computeImgList.value;
|
|
359
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
360
|
+
if (imgUrl) {
|
|
361
|
+
switch (code) {
|
|
362
|
+
case "zoomOut":
|
|
363
|
+
handleZoom(false);
|
|
364
|
+
break;
|
|
365
|
+
case "zoomIn":
|
|
366
|
+
handleZoom(true);
|
|
367
|
+
break;
|
|
368
|
+
case "pctFull":
|
|
369
|
+
resetStyle();
|
|
370
|
+
break;
|
|
371
|
+
case "pct11":
|
|
372
|
+
handlePct11();
|
|
373
|
+
break;
|
|
374
|
+
case "rotateLeft":
|
|
375
|
+
handleRotateImgEvent(evnt, false);
|
|
376
|
+
break;
|
|
377
|
+
case "rotateRight":
|
|
378
|
+
handleRotateImgEvent(evnt, true);
|
|
379
|
+
break;
|
|
380
|
+
case "print":
|
|
381
|
+
handlePrintImg();
|
|
382
|
+
break;
|
|
383
|
+
case "download":
|
|
384
|
+
handleDownloadImg(evnt);
|
|
385
|
+
break;
|
|
350
386
|
}
|
|
351
387
|
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
388
|
+
};
|
|
389
|
+
const wheelEvent = (evnt) => {
|
|
390
|
+
const delta = evnt.deltaY;
|
|
391
|
+
if (delta > 0) {
|
|
392
|
+
evnt.preventDefault();
|
|
393
|
+
handleZoom(false);
|
|
394
|
+
} else if (delta < 0) {
|
|
395
|
+
evnt.preventDefault();
|
|
396
|
+
handleZoom(true);
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
const moveEvent = (evnt) => {
|
|
400
|
+
const { offsetTop, offsetLeft } = reactData;
|
|
401
|
+
const elem = refElem.value;
|
|
402
|
+
evnt.preventDefault();
|
|
403
|
+
const domMousemove = document.onmousemove;
|
|
404
|
+
const domMouseup = document.onmouseup;
|
|
405
|
+
const startX = evnt.pageX;
|
|
406
|
+
const startY = evnt.pageY;
|
|
407
|
+
const marginSize = computeMarginSize.value;
|
|
408
|
+
document.onmousemove = (et) => {
|
|
409
|
+
const { pageX, pageY } = et;
|
|
410
|
+
const { visibleHeight, visibleWidth } = (0, import_dom.getDomNode)();
|
|
411
|
+
et.preventDefault();
|
|
412
|
+
(0, import_dom.addClass)(elem, "is--move");
|
|
413
|
+
if (pageX > marginSize && pageY > marginSize && pageX < visibleWidth - marginSize && pageY < visibleHeight - marginSize) {
|
|
414
|
+
reactData.offsetLeft = offsetLeft + pageX - startX;
|
|
415
|
+
reactData.offsetTop = offsetTop + pageY - startY;
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
document.onmouseup = () => {
|
|
419
|
+
document.onmousemove = domMousemove;
|
|
420
|
+
document.onmouseup = domMouseup;
|
|
421
|
+
(0, import_dom.removeClass)(elem, "is--move");
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
const handleGlobalKeydownEvent = (evnt) => {
|
|
425
|
+
const isControlKey = (0, import_dom.hasControlKey)(evnt);
|
|
426
|
+
const hasShiftKey = evnt.shiftKey;
|
|
427
|
+
const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
|
|
428
|
+
const isDownArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
|
|
429
|
+
const isLeftArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
|
|
430
|
+
const isRightArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
|
|
431
|
+
const isR = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.R);
|
|
432
|
+
const isP = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.P);
|
|
433
|
+
if (isUpArrow) {
|
|
434
|
+
evnt.preventDefault();
|
|
435
|
+
if (hasShiftKey) {
|
|
436
|
+
reactData.offsetTop -= 1;
|
|
437
|
+
} else {
|
|
364
438
|
handleZoom(true);
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
439
|
+
}
|
|
440
|
+
} else if (isDownArrow) {
|
|
441
|
+
evnt.preventDefault();
|
|
442
|
+
if (hasShiftKey) {
|
|
443
|
+
reactData.offsetTop += 1;
|
|
444
|
+
} else {
|
|
445
|
+
handleZoom(false);
|
|
446
|
+
}
|
|
447
|
+
} else if (isLeftArrow) {
|
|
448
|
+
evnt.preventDefault();
|
|
449
|
+
if (hasShiftKey) {
|
|
450
|
+
reactData.offsetLeft -= 1;
|
|
451
|
+
} else {
|
|
452
|
+
handleChangeEvent(evnt, false);
|
|
453
|
+
}
|
|
454
|
+
} else if (isRightArrow) {
|
|
455
|
+
evnt.preventDefault();
|
|
456
|
+
if (hasShiftKey) {
|
|
457
|
+
reactData.offsetLeft += 1;
|
|
458
|
+
} else {
|
|
459
|
+
handleChangeEvent(evnt, true);
|
|
460
|
+
}
|
|
461
|
+
} else if (isR && isControlKey) {
|
|
462
|
+
evnt.preventDefault();
|
|
463
|
+
if (hasShiftKey) {
|
|
373
464
|
handleRotateImgEvent(evnt, false);
|
|
374
|
-
|
|
375
|
-
case "rotateRight":
|
|
465
|
+
} else {
|
|
376
466
|
handleRotateImgEvent(evnt, true);
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
case "download":
|
|
382
|
-
handleDownloadImg(evnt);
|
|
383
|
-
break;
|
|
467
|
+
}
|
|
468
|
+
} else if (isP && isControlKey) {
|
|
469
|
+
evnt.preventDefault();
|
|
470
|
+
handlePrintImg();
|
|
384
471
|
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
handleZoom(false);
|
|
392
|
-
} else if (delta < 0) {
|
|
393
|
-
evnt.preventDefault();
|
|
394
|
-
handleZoom(true);
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
const moveEvent = (evnt) => {
|
|
398
|
-
const { offsetTop, offsetLeft } = reactData;
|
|
399
|
-
const elem = refElem.value;
|
|
400
|
-
evnt.preventDefault();
|
|
401
|
-
const domMousemove = document.onmousemove;
|
|
402
|
-
const domMouseup = document.onmouseup;
|
|
403
|
-
const startX = evnt.pageX;
|
|
404
|
-
const startY = evnt.pageY;
|
|
405
|
-
const marginSize = computeMarginSize.value;
|
|
406
|
-
document.onmousemove = (et) => {
|
|
407
|
-
const { pageX, pageY } = et;
|
|
408
|
-
const { visibleHeight, visibleWidth } = (0, import_dom.getDomNode)();
|
|
409
|
-
et.preventDefault();
|
|
410
|
-
(0, import_dom.addClass)(elem, "is--move");
|
|
411
|
-
if (pageX > marginSize && pageY > marginSize && pageX < visibleWidth - marginSize && pageY < visibleHeight - marginSize) {
|
|
412
|
-
reactData.offsetLeft = offsetLeft + pageX - startX;
|
|
413
|
-
reactData.offsetTop = offsetTop + pageY - startY;
|
|
472
|
+
};
|
|
473
|
+
const handleClickMaskEvent = (evnt) => {
|
|
474
|
+
if (props.maskClosable) {
|
|
475
|
+
if (evnt.target === evnt.currentTarget) {
|
|
476
|
+
dispatchEvent("close", {}, evnt);
|
|
477
|
+
}
|
|
414
478
|
}
|
|
415
479
|
};
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
480
|
+
Object.assign($xeImagePreview, imagePreviewMethods, imagePreviewPrivateMethods);
|
|
481
|
+
const renderImgWrapper = () => {
|
|
482
|
+
const { activeIndex } = reactData;
|
|
483
|
+
const imgList = computeImgList.value;
|
|
484
|
+
const imgTransform = computeImgTransform.value;
|
|
485
|
+
return (0, import_vue.h)(
|
|
486
|
+
"div",
|
|
487
|
+
{
|
|
488
|
+
class: "vxe-image-preview--img-list",
|
|
489
|
+
onClick: handleClickMaskEvent
|
|
490
|
+
},
|
|
491
|
+
imgList.map((url, index) => {
|
|
492
|
+
const isActive = activeIndex === index;
|
|
493
|
+
return (0, import_vue.h)("img", {
|
|
494
|
+
class: [
|
|
495
|
+
"vxe-image-preview--img-item",
|
|
496
|
+
{
|
|
497
|
+
"is--active": isActive
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
src: url,
|
|
501
|
+
style: isActive ? {
|
|
502
|
+
transform: imgTransform
|
|
503
|
+
} : null,
|
|
504
|
+
onMousedown(evnt) {
|
|
505
|
+
moveEvent(evnt);
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
})
|
|
509
|
+
);
|
|
420
510
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
511
|
+
const renderOperationBtn = (code, icon) => {
|
|
512
|
+
const toolbarOpts = computeToolbarOpts.value;
|
|
513
|
+
const btnConf = toolbarOpts[code];
|
|
514
|
+
const btnOpts = import_xe_utils.default.isBoolean(btnConf) ? {} : btnConf ? Object.assign({}, btnConf) : {};
|
|
515
|
+
const showBtn = btnConf !== false;
|
|
516
|
+
return showBtn ? (0, import_vue.h)(
|
|
517
|
+
"div",
|
|
518
|
+
{
|
|
519
|
+
class: "vxe-image-preview--operation-btn",
|
|
520
|
+
title: getI18n(`vxe.imagePreview.operBtn.${code}`),
|
|
521
|
+
onClick(evnt) {
|
|
522
|
+
handleOperationBtn(evnt, code);
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
[
|
|
526
|
+
(0, import_vue.h)("i", {
|
|
527
|
+
class: btnOpts.icon || getIcon()[icon]
|
|
528
|
+
})
|
|
529
|
+
]
|
|
530
|
+
) : renderEmptyElement($xeImagePreview);
|
|
531
|
+
};
|
|
532
|
+
const renderBtnWrapper = () => {
|
|
533
|
+
const { showPrintButton, showDownloadButton } = props;
|
|
534
|
+
const { activeIndex } = reactData;
|
|
535
|
+
const imgList = computeImgList.value;
|
|
536
|
+
const rotateText = computeRotateText.value;
|
|
537
|
+
const scaleText = computeScaleText.value;
|
|
538
|
+
const toolbarOpts = computeToolbarOpts.value;
|
|
539
|
+
return (0, import_vue.h)(
|
|
540
|
+
"div",
|
|
541
|
+
{
|
|
542
|
+
class: "vxe-image-preview--btn-wrapper"
|
|
543
|
+
},
|
|
544
|
+
[
|
|
545
|
+
(0, import_vue.h)(
|
|
546
|
+
"div",
|
|
547
|
+
{
|
|
548
|
+
class: "vxe-image-preview--close-wrapper"
|
|
549
|
+
},
|
|
550
|
+
[
|
|
551
|
+
(0, import_vue.h)(
|
|
552
|
+
"div",
|
|
553
|
+
{
|
|
554
|
+
class: "vxe-image-preview--close-btn",
|
|
555
|
+
onClick: handleCloseEvent
|
|
556
|
+
},
|
|
557
|
+
[
|
|
558
|
+
(0, import_vue.h)("i", {
|
|
559
|
+
class: getIcon().IMAGE_PREVIEW_CLOSE
|
|
560
|
+
})
|
|
561
|
+
]
|
|
562
|
+
),
|
|
563
|
+
(0, import_vue.h)("div", {
|
|
564
|
+
class: "vxe-image-preview--close-bg"
|
|
565
|
+
})
|
|
566
|
+
]
|
|
567
|
+
),
|
|
568
|
+
imgList.length > 1 ? (0, import_vue.h)(
|
|
569
|
+
"div",
|
|
570
|
+
{
|
|
571
|
+
class: "vxe-image-preview--previous-btn",
|
|
572
|
+
onClick(evnt) {
|
|
573
|
+
handleChangeEvent(evnt, false);
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
[
|
|
577
|
+
(0, import_vue.h)("i", {
|
|
578
|
+
class: getIcon().IMAGE_PREVIEW_PREVIOUS
|
|
579
|
+
})
|
|
580
|
+
]
|
|
581
|
+
) : renderEmptyElement($xeImagePreview),
|
|
582
|
+
imgList.length > 1 ? (0, import_vue.h)(
|
|
583
|
+
"div",
|
|
584
|
+
{
|
|
585
|
+
class: "vxe-image-preview--next-btn",
|
|
586
|
+
onClick(evnt) {
|
|
587
|
+
handleChangeEvent(evnt, true);
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
[
|
|
591
|
+
(0, import_vue.h)("i", {
|
|
592
|
+
class: getIcon().IMAGE_PREVIEW_NEXT
|
|
593
|
+
})
|
|
594
|
+
]
|
|
595
|
+
) : renderEmptyElement($xeImagePreview),
|
|
596
|
+
(0, import_vue.h)(
|
|
597
|
+
"div",
|
|
598
|
+
{
|
|
599
|
+
class: "vxe-image-preview--operation-info"
|
|
600
|
+
},
|
|
601
|
+
[
|
|
602
|
+
(0, import_vue.h)(
|
|
603
|
+
"div",
|
|
604
|
+
{
|
|
605
|
+
class: "vxe-image-preview--operation-deg"
|
|
606
|
+
},
|
|
607
|
+
rotateText
|
|
608
|
+
),
|
|
609
|
+
(0, import_vue.h)(
|
|
610
|
+
"div",
|
|
611
|
+
{
|
|
612
|
+
class: "vxe-image-preview--operation-pct"
|
|
613
|
+
},
|
|
614
|
+
scaleText
|
|
615
|
+
)
|
|
616
|
+
]
|
|
617
|
+
),
|
|
618
|
+
(0, import_vue.h)(
|
|
619
|
+
"div",
|
|
620
|
+
{
|
|
621
|
+
class: "vxe-image-preview--operation-wrapper"
|
|
622
|
+
},
|
|
623
|
+
[
|
|
624
|
+
(0, import_vue.h)(
|
|
625
|
+
"div",
|
|
626
|
+
{
|
|
627
|
+
class: "vxe-image-preview--operation-active-count"
|
|
628
|
+
},
|
|
629
|
+
[
|
|
630
|
+
(0, import_vue.h)(
|
|
631
|
+
"span",
|
|
632
|
+
{
|
|
633
|
+
class: "vxe-image-preview--operation-active-current"
|
|
634
|
+
},
|
|
635
|
+
`${(activeIndex || 0) + 1}`
|
|
636
|
+
),
|
|
637
|
+
(0, import_vue.h)(
|
|
638
|
+
"span",
|
|
639
|
+
{
|
|
640
|
+
class: "vxe-image-preview--operation-active-total"
|
|
641
|
+
},
|
|
642
|
+
`/${imgList.length}`
|
|
643
|
+
)
|
|
644
|
+
]
|
|
645
|
+
),
|
|
646
|
+
renderOperationBtn("zoomOut", "IMAGE_PREVIEW_ZOOM_OUT"),
|
|
647
|
+
renderOperationBtn("zoomIn", "IMAGE_PREVIEW_ZOOM_IN"),
|
|
648
|
+
renderOperationBtn("pctFull", "IMAGE_PREVIEW_PCT_FULL"),
|
|
649
|
+
renderOperationBtn("pct11", "IMAGE_PREVIEW_PCT_1_1"),
|
|
650
|
+
renderOperationBtn("rotateLeft", "IMAGE_PREVIEW_ROTATE_LEFT"),
|
|
651
|
+
renderOperationBtn("rotateRight", "IMAGE_PREVIEW_ROTATE_RIGHT"),
|
|
652
|
+
showPrintButton || toolbarOpts.print ? renderOperationBtn("print", "IMAGE_PREVIEW_PRINT") : renderEmptyElement($xeImagePreview),
|
|
653
|
+
showDownloadButton || toolbarOpts.download ? renderOperationBtn("download", "IMAGE_PREVIEW_DOWNLOAD") : renderEmptyElement($xeImagePreview)
|
|
654
|
+
]
|
|
655
|
+
)
|
|
656
|
+
]
|
|
657
|
+
);
|
|
658
|
+
};
|
|
659
|
+
const renderVN = () => {
|
|
660
|
+
const { offsetPct11 } = reactData;
|
|
661
|
+
return (0, import_vue.h)(
|
|
662
|
+
"div",
|
|
663
|
+
{
|
|
664
|
+
ref: refElem,
|
|
492
665
|
class: [
|
|
493
|
-
"vxe-image-preview
|
|
666
|
+
"vxe-image-preview",
|
|
494
667
|
{
|
|
495
|
-
"is--
|
|
496
|
-
}
|
|
497
|
-
],
|
|
498
|
-
src: url,
|
|
499
|
-
style: isActive ? {
|
|
500
|
-
transform: imgTransform
|
|
501
|
-
} : null,
|
|
502
|
-
onMousedown(evnt) {
|
|
503
|
-
moveEvent(evnt);
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
})
|
|
507
|
-
);
|
|
508
|
-
};
|
|
509
|
-
const renderOperationBtn = (code, icon) => {
|
|
510
|
-
const toolbarOpts = computeToolbarOpts.value;
|
|
511
|
-
const btnConf = toolbarOpts[code];
|
|
512
|
-
const btnOpts = import_xe_utils.default.isBoolean(btnConf) ? {} : btnConf ? Object.assign({}, btnConf) : {};
|
|
513
|
-
const showBtn = btnConf !== false;
|
|
514
|
-
return showBtn ? (0, import_vue.h)(
|
|
515
|
-
"div",
|
|
516
|
-
{
|
|
517
|
-
class: "vxe-image-preview--operation-btn",
|
|
518
|
-
title: getI18n(`vxe.imagePreview.operBtn.${code}`),
|
|
519
|
-
onClick(evnt) {
|
|
520
|
-
handleOperationBtn(evnt, code);
|
|
521
|
-
}
|
|
522
|
-
},
|
|
523
|
-
[
|
|
524
|
-
(0, import_vue.h)("i", {
|
|
525
|
-
class: btnOpts.icon || getIcon()[icon]
|
|
526
|
-
})
|
|
527
|
-
]
|
|
528
|
-
) : renderEmptyElement($xeImagePreview);
|
|
529
|
-
};
|
|
530
|
-
const renderBtnWrapper = () => {
|
|
531
|
-
const { showPrintButton, showDownloadButton } = props;
|
|
532
|
-
const { activeIndex } = reactData;
|
|
533
|
-
const imgList = computeImgList.value;
|
|
534
|
-
const rotateText = computeRotateText.value;
|
|
535
|
-
const scaleText = computeScaleText.value;
|
|
536
|
-
const toolbarOpts = computeToolbarOpts.value;
|
|
537
|
-
return (0, import_vue.h)(
|
|
538
|
-
"div",
|
|
539
|
-
{
|
|
540
|
-
class: "vxe-image-preview--btn-wrapper"
|
|
541
|
-
},
|
|
542
|
-
[
|
|
543
|
-
(0, import_vue.h)(
|
|
544
|
-
"div",
|
|
545
|
-
{
|
|
546
|
-
class: "vxe-image-preview--close-wrapper"
|
|
547
|
-
},
|
|
548
|
-
[
|
|
549
|
-
(0, import_vue.h)(
|
|
550
|
-
"div",
|
|
551
|
-
{
|
|
552
|
-
class: "vxe-image-preview--close-btn",
|
|
553
|
-
onClick: handleCloseEvent
|
|
554
|
-
},
|
|
555
|
-
[
|
|
556
|
-
(0, import_vue.h)("i", {
|
|
557
|
-
class: getIcon().IMAGE_PREVIEW_CLOSE
|
|
558
|
-
})
|
|
559
|
-
]
|
|
560
|
-
),
|
|
561
|
-
(0, import_vue.h)("div", {
|
|
562
|
-
class: "vxe-image-preview--close-bg"
|
|
563
|
-
})
|
|
564
|
-
]
|
|
565
|
-
),
|
|
566
|
-
imgList.length > 1 ? (0, import_vue.h)(
|
|
567
|
-
"div",
|
|
568
|
-
{
|
|
569
|
-
class: "vxe-image-preview--previous-btn",
|
|
570
|
-
onClick(evnt) {
|
|
571
|
-
handleChangeEvent(evnt, false);
|
|
668
|
+
"is--pct11": offsetPct11
|
|
572
669
|
}
|
|
573
|
-
},
|
|
574
|
-
[
|
|
575
|
-
(0, import_vue.h)("i", {
|
|
576
|
-
class: getIcon().IMAGE_PREVIEW_PREVIOUS
|
|
577
|
-
})
|
|
578
670
|
]
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
(0, import_vue.h)("i", {
|
|
590
|
-
class: getIcon().IMAGE_PREVIEW_NEXT
|
|
591
|
-
})
|
|
592
|
-
]
|
|
593
|
-
) : renderEmptyElement($xeImagePreview),
|
|
594
|
-
(0, import_vue.h)(
|
|
595
|
-
"div",
|
|
596
|
-
{
|
|
597
|
-
class: "vxe-image-preview--operation-info"
|
|
598
|
-
},
|
|
599
|
-
[
|
|
600
|
-
(0, import_vue.h)(
|
|
601
|
-
"div",
|
|
602
|
-
{
|
|
603
|
-
class: "vxe-image-preview--operation-deg"
|
|
604
|
-
},
|
|
605
|
-
rotateText
|
|
606
|
-
),
|
|
607
|
-
(0, import_vue.h)(
|
|
608
|
-
"div",
|
|
609
|
-
{
|
|
610
|
-
class: "vxe-image-preview--operation-pct"
|
|
611
|
-
},
|
|
612
|
-
scaleText
|
|
613
|
-
)
|
|
614
|
-
]
|
|
615
|
-
),
|
|
616
|
-
(0, import_vue.h)(
|
|
617
|
-
"div",
|
|
618
|
-
{
|
|
619
|
-
class: "vxe-image-preview--operation-wrapper"
|
|
620
|
-
},
|
|
621
|
-
[
|
|
622
|
-
(0, import_vue.h)(
|
|
623
|
-
"div",
|
|
624
|
-
{
|
|
625
|
-
class: "vxe-image-preview--operation-active-count"
|
|
626
|
-
},
|
|
627
|
-
[
|
|
628
|
-
(0, import_vue.h)(
|
|
629
|
-
"span",
|
|
630
|
-
{
|
|
631
|
-
class: "vxe-image-preview--operation-active-current"
|
|
632
|
-
},
|
|
633
|
-
`${(activeIndex || 0) + 1}`
|
|
634
|
-
),
|
|
635
|
-
(0, import_vue.h)(
|
|
636
|
-
"span",
|
|
637
|
-
{
|
|
638
|
-
class: "vxe-image-preview--operation-active-total"
|
|
639
|
-
},
|
|
640
|
-
`/${imgList.length}`
|
|
641
|
-
)
|
|
642
|
-
]
|
|
643
|
-
),
|
|
644
|
-
renderOperationBtn("zoomOut", "IMAGE_PREVIEW_ZOOM_OUT"),
|
|
645
|
-
renderOperationBtn("zoomIn", "IMAGE_PREVIEW_ZOOM_IN"),
|
|
646
|
-
renderOperationBtn("pctFull", "IMAGE_PREVIEW_PCT_FULL"),
|
|
647
|
-
renderOperationBtn("pct11", "IMAGE_PREVIEW_PCT_1_1"),
|
|
648
|
-
renderOperationBtn("rotateLeft", "IMAGE_PREVIEW_ROTATE_LEFT"),
|
|
649
|
-
renderOperationBtn("rotateRight", "IMAGE_PREVIEW_ROTATE_RIGHT"),
|
|
650
|
-
showPrintButton || toolbarOpts.print ? renderOperationBtn("print", "IMAGE_PREVIEW_PRINT") : renderEmptyElement($xeImagePreview),
|
|
651
|
-
showDownloadButton || toolbarOpts.download ? renderOperationBtn("download", "IMAGE_PREVIEW_DOWNLOAD") : renderEmptyElement($xeImagePreview)
|
|
652
|
-
]
|
|
653
|
-
)
|
|
654
|
-
]
|
|
655
|
-
);
|
|
656
|
-
};
|
|
657
|
-
const renderVN = () => {
|
|
658
|
-
const { offsetPct11 } = reactData;
|
|
659
|
-
return (0, import_vue.h)(
|
|
660
|
-
"div",
|
|
661
|
-
{
|
|
662
|
-
ref: refElem,
|
|
663
|
-
class: [
|
|
664
|
-
"vxe-image-preview",
|
|
665
|
-
{
|
|
666
|
-
"is--pct11": offsetPct11
|
|
667
|
-
}
|
|
668
|
-
]
|
|
669
|
-
},
|
|
670
|
-
[renderImgWrapper(), renderBtnWrapper()]
|
|
671
|
+
},
|
|
672
|
+
[renderImgWrapper(), renderBtnWrapper()]
|
|
673
|
+
);
|
|
674
|
+
};
|
|
675
|
+
(0, import_vue.watch)(
|
|
676
|
+
() => props.modelValue,
|
|
677
|
+
(val) => {
|
|
678
|
+
reactData.activeIndex = val;
|
|
679
|
+
resetStyle();
|
|
680
|
+
}
|
|
671
681
|
);
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
globalEvents.off($xeImagePreview, "keydown");
|
|
696
|
-
});
|
|
697
|
-
(0, import_vue.provide)("$xeImagePreview", $xeImagePreview);
|
|
698
|
-
$xeImagePreview.renderVN = renderVN;
|
|
699
|
-
return renderVN;
|
|
700
|
-
}
|
|
701
|
-
});
|
|
682
|
+
(0, import_vue.onMounted)(() => {
|
|
683
|
+
const elem = refElem.value;
|
|
684
|
+
if (elem) {
|
|
685
|
+
elem.addEventListener("wheel", wheelEvent, { passive: false });
|
|
686
|
+
}
|
|
687
|
+
globalEvents.on($xeImagePreview, "keydown", handleGlobalKeydownEvent);
|
|
688
|
+
});
|
|
689
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
690
|
+
const elem = refElem.value;
|
|
691
|
+
if (elem) {
|
|
692
|
+
elem.removeEventListener("wheel", wheelEvent);
|
|
693
|
+
(0, import_dom.removeClass)(elem, "is--move");
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
(0, import_vue.onUnmounted)(() => {
|
|
697
|
+
globalEvents.off($xeImagePreview, "keydown");
|
|
698
|
+
});
|
|
699
|
+
(0, import_vue.provide)("$xeImagePreview", $xeImagePreview);
|
|
700
|
+
$xeImagePreview.renderVN = renderVN;
|
|
701
|
+
return renderVN;
|
|
702
|
+
}
|
|
703
|
+
})
|
|
704
|
+
);
|