@web-utils/component 2.7.20 → 2.7.21
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/chunks/{config.46422d7f.js → config.7dec2bf2.js} +2 -2
- package/dist/chunks/confirmable-mixin.7112b769.js +75 -0
- package/dist/chunks/dataformat.9cc4428a.js +158 -0
- package/dist/chunks/dayjs.b0f2f7d9.js +247 -0
- package/dist/chunks/detail.6619700c.js +29 -0
- package/dist/chunks/dic.9de2fe5a.js +135 -0
- package/dist/chunks/{event.dd6f522d.js → event.fc358074.js} +31 -31
- package/dist/chunks/{form-input-mixin.ff5b58f7.js → form-input-mixin.df413ca8.js} +6 -6
- package/dist/chunks/{form-item-mixin.79f6eaff.js → form-item-mixin.b850e028.js} +18 -18
- package/dist/chunks/{form-pick-mixin.61ad06b2.js → form-pick-mixin.c4e0391b.js} +2 -2
- package/dist/chunks/init.e0133910.js +122 -0
- package/dist/chunks/{input-number-mixin.41a066be.js → input-number-mixin.6849fa63.js} +4 -4
- package/dist/chunks/{mixins.5a78e0db.js → mixins.6a394a6c.js} +4 -4
- package/dist/chunks/{packages.1fc9ccba.js → packages.419bde01.js} +7 -7
- package/dist/chunks/permission.07c49abf.js +16 -0
- package/dist/chunks/slot.a7387ecc.js +27 -0
- package/dist/chunks/{tab-mixin.8c0142e0.js → tab-mixin.51886d91.js} +20 -20
- package/dist/chunks/util.89913643.js +261 -0
- package/dist/chunks/utils.d7f73f8d.js +185 -0
- package/dist/chunks/utils.f44207f4.js +26 -0
- package/dist/chunks/vueComponentNormalizer.bf552d98.js +32 -0
- package/dist/components/address-input/index.js +36 -36
- package/dist/components/address-input/style.css +10 -1
- package/dist/components/affix/index.js +39 -39
- package/dist/components/affix/style.css +4 -1
- package/dist/components/aside-menu/index.js +29 -29
- package/dist/components/aside-menu/style.css +3 -1
- package/dist/components/avatar/index.js +43 -43
- package/dist/components/avatar/style.css +51 -1
- package/dist/components/awesome-button/index.js +28 -28
- package/dist/components/base.css +536 -1
- package/dist/components/capsule-tab/index.js +26 -26
- package/dist/components/capsule-tab/style.css +26 -1
- package/dist/components/card/index.js +49 -49
- package/dist/components/card/style.css +84 -1
- package/dist/components/carousel/index.js +35 -35
- package/dist/components/carousel/style.css +35 -1
- package/dist/components/chat/index.js +203 -203
- package/dist/components/chat/style.css +277 -1
- package/dist/components/chunk-file-uploader/index.js +46 -46
- package/dist/components/chunk-file-uploader/style.css +3 -1
- package/dist/components/chunk-file-uploader-button/index.js +22 -22
- package/dist/components/chunk-file-uploader-button/style.css +16 -1
- package/dist/components/chunk-file-uploader-drop/index.js +27 -27
- package/dist/components/chunk-file-uploader-drop/style.css +11 -1
- package/dist/components/chunk-file-uploader-file/index.js +118 -118
- package/dist/components/chunk-file-uploader-file/style.css +124 -1
- package/dist/components/chunk-file-uploader-files/index.js +27 -27
- package/dist/components/chunk-file-uploader-files/style.css +8 -1
- package/dist/components/chunk-file-uploader-list/index.js +27 -27
- package/dist/components/chunk-file-uploader-list/style.css +8 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +27 -27
- package/dist/components/chunk-file-uploader-un-support/style.css +5 -1
- package/dist/components/code-mirror-editor/index.js +134 -134
- package/dist/components/code-mirror-editor/style.css +11 -1
- package/dist/components/color-picker/index.js +39 -39
- package/dist/components/column/index.js +66 -66
- package/dist/components/column-default/index.js +54 -54
- package/dist/components/column-dynamic/index.js +54 -54
- package/dist/components/column-menu/index.js +128 -128
- package/dist/components/column-slot/index.js +168 -168
- package/dist/components/comment/index.js +33 -33
- package/dist/components/comment/style.css +110 -1
- package/dist/components/confirm-button/index.js +18 -18
- package/dist/components/confirmable/index.js +17 -17
- package/dist/components/context-menu/index.js +89 -89
- package/dist/components/context-menu/style.css +84 -1
- package/dist/components/count-up/index.js +36 -36
- package/dist/components/custom-scrollbar/index.js +45 -45
- package/dist/components/data-box/index.js +41 -41
- package/dist/components/data-box/style.css +52 -1
- package/dist/components/data-card/index.js +38 -38
- package/dist/components/data-card/style.css +35 -1
- package/dist/components/data-cardtext/index.js +33 -33
- package/dist/components/data-cardtext/style.css +30 -1
- package/dist/components/data-display/index.js +37 -37
- package/dist/components/data-display/style.css +31 -1
- package/dist/components/data-icons/index.js +40 -40
- package/dist/components/data-icons/style.css +47 -1
- package/dist/components/data-imgtext/index.js +44 -44
- package/dist/components/data-imgtext/style.css +65 -1
- package/dist/components/data-operatext/index.js +44 -44
- package/dist/components/data-operatext/style.css +72 -1
- package/dist/components/data-panel/index.js +38 -38
- package/dist/components/data-panel/style.css +31 -1
- package/dist/components/data-pay/index.js +60 -60
- package/dist/components/data-pay/style.css +96 -1
- package/dist/components/data-price/index.js +38 -38
- package/dist/components/data-price/style.css +75 -1
- package/dist/components/data-progress/index.js +39 -39
- package/dist/components/data-progress/style.css +24 -1
- package/dist/components/data-rotate/index.js +39 -39
- package/dist/components/data-rotate/style.css +44 -1
- package/dist/components/data-table-picker/index.js +151 -53
- package/dist/components/data-tabs/index.js +39 -39
- package/dist/components/data-tabs/style.css +64 -1
- package/dist/components/dialog-column/index.js +50 -50
- package/dist/components/dialog-excel/index.js +68 -68
- package/dist/components/dialog-filter/index.js +84 -84
- package/dist/components/dialog-form/index.js +89 -89
- package/dist/components/dialog-form/style.css +5 -0
- package/dist/components/dynamic-table/index.js +71 -71
- package/dist/components/dynamic-table/style.css +24 -1
- package/dist/components/e-charts/index.js +95 -94
- package/dist/components/e-charts/style.css +4 -1
- package/dist/components/easy-popup/index.js +87 -0
- package/dist/components/easy-popup/style.css +12 -0
- package/dist/components/editable-progress/index.js +48 -48
- package/dist/components/editable-progress/style.css +33 -1
- package/dist/components/editable-tree/index.js +587 -287
- package/dist/components/editable-tree/style.css +79 -1
- package/dist/components/egd-collapse/index.js +29 -29
- package/dist/components/egd-collapse-item/index.js +51 -51
- package/dist/components/element-dialog/index.js +74 -65
- package/dist/components/element-dialog/style.css +82 -1
- package/dist/components/empty-view/index.js +26 -26
- package/dist/components/empty-view/style.css +11 -1
- package/dist/components/error-view/index.js +25 -25
- package/dist/components/error-view/style.css +11 -1
- package/dist/components/flex-column/index.js +19 -19
- package/dist/components/flex-item/index.js +20 -20
- package/dist/components/flex-row/index.js +19 -19
- package/dist/components/flex-scroller/index.js +24 -24
- package/dist/components/flex-scroller/style.css +14 -1
- package/dist/components/flow/index.js +100 -100
- package/dist/components/flow/style.css +38 -1
- package/dist/components/flow-node/index.js +37 -37
- package/dist/components/flow-viewer/index.js +135 -0
- package/dist/components/flow-viewer/style.css +13 -0
- package/dist/components/form-button/index.js +32 -32
- package/dist/components/form-cascader/index.js +62 -61
- package/dist/components/form-checkbox-group/index.js +61 -61
- package/dist/components/form-checkbox-group/style.css +45 -1
- package/dist/components/form-date-picker/index.js +57 -57
- package/dist/components/form-group/index.js +38 -38
- package/dist/components/form-group/style.css +76 -1
- package/dist/components/form-holder/index.js +30 -30
- package/dist/components/form-input/index.js +50 -50
- package/dist/components/form-input-email/index.js +44 -44
- package/dist/components/form-input-id-card/index.js +49 -49
- package/dist/components/form-input-number/index.js +49 -49
- package/dist/components/form-input-number/style.css +6 -1
- package/dist/components/form-input-phone-number/index.js +45 -45
- package/dist/components/form-input-time/index.js +48 -48
- package/dist/components/form-item/index.js +73 -73
- package/dist/components/form-item/style.css +5 -1
- package/dist/components/form-item-config-provider/index.js +19 -19
- package/dist/components/form-item-group/index.js +65 -65
- package/dist/components/form-item-group/style.css +25 -1
- package/dist/components/form-radio-group/index.js +61 -61
- package/dist/components/form-radio-group/style.css +47 -1
- package/dist/components/form-select/index.js +52 -52
- package/dist/components/form-switch/index.js +45 -45
- package/dist/components/form-temp/index.js +50 -50
- package/dist/components/form-textarea/index.js +44 -44
- package/dist/components/form-view/index.js +143 -142
- package/dist/components/form-view/style.css +155 -1
- package/dist/components/fy-array/index.js +64 -64
- package/dist/components/fy-array/style.css +12 -1
- package/dist/components/fy-article/index.js +34 -34
- package/dist/components/fy-article/style.css +56 -1
- package/dist/components/fy-cascader/index.js +52 -52
- package/dist/components/fy-checkbox/index.js +52 -52
- package/dist/components/fy-checkbox/style.css +9 -1
- package/dist/components/fy-code/index.js +30 -30
- package/dist/components/fy-curd/index.js +317 -317
- package/dist/components/fy-curd/style.css +236 -1
- package/dist/components/fy-date/index.js +45 -45
- package/dist/components/fy-date/style.css +15 -1
- package/dist/components/fy-dialog-form/index.js +115 -115
- package/dist/components/fy-draggable/index.js +120 -120
- package/dist/components/fy-draggable/style.css +136 -1
- package/dist/components/fy-dynamic/index.js +126 -126
- package/dist/components/fy-dynamic/style.css +29 -1
- package/dist/components/fy-empty/index.js +26 -26
- package/dist/components/fy-empty/style.css +18 -1
- package/dist/components/fy-form/index.js +365 -365
- package/dist/components/fy-form/style.css +73 -1
- package/dist/components/fy-form-design/index.js +6906 -433
- package/dist/components/fy-form-design/style.css +560 -1
- package/dist/components/fy-form-menu/index.js +45 -45
- package/dist/components/fy-input/index.js +61 -61
- package/dist/components/fy-input-color/index.js +41 -41
- package/dist/components/fy-input-icon/index.js +70 -70
- package/dist/components/fy-input-icon/style.css +33 -1
- package/dist/components/fy-input-map/index.js +102 -102
- package/dist/components/fy-input-map/style.css +44 -1
- package/dist/components/fy-input-number/index.js +39 -39
- package/dist/components/fy-input-table/index.js +70 -70
- package/dist/components/fy-input-table/style.css +4 -1
- package/dist/components/fy-input-tree/index.js +105 -105
- package/dist/components/fy-input-tree/style.css +19 -1
- package/dist/components/fy-progress/index.js +25 -25
- package/dist/components/fy-radio/index.js +36 -36
- package/dist/components/fy-radio/style.css +6 -1
- package/dist/components/fy-rate/index.js +40 -40
- package/dist/components/fy-rate/style.css +3 -1
- package/dist/components/fy-select/index.js +101 -101
- package/dist/components/fy-select/style.css +19 -1
- package/dist/components/fy-slider/index.js +42 -42
- package/dist/components/fy-switch/index.js +37 -37
- package/dist/components/fy-tabs/index.js +35 -35
- package/dist/components/fy-time/index.js +47 -47
- package/dist/components/fy-title/index.js +23 -23
- package/dist/components/fy-title/style.css +5 -1
- package/dist/components/fy-tree/index.js +157 -157
- package/dist/components/fy-tree/style.css +39 -1
- package/dist/components/fy-u-editor/index.js +99 -99
- package/dist/components/fy-u-editor/style.css +9 -1
- package/dist/components/fy-upload/index.js +270 -270
- package/dist/components/fy-upload/style.css +55 -1
- package/dist/components/guide-steps/index.js +41 -41
- package/dist/components/guide-steps/style.css +28 -1
- package/dist/components/header-menu/index.js +94 -94
- package/dist/components/header-search/index.js +121 -121
- package/dist/components/highlight-j-s/index.js +76 -0
- package/dist/components/highlight-j-s/style.css +18 -0
- package/dist/components/icon-card/index.js +28 -28
- package/dist/components/icon-card/style.css +50 -1
- package/dist/components/icon-temp/index.js +24 -24
- package/dist/components/icon-temp/style.css +17 -1
- package/dist/components/iframe-window/index.js +24 -24
- package/dist/components/iframe-window/style.css +14 -1
- package/dist/components/image-cropper/index.js +117 -117
- package/dist/components/image-cropper/style.css +28 -1
- package/dist/components/image-preview/index.js +127 -127
- package/dist/components/image-preview/style.css +66 -1
- package/dist/components/image-viewer/index.js +35 -35
- package/dist/components/image-viewer/style.css +15 -1
- package/dist/components/input-number/index.js +116 -116
- package/dist/components/input-number/style.css +9 -1
- package/dist/components/input-number-range/index.js +37 -37
- package/dist/components/input-number-range/style.css +6 -1
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +71 -71
- package/dist/components/keyboard/index.js +182 -182
- package/dist/components/keyboard/style.css +473 -1
- package/dist/components/license/index.js +54 -54
- package/dist/components/loading-view/index.js +25 -25
- package/dist/components/loading-view/style.css +11 -1
- package/dist/components/login/index.js +94 -94
- package/dist/components/login/style.css +19 -1
- package/dist/components/name-avatar/index.js +26 -26
- package/dist/components/name-avatar/style.css +30 -1
- package/dist/components/nav-bar/index.js +22 -22
- package/dist/components/nav-bar/style.css +11 -1
- package/dist/components/not-implement/index.js +22 -22
- package/dist/components/not-implement/style.css +9 -1
- package/dist/components/notice/index.js +55 -55
- package/dist/components/notice/style.css +48 -1
- package/dist/components/page/index.js +20 -20
- package/dist/components/page/style.css +6 -1
- package/dist/components/page-header/index.js +28 -28
- package/dist/components/page-header/style.css +8 -1
- package/dist/components/page-index/index.js +57 -57
- package/dist/components/page-index/style.css +17 -1
- package/dist/components/page-index-top/index.js +46 -46
- package/dist/components/page-skeleton/index.js +28 -28
- package/dist/components/page-skeleton/style.css +17 -1
- package/dist/components/page-skeleton-new/index.js +38 -38
- package/dist/components/page-skeleton-new/style.css +36 -1
- package/dist/components/pageable-table/index.js +140 -139
- package/dist/components/pageable-table/style.css +66 -1
- package/dist/components/pageable-view/index.js +103 -102
- package/dist/components/pageable-view/style.css +63 -1
- package/dist/components/photo-swipe/index.js +64 -64
- package/dist/components/process-designer/index.js +4638 -0
- package/dist/components/process-designer/style.css +1648 -0
- package/dist/components/properties-panel/index.js +4765 -0
- package/dist/components/properties-panel/style.css +106 -0
- package/dist/components/queue/index.js +24 -24
- package/dist/components/record-video/index.js +55 -55
- package/dist/components/record-video/style.css +47 -1
- package/dist/components/resize-observer/index.js +26 -26
- package/dist/components/resize-observer/style.css +25 -1
- package/dist/components/search/index.js +64 -64
- package/dist/components/search/style.css +51 -1
- package/dist/components/search-popover/index.js +98 -98
- package/dist/components/search-popover/style.css +90 -1
- package/dist/components/sign/index.js +66 -66
- package/dist/components/sign/style.css +6 -1
- package/dist/components/sign-panel/index.js +78 -78
- package/dist/components/sign-panel/style.css +91 -1
- package/dist/components/skeleton/index.js +35 -35
- package/dist/components/skeleton/style.css +55 -1
- package/dist/components/split-pane/index.js +88 -88
- package/dist/components/split-pane/style.css +98 -1
- package/dist/components/stateful/index.js +29 -29
- package/dist/components/stateful/style.css +27 -1
- package/dist/components/static-pageable-table/index.js +30 -30
- package/dist/components/static-pageable-table/style.css +3 -1
- package/dist/components/swiper/index.js +69 -69
- package/dist/components/swiper/style.css +37 -1
- package/dist/components/tab/index.js +47 -47
- package/dist/components/tab/style.css +108 -1
- package/dist/components/tab-item/index.js +29 -29
- package/dist/components/table-column/index.js +25 -25
- package/dist/components/table-page/index.js +51 -51
- package/dist/components/table-view/index.js +123 -122
- package/dist/components/table-view/style.css +90 -1
- package/dist/components/tag-render/index.js +39 -39
- package/dist/components/tag-render/style.css +27 -1
- package/dist/components/text-ellipsis/index.js +40 -40
- package/dist/components/text-ellipsis/style.css +3 -1
- package/dist/components/tinymce-editor/index.js +62 -62
- package/dist/components/tinymce-editor/style.css +37 -1
- package/dist/components/tinymce-wrapper/index.js +76 -76
- package/dist/components/tinymce-wrapper/style.css +30 -1
- package/dist/components/toolbar/index.js +51 -51
- package/dist/components/toolbar/style.css +35 -1
- package/dist/components/toolbar-button/index.js +33 -33
- package/dist/components/toolbar-button/style.css +15 -1
- package/dist/components/trigger/index.js +27 -27
- package/dist/components/verify/index.js +33 -33
- package/dist/components/verify/style.css +9 -1
- package/dist/components/vue-tags-input/index.js +137 -137
- package/dist/components/vue-tags-input/style.css +102 -1
- package/dist/components/watermark/index.js +25 -25
- package/dist/components/watermark/style.css +10 -1
- package/dist/index.css +1797 -0
- package/dist/index.es.js +22766 -12431
- package/package.json +18 -6
- package/web-types.json +307 -1
- package/dist/chunks/AfdColumn.vue_vue_type_template_lang.768f2ed2.js +0 -302
- package/dist/chunks/ConfigArray.vue_vue_type_template_lang.66483daa.js +0 -51
- package/dist/chunks/ConfigColor.vue_vue_type_template_lang.cd880091.js +0 -24
- package/dist/chunks/ConfigCustom.vue_vue_type_template_lang.6e03d7fd.js +0 -52
- package/dist/chunks/ConfigDate.vue_vue_type_template_lang.116fbad4.js +0 -104
- package/dist/chunks/ConfigDynamic.vue_vue_type_template_lang.99082e47.js +0 -133
- package/dist/chunks/ConfigEvent.vue_vue_type_template_lang.5e8ed6cc.js +0 -96
- package/dist/chunks/ConfigGroup.vue_vue_type_template_lang.44117322.js +0 -48
- package/dist/chunks/ConfigInput.vue_vue_type_template_lang.cc1eb052.js +0 -96
- package/dist/chunks/ConfigMap.vue_vue_type_template_lang.daee4d38.js +0 -31
- package/dist/chunks/ConfigNumber.vue_vue_type_template_lang.d60231d7.js +0 -130
- package/dist/chunks/ConfigRate.vue_vue_type_style_index_0_scoped_true_lang.cf5d437d.js +0 -125
- package/dist/chunks/ConfigSelect.vue_vue_type_template_lang.dfc91f07.js +0 -488
- package/dist/chunks/ConfigSlider.vue_vue_type_template_lang.27b8cc7b.js +0 -99
- package/dist/chunks/ConfigSwitch.vue_vue_type_style_index_0_scoped_true_lang.4caf1bd0.js +0 -54
- package/dist/chunks/ConfigTable.vue_vue_type_template_lang.b27540fd.js +0 -344
- package/dist/chunks/ConfigTextarea.vue_vue_type_template_lang.5cddf41c.js +0 -88
- package/dist/chunks/ConfigTitle.vue_vue_type_template_lang.57d9deb5.js +0 -87
- package/dist/chunks/ConfigTree.vue_vue_type_style_index_0_scoped_true_lang.89ec5376.js +0 -465
- package/dist/chunks/ConfigUEditor.vue_vue_type_template_lang.9726b4f5.js +0 -240
- package/dist/chunks/ConfigUpload.vue_vue_type_template_lang.129c0ced.js +0 -476
- package/dist/chunks/FormConfig.vue_vue_type_template_lang.82463ce5.js +0 -220
- package/dist/chunks/WidgetConfig.vue_vue_type_template_lang.3cc74fe8.js +0 -1821
- package/dist/chunks/WidgetForm.vue_vue_type_template_lang.d4b05679.js +0 -247
- package/dist/chunks/WidgetFormGroup.vue_vue_type_template_lang.bdcb6d37.js +0 -271
- package/dist/chunks/WidgetFormItem.vue_vue_type_template_lang.48d55a5c.js +0 -24
- package/dist/chunks/WidgetFormTable.vue_vue_type_template_lang.e2b788ba.js +0 -229
- package/dist/chunks/confirmable-mixin.3a79781b.js +0 -75
- package/dist/chunks/dataformat.65b92bfe.js +0 -158
- package/dist/chunks/detail.d67573b1.js +0 -28
- package/dist/chunks/dic.70feb9b4.js +0 -135
- package/dist/chunks/init.7c58eb34.js +0 -122
- package/dist/chunks/monaco.cefcb9f5.js +0 -290
- package/dist/chunks/permission.ce5d2121.js +0 -16
- package/dist/chunks/slot.4b391395.js +0 -27
- package/dist/chunks/util.23fe58fb.js +0 -261
- package/dist/chunks/utils.97652d86.js +0 -26
- package/dist/chunks/utils.fa73de78.js +0 -185
- package/dist/chunks/vueComponentNormalizer.71e2aa87.js +0 -32
- package/dist/components/afd-column/index.js +0 -57
- package/dist/components/config-array/index.js +0 -28
- package/dist/components/config-color/index.js +0 -28
- package/dist/components/config-custom/index.js +0 -62
- package/dist/components/config-date/index.js +0 -28
- package/dist/components/config-dynamic/index.js +0 -28
- package/dist/components/config-event/index.js +0 -74
- package/dist/components/config-group/index.js +0 -36
- package/dist/components/config-input/index.js +0 -29
- package/dist/components/config-map/index.js +0 -28
- package/dist/components/config-number/index.js +0 -28
- package/dist/components/config-rate/index.js +0 -71
- package/dist/components/config-rate/style.css +0 -1
- package/dist/components/config-select/index.js +0 -90
- package/dist/components/config-slider/index.js +0 -28
- package/dist/components/config-switch/index.js +0 -33
- package/dist/components/config-switch/style.css +0 -1
- package/dist/components/config-table/index.js +0 -122
- package/dist/components/config-textarea/index.js +0 -28
- package/dist/components/config-title/index.js +0 -33
- package/dist/components/config-tree/index.js +0 -122
- package/dist/components/config-tree/style.css +0 -1
- package/dist/components/config-u-editor/index.js +0 -34
- package/dist/components/config-upload/index.js +0 -58
- package/dist/components/form-config/index.js +0 -28
- package/dist/components/fy-dialog-form/style.css +0 -1
- package/dist/components/widget-config/index.js +0 -110
- package/dist/components/widget-form/index.js +0 -71
- package/dist/components/widget-form-group/index.js +0 -96
- package/dist/components/widget-form-item/index.js +0 -71
- package/dist/components/widget-form-table/index.js +0 -95
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import {
|
|
3
|
-
import { p as
|
|
4
|
-
import { isBlank
|
|
5
|
-
import { n as
|
|
6
|
-
let
|
|
7
|
-
const
|
|
1
|
+
import { p as props, e as event } from "../../chunks/event.fc358074.js";
|
|
2
|
+
import { z as dataURLtoFile, i as isMediaType, g as getAsVal } from "../../chunks/util.89913643.js";
|
|
3
|
+
import { p as packages } from "../../chunks/packages.419bde01.js";
|
|
4
|
+
import { isBlank } from "@web-utils/core";
|
|
5
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.bf552d98.js";
|
|
6
|
+
let canvas, ctx;
|
|
7
|
+
const configDefault = {
|
|
8
8
|
width: 200,
|
|
9
9
|
height: 200
|
|
10
|
-
},
|
|
10
|
+
}, config = {
|
|
11
11
|
text: "avueJS",
|
|
12
12
|
// 文字
|
|
13
13
|
fontFamily: "microsoft yahei",
|
|
@@ -25,92 +25,92 @@ const S = {
|
|
|
25
25
|
ratio: 1
|
|
26
26
|
// 压缩比
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
e
|
|
28
|
+
function fileToBase64(file, callback) {
|
|
29
|
+
const reader = new FileReader();
|
|
30
|
+
reader.readAsDataURL(file), reader.onload = function(e) {
|
|
31
|
+
callback(e.target.result);
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const { text
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
34
|
+
function detailImg(file, option = {}, callback) {
|
|
35
|
+
const { text, fontFamily, color, fontSize, opacity, bottom, right, ratio } = option;
|
|
36
|
+
initParams(), fileToBase64(file, initImg);
|
|
37
|
+
function initParams() {
|
|
38
|
+
config.text = text || config.text, config.fontFamily = fontFamily || config.fontFamily, config.color = color || config.color, config.fontSize = fontSize || config.fontSize, config.opacity = opacity || config.opacity, config.bottom = bottom || config.bottom, config.right = right || config.right, config.ratio = ratio || config.ratio;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
40
|
+
function initImg(data) {
|
|
41
|
+
const img = new Image();
|
|
42
|
+
img.src = data, img.onload = function() {
|
|
43
|
+
const width = img.width, height = img.height;
|
|
44
|
+
cretedCanvas(width, height), ctx.drawImage(img, 0, 0, width, height), setText(width, height);
|
|
45
|
+
const base64 = document.getElementById("canvas").toDataURL(file.type, config.ratio), result = dataURLtoFile(base64, file.name);
|
|
46
|
+
callback && callback(result);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
49
|
+
function cretedCanvas(width, height) {
|
|
50
|
+
canvas = document.getElementById("canvas"), canvas === null && (canvas = document.createElement("canvas"), canvas.id = "canvas", canvas.className = "avue-canvas", document.body.appendChild(canvas)), ctx = canvas.getContext("2d"), canvas.width = width, canvas.height = height;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
|
|
52
|
+
function setText(width, height) {
|
|
53
|
+
const txt = config.text, param = calcParam(txt, width, height);
|
|
54
|
+
ctx.font = `${param.fontSize}px ${config.fontFamily}`, ctx.fillStyle = config.color, ctx.globalAlpha = config.opacity / 100, ctx.fillText(txt, param.x, param.y);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
let
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
return
|
|
64
|
-
x
|
|
65
|
-
y
|
|
66
|
-
fontSize:
|
|
56
|
+
function calcParam(txt, width, height) {
|
|
57
|
+
let x, y;
|
|
58
|
+
const fontSize2 = config.fontSize / configDefault.width * width;
|
|
59
|
+
config.bottom ? y = configDefault.height - config.bottom : y = config.top, config.right ? x = configDefault.width - config.right : x = config.left, ctx.font = `${config.fontSize}px ${config.fontFamily}`;
|
|
60
|
+
const txtWidth = Number(ctx.measureText(txt).width);
|
|
61
|
+
x = x - txtWidth;
|
|
62
|
+
const calcPosX = x / configDefault.width, calcPosY = y / configDefault.height;
|
|
63
|
+
return x = calcPosX * width, y = calcPosY * height, {
|
|
64
|
+
x,
|
|
65
|
+
y,
|
|
66
|
+
fontSize: fontSize2
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
window.__ENV__ === "development" && console && console.log("put_policy = ",
|
|
73
|
-
const
|
|
74
|
-
window.__ENV__ === "development" && console && console.log("encoded = ",
|
|
75
|
-
const
|
|
76
|
-
window.__ENV__ === "development" && console && console.log("encoded_signed=",
|
|
77
|
-
const
|
|
78
|
-
return window.__ENV__ === "development" && console && console.log("upload_token=",
|
|
70
|
+
const getToken = (accessKey, secretKey, putPolicy) => {
|
|
71
|
+
const put_policy = JSON.stringify(putPolicy);
|
|
72
|
+
window.__ENV__ === "development" && console && console.log("put_policy = ", put_policy);
|
|
73
|
+
const encoded = base64encode(utf16to8(put_policy));
|
|
74
|
+
window.__ENV__ === "development" && console && console.log("encoded = ", encoded);
|
|
75
|
+
const encoded_signed = CryptoJS.HmacSHA1(encoded, secretKey).toString(CryptoJS.enc.Base64);
|
|
76
|
+
window.__ENV__ === "development" && console && console.log("encoded_signed=", encoded_signed);
|
|
77
|
+
const upload_token = `${accessKey}:${safe64(encoded_signed)}:${encoded}`;
|
|
78
|
+
return window.__ENV__ === "development" && console && console.log("upload_token=", upload_token), upload_token;
|
|
79
79
|
};
|
|
80
|
-
function
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
for (i = 0; i <
|
|
85
|
-
|
|
86
|
-
return
|
|
80
|
+
function utf16to8(str) {
|
|
81
|
+
let out, i, c;
|
|
82
|
+
out = "";
|
|
83
|
+
const len = str.length;
|
|
84
|
+
for (i = 0; i < len; i++)
|
|
85
|
+
c = str.charCodeAt(i), c >= 1 && c <= 127 ? out += str.charAt(i) : c > 2047 ? (out += String.fromCharCode(224 | c >> 12 & 15), out += String.fromCharCode(128 | c >> 6 & 63), out += String.fromCharCode(128 | c >> 0 & 63)) : (out += String.fromCharCode(192 | c >> 6 & 31), out += String.fromCharCode(128 | c >> 0 & 63));
|
|
86
|
+
return out;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
function
|
|
90
|
-
let
|
|
91
|
-
for (
|
|
92
|
-
if (
|
|
93
|
-
|
|
88
|
+
const base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
89
|
+
function base64encode(str) {
|
|
90
|
+
let out, i, len, c1, c2, c3;
|
|
91
|
+
for (len = str.length, i = 0, out = ""; i < len; ) {
|
|
92
|
+
if (c1 = str.charCodeAt(i++) & 255, i == len) {
|
|
93
|
+
out += base64EncodeChars.charAt(c1 >> 2), out += base64EncodeChars.charAt((c1 & 3) << 4), out += "==";
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
if (
|
|
97
|
-
|
|
96
|
+
if (c2 = str.charCodeAt(i++), i == len) {
|
|
97
|
+
out += base64EncodeChars.charAt(c1 >> 2), out += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4), out += base64EncodeChars.charAt((c2 & 15) << 2), out += "=";
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
c3 = str.charCodeAt(i++), out += base64EncodeChars.charAt(c1 >> 2), out += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4), out += base64EncodeChars.charAt((c2 & 15) << 2 | (c3 & 192) >> 6), out += base64EncodeChars.charAt(c3 & 63);
|
|
101
101
|
}
|
|
102
|
-
return
|
|
102
|
+
return out;
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
return
|
|
106
|
-
},
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
return
|
|
104
|
+
const safe64 = function(base64) {
|
|
105
|
+
return base64 = base64.replace(/\+/g, "-"), base64 = base64.replace(/\//g, "_"), base64;
|
|
106
|
+
}, getClient = (params) => new OSS(params);
|
|
107
|
+
var render = function() {
|
|
108
|
+
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
109
|
+
return _c("div", {
|
|
110
110
|
directives: [{
|
|
111
111
|
name: "loading",
|
|
112
112
|
rawName: "v-loading.lock",
|
|
113
|
-
value:
|
|
113
|
+
value: _vm.loading,
|
|
114
114
|
expression: "loading",
|
|
115
115
|
modifiers: {
|
|
116
116
|
lock: !0
|
|
@@ -118,198 +118,198 @@ var Q = function() {
|
|
|
118
118
|
}],
|
|
119
119
|
staticClass: "avue-upload",
|
|
120
120
|
attrs: {
|
|
121
|
-
"element-loading-text":
|
|
121
|
+
"element-loading-text": _vm.loadText
|
|
122
122
|
}
|
|
123
|
-
}, [
|
|
124
|
-
key:
|
|
123
|
+
}, [_c("ElUpload", {
|
|
124
|
+
key: _vm.reload,
|
|
125
125
|
class: {
|
|
126
|
-
"avue-upload--list":
|
|
127
|
-
"avue-upload--upload":
|
|
126
|
+
"avue-upload--list": _vm.listType === "picture-img",
|
|
127
|
+
"avue-upload--upload": _vm.disabled
|
|
128
128
|
},
|
|
129
129
|
attrs: {
|
|
130
|
-
action:
|
|
131
|
-
"on-remove":
|
|
132
|
-
accept:
|
|
133
|
-
"before-remove":
|
|
134
|
-
multiple:
|
|
135
|
-
"on-preview":
|
|
136
|
-
limit:
|
|
137
|
-
"http-request":
|
|
138
|
-
readonly:
|
|
139
|
-
drag:
|
|
140
|
-
"show-file-list":
|
|
141
|
-
"list-type":
|
|
142
|
-
"on-change":
|
|
143
|
-
"on-exceed":
|
|
144
|
-
disabled:
|
|
145
|
-
"file-list":
|
|
130
|
+
action: _vm.action,
|
|
131
|
+
"on-remove": _vm.handleRemove,
|
|
132
|
+
accept: _vm.acceptList,
|
|
133
|
+
"before-remove": _vm.beforeRemove,
|
|
134
|
+
multiple: _vm.multiple,
|
|
135
|
+
"on-preview": _vm.handlePreview,
|
|
136
|
+
limit: _vm.limit,
|
|
137
|
+
"http-request": _vm.httpUpload,
|
|
138
|
+
readonly: _vm.readonly,
|
|
139
|
+
drag: _vm.dragFile,
|
|
140
|
+
"show-file-list": _vm.isPictureImg ? !1 : _vm.showFileList,
|
|
141
|
+
"list-type": _vm.listType,
|
|
142
|
+
"on-change": _vm.handleFileChange,
|
|
143
|
+
"on-exceed": _vm.handleExceed,
|
|
144
|
+
disabled: _vm.disabled,
|
|
145
|
+
"file-list": _vm.fileList
|
|
146
146
|
},
|
|
147
147
|
nativeOn: {
|
|
148
|
-
click: function(
|
|
149
|
-
return
|
|
148
|
+
click: function($event) {
|
|
149
|
+
return _vm.handleClick.apply(null, arguments);
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
|
-
scopedSlots:
|
|
152
|
+
scopedSlots: _vm._u([{
|
|
153
153
|
key: "tip",
|
|
154
154
|
fn: function() {
|
|
155
|
-
return [
|
|
155
|
+
return [_c("div", {
|
|
156
156
|
staticClass: "el-upload__tip",
|
|
157
157
|
domProps: {
|
|
158
|
-
innerHTML:
|
|
158
|
+
innerHTML: _vm._s(_vm.tip)
|
|
159
159
|
}
|
|
160
160
|
})];
|
|
161
161
|
},
|
|
162
162
|
proxy: !0
|
|
163
163
|
}, {
|
|
164
164
|
key: "file",
|
|
165
|
-
fn: function(
|
|
166
|
-
var
|
|
167
|
-
return [
|
|
168
|
-
file
|
|
169
|
-
}) :
|
|
165
|
+
fn: function(_ref) {
|
|
166
|
+
var file = _ref.file;
|
|
167
|
+
return [_vm.$scopedSlots.default ? _vm._t("default", null, {
|
|
168
|
+
file
|
|
169
|
+
}) : _vm.listType === "picture-card" ? _c("span", [_vm.isMediaType(file.url) ? _c(file.type, {
|
|
170
170
|
tag: "Component",
|
|
171
171
|
staticClass: "el-upload-list__item-thumbnail",
|
|
172
172
|
attrs: {
|
|
173
|
-
src:
|
|
173
|
+
src: file.url
|
|
174
174
|
}
|
|
175
|
-
}) :
|
|
175
|
+
}) : _c("i", {
|
|
176
176
|
staticClass: "avue-upload__avatar el-icon-document"
|
|
177
|
-
}),
|
|
177
|
+
}), _c("span", {
|
|
178
178
|
staticClass: "el-upload-list__item-actions"
|
|
179
|
-
}, [
|
|
179
|
+
}, [_c("span", {
|
|
180
180
|
staticClass: "el-upload-list__item-preview"
|
|
181
|
-
}, [
|
|
181
|
+
}, [_c("i", {
|
|
182
182
|
staticClass: "el-icon-zoom-in",
|
|
183
183
|
on: {
|
|
184
|
-
click: function(
|
|
185
|
-
return
|
|
184
|
+
click: function($event) {
|
|
185
|
+
return $event.stopPropagation(), _vm.handlePreview(file);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
})]),
|
|
188
|
+
})]), _c("span", {
|
|
189
189
|
staticClass: "el-upload-list__item-delete"
|
|
190
|
-
}, [
|
|
190
|
+
}, [_vm.disabled ? _vm._e() : _c("i", {
|
|
191
191
|
staticClass: "el-icon-delete",
|
|
192
192
|
on: {
|
|
193
|
-
click: function(
|
|
194
|
-
return
|
|
193
|
+
click: function($event) {
|
|
194
|
+
return $event.stopPropagation(), _vm.handleRemove(file);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
})])])], 1) :
|
|
197
|
+
})])])], 1) : _vm.listType === "picture" ? _c("span", {
|
|
198
198
|
on: {
|
|
199
|
-
click: function(
|
|
200
|
-
return
|
|
199
|
+
click: function($event) {
|
|
200
|
+
return $event.stopPropagation(), _vm.handlePreview(file);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
}, [
|
|
203
|
+
}, [_c(file.type, {
|
|
204
204
|
tag: "Component",
|
|
205
205
|
staticClass: "el-upload-list__item-thumbnail",
|
|
206
206
|
attrs: {
|
|
207
|
-
src:
|
|
207
|
+
src: file.url
|
|
208
208
|
}
|
|
209
|
-
}),
|
|
209
|
+
}), _c("a", {
|
|
210
210
|
staticClass: "el-upload-list__item-name"
|
|
211
|
-
}, [
|
|
211
|
+
}, [_c("i", {
|
|
212
212
|
staticClass: "el-icon-document"
|
|
213
|
-
}),
|
|
213
|
+
}), _vm._v(" " + _vm._s(file.name) + " ")]), _c("i", {
|
|
214
214
|
staticClass: "el-icon-close",
|
|
215
215
|
on: {
|
|
216
|
-
click: function(
|
|
217
|
-
return
|
|
216
|
+
click: function($event) {
|
|
217
|
+
return $event.stopPropagation(), _vm.handleRemove(file);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
})], 1) :
|
|
220
|
+
})], 1) : _c("span", {
|
|
221
221
|
on: {
|
|
222
|
-
click: function(
|
|
223
|
-
return
|
|
222
|
+
click: function($event) {
|
|
223
|
+
return $event.stopPropagation(), _vm.handlePreview(file);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
}, [
|
|
226
|
+
}, [_c("a", {
|
|
227
227
|
staticClass: "el-upload-list__item-name"
|
|
228
|
-
}, [
|
|
228
|
+
}, [_c("i", {
|
|
229
229
|
staticClass: "el-icon-document"
|
|
230
|
-
}),
|
|
230
|
+
}), _vm._v(" " + _vm._s(file.name) + " ")]), _vm.disabled ? _vm._e() : _c("i", {
|
|
231
231
|
staticClass: "el-icon-close",
|
|
232
232
|
on: {
|
|
233
|
-
click: function(
|
|
234
|
-
return
|
|
233
|
+
click: function($event) {
|
|
234
|
+
return $event.stopPropagation(), _vm.handleRemove(file);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
})])];
|
|
238
238
|
}
|
|
239
239
|
}], null, !0)
|
|
240
|
-
}, [
|
|
240
|
+
}, [_vm.listType === "picture-card" ? [_c("i", {
|
|
241
241
|
staticClass: "el-icon-plus"
|
|
242
|
-
})] :
|
|
242
|
+
})] : _vm.listType === "picture-img" ? [_vm.$scopedSlots.default ? _vm._t("default", null, {
|
|
243
243
|
file: {
|
|
244
|
-
url:
|
|
244
|
+
url: _vm.imgUrl
|
|
245
245
|
}
|
|
246
|
-
}) : [
|
|
246
|
+
}) : [_vm.isMediaType(_vm.imgUrl) ? _c(_vm.isMediaType(_vm.imgUrl), {
|
|
247
247
|
tag: "Component",
|
|
248
248
|
staticClass: "avue-upload__avatar",
|
|
249
249
|
attrs: {
|
|
250
|
-
src:
|
|
250
|
+
src: _vm.imgUrl
|
|
251
251
|
},
|
|
252
252
|
on: {
|
|
253
|
-
mouseover: function(
|
|
254
|
-
|
|
253
|
+
mouseover: function($event) {
|
|
254
|
+
_vm.menu = !0;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
}) :
|
|
257
|
+
}) : _vm.imgUrl ? _c("i", {
|
|
258
258
|
staticClass: "avue-upload__avatar el-icon-document",
|
|
259
259
|
on: {
|
|
260
|
-
mouseover: function(
|
|
261
|
-
|
|
260
|
+
mouseover: function($event) {
|
|
261
|
+
_vm.menu = !0;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
}) :
|
|
264
|
+
}) : _c("i", {
|
|
265
265
|
staticClass: "el-icon-plus avue-upload__avatar"
|
|
266
|
-
}),
|
|
266
|
+
}), _vm.menu ? _c("div", {
|
|
267
267
|
staticClass: "el-upload-list__item-actions avue-upload__menu",
|
|
268
268
|
on: {
|
|
269
|
-
mouseover: function(
|
|
270
|
-
|
|
269
|
+
mouseover: function($event) {
|
|
270
|
+
_vm.menu = !0;
|
|
271
271
|
},
|
|
272
|
-
mouseout: function(
|
|
273
|
-
|
|
272
|
+
mouseout: function($event) {
|
|
273
|
+
_vm.menu = !1;
|
|
274
274
|
},
|
|
275
|
-
click: function(
|
|
276
|
-
|
|
275
|
+
click: function($event) {
|
|
276
|
+
$event.stopPropagation();
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
}, [
|
|
279
|
+
}, [_c("i", {
|
|
280
280
|
staticClass: "el-icon-zoom-in",
|
|
281
281
|
on: {
|
|
282
|
-
click: function(
|
|
283
|
-
return
|
|
284
|
-
url:
|
|
282
|
+
click: function($event) {
|
|
283
|
+
return $event.stopPropagation(), _vm.handlePreview({
|
|
284
|
+
url: _vm.imgUrl
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
}),
|
|
288
|
+
}), _vm.disabled ? _vm._e() : _c("i", {
|
|
289
289
|
staticClass: "el-icon-delete",
|
|
290
290
|
on: {
|
|
291
|
-
click: function(
|
|
292
|
-
return
|
|
291
|
+
click: function($event) {
|
|
292
|
+
return $event.stopPropagation(), _vm.handleDelete(_vm.imgUrl);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
})]) :
|
|
295
|
+
})]) : _vm._e()]] : _vm.dragFile ? [_c("i", {
|
|
296
296
|
staticClass: "el-icon-upload"
|
|
297
|
-
}),
|
|
297
|
+
}), _c("div", {
|
|
298
298
|
staticClass: "el-upload__text"
|
|
299
|
-
}, [
|
|
299
|
+
}, [_c("em", [_vm._v(_vm._s(_vm.fileText || "上传"))])])] : [_c("ElButton", {
|
|
300
300
|
attrs: {
|
|
301
301
|
icon: "el-icon-upload",
|
|
302
|
-
size:
|
|
302
|
+
size: _vm.size,
|
|
303
303
|
type: "primary"
|
|
304
304
|
}
|
|
305
|
-
}, [
|
|
306
|
-
},
|
|
307
|
-
function
|
|
308
|
-
return
|
|
305
|
+
}, [_vm._v(" " + _vm._s(_vm.fileText || "上传") + " ")])]], 2)], 1);
|
|
306
|
+
}, staticRenderFns = [];
|
|
307
|
+
function getFileUrl(home, uri = "") {
|
|
308
|
+
return uri.match(/(^http:\/\/|^https:\/\/|^\/\/|data:image\/)/) ? uri : home + uri;
|
|
309
309
|
}
|
|
310
|
-
const
|
|
310
|
+
const __vue2_script = {
|
|
311
311
|
name: "FyUpload",
|
|
312
|
-
mixins: [
|
|
312
|
+
mixins: [props, event],
|
|
313
313
|
props: {
|
|
314
314
|
qiniu: Object,
|
|
315
315
|
ali: Object,
|
|
@@ -406,186 +406,186 @@ const X = {
|
|
|
406
406
|
},
|
|
407
407
|
// 单个头像图片
|
|
408
408
|
imgUrl() {
|
|
409
|
-
return
|
|
409
|
+
return isBlank(this.text) ? null : getFileUrl(this.homeUrl, this.text[0]);
|
|
410
410
|
},
|
|
411
411
|
fileList() {
|
|
412
|
-
const
|
|
413
|
-
return (this.text || []).forEach((
|
|
414
|
-
if (
|
|
415
|
-
const
|
|
416
|
-
let
|
|
417
|
-
|
|
418
|
-
uid: `${
|
|
412
|
+
const list = [];
|
|
413
|
+
return (this.text || []).forEach((ele, index) => {
|
|
414
|
+
if (ele) {
|
|
415
|
+
const name = this.isObject ? ele[this.labelKey] : ele.substring(ele.lastIndexOf("/") + 1);
|
|
416
|
+
let url = this.isObject ? ele[this.valueKey] : ele;
|
|
417
|
+
url = getFileUrl(this.homeUrl, url), list.push({
|
|
418
|
+
uid: `${index}`,
|
|
419
419
|
status: "done",
|
|
420
|
-
type: this.isMediaType(
|
|
421
|
-
name
|
|
422
|
-
url
|
|
420
|
+
type: this.isMediaType(url),
|
|
421
|
+
name,
|
|
422
|
+
url
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
|
-
}),
|
|
425
|
+
}), list;
|
|
426
426
|
}
|
|
427
427
|
},
|
|
428
428
|
mounted() {
|
|
429
429
|
this.drag && this.setSort();
|
|
430
430
|
},
|
|
431
431
|
methods: {
|
|
432
|
-
isMediaType(
|
|
433
|
-
return
|
|
432
|
+
isMediaType(url) {
|
|
433
|
+
return isMediaType(url, this.fileType);
|
|
434
434
|
},
|
|
435
435
|
setSort() {
|
|
436
436
|
if (!window.Sortable) {
|
|
437
|
-
|
|
437
|
+
packages.logs("Sortable");
|
|
438
438
|
return;
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
window.Sortable.create(
|
|
440
|
+
const el = this.$el.querySelectorAll(".avue-upload > ul")[0];
|
|
441
|
+
window.Sortable.create(el, {
|
|
442
442
|
animation: 100,
|
|
443
|
-
onEnd: (
|
|
444
|
-
const
|
|
445
|
-
this.text.splice(
|
|
443
|
+
onEnd: (evt) => {
|
|
444
|
+
const targetRow = this.text.splice(evt.oldIndex, 1)[0];
|
|
445
|
+
this.text.splice(evt.newIndex, 0, targetRow), this.reload = Math.random(), this.$nextTick(() => this.setSort());
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
448
|
},
|
|
449
|
-
handleSuccess(
|
|
449
|
+
handleSuccess(file) {
|
|
450
450
|
if (this.isPictureImg)
|
|
451
|
-
this.text.splice(0, 1,
|
|
451
|
+
this.text.splice(0, 1, file[this.urlKey]);
|
|
452
452
|
else if (this.isObject) {
|
|
453
|
-
const
|
|
454
|
-
|
|
453
|
+
const obj = {};
|
|
454
|
+
obj[this.labelKey] = file[this.nameKey], obj[this.valueKey] = file[this.urlKey], this.text.push(obj);
|
|
455
455
|
} else
|
|
456
|
-
this.text.push(
|
|
456
|
+
this.text.push(file[this.urlKey]);
|
|
457
457
|
},
|
|
458
|
-
handleRemove(
|
|
459
|
-
this.beforeRemove(
|
|
460
|
-
this.delete(
|
|
458
|
+
handleRemove(file) {
|
|
459
|
+
this.beforeRemove(file).then(() => {
|
|
460
|
+
this.delete(file);
|
|
461
461
|
});
|
|
462
462
|
},
|
|
463
|
-
handleError(
|
|
464
|
-
this.uploadError && this.uploadError(
|
|
463
|
+
handleError(error) {
|
|
464
|
+
this.uploadError && this.uploadError(error, this.column);
|
|
465
465
|
},
|
|
466
|
-
delete(
|
|
467
|
-
(this.text || []).forEach((
|
|
468
|
-
const
|
|
469
|
-
|
|
466
|
+
delete(file) {
|
|
467
|
+
(this.text || []).forEach((ele, index) => {
|
|
468
|
+
const url = this.isObject ? ele[this.valueKey] : ele;
|
|
469
|
+
getFileUrl(this.homeUrl, url) === file.url && this.text.splice(index, 1);
|
|
470
470
|
});
|
|
471
471
|
},
|
|
472
|
-
show(
|
|
473
|
-
this.loading = !1, this.res =
|
|
472
|
+
show(data) {
|
|
473
|
+
this.loading = !1, this.res = data || this.res, this.handleSuccess(this.res);
|
|
474
474
|
},
|
|
475
|
-
hide(
|
|
476
|
-
this.loading = !1,
|
|
475
|
+
hide(msg) {
|
|
476
|
+
this.loading = !1, msg && this.handleError(msg);
|
|
477
477
|
},
|
|
478
|
-
handleFileChange(
|
|
479
|
-
|
|
478
|
+
handleFileChange(file, fileList) {
|
|
479
|
+
fileList.splice(fileList.length - 1, 1);
|
|
480
480
|
},
|
|
481
|
-
httpUpload(
|
|
481
|
+
httpUpload(config2) {
|
|
482
482
|
if (typeof this.httpRequest == "function") {
|
|
483
|
-
this.httpRequest(
|
|
483
|
+
this.httpRequest(config2);
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
486
|
this.loading = !0;
|
|
487
|
-
let
|
|
488
|
-
const
|
|
489
|
-
if (!
|
|
487
|
+
let file = config2.file;
|
|
488
|
+
const fileSize = file.size / 1024;
|
|
489
|
+
if (!isBlank(fileSize) && fileSize > this.fileSize) {
|
|
490
490
|
this.hide("文件太大不符合");
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
let
|
|
495
|
-
const
|
|
496
|
-
const
|
|
497
|
-
let
|
|
498
|
-
for (const
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
493
|
+
const headers = Object.assign(this.headers, { "Content-Type": "multipart/form-data" });
|
|
494
|
+
let ossConfig = {}, client = {};
|
|
495
|
+
const param = new FormData(), done = () => {
|
|
496
|
+
const callback = (newFile) => {
|
|
497
|
+
let url = this.action;
|
|
498
|
+
for (const o in this.data)
|
|
499
|
+
param.append(o, this.data[o]);
|
|
500
|
+
const uploadFile = newFile || file;
|
|
501
|
+
if (param.append(this.fileName, uploadFile), this.isQiniuOss) {
|
|
502
502
|
if (!window.CryptoJS) {
|
|
503
|
-
|
|
503
|
+
packages.logs("CryptoJS"), this.hide();
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
|
-
|
|
507
|
-
const
|
|
508
|
-
scope:
|
|
509
|
-
deadline: new Date().getTime() +
|
|
506
|
+
ossConfig = this.qiniu || this.$AVUE.qiniu;
|
|
507
|
+
const token = getToken(ossConfig.AK, ossConfig.SK, {
|
|
508
|
+
scope: ossConfig.scope,
|
|
509
|
+
deadline: new Date().getTime() + ossConfig.deadline * 3600
|
|
510
510
|
});
|
|
511
|
-
|
|
511
|
+
param.append("token", token), url = ossConfig.bucket;
|
|
512
512
|
} else if (this.isAliOss) {
|
|
513
513
|
if (!window.OSS) {
|
|
514
|
-
|
|
514
|
+
packages.logs("AliOSS"), this.hide();
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
ossConfig = this.ali || this.$AVUE.ali, client = getClient(ossConfig);
|
|
518
518
|
}
|
|
519
|
-
(() => this.isAliOss ?
|
|
519
|
+
(() => this.isAliOss ? client.put(uploadFile.name, uploadFile, {
|
|
520
520
|
headers: this.headers
|
|
521
|
-
}) : this.$axios.post(
|
|
522
|
-
this.res = {}, this.isQiniuOss && (
|
|
523
|
-
}).catch((
|
|
524
|
-
this.hide(
|
|
521
|
+
}) : this.$axios.post(url, param, { headers }))().then((res) => {
|
|
522
|
+
this.res = {}, this.isQiniuOss && (res.data.key = ossConfig.url + res.data.key), this.res = getAsVal(this.isAliOss ? res : res.data, this.resKey), typeof this.uploadAfter == "function" ? this.uploadAfter(this.res, this.show, this.hide, this.column) : this.show();
|
|
523
|
+
}).catch((error) => {
|
|
524
|
+
this.hide(error);
|
|
525
525
|
});
|
|
526
526
|
};
|
|
527
|
-
typeof this.uploadBefore == "function" ? this.uploadBefore(
|
|
527
|
+
typeof this.uploadBefore == "function" ? this.uploadBefore(file, callback, this.hide, this.column) : callback();
|
|
528
528
|
};
|
|
529
|
-
if (
|
|
530
|
-
|
|
529
|
+
if (isMediaType(file.name) !== "img") {
|
|
530
|
+
done();
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
533
|
+
const canvasDone = () => {
|
|
534
|
+
isBlank(this.canvasOption) ? done() : detailImg(file, this.canvasOption, (res) => {
|
|
535
|
+
file = res, done();
|
|
536
536
|
});
|
|
537
537
|
};
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
img:
|
|
538
|
+
isBlank(this.cropperOption) ? canvasDone() : fileToBase64(file, (res) => {
|
|
539
|
+
const option = Object.assign(this.cropperOption, {
|
|
540
|
+
img: res,
|
|
541
541
|
type: "file",
|
|
542
|
-
callback: (
|
|
543
|
-
|
|
542
|
+
callback: (res2) => {
|
|
543
|
+
file = res2, canvasDone();
|
|
544
544
|
},
|
|
545
545
|
cancel: () => {
|
|
546
546
|
this.loading = !1;
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
|
-
this.$ImageCropper(
|
|
549
|
+
this.$ImageCropper(option);
|
|
550
550
|
});
|
|
551
551
|
},
|
|
552
|
-
handleExceed(
|
|
553
|
-
this.uploadExceed && this.uploadExceed(this.limit,
|
|
552
|
+
handleExceed(files, fileList) {
|
|
553
|
+
this.uploadExceed && this.uploadExceed(this.limit, files, fileList, this.column);
|
|
554
554
|
},
|
|
555
|
-
handlePreview(
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
this.$ImagePreview(this.fileList,
|
|
555
|
+
handlePreview(file) {
|
|
556
|
+
const callback = () => {
|
|
557
|
+
const index = this.fileList.findIndex((ele) => ele.url === file.url);
|
|
558
|
+
this.$ImagePreview(this.fileList, index);
|
|
559
559
|
};
|
|
560
|
-
typeof this.uploadPreview == "function" ? this.uploadPreview(
|
|
560
|
+
typeof this.uploadPreview == "function" ? this.uploadPreview(file, this.column, callback) : callback();
|
|
561
561
|
},
|
|
562
|
-
handleDelete(
|
|
563
|
-
this.beforeRemove(
|
|
562
|
+
handleDelete(file) {
|
|
563
|
+
this.beforeRemove(file).then(() => {
|
|
564
564
|
this.text = [], this.menu = !1;
|
|
565
565
|
});
|
|
566
566
|
},
|
|
567
|
-
beforeRemove(
|
|
568
|
-
return typeof this.uploadDelete == "function" ? this.uploadDelete(
|
|
567
|
+
beforeRemove(file) {
|
|
568
|
+
return typeof this.uploadDelete == "function" ? this.uploadDelete(file, this.column) : Promise.resolve();
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
},
|
|
572
|
-
var
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
571
|
+
}, __cssModules = {};
|
|
572
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
573
|
+
__vue2_script,
|
|
574
|
+
render,
|
|
575
|
+
staticRenderFns,
|
|
576
576
|
!1,
|
|
577
|
-
|
|
577
|
+
__vue2_injectStyles,
|
|
578
578
|
null,
|
|
579
579
|
null,
|
|
580
580
|
null
|
|
581
581
|
);
|
|
582
|
-
function
|
|
583
|
-
for (let
|
|
584
|
-
this[
|
|
582
|
+
function __vue2_injectStyles(context) {
|
|
583
|
+
for (let o in __cssModules)
|
|
584
|
+
this[o] = __cssModules[o];
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
return
|
|
586
|
+
const FyUpload = /* @__PURE__ */ function() {
|
|
587
|
+
return __component__.exports;
|
|
588
588
|
}();
|
|
589
589
|
export {
|
|
590
|
-
|
|
590
|
+
FyUpload as default
|
|
591
591
|
};
|