@web-utils/component 2.7.19 → 2.7.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{config.46422d7f.js → config.7dec2bf2.js} +2 -2
- package/dist/chunks/confirmable-mixin.7112b769.js +75 -0
- package/dist/chunks/dataformat.9cc4428a.js +158 -0
- package/dist/chunks/dayjs.b0f2f7d9.js +247 -0
- package/dist/chunks/detail.6619700c.js +29 -0
- package/dist/chunks/dic.9de2fe5a.js +135 -0
- package/dist/chunks/{event.dd6f522d.js → event.fc358074.js} +31 -31
- package/dist/chunks/{form-input-mixin.ff5b58f7.js → form-input-mixin.df413ca8.js} +6 -6
- package/dist/chunks/{form-item-mixin.79f6eaff.js → form-item-mixin.b850e028.js} +18 -18
- package/dist/chunks/{form-pick-mixin.61ad06b2.js → form-pick-mixin.c4e0391b.js} +2 -2
- package/dist/chunks/init.e0133910.js +122 -0
- package/dist/chunks/{input-number-mixin.41a066be.js → input-number-mixin.6849fa63.js} +4 -4
- package/dist/chunks/{mixins.5a78e0db.js → mixins.6a394a6c.js} +4 -4
- package/dist/chunks/{packages.1fc9ccba.js → packages.419bde01.js} +7 -7
- package/dist/chunks/permission.07c49abf.js +16 -0
- package/dist/chunks/slot.a7387ecc.js +27 -0
- package/dist/chunks/{tab-mixin.8c0142e0.js → tab-mixin.51886d91.js} +20 -20
- package/dist/chunks/util.89913643.js +261 -0
- package/dist/chunks/utils.d7f73f8d.js +185 -0
- package/dist/chunks/utils.f44207f4.js +26 -0
- package/dist/chunks/vueComponentNormalizer.bf552d98.js +32 -0
- package/dist/components/address-input/index.js +36 -36
- package/dist/components/address-input/style.css +10 -1
- package/dist/components/affix/index.js +39 -39
- package/dist/components/affix/style.css +4 -1
- package/dist/components/aside-menu/index.js +29 -29
- package/dist/components/aside-menu/style.css +3 -1
- package/dist/components/avatar/index.js +43 -43
- package/dist/components/avatar/style.css +51 -1
- package/dist/components/awesome-button/index.js +28 -28
- package/dist/components/base.css +536 -1
- package/dist/components/capsule-tab/index.js +26 -26
- package/dist/components/capsule-tab/style.css +26 -1
- package/dist/components/card/index.js +49 -49
- package/dist/components/card/style.css +84 -1
- package/dist/components/carousel/index.js +35 -35
- package/dist/components/carousel/style.css +35 -1
- package/dist/components/chat/index.js +203 -203
- package/dist/components/chat/style.css +277 -1
- package/dist/components/chunk-file-uploader/index.js +46 -46
- package/dist/components/chunk-file-uploader/style.css +3 -1
- package/dist/components/chunk-file-uploader-button/index.js +22 -22
- package/dist/components/chunk-file-uploader-button/style.css +16 -1
- package/dist/components/chunk-file-uploader-drop/index.js +27 -27
- package/dist/components/chunk-file-uploader-drop/style.css +11 -1
- package/dist/components/chunk-file-uploader-file/index.js +118 -118
- package/dist/components/chunk-file-uploader-file/style.css +124 -1
- package/dist/components/chunk-file-uploader-files/index.js +27 -27
- package/dist/components/chunk-file-uploader-files/style.css +8 -1
- package/dist/components/chunk-file-uploader-list/index.js +27 -27
- package/dist/components/chunk-file-uploader-list/style.css +8 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +27 -27
- package/dist/components/chunk-file-uploader-un-support/style.css +5 -1
- package/dist/components/code-mirror-editor/index.js +134 -134
- package/dist/components/code-mirror-editor/style.css +11 -1
- package/dist/components/color-picker/index.js +39 -39
- package/dist/components/column/index.js +66 -66
- package/dist/components/column-default/index.js +54 -54
- package/dist/components/column-dynamic/index.js +54 -54
- package/dist/components/column-menu/index.js +128 -128
- package/dist/components/column-slot/index.js +168 -168
- package/dist/components/comment/index.js +33 -33
- package/dist/components/comment/style.css +110 -1
- package/dist/components/confirm-button/index.js +18 -18
- package/dist/components/confirmable/index.js +17 -17
- package/dist/components/context-menu/index.js +89 -89
- package/dist/components/context-menu/style.css +84 -1
- package/dist/components/count-up/index.js +36 -36
- package/dist/components/custom-scrollbar/index.js +45 -45
- package/dist/components/data-box/index.js +41 -41
- package/dist/components/data-box/style.css +52 -1
- package/dist/components/data-card/index.js +38 -38
- package/dist/components/data-card/style.css +35 -1
- package/dist/components/data-cardtext/index.js +33 -33
- package/dist/components/data-cardtext/style.css +30 -1
- package/dist/components/data-display/index.js +37 -37
- package/dist/components/data-display/style.css +31 -1
- package/dist/components/data-icons/index.js +40 -40
- package/dist/components/data-icons/style.css +47 -1
- package/dist/components/data-imgtext/index.js +44 -44
- package/dist/components/data-imgtext/style.css +65 -1
- package/dist/components/data-operatext/index.js +44 -44
- package/dist/components/data-operatext/style.css +72 -1
- package/dist/components/data-panel/index.js +38 -38
- package/dist/components/data-panel/style.css +31 -1
- package/dist/components/data-pay/index.js +60 -60
- package/dist/components/data-pay/style.css +96 -1
- package/dist/components/data-price/index.js +38 -38
- package/dist/components/data-price/style.css +75 -1
- package/dist/components/data-progress/index.js +39 -39
- package/dist/components/data-progress/style.css +24 -1
- package/dist/components/data-rotate/index.js +39 -39
- package/dist/components/data-rotate/style.css +44 -1
- package/dist/components/data-table-picker/index.js +151 -53
- package/dist/components/data-tabs/index.js +39 -39
- package/dist/components/data-tabs/style.css +64 -1
- package/dist/components/dialog-column/index.js +50 -50
- package/dist/components/dialog-excel/index.js +68 -68
- package/dist/components/dialog-filter/index.js +84 -84
- package/dist/components/dialog-form/index.js +89 -89
- package/dist/components/dialog-form/style.css +5 -0
- package/dist/components/dynamic-table/index.js +71 -71
- package/dist/components/dynamic-table/style.css +24 -1
- package/dist/components/e-charts/index.js +95 -94
- package/dist/components/e-charts/style.css +4 -1
- package/dist/components/easy-popup/index.js +87 -0
- package/dist/components/easy-popup/style.css +12 -0
- package/dist/components/editable-progress/index.js +48 -48
- package/dist/components/editable-progress/style.css +33 -1
- package/dist/components/editable-tree/index.js +587 -287
- package/dist/components/editable-tree/style.css +79 -1
- package/dist/components/egd-collapse/index.js +29 -29
- package/dist/components/egd-collapse-item/index.js +51 -51
- package/dist/components/element-dialog/index.js +74 -65
- package/dist/components/element-dialog/style.css +82 -1
- package/dist/components/empty-view/index.js +26 -26
- package/dist/components/empty-view/style.css +11 -1
- package/dist/components/error-view/index.js +25 -25
- package/dist/components/error-view/style.css +11 -1
- package/dist/components/flex-column/index.js +19 -19
- package/dist/components/flex-item/index.js +20 -20
- package/dist/components/flex-row/index.js +19 -19
- package/dist/components/flex-scroller/index.js +24 -24
- package/dist/components/flex-scroller/style.css +14 -1
- package/dist/components/flow/index.js +100 -100
- package/dist/components/flow/style.css +38 -1
- package/dist/components/flow-node/index.js +37 -37
- package/dist/components/flow-viewer/index.js +135 -0
- package/dist/components/flow-viewer/style.css +13 -0
- package/dist/components/form-button/index.js +32 -32
- package/dist/components/form-cascader/index.js +62 -61
- package/dist/components/form-checkbox-group/index.js +61 -61
- package/dist/components/form-checkbox-group/style.css +45 -1
- package/dist/components/form-date-picker/index.js +57 -57
- package/dist/components/form-group/index.js +38 -38
- package/dist/components/form-group/style.css +76 -1
- package/dist/components/form-holder/index.js +30 -30
- package/dist/components/form-input/index.js +50 -50
- package/dist/components/form-input-email/index.js +44 -44
- package/dist/components/form-input-id-card/index.js +49 -49
- package/dist/components/form-input-number/index.js +49 -49
- package/dist/components/form-input-number/style.css +6 -1
- package/dist/components/form-input-phone-number/index.js +45 -45
- package/dist/components/form-input-time/index.js +48 -48
- package/dist/components/form-item/index.js +73 -73
- package/dist/components/form-item/style.css +5 -1
- package/dist/components/form-item-config-provider/index.js +19 -19
- package/dist/components/form-item-group/index.js +65 -65
- package/dist/components/form-item-group/style.css +25 -1
- package/dist/components/form-radio-group/index.js +61 -61
- package/dist/components/form-radio-group/style.css +47 -1
- package/dist/components/form-select/index.js +52 -52
- package/dist/components/form-switch/index.js +45 -45
- package/dist/components/form-temp/index.js +50 -50
- package/dist/components/form-textarea/index.js +44 -44
- package/dist/components/form-view/index.js +143 -142
- package/dist/components/form-view/style.css +155 -1
- package/dist/components/fy-array/index.js +64 -64
- package/dist/components/fy-array/style.css +12 -1
- package/dist/components/fy-article/index.js +34 -34
- package/dist/components/fy-article/style.css +56 -1
- package/dist/components/fy-cascader/index.js +52 -52
- package/dist/components/fy-checkbox/index.js +52 -52
- package/dist/components/fy-checkbox/style.css +9 -1
- package/dist/components/fy-code/index.js +30 -30
- package/dist/components/fy-curd/index.js +317 -317
- package/dist/components/fy-curd/style.css +236 -1
- package/dist/components/fy-date/index.js +45 -45
- package/dist/components/fy-date/style.css +15 -1
- package/dist/components/fy-dialog-form/index.js +115 -115
- package/dist/components/fy-draggable/index.js +120 -120
- package/dist/components/fy-draggable/style.css +136 -1
- package/dist/components/fy-dynamic/index.js +126 -126
- package/dist/components/fy-dynamic/style.css +29 -1
- package/dist/components/fy-empty/index.js +26 -26
- package/dist/components/fy-empty/style.css +18 -1
- package/dist/components/fy-form/index.js +365 -365
- package/dist/components/fy-form/style.css +73 -1
- package/dist/components/fy-form-design/index.js +6906 -433
- package/dist/components/fy-form-design/style.css +560 -1
- package/dist/components/fy-form-menu/index.js +45 -45
- package/dist/components/fy-input/index.js +61 -61
- package/dist/components/fy-input-color/index.js +41 -41
- package/dist/components/fy-input-icon/index.js +70 -70
- package/dist/components/fy-input-icon/style.css +33 -1
- package/dist/components/fy-input-map/index.js +102 -102
- package/dist/components/fy-input-map/style.css +44 -1
- package/dist/components/fy-input-number/index.js +39 -39
- package/dist/components/fy-input-table/index.js +70 -70
- package/dist/components/fy-input-table/style.css +4 -1
- package/dist/components/fy-input-tree/index.js +105 -105
- package/dist/components/fy-input-tree/style.css +19 -1
- package/dist/components/fy-progress/index.js +25 -25
- package/dist/components/fy-radio/index.js +36 -36
- package/dist/components/fy-radio/style.css +6 -1
- package/dist/components/fy-rate/index.js +40 -40
- package/dist/components/fy-rate/style.css +3 -1
- package/dist/components/fy-select/index.js +101 -101
- package/dist/components/fy-select/style.css +19 -1
- package/dist/components/fy-slider/index.js +42 -42
- package/dist/components/fy-switch/index.js +37 -37
- package/dist/components/fy-tabs/index.js +35 -35
- package/dist/components/fy-time/index.js +47 -47
- package/dist/components/fy-title/index.js +23 -23
- package/dist/components/fy-title/style.css +5 -1
- package/dist/components/fy-tree/index.js +157 -157
- package/dist/components/fy-tree/style.css +39 -1
- package/dist/components/fy-u-editor/index.js +99 -99
- package/dist/components/fy-u-editor/style.css +9 -1
- package/dist/components/fy-upload/index.js +270 -270
- package/dist/components/fy-upload/style.css +55 -1
- package/dist/components/guide-steps/index.js +41 -41
- package/dist/components/guide-steps/style.css +28 -1
- package/dist/components/header-menu/index.js +94 -94
- package/dist/components/header-search/index.js +121 -121
- package/dist/components/highlight-j-s/index.js +76 -0
- package/dist/components/highlight-j-s/style.css +18 -0
- package/dist/components/icon-card/index.js +28 -28
- package/dist/components/icon-card/style.css +50 -1
- package/dist/components/icon-temp/index.js +24 -24
- package/dist/components/icon-temp/style.css +17 -1
- package/dist/components/iframe-window/index.js +24 -24
- package/dist/components/iframe-window/style.css +14 -1
- package/dist/components/image-cropper/index.js +117 -117
- package/dist/components/image-cropper/style.css +28 -1
- package/dist/components/image-preview/index.js +127 -127
- package/dist/components/image-preview/style.css +66 -1
- package/dist/components/image-viewer/index.js +35 -35
- package/dist/components/image-viewer/style.css +15 -1
- package/dist/components/input-number/index.js +116 -116
- package/dist/components/input-number/style.css +9 -1
- package/dist/components/input-number-range/index.js +37 -37
- package/dist/components/input-number-range/style.css +6 -1
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +71 -71
- package/dist/components/keyboard/index.js +182 -182
- package/dist/components/keyboard/style.css +473 -1
- package/dist/components/license/index.js +54 -54
- package/dist/components/loading-view/index.js +25 -25
- package/dist/components/loading-view/style.css +11 -1
- package/dist/components/login/index.js +94 -94
- package/dist/components/login/style.css +19 -1
- package/dist/components/name-avatar/index.js +26 -26
- package/dist/components/name-avatar/style.css +30 -1
- package/dist/components/nav-bar/index.js +22 -22
- package/dist/components/nav-bar/style.css +11 -1
- package/dist/components/not-implement/index.js +22 -22
- package/dist/components/not-implement/style.css +9 -1
- package/dist/components/notice/index.js +55 -55
- package/dist/components/notice/style.css +48 -1
- package/dist/components/page/index.js +20 -20
- package/dist/components/page/style.css +6 -1
- package/dist/components/page-header/index.js +28 -28
- package/dist/components/page-header/style.css +8 -1
- package/dist/components/page-index/index.js +57 -57
- package/dist/components/page-index/style.css +17 -1
- package/dist/components/page-index-top/index.js +46 -46
- package/dist/components/page-skeleton/index.js +28 -28
- package/dist/components/page-skeleton/style.css +17 -1
- package/dist/components/page-skeleton-new/index.js +38 -38
- package/dist/components/page-skeleton-new/style.css +36 -1
- package/dist/components/pageable-table/index.js +140 -139
- package/dist/components/pageable-table/style.css +66 -1
- package/dist/components/pageable-view/index.js +103 -102
- package/dist/components/pageable-view/style.css +63 -1
- package/dist/components/photo-swipe/index.js +64 -64
- package/dist/components/process-designer/index.js +4638 -0
- package/dist/components/process-designer/style.css +1648 -0
- package/dist/components/properties-panel/index.js +4765 -0
- package/dist/components/properties-panel/style.css +106 -0
- package/dist/components/queue/index.js +24 -24
- package/dist/components/record-video/index.js +55 -55
- package/dist/components/record-video/style.css +47 -1
- package/dist/components/resize-observer/index.js +26 -26
- package/dist/components/resize-observer/style.css +25 -1
- package/dist/components/search/index.js +64 -64
- package/dist/components/search/style.css +51 -1
- package/dist/components/search-popover/index.js +98 -98
- package/dist/components/search-popover/style.css +90 -1
- package/dist/components/sign/index.js +66 -66
- package/dist/components/sign/style.css +6 -1
- package/dist/components/sign-panel/index.js +78 -78
- package/dist/components/sign-panel/style.css +91 -1
- package/dist/components/skeleton/index.js +35 -35
- package/dist/components/skeleton/style.css +55 -1
- package/dist/components/split-pane/index.js +88 -88
- package/dist/components/split-pane/style.css +98 -1
- package/dist/components/stateful/index.js +29 -29
- package/dist/components/stateful/style.css +27 -1
- package/dist/components/static-pageable-table/index.js +30 -30
- package/dist/components/static-pageable-table/style.css +3 -1
- package/dist/components/swiper/index.js +69 -69
- package/dist/components/swiper/style.css +37 -1
- package/dist/components/tab/index.js +47 -47
- package/dist/components/tab/style.css +108 -1
- package/dist/components/tab-item/index.js +29 -29
- package/dist/components/table-column/index.js +25 -25
- package/dist/components/table-page/index.js +51 -51
- package/dist/components/table-view/index.js +123 -122
- package/dist/components/table-view/style.css +90 -1
- package/dist/components/tag-render/index.js +39 -39
- package/dist/components/tag-render/style.css +27 -1
- package/dist/components/text-ellipsis/index.js +40 -40
- package/dist/components/text-ellipsis/style.css +3 -1
- package/dist/components/tinymce-editor/index.js +62 -62
- package/dist/components/tinymce-editor/style.css +37 -1
- package/dist/components/tinymce-wrapper/index.js +76 -76
- package/dist/components/tinymce-wrapper/style.css +30 -1
- package/dist/components/toolbar/index.js +51 -51
- package/dist/components/toolbar/style.css +35 -1
- package/dist/components/toolbar-button/index.js +33 -33
- package/dist/components/toolbar-button/style.css +15 -1
- package/dist/components/trigger/index.js +27 -27
- package/dist/components/verify/index.js +33 -33
- package/dist/components/verify/style.css +9 -1
- package/dist/components/vue-tags-input/index.js +137 -137
- package/dist/components/vue-tags-input/style.css +102 -1
- package/dist/components/watermark/index.js +25 -25
- package/dist/components/watermark/style.css +10 -1
- package/dist/index.css +1797 -0
- package/dist/index.es.js +22766 -12431
- package/package.json +18 -6
- package/web-types.json +307 -1
- package/dist/chunks/AfdColumn.vue_vue_type_template_lang.768f2ed2.js +0 -302
- package/dist/chunks/ConfigArray.vue_vue_type_template_lang.66483daa.js +0 -51
- package/dist/chunks/ConfigColor.vue_vue_type_template_lang.cd880091.js +0 -24
- package/dist/chunks/ConfigCustom.vue_vue_type_template_lang.6e03d7fd.js +0 -52
- package/dist/chunks/ConfigDate.vue_vue_type_template_lang.116fbad4.js +0 -104
- package/dist/chunks/ConfigDynamic.vue_vue_type_template_lang.99082e47.js +0 -133
- package/dist/chunks/ConfigEvent.vue_vue_type_template_lang.5e8ed6cc.js +0 -96
- package/dist/chunks/ConfigGroup.vue_vue_type_template_lang.44117322.js +0 -48
- package/dist/chunks/ConfigInput.vue_vue_type_template_lang.cc1eb052.js +0 -96
- package/dist/chunks/ConfigMap.vue_vue_type_template_lang.daee4d38.js +0 -31
- package/dist/chunks/ConfigNumber.vue_vue_type_template_lang.d60231d7.js +0 -130
- package/dist/chunks/ConfigRate.vue_vue_type_style_index_0_scoped_true_lang.cf5d437d.js +0 -125
- package/dist/chunks/ConfigSelect.vue_vue_type_template_lang.dfc91f07.js +0 -488
- package/dist/chunks/ConfigSlider.vue_vue_type_template_lang.27b8cc7b.js +0 -99
- package/dist/chunks/ConfigSwitch.vue_vue_type_style_index_0_scoped_true_lang.4caf1bd0.js +0 -54
- package/dist/chunks/ConfigTable.vue_vue_type_template_lang.b27540fd.js +0 -344
- package/dist/chunks/ConfigTextarea.vue_vue_type_template_lang.5cddf41c.js +0 -88
- package/dist/chunks/ConfigTitle.vue_vue_type_template_lang.57d9deb5.js +0 -87
- package/dist/chunks/ConfigTree.vue_vue_type_style_index_0_scoped_true_lang.89ec5376.js +0 -465
- package/dist/chunks/ConfigUEditor.vue_vue_type_template_lang.9726b4f5.js +0 -240
- package/dist/chunks/ConfigUpload.vue_vue_type_template_lang.129c0ced.js +0 -476
- package/dist/chunks/FormConfig.vue_vue_type_template_lang.82463ce5.js +0 -220
- package/dist/chunks/WidgetConfig.vue_vue_type_template_lang.3cc74fe8.js +0 -1821
- package/dist/chunks/WidgetForm.vue_vue_type_template_lang.d4b05679.js +0 -247
- package/dist/chunks/WidgetFormGroup.vue_vue_type_template_lang.bdcb6d37.js +0 -271
- package/dist/chunks/WidgetFormItem.vue_vue_type_template_lang.48d55a5c.js +0 -24
- package/dist/chunks/WidgetFormTable.vue_vue_type_template_lang.e2b788ba.js +0 -229
- package/dist/chunks/confirmable-mixin.3a79781b.js +0 -75
- package/dist/chunks/dataformat.65b92bfe.js +0 -158
- package/dist/chunks/detail.d67573b1.js +0 -28
- package/dist/chunks/dic.70feb9b4.js +0 -135
- package/dist/chunks/init.7c58eb34.js +0 -122
- package/dist/chunks/monaco.cefcb9f5.js +0 -290
- package/dist/chunks/permission.ce5d2121.js +0 -16
- package/dist/chunks/slot.4b391395.js +0 -27
- package/dist/chunks/util.23fe58fb.js +0 -261
- package/dist/chunks/utils.97652d86.js +0 -26
- package/dist/chunks/utils.fa73de78.js +0 -185
- package/dist/chunks/vueComponentNormalizer.71e2aa87.js +0 -32
- package/dist/components/afd-column/index.js +0 -57
- package/dist/components/config-array/index.js +0 -28
- package/dist/components/config-color/index.js +0 -28
- package/dist/components/config-custom/index.js +0 -62
- package/dist/components/config-date/index.js +0 -28
- package/dist/components/config-dynamic/index.js +0 -28
- package/dist/components/config-event/index.js +0 -74
- package/dist/components/config-group/index.js +0 -36
- package/dist/components/config-input/index.js +0 -29
- package/dist/components/config-map/index.js +0 -28
- package/dist/components/config-number/index.js +0 -28
- package/dist/components/config-rate/index.js +0 -71
- package/dist/components/config-rate/style.css +0 -1
- package/dist/components/config-select/index.js +0 -90
- package/dist/components/config-slider/index.js +0 -28
- package/dist/components/config-switch/index.js +0 -33
- package/dist/components/config-switch/style.css +0 -1
- package/dist/components/config-table/index.js +0 -122
- package/dist/components/config-textarea/index.js +0 -28
- package/dist/components/config-title/index.js +0 -33
- package/dist/components/config-tree/index.js +0 -122
- package/dist/components/config-tree/style.css +0 -1
- package/dist/components/config-u-editor/index.js +0 -34
- package/dist/components/config-upload/index.js +0 -58
- package/dist/components/form-config/index.js +0 -28
- package/dist/components/fy-dialog-form/style.css +0 -1
- package/dist/components/widget-config/index.js +0 -110
- package/dist/components/widget-form/index.js +0 -71
- package/dist/components/widget-form-group/index.js +0 -96
- package/dist/components/widget-form-item/index.js +0 -71
- package/dist/components/widget-form-table/index.js +0 -95
|
@@ -1,18 +1,318 @@
|
|
|
1
|
-
import { hasOwn
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
|
|
2
|
+
import { cloneDeep } from "@web-utils/integrations/lodash";
|
|
3
|
+
import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
|
|
4
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.bf552d98.js";
|
|
5
|
+
var MapShim = function() {
|
|
6
|
+
if (typeof Map < "u")
|
|
7
|
+
return Map;
|
|
8
|
+
function getIndex(arr, key) {
|
|
9
|
+
var result = -1;
|
|
10
|
+
return arr.some(function(entry, index2) {
|
|
11
|
+
return entry[0] === key ? (result = index2, !0) : !1;
|
|
12
|
+
}), result;
|
|
13
|
+
}
|
|
14
|
+
return (
|
|
15
|
+
/** @class */
|
|
16
|
+
function() {
|
|
17
|
+
function class_1() {
|
|
18
|
+
this.__entries__ = [];
|
|
19
|
+
}
|
|
20
|
+
return Object.defineProperty(class_1.prototype, "size", {
|
|
21
|
+
/**
|
|
22
|
+
* @returns {boolean}
|
|
23
|
+
*/
|
|
24
|
+
get: function() {
|
|
25
|
+
return this.__entries__.length;
|
|
26
|
+
},
|
|
27
|
+
enumerable: !0,
|
|
28
|
+
configurable: !0
|
|
29
|
+
}), class_1.prototype.get = function(key) {
|
|
30
|
+
var index2 = getIndex(this.__entries__, key), entry = this.__entries__[index2];
|
|
31
|
+
return entry && entry[1];
|
|
32
|
+
}, class_1.prototype.set = function(key, value) {
|
|
33
|
+
var index2 = getIndex(this.__entries__, key);
|
|
34
|
+
~index2 ? this.__entries__[index2][1] = value : this.__entries__.push([key, value]);
|
|
35
|
+
}, class_1.prototype.delete = function(key) {
|
|
36
|
+
var entries = this.__entries__, index2 = getIndex(entries, key);
|
|
37
|
+
~index2 && entries.splice(index2, 1);
|
|
38
|
+
}, class_1.prototype.has = function(key) {
|
|
39
|
+
return !!~getIndex(this.__entries__, key);
|
|
40
|
+
}, class_1.prototype.clear = function() {
|
|
41
|
+
this.__entries__.splice(0);
|
|
42
|
+
}, class_1.prototype.forEach = function(callback, ctx) {
|
|
43
|
+
ctx === void 0 && (ctx = null);
|
|
44
|
+
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
45
|
+
var entry = _a[_i];
|
|
46
|
+
callback.call(ctx, entry[1], entry[0]);
|
|
47
|
+
}
|
|
48
|
+
}, class_1;
|
|
49
|
+
}()
|
|
50
|
+
);
|
|
51
|
+
}(), isBrowser = typeof window < "u" && typeof document < "u" && window.document === document, global$1 = function() {
|
|
52
|
+
return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
|
|
53
|
+
}(), requestAnimationFrame$1 = function() {
|
|
54
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(global$1) : function(callback) {
|
|
55
|
+
return setTimeout(function() {
|
|
56
|
+
return callback(Date.now());
|
|
57
|
+
}, 1e3 / 60);
|
|
58
|
+
};
|
|
59
|
+
}(), trailingTimeout = 2;
|
|
60
|
+
function throttle(callback, delay2) {
|
|
61
|
+
var leadingCall = !1, trailingCall = !1, lastCallTime = 0;
|
|
62
|
+
function resolvePending() {
|
|
63
|
+
leadingCall && (leadingCall = !1, callback()), trailingCall && proxy();
|
|
64
|
+
}
|
|
65
|
+
function timeoutCallback() {
|
|
66
|
+
requestAnimationFrame$1(resolvePending);
|
|
67
|
+
}
|
|
68
|
+
function proxy() {
|
|
69
|
+
var timeStamp = Date.now();
|
|
70
|
+
if (leadingCall) {
|
|
71
|
+
if (timeStamp - lastCallTime < trailingTimeout)
|
|
72
|
+
return;
|
|
73
|
+
trailingCall = !0;
|
|
74
|
+
} else
|
|
75
|
+
leadingCall = !0, trailingCall = !1, setTimeout(timeoutCallback, delay2);
|
|
76
|
+
lastCallTime = timeStamp;
|
|
77
|
+
}
|
|
78
|
+
return proxy;
|
|
79
|
+
}
|
|
80
|
+
var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], mutationObserverSupported = typeof MutationObserver < "u", ResizeObserverController = (
|
|
81
|
+
/** @class */
|
|
82
|
+
function() {
|
|
83
|
+
function ResizeObserverController2() {
|
|
84
|
+
this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
85
|
+
}
|
|
86
|
+
return ResizeObserverController2.prototype.addObserver = function(observer) {
|
|
87
|
+
~this.observers_.indexOf(observer) || this.observers_.push(observer), this.connected_ || this.connect_();
|
|
88
|
+
}, ResizeObserverController2.prototype.removeObserver = function(observer) {
|
|
89
|
+
var observers2 = this.observers_, index2 = observers2.indexOf(observer);
|
|
90
|
+
~index2 && observers2.splice(index2, 1), !observers2.length && this.connected_ && this.disconnect_();
|
|
91
|
+
}, ResizeObserverController2.prototype.refresh = function() {
|
|
92
|
+
var changesDetected = this.updateObservers_();
|
|
93
|
+
changesDetected && this.refresh();
|
|
94
|
+
}, ResizeObserverController2.prototype.updateObservers_ = function() {
|
|
95
|
+
var activeObservers = this.observers_.filter(function(observer) {
|
|
96
|
+
return observer.gatherActive(), observer.hasActive();
|
|
97
|
+
});
|
|
98
|
+
return activeObservers.forEach(function(observer) {
|
|
99
|
+
return observer.broadcastActive();
|
|
100
|
+
}), activeObservers.length > 0;
|
|
101
|
+
}, ResizeObserverController2.prototype.connect_ = function() {
|
|
102
|
+
!isBrowser || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), mutationObserverSupported ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
|
|
103
|
+
attributes: !0,
|
|
104
|
+
childList: !0,
|
|
105
|
+
characterData: !0,
|
|
106
|
+
subtree: !0
|
|
107
|
+
})) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
|
|
108
|
+
}, ResizeObserverController2.prototype.disconnect_ = function() {
|
|
109
|
+
!isBrowser || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
|
|
110
|
+
}, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
|
|
111
|
+
var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
|
|
112
|
+
return !!~propertyName.indexOf(key);
|
|
113
|
+
});
|
|
114
|
+
isReflowProperty && this.refresh();
|
|
115
|
+
}, ResizeObserverController2.getInstance = function() {
|
|
116
|
+
return this.instance_ || (this.instance_ = new ResizeObserverController2()), this.instance_;
|
|
117
|
+
}, ResizeObserverController2.instance_ = null, ResizeObserverController2;
|
|
118
|
+
}()
|
|
119
|
+
), defineConfigurable = function(target, props) {
|
|
120
|
+
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
121
|
+
var key = _a[_i];
|
|
122
|
+
Object.defineProperty(target, key, {
|
|
123
|
+
value: props[key],
|
|
124
|
+
enumerable: !1,
|
|
125
|
+
writable: !1,
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return target;
|
|
130
|
+
}, getWindowOf = function(target) {
|
|
131
|
+
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
132
|
+
return ownerGlobal || global$1;
|
|
133
|
+
}, emptyRect = createRectInit(0, 0, 0, 0);
|
|
134
|
+
function toFloat(value) {
|
|
135
|
+
return parseFloat(value) || 0;
|
|
136
|
+
}
|
|
137
|
+
function getBordersSize(styles) {
|
|
138
|
+
for (var positions = [], _i = 1; _i < arguments.length; _i++)
|
|
139
|
+
positions[_i - 1] = arguments[_i];
|
|
140
|
+
return positions.reduce(function(size, position) {
|
|
141
|
+
var value = styles["border-" + position + "-width"];
|
|
142
|
+
return size + toFloat(value);
|
|
143
|
+
}, 0);
|
|
144
|
+
}
|
|
145
|
+
function getPaddings(styles) {
|
|
146
|
+
for (var positions = ["top", "right", "bottom", "left"], paddings = {}, _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
147
|
+
var position = positions_1[_i], value = styles["padding-" + position];
|
|
148
|
+
paddings[position] = toFloat(value);
|
|
149
|
+
}
|
|
150
|
+
return paddings;
|
|
151
|
+
}
|
|
152
|
+
function getSVGContentRect(target) {
|
|
153
|
+
var bbox = target.getBBox();
|
|
154
|
+
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
155
|
+
}
|
|
156
|
+
function getHTMLElementContentRect(target) {
|
|
157
|
+
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
158
|
+
if (!clientWidth && !clientHeight)
|
|
159
|
+
return emptyRect;
|
|
160
|
+
var styles = getWindowOf(target).getComputedStyle(target), paddings = getPaddings(styles), horizPad = paddings.left + paddings.right, vertPad = paddings.top + paddings.bottom, width = toFloat(styles.width), height = toFloat(styles.height);
|
|
161
|
+
if (styles.boxSizing === "border-box" && (Math.round(width + horizPad) !== clientWidth && (width -= getBordersSize(styles, "left", "right") + horizPad), Math.round(height + vertPad) !== clientHeight && (height -= getBordersSize(styles, "top", "bottom") + vertPad)), !isDocumentElement(target)) {
|
|
162
|
+
var vertScrollbar = Math.round(width + horizPad) - clientWidth, horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
163
|
+
Math.abs(vertScrollbar) !== 1 && (width -= vertScrollbar), Math.abs(horizScrollbar) !== 1 && (height -= horizScrollbar);
|
|
164
|
+
}
|
|
165
|
+
return createRectInit(paddings.left, paddings.top, width, height);
|
|
166
|
+
}
|
|
167
|
+
var isSVGGraphicsElement = function() {
|
|
168
|
+
return typeof SVGGraphicsElement < "u" ? function(target) {
|
|
169
|
+
return target instanceof getWindowOf(target).SVGGraphicsElement;
|
|
170
|
+
} : function(target) {
|
|
171
|
+
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox == "function";
|
|
172
|
+
};
|
|
173
|
+
}();
|
|
174
|
+
function isDocumentElement(target) {
|
|
175
|
+
return target === getWindowOf(target).document.documentElement;
|
|
176
|
+
}
|
|
177
|
+
function getContentRect(target) {
|
|
178
|
+
return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
|
|
179
|
+
}
|
|
180
|
+
function createReadOnlyRect(_a) {
|
|
181
|
+
var x = _a.x, y = _a.y, width = _a.width, height = _a.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
|
|
182
|
+
return defineConfigurable(rect, {
|
|
183
|
+
x,
|
|
184
|
+
y,
|
|
185
|
+
width,
|
|
186
|
+
height,
|
|
187
|
+
top: y,
|
|
188
|
+
right: x + width,
|
|
189
|
+
bottom: height + y,
|
|
190
|
+
left: x
|
|
191
|
+
}), rect;
|
|
192
|
+
}
|
|
193
|
+
function createRectInit(x, y, width, height) {
|
|
194
|
+
return { x, y, width, height };
|
|
195
|
+
}
|
|
196
|
+
var ResizeObservation = (
|
|
197
|
+
/** @class */
|
|
198
|
+
function() {
|
|
199
|
+
function ResizeObservation2(target) {
|
|
200
|
+
this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = createRectInit(0, 0, 0, 0), this.target = target;
|
|
201
|
+
}
|
|
202
|
+
return ResizeObservation2.prototype.isActive = function() {
|
|
203
|
+
var rect = getContentRect(this.target);
|
|
204
|
+
return this.contentRect_ = rect, rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
|
|
205
|
+
}, ResizeObservation2.prototype.broadcastRect = function() {
|
|
206
|
+
var rect = this.contentRect_;
|
|
207
|
+
return this.broadcastWidth = rect.width, this.broadcastHeight = rect.height, rect;
|
|
208
|
+
}, ResizeObservation2;
|
|
209
|
+
}()
|
|
210
|
+
), ResizeObserverEntry = (
|
|
211
|
+
/** @class */
|
|
212
|
+
function() {
|
|
213
|
+
function ResizeObserverEntry2(target, rectInit) {
|
|
214
|
+
var contentRect = createReadOnlyRect(rectInit);
|
|
215
|
+
defineConfigurable(this, { target, contentRect });
|
|
216
|
+
}
|
|
217
|
+
return ResizeObserverEntry2;
|
|
218
|
+
}()
|
|
219
|
+
), ResizeObserverSPI = (
|
|
220
|
+
/** @class */
|
|
221
|
+
function() {
|
|
222
|
+
function ResizeObserverSPI2(callback, controller, callbackCtx) {
|
|
223
|
+
if (this.activeObservations_ = [], this.observations_ = new MapShim(), typeof callback != "function")
|
|
224
|
+
throw new TypeError("The callback provided as parameter 1 is not a function.");
|
|
225
|
+
this.callback_ = callback, this.controller_ = controller, this.callbackCtx_ = callbackCtx;
|
|
226
|
+
}
|
|
227
|
+
return ResizeObserverSPI2.prototype.observe = function(target) {
|
|
228
|
+
if (!arguments.length)
|
|
229
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
230
|
+
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
231
|
+
if (!(target instanceof getWindowOf(target).Element))
|
|
232
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
233
|
+
var observations = this.observations_;
|
|
234
|
+
observations.has(target) || (observations.set(target, new ResizeObservation(target)), this.controller_.addObserver(this), this.controller_.refresh());
|
|
235
|
+
}
|
|
236
|
+
}, ResizeObserverSPI2.prototype.unobserve = function(target) {
|
|
237
|
+
if (!arguments.length)
|
|
238
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
239
|
+
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
240
|
+
if (!(target instanceof getWindowOf(target).Element))
|
|
241
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
242
|
+
var observations = this.observations_;
|
|
243
|
+
observations.has(target) && (observations.delete(target), observations.size || this.controller_.removeObserver(this));
|
|
244
|
+
}
|
|
245
|
+
}, ResizeObserverSPI2.prototype.disconnect = function() {
|
|
246
|
+
this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
|
|
247
|
+
}, ResizeObserverSPI2.prototype.gatherActive = function() {
|
|
248
|
+
var _this = this;
|
|
249
|
+
this.clearActive(), this.observations_.forEach(function(observation) {
|
|
250
|
+
observation.isActive() && _this.activeObservations_.push(observation);
|
|
251
|
+
});
|
|
252
|
+
}, ResizeObserverSPI2.prototype.broadcastActive = function() {
|
|
253
|
+
if (this.hasActive()) {
|
|
254
|
+
var ctx = this.callbackCtx_, entries = this.activeObservations_.map(function(observation) {
|
|
255
|
+
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
256
|
+
});
|
|
257
|
+
this.callback_.call(ctx, entries, ctx), this.clearActive();
|
|
258
|
+
}
|
|
259
|
+
}, ResizeObserverSPI2.prototype.clearActive = function() {
|
|
260
|
+
this.activeObservations_.splice(0);
|
|
261
|
+
}, ResizeObserverSPI2.prototype.hasActive = function() {
|
|
262
|
+
return this.activeObservations_.length > 0;
|
|
263
|
+
}, ResizeObserverSPI2;
|
|
264
|
+
}()
|
|
265
|
+
), observers = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new MapShim(), ResizeObserver = (
|
|
266
|
+
/** @class */
|
|
267
|
+
function() {
|
|
268
|
+
function ResizeObserver2(callback) {
|
|
269
|
+
if (!(this instanceof ResizeObserver2))
|
|
270
|
+
throw new TypeError("Cannot call a class as a function.");
|
|
271
|
+
if (!arguments.length)
|
|
272
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
273
|
+
var controller = ResizeObserverController.getInstance(), observer = new ResizeObserverSPI(callback, controller, this);
|
|
274
|
+
observers.set(this, observer);
|
|
275
|
+
}
|
|
276
|
+
return ResizeObserver2;
|
|
277
|
+
}()
|
|
278
|
+
);
|
|
279
|
+
[
|
|
280
|
+
"observe",
|
|
281
|
+
"unobserve",
|
|
282
|
+
"disconnect"
|
|
283
|
+
].forEach(function(method) {
|
|
284
|
+
ResizeObserver.prototype[method] = function() {
|
|
285
|
+
var _a;
|
|
286
|
+
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
var index = function() {
|
|
290
|
+
return typeof global$1.ResizeObserver < "u" ? global$1.ResizeObserver : ResizeObserver;
|
|
291
|
+
}();
|
|
292
|
+
const isServer = typeof window > "u", resizeHandler = (entries) => {
|
|
293
|
+
for (const entry of entries) {
|
|
294
|
+
const listeners = entry.target.__resizeListeners__ || [];
|
|
295
|
+
listeners.length && listeners.forEach((fn) => {
|
|
296
|
+
fn();
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}, addResizeListener = (element, fn) => {
|
|
300
|
+
isServer || (element.__resizeListeners__ || (element.__resizeListeners__ = [], element.__ro__ = new index(resizeHandler), element.__ro__.observe(element)), element.__resizeListeners__.push(fn));
|
|
301
|
+
}, removeResizeListener = (element, fn) => {
|
|
302
|
+
!element || !element.__resizeListeners__ || (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1), element.__resizeListeners__.length || element.__ro__.disconnect());
|
|
303
|
+
};
|
|
304
|
+
var render = function() {
|
|
305
|
+
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
306
|
+
return _c("div", {
|
|
7
307
|
staticClass: "editable-tree"
|
|
8
|
-
}, [!
|
|
308
|
+
}, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top-right" ? _c("ElButton", {
|
|
9
309
|
staticStyle: {
|
|
10
310
|
position: "absolute",
|
|
11
311
|
top: "4px",
|
|
12
312
|
"z-index": "1"
|
|
13
313
|
},
|
|
14
314
|
style: {
|
|
15
|
-
right: `${
|
|
315
|
+
right: `${_vm.right}px`
|
|
16
316
|
},
|
|
17
317
|
attrs: {
|
|
18
318
|
type: "primary",
|
|
@@ -22,95 +322,95 @@ var B = function() {
|
|
|
22
322
|
plain: ""
|
|
23
323
|
},
|
|
24
324
|
on: {
|
|
25
|
-
click: function(
|
|
26
|
-
return
|
|
325
|
+
click: function($event) {
|
|
326
|
+
return $event.stopPropagation(), _vm.$emit("add-root-node");
|
|
27
327
|
}
|
|
28
328
|
}
|
|
29
|
-
}) :
|
|
329
|
+
}) : _vm._e(), _c("div", {
|
|
30
330
|
ref: "treeWrapper",
|
|
31
331
|
staticClass: "et-tree-wrapper"
|
|
32
|
-
}, [!
|
|
332
|
+
}, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top" ? _c("div", {
|
|
33
333
|
staticStyle: {
|
|
34
334
|
"padding-left": "24px"
|
|
35
335
|
}
|
|
36
|
-
}, [
|
|
336
|
+
}, [_c("ElButton", {
|
|
37
337
|
attrs: {
|
|
38
|
-
disabled:
|
|
338
|
+
disabled: _vm.loading,
|
|
39
339
|
size: "mini",
|
|
40
340
|
type: "text"
|
|
41
341
|
},
|
|
42
342
|
on: {
|
|
43
|
-
click:
|
|
343
|
+
click: _vm.appendRootNode
|
|
44
344
|
}
|
|
45
|
-
}, [
|
|
345
|
+
}, [_c("i", {
|
|
46
346
|
staticClass: "el-icon-lx-add"
|
|
47
|
-
}),
|
|
48
|
-
key:
|
|
347
|
+
}), _vm._v(" " + _vm._s(_vm.addRootNodeLabel ? _vm.addRootNodeLabel : `添加${_vm.label}`) + " ")])], 1) : _vm._e(), _c("ElTree", _vm._g(_vm._b({
|
|
348
|
+
key: _vm.treeKey,
|
|
49
349
|
ref: "tree",
|
|
50
350
|
staticClass: "flex-item",
|
|
51
351
|
attrs: {
|
|
52
|
-
"default-expanded-keys":
|
|
352
|
+
"default-expanded-keys": _vm.expandedKeys,
|
|
53
353
|
"expand-on-click-node": !1,
|
|
54
354
|
"highlight-current": "",
|
|
55
|
-
load:
|
|
56
|
-
data:
|
|
57
|
-
props:
|
|
58
|
-
lazy:
|
|
59
|
-
"node-key":
|
|
355
|
+
load: _vm.loadNode,
|
|
356
|
+
data: _vm.innerTreeData,
|
|
357
|
+
props: _vm.treeProps,
|
|
358
|
+
lazy: _vm.lazy,
|
|
359
|
+
"node-key": _vm.nodeKey
|
|
60
360
|
},
|
|
61
361
|
on: {
|
|
62
|
-
"node-click":
|
|
63
|
-
"node-contextmenu":
|
|
64
|
-
"node-expand":
|
|
65
|
-
"node-collapse":
|
|
362
|
+
"node-click": _vm.nodeClick,
|
|
363
|
+
"node-contextmenu": _vm.showContextMenu,
|
|
364
|
+
"node-expand": _vm.addExpandKey,
|
|
365
|
+
"node-collapse": _vm.removeExpandKey
|
|
66
366
|
},
|
|
67
|
-
scopedSlots:
|
|
367
|
+
scopedSlots: _vm._u([{
|
|
68
368
|
key: "default",
|
|
69
|
-
fn: function(
|
|
70
|
-
var
|
|
71
|
-
return [
|
|
72
|
-
return [
|
|
369
|
+
fn: function(_ref) {
|
|
370
|
+
var node = _ref.node, data = _ref.data;
|
|
371
|
+
return [_vm._t("default", function() {
|
|
372
|
+
return [data.edit ? [_c("span", {
|
|
73
373
|
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
74
374
|
attrs: {
|
|
75
|
-
"data-id":
|
|
375
|
+
"data-id": data.id
|
|
76
376
|
}
|
|
77
|
-
}, [
|
|
377
|
+
}, [_vm.icon ? _c("i", {
|
|
78
378
|
staticClass: "node-icon shrink-0",
|
|
79
|
-
class:
|
|
80
|
-
}) :
|
|
379
|
+
class: data.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
380
|
+
}) : _vm._e(), _c("ElInput", {
|
|
81
381
|
ref: "labelTxt",
|
|
82
382
|
staticClass: "node-input flex-item",
|
|
83
383
|
attrs: {
|
|
84
384
|
size: "mini",
|
|
85
|
-
placeholder:
|
|
385
|
+
placeholder: _vm.defaultOptions.inputPlaceholder
|
|
86
386
|
},
|
|
87
387
|
on: {
|
|
88
|
-
blur: function(
|
|
89
|
-
return
|
|
388
|
+
blur: function(event) {
|
|
389
|
+
return _vm.inputBlur(event, node, data);
|
|
90
390
|
}
|
|
91
391
|
},
|
|
92
392
|
nativeOn: {
|
|
93
|
-
keyup: function(
|
|
94
|
-
return function(
|
|
95
|
-
return
|
|
393
|
+
keyup: function($event) {
|
|
394
|
+
return function(event) {
|
|
395
|
+
return _vm.inputKeyup(event, node, data);
|
|
96
396
|
}.apply(null, arguments);
|
|
97
397
|
},
|
|
98
|
-
click: function(
|
|
99
|
-
|
|
398
|
+
click: function($event) {
|
|
399
|
+
$event.stopPropagation();
|
|
100
400
|
}
|
|
101
401
|
},
|
|
102
402
|
model: {
|
|
103
|
-
value:
|
|
104
|
-
callback: function(
|
|
105
|
-
|
|
403
|
+
value: _vm.text,
|
|
404
|
+
callback: function($$v) {
|
|
405
|
+
_vm.text = $$v;
|
|
106
406
|
},
|
|
107
407
|
expression: "text"
|
|
108
408
|
}
|
|
109
|
-
}),
|
|
409
|
+
}), _vm.confirmButton ? [_c("ElButton", {
|
|
110
410
|
directives: [{
|
|
111
411
|
name: "show",
|
|
112
412
|
rawName: "v-show",
|
|
113
|
-
value: !
|
|
413
|
+
value: !data.loading,
|
|
114
414
|
expression: "!data.loading"
|
|
115
415
|
}],
|
|
116
416
|
staticClass: "shrink-0",
|
|
@@ -119,15 +419,15 @@ var B = function() {
|
|
|
119
419
|
type: "text"
|
|
120
420
|
},
|
|
121
421
|
on: {
|
|
122
|
-
click: function(
|
|
123
|
-
return
|
|
422
|
+
click: function($event) {
|
|
423
|
+
return $event.stopPropagation(), _vm.onConfirm(node, data);
|
|
124
424
|
}
|
|
125
425
|
}
|
|
126
|
-
}, [
|
|
426
|
+
}, [_vm._v("确定")]), _c("ElButton", {
|
|
127
427
|
directives: [{
|
|
128
428
|
name: "show",
|
|
129
429
|
rawName: "v-show",
|
|
130
|
-
value: !
|
|
430
|
+
value: !data.loading,
|
|
131
431
|
expression: "!data.loading"
|
|
132
432
|
}],
|
|
133
433
|
staticClass: "shrink-0",
|
|
@@ -136,85 +436,85 @@ var B = function() {
|
|
|
136
436
|
type: "text"
|
|
137
437
|
},
|
|
138
438
|
on: {
|
|
139
|
-
click: function(
|
|
140
|
-
return
|
|
439
|
+
click: function($event) {
|
|
440
|
+
return $event.stopPropagation(), _vm.onCancel(node, data);
|
|
141
441
|
}
|
|
142
442
|
}
|
|
143
|
-
}, [
|
|
443
|
+
}, [_vm._v("取消")])] : _vm._e()], 2)] : [_c("span", {
|
|
144
444
|
staticClass: "custom-tree-node",
|
|
145
445
|
attrs: {
|
|
146
|
-
"data-id":
|
|
446
|
+
"data-id": data.id
|
|
147
447
|
}
|
|
148
|
-
}, [
|
|
448
|
+
}, [_c("span", {
|
|
149
449
|
staticClass: "node-label flex-row flex-item oh ellipsis-1"
|
|
150
|
-
}, [
|
|
450
|
+
}, [_vm.icon ? _c("i", {
|
|
151
451
|
staticClass: "node-icon",
|
|
152
|
-
class:
|
|
153
|
-
}) :
|
|
452
|
+
class: data.loading ? "el-icon-loading" : _vm.icon(data, node)
|
|
453
|
+
}) : _vm._e(), _c("span", {
|
|
154
454
|
staticClass: "flex-item-relative",
|
|
155
455
|
staticStyle: {
|
|
156
456
|
height: "21px"
|
|
157
457
|
}
|
|
158
|
-
}, [
|
|
458
|
+
}, [_c("span", {
|
|
159
459
|
staticClass: "ellipsis-1 absolute-box et-tree-label",
|
|
160
460
|
attrs: {
|
|
161
|
-
title:
|
|
461
|
+
title: node.label
|
|
162
462
|
}
|
|
163
|
-
}, [
|
|
164
|
-
return [
|
|
463
|
+
}, [_vm._t("label", function() {
|
|
464
|
+
return [_vm._v(_vm._s(node.label))];
|
|
165
465
|
}, {
|
|
166
|
-
data
|
|
167
|
-
node
|
|
168
|
-
})], 2)]),
|
|
169
|
-
node
|
|
170
|
-
data
|
|
171
|
-
})], 2), !
|
|
466
|
+
data,
|
|
467
|
+
node
|
|
468
|
+
})], 2)]), _vm._t("label-suffix", null, {
|
|
469
|
+
node,
|
|
470
|
+
data
|
|
471
|
+
})], 2), !_vm.contextMenu && !_vm.readonly ? _c("span", {
|
|
172
472
|
directives: [{
|
|
173
473
|
name: "show",
|
|
174
474
|
rawName: "v-show",
|
|
175
|
-
value: !
|
|
475
|
+
value: !data.loading && !_vm.loading,
|
|
176
476
|
expression: "!data.loading && !loading"
|
|
177
477
|
}],
|
|
178
478
|
staticClass: "handle-actions"
|
|
179
|
-
}, [
|
|
479
|
+
}, [_c("ElButton", {
|
|
180
480
|
attrs: {
|
|
181
481
|
size: "mini",
|
|
182
482
|
type: "text"
|
|
183
483
|
},
|
|
184
484
|
on: {
|
|
185
|
-
click: function(
|
|
186
|
-
return
|
|
485
|
+
click: function($event) {
|
|
486
|
+
return $event.stopPropagation(), _vm.appendChildNode(node, data);
|
|
187
487
|
}
|
|
188
488
|
}
|
|
189
|
-
}, [
|
|
489
|
+
}, [_vm._v("添加")]), _c("ElButton", {
|
|
190
490
|
attrs: {
|
|
191
491
|
size: "mini",
|
|
192
492
|
type: "text"
|
|
193
493
|
},
|
|
194
494
|
on: {
|
|
195
|
-
click: function(
|
|
196
|
-
return
|
|
495
|
+
click: function($event) {
|
|
496
|
+
return $event.stopPropagation(), _vm.editNode(node, data);
|
|
197
497
|
}
|
|
198
498
|
}
|
|
199
|
-
}, [
|
|
499
|
+
}, [_vm._v("修改")]), _c("ElPopconfirm", {
|
|
200
500
|
staticClass: "pop-confirm",
|
|
201
501
|
attrs: {
|
|
202
502
|
"icon-color": "red",
|
|
203
503
|
title: "你确定要删除吗?"
|
|
204
504
|
},
|
|
205
505
|
on: {
|
|
206
|
-
confirm: function(
|
|
207
|
-
return
|
|
506
|
+
confirm: function($event) {
|
|
507
|
+
return _vm.removeNode(node, data);
|
|
208
508
|
}
|
|
209
509
|
},
|
|
210
|
-
scopedSlots:
|
|
510
|
+
scopedSlots: _vm._u([{
|
|
211
511
|
key: "reference",
|
|
212
512
|
fn: function() {
|
|
213
|
-
return [
|
|
513
|
+
return [_c("ElButton", {
|
|
214
514
|
directives: [{
|
|
215
515
|
name: "show",
|
|
216
516
|
rawName: "v-show",
|
|
217
|
-
value:
|
|
517
|
+
value: node.isLeaf,
|
|
218
518
|
expression: "node.isLeaf"
|
|
219
519
|
}],
|
|
220
520
|
staticStyle: {
|
|
@@ -225,26 +525,26 @@ var B = function() {
|
|
|
225
525
|
type: "text"
|
|
226
526
|
},
|
|
227
527
|
on: {
|
|
228
|
-
click: function(
|
|
229
|
-
|
|
528
|
+
click: function($event) {
|
|
529
|
+
$event.stopPropagation();
|
|
230
530
|
}
|
|
231
531
|
}
|
|
232
|
-
}, [
|
|
532
|
+
}, [_vm._v("删除")])];
|
|
233
533
|
},
|
|
234
534
|
proxy: !0
|
|
235
535
|
}], null, !0)
|
|
236
|
-
})], 1) :
|
|
536
|
+
})], 1) : _vm._e(), _vm.contextMenuIcon && _vm.contextMenu && !_vm.readonly ? _c("span", {
|
|
237
537
|
directives: [{
|
|
238
538
|
name: "show",
|
|
239
539
|
rawName: "v-show",
|
|
240
|
-
value: !
|
|
540
|
+
value: !data.loading && !_vm.loading,
|
|
241
541
|
expression: "!data.loading && !loading"
|
|
242
542
|
}],
|
|
243
543
|
staticClass: "handle-actions",
|
|
244
544
|
staticStyle: {
|
|
245
545
|
display: "inline-block"
|
|
246
546
|
}
|
|
247
|
-
}, [
|
|
547
|
+
}, [_c("ElButton", {
|
|
248
548
|
staticStyle: {
|
|
249
549
|
padding: "6px 10px 0"
|
|
250
550
|
},
|
|
@@ -253,103 +553,103 @@ var B = function() {
|
|
|
253
553
|
type: "text"
|
|
254
554
|
},
|
|
255
555
|
on: {
|
|
256
|
-
click: function(
|
|
257
|
-
return
|
|
556
|
+
click: function($event) {
|
|
557
|
+
return $event.stopPropagation(), _vm.showContextMenu($event, data, node);
|
|
258
558
|
}
|
|
259
559
|
}
|
|
260
|
-
}, [
|
|
560
|
+
}, [_vm._v(". . .")])], 1) : _vm._e()])]];
|
|
261
561
|
}, {
|
|
262
|
-
node
|
|
263
|
-
data
|
|
562
|
+
node,
|
|
563
|
+
data
|
|
264
564
|
})];
|
|
265
565
|
}
|
|
266
566
|
}], null, !0)
|
|
267
|
-
}, "ElTree",
|
|
567
|
+
}, "ElTree", _vm.filterTreeProperties(_vm.$attrs), !1), _vm.filterTreeEvents(_vm.$listeners))), _vm.contextMenu && !_vm.readonly ? _c("div", {
|
|
268
568
|
directives: [{
|
|
269
569
|
name: "show",
|
|
270
570
|
rawName: "v-show",
|
|
271
|
-
value:
|
|
571
|
+
value: _vm.showMenu,
|
|
272
572
|
expression: "showMenu"
|
|
273
573
|
}],
|
|
274
574
|
ref: "contextMenu",
|
|
275
575
|
staticClass: "menu",
|
|
276
|
-
style:
|
|
277
|
-
}, [
|
|
576
|
+
style: _vm.position
|
|
577
|
+
}, [_c("ul", {
|
|
278
578
|
staticClass: "menu-list"
|
|
279
|
-
}, [
|
|
280
|
-
return [
|
|
579
|
+
}, [_vm._t("context-menu", function() {
|
|
580
|
+
return [_c("li", {
|
|
281
581
|
directives: [{
|
|
282
582
|
name: "show",
|
|
283
583
|
rawName: "v-show",
|
|
284
|
-
value:
|
|
584
|
+
value: _vm.curData.id > -1,
|
|
285
585
|
expression: "curData.id > -1"
|
|
286
586
|
}],
|
|
287
587
|
staticClass: "menu-item",
|
|
288
588
|
on: {
|
|
289
|
-
click: function(
|
|
290
|
-
return
|
|
589
|
+
click: function($event) {
|
|
590
|
+
return _vm.appendPeerNode(_vm.curNode, _vm.curData);
|
|
291
591
|
}
|
|
292
592
|
}
|
|
293
|
-
}, [
|
|
593
|
+
}, [_c("i", {
|
|
294
594
|
staticClass: "menu-item-icon el-icon-lx-add",
|
|
295
595
|
staticStyle: {
|
|
296
596
|
color: "#228b22"
|
|
297
597
|
}
|
|
298
|
-
}),
|
|
598
|
+
}), _vm._v(_vm._s(_vm.menuLabel.appendPeer) + " ")]), _c("li", {
|
|
299
599
|
staticClass: "menu-item",
|
|
300
600
|
on: {
|
|
301
|
-
click: function(
|
|
302
|
-
return
|
|
601
|
+
click: function($event) {
|
|
602
|
+
return _vm.appendChildNode(_vm.curNode, _vm.curData);
|
|
303
603
|
}
|
|
304
604
|
}
|
|
305
|
-
}, [
|
|
605
|
+
}, [_c("i", {
|
|
306
606
|
staticClass: "menu-item-icon el-icon-lx-add",
|
|
307
607
|
staticStyle: {
|
|
308
608
|
color: "#228b22"
|
|
309
609
|
}
|
|
310
|
-
}),
|
|
610
|
+
}), _vm._v(_vm._s(_vm.menuLabel.appendChild) + " ")]), _c("li", {
|
|
311
611
|
directives: [{
|
|
312
612
|
name: "show",
|
|
313
613
|
rawName: "v-show",
|
|
314
|
-
value:
|
|
614
|
+
value: _vm.curData.id > -1,
|
|
315
615
|
expression: "curData.id > -1"
|
|
316
616
|
}],
|
|
317
617
|
staticClass: "menu-item",
|
|
318
618
|
on: {
|
|
319
|
-
click: function(
|
|
320
|
-
return
|
|
619
|
+
click: function($event) {
|
|
620
|
+
return _vm.editNode(_vm.curNode, _vm.curData);
|
|
321
621
|
}
|
|
322
622
|
}
|
|
323
|
-
}, [
|
|
623
|
+
}, [_c("i", {
|
|
324
624
|
staticClass: "menu-item-icon el-icon-edit-outline",
|
|
325
625
|
staticStyle: {
|
|
326
626
|
color: "#ffa500"
|
|
327
627
|
}
|
|
328
|
-
}),
|
|
628
|
+
}), _vm._v(_vm._s(_vm.menuLabel.editNode) + " ")]), _c("li", {
|
|
329
629
|
directives: [{
|
|
330
630
|
name: "show",
|
|
331
631
|
rawName: "v-show",
|
|
332
|
-
value:
|
|
632
|
+
value: _vm.curNode.isLeaf,
|
|
333
633
|
expression: "curNode.isLeaf"
|
|
334
634
|
}],
|
|
335
635
|
staticClass: "menu-item",
|
|
336
636
|
on: {
|
|
337
|
-
click: function(
|
|
338
|
-
return
|
|
637
|
+
click: function($event) {
|
|
638
|
+
return _vm.removeNodeModal(_vm.curNode, _vm.curData);
|
|
339
639
|
}
|
|
340
640
|
}
|
|
341
|
-
}, [
|
|
641
|
+
}, [_c("i", {
|
|
342
642
|
staticClass: "menu-item-icon el-icon-delete",
|
|
343
643
|
staticStyle: {
|
|
344
644
|
color: "#f00"
|
|
345
645
|
}
|
|
346
|
-
}),
|
|
646
|
+
}), _vm._v(_vm._s(_vm.menuLabel.removeNode) + " ")])];
|
|
347
647
|
}, {
|
|
348
|
-
curNode:
|
|
349
|
-
curData:
|
|
350
|
-
})], 2)]) :
|
|
351
|
-
},
|
|
352
|
-
const
|
|
648
|
+
curNode: _vm.curNode,
|
|
649
|
+
curData: _vm.curData
|
|
650
|
+
})], 2)]) : _vm._e()], 1)], 1);
|
|
651
|
+
}, staticRenderFns = [];
|
|
652
|
+
const __vue2_script = {
|
|
353
653
|
name: "EditableTree",
|
|
354
654
|
props: {
|
|
355
655
|
label: {
|
|
@@ -365,9 +665,9 @@ const M = {
|
|
|
365
665
|
},
|
|
366
666
|
newNodeBuilder: {
|
|
367
667
|
type: Function,
|
|
368
|
-
default: (
|
|
369
|
-
name
|
|
370
|
-
parentId:
|
|
668
|
+
default: (name, parent) => ({
|
|
669
|
+
name,
|
|
670
|
+
parentId: parent.id
|
|
371
671
|
})
|
|
372
672
|
},
|
|
373
673
|
contextMenu: Boolean,
|
|
@@ -408,7 +708,7 @@ const M = {
|
|
|
408
708
|
default: () => ({
|
|
409
709
|
children: "children",
|
|
410
710
|
label: "name",
|
|
411
|
-
isLeaf: (
|
|
711
|
+
isLeaf: (data) => hasOwn(data, "hasChildren") ? !data.hasChildren : hasOwn(data, "hasChild") ? !data.hasChild : hasOwn(data, "children") && data.children ? data.children.length === 0 : !0
|
|
412
712
|
})
|
|
413
713
|
},
|
|
414
714
|
menuLabel: {
|
|
@@ -462,19 +762,19 @@ const M = {
|
|
|
462
762
|
modal: !0,
|
|
463
763
|
inputErrorMessage: `${this.label}名不能为空!`,
|
|
464
764
|
inputPlaceholder: `请输入${this.label}名...`,
|
|
465
|
-
inputValidator: (
|
|
765
|
+
inputValidator: (value) => value != null && value.trim().length > 0
|
|
466
766
|
};
|
|
467
767
|
},
|
|
468
768
|
innerTreeData() {
|
|
469
|
-
var
|
|
470
|
-
return (
|
|
769
|
+
var _a;
|
|
770
|
+
return (_a = this.$attrs.data) != null && _a.length ? this.$attrs.data : this.treeData;
|
|
471
771
|
}
|
|
472
772
|
},
|
|
473
773
|
watch: {
|
|
474
774
|
defaultExpandedKeys: {
|
|
475
775
|
immediate: !0,
|
|
476
|
-
handler(
|
|
477
|
-
this.expandedKeys = [...
|
|
776
|
+
handler(newVal) {
|
|
777
|
+
this.expandedKeys = [...newVal];
|
|
478
778
|
}
|
|
479
779
|
}
|
|
480
780
|
},
|
|
@@ -482,61 +782,61 @@ const M = {
|
|
|
482
782
|
this.tryFetch();
|
|
483
783
|
},
|
|
484
784
|
mounted() {
|
|
485
|
-
|
|
785
|
+
addResizeListener(this.$refs.tree.$el, this.resize), addResizeListener(this.$refs.treeWrapper, this.resize);
|
|
486
786
|
},
|
|
487
787
|
beforeDestroy() {
|
|
488
|
-
|
|
788
|
+
removeResizeListener(this.$refs.tree.$el, this.resize), removeResizeListener(this.$refs.treeWrapper, this.resize);
|
|
489
789
|
},
|
|
490
790
|
methods: {
|
|
491
|
-
filterTreeProperties
|
|
492
|
-
filterTreeEvents
|
|
493
|
-
addExpandKey(
|
|
494
|
-
this.reserveExpandKey && this.expandedKeys.push(
|
|
791
|
+
filterTreeProperties,
|
|
792
|
+
filterTreeEvents,
|
|
793
|
+
addExpandKey(data) {
|
|
794
|
+
this.reserveExpandKey && this.expandedKeys.push(data[this.nodeKey]);
|
|
495
795
|
},
|
|
496
|
-
removeExpandKey(
|
|
497
|
-
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((
|
|
796
|
+
removeExpandKey(data) {
|
|
797
|
+
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((key) => key !== data[this.nodeKey]));
|
|
498
798
|
},
|
|
499
799
|
resize() {
|
|
500
|
-
|
|
800
|
+
isVerticalScrollbarVisible(this.$refs.treeWrapper) ? this.right = 4 + scrollbarWidth : this.right = 4;
|
|
501
801
|
},
|
|
502
|
-
async showContextMenu(
|
|
503
|
-
|
|
802
|
+
async showContextMenu(event, data, node) {
|
|
803
|
+
data.contextmenu === !1 || data.id === -1 || data.id === 0 || data.edit === !0 || this.contextMenu && (this.curNode = node, this.curData = data, this.showMenu = !0, this.$refs.tree.setCurrentKey(data.id), await this.$nextTick(), this.position = computePosition(event, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
504
804
|
},
|
|
505
805
|
hideContextMenu() {
|
|
506
806
|
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
507
807
|
},
|
|
508
808
|
async tryFetch() {
|
|
509
|
-
var
|
|
809
|
+
var _a;
|
|
510
810
|
if (this.lazy === !1 && this.fetchApi) {
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
} else if (
|
|
516
|
-
const
|
|
517
|
-
|
|
811
|
+
const res = await this.fetchApi(((_a = this.rootNode) == null ? void 0 : _a.id) ?? -1, {});
|
|
812
|
+
if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
|
|
813
|
+
const data = cloneDeep(this.customRootNode);
|
|
814
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
|
|
815
|
+
} else if (isFunction(this.customRootNode)) {
|
|
816
|
+
const data = this.customRootNode(res.data);
|
|
817
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
|
|
518
818
|
} else
|
|
519
|
-
this.treeData =
|
|
819
|
+
this.treeData = res.data;
|
|
520
820
|
}
|
|
521
821
|
},
|
|
522
|
-
async loadNode(
|
|
523
|
-
var
|
|
524
|
-
if (
|
|
525
|
-
const
|
|
526
|
-
if (this.empty =
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
} else if (
|
|
530
|
-
const
|
|
531
|
-
|
|
822
|
+
async loadNode(node, resolve) {
|
|
823
|
+
var _a, _b, _c;
|
|
824
|
+
if (node.level === 0) {
|
|
825
|
+
const res = await this.fetchApi(((_a = this.rootNode) == null ? void 0 : _a.id) ?? -1, node);
|
|
826
|
+
if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
|
|
827
|
+
const data = cloneDeep(this.customRootNode);
|
|
828
|
+
data[this.treeProps.children || "children"] = res.data, resolve([data]);
|
|
829
|
+
} else if (isFunction(this.customRootNode)) {
|
|
830
|
+
const data = this.customRootNode(res.data);
|
|
831
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
|
|
532
832
|
} else
|
|
533
|
-
|
|
534
|
-
await this.$nextTick(), this.$emit("root-node-loaded",
|
|
833
|
+
resolve(res.data);
|
|
834
|
+
await this.$nextTick(), this.$emit("root-node-loaded", res.data), this.defaultExpandedKeys ? this.expandedKeys = [(_b = res == null ? void 0 : res.data[0]) == null ? void 0 : _b.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id]);
|
|
535
835
|
} else {
|
|
536
|
-
if (
|
|
537
|
-
return
|
|
538
|
-
const
|
|
539
|
-
|
|
836
|
+
if (node.leaf || node.data.isTempNode)
|
|
837
|
+
return resolve([]);
|
|
838
|
+
const res = await this.fetchApi(node.data.id, node);
|
|
839
|
+
resolve(res.data), await this.$nextTick(), this.$emit("node-loaded", res.data);
|
|
540
840
|
}
|
|
541
841
|
},
|
|
542
842
|
clear() {
|
|
@@ -549,115 +849,115 @@ const M = {
|
|
|
549
849
|
this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
550
850
|
},
|
|
551
851
|
cancelEdit() {
|
|
552
|
-
this.editData && (
|
|
852
|
+
this.editData && (isUndefined(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
553
853
|
},
|
|
554
|
-
async editNode(
|
|
555
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData =
|
|
854
|
+
async editNode(node, data) {
|
|
855
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = data, this.text = data[this.treeProps.label], isUndefined(data.edit) ? this.$set(data, "edit", !0) : data.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await this.$prompt(`请输入新的${this.label}名:`, {
|
|
556
856
|
...this.defaultOptions,
|
|
557
|
-
inputValue:
|
|
558
|
-
beforeClose: async (
|
|
559
|
-
if (
|
|
857
|
+
inputValue: data[this.treeProps.label],
|
|
858
|
+
beforeClose: async (action, instance, done) => {
|
|
859
|
+
if (action === "confirm") {
|
|
560
860
|
try {
|
|
561
|
-
|
|
861
|
+
instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, await this.onConfirm(this.curNode, this.curData), done();
|
|
562
862
|
} catch {
|
|
563
|
-
|
|
863
|
+
instance.confirmButtonText = "确定";
|
|
564
864
|
}
|
|
565
|
-
|
|
865
|
+
instance.confirmButtonLoading = !1;
|
|
566
866
|
} else
|
|
567
|
-
|
|
867
|
+
done();
|
|
568
868
|
}
|
|
569
|
-
}).catch((
|
|
869
|
+
}).catch((_) => _);
|
|
570
870
|
},
|
|
571
871
|
async appendRootNode() {
|
|
572
872
|
this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.scrollIntoView(!0)) : await this.$prompt(`请输入${this.label}名:`, {
|
|
573
873
|
...this.defaultOptions,
|
|
574
|
-
beforeClose: async (
|
|
575
|
-
if (
|
|
874
|
+
beforeClose: async (action, instance, done) => {
|
|
875
|
+
if (action === "confirm") {
|
|
576
876
|
try {
|
|
577
|
-
this.createNewChild(-1),
|
|
578
|
-
const
|
|
579
|
-
this.newChild[this.treeProps.label] =
|
|
877
|
+
this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
|
|
878
|
+
const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
|
|
879
|
+
this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), done();
|
|
580
880
|
} catch {
|
|
581
|
-
|
|
881
|
+
instance.confirmButtonText = "确定";
|
|
582
882
|
}
|
|
583
|
-
|
|
883
|
+
instance.confirmButtonLoading = !1;
|
|
584
884
|
} else
|
|
585
|
-
|
|
885
|
+
done();
|
|
586
886
|
}
|
|
587
|
-
}).catch((
|
|
887
|
+
}).catch((_) => _);
|
|
588
888
|
},
|
|
589
|
-
appendChildNode(
|
|
889
|
+
appendChildNode(node) {
|
|
590
890
|
this.text = "";
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(
|
|
891
|
+
const expanded = node.expanded;
|
|
892
|
+
node.expand(async () => {
|
|
893
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(node.data.id), this.$refs.tree.append(this.newChild, node), await this.scrollIntoView(expanded)) : await this.$prompt(`请输入${this.label}名:`, {
|
|
594
894
|
...this.defaultOptions,
|
|
595
|
-
beforeClose: async (
|
|
596
|
-
if (
|
|
895
|
+
beforeClose: async (action, instance, done) => {
|
|
896
|
+
if (action === "confirm") {
|
|
597
897
|
try {
|
|
598
|
-
this.createNewChild(
|
|
599
|
-
const
|
|
600
|
-
this.newChild[this.treeProps.label] =
|
|
898
|
+
this.createNewChild(node.data.id), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
|
|
899
|
+
const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
|
|
900
|
+
this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.append(this.newChild, node), await this.locateView(), done();
|
|
601
901
|
} catch {
|
|
602
|
-
|
|
902
|
+
instance.confirmButtonText = "确定";
|
|
603
903
|
}
|
|
604
|
-
|
|
904
|
+
instance.confirmButtonLoading = !1;
|
|
605
905
|
} else
|
|
606
|
-
|
|
906
|
+
done();
|
|
607
907
|
}
|
|
608
|
-
}).catch((
|
|
908
|
+
}).catch((_) => _);
|
|
609
909
|
});
|
|
610
910
|
},
|
|
611
|
-
appendChildNodeWithData(
|
|
911
|
+
appendChildNodeWithData(node, parentId, label) {
|
|
612
912
|
this.text = "";
|
|
613
|
-
const
|
|
614
|
-
|
|
913
|
+
const expanded = node.expanded;
|
|
914
|
+
node.expand(async () => {
|
|
615
915
|
this.clear(), this.newChild = {
|
|
616
916
|
id: -1,
|
|
617
|
-
parentId
|
|
618
|
-
[this.treeProps.label]:
|
|
917
|
+
parentId,
|
|
918
|
+
[this.treeProps.label]: label,
|
|
619
919
|
edit: !1,
|
|
620
920
|
isTempNode: !0,
|
|
621
921
|
hasChildren: !1
|
|
622
|
-
}, this.$refs.tree.append(this.newChild,
|
|
922
|
+
}, this.$refs.tree.append(this.newChild, node), await this.scrollIntoView(expanded);
|
|
623
923
|
});
|
|
624
924
|
},
|
|
625
|
-
appendPeerNode(
|
|
626
|
-
|
|
925
|
+
appendPeerNode(node) {
|
|
926
|
+
node.parent && node.parent.level !== 0 ? this.appendChildNode(node.parent) : this.appendRootNode();
|
|
627
927
|
},
|
|
628
|
-
async addRootNode(
|
|
629
|
-
this.$refs.tree.remove(
|
|
928
|
+
async addRootNode(data) {
|
|
929
|
+
this.$refs.tree.remove(data), await this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
|
|
630
930
|
},
|
|
631
|
-
async addChildNode(
|
|
931
|
+
async addChildNode(data) {
|
|
632
932
|
this.curNode && this.curNode.level !== 0 ? this.curNode.expand(async () => {
|
|
633
|
-
this.$refs.tree.remove(
|
|
634
|
-
}) : await this.addRootNode(
|
|
933
|
+
this.$refs.tree.remove(data), await this.$nextTick(), this.$refs.tree.append(data, this.curNode);
|
|
934
|
+
}) : await this.addRootNode(data);
|
|
635
935
|
},
|
|
636
|
-
async addPeerNode(
|
|
936
|
+
async addPeerNode(data) {
|
|
637
937
|
this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(async () => {
|
|
638
|
-
this.$refs.tree.remove(
|
|
639
|
-
}) : await this.addRootNode(
|
|
938
|
+
this.$refs.tree.remove(data), await this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
|
|
939
|
+
}) : await this.addRootNode(data);
|
|
640
940
|
},
|
|
641
|
-
updateNode(
|
|
642
|
-
const
|
|
643
|
-
|
|
941
|
+
updateNode(data) {
|
|
942
|
+
const node = this.$refs.tree.getNode(data);
|
|
943
|
+
node && (node.data = data);
|
|
644
944
|
},
|
|
645
|
-
setCurrentKey(
|
|
646
|
-
this.$refs.tree && this.$refs.tree.setCurrentKey(
|
|
945
|
+
setCurrentKey(key) {
|
|
946
|
+
this.$refs.tree && this.$refs.tree.setCurrentKey(key);
|
|
647
947
|
},
|
|
648
|
-
createNewChild(
|
|
948
|
+
createNewChild(parentId) {
|
|
649
949
|
this.newChild = {
|
|
650
950
|
id: -1,
|
|
651
|
-
parentId
|
|
951
|
+
parentId,
|
|
652
952
|
[this.treeProps.label]: "",
|
|
653
953
|
edit: !0,
|
|
654
954
|
isTempNode: !0,
|
|
655
955
|
hasChildren: !1
|
|
656
956
|
}, this.$emit("create-new-node", this.newChild);
|
|
657
957
|
},
|
|
658
|
-
async removeNodeModal(
|
|
958
|
+
async removeNodeModal(node) {
|
|
659
959
|
await this.$confirm(
|
|
660
|
-
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${
|
|
960
|
+
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
|
|
661
961
|
"系统提示",
|
|
662
962
|
{
|
|
663
963
|
type: "warning",
|
|
@@ -667,123 +967,123 @@ const M = {
|
|
|
667
967
|
closeOnClickModal: !1,
|
|
668
968
|
confirmButtonClass: "el-button--danger",
|
|
669
969
|
cancelButtonClass: "el-button--primary is-plain",
|
|
670
|
-
beforeClose: async (
|
|
671
|
-
if (
|
|
970
|
+
beforeClose: async (action, instance, done) => {
|
|
971
|
+
if (action === "confirm") {
|
|
672
972
|
try {
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
|
|
973
|
+
instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
|
|
974
|
+
const parentNode = node.parent, res = await this.deleteApi(node.data.id);
|
|
975
|
+
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
|
|
676
976
|
} catch {
|
|
677
977
|
}
|
|
678
|
-
|
|
978
|
+
instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
|
|
679
979
|
} else
|
|
680
|
-
|
|
980
|
+
done();
|
|
681
981
|
}
|
|
682
982
|
}
|
|
683
|
-
).catch((
|
|
983
|
+
).catch((_) => _);
|
|
684
984
|
},
|
|
685
|
-
async removeNode(
|
|
985
|
+
async removeNode(node) {
|
|
686
986
|
try {
|
|
687
|
-
const
|
|
987
|
+
const parentNode = node.parent;
|
|
688
988
|
if (this.deleteApi) {
|
|
689
|
-
const
|
|
690
|
-
|
|
989
|
+
const res = await this.deleteApi(node.data.id);
|
|
990
|
+
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
|
|
691
991
|
} else
|
|
692
|
-
this.$refs.tree.remove(
|
|
992
|
+
this.$refs.tree.remove(node);
|
|
693
993
|
} catch {
|
|
694
994
|
}
|
|
695
995
|
},
|
|
696
|
-
async onConfirm(
|
|
697
|
-
if (
|
|
996
|
+
async onConfirm(node, data) {
|
|
997
|
+
if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
|
|
698
998
|
this.clear();
|
|
699
999
|
return;
|
|
700
1000
|
}
|
|
701
|
-
|
|
1001
|
+
isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
|
|
702
1002
|
try {
|
|
703
|
-
if (this.loading = !0,
|
|
704
|
-
const
|
|
705
|
-
|
|
1003
|
+
if (this.loading = !0, data.id === -1) {
|
|
1004
|
+
const res = await this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
|
|
1005
|
+
assignReactiveProperties(data, { ...res.data, isTempNode: !1 }), this.$emit("node-added", data, old, node), this.registerNode(node);
|
|
706
1006
|
} else
|
|
707
|
-
await this.updateApi({ ...
|
|
708
|
-
|
|
1007
|
+
await this.updateApi({ ...data, [this.treeProps.label]: this.text });
|
|
1008
|
+
data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
|
|
709
1009
|
} catch {
|
|
710
1010
|
}
|
|
711
|
-
|
|
1011
|
+
data.loading = !1, this.loading = !1;
|
|
712
1012
|
},
|
|
713
|
-
onCancel(
|
|
714
|
-
|
|
1013
|
+
onCancel(node, data) {
|
|
1014
|
+
data.id === -1 ? this.$refs.tree.remove(node) : data.edit = !1, this.text = "";
|
|
715
1015
|
},
|
|
716
|
-
nodeClick(
|
|
717
|
-
this.hideContextMenu(), (
|
|
1016
|
+
nodeClick(data, node, tree) {
|
|
1017
|
+
this.hideContextMenu(), (isUndefined(data.loading) || !data.loading) && (this.curNode = node, this.curData = data, this.$emit("on-node-click", data, node, tree));
|
|
718
1018
|
},
|
|
719
1019
|
getCurrentNode() {
|
|
720
1020
|
return this.$refs.tree.getCurrentNode();
|
|
721
1021
|
},
|
|
722
1022
|
async locateView() {
|
|
723
1023
|
await this.$nextTick();
|
|
724
|
-
const
|
|
725
|
-
|
|
1024
|
+
const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
|
|
1025
|
+
el && el.scrollIntoView();
|
|
726
1026
|
},
|
|
727
|
-
async scrollIntoView(
|
|
728
|
-
var
|
|
729
|
-
await this.$nextTick(),
|
|
1027
|
+
async scrollIntoView(expanded) {
|
|
1028
|
+
var _a, _b;
|
|
1029
|
+
await this.$nextTick(), expanded || await delay(300), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
|
|
730
1030
|
},
|
|
731
|
-
inputKeyup(
|
|
732
|
-
|
|
1031
|
+
inputKeyup(event, node, data) {
|
|
1032
|
+
event.keyCode === 13 && this.onConfirm(node, data), event.keyCode === 27 && this.clear();
|
|
733
1033
|
},
|
|
734
|
-
inputBlur(
|
|
735
|
-
this.confirmButton || this.onConfirm(
|
|
1034
|
+
inputBlur(event, node, data) {
|
|
1035
|
+
this.confirmButton || this.onConfirm(node, data);
|
|
736
1036
|
},
|
|
737
1037
|
getCheckedKeys() {
|
|
738
1038
|
return this.$refs.tree.getCheckedKeys();
|
|
739
1039
|
},
|
|
740
|
-
setCheckedKeys(
|
|
741
|
-
this.$refs.tree.setCheckedKeys(
|
|
1040
|
+
setCheckedKeys(keys) {
|
|
1041
|
+
this.$refs.tree.setCheckedKeys(keys);
|
|
742
1042
|
},
|
|
743
1043
|
getCheckedNodes() {
|
|
744
1044
|
return this.$refs.tree.getCheckedNodes();
|
|
745
1045
|
},
|
|
746
|
-
setCheckedNodes(
|
|
747
|
-
this.$refs.tree.setCheckedNodes(
|
|
1046
|
+
setCheckedNodes(nodes) {
|
|
1047
|
+
this.$refs.tree.setCheckedNodes(nodes);
|
|
748
1048
|
},
|
|
749
|
-
getNode(
|
|
750
|
-
return this.$refs.tree.getNode(
|
|
1049
|
+
getNode(data) {
|
|
1050
|
+
return this.$refs.tree.getNode(data);
|
|
751
1051
|
},
|
|
752
1052
|
getRootNode() {
|
|
753
1053
|
return this.$refs.tree.root;
|
|
754
1054
|
},
|
|
755
|
-
findTreeNode(
|
|
756
|
-
return
|
|
1055
|
+
findTreeNode(data) {
|
|
1056
|
+
return findTreeChildren(
|
|
757
1057
|
this.$refs.tree.root.childNodes,
|
|
758
|
-
(
|
|
1058
|
+
(node) => node.data === data || node.data.id === data,
|
|
759
1059
|
"childNodes"
|
|
760
1060
|
);
|
|
761
1061
|
},
|
|
762
|
-
registerNode(
|
|
763
|
-
|
|
1062
|
+
registerNode(node) {
|
|
1063
|
+
node.store.registerNode(node), delete node.store.nodesMap[-1];
|
|
764
1064
|
},
|
|
765
1065
|
async reloadTree() {
|
|
766
1066
|
this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
|
|
767
1067
|
}
|
|
768
1068
|
}
|
|
769
|
-
},
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
1069
|
+
}, __cssModules = {};
|
|
1070
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
1071
|
+
__vue2_script,
|
|
1072
|
+
render,
|
|
1073
|
+
staticRenderFns,
|
|
774
1074
|
!1,
|
|
775
|
-
|
|
1075
|
+
__vue2_injectStyles,
|
|
776
1076
|
null,
|
|
777
1077
|
null,
|
|
778
1078
|
null
|
|
779
1079
|
);
|
|
780
|
-
function
|
|
781
|
-
for (let
|
|
782
|
-
this[
|
|
1080
|
+
function __vue2_injectStyles(context) {
|
|
1081
|
+
for (let o in __cssModules)
|
|
1082
|
+
this[o] = __cssModules[o];
|
|
783
1083
|
}
|
|
784
|
-
const
|
|
785
|
-
return
|
|
1084
|
+
const EditableTree = /* @__PURE__ */ function() {
|
|
1085
|
+
return __component__.exports;
|
|
786
1086
|
}();
|
|
787
1087
|
export {
|
|
788
|
-
|
|
1088
|
+
EditableTree as default
|
|
789
1089
|
};
|