@web-utils/component 2.7.30 → 2.7.32
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.7dec2bf2.js → config.75161c38.mjs} +29 -29
- package/dist/chunks/confirmable-mixin.851d6299.mjs +137 -0
- package/dist/chunks/dataformat.3388d88a.mjs +237 -0
- package/dist/chunks/detail.37726835.mjs +55 -0
- package/dist/chunks/dic.09a81bc8.mjs +215 -0
- package/dist/chunks/{event.fc358074.js → event.6fc3df3a.mjs} +54 -23
- package/dist/chunks/{form-input-mixin.760cd65d.js → form-input-mixin.e7f93f4c.mjs} +4 -4
- package/dist/chunks/{form-item-mixin.fa314b67.js → form-item-mixin.a2ed6693.mjs} +44 -17
- package/dist/chunks/{form-pick-mixin.c4e0391b.js → form-pick-mixin.822300f3.mjs} +1 -1
- package/dist/chunks/{init.e0133910.js → init.3407e589.mjs} +41 -21
- package/dist/chunks/{input-number-mixin.6849fa63.js → input-number-mixin.44b78389.mjs} +4 -4
- package/dist/chunks/{mixins.6a394a6c.js → mixins.e1939731.mjs} +3 -2
- package/dist/chunks/{packages.419bde01.js → packages.c4ea639d.mjs} +12 -6
- package/dist/chunks/{permission.07c49abf.js → permission.9c766972.mjs} +6 -1
- package/dist/chunks/slot.55598d0f.mjs +35 -0
- package/dist/chunks/{tab-mixin.9d568df9.js → tab-mixin.9d848bf6.mjs} +29 -11
- package/dist/chunks/util.b0d0b0ad.mjs +478 -0
- package/dist/chunks/{utils.d7f73f8d.js → utils.2a3ffac9.mjs} +89 -24
- package/dist/chunks/{utils.f44207f4.js → utils.a8891d2c.mjs} +9 -5
- package/dist/chunks/vueComponentNormalizer.9c6b8b3d.mjs +59 -0
- package/dist/components/address-input/{index.js → index.mjs} +30 -17
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/affix/index.mjs +152 -0
- package/dist/components/affix/style.css +5 -1
- package/dist/components/aside-menu/{index.js → index.mjs} +14 -8
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/avatar/{index.js → index.mjs} +33 -15
- package/dist/components/avatar/style.css +57 -1
- package/dist/components/awesome-button/{index.js → index.mjs} +45 -31
- package/dist/components/base.css +410 -1
- package/dist/components/capsule-tab/{index.js → index.mjs} +13 -7
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/card/{index.js → index.mjs} +33 -20
- package/dist/components/card/style.css +90 -1
- package/dist/components/carousel/{index.js → index.mjs} +18 -12
- package/dist/components/carousel/style.css +41 -1
- package/dist/components/chat/{index.js → index.mjs} +245 -139
- package/dist/components/chat/style.css +279 -1
- package/dist/components/chunk-file-uploader/index.mjs +153 -0
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/{index.js → index.mjs} +15 -9
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.mjs +101 -0
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/{index.js → index.mjs} +150 -73
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/{index.js → index.mjs} +15 -9
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/{index.js → index.mjs} +16 -10
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/{index.js → index.mjs} +18 -10
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/{index.js → index.mjs} +75 -47
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/{index.js → index.mjs} +62 -39
- package/dist/components/column/{index.js → index.mjs} +54 -29
- package/dist/components/column-default/{index.js → index.mjs} +47 -33
- package/dist/components/column-dynamic/{index.js → index.mjs} +26 -19
- package/dist/components/column-menu/{index.js → index.mjs} +98 -86
- package/dist/components/column-slot/{index.js → index.mjs} +135 -75
- package/dist/components/comment/{index.js → index.mjs} +28 -15
- package/dist/components/comment/style.css +92 -1
- package/dist/components/confirm-button/{index.js → index.mjs} +7 -5
- package/dist/components/confirmable/{index.js → index.mjs} +5 -4
- package/dist/components/context-menu/{index.js → index.mjs} +54 -32
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/count-up/index.mjs +148 -0
- package/dist/components/custom-scrollbar/{index.js → index.mjs} +45 -21
- package/dist/components/data-box/{index.js → index.mjs} +22 -16
- package/dist/components/data-box/style.css +58 -1
- package/dist/components/data-card/{index.js → index.mjs} +21 -15
- package/dist/components/data-card/style.css +46 -1
- package/dist/components/data-cardtext/{index.js → index.mjs} +19 -13
- package/dist/components/data-cardtext/style.css +36 -1
- package/dist/components/data-display/{index.js → index.mjs} +22 -16
- package/dist/components/data-display/style.css +37 -1
- package/dist/components/data-icons/{index.js → index.mjs} +23 -17
- package/dist/components/data-icons/style.css +53 -1
- package/dist/components/data-imgtext/{index.js → index.mjs} +26 -20
- package/dist/components/data-imgtext/style.css +70 -1
- package/dist/components/data-operatext/{index.js → index.mjs} +20 -14
- package/dist/components/data-operatext/style.css +81 -1
- package/dist/components/data-panel/{index.js → index.mjs} +21 -15
- package/dist/components/data-panel/style.css +37 -1
- package/dist/components/data-pay/{index.js → index.mjs} +29 -23
- package/dist/components/data-pay/style.css +102 -1
- package/dist/components/data-price/{index.js → index.mjs} +19 -13
- package/dist/components/data-price/style.css +81 -1
- package/dist/components/data-progress/{index.js → index.mjs} +26 -20
- package/dist/components/data-progress/style.css +30 -1
- package/dist/components/data-rotate/{index.js → index.mjs} +21 -15
- package/dist/components/data-rotate/style.css +50 -1
- package/dist/components/data-table-picker/{index.js → index.mjs} +47 -28
- package/dist/components/data-tabs/{index.js → index.mjs} +22 -16
- package/dist/components/data-tabs/style.css +70 -1
- package/dist/components/dialog-column/{index.js → index.mjs} +46 -33
- package/dist/components/dialog-excel/{index.js → index.mjs} +102 -53
- package/dist/components/dialog-filter/{index.js → index.mjs} +64 -51
- package/dist/components/dialog-form/{index.js → index.mjs} +54 -34
- package/dist/components/dialog-form/style.css +10 -0
- package/dist/components/dynamic-table/{index.js → index.mjs} +66 -42
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/{index.js → index.mjs} +127 -46
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/easy-popup/{index.js → index.mjs} +32 -14
- package/dist/components/easy-popup/style.css +18 -1
- package/dist/components/editable-progress/{index.js → index.mjs} +64 -31
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/{index.js → index.mjs} +513 -287
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/{index.js → index.mjs} +25 -12
- package/dist/components/egd-collapse-item/{index.js → index.mjs} +41 -25
- package/dist/components/element-dialog/{index.js → index.mjs} +101 -48
- package/dist/components/element-dialog/style.css +88 -1
- package/dist/components/empty-view/{index.js → index.mjs} +13 -7
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/{index.js → index.mjs} +12 -6
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.mjs +84 -0
- package/dist/components/flex-item/index.mjs +116 -0
- package/dist/components/flex-row/index.mjs +84 -0
- package/dist/components/flex-scroller/{index.js → index.mjs} +13 -7
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/flow/{index.js → index.mjs} +116 -64
- package/dist/components/flow/style.css +44 -1
- package/dist/components/flow-node/{index.js → index.mjs} +29 -21
- package/dist/components/flow-viewer/index.mjs +207 -0
- package/dist/components/flow-viewer/style.css +19 -1
- package/dist/components/form-button/{index.js → index.mjs} +12 -8
- package/dist/components/form-cascader/{index.js → index.mjs} +55 -40
- package/dist/components/form-checkbox-group/{index.js → index.mjs} +90 -60
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/{index.js → index.mjs} +113 -44
- package/dist/components/form-group/{index.js → index.mjs} +23 -17
- package/dist/components/form-group/style.css +76 -1
- package/dist/components/form-holder/{index.js → index.mjs} +41 -30
- package/dist/components/form-input/{index.js → index.mjs} +42 -31
- package/dist/components/form-input-email/{index.js → index.mjs} +47 -30
- package/dist/components/form-input-id-card/{index.js → index.mjs} +40 -29
- package/dist/components/form-input-number/{index.js → index.mjs} +50 -38
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/{index.js → index.mjs} +40 -29
- package/dist/components/form-input-time/{index.js → index.mjs} +40 -29
- package/dist/components/form-item/index.mjs +199 -0
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/{index.js → index.mjs} +9 -8
- package/dist/components/form-item-group/{index.js → index.mjs} +69 -43
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/{index.js → index.mjs} +77 -53
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/{index.js → index.mjs} +71 -51
- package/dist/components/form-switch/{index.js → index.mjs} +41 -30
- package/dist/components/form-temp/{index.js → index.mjs} +49 -29
- package/dist/components/form-textarea/{index.js → index.mjs} +45 -34
- package/dist/components/form-view/{index.js → index.mjs} +152 -81
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/fy-array/{index.js → index.mjs} +51 -43
- package/dist/components/fy-array/style.css +18 -1
- package/dist/components/fy-article/{index.js → index.mjs} +24 -13
- package/dist/components/fy-article/style.css +40 -1
- package/dist/components/fy-cascader/{index.js → index.mjs} +39 -29
- package/dist/components/fy-checkbox/{index.js → index.mjs} +38 -27
- package/dist/components/fy-checkbox/style.css +15 -1
- package/dist/components/fy-code/{index.js → index.mjs} +19 -12
- package/dist/components/fy-curd/{index.js → index.mjs} +290 -152
- package/dist/components/fy-curd/style.css +239 -1
- package/dist/components/fy-date/{index.js → index.mjs} +24 -18
- package/dist/components/fy-date/style.css +21 -1
- package/dist/components/fy-dialog-form/{index.js → index.mjs} +127 -54
- package/dist/components/fy-draggable/{index.js → index.mjs} +196 -73
- package/dist/components/fy-draggable/style.css +136 -1
- package/dist/components/fy-dynamic/{index.js → index.mjs} +116 -73
- package/dist/components/fy-dynamic/style.css +35 -1
- package/dist/components/fy-empty/{index.js → index.mjs} +15 -9
- package/dist/components/fy-empty/style.css +24 -1
- package/dist/components/fy-form/{index.js → index.mjs} +399 -221
- package/dist/components/fy-form/style.css +79 -1
- package/dist/components/fy-form-design/{index.js → index.mjs} +2267 -1630
- package/dist/components/fy-form-design/style.css +578 -1
- package/dist/components/fy-form-menu/{index.js → index.mjs} +43 -35
- package/dist/components/fy-input/{index.js → index.mjs} +46 -35
- package/dist/components/fy-input-color/{index.js → index.mjs} +40 -33
- package/dist/components/fy-input-icon/{index.js → index.mjs} +58 -37
- package/dist/components/fy-input-icon/style.css +39 -1
- package/dist/components/fy-input-map/{index.js → index.mjs} +113 -68
- package/dist/components/fy-input-map/style.css +50 -1
- package/dist/components/fy-input-number/{index.js → index.mjs} +29 -24
- package/dist/components/fy-input-table/{index.js → index.mjs} +82 -48
- package/dist/components/fy-input-table/style.css +10 -1
- package/dist/components/fy-input-tree/{index.js → index.mjs} +104 -60
- package/dist/components/fy-input-tree/style.css +25 -1
- package/dist/components/fy-progress/{index.js → index.mjs} +15 -10
- package/dist/components/fy-radio/{index.js → index.mjs} +20 -14
- package/dist/components/fy-radio/style.css +12 -1
- package/dist/components/fy-rate/{index.js → index.mjs} +21 -15
- package/dist/components/fy-rate/style.css +9 -1
- package/dist/components/fy-select/{index.js → index.mjs} +73 -55
- package/dist/components/fy-select/style.css +25 -1
- package/dist/components/fy-slider/{index.js → index.mjs} +22 -17
- package/dist/components/fy-switch/{index.js → index.mjs} +17 -12
- package/dist/components/fy-tabs/{index.js → index.mjs} +20 -12
- package/dist/components/fy-tabs/style.css +6 -0
- package/dist/components/fy-time/{index.js → index.mjs} +29 -18
- package/dist/components/fy-title/{index.js → index.mjs} +16 -8
- package/dist/components/fy-title/style.css +11 -1
- package/dist/components/fy-tree/{index.js → index.mjs} +135 -72
- package/dist/components/fy-tree/style.css +46 -1
- package/dist/components/fy-u-editor/{index.js → index.mjs} +172 -67
- package/dist/components/fy-u-editor/style.css +15 -1
- package/dist/components/fy-upload/{index.js → index.mjs} +317 -148
- package/dist/components/fy-upload/style.css +60 -1
- package/dist/components/guide-steps/{index.js → index.mjs} +31 -17
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/header-menu/{index.js → index.mjs} +86 -66
- package/dist/components/header-search/{index.js → index.mjs} +92 -60
- package/dist/components/highlight-j-s/{index.js → index.mjs} +28 -15
- package/dist/components/highlight-j-s/style.css +21 -1
- package/dist/components/icon-card/{index.js → index.mjs} +13 -7
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/icon-temp/{index.js → index.mjs} +12 -6
- package/dist/components/icon-temp/style.css +21 -1
- package/dist/components/iframe-window/{index.js → index.mjs} +20 -14
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-cropper/{index.js → index.mjs} +69 -51
- package/dist/components/image-cropper/style.css +34 -1
- package/dist/components/image-preview/{index.js → index.mjs} +77 -46
- package/dist/components/image-preview/style.css +72 -1
- package/dist/components/image-viewer/{index.js → index.mjs} +40 -22
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/{index.js → index.mjs} +122 -56
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/{index.js → index.mjs} +32 -20
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/j-s-x-component/{index.js → index.mjs} +0 -0
- package/dist/components/keep-view-alive/{index.js → index.mjs} +68 -21
- package/dist/components/keyboard/index.mjs +469 -0
- package/dist/components/keyboard/style.css +547 -1
- package/dist/components/license/index.mjs +180 -0
- package/dist/components/loading-view/{index.js → index.mjs} +12 -6
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/login/{index.js → index.mjs} +91 -62
- package/dist/components/login/style.css +25 -1
- package/dist/components/name-avatar/{index.js → index.mjs} +32 -10
- package/dist/components/name-avatar/style.css +35 -1
- package/dist/components/nav-bar/{index.js → index.mjs} +21 -11
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/{index.js → index.mjs} +16 -8
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/notice/{index.js → index.mjs} +40 -27
- package/dist/components/notice/style.css +54 -1
- package/dist/components/page/{index.js → index.mjs} +13 -7
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/{index.js → index.mjs} +15 -9
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/{index.js → index.mjs} +62 -37
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/{index.js → index.mjs} +53 -34
- package/dist/components/page-skeleton/{index.js → index.mjs} +15 -9
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/{index.js → index.mjs} +15 -9
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/{index.js → index.mjs} +187 -106
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/{index.js → index.mjs} +164 -80
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.mjs +175 -0
- package/dist/components/process-designer/{index.js → index.mjs} +961 -772
- package/dist/components/process-designer/style.css +1186 -1
- package/dist/components/properties-panel/{index.js → index.mjs} +1488 -1044
- package/dist/components/properties-panel/style.css +122 -1
- package/dist/components/queue/{index.js → index.mjs} +24 -12
- package/dist/components/record-video/{index.js → index.mjs} +53 -27
- package/dist/components/record-video/style.css +53 -1
- package/dist/components/resize-observer/index.mjs +96 -0
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search/{index.js → index.mjs} +41 -22
- package/dist/components/search/style.css +57 -1
- package/dist/components/search-popover/{index.js → index.mjs} +153 -91
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign/index.mjs +236 -0
- package/dist/components/sign/style.css +12 -1
- package/dist/components/sign-panel/{index.js → index.mjs} +96 -46
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/skeleton/{index.js → index.mjs} +22 -12
- package/dist/components/skeleton/style.css +61 -1
- package/dist/components/split-pane/{index.js → index.mjs} +125 -60
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/{index.js → index.mjs} +8 -5
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/{index.js → index.mjs} +22 -15
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.mjs +247 -0
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/{index.js → index.mjs} +34 -16
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/{index.js → index.mjs} +14 -9
- package/dist/components/table-column/{index.js → index.mjs} +26 -17
- package/dist/components/table-page/{index.js → index.mjs} +42 -23
- package/dist/components/table-view/{index.js → index.mjs} +162 -87
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/{index.js → index.mjs} +41 -22
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/text-ellipsis/{index.js → index.mjs} +48 -26
- package/dist/components/text-ellipsis/style.css +9 -1
- package/dist/components/tinymce-editor/{index.js → index.mjs} +80 -60
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/{index.js → index.mjs} +77 -41
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/{index.js → index.mjs} +46 -25
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/{index.js → index.mjs} +46 -35
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/{index.js → index.mjs} +15 -8
- package/dist/components/verify/{index.js → index.mjs} +15 -8
- package/dist/components/verify/style.css +15 -1
- package/dist/components/vue-tags-input/{index.js → index.mjs} +233 -113
- package/dist/components/vue-tags-input/style.css +688 -1
- package/dist/components/watermark/{index.js → index.mjs} +33 -14
- package/dist/components/watermark/style.css +11 -1
- package/dist/index.css +2434 -1750
- package/dist/{index.es.js → index.mjs} +15944 -9317
- package/package.json +4 -4
- package/web-types.json +1 -1
- package/dist/chunks/confirmable-mixin.35bd1934.js +0 -104
- package/dist/chunks/dataformat.9cc4428a.js +0 -158
- package/dist/chunks/detail.544c52b0.js +0 -29
- package/dist/chunks/dic.9de2fe5a.js +0 -135
- package/dist/chunks/slot.a7387ecc.js +0 -27
- package/dist/chunks/util.89913643.js +0 -261
- package/dist/chunks/vueComponentNormalizer.77ec6792.js +0 -32
- package/dist/components/affix/index.js +0 -102
- package/dist/components/chunk-file-uploader/index.js +0 -119
- package/dist/components/chunk-file-uploader-drop/index.js +0 -83
- package/dist/components/count-up/index.js +0 -131
- package/dist/components/flex-column/index.js +0 -62
- package/dist/components/flex-item/index.js +0 -81
- package/dist/components/flex-row/index.js +0 -62
- package/dist/components/flow-viewer/index.js +0 -162
- package/dist/components/form-item/index.js +0 -147
- package/dist/components/fy-dialog-form/style.css +0 -1
- package/dist/components/keyboard/index.js +0 -384
- package/dist/components/license/index.js +0 -134
- package/dist/components/photo-swipe/index.js +0 -129
- package/dist/components/resize-observer/index.js +0 -62
- package/dist/components/sign/index.js +0 -133
- package/dist/components/swiper/index.js +0 -178
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { p as props, e as event } from "../../chunks/event.
|
|
2
|
-
import { z as dataURLtoFile, i as isMediaType, g as getAsVal } from "../../chunks/util.
|
|
3
|
-
import { p as packages } from "../../chunks/packages.
|
|
1
|
+
import { p as props, e as event } from "../../chunks/event.6fc3df3a.mjs";
|
|
2
|
+
import { z as dataURLtoFile, i as isMediaType, g as getAsVal } from "../../chunks/util.b0d0b0ad.mjs";
|
|
3
|
+
import { p as packages } from "../../chunks/packages.c4ea639d.mjs";
|
|
4
4
|
import { isBlank } from "@web-utils/core";
|
|
5
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
6
|
-
let canvas
|
|
5
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.9c6b8b3d.mjs";
|
|
6
|
+
let canvas;
|
|
7
|
+
let ctx;
|
|
7
8
|
const configDefault = {
|
|
8
9
|
width: 200,
|
|
9
10
|
height: 200
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
const config = {
|
|
11
13
|
text: "avueJS",
|
|
12
14
|
// 文字
|
|
13
15
|
fontFamily: "microsoft yahei",
|
|
@@ -27,40 +29,81 @@ const configDefault = {
|
|
|
27
29
|
};
|
|
28
30
|
function fileToBase64(file, callback) {
|
|
29
31
|
const reader = new FileReader();
|
|
30
|
-
reader.readAsDataURL(file)
|
|
32
|
+
reader.readAsDataURL(file);
|
|
33
|
+
reader.onload = function(e) {
|
|
31
34
|
callback(e.target.result);
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
function detailImg(file, option = {}, callback) {
|
|
35
38
|
const { text, fontFamily, color, fontSize, opacity, bottom, right, ratio } = option;
|
|
36
|
-
initParams()
|
|
39
|
+
initParams();
|
|
40
|
+
fileToBase64(file, initImg);
|
|
37
41
|
function initParams() {
|
|
38
|
-
config.text = text || config.text
|
|
42
|
+
config.text = text || config.text;
|
|
43
|
+
config.fontFamily = fontFamily || config.fontFamily;
|
|
44
|
+
config.color = color || config.color;
|
|
45
|
+
config.fontSize = fontSize || config.fontSize;
|
|
46
|
+
config.opacity = opacity || config.opacity;
|
|
47
|
+
config.bottom = bottom || config.bottom;
|
|
48
|
+
config.right = right || config.right;
|
|
49
|
+
config.ratio = ratio || config.ratio;
|
|
39
50
|
}
|
|
40
51
|
function initImg(data) {
|
|
41
52
|
const img = new Image();
|
|
42
|
-
img.src = data
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
53
|
+
img.src = data;
|
|
54
|
+
img.onload = function() {
|
|
55
|
+
const width = img.width;
|
|
56
|
+
const height = img.height;
|
|
57
|
+
cretedCanvas(width, height);
|
|
58
|
+
ctx.drawImage(img, 0, 0, width, height);
|
|
59
|
+
setText(width, height);
|
|
60
|
+
const base64 = document.getElementById("canvas").toDataURL(file.type, config.ratio);
|
|
61
|
+
const result = dataURLtoFile(base64, file.name);
|
|
46
62
|
callback && callback(result);
|
|
47
63
|
};
|
|
48
64
|
}
|
|
49
65
|
function cretedCanvas(width, height) {
|
|
50
|
-
canvas = document.getElementById("canvas")
|
|
66
|
+
canvas = document.getElementById("canvas");
|
|
67
|
+
if (canvas === null) {
|
|
68
|
+
canvas = document.createElement("canvas");
|
|
69
|
+
canvas.id = "canvas";
|
|
70
|
+
canvas.className = "avue-canvas";
|
|
71
|
+
document.body.appendChild(canvas);
|
|
72
|
+
}
|
|
73
|
+
ctx = canvas.getContext("2d");
|
|
74
|
+
canvas.width = width;
|
|
75
|
+
canvas.height = height;
|
|
51
76
|
}
|
|
52
77
|
function setText(width, height) {
|
|
53
|
-
const txt = config.text
|
|
54
|
-
|
|
78
|
+
const txt = config.text;
|
|
79
|
+
const param = calcParam(txt, width, height);
|
|
80
|
+
ctx.font = `${param.fontSize}px ${config.fontFamily}`;
|
|
81
|
+
ctx.fillStyle = config.color;
|
|
82
|
+
ctx.globalAlpha = config.opacity / 100;
|
|
83
|
+
ctx.fillText(txt, param.x, param.y);
|
|
55
84
|
}
|
|
56
85
|
function calcParam(txt, width, height) {
|
|
57
86
|
let x, y;
|
|
58
|
-
const
|
|
59
|
-
|
|
87
|
+
const calcFontSize = config.fontSize / configDefault.width;
|
|
88
|
+
const fontSize2 = calcFontSize * width;
|
|
89
|
+
if (config.bottom) {
|
|
90
|
+
y = configDefault.height - config.bottom;
|
|
91
|
+
} else {
|
|
92
|
+
y = config.top;
|
|
93
|
+
}
|
|
94
|
+
if (config.right) {
|
|
95
|
+
x = configDefault.width - config.right;
|
|
96
|
+
} else {
|
|
97
|
+
x = config.left;
|
|
98
|
+
}
|
|
99
|
+
ctx.font = `${config.fontSize}px ${config.fontFamily}`;
|
|
60
100
|
const txtWidth = Number(ctx.measureText(txt).width);
|
|
61
101
|
x = x - txtWidth;
|
|
62
|
-
const calcPosX = x / configDefault.width
|
|
63
|
-
|
|
102
|
+
const calcPosX = x / configDefault.width;
|
|
103
|
+
const calcPosY = y / configDefault.height;
|
|
104
|
+
x = calcPosX * width;
|
|
105
|
+
y = calcPosY * height;
|
|
106
|
+
return {
|
|
64
107
|
x,
|
|
65
108
|
y,
|
|
66
109
|
fontSize: fontSize2
|
|
@@ -72,40 +115,76 @@ const getToken = (accessKey, secretKey, putPolicy) => {
|
|
|
72
115
|
window.__ENV__ === "development" && console && console.log("put_policy = ", put_policy);
|
|
73
116
|
const encoded = base64encode(utf16to8(put_policy));
|
|
74
117
|
window.__ENV__ === "development" && console && console.log("encoded = ", encoded);
|
|
75
|
-
const
|
|
118
|
+
const hash = CryptoJS.HmacSHA1(encoded, secretKey);
|
|
119
|
+
const encoded_signed = hash.toString(CryptoJS.enc.Base64);
|
|
76
120
|
window.__ENV__ === "development" && console && console.log("encoded_signed=", encoded_signed);
|
|
77
121
|
const upload_token = `${accessKey}:${safe64(encoded_signed)}:${encoded}`;
|
|
78
|
-
|
|
122
|
+
window.__ENV__ === "development" && console && console.log("upload_token=", upload_token);
|
|
123
|
+
return upload_token;
|
|
79
124
|
};
|
|
80
125
|
function utf16to8(str) {
|
|
81
126
|
let out, i, c;
|
|
82
127
|
out = "";
|
|
83
128
|
const len = str.length;
|
|
84
|
-
for (i = 0; i < len; i++)
|
|
85
|
-
c = str.charCodeAt(i)
|
|
129
|
+
for (i = 0; i < len; i++) {
|
|
130
|
+
c = str.charCodeAt(i);
|
|
131
|
+
if (c >= 1 && c <= 127) {
|
|
132
|
+
out += str.charAt(i);
|
|
133
|
+
} else if (c > 2047) {
|
|
134
|
+
out += String.fromCharCode(224 | c >> 12 & 15);
|
|
135
|
+
out += String.fromCharCode(128 | c >> 6 & 63);
|
|
136
|
+
out += String.fromCharCode(128 | c >> 0 & 63);
|
|
137
|
+
} else {
|
|
138
|
+
out += String.fromCharCode(192 | c >> 6 & 31);
|
|
139
|
+
out += String.fromCharCode(128 | c >> 0 & 63);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
86
142
|
return out;
|
|
87
143
|
}
|
|
88
144
|
const base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
89
145
|
function base64encode(str) {
|
|
90
|
-
let out, i, len
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
146
|
+
let out, i, len;
|
|
147
|
+
let c1, c2, c3;
|
|
148
|
+
len = str.length;
|
|
149
|
+
i = 0;
|
|
150
|
+
out = "";
|
|
151
|
+
while (i < len) {
|
|
152
|
+
c1 = str.charCodeAt(i++) & 255;
|
|
153
|
+
if (i == len) {
|
|
154
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
|
155
|
+
out += base64EncodeChars.charAt((c1 & 3) << 4);
|
|
156
|
+
out += "==";
|
|
94
157
|
break;
|
|
95
158
|
}
|
|
96
|
-
|
|
97
|
-
|
|
159
|
+
c2 = str.charCodeAt(i++);
|
|
160
|
+
if (i == len) {
|
|
161
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
|
162
|
+
out += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
|
|
163
|
+
out += base64EncodeChars.charAt((c2 & 15) << 2);
|
|
164
|
+
out += "=";
|
|
98
165
|
break;
|
|
99
166
|
}
|
|
100
|
-
c3 = str.charCodeAt(i++)
|
|
167
|
+
c3 = str.charCodeAt(i++);
|
|
168
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
|
169
|
+
out += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
|
|
170
|
+
out += base64EncodeChars.charAt((c2 & 15) << 2 | (c3 & 192) >> 6);
|
|
171
|
+
out += base64EncodeChars.charAt(c3 & 63);
|
|
101
172
|
}
|
|
102
173
|
return out;
|
|
103
174
|
}
|
|
104
175
|
const safe64 = function(base64) {
|
|
105
|
-
|
|
106
|
-
|
|
176
|
+
base64 = base64.replace(/\+/g, "-");
|
|
177
|
+
base64 = base64.replace(/\//g, "_");
|
|
178
|
+
return base64;
|
|
179
|
+
};
|
|
180
|
+
const getClient = (params) => {
|
|
181
|
+
const client = new OSS(params);
|
|
182
|
+
return client;
|
|
183
|
+
};
|
|
107
184
|
var render = function() {
|
|
108
|
-
var _vm = this
|
|
185
|
+
var _vm = this;
|
|
186
|
+
var _h = _vm.$createElement;
|
|
187
|
+
var _c = _vm._self._c || _h;
|
|
109
188
|
return _c("div", {
|
|
110
189
|
directives: [{
|
|
111
190
|
name: "loading",
|
|
@@ -113,7 +192,7 @@ var render = function() {
|
|
|
113
192
|
value: _vm.loading,
|
|
114
193
|
expression: "loading",
|
|
115
194
|
modifiers: {
|
|
116
|
-
lock:
|
|
195
|
+
"lock": true
|
|
117
196
|
}
|
|
118
197
|
}],
|
|
119
198
|
staticClass: "avue-upload",
|
|
@@ -127,25 +206,25 @@ var render = function() {
|
|
|
127
206
|
"avue-upload--upload": _vm.disabled
|
|
128
207
|
},
|
|
129
208
|
attrs: {
|
|
130
|
-
action: _vm.action,
|
|
209
|
+
"action": _vm.action,
|
|
131
210
|
"on-remove": _vm.handleRemove,
|
|
132
|
-
accept: _vm.acceptList,
|
|
211
|
+
"accept": _vm.acceptList,
|
|
133
212
|
"before-remove": _vm.beforeRemove,
|
|
134
|
-
multiple: _vm.multiple,
|
|
213
|
+
"multiple": _vm.multiple,
|
|
135
214
|
"on-preview": _vm.handlePreview,
|
|
136
|
-
limit: _vm.limit,
|
|
215
|
+
"limit": _vm.limit,
|
|
137
216
|
"http-request": _vm.httpUpload,
|
|
138
|
-
readonly: _vm.readonly,
|
|
139
|
-
drag: _vm.dragFile,
|
|
140
|
-
"show-file-list": _vm.isPictureImg ?
|
|
217
|
+
"readonly": _vm.readonly,
|
|
218
|
+
"drag": _vm.dragFile,
|
|
219
|
+
"show-file-list": _vm.isPictureImg ? false : _vm.showFileList,
|
|
141
220
|
"list-type": _vm.listType,
|
|
142
221
|
"on-change": _vm.handleFileChange,
|
|
143
222
|
"on-exceed": _vm.handleExceed,
|
|
144
|
-
disabled: _vm.disabled,
|
|
223
|
+
"disabled": _vm.disabled,
|
|
145
224
|
"file-list": _vm.fileList
|
|
146
225
|
},
|
|
147
226
|
nativeOn: {
|
|
148
|
-
click: function($event) {
|
|
227
|
+
"click": function($event) {
|
|
149
228
|
return _vm.handleClick.apply(null, arguments);
|
|
150
229
|
}
|
|
151
230
|
},
|
|
@@ -155,22 +234,22 @@ var render = function() {
|
|
|
155
234
|
return [_c("div", {
|
|
156
235
|
staticClass: "el-upload__tip",
|
|
157
236
|
domProps: {
|
|
158
|
-
innerHTML: _vm._s(_vm.tip)
|
|
237
|
+
"innerHTML": _vm._s(_vm.tip)
|
|
159
238
|
}
|
|
160
239
|
})];
|
|
161
240
|
},
|
|
162
|
-
proxy:
|
|
241
|
+
proxy: true
|
|
163
242
|
}, {
|
|
164
243
|
key: "file",
|
|
165
244
|
fn: function(_ref) {
|
|
166
245
|
var file = _ref.file;
|
|
167
246
|
return [_vm.$scopedSlots.default ? _vm._t("default", null, {
|
|
168
|
-
file
|
|
247
|
+
"file": file
|
|
169
248
|
}) : _vm.listType === "picture-card" ? _c("span", [_vm.isMediaType(file.url) ? _c(file.type, {
|
|
170
249
|
tag: "Component",
|
|
171
250
|
staticClass: "el-upload-list__item-thumbnail",
|
|
172
251
|
attrs: {
|
|
173
|
-
src: file.url
|
|
252
|
+
"src": file.url
|
|
174
253
|
}
|
|
175
254
|
}) : _c("i", {
|
|
176
255
|
staticClass: "avue-upload__avatar el-icon-document"
|
|
@@ -181,30 +260,33 @@ var render = function() {
|
|
|
181
260
|
}, [_c("i", {
|
|
182
261
|
staticClass: "el-icon-zoom-in",
|
|
183
262
|
on: {
|
|
184
|
-
click: function($event) {
|
|
185
|
-
|
|
263
|
+
"click": function($event) {
|
|
264
|
+
$event.stopPropagation();
|
|
265
|
+
return _vm.handlePreview(file);
|
|
186
266
|
}
|
|
187
267
|
}
|
|
188
268
|
})]), _c("span", {
|
|
189
269
|
staticClass: "el-upload-list__item-delete"
|
|
190
|
-
}, [_vm.disabled ?
|
|
270
|
+
}, [!_vm.disabled ? _c("i", {
|
|
191
271
|
staticClass: "el-icon-delete",
|
|
192
272
|
on: {
|
|
193
|
-
click: function($event) {
|
|
194
|
-
|
|
273
|
+
"click": function($event) {
|
|
274
|
+
$event.stopPropagation();
|
|
275
|
+
return _vm.handleRemove(file);
|
|
195
276
|
}
|
|
196
277
|
}
|
|
197
|
-
})])])], 1) : _vm.listType === "picture" ? _c("span", {
|
|
278
|
+
}) : _vm._e()])])], 1) : _vm.listType === "picture" ? _c("span", {
|
|
198
279
|
on: {
|
|
199
|
-
click: function($event) {
|
|
200
|
-
|
|
280
|
+
"click": function($event) {
|
|
281
|
+
$event.stopPropagation();
|
|
282
|
+
return _vm.handlePreview(file);
|
|
201
283
|
}
|
|
202
284
|
}
|
|
203
285
|
}, [_c(file.type, {
|
|
204
286
|
tag: "Component",
|
|
205
287
|
staticClass: "el-upload-list__item-thumbnail",
|
|
206
288
|
attrs: {
|
|
207
|
-
src: file.url
|
|
289
|
+
"src": file.url
|
|
208
290
|
}
|
|
209
291
|
}), _c("a", {
|
|
210
292
|
staticClass: "el-upload-list__item-name"
|
|
@@ -213,52 +295,55 @@ var render = function() {
|
|
|
213
295
|
}), _vm._v(" " + _vm._s(file.name) + " ")]), _c("i", {
|
|
214
296
|
staticClass: "el-icon-close",
|
|
215
297
|
on: {
|
|
216
|
-
click: function($event) {
|
|
217
|
-
|
|
298
|
+
"click": function($event) {
|
|
299
|
+
$event.stopPropagation();
|
|
300
|
+
return _vm.handleRemove(file);
|
|
218
301
|
}
|
|
219
302
|
}
|
|
220
303
|
})], 1) : _c("span", {
|
|
221
304
|
on: {
|
|
222
|
-
click: function($event) {
|
|
223
|
-
|
|
305
|
+
"click": function($event) {
|
|
306
|
+
$event.stopPropagation();
|
|
307
|
+
return _vm.handlePreview(file);
|
|
224
308
|
}
|
|
225
309
|
}
|
|
226
310
|
}, [_c("a", {
|
|
227
311
|
staticClass: "el-upload-list__item-name"
|
|
228
312
|
}, [_c("i", {
|
|
229
313
|
staticClass: "el-icon-document"
|
|
230
|
-
}), _vm._v(" " + _vm._s(file.name) + " ")]), _vm.disabled ?
|
|
314
|
+
}), _vm._v(" " + _vm._s(file.name) + " ")]), !_vm.disabled ? _c("i", {
|
|
231
315
|
staticClass: "el-icon-close",
|
|
232
316
|
on: {
|
|
233
|
-
click: function($event) {
|
|
234
|
-
|
|
317
|
+
"click": function($event) {
|
|
318
|
+
$event.stopPropagation();
|
|
319
|
+
return _vm.handleRemove(file);
|
|
235
320
|
}
|
|
236
321
|
}
|
|
237
|
-
})])];
|
|
322
|
+
}) : _vm._e()])];
|
|
238
323
|
}
|
|
239
|
-
}], null,
|
|
324
|
+
}], null, true)
|
|
240
325
|
}, [_vm.listType === "picture-card" ? [_c("i", {
|
|
241
326
|
staticClass: "el-icon-plus"
|
|
242
327
|
})] : _vm.listType === "picture-img" ? [_vm.$scopedSlots.default ? _vm._t("default", null, {
|
|
243
|
-
file: {
|
|
328
|
+
"file": {
|
|
244
329
|
url: _vm.imgUrl
|
|
245
330
|
}
|
|
246
331
|
}) : [_vm.isMediaType(_vm.imgUrl) ? _c(_vm.isMediaType(_vm.imgUrl), {
|
|
247
332
|
tag: "Component",
|
|
248
333
|
staticClass: "avue-upload__avatar",
|
|
249
334
|
attrs: {
|
|
250
|
-
src: _vm.imgUrl
|
|
335
|
+
"src": _vm.imgUrl
|
|
251
336
|
},
|
|
252
337
|
on: {
|
|
253
|
-
mouseover: function($event) {
|
|
254
|
-
_vm.menu =
|
|
338
|
+
"mouseover": function($event) {
|
|
339
|
+
_vm.menu = true;
|
|
255
340
|
}
|
|
256
341
|
}
|
|
257
342
|
}) : _vm.imgUrl ? _c("i", {
|
|
258
343
|
staticClass: "avue-upload__avatar el-icon-document",
|
|
259
344
|
on: {
|
|
260
|
-
mouseover: function($event) {
|
|
261
|
-
_vm.menu =
|
|
345
|
+
"mouseover": function($event) {
|
|
346
|
+
_vm.menu = true;
|
|
262
347
|
}
|
|
263
348
|
}
|
|
264
349
|
}) : _c("i", {
|
|
@@ -266,44 +351,48 @@ var render = function() {
|
|
|
266
351
|
}), _vm.menu ? _c("div", {
|
|
267
352
|
staticClass: "el-upload-list__item-actions avue-upload__menu",
|
|
268
353
|
on: {
|
|
269
|
-
mouseover: function($event) {
|
|
270
|
-
_vm.menu =
|
|
354
|
+
"mouseover": function($event) {
|
|
355
|
+
_vm.menu = true;
|
|
271
356
|
},
|
|
272
|
-
mouseout: function($event) {
|
|
273
|
-
_vm.menu =
|
|
357
|
+
"mouseout": function($event) {
|
|
358
|
+
_vm.menu = false;
|
|
274
359
|
},
|
|
275
|
-
click: function($event) {
|
|
360
|
+
"click": function($event) {
|
|
276
361
|
$event.stopPropagation();
|
|
277
362
|
}
|
|
278
363
|
}
|
|
279
364
|
}, [_c("i", {
|
|
280
365
|
staticClass: "el-icon-zoom-in",
|
|
281
366
|
on: {
|
|
282
|
-
click: function($event) {
|
|
283
|
-
|
|
367
|
+
"click": function($event) {
|
|
368
|
+
$event.stopPropagation();
|
|
369
|
+
return _vm.handlePreview({
|
|
284
370
|
url: _vm.imgUrl
|
|
285
371
|
});
|
|
286
372
|
}
|
|
287
373
|
}
|
|
288
|
-
}), _vm.disabled ?
|
|
374
|
+
}), !_vm.disabled ? _c("i", {
|
|
289
375
|
staticClass: "el-icon-delete",
|
|
290
376
|
on: {
|
|
291
|
-
click: function($event) {
|
|
292
|
-
|
|
377
|
+
"click": function($event) {
|
|
378
|
+
$event.stopPropagation();
|
|
379
|
+
return _vm.handleDelete(_vm.imgUrl);
|
|
293
380
|
}
|
|
294
381
|
}
|
|
295
|
-
})]) : _vm._e()]] : _vm.dragFile ? [_c("i", {
|
|
382
|
+
}) : _vm._e()]) : _vm._e()]] : _vm.dragFile ? [_c("i", {
|
|
296
383
|
staticClass: "el-icon-upload"
|
|
297
384
|
}), _c("div", {
|
|
298
385
|
staticClass: "el-upload__text"
|
|
299
386
|
}, [_c("em", [_vm._v(_vm._s(_vm.fileText || "上传"))])])] : [_c("ElButton", {
|
|
300
387
|
attrs: {
|
|
301
|
-
icon: "el-icon-upload",
|
|
302
|
-
size: _vm.size,
|
|
303
|
-
type: "primary"
|
|
388
|
+
"icon": "el-icon-upload",
|
|
389
|
+
"size": _vm.size,
|
|
390
|
+
"type": "primary"
|
|
304
391
|
}
|
|
305
392
|
}, [_vm._v(" " + _vm._s(_vm.fileText || "上传") + " ")])]], 2)], 1);
|
|
306
|
-
}
|
|
393
|
+
};
|
|
394
|
+
var staticRenderFns = [];
|
|
395
|
+
const FyUpload_vue_vue_type_style_index_0_lang = "";
|
|
307
396
|
function getFileUrl(home, uri = "") {
|
|
308
397
|
return uri.match(/(^http:\/\/|^https:\/\/|^\/\/|data:image\/)/) ? uri : home + uri;
|
|
309
398
|
}
|
|
@@ -315,11 +404,13 @@ const __vue2_script = {
|
|
|
315
404
|
ali: Object,
|
|
316
405
|
data: {
|
|
317
406
|
type: Object,
|
|
318
|
-
default: () =>
|
|
407
|
+
default: () => {
|
|
408
|
+
return {};
|
|
409
|
+
}
|
|
319
410
|
},
|
|
320
411
|
showFileList: {
|
|
321
412
|
type: Boolean,
|
|
322
|
-
default:
|
|
413
|
+
default: true
|
|
323
414
|
},
|
|
324
415
|
fileText: String,
|
|
325
416
|
fileType: {
|
|
@@ -333,7 +424,9 @@ const __vue2_script = {
|
|
|
333
424
|
},
|
|
334
425
|
headers: {
|
|
335
426
|
type: Object,
|
|
336
|
-
default: () =>
|
|
427
|
+
default: () => {
|
|
428
|
+
return {};
|
|
429
|
+
}
|
|
337
430
|
},
|
|
338
431
|
accept: {
|
|
339
432
|
type: [String, Array],
|
|
@@ -341,22 +434,26 @@ const __vue2_script = {
|
|
|
341
434
|
},
|
|
342
435
|
canvasOption: {
|
|
343
436
|
type: Object,
|
|
344
|
-
default: () =>
|
|
437
|
+
default: () => {
|
|
438
|
+
return {};
|
|
439
|
+
}
|
|
345
440
|
},
|
|
346
441
|
cropperOption: {
|
|
347
442
|
type: Object,
|
|
348
|
-
default: () =>
|
|
443
|
+
default: () => {
|
|
444
|
+
return {};
|
|
445
|
+
}
|
|
349
446
|
},
|
|
350
447
|
fileSize: {
|
|
351
448
|
type: Number
|
|
352
449
|
},
|
|
353
450
|
dragFile: {
|
|
354
451
|
type: Boolean,
|
|
355
|
-
default:
|
|
452
|
+
default: false
|
|
356
453
|
},
|
|
357
454
|
drag: {
|
|
358
455
|
type: Boolean,
|
|
359
|
-
default:
|
|
456
|
+
default: false
|
|
360
457
|
},
|
|
361
458
|
loadText: {
|
|
362
459
|
type: String,
|
|
@@ -377,17 +474,21 @@ const __vue2_script = {
|
|
|
377
474
|
data() {
|
|
378
475
|
return {
|
|
379
476
|
res: "",
|
|
380
|
-
loading:
|
|
381
|
-
menu:
|
|
477
|
+
loading: false,
|
|
478
|
+
menu: false,
|
|
382
479
|
reload: Math.random()
|
|
383
480
|
};
|
|
384
481
|
},
|
|
385
482
|
computed: {
|
|
386
483
|
isObject() {
|
|
387
|
-
|
|
484
|
+
const obj = this.text[0];
|
|
485
|
+
return typeof obj === "object";
|
|
388
486
|
},
|
|
389
487
|
acceptList() {
|
|
390
|
-
|
|
488
|
+
if (Array.isArray(this.accept)) {
|
|
489
|
+
return this.accept.join(",");
|
|
490
|
+
}
|
|
491
|
+
return this.accept;
|
|
391
492
|
},
|
|
392
493
|
homeUrl() {
|
|
393
494
|
return this.propsHttp.home || "";
|
|
@@ -406,15 +507,19 @@ const __vue2_script = {
|
|
|
406
507
|
},
|
|
407
508
|
// 单个头像图片
|
|
408
509
|
imgUrl() {
|
|
409
|
-
|
|
510
|
+
if (!isBlank(this.text)) {
|
|
511
|
+
return getFileUrl(this.homeUrl, this.text[0]);
|
|
512
|
+
}
|
|
513
|
+
return null;
|
|
410
514
|
},
|
|
411
515
|
fileList() {
|
|
412
516
|
const list = [];
|
|
413
|
-
|
|
517
|
+
(this.text || []).forEach((ele, index) => {
|
|
414
518
|
if (ele) {
|
|
415
519
|
const name = this.isObject ? ele[this.labelKey] : ele.substring(ele.lastIndexOf("/") + 1);
|
|
416
520
|
let url = this.isObject ? ele[this.valueKey] : ele;
|
|
417
|
-
url = getFileUrl(this.homeUrl, url)
|
|
521
|
+
url = getFileUrl(this.homeUrl, url);
|
|
522
|
+
list.push({
|
|
418
523
|
uid: `${index}`,
|
|
419
524
|
status: "done",
|
|
420
525
|
type: this.isMediaType(url),
|
|
@@ -422,11 +527,14 @@ const __vue2_script = {
|
|
|
422
527
|
url
|
|
423
528
|
});
|
|
424
529
|
}
|
|
425
|
-
})
|
|
530
|
+
});
|
|
531
|
+
return list;
|
|
426
532
|
}
|
|
427
533
|
},
|
|
428
534
|
mounted() {
|
|
429
|
-
this.drag
|
|
535
|
+
if (this.drag) {
|
|
536
|
+
this.setSort();
|
|
537
|
+
}
|
|
430
538
|
},
|
|
431
539
|
methods: {
|
|
432
540
|
isMediaType(url) {
|
|
@@ -442,18 +550,23 @@ const __vue2_script = {
|
|
|
442
550
|
animation: 100,
|
|
443
551
|
onEnd: (evt) => {
|
|
444
552
|
const targetRow = this.text.splice(evt.oldIndex, 1)[0];
|
|
445
|
-
this.text.splice(evt.newIndex, 0, targetRow)
|
|
553
|
+
this.text.splice(evt.newIndex, 0, targetRow);
|
|
554
|
+
this.reload = Math.random();
|
|
555
|
+
this.$nextTick(() => this.setSort());
|
|
446
556
|
}
|
|
447
557
|
});
|
|
448
558
|
},
|
|
449
559
|
handleSuccess(file) {
|
|
450
|
-
if (this.isPictureImg)
|
|
560
|
+
if (this.isPictureImg) {
|
|
451
561
|
this.text.splice(0, 1, file[this.urlKey]);
|
|
452
|
-
else if (this.isObject) {
|
|
562
|
+
} else if (this.isObject) {
|
|
453
563
|
const obj = {};
|
|
454
|
-
obj[this.labelKey] = file[this.nameKey]
|
|
455
|
-
|
|
564
|
+
obj[this.labelKey] = file[this.nameKey];
|
|
565
|
+
obj[this.valueKey] = file[this.urlKey];
|
|
566
|
+
this.text.push(obj);
|
|
567
|
+
} else {
|
|
456
568
|
this.text.push(file[this.urlKey]);
|
|
569
|
+
}
|
|
457
570
|
},
|
|
458
571
|
handleRemove(file) {
|
|
459
572
|
this.beforeRemove(file).then(() => {
|
|
@@ -466,24 +579,30 @@ const __vue2_script = {
|
|
|
466
579
|
delete(file) {
|
|
467
580
|
(this.text || []).forEach((ele, index) => {
|
|
468
581
|
const url = this.isObject ? ele[this.valueKey] : ele;
|
|
469
|
-
getFileUrl(this.homeUrl, url) === file.url
|
|
582
|
+
if (getFileUrl(this.homeUrl, url) === file.url) {
|
|
583
|
+
this.text.splice(index, 1);
|
|
584
|
+
}
|
|
470
585
|
});
|
|
471
586
|
},
|
|
472
587
|
show(data) {
|
|
473
|
-
this.loading =
|
|
588
|
+
this.loading = false;
|
|
589
|
+
this.res = data || this.res;
|
|
590
|
+
this.handleSuccess(this.res);
|
|
474
591
|
},
|
|
475
592
|
hide(msg) {
|
|
476
|
-
this.loading =
|
|
593
|
+
this.loading = false;
|
|
594
|
+
if (msg)
|
|
595
|
+
this.handleError(msg);
|
|
477
596
|
},
|
|
478
597
|
handleFileChange(file, fileList) {
|
|
479
598
|
fileList.splice(fileList.length - 1, 1);
|
|
480
599
|
},
|
|
481
600
|
httpUpload(config2) {
|
|
482
|
-
if (typeof this.httpRequest
|
|
601
|
+
if (typeof this.httpRequest === "function") {
|
|
483
602
|
this.httpRequest(config2);
|
|
484
603
|
return;
|
|
485
604
|
}
|
|
486
|
-
this.loading =
|
|
605
|
+
this.loading = true;
|
|
487
606
|
let file = config2.file;
|
|
488
607
|
const fileSize = file.size / 1024;
|
|
489
608
|
if (!isBlank(fileSize) && fileSize > this.fileSize) {
|
|
@@ -491,16 +610,21 @@ const __vue2_script = {
|
|
|
491
610
|
return;
|
|
492
611
|
}
|
|
493
612
|
const headers = Object.assign(this.headers, { "Content-Type": "multipart/form-data" });
|
|
494
|
-
let ossConfig = {}
|
|
495
|
-
|
|
613
|
+
let ossConfig = {};
|
|
614
|
+
let client = {};
|
|
615
|
+
const param = new FormData();
|
|
616
|
+
const done = () => {
|
|
496
617
|
const callback = (newFile) => {
|
|
497
618
|
let url = this.action;
|
|
498
|
-
for (const o in this.data)
|
|
619
|
+
for (const o in this.data) {
|
|
499
620
|
param.append(o, this.data[o]);
|
|
621
|
+
}
|
|
500
622
|
const uploadFile = newFile || file;
|
|
501
|
-
|
|
623
|
+
param.append(this.fileName, uploadFile);
|
|
624
|
+
if (this.isQiniuOss) {
|
|
502
625
|
if (!window.CryptoJS) {
|
|
503
|
-
packages.logs("CryptoJS")
|
|
626
|
+
packages.logs("CryptoJS");
|
|
627
|
+
this.hide();
|
|
504
628
|
return;
|
|
505
629
|
}
|
|
506
630
|
ossConfig = this.qiniu || this.$AVUE.qiniu;
|
|
@@ -508,80 +632,125 @@ const __vue2_script = {
|
|
|
508
632
|
scope: ossConfig.scope,
|
|
509
633
|
deadline: new Date().getTime() + ossConfig.deadline * 3600
|
|
510
634
|
});
|
|
511
|
-
param.append("token", token)
|
|
635
|
+
param.append("token", token);
|
|
636
|
+
url = ossConfig.bucket;
|
|
512
637
|
} else if (this.isAliOss) {
|
|
513
638
|
if (!window.OSS) {
|
|
514
|
-
packages.logs("AliOSS")
|
|
639
|
+
packages.logs("AliOSS");
|
|
640
|
+
this.hide();
|
|
515
641
|
return;
|
|
516
642
|
}
|
|
517
|
-
ossConfig = this.ali || this.$AVUE.ali
|
|
643
|
+
ossConfig = this.ali || this.$AVUE.ali;
|
|
644
|
+
client = getClient(ossConfig);
|
|
518
645
|
}
|
|
519
|
-
(() =>
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
646
|
+
(() => {
|
|
647
|
+
if (this.isAliOss) {
|
|
648
|
+
return client.put(uploadFile.name, uploadFile, {
|
|
649
|
+
headers: this.headers
|
|
650
|
+
});
|
|
651
|
+
} else {
|
|
652
|
+
return this.$axios.post(url, param, { headers });
|
|
653
|
+
}
|
|
654
|
+
})().then((res) => {
|
|
655
|
+
this.res = {};
|
|
656
|
+
if (this.isQiniuOss) {
|
|
657
|
+
res.data.key = ossConfig.url + res.data.key;
|
|
658
|
+
}
|
|
659
|
+
this.res = getAsVal(this.isAliOss ? res : res.data, this.resKey);
|
|
660
|
+
if (typeof this.uploadAfter === "function") {
|
|
661
|
+
this.uploadAfter(this.res, this.show, this.hide, this.column);
|
|
662
|
+
} else {
|
|
663
|
+
this.show();
|
|
664
|
+
}
|
|
523
665
|
}).catch((error) => {
|
|
524
666
|
this.hide(error);
|
|
525
667
|
});
|
|
526
668
|
};
|
|
527
|
-
typeof this.uploadBefore
|
|
669
|
+
if (typeof this.uploadBefore === "function") {
|
|
670
|
+
this.uploadBefore(file, callback, this.hide, this.column);
|
|
671
|
+
} else {
|
|
672
|
+
callback();
|
|
673
|
+
}
|
|
528
674
|
};
|
|
529
675
|
if (isMediaType(file.name) !== "img") {
|
|
530
676
|
done();
|
|
531
677
|
return;
|
|
532
678
|
}
|
|
533
679
|
const canvasDone = () => {
|
|
534
|
-
isBlank(this.canvasOption)
|
|
535
|
-
file
|
|
536
|
-
|
|
680
|
+
if (!isBlank(this.canvasOption)) {
|
|
681
|
+
detailImg(file, this.canvasOption, (res) => {
|
|
682
|
+
file = res;
|
|
683
|
+
done();
|
|
684
|
+
});
|
|
685
|
+
} else {
|
|
686
|
+
done();
|
|
687
|
+
}
|
|
537
688
|
};
|
|
538
|
-
isBlank(this.cropperOption)
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
689
|
+
if (!isBlank(this.cropperOption)) {
|
|
690
|
+
fileToBase64(file, (res) => {
|
|
691
|
+
const option = Object.assign(this.cropperOption, {
|
|
692
|
+
img: res,
|
|
693
|
+
type: "file",
|
|
694
|
+
callback: (res2) => {
|
|
695
|
+
file = res2;
|
|
696
|
+
canvasDone();
|
|
697
|
+
},
|
|
698
|
+
cancel: () => {
|
|
699
|
+
this.loading = false;
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
this.$ImageCropper(option);
|
|
548
703
|
});
|
|
549
|
-
|
|
550
|
-
|
|
704
|
+
} else {
|
|
705
|
+
canvasDone();
|
|
706
|
+
}
|
|
551
707
|
},
|
|
552
708
|
handleExceed(files, fileList) {
|
|
553
709
|
this.uploadExceed && this.uploadExceed(this.limit, files, fileList, this.column);
|
|
554
710
|
},
|
|
555
711
|
handlePreview(file) {
|
|
556
712
|
const callback = () => {
|
|
557
|
-
const index = this.fileList.findIndex((ele) =>
|
|
713
|
+
const index = this.fileList.findIndex((ele) => {
|
|
714
|
+
return ele.url === file.url;
|
|
715
|
+
});
|
|
558
716
|
this.$ImagePreview(this.fileList, index);
|
|
559
717
|
};
|
|
560
|
-
typeof this.uploadPreview
|
|
718
|
+
if (typeof this.uploadPreview === "function") {
|
|
719
|
+
this.uploadPreview(file, this.column, callback);
|
|
720
|
+
} else {
|
|
721
|
+
callback();
|
|
722
|
+
}
|
|
561
723
|
},
|
|
562
724
|
handleDelete(file) {
|
|
563
725
|
this.beforeRemove(file).then(() => {
|
|
564
|
-
this.text = []
|
|
726
|
+
this.text = [];
|
|
727
|
+
this.menu = false;
|
|
565
728
|
});
|
|
566
729
|
},
|
|
567
730
|
beforeRemove(file) {
|
|
568
|
-
|
|
731
|
+
if (typeof this.uploadDelete === "function") {
|
|
732
|
+
return this.uploadDelete(file, this.column);
|
|
733
|
+
} else {
|
|
734
|
+
return Promise.resolve();
|
|
735
|
+
}
|
|
569
736
|
}
|
|
570
737
|
}
|
|
571
|
-
}
|
|
738
|
+
};
|
|
739
|
+
const __cssModules = {};
|
|
572
740
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
573
741
|
__vue2_script,
|
|
574
742
|
render,
|
|
575
743
|
staticRenderFns,
|
|
576
|
-
|
|
744
|
+
false,
|
|
577
745
|
__vue2_injectStyles,
|
|
578
746
|
null,
|
|
579
747
|
null,
|
|
580
748
|
null
|
|
581
749
|
);
|
|
582
750
|
function __vue2_injectStyles(context) {
|
|
583
|
-
for (let o in __cssModules)
|
|
751
|
+
for (let o in __cssModules) {
|
|
584
752
|
this[o] = __cssModules[o];
|
|
753
|
+
}
|
|
585
754
|
}
|
|
586
755
|
const FyUpload = /* @__PURE__ */ function() {
|
|
587
756
|
return __component__.exports;
|