@web-utils/component 2.0.13 → 2.2.0
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/address-input/index.mjs +113 -0
- package/address-input/style.css +1 -0
- package/affix/index.mjs +102 -0
- package/affix/style.css +1 -0
- package/aside-menu/index.mjs +58 -0
- package/aside-menu/style.css +1 -0
- package/avatar/index.mjs +106 -0
- package/avatar/style.css +1 -0
- package/awesome-button/index.mjs +112 -0
- package/base.css +1 -0
- package/capsule-tab/index.mjs +52 -0
- package/capsule-tab/style.css +1 -0
- package/card/index.mjs +126 -0
- package/card/style.css +1 -0
- package/carousel/index.mjs +70 -0
- package/carousel/style.css +1 -0
- package/chat/index.mjs +576 -0
- package/chat/style.css +1 -0
- package/chunk-file-uploader/index.mjs +121 -0
- package/chunk-file-uploader/style.css +1 -0
- package/chunks/FormTemp.FX8xmbVB.mjs +165 -0
- package/chunks/confirmable-mixin.rTUMhoRH.mjs +106 -0
- package/chunks/dataformat.X_61lMA7.mjs +158 -0
- package/chunks/dic.6tk91Dmq.mjs +130 -0
- package/chunks/event.NHA7rYFE.mjs +236 -0
- package/chunks/form-input-mixin.IKogWBfn.mjs +24 -0
- package/chunks/form-item-mixin.BilKDUlK.mjs +140 -0
- package/{dist/chunks/822300f3.js → chunks/form-pick-mixin.y-qhZJi6.mjs} +3 -3
- package/chunks/index.LGsb2aDq.mjs +185 -0
- package/chunks/init.Ac4dKUJB.mjs +122 -0
- package/{dist/chunks/44b78389.js → chunks/input-number-mixin.GE2zr_3s.mjs} +8 -8
- package/chunks/json-beautifier.fUZFSW5j.mjs +126 -0
- package/chunks/packages.v6r2Hr7E.mjs +58 -0
- package/chunks/permission.E9kZbW48.mjs +16 -0
- package/chunks/slot.j1uMmBnG.mjs +27 -0
- package/chunks/tab-mixin.tM9jcRT8.mjs +81 -0
- package/chunks/util.C2Bhx22L.mjs +259 -0
- package/chunks/vueComponentNormalizer.JwmUNtgn.mjs +32 -0
- package/code-mirror-editor/index.mjs +313 -0
- package/code-mirror-editor/style.css +1 -0
- package/color-picker/index.mjs +128 -0
- package/comment/index.mjs +90 -0
- package/comment/style.css +1 -0
- package/confirm-button/index.mjs +57 -0
- package/confirmable/index.mjs +28 -0
- package/context-menu/index.mjs +255 -0
- package/context-menu/style.css +1 -0
- package/count-up/index.mjs +131 -0
- package/custom-scrollbar/index.mjs +116 -0
- package/data-box/index.mjs +97 -0
- package/data-box/style.css +1 -0
- package/data-card/index.mjs +98 -0
- package/data-card/style.css +1 -0
- package/data-cardtext/index.mjs +82 -0
- package/data-cardtext/style.css +1 -0
- package/data-display/index.mjs +97 -0
- package/data-display/style.css +1 -0
- package/data-icons/index.mjs +104 -0
- package/data-icons/style.css +1 -0
- package/data-imgtext/index.mjs +106 -0
- package/data-imgtext/style.css +1 -0
- package/data-operatext/index.mjs +99 -0
- package/data-operatext/style.css +1 -0
- package/data-panel/index.mjs +93 -0
- package/data-panel/style.css +1 -0
- package/data-pay/index.mjs +152 -0
- package/data-pay/style.css +1 -0
- package/data-price/index.mjs +84 -0
- package/data-price/style.css +1 -0
- package/data-progress/index.mjs +97 -0
- package/data-progress/style.css +1 -0
- package/data-rotate/index.mjs +96 -0
- package/data-rotate/style.css +1 -0
- package/data-table-picker/index.mjs +137 -0
- package/data-tabs/index.mjs +94 -0
- package/data-tabs/style.css +1 -0
- package/dialog-form/index.mjs +148 -0
- package/dialog-form/style.css +1 -0
- package/dynamic-table/index.mjs +195 -0
- package/dynamic-table/style.css +1 -0
- package/e-charts/index.mjs +216 -0
- package/e-charts/style.css +1 -0
- package/easy-popup/index.mjs +136 -0
- package/easy-popup/style.css +1 -0
- package/editable-progress/index.mjs +141 -0
- package/editable-progress/style.css +1 -0
- package/editable-tree/index.mjs +844 -0
- package/editable-tree/style.css +1 -0
- package/egd-collapse/index.mjs +79 -0
- package/egd-collapse-item/index.mjs +134 -0
- package/element-dialog/index.mjs +296 -0
- package/element-dialog/style.css +1 -0
- package/empty-view/index.mjs +69 -0
- package/empty-view/style.css +1 -0
- package/error-view/index.mjs +61 -0
- package/error-view/style.css +1 -0
- package/flex-column/index.mjs +62 -0
- package/flex-item/index.mjs +81 -0
- package/flex-row/index.mjs +62 -0
- package/flex-scroller/index.mjs +47 -0
- package/flex-scroller/style.css +1 -0
- package/flow/index.mjs +277 -0
- package/flow/style.css +1 -0
- package/flow-designer/index.mjs +10184 -0
- package/flow-designer/style.css +1 -0
- package/flow-node/index.mjs +102 -0
- package/flow-viewer/index.mjs +209 -0
- package/flow-viewer/style.css +1 -0
- package/form-block/index.mjs +156 -0
- package/form-block/style.css +1 -0
- package/form-button/index.mjs +58 -0
- package/form-cascader/index.mjs +163 -0
- package/form-checkbox-group/index.mjs +203 -0
- package/form-checkbox-group/style.css +1 -0
- package/form-date-picker/index.mjs +191 -0
- package/form-holder/index.mjs +129 -0
- package/form-input/index.mjs +117 -0
- package/form-input-email/index.mjs +108 -0
- package/form-input-id-card/index.mjs +115 -0
- package/form-input-number/index.mjs +134 -0
- package/form-input-number/style.css +1 -0
- package/form-input-phone-number/index.mjs +109 -0
- package/form-input-tag/index.mjs +108 -0
- package/form-input-time/index.mjs +135 -0
- package/form-item/index.mjs +147 -0
- package/form-item/style.css +1 -0
- package/form-item-config-provider/index.mjs +63 -0
- package/form-item-group/index.mjs +169 -0
- package/form-item-group/style.css +1 -0
- package/form-radio-group/index.mjs +181 -0
- package/form-radio-group/style.css +1 -0
- package/form-select/index.mjs +165 -0
- package/form-switch/index.mjs +108 -0
- package/form-textarea/index.mjs +113 -0
- package/form-view/index.mjs +371 -0
- package/form-view/style.css +1 -0
- package/fy-array/index.mjs +158 -0
- package/fy-array/style.css +1 -0
- package/fy-article/index.mjs +93 -0
- package/fy-article/style.css +1 -0
- package/fy-cascader/index.mjs +132 -0
- package/fy-checkbox/index.mjs +117 -0
- package/fy-checkbox/style.css +1 -0
- package/fy-code/index.mjs +66 -0
- package/fy-curd/index.mjs +3119 -0
- package/fy-curd/style.css +1 -0
- package/fy-date/index.mjs +84 -0
- package/fy-date/style.css +1 -0
- package/fy-draggable/index.mjs +382 -0
- package/fy-draggable/style.css +1 -0
- package/fy-dynamic/index.mjs +337 -0
- package/fy-dynamic/style.css +1 -0
- package/fy-empty/index.mjs +59 -0
- package/fy-empty/style.css +1 -0
- package/fy-form/index.mjs +993 -0
- package/fy-form/style.css +1 -0
- package/fy-form-design/index.mjs +7483 -0
- package/fy-form-design/style.css +1 -0
- package/fy-input/index.mjs +171 -0
- package/fy-input-color/index.mjs +101 -0
- package/fy-input-icon/index.mjs +169 -0
- package/fy-input-icon/style.css +1 -0
- package/fy-input-map/index.mjs +279 -0
- package/fy-input-map/style.css +1 -0
- package/fy-input-number/index.mjs +87 -0
- package/fy-input-table/index.mjs +172 -0
- package/fy-input-table/style.css +1 -0
- package/fy-input-tree/index.mjs +267 -0
- package/fy-input-tree/style.css +1 -0
- package/fy-progress/index.mjs +60 -0
- package/fy-radio/index.mjs +70 -0
- package/fy-radio/style.css +1 -0
- package/fy-rate/index.mjs +106 -0
- package/fy-rate/style.css +1 -0
- package/fy-select/index.mjs +225 -0
- package/fy-select/style.css +1 -0
- package/fy-slider/index.mjs +79 -0
- package/fy-switch/index.mjs +74 -0
- package/fy-tabs/index.mjs +92 -0
- package/fy-time/index.mjs +95 -0
- package/fy-title/index.mjs +40 -0
- package/fy-title/style.css +1 -0
- package/fy-tree/index.mjs +433 -0
- package/fy-tree/style.css +1 -0
- package/fy-u-editor/index.mjs +398 -0
- package/fy-u-editor/style.css +1 -0
- package/fy-upload/index.mjs +592 -0
- package/fy-upload/style.css +1 -0
- package/guide-steps/index.mjs +94 -0
- package/guide-steps/style.css +1 -0
- package/highlight-j-s/index.mjs +76 -0
- package/highlight-j-s/style.css +1 -0
- package/icon-card/index.mjs +62 -0
- package/icon-card/style.css +1 -0
- package/icon-temp/index.mjs +50 -0
- package/icon-temp/style.css +1 -0
- package/iframe-window/index.mjs +61 -0
- package/iframe-window/style.css +1 -0
- package/image-cropper/index.mjs +249 -0
- package/image-cropper/style.css +1 -0
- package/image-preview/index.mjs +260 -0
- package/image-preview/style.css +1 -0
- package/image-viewer/index.mjs +95 -0
- package/image-viewer/style.css +1 -0
- package/index.mjs +627 -0
- package/input-number/index.mjs +274 -0
- package/input-number/style.css +1 -0
- package/input-number-range/index.mjs +110 -0
- package/input-number-range/style.css +1 -0
- package/{dist/components/j-s-x-component/index.js → j-s-x-component/index.mjs} +4 -4
- package/keep-view-alive/index.mjs +123 -0
- package/keyboard/index.mjs +384 -0
- package/keyboard/style.css +1 -0
- package/license/index.mjs +134 -0
- package/loading-view/index.mjs +61 -0
- package/loading-view/style.css +1 -0
- package/login/index.mjs +250 -0
- package/login/style.css +1 -0
- package/monaco-editor/index.mjs +197 -0
- package/name-avatar/index.mjs +66 -0
- package/name-avatar/style.css +1 -0
- package/nav-bar/index.mjs +52 -0
- package/nav-bar/style.css +1 -0
- package/not-implement/index.mjs +35 -0
- package/not-implement/style.css +1 -0
- package/notice/index.mjs +143 -0
- package/notice/style.css +1 -0
- package/package.json +41 -148
- package/page/index.mjs +40 -0
- package/page/style.css +1 -0
- package/page-header/index.mjs +56 -0
- package/page-header/style.css +1 -0
- package/page-index/index.mjs +175 -0
- package/page-index/style.css +1 -0
- package/page-index-top/index.mjs +141 -0
- package/page-skeleton/index.mjs +67 -0
- package/page-skeleton/style.css +1 -0
- package/page-skeleton-new/index.mjs +98 -0
- package/page-skeleton-new/style.css +1 -0
- package/pageable-table/index.mjs +478 -0
- package/pageable-table/style.css +1 -0
- package/pageable-view/index.mjs +378 -0
- package/pageable-view/style.css +1 -0
- package/photo-swipe/index.mjs +129 -0
- package/present-view/index.mjs +365 -0
- package/present-view/style.css +1 -0
- package/queue/index.mjs +71 -0
- package/queue/style.css +1 -0
- package/record-video/index.mjs +173 -0
- package/record-video/style.css +1 -0
- package/resize-observer/index.mjs +62 -0
- package/resize-observer/style.css +1 -0
- package/search/index.mjs +143 -0
- package/search/style.css +1 -0
- package/search-popover/index.mjs +412 -0
- package/search-popover/style.css +1 -0
- package/sign/index.mjs +132 -0
- package/sign/style.css +1 -0
- package/sign-panel/index.mjs +255 -0
- package/sign-panel/style.css +1 -0
- package/skeleton/index.mjs +82 -0
- package/skeleton/style.css +1 -0
- package/split-pane/index.mjs +306 -0
- package/split-pane/style.css +1 -0
- package/stateful/index.mjs +84 -0
- package/stateful/style.css +1 -0
- package/static-pageable-table/index.mjs +92 -0
- package/static-pageable-table/style.css +1 -0
- package/swiper/index.mjs +183 -0
- package/swiper/style.css +1 -0
- package/tab/index.mjs +147 -0
- package/tab/style.css +1 -0
- package/tab-item/index.mjs +73 -0
- package/table-column/index.mjs +102 -0
- package/table-view/index.mjs +390 -0
- package/table-view/style.css +1 -0
- package/tag-render/index.mjs +116 -0
- package/tag-render/style.css +1 -0
- package/text-ellipsis/index.mjs +108 -0
- package/text-ellipsis/style.css +1 -0
- package/{dist/components/tinymce-wrapper/index.js → tinymce-editor/index.mjs} +479 -133
- package/tinymce-editor/style.css +1 -0
- package/toolbar/index.mjs +217 -0
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.mjs +108 -0
- package/toolbar-button/style.css +1 -0
- package/verify/index.mjs +80 -0
- package/verify/style.css +1 -0
- package/vue-cron/index.mjs +1410 -0
- package/vue-cron/style.css +1 -0
- package/vue-qr-code/index.mjs +83 -0
- package/vue-quill-editor/index.mjs +117 -0
- package/vue-quill-editor/style.css +1 -0
- package/vue-tags-input/index.mjs +553 -0
- package/vue-tags-input/style.css +1 -0
- package/vue-tree-select/index.mjs +2881 -0
- package/vue-tree-select/style.css +1 -0
- package/vue-video-player/index.mjs +192 -0
- package/vue-video-player/style.css +1 -0
- package/watermark/index.mjs +95 -0
- package/watermark/style.css +1 -0
- package/web-types.json +14033 -2752
- package/x-input-tag/index.mjs +203 -0
- package/x-input-tag/style.css +1 -0
- package/README.md +0 -27
- package/dist/chunks/3d28cc08.js +0 -57
- package/dist/chunks/5d33812d.js +0 -147
- package/dist/chunks/9d848bf6.js +0 -99
- package/dist/chunks/a0bb327b.js +0 -96
- package/dist/chunks/a8891d2c.js +0 -30
- package/dist/chunks/c69d5628.js +0 -248
- package/dist/chunks/de9fe802.js +0 -24
- package/dist/chunks/e1939731.js +0 -17
- package/dist/components/address-input/index.js +0 -126
- package/dist/components/address-input/style.css +0 -15
- package/dist/components/aside-menu/index.js +0 -64
- package/dist/components/aside-menu/style.css +0 -9
- package/dist/components/awesome-button/index.js +0 -85
- package/dist/components/base.css +0 -66
- package/dist/components/capsule-tab/index.js +0 -58
- package/dist/components/capsule-tab/style.css +0 -32
- package/dist/components/chunk-file-uploader/index.js +0 -153
- package/dist/components/chunk-file-uploader/style.css +0 -4
- package/dist/components/chunk-file-uploader-button/index.js +0 -66
- package/dist/components/chunk-file-uploader-button/style.css +0 -17
- package/dist/components/chunk-file-uploader-drop/index.js +0 -79
- package/dist/components/chunk-file-uploader-drop/style.css +0 -12
- package/dist/components/chunk-file-uploader-file/index.js +0 -388
- package/dist/components/chunk-file-uploader-file/style.css +0 -125
- package/dist/components/chunk-file-uploader-files/index.js +0 -55
- package/dist/components/chunk-file-uploader-files/style.css +0 -9
- package/dist/components/chunk-file-uploader-list/index.js +0 -56
- package/dist/components/chunk-file-uploader-list/style.css +0 -9
- package/dist/components/chunk-file-uploader-un-support/index.js +0 -59
- package/dist/components/chunk-file-uploader-un-support/style.css +0 -6
- package/dist/components/code-mirror-editor/index.js +0 -338
- package/dist/components/code-mirror-editor/style.css +0 -17
- package/dist/components/color-picker/index.js +0 -129
- package/dist/components/confirm-button/index.js +0 -59
- package/dist/components/confirmable/index.js +0 -29
- package/dist/components/context-menu/index.js +0 -265
- package/dist/components/context-menu/style.css +0 -88
- package/dist/components/custom-scrollbar/index.js +0 -167
- package/dist/components/data-table-picker/index.js +0 -156
- package/dist/components/dynamic-table/index.js +0 -219
- package/dist/components/dynamic-table/style.css +0 -30
- package/dist/components/e-charts/index.js +0 -310
- package/dist/components/e-charts/style.css +0 -10
- package/dist/components/editable-progress/index.js +0 -174
- package/dist/components/editable-progress/style.css +0 -37
- package/dist/components/editable-tree/index.js +0 -1004
- package/dist/components/editable-tree/style.css +0 -82
- package/dist/components/egd-collapse/index.js +0 -92
- package/dist/components/egd-collapse-item/index.js +0 -148
- package/dist/components/element-dialog/index.js +0 -295
- package/dist/components/element-dialog/style.css +0 -102
- package/dist/components/empty-view/index.js +0 -75
- package/dist/components/empty-view/style.css +0 -17
- package/dist/components/error-view/index.js +0 -67
- package/dist/components/error-view/style.css +0 -17
- package/dist/components/flex-column/index.js +0 -65
- package/dist/components/flex-item/index.js +0 -94
- package/dist/components/flex-row/index.js +0 -65
- package/dist/components/flex-scroller/index.js +0 -53
- package/dist/components/flex-scroller/style.css +0 -20
- package/dist/components/form-button/index.js +0 -84
- package/dist/components/form-cascader/index.js +0 -161
- package/dist/components/form-checkbox-group/index.js +0 -217
- package/dist/components/form-checkbox-group/style.css +0 -51
- package/dist/components/form-date-picker/index.js +0 -244
- package/dist/components/form-holder/index.js +0 -97
- package/dist/components/form-input/index.js +0 -112
- package/dist/components/form-input-email/index.js +0 -109
- package/dist/components/form-input-id-card/index.js +0 -110
- package/dist/components/form-input-number/index.js +0 -130
- package/dist/components/form-input-number/style.css +0 -12
- package/dist/components/form-input-phone-number/index.js +0 -104
- package/dist/components/form-input-time/index.js +0 -130
- package/dist/components/form-item/index.js +0 -162
- package/dist/components/form-item/style.css +0 -11
- package/dist/components/form-item-config-provider/index.js +0 -64
- package/dist/components/form-item-group/index.js +0 -195
- package/dist/components/form-item-group/style.css +0 -30
- package/dist/components/form-radio-group/index.js +0 -189
- package/dist/components/form-radio-group/style.css +0 -53
- package/dist/components/form-select/index.js +0 -169
- package/dist/components/form-switch/index.js +0 -103
- package/dist/components/form-textarea/index.js +0 -108
- package/dist/components/form-view/index.js +0 -410
- package/dist/components/form-view/style.css +0 -158
- package/dist/components/guide-steps/index.js +0 -108
- package/dist/components/guide-steps/style.css +0 -34
- package/dist/components/icon-card/index.js +0 -68
- package/dist/components/icon-card/style.css +0 -56
- package/dist/components/iframe-window/index.js +0 -67
- package/dist/components/iframe-window/style.css +0 -20
- package/dist/components/image-viewer/index.js +0 -113
- package/dist/components/image-viewer/style.css +0 -21
- package/dist/components/input-number/index.js +0 -340
- package/dist/components/input-number/style.css +0 -15
- package/dist/components/input-number-range/index.js +0 -122
- package/dist/components/input-number-range/style.css +0 -12
- package/dist/components/keep-view-alive/index.js +0 -166
- package/dist/components/loading-view/index.js +0 -67
- package/dist/components/loading-view/style.css +0 -17
- package/dist/components/nav-bar/index.js +0 -62
- package/dist/components/nav-bar/style.css +0 -17
- package/dist/components/not-implement/index.js +0 -43
- package/dist/components/not-implement/style.css +0 -15
- package/dist/components/page/index.js +0 -46
- package/dist/components/page/style.css +0 -12
- package/dist/components/page-header/index.js +0 -62
- package/dist/components/page-header/style.css +0 -14
- package/dist/components/page-index/index.js +0 -172
- package/dist/components/page-index/style.css +0 -23
- package/dist/components/page-index-top/index.js +0 -134
- package/dist/components/page-skeleton/index.js +0 -62
- package/dist/components/page-skeleton/style.css +0 -23
- package/dist/components/page-skeleton-new/index.js +0 -104
- package/dist/components/page-skeleton-new/style.css +0 -42
- package/dist/components/pageable-table/index.js +0 -496
- package/dist/components/pageable-table/style.css +0 -72
- package/dist/components/pageable-view/index.js +0 -398
- package/dist/components/pageable-view/style.css +0 -69
- package/dist/components/photo-swipe/index.js +0 -228
- package/dist/components/photo-swipe/style.css +0 -20
- package/dist/components/resize-observer/index.js +0 -96
- package/dist/components/resize-observer/style.css +0 -31
- package/dist/components/search-popover/index.js +0 -449
- package/dist/components/search-popover/style.css +0 -93
- package/dist/components/sign-panel/index.js +0 -292
- package/dist/components/sign-panel/style.css +0 -97
- package/dist/components/split-pane/index.js +0 -270
- package/dist/components/split-pane/style.css +0 -100
- package/dist/components/stateful/index.js +0 -87
- package/dist/components/stateful/style.css +0 -33
- package/dist/components/static-pageable-table/index.js +0 -99
- package/dist/components/static-pageable-table/style.css +0 -9
- package/dist/components/swiper/index.js +0 -223
- package/dist/components/swiper/style.css +0 -43
- package/dist/components/tab/index.js +0 -163
- package/dist/components/tab/style.css +0 -122
- package/dist/components/tab-item/index.js +0 -78
- package/dist/components/table-column/index.js +0 -91
- package/dist/components/table-view/index.js +0 -434
- package/dist/components/table-view/style.css +0 -95
- package/dist/components/tag-render/index.js +0 -111
- package/dist/components/tag-render/style.css +0 -33
- package/dist/components/tinymce-editor/index.js +0 -189
- package/dist/components/tinymce-editor/style.css +0 -43
- package/dist/components/tinymce-wrapper/style.css +0 -36
- package/dist/components/toolbar/index.js +0 -238
- package/dist/components/toolbar/style.css +0 -39
- package/dist/components/toolbar-button/index.js +0 -97
- package/dist/components/toolbar-button/style.css +0 -21
- package/dist/components/trigger/index.js +0 -78
- package/dist/components/vue-tags-input/index.js +0 -559
- package/dist/components/vue-tags-input/style.css +0 -682
- package/dist/components/watermark/index.js +0 -75
- package/dist/components/watermark/style.css +0 -11
- package/dist/components/x-dialog/index.js +0 -199
- package/dist/components/x-dialog/style.css +0 -15
- package/dist/index.css +0 -2972
- package/dist/index.es.js +0 -15689
|
@@ -1,1004 +0,0 @@
|
|
|
1
|
-
import { hasOwn, addResizeListener, removeResizeListener, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, cloneDeep, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
|
|
2
|
-
import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/c69d5628.js";
|
|
3
|
-
import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
|
|
4
|
-
var render = function() {
|
|
5
|
-
var _vm = this;
|
|
6
|
-
var _h = _vm.$createElement;
|
|
7
|
-
var _c = _vm._self._c || _h;
|
|
8
|
-
return _c("div", {
|
|
9
|
-
staticClass: "editable-tree"
|
|
10
|
-
}, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top-right" ? _c("ElButton", {
|
|
11
|
-
staticStyle: {
|
|
12
|
-
"position": "absolute",
|
|
13
|
-
"top": "4px",
|
|
14
|
-
"z-index": "1"
|
|
15
|
-
},
|
|
16
|
-
style: {
|
|
17
|
-
right: `${_vm.right}px`
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
"type": "primary",
|
|
21
|
-
"size": "mini",
|
|
22
|
-
"icon": "el-icon-plus",
|
|
23
|
-
"circle": "",
|
|
24
|
-
"plain": ""
|
|
25
|
-
},
|
|
26
|
-
on: {
|
|
27
|
-
"click": function($event) {
|
|
28
|
-
$event.stopPropagation();
|
|
29
|
-
return _vm.$emit("add-root-node");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}) : _vm._e(), _c("div", {
|
|
33
|
-
ref: "treeWrapper",
|
|
34
|
-
staticClass: "et-tree-wrapper"
|
|
35
|
-
}, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top" ? _c("div", {
|
|
36
|
-
staticStyle: {
|
|
37
|
-
"padding-left": "24px"
|
|
38
|
-
}
|
|
39
|
-
}, [_c("ElButton", {
|
|
40
|
-
attrs: {
|
|
41
|
-
"disabled": _vm.loading,
|
|
42
|
-
"size": "mini",
|
|
43
|
-
"type": "text"
|
|
44
|
-
},
|
|
45
|
-
on: {
|
|
46
|
-
"click": _vm.appendRootNode
|
|
47
|
-
}
|
|
48
|
-
}, [_c("i", {
|
|
49
|
-
staticClass: "el-icon-lx-add"
|
|
50
|
-
}), _vm._v(" " + _vm._s(_vm.addRootNodeLabel ? _vm.addRootNodeLabel : `添加${_vm.label}`) + " ")])], 1) : _vm._e(), _c("ElTree", _vm._g(_vm._b({
|
|
51
|
-
key: _vm.treeKey,
|
|
52
|
-
ref: "tree",
|
|
53
|
-
staticClass: "flex-item",
|
|
54
|
-
attrs: {
|
|
55
|
-
"default-expanded-keys": _vm.expandedKeys,
|
|
56
|
-
"expand-on-click-node": false,
|
|
57
|
-
"highlight-current": "",
|
|
58
|
-
"load": _vm.loadNode,
|
|
59
|
-
"data": _vm.innerTreeData,
|
|
60
|
-
"props": _vm.treeProps,
|
|
61
|
-
"lazy": _vm.lazy,
|
|
62
|
-
"node-key": _vm.nodeKey
|
|
63
|
-
},
|
|
64
|
-
on: {
|
|
65
|
-
"node-click": _vm.nodeClick,
|
|
66
|
-
"node-contextmenu": _vm.showContextMenu,
|
|
67
|
-
"node-expand": _vm.addExpandKey,
|
|
68
|
-
"node-collapse": _vm.removeExpandKey
|
|
69
|
-
},
|
|
70
|
-
scopedSlots: _vm._u([{
|
|
71
|
-
key: "default",
|
|
72
|
-
fn: function(_ref) {
|
|
73
|
-
var node = _ref.node, data = _ref.data;
|
|
74
|
-
return [_vm._t("default", function() {
|
|
75
|
-
return [!data.edit ? [_c("span", {
|
|
76
|
-
staticClass: "custom-tree-node",
|
|
77
|
-
attrs: {
|
|
78
|
-
"data-id": data.id
|
|
79
|
-
}
|
|
80
|
-
}, [_c("span", {
|
|
81
|
-
staticClass: "node-label flex-row flex-item oh ellipsis-1"
|
|
82
|
-
}, [_vm.icon ? _c("i", {
|
|
83
|
-
staticClass: "node-icon",
|
|
84
|
-
class: data.loading ? "el-icon-loading" : _vm.icon(data, node)
|
|
85
|
-
}) : _vm._e(), _c("span", {
|
|
86
|
-
staticClass: "flex-item-relative",
|
|
87
|
-
staticStyle: {
|
|
88
|
-
"height": "21px"
|
|
89
|
-
}
|
|
90
|
-
}, [_c("span", {
|
|
91
|
-
staticClass: "ellipsis-1 absolute-box et-tree-label",
|
|
92
|
-
attrs: {
|
|
93
|
-
"title": node.label
|
|
94
|
-
}
|
|
95
|
-
}, [_vm._t("label", function() {
|
|
96
|
-
return [_vm._v(_vm._s(node.label))];
|
|
97
|
-
}, {
|
|
98
|
-
"data": data,
|
|
99
|
-
"node": node
|
|
100
|
-
})], 2)]), _vm._t("label-suffix", null, {
|
|
101
|
-
"node": node,
|
|
102
|
-
"data": data
|
|
103
|
-
})], 2), !_vm.contextMenu && !_vm.readonly ? _c("span", {
|
|
104
|
-
directives: [{
|
|
105
|
-
name: "show",
|
|
106
|
-
rawName: "v-show",
|
|
107
|
-
value: !data.loading && !_vm.loading,
|
|
108
|
-
expression: "!data.loading && !loading"
|
|
109
|
-
}],
|
|
110
|
-
staticClass: "handle-actions"
|
|
111
|
-
}, [_c("ElButton", {
|
|
112
|
-
attrs: {
|
|
113
|
-
"size": "mini",
|
|
114
|
-
"type": "text"
|
|
115
|
-
},
|
|
116
|
-
on: {
|
|
117
|
-
"click": function($event) {
|
|
118
|
-
$event.stopPropagation();
|
|
119
|
-
return _vm.appendChildNode(node, data);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}, [_vm._v("添加")]), _c("ElButton", {
|
|
123
|
-
attrs: {
|
|
124
|
-
"size": "mini",
|
|
125
|
-
"type": "text"
|
|
126
|
-
},
|
|
127
|
-
on: {
|
|
128
|
-
"click": function($event) {
|
|
129
|
-
$event.stopPropagation();
|
|
130
|
-
return _vm.editNode(node, data);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}, [_vm._v("修改")]), _c("ElPopconfirm", {
|
|
134
|
-
staticClass: "pop-confirm",
|
|
135
|
-
attrs: {
|
|
136
|
-
"icon-color": "red",
|
|
137
|
-
"title": "你确定要删除吗?"
|
|
138
|
-
},
|
|
139
|
-
on: {
|
|
140
|
-
"confirm": function($event) {
|
|
141
|
-
return _vm.removeNode(node, data);
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
scopedSlots: _vm._u([{
|
|
145
|
-
key: "reference",
|
|
146
|
-
fn: function() {
|
|
147
|
-
return [_c("ElButton", {
|
|
148
|
-
directives: [{
|
|
149
|
-
name: "show",
|
|
150
|
-
rawName: "v-show",
|
|
151
|
-
value: node.isLeaf,
|
|
152
|
-
expression: "node.isLeaf"
|
|
153
|
-
}],
|
|
154
|
-
staticStyle: {
|
|
155
|
-
"margin-left": "4px"
|
|
156
|
-
},
|
|
157
|
-
attrs: {
|
|
158
|
-
"size": "mini",
|
|
159
|
-
"type": "text"
|
|
160
|
-
},
|
|
161
|
-
on: {
|
|
162
|
-
"click": function($event) {
|
|
163
|
-
$event.stopPropagation();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}, [_vm._v("删除")])];
|
|
167
|
-
},
|
|
168
|
-
proxy: true
|
|
169
|
-
}], null, true)
|
|
170
|
-
})], 1) : _vm._e(), _vm.contextMenuIcon && _vm.contextMenu && !_vm.readonly ? _c("span", {
|
|
171
|
-
directives: [{
|
|
172
|
-
name: "show",
|
|
173
|
-
rawName: "v-show",
|
|
174
|
-
value: !data.loading && !_vm.loading,
|
|
175
|
-
expression: "!data.loading && !loading"
|
|
176
|
-
}],
|
|
177
|
-
staticClass: "handle-actions",
|
|
178
|
-
staticStyle: {
|
|
179
|
-
"display": "inline-block"
|
|
180
|
-
}
|
|
181
|
-
}, [_c("ElButton", {
|
|
182
|
-
staticStyle: {
|
|
183
|
-
"padding": "6px 10px 0"
|
|
184
|
-
},
|
|
185
|
-
attrs: {
|
|
186
|
-
"size": "mini",
|
|
187
|
-
"type": "text"
|
|
188
|
-
},
|
|
189
|
-
on: {
|
|
190
|
-
"click": function($event) {
|
|
191
|
-
$event.stopPropagation();
|
|
192
|
-
return _vm.showContextMenu($event, data, node);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}, [_vm._v(". . .")])], 1) : _vm._e()])] : [_c("span", {
|
|
196
|
-
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
197
|
-
attrs: {
|
|
198
|
-
"data-id": data.id
|
|
199
|
-
}
|
|
200
|
-
}, [_vm.icon ? _c("i", {
|
|
201
|
-
staticClass: "node-icon shrink-0",
|
|
202
|
-
class: data.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
203
|
-
}) : _vm._e(), _c("ElInput", {
|
|
204
|
-
ref: "labelTxt",
|
|
205
|
-
staticClass: "node-input flex-item",
|
|
206
|
-
attrs: {
|
|
207
|
-
"size": "mini",
|
|
208
|
-
"placeholder": _vm.defaultOptions.inputPlaceholder
|
|
209
|
-
},
|
|
210
|
-
on: {
|
|
211
|
-
"blur": function(event) {
|
|
212
|
-
return _vm.inputBlur(event, node, data);
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
nativeOn: {
|
|
216
|
-
"keyup": function($event) {
|
|
217
|
-
return function(event) {
|
|
218
|
-
return _vm.inputKeyup(event, node, data);
|
|
219
|
-
}.apply(null, arguments);
|
|
220
|
-
},
|
|
221
|
-
"click": function($event) {
|
|
222
|
-
$event.stopPropagation();
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
model: {
|
|
226
|
-
value: _vm.text,
|
|
227
|
-
callback: function($$v) {
|
|
228
|
-
_vm.text = $$v;
|
|
229
|
-
},
|
|
230
|
-
expression: "text"
|
|
231
|
-
}
|
|
232
|
-
}), _vm.confirmButton ? [_c("ElButton", {
|
|
233
|
-
directives: [{
|
|
234
|
-
name: "show",
|
|
235
|
-
rawName: "v-show",
|
|
236
|
-
value: !data.loading,
|
|
237
|
-
expression: "!data.loading"
|
|
238
|
-
}],
|
|
239
|
-
staticClass: "shrink-0",
|
|
240
|
-
attrs: {
|
|
241
|
-
"size": "mini",
|
|
242
|
-
"type": "text"
|
|
243
|
-
},
|
|
244
|
-
on: {
|
|
245
|
-
"click": function($event) {
|
|
246
|
-
$event.stopPropagation();
|
|
247
|
-
return _vm.onConfirm(node, data);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}, [_vm._v("确定")]), _c("ElButton", {
|
|
251
|
-
directives: [{
|
|
252
|
-
name: "show",
|
|
253
|
-
rawName: "v-show",
|
|
254
|
-
value: !data.loading,
|
|
255
|
-
expression: "!data.loading"
|
|
256
|
-
}],
|
|
257
|
-
staticClass: "shrink-0",
|
|
258
|
-
attrs: {
|
|
259
|
-
"size": "mini",
|
|
260
|
-
"type": "text"
|
|
261
|
-
},
|
|
262
|
-
on: {
|
|
263
|
-
"click": function($event) {
|
|
264
|
-
$event.stopPropagation();
|
|
265
|
-
return _vm.onCancel(node, data);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}, [_vm._v("取消")])] : _vm._e()], 2)]];
|
|
269
|
-
}, {
|
|
270
|
-
"node": node,
|
|
271
|
-
"data": data
|
|
272
|
-
})];
|
|
273
|
-
}
|
|
274
|
-
}], null, true)
|
|
275
|
-
}, "ElTree", _vm.filterTreeProperties(_vm.$attrs), false), _vm.filterTreeEvents(_vm.$listeners))), _vm.contextMenu && !_vm.readonly ? _c("div", {
|
|
276
|
-
directives: [{
|
|
277
|
-
name: "show",
|
|
278
|
-
rawName: "v-show",
|
|
279
|
-
value: _vm.showMenu,
|
|
280
|
-
expression: "showMenu"
|
|
281
|
-
}],
|
|
282
|
-
ref: "contextMenu",
|
|
283
|
-
staticClass: "menu",
|
|
284
|
-
style: _vm.position
|
|
285
|
-
}, [_c("ul", {
|
|
286
|
-
staticClass: "menu-list"
|
|
287
|
-
}, [_vm._t("context-menu", function() {
|
|
288
|
-
return [_c("li", {
|
|
289
|
-
directives: [{
|
|
290
|
-
name: "show",
|
|
291
|
-
rawName: "v-show",
|
|
292
|
-
value: _vm.curData.id > -1,
|
|
293
|
-
expression: "curData.id > -1"
|
|
294
|
-
}],
|
|
295
|
-
staticClass: "menu-item",
|
|
296
|
-
on: {
|
|
297
|
-
"click": function($event) {
|
|
298
|
-
return _vm.appendPeerNode(_vm.curNode, _vm.curData);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}, [_c("i", {
|
|
302
|
-
staticClass: "menu-item-icon el-icon-lx-add",
|
|
303
|
-
staticStyle: {
|
|
304
|
-
"color": "#228b22"
|
|
305
|
-
}
|
|
306
|
-
}), _vm._v(_vm._s(_vm.menuLabel.appendPeer) + " ")]), _c("li", {
|
|
307
|
-
staticClass: "menu-item",
|
|
308
|
-
on: {
|
|
309
|
-
"click": function($event) {
|
|
310
|
-
return _vm.appendChildNode(_vm.curNode, _vm.curData);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}, [_c("i", {
|
|
314
|
-
staticClass: "menu-item-icon el-icon-lx-add",
|
|
315
|
-
staticStyle: {
|
|
316
|
-
"color": "#228b22"
|
|
317
|
-
}
|
|
318
|
-
}), _vm._v(_vm._s(_vm.menuLabel.appendChild) + " ")]), _c("li", {
|
|
319
|
-
directives: [{
|
|
320
|
-
name: "show",
|
|
321
|
-
rawName: "v-show",
|
|
322
|
-
value: _vm.curData.id > -1,
|
|
323
|
-
expression: "curData.id > -1"
|
|
324
|
-
}],
|
|
325
|
-
staticClass: "menu-item",
|
|
326
|
-
on: {
|
|
327
|
-
"click": function($event) {
|
|
328
|
-
return _vm.editNode(_vm.curNode, _vm.curData);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}, [_c("i", {
|
|
332
|
-
staticClass: "menu-item-icon el-icon-edit-outline",
|
|
333
|
-
staticStyle: {
|
|
334
|
-
"color": "#ffa500"
|
|
335
|
-
}
|
|
336
|
-
}), _vm._v(_vm._s(_vm.menuLabel.editNode) + " ")]), _c("li", {
|
|
337
|
-
directives: [{
|
|
338
|
-
name: "show",
|
|
339
|
-
rawName: "v-show",
|
|
340
|
-
value: _vm.curNode.isLeaf,
|
|
341
|
-
expression: "curNode.isLeaf"
|
|
342
|
-
}],
|
|
343
|
-
staticClass: "menu-item",
|
|
344
|
-
on: {
|
|
345
|
-
"click": function($event) {
|
|
346
|
-
return _vm.removeNodeModal(_vm.curNode, _vm.curData);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}, [_c("i", {
|
|
350
|
-
staticClass: "menu-item-icon el-icon-delete",
|
|
351
|
-
staticStyle: {
|
|
352
|
-
"color": "#f00"
|
|
353
|
-
}
|
|
354
|
-
}), _vm._v(_vm._s(_vm.menuLabel.removeNode) + " ")])];
|
|
355
|
-
}, {
|
|
356
|
-
"curNode": _vm.curNode,
|
|
357
|
-
"curData": _vm.curData
|
|
358
|
-
})], 2)]) : _vm._e()], 1)], 1);
|
|
359
|
-
};
|
|
360
|
-
var staticRenderFns = [];
|
|
361
|
-
const EditableTree_vue_vue_type_style_index_0_lang = "";
|
|
362
|
-
const __vue2_script = {
|
|
363
|
-
name: "EditableTree",
|
|
364
|
-
props: {
|
|
365
|
-
label: {
|
|
366
|
-
type: String,
|
|
367
|
-
default: "书签"
|
|
368
|
-
},
|
|
369
|
-
addRootNodeLabel: {
|
|
370
|
-
type: String
|
|
371
|
-
},
|
|
372
|
-
defaultExpandedKeys: {
|
|
373
|
-
type: Array,
|
|
374
|
-
default: () => []
|
|
375
|
-
},
|
|
376
|
-
newNodeBuilder: {
|
|
377
|
-
type: Function,
|
|
378
|
-
default: (name, parent) => {
|
|
379
|
-
return {
|
|
380
|
-
name,
|
|
381
|
-
parentId: parent.id
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
contextMenu: Boolean,
|
|
386
|
-
lazy: {
|
|
387
|
-
type: Boolean,
|
|
388
|
-
default: true
|
|
389
|
-
},
|
|
390
|
-
expandFirstNode: {
|
|
391
|
-
type: Boolean,
|
|
392
|
-
default: true
|
|
393
|
-
},
|
|
394
|
-
readonly: Boolean,
|
|
395
|
-
saveApi: {
|
|
396
|
-
type: Function
|
|
397
|
-
},
|
|
398
|
-
updateApi: {
|
|
399
|
-
type: Function
|
|
400
|
-
},
|
|
401
|
-
deleteApi: {
|
|
402
|
-
type: Function
|
|
403
|
-
},
|
|
404
|
-
fetchApi: {
|
|
405
|
-
type: Function
|
|
406
|
-
},
|
|
407
|
-
customRootNode: {
|
|
408
|
-
type: {
|
|
409
|
-
type: Object,
|
|
410
|
-
default: void 0
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
rootNode: {
|
|
414
|
-
type: Object
|
|
415
|
-
},
|
|
416
|
-
contextMenuIcon: Boolean,
|
|
417
|
-
contextMenuInline: Boolean,
|
|
418
|
-
treeProps: {
|
|
419
|
-
type: Object,
|
|
420
|
-
default: () => {
|
|
421
|
-
return {
|
|
422
|
-
children: "children",
|
|
423
|
-
label: "name",
|
|
424
|
-
isLeaf: (data) => {
|
|
425
|
-
if (hasOwn(data, "hasChildren")) {
|
|
426
|
-
return !data.hasChildren;
|
|
427
|
-
} else if (hasOwn(data, "hasChild")) {
|
|
428
|
-
return !data.hasChild;
|
|
429
|
-
} else if (hasOwn(data, "children") && data.children) {
|
|
430
|
-
return data.children.length === 0;
|
|
431
|
-
} else {
|
|
432
|
-
return true;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
menuLabel: {
|
|
439
|
-
type: Object,
|
|
440
|
-
default: () => ({
|
|
441
|
-
appendPeer: "添加同级节点",
|
|
442
|
-
appendChild: "添加",
|
|
443
|
-
removeNode: "删除",
|
|
444
|
-
editNode: "修改"
|
|
445
|
-
})
|
|
446
|
-
},
|
|
447
|
-
icon: {
|
|
448
|
-
type: [Function, Boolean],
|
|
449
|
-
default: () => {
|
|
450
|
-
return "el-icon-collection-tag";
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
confirmButton: {
|
|
454
|
-
type: Boolean,
|
|
455
|
-
default: true
|
|
456
|
-
},
|
|
457
|
-
addRootNodeButtonStyle: {
|
|
458
|
-
type: String,
|
|
459
|
-
default: "top"
|
|
460
|
-
},
|
|
461
|
-
reserveExpandKey: Boolean,
|
|
462
|
-
nodeKey: {
|
|
463
|
-
type: String,
|
|
464
|
-
default: "id"
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
data() {
|
|
468
|
-
return {
|
|
469
|
-
loading: false,
|
|
470
|
-
showMenu: false,
|
|
471
|
-
empty: true,
|
|
472
|
-
expandedKeys: this.lazy ? [] : this.defaultExpandedKeys,
|
|
473
|
-
treeData: [],
|
|
474
|
-
curNode: {},
|
|
475
|
-
curData: {},
|
|
476
|
-
position: {},
|
|
477
|
-
text: "",
|
|
478
|
-
right: 4,
|
|
479
|
-
treeKey: Date.now()
|
|
480
|
-
};
|
|
481
|
-
},
|
|
482
|
-
computed: {
|
|
483
|
-
defaultOptions() {
|
|
484
|
-
return {
|
|
485
|
-
confirmButtonText: "确定",
|
|
486
|
-
cancelButtonText: "取消",
|
|
487
|
-
closeOnClickModal: false,
|
|
488
|
-
modal: true,
|
|
489
|
-
inputErrorMessage: `${this.label}名不能为空!`,
|
|
490
|
-
inputPlaceholder: `请输入${this.label}名...`,
|
|
491
|
-
inputValidator: (value) => value != null && value.trim().length > 0
|
|
492
|
-
};
|
|
493
|
-
},
|
|
494
|
-
innerTreeData() {
|
|
495
|
-
var _a;
|
|
496
|
-
return ((_a = this.$attrs.data) == null ? void 0 : _a.length) ? this.$attrs.data : this.treeData;
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
|
-
watch: {
|
|
500
|
-
defaultExpandedKeys: {
|
|
501
|
-
immediate: true,
|
|
502
|
-
handler(newVal) {
|
|
503
|
-
this.expandedKeys = [...newVal];
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
created() {
|
|
508
|
-
this.tryFetch();
|
|
509
|
-
},
|
|
510
|
-
mounted() {
|
|
511
|
-
addResizeListener(this.$refs.tree.$el, this.resize);
|
|
512
|
-
addResizeListener(this.$refs.treeWrapper, this.resize);
|
|
513
|
-
},
|
|
514
|
-
beforeDestroy() {
|
|
515
|
-
removeResizeListener(this.$refs.tree.$el, this.resize);
|
|
516
|
-
removeResizeListener(this.$refs.treeWrapper, this.resize);
|
|
517
|
-
},
|
|
518
|
-
methods: {
|
|
519
|
-
filterTreeProperties,
|
|
520
|
-
filterTreeEvents,
|
|
521
|
-
addExpandKey(data) {
|
|
522
|
-
if (this.reserveExpandKey) {
|
|
523
|
-
this.expandedKeys.push(data[this.nodeKey]);
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
removeExpandKey(data) {
|
|
527
|
-
if (this.reserveExpandKey) {
|
|
528
|
-
this.expandedKeys = this.expandedKeys.filter((key) => key !== data[this.nodeKey]);
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
resize() {
|
|
532
|
-
if (isVerticalScrollbarVisible(this.$refs.treeWrapper)) {
|
|
533
|
-
this.right = 4 + scrollbarWidth;
|
|
534
|
-
} else {
|
|
535
|
-
this.right = 4;
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
async showContextMenu(event, data, node) {
|
|
539
|
-
if (data.contextmenu === false || data.id === -1 || data.id === 0 || data.edit === true) {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
if (this.contextMenu) {
|
|
543
|
-
this.curNode = node;
|
|
544
|
-
this.curData = data;
|
|
545
|
-
this.showMenu = true;
|
|
546
|
-
this.$refs.tree.setCurrentKey(data.id);
|
|
547
|
-
await this.$nextTick();
|
|
548
|
-
this.position = computePosition(event, this.$refs.contextMenu);
|
|
549
|
-
window.addEventListener("click", this.hideContextMenu);
|
|
550
|
-
}
|
|
551
|
-
},
|
|
552
|
-
hideContextMenu() {
|
|
553
|
-
this.showMenu = false;
|
|
554
|
-
window.removeEventListener("click", this.hideContextMenu);
|
|
555
|
-
},
|
|
556
|
-
async tryFetch() {
|
|
557
|
-
var _a;
|
|
558
|
-
if (this.lazy === false && this.fetchApi) {
|
|
559
|
-
const res = await this.fetchApi(((_a = this.rootNode) == null ? void 0 : _a.id) ?? -1, {});
|
|
560
|
-
if (isPlainObject(res.data)) {
|
|
561
|
-
res.data = [res.data];
|
|
562
|
-
}
|
|
563
|
-
res.data = res.data || [];
|
|
564
|
-
this.empty = res.data.length === 0;
|
|
565
|
-
if (isPlainObject(this.customRootNode)) {
|
|
566
|
-
const data = cloneDeep(this.customRootNode);
|
|
567
|
-
data[this.treeProps.children || "children"] = res.data;
|
|
568
|
-
this.treeData = [data];
|
|
569
|
-
} else if (isFunction(this.customRootNode)) {
|
|
570
|
-
const data = this.customRootNode(res.data);
|
|
571
|
-
data[this.treeProps.children || "children"] = res.data;
|
|
572
|
-
this.treeData = isPlainObject(data) ? [data] : data;
|
|
573
|
-
} else {
|
|
574
|
-
this.treeData = res.data;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
},
|
|
578
|
-
async loadNode(node, resolve) {
|
|
579
|
-
var _a, _b, _c;
|
|
580
|
-
if (node.level === 0) {
|
|
581
|
-
const res = await this.fetchApi(((_a = this.rootNode) == null ? void 0 : _a.id) ?? -1, node);
|
|
582
|
-
this.empty = res.data.length === 0;
|
|
583
|
-
if (isPlainObject(this.customRootNode)) {
|
|
584
|
-
const data = cloneDeep(this.customRootNode);
|
|
585
|
-
data[this.treeProps.children || "children"] = res.data;
|
|
586
|
-
resolve([data]);
|
|
587
|
-
} else if (isFunction(this.customRootNode)) {
|
|
588
|
-
const data = this.customRootNode(res.data);
|
|
589
|
-
data[this.treeProps.children || "children"] = res.data;
|
|
590
|
-
this.treeData = isPlainObject(data) ? [data] : data;
|
|
591
|
-
} else {
|
|
592
|
-
resolve(res.data);
|
|
593
|
-
}
|
|
594
|
-
await this.$nextTick();
|
|
595
|
-
this.$emit("root-node-loaded", res.data);
|
|
596
|
-
if (this.defaultExpandedKeys) {
|
|
597
|
-
this.expandedKeys = [(_b = res == null ? void 0 : res.data[0]) == null ? void 0 : _b.id, ...this.defaultExpandedKeys];
|
|
598
|
-
} else {
|
|
599
|
-
if (this.expandFirstNode) {
|
|
600
|
-
this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id];
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
} else {
|
|
604
|
-
if (node.leaf || node.data.isTempNode) {
|
|
605
|
-
return resolve([]);
|
|
606
|
-
}
|
|
607
|
-
const res = await this.fetchApi(node.data.id, node);
|
|
608
|
-
resolve(res.data);
|
|
609
|
-
await this.$nextTick();
|
|
610
|
-
this.$emit("node-loaded", res.data);
|
|
611
|
-
}
|
|
612
|
-
},
|
|
613
|
-
clear() {
|
|
614
|
-
this.cancelEdit();
|
|
615
|
-
this.removeNewNode();
|
|
616
|
-
},
|
|
617
|
-
clearChecked() {
|
|
618
|
-
this.$refs.tree.setCheckedKeys([]);
|
|
619
|
-
},
|
|
620
|
-
removeNewNode() {
|
|
621
|
-
if (this.newChild && this.newChild.id === -1) {
|
|
622
|
-
console.log(this.newChild);
|
|
623
|
-
this.$refs.tree.remove(this.newChild);
|
|
624
|
-
this.$emit("remove-new-node");
|
|
625
|
-
}
|
|
626
|
-
},
|
|
627
|
-
cancelEdit() {
|
|
628
|
-
if (this.editData) {
|
|
629
|
-
if (isUndefined(this.editData.edit)) {
|
|
630
|
-
this.$set(this.editData, "edit", true);
|
|
631
|
-
} else {
|
|
632
|
-
this.editData.edit = false;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
},
|
|
636
|
-
async editNode(node, data) {
|
|
637
|
-
if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
|
|
638
|
-
this.clear();
|
|
639
|
-
this.editData = data;
|
|
640
|
-
this.text = data[this.treeProps.label];
|
|
641
|
-
if (isUndefined(data.edit)) {
|
|
642
|
-
this.$set(data, "edit", true);
|
|
643
|
-
} else {
|
|
644
|
-
data.edit = true;
|
|
645
|
-
}
|
|
646
|
-
await this.$nextTick();
|
|
647
|
-
this.$refs.labelTxt.focus();
|
|
648
|
-
} else {
|
|
649
|
-
await this.$prompt(`请输入新的${this.label}名:`, {
|
|
650
|
-
...this.defaultOptions,
|
|
651
|
-
inputValue: data[this.treeProps.label],
|
|
652
|
-
beforeClose: async (action, instance, done) => {
|
|
653
|
-
if (action === "confirm") {
|
|
654
|
-
try {
|
|
655
|
-
instance.confirmButtonLoading = true;
|
|
656
|
-
instance.confirmButtonText = "处理中...";
|
|
657
|
-
this.text = instance.inputValue;
|
|
658
|
-
await this.onConfirm(this.curNode, this.curData);
|
|
659
|
-
done();
|
|
660
|
-
} catch (e) {
|
|
661
|
-
instance.confirmButtonText = "确定";
|
|
662
|
-
}
|
|
663
|
-
instance.confirmButtonLoading = false;
|
|
664
|
-
} else {
|
|
665
|
-
done();
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
}).catch((_) => _);
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
async appendRootNode() {
|
|
672
|
-
this.text = "";
|
|
673
|
-
if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
|
|
674
|
-
this.clear();
|
|
675
|
-
this.createNewChild(void 0);
|
|
676
|
-
this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, true);
|
|
677
|
-
await this.scrollIntoView(true);
|
|
678
|
-
} else {
|
|
679
|
-
await this.$prompt(`请输入${this.label}名:`, {
|
|
680
|
-
...this.defaultOptions,
|
|
681
|
-
beforeClose: async (action, instance, done) => {
|
|
682
|
-
if (action === "confirm") {
|
|
683
|
-
try {
|
|
684
|
-
this.createNewChild(-1);
|
|
685
|
-
instance.confirmButtonLoading = true;
|
|
686
|
-
instance.confirmButtonText = "处理中...";
|
|
687
|
-
const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
|
|
688
|
-
this.newChild[this.treeProps.label] = instance.inputValue;
|
|
689
|
-
this.newChild.edit = false;
|
|
690
|
-
assignReactiveProperties(this.newChild, res.data);
|
|
691
|
-
this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, true);
|
|
692
|
-
await this.locateView();
|
|
693
|
-
done();
|
|
694
|
-
} catch (e) {
|
|
695
|
-
instance.confirmButtonText = "确定";
|
|
696
|
-
}
|
|
697
|
-
instance.confirmButtonLoading = false;
|
|
698
|
-
} else {
|
|
699
|
-
done();
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}).catch((_) => _);
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
appendChildNode(node) {
|
|
706
|
-
this.text = "";
|
|
707
|
-
const expanded = node.expanded;
|
|
708
|
-
node.expand(async () => {
|
|
709
|
-
if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
|
|
710
|
-
this.clear();
|
|
711
|
-
this.createNewChild(node.data.id);
|
|
712
|
-
this.$refs.tree.append(this.newChild, node);
|
|
713
|
-
await this.scrollIntoView(expanded);
|
|
714
|
-
} else {
|
|
715
|
-
await this.$prompt(`请输入${this.label}名:`, {
|
|
716
|
-
...this.defaultOptions,
|
|
717
|
-
beforeClose: async (action, instance, done) => {
|
|
718
|
-
if (action === "confirm") {
|
|
719
|
-
try {
|
|
720
|
-
this.createNewChild(node.data.id);
|
|
721
|
-
instance.confirmButtonLoading = true;
|
|
722
|
-
instance.confirmButtonText = "处理中...";
|
|
723
|
-
const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
|
|
724
|
-
this.newChild[this.treeProps.label] = instance.inputValue;
|
|
725
|
-
this.newChild.edit = false;
|
|
726
|
-
assignReactiveProperties(this.newChild, res.data);
|
|
727
|
-
this.$refs.tree.append(this.newChild, node);
|
|
728
|
-
await this.locateView();
|
|
729
|
-
done();
|
|
730
|
-
} catch (e) {
|
|
731
|
-
instance.confirmButtonText = "确定";
|
|
732
|
-
}
|
|
733
|
-
instance.confirmButtonLoading = false;
|
|
734
|
-
} else {
|
|
735
|
-
done();
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}).catch((_) => _);
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
},
|
|
742
|
-
appendChildNodeWithData(node, parentId, label) {
|
|
743
|
-
this.text = "";
|
|
744
|
-
const expanded = node.expanded;
|
|
745
|
-
node.expand(async () => {
|
|
746
|
-
this.clear();
|
|
747
|
-
this.newChild = {
|
|
748
|
-
id: -1,
|
|
749
|
-
parentId,
|
|
750
|
-
[this.treeProps.label]: label,
|
|
751
|
-
edit: false,
|
|
752
|
-
isTempNode: true,
|
|
753
|
-
hasChildren: false
|
|
754
|
-
};
|
|
755
|
-
this.$refs.tree.append(this.newChild, node);
|
|
756
|
-
await this.scrollIntoView(expanded);
|
|
757
|
-
});
|
|
758
|
-
},
|
|
759
|
-
appendPeerNode(node) {
|
|
760
|
-
if (node.parent && node.parent.level !== 0) {
|
|
761
|
-
this.appendChildNode(node.parent);
|
|
762
|
-
} else {
|
|
763
|
-
this.appendRootNode();
|
|
764
|
-
}
|
|
765
|
-
},
|
|
766
|
-
async addRootNode(data) {
|
|
767
|
-
this.$refs.tree.remove(data);
|
|
768
|
-
await this.$nextTick();
|
|
769
|
-
this.$refs.tree.root.insertChild({ data }, void 0, true);
|
|
770
|
-
},
|
|
771
|
-
async addChildNode(data) {
|
|
772
|
-
if (this.curNode && this.curNode.level !== 0) {
|
|
773
|
-
this.curNode.expand(async () => {
|
|
774
|
-
this.$refs.tree.remove(data);
|
|
775
|
-
await this.$nextTick();
|
|
776
|
-
this.$refs.tree.append(data, this.curNode);
|
|
777
|
-
});
|
|
778
|
-
} else {
|
|
779
|
-
await this.addRootNode(data);
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
async addPeerNode(data) {
|
|
783
|
-
if (this.curNode && this.curNode.parent && this.curNode.parent.level !== 0) {
|
|
784
|
-
this.curNode.parent.expand(async () => {
|
|
785
|
-
this.$refs.tree.remove(data);
|
|
786
|
-
await this.$nextTick();
|
|
787
|
-
this.$refs.tree.append(data, this.curNode.parent);
|
|
788
|
-
});
|
|
789
|
-
} else {
|
|
790
|
-
await this.addRootNode(data);
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
updateNode(data) {
|
|
794
|
-
const node = this.$refs.tree.getNode(data);
|
|
795
|
-
node && (node.data = data);
|
|
796
|
-
},
|
|
797
|
-
setCurrentKey(key) {
|
|
798
|
-
this.$refs.tree && this.$refs.tree.setCurrentKey(key);
|
|
799
|
-
},
|
|
800
|
-
createNewChild(parentId) {
|
|
801
|
-
this.newChild = {
|
|
802
|
-
id: -1,
|
|
803
|
-
parentId,
|
|
804
|
-
[this.treeProps.label]: "",
|
|
805
|
-
edit: true,
|
|
806
|
-
isTempNode: true,
|
|
807
|
-
hasChildren: false
|
|
808
|
-
};
|
|
809
|
-
this.$emit("create-new-node", this.newChild);
|
|
810
|
-
},
|
|
811
|
-
async removeNodeModal(node) {
|
|
812
|
-
await this.$confirm(
|
|
813
|
-
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
|
|
814
|
-
"系统提示",
|
|
815
|
-
{
|
|
816
|
-
type: "warning",
|
|
817
|
-
modal: true,
|
|
818
|
-
dangerouslyUseHTMLString: true,
|
|
819
|
-
iconClass: "el-icon-question",
|
|
820
|
-
closeOnClickModal: false,
|
|
821
|
-
confirmButtonClass: "el-button--danger",
|
|
822
|
-
cancelButtonClass: "el-button--primary is-plain",
|
|
823
|
-
beforeClose: async (action, instance, done) => {
|
|
824
|
-
if (action === "confirm") {
|
|
825
|
-
try {
|
|
826
|
-
instance.confirmButtonLoading = true;
|
|
827
|
-
instance.confirmButtonText = "删除...";
|
|
828
|
-
const parentNode = node.parent;
|
|
829
|
-
const res = await this.deleteApi(node.data.id);
|
|
830
|
-
if (res.code === 0) {
|
|
831
|
-
this.$message.success("删除成功!");
|
|
832
|
-
this.$refs.tree.remove(node);
|
|
833
|
-
this.$emit("node-deleted", parentNode, node.data);
|
|
834
|
-
done();
|
|
835
|
-
} else {
|
|
836
|
-
this.$message.error(res.message);
|
|
837
|
-
}
|
|
838
|
-
} catch (_) {
|
|
839
|
-
}
|
|
840
|
-
instance.confirmButtonText = "确定";
|
|
841
|
-
instance.confirmButtonLoading = false;
|
|
842
|
-
} else {
|
|
843
|
-
done();
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
).catch((_) => _);
|
|
848
|
-
},
|
|
849
|
-
async removeNode(node) {
|
|
850
|
-
try {
|
|
851
|
-
const parentNode = node.parent;
|
|
852
|
-
if (this.deleteApi) {
|
|
853
|
-
const res = await this.deleteApi(node.data.id);
|
|
854
|
-
if (res.code === 0) {
|
|
855
|
-
this.$message.success("删除成功!");
|
|
856
|
-
this.$refs.tree.remove(node);
|
|
857
|
-
this.$emit("node-deleted", parentNode, node.data);
|
|
858
|
-
} else {
|
|
859
|
-
this.$message.error(res.message);
|
|
860
|
-
}
|
|
861
|
-
} else {
|
|
862
|
-
this.$refs.tree.remove(node);
|
|
863
|
-
}
|
|
864
|
-
} catch (e) {
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
async onConfirm(node, data) {
|
|
868
|
-
if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
|
|
869
|
-
this.clear();
|
|
870
|
-
return;
|
|
871
|
-
}
|
|
872
|
-
if (isUndefined(data.loading)) {
|
|
873
|
-
this.$set(data, "loading", true);
|
|
874
|
-
} else {
|
|
875
|
-
data.loading = true;
|
|
876
|
-
}
|
|
877
|
-
try {
|
|
878
|
-
this.loading = true;
|
|
879
|
-
if (data.id === -1) {
|
|
880
|
-
const res = await this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 }));
|
|
881
|
-
const old = fastClone(data);
|
|
882
|
-
assignReactiveProperties(data, { ...res.data, isTempNode: false });
|
|
883
|
-
this.$emit("node-added", data, old, node);
|
|
884
|
-
this.registerNode(node);
|
|
885
|
-
} else {
|
|
886
|
-
await this.updateApi({ ...data, [this.treeProps.label]: this.text });
|
|
887
|
-
}
|
|
888
|
-
data[this.treeProps.label] = this.text;
|
|
889
|
-
data.edit = false;
|
|
890
|
-
this.$emit("node-updated", data, node);
|
|
891
|
-
this.text = "";
|
|
892
|
-
} catch (e) {
|
|
893
|
-
}
|
|
894
|
-
data.loading = false;
|
|
895
|
-
this.loading = false;
|
|
896
|
-
},
|
|
897
|
-
onCancel(node, data) {
|
|
898
|
-
if (data.id === -1) {
|
|
899
|
-
this.$refs.tree.remove(node);
|
|
900
|
-
} else {
|
|
901
|
-
data.edit = false;
|
|
902
|
-
}
|
|
903
|
-
this.text = "";
|
|
904
|
-
},
|
|
905
|
-
nodeClick(data, node, tree) {
|
|
906
|
-
this.hideContextMenu();
|
|
907
|
-
if (isUndefined(data.loading) || !data.loading) {
|
|
908
|
-
this.curNode = node;
|
|
909
|
-
this.curData = data;
|
|
910
|
-
this.$emit("on-node-click", data, node, tree);
|
|
911
|
-
}
|
|
912
|
-
},
|
|
913
|
-
getCurrentNode() {
|
|
914
|
-
return this.$refs.tree.getCurrentNode();
|
|
915
|
-
},
|
|
916
|
-
async locateView() {
|
|
917
|
-
await this.$nextTick();
|
|
918
|
-
const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
|
|
919
|
-
if (el) {
|
|
920
|
-
el.scrollIntoView();
|
|
921
|
-
}
|
|
922
|
-
},
|
|
923
|
-
async scrollIntoView(expanded) {
|
|
924
|
-
var _a, _b;
|
|
925
|
-
await this.$nextTick();
|
|
926
|
-
if (!expanded) {
|
|
927
|
-
await delay(300);
|
|
928
|
-
}
|
|
929
|
-
(_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null ? void 0 : _b.focus();
|
|
930
|
-
},
|
|
931
|
-
inputKeyup(event, node, data) {
|
|
932
|
-
if (event.keyCode === 13) {
|
|
933
|
-
this.onConfirm(node, data);
|
|
934
|
-
}
|
|
935
|
-
if (event.keyCode === 27) {
|
|
936
|
-
this.clear();
|
|
937
|
-
}
|
|
938
|
-
},
|
|
939
|
-
inputBlur(event, node, data) {
|
|
940
|
-
if (this.confirmButton) {
|
|
941
|
-
return;
|
|
942
|
-
}
|
|
943
|
-
this.onConfirm(node, data);
|
|
944
|
-
},
|
|
945
|
-
getCheckedKeys() {
|
|
946
|
-
return this.$refs.tree.getCheckedKeys();
|
|
947
|
-
},
|
|
948
|
-
setCheckedKeys(keys) {
|
|
949
|
-
this.$refs.tree.setCheckedKeys(keys);
|
|
950
|
-
},
|
|
951
|
-
getCheckedNodes() {
|
|
952
|
-
return this.$refs.tree.getCheckedNodes();
|
|
953
|
-
},
|
|
954
|
-
setCheckedNodes(nodes) {
|
|
955
|
-
this.$refs.tree.setCheckedNodes(nodes);
|
|
956
|
-
},
|
|
957
|
-
getNode(data) {
|
|
958
|
-
return this.$refs.tree.getNode(data);
|
|
959
|
-
},
|
|
960
|
-
getRootNode() {
|
|
961
|
-
return this.$refs.tree.root;
|
|
962
|
-
},
|
|
963
|
-
findTreeNode(data) {
|
|
964
|
-
return findTreeChildren(
|
|
965
|
-
this.$refs.tree.root.childNodes,
|
|
966
|
-
(node) => node.data === data || node.data.id === data,
|
|
967
|
-
"childNodes"
|
|
968
|
-
);
|
|
969
|
-
},
|
|
970
|
-
registerNode(node) {
|
|
971
|
-
node.store.registerNode(node);
|
|
972
|
-
delete node.store.nodesMap[-1];
|
|
973
|
-
},
|
|
974
|
-
async reloadTree() {
|
|
975
|
-
if (this.lazy) {
|
|
976
|
-
this.treeKey = Date.now();
|
|
977
|
-
} else {
|
|
978
|
-
await this.tryFetch();
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
};
|
|
983
|
-
const __cssModules = {};
|
|
984
|
-
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
985
|
-
__vue2_script,
|
|
986
|
-
render,
|
|
987
|
-
staticRenderFns,
|
|
988
|
-
false,
|
|
989
|
-
__vue2_injectStyles,
|
|
990
|
-
null,
|
|
991
|
-
null,
|
|
992
|
-
null
|
|
993
|
-
);
|
|
994
|
-
function __vue2_injectStyles(context) {
|
|
995
|
-
for (let o in __cssModules) {
|
|
996
|
-
this[o] = __cssModules[o];
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
const EditableTree = /* @__PURE__ */ function() {
|
|
1000
|
-
return __component__.exports;
|
|
1001
|
-
}();
|
|
1002
|
-
export {
|
|
1003
|
-
EditableTree as default
|
|
1004
|
-
};
|