@web-utils/form-ui 1.0.0-beta9 → 1.0.0-beta90
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.d.ts +52 -0
- package/address-input/index.mjs +2 -0
- package/address-input/style.css +1 -0
- package/affix/index.d.ts +30 -0
- package/affix/index.mjs +48 -0
- package/affix/style.css +1 -0
- package/api/index.d.ts +66 -0
- package/api/index.mjs +42 -0
- package/awesome-button/index.d.ts +60 -0
- package/awesome-button/index.mjs +49 -0
- package/base.css +1 -1
- package/capsule-tab/index.d.ts +30 -0
- package/capsule-tab/index.mjs +2 -0
- package/capsule-tab/style.css +1 -0
- package/card/index.d.ts +41 -0
- package/card/index.mjs +90 -0
- package/card/style.css +1 -0
- package/chunks/6eDDQWcr.mjs +69 -0
- package/chunks/8A7LSgb4.mjs +109 -0
- package/chunks/9biMMvdz.mjs +206 -0
- package/chunks/B1MSrc6f.mjs +8 -0
- package/chunks/B7DACryk.mjs +40 -0
- package/chunks/BAqI0u4Z2.mjs +29 -0
- package/chunks/BDc8zAp9.mjs +302 -0
- package/chunks/BFcXbHOc.mjs +32 -0
- package/chunks/BJajYDQv2.mjs +379 -0
- package/chunks/BMxD6EUb2.mjs +39 -0
- package/chunks/BO0sFz5y2.mjs +31 -0
- package/chunks/BQytQPLa.mjs +780 -0
- package/chunks/BUMCkrlW.mjs +4794 -0
- package/chunks/BVlUGEuO2.mjs +521 -0
- package/chunks/BYixGVnP.mjs +449 -0
- package/chunks/BiZI9y1L.mjs +89 -0
- package/chunks/Bii5Lj6z.mjs +30 -0
- package/chunks/Bqa2LN1P.mjs +298 -0
- package/chunks/BrelfRGo2.mjs +111 -0
- package/chunks/BsqIRxSS.mjs +67 -0
- package/chunks/BvR_UvV82.mjs +26 -0
- package/chunks/C-iN5MJZ.mjs +57 -0
- package/chunks/C4-9yqfz2.mjs +87 -0
- package/chunks/C8b7OeMD2.mjs +63 -0
- package/chunks/C8jbksGf2.mjs +30 -0
- package/chunks/CC4-dgXh.mjs +340 -0
- package/chunks/CHjGX9KK.mjs +200 -0
- package/chunks/CJ91sgqD.mjs +4103 -0
- package/chunks/CLI1zBAA.mjs +217 -0
- package/chunks/CQB9uqNw.mjs +517 -0
- package/chunks/CVjOe4WH.mjs +99 -0
- package/chunks/CX7Oiw5N.mjs +384 -0
- package/chunks/CXHJqvbJ.mjs +204 -0
- package/chunks/CYjby4eo.mjs +17 -0
- package/chunks/C_EelJUP.mjs +672 -0
- package/chunks/C_QfuxeQ.mjs +98 -0
- package/chunks/ClVh1Lek.mjs +130 -0
- package/chunks/CmXOOFaq2.mjs +26 -0
- package/chunks/CqoSAx2f2.mjs +27 -0
- package/chunks/CsiD_AYs.mjs +56 -0
- package/chunks/Ctq8BqkS.mjs +58 -0
- package/chunks/Ctx93AFS.mjs +54 -0
- package/chunks/CuOWVayQ.mjs +595 -0
- package/chunks/Cun90-R7.mjs +63 -0
- package/chunks/CvKF64A3.mjs +613 -0
- package/chunks/Cw2dcjLE2.mjs +25 -0
- package/chunks/CxoBTwVp2.mjs +34 -0
- package/chunks/D2NeD2g32.mjs +1361 -0
- package/chunks/D3PMBaWK2.mjs +108 -0
- package/chunks/D7_Djkww2.mjs +230 -0
- package/chunks/DGkSZT8r.mjs +155 -0
- package/chunks/DHBi4mlK2.mjs +425 -0
- package/chunks/DKXIKHKG.mjs +61 -0
- package/chunks/DZk7uYn32.mjs +29 -0
- package/chunks/DbGsHK5m.mjs +199 -0
- package/chunks/DcK-uACO.mjs +52 -0
- package/chunks/DdACGFy3.mjs +90 -0
- package/chunks/Dodxnwze.mjs +60 -0
- package/chunks/DokYQ49m.mjs +29 -0
- package/chunks/DqxR4G_B2.mjs +221 -0
- package/chunks/DscijaV_2.mjs +42 -0
- package/chunks/DtQg1F6Q2.mjs +145 -0
- package/chunks/DuPfGcqQ.mjs +198 -0
- package/chunks/Dxlhoq6v.mjs +1798 -0
- package/chunks/Gh6td4HK.mjs +184 -0
- package/chunks/Kyk412rw2.mjs +26 -0
- package/chunks/V-Js6hNd.mjs +179 -0
- package/chunks/e0fWXKxt.mjs +46 -0
- package/chunks/id2zIVnt.mjs +64 -0
- package/chunks/jYBVv5nL.mjs +50 -0
- package/chunks/lyW9mwQp.mjs +68 -0
- package/chunks/syMDpSl42.mjs +34 -0
- package/chunks/t6OjVLsq2.mjs +37 -0
- package/chunks/tjwOOiNr2.mjs +95 -0
- package/chunks/tzjUpVIj.mjs +37 -0
- package/chunks/uf-2jFmW.mjs +647 -0
- package/chunks/vEV0HSsL.mjs +60 -0
- package/chunks/wkrkYyvs.mjs +17 -0
- package/code-mirror-editor/index.d.ts +50 -0
- package/code-mirror-editor/index.mjs +99 -0
- package/code-mirror-editor/style.css +1 -0
- package/confirm-button/index.d.ts +122 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +93 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +75 -0
- package/constants/index.mjs +4 -0
- package/context-menu/index.d.ts +183 -0
- package/context-menu/index.mjs +196 -0
- package/context-menu/style.css +1 -0
- package/count-up/index.d.ts +70 -0
- package/count-up/index.mjs +94 -0
- package/custom-scrollbar/index.d.ts +49 -0
- package/custom-scrollbar/index.mjs +93 -0
- package/data-box/index.d.ts +30 -0
- package/data-box/index.mjs +2 -0
- package/data-box/style.css +1 -0
- package/data-card/index.d.ts +20 -0
- package/data-card/index.mjs +64 -0
- package/data-card/style.css +1 -0
- package/data-card-text/index.d.ts +21 -0
- package/data-card-text/index.mjs +68 -0
- package/data-card-text/style.css +1 -0
- package/data-display/index.d.ts +20 -0
- package/data-display/index.mjs +74 -0
- package/data-display/style.css +1 -0
- package/data-icons/index.d.ts +21 -0
- package/data-icons/index.mjs +75 -0
- package/data-icons/style.css +1 -0
- package/data-imgtext/index.d.ts +18 -0
- package/data-imgtext/index.mjs +72 -0
- package/data-imgtext/style.css +1 -0
- package/data-operatext/index.d.ts +17 -0
- package/data-operatext/index.mjs +55 -0
- package/data-operatext/style.css +1 -0
- package/data-panel/index.d.ts +19 -0
- package/data-panel/index.mjs +62 -0
- package/data-panel/style.css +1 -0
- package/data-pay/index.d.ts +19 -0
- package/data-pay/index.mjs +111 -0
- package/data-pay/style.css +1 -0
- package/data-price/index.d.ts +17 -0
- package/data-price/index.mjs +52 -0
- package/data-price/style.css +1 -0
- package/data-progress/index.d.ts +19 -0
- package/data-progress/index.mjs +73 -0
- package/data-progress/style.css +1 -0
- package/data-rotate/index.d.ts +21 -0
- package/data-rotate/index.mjs +2 -0
- package/data-rotate/style.css +1 -0
- package/data-table-picker/index.d.ts +61 -0
- package/data-table-picker/index.mjs +120 -0
- package/data-tabs/index.d.ts +21 -0
- package/data-tabs/index.mjs +2 -0
- package/data-tabs/style.css +1 -0
- package/dialog-form/index.d.ts +4 -0
- package/dialog-form/index.mjs +154 -0
- package/dialog-form/style.css +1 -0
- package/dict-render/index.d.ts +28 -0
- package/dict-render/index.mjs +2 -0
- package/e-charts/index.d.ts +79 -0
- package/e-charts/index.mjs +179 -0
- package/e-charts/style.css +1 -0
- package/easy-popup/index.d.ts +114 -0
- package/easy-popup/index.mjs +92 -0
- package/easy-popup/style.css +1 -0
- package/editable-progress/index.d.ts +68 -0
- package/editable-progress/index.mjs +121 -0
- package/editable-progress/style.css +1 -0
- package/editable-tree/index.d.ts +281 -0
- package/editable-tree/index.mjs +596 -0
- package/editable-tree/style.css +1 -0
- package/element-dialog/index.d.ts +341 -18
- package/element-dialog/index.mjs +2 -91
- package/element-dialog/style.css +1 -1
- package/element-listeners/style.css +1 -0
- package/element-multi-instance/style.css +1 -0
- package/element-resize-observer/index.d.ts +8 -0
- package/element-resize-observer/index.mjs +40 -0
- package/element-resize-observer/style.css +1 -0
- package/empty-view/index.d.ts +4 -4
- package/empty-view/index.mjs +1 -1
- package/error-view/index.d.ts +25 -0
- package/error-view/index.mjs +37 -0
- package/error-view/style.css +1 -0
- package/flex-box/index.d.ts +44 -0
- package/flex-box/index.mjs +2 -0
- package/flex-column/index.d.ts +41 -0
- package/flex-column/index.mjs +2 -0
- package/flex-item/index.d.ts +77 -0
- package/flex-item/index.mjs +2 -0
- package/flex-row/index.d.ts +41 -0
- package/flex-row/index.mjs +2 -0
- package/flex-scroll-area/index.d.ts +1 -1
- package/flex-scroll-area/index.mjs +1 -1
- package/flex-scroller/index.d.ts +26 -0
- package/flex-scroller/index.mjs +29 -0
- package/flex-scroller/style.css +1 -0
- package/flow-designer/index.d.ts +286 -0
- package/flow-designer/index.mjs +2 -0
- package/flow-designer/style.css +1 -0
- package/flow-viewer/index.d.ts +62 -0
- package/flow-viewer/index.mjs +159 -0
- package/flow-viewer/style.css +1 -0
- package/form-advice/index.mjs +13 -12
- package/form-button/index.d.ts +123 -0
- package/form-button/index.mjs +36 -0
- package/form-card/index.d.ts +14 -0
- package/form-card/index.mjs +18 -0
- package/form-cascader/index.d.ts +478 -0
- package/form-cascader/index.mjs +2 -0
- package/form-checkbox/index.d.ts +237 -30
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.d.ts +373 -0
- package/form-checkbox-group/index.mjs +2 -0
- package/form-checkbox-group/style.css +1 -0
- package/form-date-picker/index.d.ts +375 -29
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +89 -22
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +137 -23
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +282 -50
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.d.ts +223 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +296 -25
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +296 -25
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +237 -29
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +296 -25
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +269 -1
- package/form-input-tag/index.mjs +1 -3
- package/form-input-time/index.d.ts +440 -1
- package/form-input-time/index.mjs +1 -3
- package/form-item/index.d.ts +190 -0
- package/form-item/index.mjs +2 -0
- package/form-item/style.css +1 -0
- package/form-item-config-provider/index.d.ts +23 -3
- package/form-item-config-provider/index.mjs +7 -7
- package/form-item-group/index.d.ts +91 -17
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-radio-group/index.d.ts +295 -28
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +244 -24
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +2 -2
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +527 -28
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +273 -26
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +264 -26
- package/form-switch/index.mjs +1 -1
- package/form-table/index.d.ts +296 -0
- package/form-table/index.mjs +2 -0
- package/form-table-plus/index.d.ts +275 -0
- package/form-table-plus/index.mjs +2 -0
- package/form-text/index.d.ts +157 -23
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +2 -0
- package/form-time-select/index.d.ts +325 -0
- package/form-time-select/index.mjs +2 -0
- package/form-tree-select/index.d.ts +715 -0
- package/form-tree-select/index.mjs +2 -0
- package/form-tree-select/style.css +1 -0
- package/form-tree-select-multiple/index.d.ts +717 -0
- package/form-tree-select-multiple/index.mjs +2 -0
- package/form-view/index.d.ts +225 -1
- package/form-view/index.mjs +280 -6
- package/form-view/style.css +1 -0
- package/fy-array/index.d.ts +497 -0
- package/fy-array/index.mjs +130 -0
- package/fy-array/style.css +1 -0
- package/fy-cascader/index.d.ts +561 -0
- package/fy-cascader/index.mjs +116 -0
- package/fy-checkbox/index.d.ts +494 -0
- package/fy-checkbox/index.mjs +100 -0
- package/fy-checkbox/style.css +1 -0
- package/fy-curd/index.d.ts +986 -0
- package/fy-curd/index.mjs +2 -0
- package/fy-date/index.d.ts +509 -0
- package/fy-date/index.mjs +79 -0
- package/fy-date/style.css +1 -0
- package/fy-dynamic/index.d.ts +531 -0
- package/fy-dynamic/index.mjs +2 -0
- package/fy-empty/index.d.ts +31 -0
- package/fy-empty/index.mjs +35 -0
- package/fy-empty/style.css +1 -0
- package/fy-form/index.d.ts +528 -0
- package/fy-form/index.mjs +2 -0
- package/fy-form/style.css +1 -0
- package/fy-input/index.d.ts +579 -0
- package/fy-input/index.mjs +122 -0
- package/fy-input-color/index.d.ts +498 -0
- package/fy-input-color/index.mjs +80 -0
- package/fy-input-icon/index.d.ts +507 -0
- package/fy-input-icon/index.mjs +133 -0
- package/fy-input-icon/style.css +1 -0
- package/fy-input-map/index.d.ts +529 -0
- package/fy-input-map/index.mjs +248 -0
- package/fy-input-map/style.css +1 -0
- package/fy-input-number/index.d.ts +529 -0
- package/fy-input-number/index.mjs +78 -0
- package/fy-input-table/index.d.ts +511 -0
- package/fy-input-table/index.mjs +166 -0
- package/fy-input-table/style.css +1 -0
- package/fy-input-tree/index.d.ts +614 -0
- package/fy-input-tree/index.mjs +266 -0
- package/fy-input-tree/style.css +1 -0
- package/fy-radio/index.d.ts +481 -0
- package/fy-radio/index.mjs +56 -0
- package/fy-radio/style.css +1 -0
- package/fy-rate/index.d.ts +551 -0
- package/fy-rate/index.mjs +90 -0
- package/fy-rate/style.css +1 -0
- package/fy-select/index.d.ts +587 -0
- package/fy-select/index.mjs +2 -0
- package/fy-select/style.css +1 -0
- package/fy-slider/index.d.ts +512 -0
- package/fy-slider/index.mjs +72 -0
- package/fy-switch/index.d.ts +492 -0
- package/fy-switch/index.mjs +71 -0
- package/fy-tabs/index.d.ts +20 -0
- package/fy-tabs/index.mjs +50 -0
- package/fy-time/index.d.ts +967 -0
- package/fy-time/index.mjs +85 -0
- package/fy-title/index.d.ts +487 -0
- package/fy-title/index.mjs +18 -0
- package/fy-title/style.css +1 -0
- package/fy-tree/index.d.ts +142 -0
- package/fy-tree/index.mjs +391 -0
- package/fy-tree/style.css +1 -0
- package/fy-u-editor/index.d.ts +116 -0
- package/fy-u-editor/index.mjs +2 -0
- package/fy-u-editor/style.css +1 -0
- package/fy-upload/index.d.ts +642 -0
- package/fy-upload/index.mjs +2 -0
- package/fy-upload/style.css +1 -0
- package/guide-steps/index.d.ts +31 -0
- package/guide-steps/index.mjs +77 -0
- package/guide-steps/style.css +1 -0
- package/helper/avue.d.ts +36 -0
- package/helper/avue.mjs +35 -0
- package/helper/dictionary.d.ts +29 -0
- package/helper/dictionary.mjs +97 -0
- package/helper/form-item.d.ts +17 -0
- package/helper/form-item.mjs +27 -0
- package/helper/input.d.ts +49 -0
- package/helper/input.mjs +2 -0
- package/helper/sub-table-plus.d.ts +98 -0
- package/helper/sub-table-plus.mjs +4 -0
- package/highlight-j-s/index.d.ts +18 -0
- package/highlight-j-s/index.mjs +51 -0
- package/highlight-j-s/style.css +1 -0
- package/hook/useDictionary.d.ts +60 -0
- package/hook/useDictionary.mjs +15 -0
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/icon-temp/index.d.ts +19 -0
- package/icon-temp/index.mjs +27 -0
- package/icon-temp/style.css +1 -0
- package/iframe-window/index.d.ts +9 -0
- package/iframe-window/index.mjs +37 -0
- package/iframe-window/style.css +1 -0
- package/image-cropper/index.d.ts +365 -0
- package/image-cropper/index.mjs +154 -0
- package/image-cropper/style.css +1 -0
- package/image-preview/index.d.ts +61 -0
- package/image-preview/index.mjs +201 -0
- package/image-preview/style.css +1 -0
- package/image-viewer/index.d.ts +25 -0
- package/image-viewer/index.mjs +70 -0
- package/image-viewer/style.css +1 -0
- package/index.css +2 -0
- package/index.d.ts +149 -36
- package/index.mjs +149 -62
- package/input-number-range/index.d.ts +41 -0
- package/input-number-range/index.mjs +77 -0
- package/input-number-range/style.css +1 -0
- package/keyboard/index.d.ts +64 -0
- package/keyboard/index.mjs +2 -0
- package/keyboard/style.css +1 -0
- package/loading-view/index.d.ts +65 -0
- package/loading-view/index.mjs +39 -0
- package/loading-view/style.css +1 -0
- package/monaco-editor/index.d.ts +126 -0
- package/monaco-editor/index.mjs +2 -0
- package/monaco-editor/style.css +1 -0
- package/name-avatar/index.d.ts +62 -0
- package/name-avatar/index.mjs +61 -0
- package/name-avatar/style.css +1 -0
- package/nav-bar/index.d.ts +21 -0
- package/nav-bar/index.mjs +35 -0
- package/nav-bar/style.css +1 -0
- package/package.json +30 -8
- package/page/index.d.ts +21 -0
- package/page/index.mjs +17 -0
- package/page/style.css +1 -0
- package/page-header/index.d.ts +27 -0
- package/page-header/index.mjs +25 -0
- package/page-header/style.css +1 -0
- package/page-index/index.d.ts +82 -0
- package/page-index/index.mjs +124 -0
- package/page-index/style.css +1 -0
- package/page-index-top/index.d.ts +38 -0
- package/page-index-top/index.mjs +87 -0
- package/page-skeleton/index.d.ts +30 -0
- package/page-skeleton/index.mjs +44 -0
- package/page-skeleton/style.css +1 -0
- package/page-skeleton-new/index.d.ts +34 -0
- package/page-skeleton-new/index.mjs +80 -0
- package/page-skeleton-new/style.css +1 -0
- package/pageable-table/index.d.ts +400 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/photo-swipe/index.d.ts +18 -0
- package/photo-swipe/index.mjs +2 -0
- package/props/cascader.d.ts +326 -0
- package/props/cascader.mjs +145 -0
- package/props/checkbox-group.d.ts +213 -0
- package/props/checkbox-group.mjs +83 -0
- package/props/checkbox.d.ts +205 -0
- package/props/checkbox.mjs +74 -0
- package/props/col.d.ts +74 -0
- package/props/col.mjs +32 -0
- package/props/common.d.ts +114 -0
- package/props/common.mjs +18 -0
- package/props/date.d.ts +336 -0
- package/props/date.mjs +158 -0
- package/props/form-item.d.ts +144 -0
- package/props/form-item.mjs +73 -0
- package/props/form.d.ts +157 -0
- package/props/form.mjs +89 -0
- package/props/image.d.ts +102 -0
- package/props/image.mjs +10 -0
- package/props/input-cron.d.ts +102 -0
- package/props/input-cron.mjs +16 -0
- package/props/input-number.d.ts +216 -0
- package/props/input-number.mjs +72 -0
- package/props/input-tag.d.ts +123 -0
- package/props/input-tag.mjs +33 -0
- package/props/input.d.ts +299 -0
- package/props/input.mjs +97 -0
- package/props/radio-group.d.ts +205 -0
- package/props/radio-group.mjs +84 -0
- package/props/rate.d.ts +211 -0
- package/props/rate.mjs +66 -0
- package/props/select.d.ts +450 -0
- package/props/select.mjs +218 -0
- package/props/slide.d.ts +235 -0
- package/props/slide.mjs +72 -0
- package/props/switch.d.ts +229 -0
- package/props/switch.mjs +80 -0
- package/props/text.d.ts +127 -0
- package/props/text.mjs +22 -0
- package/props/textarea.d.ts +266 -0
- package/props/textarea.mjs +82 -0
- package/props/time-select.d.ts +216 -0
- package/props/time-select.mjs +67 -0
- package/props/time.d.ts +304 -0
- package/props/time.mjs +138 -0
- package/props/tree-select-multiple.d.ts +324 -0
- package/props/tree-select-multiple.mjs +16 -0
- package/props/tree-select.d.ts +326 -0
- package/props/tree-select.mjs +25 -0
- package/props/tree.d.ts +76 -0
- package/props/tree.mjs +75 -0
- package/props/vue-tree-select.d.ts +458 -0
- package/props/vue-tree-select.mjs +213 -0
- package/resolver/components.d.ts +4 -0
- package/resolver/components.mjs +4 -0
- package/resolver/index.mjs +29 -0
- package/resolver/vite-optimize-deps-plugin.d.ts +9 -0
- package/resolver/vite-optimize-deps-plugin.mjs +13 -0
- package/sign-panel/index.d.ts +85 -0
- package/sign-panel/index.mjs +183 -0
- package/sign-panel/style.css +1 -0
- package/skeleton-panel/index.d.ts +27 -0
- package/skeleton-panel/index.mjs +38 -0
- package/skeleton-panel/style.css +1 -0
- package/split-pane/index.d.ts +106 -0
- package/split-pane/index.mjs +2 -0
- package/split-pane/style.css +1 -0
- package/stateful/index.d.ts +92 -0
- package/stateful/index.mjs +67 -0
- package/stateful/style.css +1 -0
- package/sub-table/index.d.ts +118 -0
- package/sub-table/index.mjs +2 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.d.ts +118 -0
- package/sub-table-plus/index.mjs +2 -0
- package/sub-table-plus/style.css +1 -0
- package/swiper/index.d.ts +27 -0
- package/swiper/index.mjs +126 -0
- package/swiper/style.css +1 -0
- package/table-column/index.d.ts +163 -0
- package/table-column/index.mjs +2 -0
- package/table-column/style.css +1 -0
- package/table-column-def/index.d.ts +97 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +345 -1
- package/table-view/index.mjs +472 -6
- package/table-view/style.css +1 -0
- package/tag-render/index.d.ts +48 -0
- package/tag-render/index.mjs +86 -0
- package/tag-render/style.css +1 -0
- package/text-ellipsis/index.d.ts +111 -0
- package/text-ellipsis/index.mjs +124 -0
- package/text-ellipsis/style.css +1 -0
- package/toolbar/index.d.ts +133 -1
- package/toolbar/index.mjs +1 -8
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.d.ts +188 -1
- package/toolbar-button/index.mjs +1 -8
- package/toolbar-button/style.css +1 -0
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/vue-qr-code/index.d.ts +47 -0
- package/vue-qr-code/index.mjs +32 -0
- package/vue-tags-input/index.d.ts +373 -0
- package/vue-tags-input/index.mjs +350 -0
- package/vue-tags-input/style.css +1 -0
- package/vue-tree-select/index.d.ts +1534 -0
- package/vue-tree-select/index.mjs +2 -0
- package/vue-tree-select/style.css +1 -0
- package/vue-video-player/index.d.ts +117 -0
- package/vue-video-player/index.mjs +136 -0
- package/vue-video-player/style.css +1 -0
- package/watermark/index.d.ts +97 -0
- package/watermark/index.mjs +2 -0
- package/watermark/style.css +1 -0
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +232 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +2 -0
- package/year-calendar/style.css +1 -0
- package/chunks/1glrRdhD.mjs +0 -23
- package/chunks/6Ukll2os.mjs +0 -149
- package/chunks/78hGOZc9.mjs +0 -43
- package/chunks/BID1Rr2O.mjs +0 -32
- package/chunks/BMkPC2kt.mjs +0 -28
- package/chunks/BPJNSq9M.mjs +0 -4
- package/chunks/BaExlbMY.mjs +0 -32
- package/chunks/BeIZhqg_.mjs +0 -167
- package/chunks/BmQGmui_.mjs +0 -54
- package/chunks/BnycM8aG.mjs +0 -74
- package/chunks/BooKKkk0.mjs +0 -36
- package/chunks/Bpox2cVQ.mjs +0 -92
- package/chunks/Bs_IYr3X.mjs +0 -94
- package/chunks/BuZDN2DV.mjs +0 -28
- package/chunks/C4JpDEWP.mjs +0 -35
- package/chunks/C76R4lB3.mjs +0 -74
- package/chunks/DAjuA2O6.mjs +0 -28
- package/chunks/Dywq0t6V.mjs +0 -47
- package/chunks/GlsJxLiF.mjs +0 -35
- package/chunks/pFgf4c4i.mjs +0 -47
- package/constants.d.ts +0 -7
- package/constants.mjs +0 -4
- package/form-check-box-group/index.d.ts +0 -119
- package/form-check-box-group/index.mjs +0 -2
- package/form-item-x/index.d.ts +0 -75
- package/form-item-x/index.mjs +0 -2
- package/input/style.css +0 -1
- package/json-editor/index.d.ts +0 -32
- package/json-editor/index.mjs +0 -2
- package/json-editor/style.css +0 -1
- package/resolver.mjs +0 -81
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,4103 @@
|
|
|
1
|
+
import { u as e } from "./ClVh1Lek.mjs";
|
|
2
|
+
import { t } from "./B1MSrc6f.mjs";
|
|
3
|
+
import { t as n } from "./V-Js6hNd.mjs";
|
|
4
|
+
import { avueConfigContextKey as r } from "../constants/index.mjs";
|
|
5
|
+
import { t as i } from "./Gh6td4HK.mjs";
|
|
6
|
+
import { C as a, T as o, _ as s, a as c, b as l, c as u, d, g as f, h as p, l as m, m as h, n as g, p as ee, t as te, v as _, x as ne, y as re } from "./CXHJqvbJ.mjs";
|
|
7
|
+
import { a as ie, c as v, i as ae, l as oe, n as se, o as ce, r as y, s as le, t as ue, u as de } from "./CX7Oiw5N.mjs";
|
|
8
|
+
import fe from "../fy-array/index.mjs";
|
|
9
|
+
import pe from "../fy-cascader/index.mjs";
|
|
10
|
+
import me from "../fy-checkbox/index.mjs";
|
|
11
|
+
import he from "../fy-date/index.mjs";
|
|
12
|
+
import ge from "../fy-input/index.mjs";
|
|
13
|
+
import { a as b, i as _e, n as ve, r as ye, t as be } from "./CC4-dgXh.mjs";
|
|
14
|
+
import { t as xe } from "./CsiD_AYs.mjs";
|
|
15
|
+
import Se from "../icon-temp/index.mjs";
|
|
16
|
+
import Ce from "../fy-rate/index.mjs";
|
|
17
|
+
import we from "../fy-input-color/index.mjs";
|
|
18
|
+
import Te from "../fy-input-icon/index.mjs";
|
|
19
|
+
import Ee from "../fy-input-map/index.mjs";
|
|
20
|
+
import De from "../fy-input-number/index.mjs";
|
|
21
|
+
import Oe from "../fy-radio/index.mjs";
|
|
22
|
+
import ke from "../fy-slider/index.mjs";
|
|
23
|
+
import Ae from "../fy-switch/index.mjs";
|
|
24
|
+
import je from "../fy-time/index.mjs";
|
|
25
|
+
import Me from "../fy-title/index.mjs";
|
|
26
|
+
import { t as Ne } from "./CQB9uqNw.mjs";
|
|
27
|
+
import Pe from "../fy-input-tree/index.mjs";
|
|
28
|
+
import { ElButtonGroup as Fe, ElCard as Ie, ElCheckbox as Le, ElCol as x, ElCollapse as Re, ElCollapseItem as ze, ElDrawer as S, ElDropdown as Be, ElDropdownItem as Ve, ElDropdownMenu as He, ElEmpty as Ue, ElForm as We, ElFormItem as C, ElLink as Ge, ElLoadingDirective as Ke, ElPagination as qe, ElRow as Je, ElTabPane as Ye, ElTable as Xe, ElTableColumn as w, ElTabs as Ze, ElTag as Qe, ElTooltip as $e } from "element-plus/es";
|
|
29
|
+
import "element-plus/es/components/base/style/css";
|
|
30
|
+
import { Fragment as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as A, createTextVNode as j, createVNode as M, defineAsyncComponent as et, guardReactiveProps as N, mergeProps as P, normalizeClass as F, normalizeProps as I, normalizeStyle as L, openBlock as R, renderList as z, renderSlot as B, resolveComponent as tt, resolveDirective as V, resolveDynamicComponent as H, toDisplayString as U, toHandlers as nt, vShow as rt, withCtx as W, withDirectives as G, withKeys as it, withModifiers as K } from "vue";
|
|
31
|
+
import { isBlank as q } from "@web-utils/core";
|
|
32
|
+
import "element-plus/es/components/row/style/css";
|
|
33
|
+
import "element-plus/es/components/col/style/css";
|
|
34
|
+
import "element-plus/es/components/loading/style/css";
|
|
35
|
+
import "element-plus/es/components/tooltip/style/css";
|
|
36
|
+
import "element-plus/es/components/drawer/style/css";
|
|
37
|
+
import "element-plus/es/components/table/style/css";
|
|
38
|
+
import "element-plus/es/components/checkbox/style/css";
|
|
39
|
+
import "element-plus/es/components/table-column/style/css";
|
|
40
|
+
import "element-plus/es/components/pagination/style/css";
|
|
41
|
+
import "element-plus/es/components/empty/style/css";
|
|
42
|
+
import "element-plus/es/components/form/style/css";
|
|
43
|
+
import "element-plus/es/components/collapse/style/css";
|
|
44
|
+
import "element-plus/es/components/collapse-item/style/css";
|
|
45
|
+
import "element-plus/es/components/form-item/style/css";
|
|
46
|
+
import "element-plus/es/components/link/style/css";
|
|
47
|
+
import "element-plus/es/components/button-group/style/css";
|
|
48
|
+
import { formatDate as J } from "@web-utils/integrations/dayjs";
|
|
49
|
+
import "element-plus/es/components/card/style/css";
|
|
50
|
+
import "element-plus/es/components/dropdown/style/css";
|
|
51
|
+
import "element-plus/es/components/dropdown-menu/style/css";
|
|
52
|
+
import "element-plus/es/components/dropdown-item/style/css";
|
|
53
|
+
import "element-plus/es/components/tag/style/css";
|
|
54
|
+
import "element-plus/es/components/tabs/style/css";
|
|
55
|
+
import "element-plus/es/components/tab-pane/style/css";
|
|
56
|
+
//#region src/components/avue/fy-from/components/FormGroup.vue
|
|
57
|
+
var at = {
|
|
58
|
+
name: "FormGroup",
|
|
59
|
+
props: {
|
|
60
|
+
arrow: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !0
|
|
63
|
+
},
|
|
64
|
+
collapse: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !0
|
|
67
|
+
},
|
|
68
|
+
header: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !0
|
|
71
|
+
},
|
|
72
|
+
icon: { type: String },
|
|
73
|
+
display: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !0
|
|
76
|
+
},
|
|
77
|
+
label: { type: String }
|
|
78
|
+
},
|
|
79
|
+
emits: ["change"],
|
|
80
|
+
data() {
|
|
81
|
+
return { activeName: "" };
|
|
82
|
+
},
|
|
83
|
+
computed: {
|
|
84
|
+
text() {
|
|
85
|
+
return +!!this.collapse;
|
|
86
|
+
},
|
|
87
|
+
isHeader() {
|
|
88
|
+
return this.$slots.header && this.header || (this.label || this.icon) && this.header;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
watch: { text(e) {
|
|
92
|
+
this.activeName = [e];
|
|
93
|
+
} },
|
|
94
|
+
created() {
|
|
95
|
+
this.activeName = [this.text];
|
|
96
|
+
},
|
|
97
|
+
methods: { handleChange(e) {
|
|
98
|
+
this.$emit("change", e);
|
|
99
|
+
} }
|
|
100
|
+
}, ot = { class: "avue-group__header" }, st = {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: "avue-group__title"
|
|
103
|
+
};
|
|
104
|
+
function ct(e, t, n, r, i, a) {
|
|
105
|
+
let o = ze, s = Re;
|
|
106
|
+
return n.display ? (R(), O("div", {
|
|
107
|
+
key: 0,
|
|
108
|
+
class: F(["avue-group", {
|
|
109
|
+
"avue-group--header": !a.isHeader,
|
|
110
|
+
"avue-group__arrow": !n.arrow
|
|
111
|
+
}])
|
|
112
|
+
}, [B(e.$slots, "tabs"), M(s, {
|
|
113
|
+
modelValue: i.activeName,
|
|
114
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => i.activeName = e),
|
|
115
|
+
value: a.text,
|
|
116
|
+
onChange: a.handleChange
|
|
117
|
+
}, {
|
|
118
|
+
default: W(() => [M(o, {
|
|
119
|
+
name: 1,
|
|
120
|
+
disabled: !n.arrow
|
|
121
|
+
}, {
|
|
122
|
+
title: W(() => [k("div", ot, [B(e.$slots, "header", {}, () => [n.icon ? (R(), O("i", {
|
|
123
|
+
key: 0,
|
|
124
|
+
class: F([n.icon, "avue-group__icon"])
|
|
125
|
+
}, null, 2)) : D("v-if", !0), n.label ? (R(), O("h1", st, U(n.label), 1)) : D("v-if", !0)])])]),
|
|
126
|
+
default: W(() => [B(e.$slots, "default")]),
|
|
127
|
+
_: 3
|
|
128
|
+
}, 8, ["disabled"])]),
|
|
129
|
+
_: 3
|
|
130
|
+
}, 8, [
|
|
131
|
+
"modelValue",
|
|
132
|
+
"value",
|
|
133
|
+
"onChange"
|
|
134
|
+
])], 2)) : D("v-if", !0);
|
|
135
|
+
}
|
|
136
|
+
var lt = /* @__PURE__ */ t(at, [["render", ct]]), ut = {
|
|
137
|
+
name: "FyFormMenu",
|
|
138
|
+
inject: ["formSafe"],
|
|
139
|
+
computed: {
|
|
140
|
+
menuSpan() {
|
|
141
|
+
return this.formSafe.parentOption.menuSpan || 24;
|
|
142
|
+
},
|
|
143
|
+
styleName() {
|
|
144
|
+
return this.menuSpan === 24 ? {} : { padding: 0 };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
function dt(e, t, n, r, a, o) {
|
|
149
|
+
let s = i, c = C, l = x;
|
|
150
|
+
return o.formSafe.parentOption.menuBtn === !1 ? D("v-if", !0) : (R(), E(l, {
|
|
151
|
+
key: 0,
|
|
152
|
+
span: o.menuSpan,
|
|
153
|
+
md: o.menuSpan,
|
|
154
|
+
style: L(o.styleName),
|
|
155
|
+
class: F([
|
|
156
|
+
"menu",
|
|
157
|
+
o.formSafe.menuPosition,
|
|
158
|
+
"no-print"
|
|
159
|
+
])
|
|
160
|
+
}, {
|
|
161
|
+
default: W(() => [M(c, {
|
|
162
|
+
"label-width": "0px",
|
|
163
|
+
style: { "text-align": "center" }
|
|
164
|
+
}, {
|
|
165
|
+
default: W(() => [
|
|
166
|
+
o.formSafe.isMock ? (R(), E(s, {
|
|
167
|
+
key: 0,
|
|
168
|
+
type: "primary",
|
|
169
|
+
size: o.formSafe.controlSize,
|
|
170
|
+
disabled: o.formSafe.allDisabled,
|
|
171
|
+
onClick: o.formSafe.handleMock
|
|
172
|
+
}, {
|
|
173
|
+
icon: W(() => [...t[0] || (t[0] = [k("i", { class: "el-icon-edit-outline" }, null, -1)])]),
|
|
174
|
+
default: W(() => [j(U(o.formSafe.parentOption.mockText || "模拟") + " ", 1)]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 8, [
|
|
177
|
+
"size",
|
|
178
|
+
"disabled",
|
|
179
|
+
"onClick"
|
|
180
|
+
])) : D("v-if", !0),
|
|
181
|
+
o.formSafe.isPrint ? (R(), E(s, {
|
|
182
|
+
key: 1,
|
|
183
|
+
type: "primary",
|
|
184
|
+
size: o.formSafe.controlSize,
|
|
185
|
+
icon: "el-icon-printer",
|
|
186
|
+
disabled: o.formSafe.allDisabled,
|
|
187
|
+
onClick: o.formSafe.handlePrint
|
|
188
|
+
}, {
|
|
189
|
+
icon: W(() => [...t[1] || (t[1] = [k("i", { class: "el-icon-printer" }, null, -1)])]),
|
|
190
|
+
default: W(() => [j(U(o.formSafe.parentOption.printText || "打印") + " ", 1)]),
|
|
191
|
+
_: 1
|
|
192
|
+
}, 8, [
|
|
193
|
+
"size",
|
|
194
|
+
"disabled",
|
|
195
|
+
"onClick"
|
|
196
|
+
])) : D("v-if", !0),
|
|
197
|
+
o.formSafe.parentOption.submitBtn === !1 ? D("v-if", !0) : (R(), E(s, {
|
|
198
|
+
key: 2,
|
|
199
|
+
type: "primary",
|
|
200
|
+
size: o.formSafe.controlSize,
|
|
201
|
+
loading: o.formSafe.allDisabled,
|
|
202
|
+
onClick: o.formSafe.submit
|
|
203
|
+
}, {
|
|
204
|
+
icon: W(() => [k("i", { class: F(o.formSafe.parentOption.submitIcon || "el-icon-check") }, null, 2)]),
|
|
205
|
+
default: W(() => [j(U(o.formSafe.parentOption.submitText || "提交") + " ", 1)]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, [
|
|
208
|
+
"size",
|
|
209
|
+
"loading",
|
|
210
|
+
"onClick"
|
|
211
|
+
])),
|
|
212
|
+
o.formSafe.parentOption.emptyBtn === !1 ? D("v-if", !0) : (R(), E(s, {
|
|
213
|
+
key: 3,
|
|
214
|
+
size: o.formSafe.controlSize,
|
|
215
|
+
disabled: o.formSafe.allDisabled,
|
|
216
|
+
onClick: o.formSafe.resetForm
|
|
217
|
+
}, {
|
|
218
|
+
icon: W(() => [k("i", { class: F(o.formSafe.parentOption.emptyIcon || "el-icon-delete") }, null, 2)]),
|
|
219
|
+
default: W(() => [j(U(o.formSafe.parentOption.emptyText || "清空") + " ", 1)]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, [
|
|
222
|
+
"size",
|
|
223
|
+
"disabled",
|
|
224
|
+
"onClick"
|
|
225
|
+
])),
|
|
226
|
+
B(e.$slots, "menuForm", {
|
|
227
|
+
disabled: o.formSafe.allDisabled,
|
|
228
|
+
size: o.formSafe.controlSize
|
|
229
|
+
})
|
|
230
|
+
]),
|
|
231
|
+
_: 3
|
|
232
|
+
})]),
|
|
233
|
+
_: 3
|
|
234
|
+
}, 8, [
|
|
235
|
+
"span",
|
|
236
|
+
"md",
|
|
237
|
+
"style",
|
|
238
|
+
"class"
|
|
239
|
+
]));
|
|
240
|
+
}
|
|
241
|
+
var ft = /* @__PURE__ */ t(ut, [["render", dt]]), pt = {
|
|
242
|
+
name: "DialogFilter",
|
|
243
|
+
inject: ["crud"],
|
|
244
|
+
data() {
|
|
245
|
+
return {
|
|
246
|
+
box: !1,
|
|
247
|
+
columnObj: {},
|
|
248
|
+
symbolDic: [
|
|
249
|
+
{
|
|
250
|
+
label: "=",
|
|
251
|
+
value: "="
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
label: "≠",
|
|
255
|
+
value: "≠"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: "like",
|
|
259
|
+
value: "like"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
label: ">",
|
|
263
|
+
value: ">"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
label: "≥",
|
|
267
|
+
value: "≥"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
label: "<",
|
|
271
|
+
value: "<"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
label: "≤",
|
|
275
|
+
value: "≤"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
label: "∈",
|
|
279
|
+
value: "∈"
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
list: [],
|
|
283
|
+
columnOption: {}
|
|
284
|
+
};
|
|
285
|
+
},
|
|
286
|
+
methods: {
|
|
287
|
+
handleShow() {
|
|
288
|
+
this.getColumnOption(), this.box = !0;
|
|
289
|
+
},
|
|
290
|
+
getColumnOption() {
|
|
291
|
+
let e = [];
|
|
292
|
+
c(this.crud.propOption).forEach((t) => {
|
|
293
|
+
t.showColumn !== !1 && e.push(Object.assign(t, { value: t.prop }));
|
|
294
|
+
}), this.columnOption = e, this.columnObj = this.columnOption[0];
|
|
295
|
+
},
|
|
296
|
+
handleDelete(e) {
|
|
297
|
+
this.list.splice(e, 1);
|
|
298
|
+
},
|
|
299
|
+
handleClear() {
|
|
300
|
+
this.list = [];
|
|
301
|
+
},
|
|
302
|
+
handleValueClear() {
|
|
303
|
+
this.list.forEach((e) => {
|
|
304
|
+
e.value = "";
|
|
305
|
+
});
|
|
306
|
+
},
|
|
307
|
+
handleSubmit() {
|
|
308
|
+
let e = [];
|
|
309
|
+
this.list.forEach((t) => {
|
|
310
|
+
e.push([
|
|
311
|
+
t.text,
|
|
312
|
+
t.symbol,
|
|
313
|
+
t.value
|
|
314
|
+
]);
|
|
315
|
+
}), this.crud.$emit("filter", e), this.box = !1;
|
|
316
|
+
},
|
|
317
|
+
handleChange(e) {
|
|
318
|
+
this.list[e].value = "";
|
|
319
|
+
},
|
|
320
|
+
handleAdd() {
|
|
321
|
+
let e = this.columnObj.prop;
|
|
322
|
+
this.list.push({
|
|
323
|
+
text: e,
|
|
324
|
+
value: "",
|
|
325
|
+
symbol: this.symbolDic[0].value
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}, mt = { key: 0 }, ht = { class: "avue-crud__filter-menu" };
|
|
330
|
+
function gt(e, t, n, r, a, o) {
|
|
331
|
+
let s = i, c = Fe, l = be, u = ge, d = x, f = Je, p = S;
|
|
332
|
+
return a.box ? (R(), O("div", mt, [M(p, {
|
|
333
|
+
modelValue: a.box,
|
|
334
|
+
"onUpdate:modelValue": t[1] || (t[1] = (e) => a.box = e),
|
|
335
|
+
class: F([["avue-crud__dialog", "avue-crud__filter"], "avue-dialog"]),
|
|
336
|
+
"lock-scroll": "",
|
|
337
|
+
"append-to-body": "",
|
|
338
|
+
title: "过滤条件",
|
|
339
|
+
size: o.crud.isMobile ? "100%" : "60%"
|
|
340
|
+
}, {
|
|
341
|
+
default: W(() => [M(f, { span: 24 }, {
|
|
342
|
+
default: W(() => [
|
|
343
|
+
k("div", ht, [M(c, null, {
|
|
344
|
+
default: W(() => [
|
|
345
|
+
M(s, {
|
|
346
|
+
type: "primary",
|
|
347
|
+
size: o.crud.isMediumSize,
|
|
348
|
+
onClick: o.handleAdd
|
|
349
|
+
}, {
|
|
350
|
+
default: W(() => [...t[2] || (t[2] = [j("新增条件", -1)])]),
|
|
351
|
+
_: 1
|
|
352
|
+
}, 8, ["size", "onClick"]),
|
|
353
|
+
M(s, {
|
|
354
|
+
type: "primary",
|
|
355
|
+
size: o.crud.isMediumSize,
|
|
356
|
+
onClick: o.handleClear
|
|
357
|
+
}, {
|
|
358
|
+
default: W(() => [...t[3] || (t[3] = [j("清空条件", -1)])]),
|
|
359
|
+
_: 1
|
|
360
|
+
}, 8, ["size", "onClick"]),
|
|
361
|
+
M(s, {
|
|
362
|
+
type: "primary",
|
|
363
|
+
size: o.crud.isMediumSize,
|
|
364
|
+
onClick: o.handleValueClear
|
|
365
|
+
}, {
|
|
366
|
+
default: W(() => [...t[4] || (t[4] = [j("清空数据", -1)])]),
|
|
367
|
+
_: 1
|
|
368
|
+
}, 8, ["size", "onClick"])
|
|
369
|
+
]),
|
|
370
|
+
_: 1
|
|
371
|
+
})]),
|
|
372
|
+
(R(!0), O(T, null, z(a.list, (e, t) => (R(), E(d, {
|
|
373
|
+
key: t,
|
|
374
|
+
md: 12,
|
|
375
|
+
xs: 24,
|
|
376
|
+
sm: 12,
|
|
377
|
+
class: "avue-crud__filter-item"
|
|
378
|
+
}, {
|
|
379
|
+
default: W(() => [
|
|
380
|
+
M(l, {
|
|
381
|
+
modelValue: e.text,
|
|
382
|
+
"onUpdate:modelValue": (t) => e.text = t,
|
|
383
|
+
dic: a.columnOption,
|
|
384
|
+
clearable: !1,
|
|
385
|
+
size: o.crud.isMediumSize,
|
|
386
|
+
class: "avue-crud__filter-label",
|
|
387
|
+
onChange: (e) => o.handleChange(t)
|
|
388
|
+
}, null, 8, [
|
|
389
|
+
"modelValue",
|
|
390
|
+
"onUpdate:modelValue",
|
|
391
|
+
"dic",
|
|
392
|
+
"size",
|
|
393
|
+
"onChange"
|
|
394
|
+
]),
|
|
395
|
+
M(l, {
|
|
396
|
+
modelValue: e.symbol,
|
|
397
|
+
"onUpdate:modelValue": (t) => e.symbol = t,
|
|
398
|
+
class: "avue-crud__filter-symbol",
|
|
399
|
+
dic: a.symbolDic,
|
|
400
|
+
clearable: !1,
|
|
401
|
+
size: o.crud.isMediumSize
|
|
402
|
+
}, null, 8, [
|
|
403
|
+
"modelValue",
|
|
404
|
+
"onUpdate:modelValue",
|
|
405
|
+
"dic",
|
|
406
|
+
"size"
|
|
407
|
+
]),
|
|
408
|
+
M(u, {
|
|
409
|
+
modelValue: e.value,
|
|
410
|
+
"onUpdate:modelValue": (t) => e.value = t,
|
|
411
|
+
size: o.crud.isMediumSize,
|
|
412
|
+
class: "avue-crud__filter-value"
|
|
413
|
+
}, null, 8, [
|
|
414
|
+
"modelValue",
|
|
415
|
+
"onUpdate:modelValue",
|
|
416
|
+
"size"
|
|
417
|
+
]),
|
|
418
|
+
M(s, {
|
|
419
|
+
type: "danger",
|
|
420
|
+
class: "avue-crud__filter-icon",
|
|
421
|
+
circle: "",
|
|
422
|
+
icon: "el-icon-minus",
|
|
423
|
+
onClick: (e) => o.handleDelete(t)
|
|
424
|
+
}, null, 8, ["onClick"])
|
|
425
|
+
]),
|
|
426
|
+
_: 2
|
|
427
|
+
}, 1024))), 128)),
|
|
428
|
+
M(d, {
|
|
429
|
+
span: 24,
|
|
430
|
+
class: "avue-form__menu avue-form__menu--right"
|
|
431
|
+
}, {
|
|
432
|
+
default: W(() => [M(s, {
|
|
433
|
+
type: "primary",
|
|
434
|
+
size: o.crud.isMediumSize,
|
|
435
|
+
onClick: o.handleSubmit
|
|
436
|
+
}, {
|
|
437
|
+
default: W(() => [...t[5] || (t[5] = [j("确 定", -1)])]),
|
|
438
|
+
_: 1
|
|
439
|
+
}, 8, ["size", "onClick"]), M(s, {
|
|
440
|
+
size: o.crud.isMediumSize,
|
|
441
|
+
onClick: t[0] || (t[0] = (e) => a.box = !1)
|
|
442
|
+
}, {
|
|
443
|
+
default: W(() => [...t[6] || (t[6] = [j("取 消", -1)])]),
|
|
444
|
+
_: 1
|
|
445
|
+
}, 8, ["size"])]),
|
|
446
|
+
_: 1
|
|
447
|
+
})
|
|
448
|
+
]),
|
|
449
|
+
_: 1
|
|
450
|
+
})]),
|
|
451
|
+
_: 1
|
|
452
|
+
}, 8, ["modelValue", "size"])])) : D("v-if", !0);
|
|
453
|
+
}
|
|
454
|
+
var _t = /* @__PURE__ */ t(pt, [["render", gt]]), Y = (e = {}, t = {}, n = {}, r = []) => {
|
|
455
|
+
let i = e[t.prop], a = t.type, c = t.separator;
|
|
456
|
+
if (t.bind && (i = d(e, t.bind)), q(i)) i = "";
|
|
457
|
+
else {
|
|
458
|
+
let e = o.includes(t.type) && t.multiple, u = l.includes(t.type);
|
|
459
|
+
if ((["string", "number"].includes(t.dataType) || e || u) && !Array.isArray(i) && (i = `${i}`.split(c || ","), t.dataType === "number" && (i = s(i))), re.includes(a)) i = Array.isArray(i) ? i.join(c || " | ") : i.split(c || ",").join(c || " | ");
|
|
460
|
+
else if (a === "password") i = ee(i, "*");
|
|
461
|
+
else if (ne.includes(a) && t.format) {
|
|
462
|
+
let e = t.format.replace("dd", "DD").replace("yyyy", "YYYY"), n = J(Date.now(), "YYYY-MM-DD");
|
|
463
|
+
if (a.indexOf("range") !== -1) {
|
|
464
|
+
let r = i[0] || "", o = i[1] || "";
|
|
465
|
+
a === "timerange" && r.length <= 8 && o.length < 8 && (r = `${n} ${r}`, o = `${n} ${o}`), i = [J(r, e), J(o, e)].join(t.separator || "~");
|
|
466
|
+
} else a === "time" && i.length <= 8 && (i = `${n} ${i}`), i = J(i, e);
|
|
467
|
+
}
|
|
468
|
+
i = m(r, i, t.props || n.props);
|
|
469
|
+
}
|
|
470
|
+
return t.formatter && typeof t.formatter == "function" && (i = t.formatter(e, e[t.prop], i, t)), i;
|
|
471
|
+
}, vt = {
|
|
472
|
+
name: "DialogExcel",
|
|
473
|
+
inject: ["crud"],
|
|
474
|
+
data() {
|
|
475
|
+
return {
|
|
476
|
+
option: {},
|
|
477
|
+
columnOption: {},
|
|
478
|
+
box: !1,
|
|
479
|
+
form: { name: this.crud.tableOption.title }
|
|
480
|
+
};
|
|
481
|
+
},
|
|
482
|
+
methods: {
|
|
483
|
+
handleShow() {
|
|
484
|
+
this.getColumnOption(), this.getOption(), this.box = !0;
|
|
485
|
+
},
|
|
486
|
+
handleSubmit() {
|
|
487
|
+
this.$Export.excel({
|
|
488
|
+
title: this.form.name,
|
|
489
|
+
columns: this.getColumn(),
|
|
490
|
+
data: this.handleSum()
|
|
491
|
+
}), this.box = !1;
|
|
492
|
+
},
|
|
493
|
+
handleSum() {
|
|
494
|
+
let e = this.crud.tableOption, t = this.crud.propOption, n = this.form.type ? this.crud.list : this.crud.tableSelect, r = [];
|
|
495
|
+
return this.form.params.includes("data") && n.forEach((n) => {
|
|
496
|
+
let i = c(n);
|
|
497
|
+
t.forEach((t) => {
|
|
498
|
+
let n = t.parentProp ? (this.crud.cascaderDIC[t.$index] || {})[t.prop] : this.crud.DIC[t.prop];
|
|
499
|
+
i[t.prop] = Y(i, t, e, n);
|
|
500
|
+
}), r.push(i);
|
|
501
|
+
}), this.form.params.includes("sum") && e.showSummary && r.push(this.crud.sumsList), r;
|
|
502
|
+
},
|
|
503
|
+
getOption() {
|
|
504
|
+
this.option = {
|
|
505
|
+
submitBtn: !1,
|
|
506
|
+
emptyBtn: !1,
|
|
507
|
+
column: [
|
|
508
|
+
{
|
|
509
|
+
label: "文件名",
|
|
510
|
+
prop: "name",
|
|
511
|
+
span: 24
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
label: "选择数据",
|
|
515
|
+
prop: "type",
|
|
516
|
+
span: 24,
|
|
517
|
+
type: "select",
|
|
518
|
+
dicData: [{
|
|
519
|
+
label: "当前数据(当前页全部的数据)",
|
|
520
|
+
value: !0
|
|
521
|
+
}, {
|
|
522
|
+
label: "选中的数据(当前页选中的数据)",
|
|
523
|
+
disabled: this.crud.tableOption.selection !== !0,
|
|
524
|
+
value: !1
|
|
525
|
+
}]
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
label: "选择字段",
|
|
529
|
+
prop: "prop",
|
|
530
|
+
type: "tree",
|
|
531
|
+
multiple: !0,
|
|
532
|
+
checkStrictly: !0,
|
|
533
|
+
span: 24,
|
|
534
|
+
props: { value: "prop" },
|
|
535
|
+
dicData: this.columnOption
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
label: "参数设置",
|
|
539
|
+
prop: "params",
|
|
540
|
+
type: "checkbox",
|
|
541
|
+
span: 24,
|
|
542
|
+
value: ["header", "data"].concat((() => {
|
|
543
|
+
let e = [];
|
|
544
|
+
return this.crud.isHeader && e.push("headers"), this.crud.isShowSummary && e.push("sum"), e;
|
|
545
|
+
})()),
|
|
546
|
+
dicData: [{
|
|
547
|
+
label: "表头",
|
|
548
|
+
disabled: !0,
|
|
549
|
+
value: "header"
|
|
550
|
+
}, {
|
|
551
|
+
label: "数据源",
|
|
552
|
+
value: "data"
|
|
553
|
+
}].concat((() => {
|
|
554
|
+
let e = [];
|
|
555
|
+
return e.push({
|
|
556
|
+
label: "复杂表头",
|
|
557
|
+
value: "headers",
|
|
558
|
+
disabled: !this.crud.isHeader
|
|
559
|
+
}), e.push({
|
|
560
|
+
label: "合计统计",
|
|
561
|
+
value: "sum",
|
|
562
|
+
disabled: !this.crud.isShowSummary
|
|
563
|
+
}), e;
|
|
564
|
+
})())
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
}, this.form.type = this.crud.selectLen === 0;
|
|
568
|
+
},
|
|
569
|
+
getColumnOption() {
|
|
570
|
+
let e = c(this.crud.columnOption), t = [], n = (e = []) => {
|
|
571
|
+
e.forEach((r, i) => {
|
|
572
|
+
let a = r.children;
|
|
573
|
+
a && !Array.isArray(a) ? delete r.children : r.showColumn === !1 ? e.splice(i, 1) : (t.push(r.prop), r.children && n(a));
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
n(e), this.columnOption = e, this.form.prop = t;
|
|
577
|
+
},
|
|
578
|
+
getColumn() {
|
|
579
|
+
let e = c(this.columnOption), t = this.$refs.form.getPropRef("prop").$refs.temp.getHalfList();
|
|
580
|
+
if (!this.form.params) return [];
|
|
581
|
+
if (this.form.params.includes("headers")) {
|
|
582
|
+
let n = (e = []) => {
|
|
583
|
+
e.forEach((r, i) => {
|
|
584
|
+
t.includes(r.prop) ? r.children && n(r.children) : e.splice(i, 1);
|
|
585
|
+
});
|
|
586
|
+
};
|
|
587
|
+
return n(e), e;
|
|
588
|
+
} else {
|
|
589
|
+
let n = [], r = (e = []) => {
|
|
590
|
+
e.forEach((e) => {
|
|
591
|
+
e.children ? r(e.children) : t.includes(e.prop) && n.push(e);
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
return r(e), n;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}, yt = { key: 0 }, bt = { class: "dialog-footer" };
|
|
599
|
+
function xt(e, t, r, a, o, s) {
|
|
600
|
+
let c = $, l = i, u = n;
|
|
601
|
+
return o.box ? (R(), O("div", yt, [M(u, {
|
|
602
|
+
modelValue: o.box,
|
|
603
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => o.box = e),
|
|
604
|
+
title: "导出",
|
|
605
|
+
"lock-scroll": "",
|
|
606
|
+
class: "avue-dialog",
|
|
607
|
+
width: s.crud.isMobile ? "100%" : "30%"
|
|
608
|
+
}, {
|
|
609
|
+
footer: W(() => [k("span", bt, [M(l, {
|
|
610
|
+
type: "primary",
|
|
611
|
+
size: s.crud.isMediumSize,
|
|
612
|
+
onClick: s.handleSubmit
|
|
613
|
+
}, {
|
|
614
|
+
default: W(() => [...t[3] || (t[3] = [j("确定", -1)])]),
|
|
615
|
+
_: 1
|
|
616
|
+
}, 8, ["size", "onClick"]), M(l, {
|
|
617
|
+
size: s.crud.isMediumSize,
|
|
618
|
+
onClick: t[1] || (t[1] = (e) => o.box = !1)
|
|
619
|
+
}, {
|
|
620
|
+
default: W(() => [...t[4] || (t[4] = [j("取消", -1)])]),
|
|
621
|
+
_: 1
|
|
622
|
+
}, 8, ["size"])])]),
|
|
623
|
+
default: W(() => [M(c, {
|
|
624
|
+
modelValue: o.form,
|
|
625
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => o.form = e),
|
|
626
|
+
option: o.option
|
|
627
|
+
}, null, 8, ["modelValue", "option"])]),
|
|
628
|
+
_: 1
|
|
629
|
+
}, 8, ["modelValue", "width"])])) : D("v-if", !0);
|
|
630
|
+
}
|
|
631
|
+
var St = /* @__PURE__ */ t(vt, [["render", xt]]), X = {
|
|
632
|
+
menuWidth: 220,
|
|
633
|
+
menuFixed: "right",
|
|
634
|
+
menuXsWidth: 100,
|
|
635
|
+
menuAlign: "center",
|
|
636
|
+
menuHeaderAlign: "center",
|
|
637
|
+
headerAlign: "left",
|
|
638
|
+
cancelBtnIcon: "el-icon-circle-close",
|
|
639
|
+
viewBtnIcon: "el-icon-view",
|
|
640
|
+
editBtnIcon: "el-icon-edit",
|
|
641
|
+
copyBtnIcon: "el-icon-document-add",
|
|
642
|
+
addBtnIcon: "el-icon-plus",
|
|
643
|
+
printBtnIcon: "el-icon-printer",
|
|
644
|
+
excelBtnIcon: "el-icon-download",
|
|
645
|
+
delBtnIcon: "el-icon-delete",
|
|
646
|
+
searchBtnIcon: "el-icon-search",
|
|
647
|
+
emptyBtnIcon: "el-icon-delete",
|
|
648
|
+
saveBtnIcon: "el-icon-circle-plus-outline",
|
|
649
|
+
updateBtnIcon: "el-icon-circle-check",
|
|
650
|
+
columnBtnIcon: "el-icon-s-operation",
|
|
651
|
+
filterBtnIcon: "el-icon-tickets",
|
|
652
|
+
refreshBtnIcon: "el-icon-refresh",
|
|
653
|
+
viewBtn: !1,
|
|
654
|
+
editBtn: !0,
|
|
655
|
+
copyBtn: !1,
|
|
656
|
+
cancelBtn: !0,
|
|
657
|
+
addBtn: !0,
|
|
658
|
+
addRowBtn: !1,
|
|
659
|
+
printBtn: !1,
|
|
660
|
+
excelBtn: !1,
|
|
661
|
+
delBtn: !0,
|
|
662
|
+
cellBtn: !1,
|
|
663
|
+
dateBtn: !1,
|
|
664
|
+
updateBtn: !0,
|
|
665
|
+
saveBtn: !0,
|
|
666
|
+
refreshBtn: !0,
|
|
667
|
+
columnBtn: !0,
|
|
668
|
+
filterBtn: !1,
|
|
669
|
+
queryBtn: !0,
|
|
670
|
+
menuBtn: !1,
|
|
671
|
+
searchBtn: !0,
|
|
672
|
+
clearBtn: !0,
|
|
673
|
+
selectClearBtn: !0,
|
|
674
|
+
searchShow: !0,
|
|
675
|
+
tip: !0,
|
|
676
|
+
dialogWidth: "60%",
|
|
677
|
+
dialogDrag: !1,
|
|
678
|
+
formFullscreen: !1,
|
|
679
|
+
pageBackground: !0,
|
|
680
|
+
page: !0,
|
|
681
|
+
menu: !0,
|
|
682
|
+
indexLabel: "#",
|
|
683
|
+
indexWidth: 50,
|
|
684
|
+
indexFixed: "left",
|
|
685
|
+
selectionWidth: 50,
|
|
686
|
+
selectionFixed: "left",
|
|
687
|
+
expandWidth: 60,
|
|
688
|
+
expandFixed: "left",
|
|
689
|
+
filterMultiple: !0,
|
|
690
|
+
calcHeight: 300,
|
|
691
|
+
width: "100%",
|
|
692
|
+
searchGutter: 20,
|
|
693
|
+
searchLabelWidth: 80,
|
|
694
|
+
searchSpan: 6,
|
|
695
|
+
dropRowClass: ".el-table__body-wrapper > table > tbody",
|
|
696
|
+
dropColClass: ".el-table__header-wrapper tr",
|
|
697
|
+
ghostClass: "avue-crud__ghost"
|
|
698
|
+
}, Ct = {
|
|
699
|
+
name: "DialogColumn",
|
|
700
|
+
inject: ["crud"],
|
|
701
|
+
data() {
|
|
702
|
+
return {
|
|
703
|
+
data: [],
|
|
704
|
+
columnBox: !1
|
|
705
|
+
};
|
|
706
|
+
},
|
|
707
|
+
computed: { defaultColumn() {
|
|
708
|
+
return [
|
|
709
|
+
{
|
|
710
|
+
label: "隐藏",
|
|
711
|
+
prop: "hide"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
label: "冻结",
|
|
715
|
+
prop: "fixed"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
label: "过滤",
|
|
719
|
+
prop: "filters"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
label: "排序",
|
|
723
|
+
prop: "sortable"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
label: "序号",
|
|
727
|
+
prop: "index",
|
|
728
|
+
hide: !0
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
label: "宽度",
|
|
732
|
+
prop: "width",
|
|
733
|
+
hide: !0
|
|
734
|
+
}
|
|
735
|
+
];
|
|
736
|
+
} },
|
|
737
|
+
methods: {
|
|
738
|
+
handleShow() {
|
|
739
|
+
this.data = [], this.crud.propOption.forEach((e) => {
|
|
740
|
+
e.showColumn !== !1 && this.data.push(e);
|
|
741
|
+
}), this.columnBox = !0, this.$nextTick(() => this.rowDrop());
|
|
742
|
+
},
|
|
743
|
+
handleChange(e) {
|
|
744
|
+
["hide", "filters"].includes(e) && this.crud.refreshTable();
|
|
745
|
+
},
|
|
746
|
+
rowDrop() {
|
|
747
|
+
let e = this.$refs.table.$el.querySelectorAll(X.dropRowClass)[0];
|
|
748
|
+
this.crud.tableDrop("column", e, (e) => {
|
|
749
|
+
let t = e.oldIndex, n = e.newIndex;
|
|
750
|
+
this.crud.headerSort(t, n), this.crud.refreshTable(() => this.rowDrop());
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}, wt = { key: 0 };
|
|
755
|
+
function Tt(e, t, n, r, i, a) {
|
|
756
|
+
let o = w, s = Le, c = Xe, l = S;
|
|
757
|
+
return i.columnBox ? (R(), O("div", wt, [M(l, {
|
|
758
|
+
modelValue: i.columnBox,
|
|
759
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => i.columnBox = e),
|
|
760
|
+
class: "avue-crud__dialog avue-crud__column avue-dialog",
|
|
761
|
+
"lock-scroll": "",
|
|
762
|
+
"append-to-body": "",
|
|
763
|
+
title: "列显隐",
|
|
764
|
+
size: a.crud.isMobile ? "100%" : "40%"
|
|
765
|
+
}, {
|
|
766
|
+
default: W(() => [M(c, {
|
|
767
|
+
ref: "table",
|
|
768
|
+
data: i.data,
|
|
769
|
+
height: "100%",
|
|
770
|
+
border: ""
|
|
771
|
+
}, {
|
|
772
|
+
default: W(() => [M(o, {
|
|
773
|
+
key: "label",
|
|
774
|
+
align: "center",
|
|
775
|
+
width: "100",
|
|
776
|
+
"header-align": "center",
|
|
777
|
+
prop: "label",
|
|
778
|
+
label: "列名"
|
|
779
|
+
}), (R(!0), O(T, null, z(a.defaultColumn, (e, t) => (R(), O(T, null, [e.hide === !0 ? D("v-if", !0) : (R(), E(o, {
|
|
780
|
+
key: t,
|
|
781
|
+
label: e.label,
|
|
782
|
+
prop: e.prop,
|
|
783
|
+
align: "center",
|
|
784
|
+
"header-align": "center"
|
|
785
|
+
}, {
|
|
786
|
+
default: W(({ row: t }) => [M(s, {
|
|
787
|
+
modelValue: a.crud.objectOption[t.prop][e.prop],
|
|
788
|
+
"onUpdate:modelValue": (n) => a.crud.objectOption[t.prop][e.prop] = n,
|
|
789
|
+
onChange: (t) => a.handleChange(e.prop)
|
|
790
|
+
}, null, 8, [
|
|
791
|
+
"modelValue",
|
|
792
|
+
"onUpdate:modelValue",
|
|
793
|
+
"onChange"
|
|
794
|
+
])]),
|
|
795
|
+
_: 2
|
|
796
|
+
}, 1032, ["label", "prop"]))], 64))), 256))]),
|
|
797
|
+
_: 1
|
|
798
|
+
}, 8, ["data"])]),
|
|
799
|
+
_: 1
|
|
800
|
+
}, 8, ["modelValue", "size"])])) : D("v-if", !0);
|
|
801
|
+
}
|
|
802
|
+
var Et = /* @__PURE__ */ t(Ct, [["render", Tt]]), Dt = {
|
|
803
|
+
name: "FyDialogForm",
|
|
804
|
+
components: { ElementDialog: n },
|
|
805
|
+
inject: ["crud"],
|
|
806
|
+
data() {
|
|
807
|
+
return {
|
|
808
|
+
disabled: !1,
|
|
809
|
+
boxType: "",
|
|
810
|
+
fullscreen: !1,
|
|
811
|
+
size: null,
|
|
812
|
+
boxVisible: !1
|
|
813
|
+
};
|
|
814
|
+
},
|
|
815
|
+
computed: {
|
|
816
|
+
option() {
|
|
817
|
+
let e = c(this.crud.tableOption);
|
|
818
|
+
return e.boxType = this.boxType, e.column = c(this.crud.propOption), e.menuBtn = !1, this.isAdd ? (e.submitBtn = e.saveBtn, e.submitText = this.crud.menuIcon("saveBtn"), e.submitIcon = this.crud.getBtnIcon("saveBtn")) : this.isEdit ? (e.submitBtn = e.updateBtn, e.submitText = this.crud.menuIcon("updateBtn"), e.submitIcon = this.crud.getBtnIcon("updateBtn")) : this.isView && (e.detail = !0), e.emptyBtn = e.cancelBtn, e.emptyText = this.crud.menuIcon("cancelBtn"), e.emptyIcon = this.crud.getBtnIcon("cancelBtn"), this.crud.isGroup || (e.dicFlag = !1, e.dicData = this.crud.DIC), q(e.dicFlag) || e.column.forEach((t) => {
|
|
819
|
+
t.boxType = this.boxType, t.dicFlag = t.dicFlag || e.dicFlag;
|
|
820
|
+
}), e;
|
|
821
|
+
},
|
|
822
|
+
isView() {
|
|
823
|
+
return this.boxType === "view";
|
|
824
|
+
},
|
|
825
|
+
isAdd() {
|
|
826
|
+
return this.boxType === "add";
|
|
827
|
+
},
|
|
828
|
+
isEdit() {
|
|
829
|
+
return this.boxType === "edit";
|
|
830
|
+
},
|
|
831
|
+
direction() {
|
|
832
|
+
return this.crud.tableOption.dialogDirection;
|
|
833
|
+
},
|
|
834
|
+
width() {
|
|
835
|
+
return h(`${this.crud.tableOption.dialogWidth}`, this.crud.isMobile ? "100%" : `${X.dialogWidth}`);
|
|
836
|
+
},
|
|
837
|
+
dialogType() {
|
|
838
|
+
return this.isDrawer ? S : n;
|
|
839
|
+
},
|
|
840
|
+
dialogTop() {
|
|
841
|
+
return !this.isDrawer && !this.fullscreen ? this.crud.tableOption.dialogTop : "0";
|
|
842
|
+
},
|
|
843
|
+
isDrawer() {
|
|
844
|
+
return this.crud.tableOption.dialogType === "drawer";
|
|
845
|
+
},
|
|
846
|
+
params() {
|
|
847
|
+
return this.isDrawer ? {
|
|
848
|
+
size: this.fullscreen ? "100%" : this.width,
|
|
849
|
+
direction: this.crud.tableOption.dialogDirection
|
|
850
|
+
} : {
|
|
851
|
+
width: this.width,
|
|
852
|
+
fullscreen: this.fullscreen
|
|
853
|
+
};
|
|
854
|
+
},
|
|
855
|
+
dialogTitle() {
|
|
856
|
+
let e = `${this.boxType}`;
|
|
857
|
+
return q(this.boxType) ? "" : this.crud.tableOption[`${e}Title`] || {
|
|
858
|
+
tipStartTitle: "当前表格已选择",
|
|
859
|
+
tipEndTitle: "项",
|
|
860
|
+
editTitle: "编 辑",
|
|
861
|
+
copyTitle: "复 制",
|
|
862
|
+
addTitle: "新 增",
|
|
863
|
+
viewTitle: "查 看",
|
|
864
|
+
filterTitle: "过滤条件",
|
|
865
|
+
showTitle: "列显隐"
|
|
866
|
+
}[`${e}Title`];
|
|
867
|
+
},
|
|
868
|
+
dialogMenuPosition() {
|
|
869
|
+
return this.crud.option.dialogMenuPosition || "right";
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
methods: {
|
|
873
|
+
optVal: h,
|
|
874
|
+
uploadFun: _,
|
|
875
|
+
submit() {
|
|
876
|
+
this.$refs.tableForm.submit();
|
|
877
|
+
},
|
|
878
|
+
reset() {
|
|
879
|
+
this.$refs.tableForm.resetForm(!1);
|
|
880
|
+
},
|
|
881
|
+
getSlotName(e) {
|
|
882
|
+
return e.replace("Form", "");
|
|
883
|
+
},
|
|
884
|
+
initFun() {
|
|
885
|
+
[
|
|
886
|
+
"clearValidate",
|
|
887
|
+
"validate",
|
|
888
|
+
"resetForm",
|
|
889
|
+
"validateField"
|
|
890
|
+
].forEach((e) => {
|
|
891
|
+
var t;
|
|
892
|
+
this.crud[e] = (t = this.$refs.tableForm) == null ? void 0 : t[e];
|
|
893
|
+
});
|
|
894
|
+
},
|
|
895
|
+
handleChange() {
|
|
896
|
+
this.crud.setVal();
|
|
897
|
+
},
|
|
898
|
+
handleTabClick(e, t) {
|
|
899
|
+
this.crud.$emit("tab-click", e, t);
|
|
900
|
+
},
|
|
901
|
+
handleFullScreen() {
|
|
902
|
+
this.isDrawer && (q(this.size) ? this.size = "100%" : this.size = ""), this.fullscreen = !this.fullscreen;
|
|
903
|
+
},
|
|
904
|
+
handleError(e) {
|
|
905
|
+
this.crud.$emit("error", e);
|
|
906
|
+
},
|
|
907
|
+
handleSubmit(e, t) {
|
|
908
|
+
this.isAdd ? this.rowSave(t) : this.isEdit && this.rowUpdate(t);
|
|
909
|
+
},
|
|
910
|
+
rowSave(e) {
|
|
911
|
+
this.crud.$emit("row-save", u(this.crud.tableForm, ["$"]), this.closeDialog, e);
|
|
912
|
+
},
|
|
913
|
+
rowUpdate(e) {
|
|
914
|
+
this.crud.$emit("row-update", u(this.crud.tableForm, ["$"]), this.crud.tableIndex, this.closeDialog, e);
|
|
915
|
+
},
|
|
916
|
+
closeDialog(e) {
|
|
917
|
+
e = c(e), e && (() => {
|
|
918
|
+
if (this.isEdit) {
|
|
919
|
+
let { parentList: t, index: n } = this.crud.findData(e[this.crud.rowKey]);
|
|
920
|
+
if (t) {
|
|
921
|
+
let r = t.splice(n, 1)[0];
|
|
922
|
+
e[this.crud.childrenKey] = r[this.crud.childrenKey], t.splice(n, 0, e);
|
|
923
|
+
}
|
|
924
|
+
} else if (this.isAdd) {
|
|
925
|
+
let { item: t } = this.crud.findData(e[this.crud.rowParentKey]);
|
|
926
|
+
t ? (t[this.crud.childrenKey] || (t[this.crud.childrenKey] = []), this.crud.tableOption.lazy && (t[this.crud.hasChildrenKey] = !0), t[this.crud.childrenKey].push(e)) : this.crud.list.push(e);
|
|
927
|
+
}
|
|
928
|
+
})(), this.hide();
|
|
929
|
+
},
|
|
930
|
+
hide(e) {
|
|
931
|
+
let t = () => {
|
|
932
|
+
e == null || e(), this.crud.tableIndex = -1, this.crud.tableForm = {}, this.crud.setVal(), this.boxVisible = !1;
|
|
933
|
+
};
|
|
934
|
+
typeof this.crud.beforeClose == "function" ? this.crud.beforeClose(t, this.boxType) : t();
|
|
935
|
+
},
|
|
936
|
+
show(e) {
|
|
937
|
+
this.boxType = e;
|
|
938
|
+
let t = () => {
|
|
939
|
+
this.fullscreen = this.crud.tableOption.dialogFullscreen, this.boxVisible = !0, this.$nextTick(() => {
|
|
940
|
+
this.initFun();
|
|
941
|
+
});
|
|
942
|
+
};
|
|
943
|
+
typeof this.crud.beforeOpen == "function" ? this.crud.beforeOpen(t, this.boxType) : t();
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
function Ot(e, t, n, r, a, o) {
|
|
948
|
+
let s = $, c = i;
|
|
949
|
+
return a.boxVisible ? (R(), E(H(o.dialogType), P({
|
|
950
|
+
key: 0,
|
|
951
|
+
modelValue: a.boxVisible,
|
|
952
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => a.boxVisible = e),
|
|
953
|
+
"lock-scroll": "",
|
|
954
|
+
"show-full-screen": "",
|
|
955
|
+
"destroy-on-close": o.crud.tableOption.dialogDestroy,
|
|
956
|
+
"wrapper-closable": o.crud.tableOption.dialogClickModal,
|
|
957
|
+
direction: o.direction,
|
|
958
|
+
class: "dialog-form",
|
|
959
|
+
"custom-class": o.crud.tableOption.dialogCustomClass,
|
|
960
|
+
"modal-append-to-body": "",
|
|
961
|
+
"append-to-body": "",
|
|
962
|
+
top: o.dialogTop,
|
|
963
|
+
title: o.dialogTitle,
|
|
964
|
+
"close-on-press-escape": o.crud.tableOption.dialogEscape,
|
|
965
|
+
"close-on-click-modal": o.optVal(o.crud.tableOption.dialogClickModal, !1),
|
|
966
|
+
modal: o.crud.tableOption.dialogModal,
|
|
967
|
+
"show-close": o.crud.tableOption.dialogCloseBtn
|
|
968
|
+
}, o.params, { "before-close": o.hide }), {
|
|
969
|
+
footer: W(() => [k("span", { class: F(["avue-dialog__footer", `avue-dialog__footer--${o.dialogMenuPosition}`]) }, [
|
|
970
|
+
o.optVal(o.option.submitBtn, !0) && !o.isView ? (R(), E(c, {
|
|
971
|
+
key: 0,
|
|
972
|
+
loading: a.disabled,
|
|
973
|
+
size: o.crud.controlSize,
|
|
974
|
+
icon: o.option.submitIcon,
|
|
975
|
+
type: "primary",
|
|
976
|
+
onClick: o.submit
|
|
977
|
+
}, {
|
|
978
|
+
default: W(() => [j(U(o.option.submitText), 1)]),
|
|
979
|
+
_: 1
|
|
980
|
+
}, 8, [
|
|
981
|
+
"loading",
|
|
982
|
+
"size",
|
|
983
|
+
"icon",
|
|
984
|
+
"onClick"
|
|
985
|
+
])) : D("v-if", !0),
|
|
986
|
+
o.optVal(o.option.emptyBtn, !0) && !o.isView ? (R(), E(c, {
|
|
987
|
+
key: 1,
|
|
988
|
+
disabled: a.disabled,
|
|
989
|
+
size: o.crud.controlSize,
|
|
990
|
+
icon: o.option.emptyIcon,
|
|
991
|
+
onClick: o.reset
|
|
992
|
+
}, {
|
|
993
|
+
default: W(() => [j(U(o.option.emptyText), 1)]),
|
|
994
|
+
_: 1
|
|
995
|
+
}, 8, [
|
|
996
|
+
"disabled",
|
|
997
|
+
"size",
|
|
998
|
+
"icon",
|
|
999
|
+
"onClick"
|
|
1000
|
+
])) : D("v-if", !0),
|
|
1001
|
+
B(e.$slots, "menuForm", {
|
|
1002
|
+
disabled: a.disabled,
|
|
1003
|
+
size: o.crud.controlSize,
|
|
1004
|
+
type: a.boxType
|
|
1005
|
+
})
|
|
1006
|
+
], 2)]),
|
|
1007
|
+
default: W(() => [M(s, P({
|
|
1008
|
+
ref: "tableForm",
|
|
1009
|
+
modelValue: o.crud.tableForm,
|
|
1010
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => o.crud.tableForm = e),
|
|
1011
|
+
status: a.disabled,
|
|
1012
|
+
"onUpdate:status": t[1] || (t[1] = (e) => a.disabled = e)
|
|
1013
|
+
}, o.uploadFun({}, o.crud), {
|
|
1014
|
+
option: o.option,
|
|
1015
|
+
onChange: o.handleChange,
|
|
1016
|
+
onSubmit: o.handleSubmit,
|
|
1017
|
+
onResetChange: o.hide,
|
|
1018
|
+
onTabClick: o.handleTabClick,
|
|
1019
|
+
onError: o.handleError
|
|
1020
|
+
}), A({ _: 2 }, [z(o.crud.formSlot, (t) => ({
|
|
1021
|
+
name: o.getSlotName(t),
|
|
1022
|
+
fn: W((n) => [B(e.$slots, t, I(N(Object.assign(n, { type: a.boxType }))))])
|
|
1023
|
+
}))]), 1040, [
|
|
1024
|
+
"modelValue",
|
|
1025
|
+
"status",
|
|
1026
|
+
"option",
|
|
1027
|
+
"onChange",
|
|
1028
|
+
"onSubmit",
|
|
1029
|
+
"onResetChange",
|
|
1030
|
+
"onTabClick",
|
|
1031
|
+
"onError"
|
|
1032
|
+
])]),
|
|
1033
|
+
_: 3
|
|
1034
|
+
}, 16, [
|
|
1035
|
+
"modelValue",
|
|
1036
|
+
"destroy-on-close",
|
|
1037
|
+
"wrapper-closable",
|
|
1038
|
+
"direction",
|
|
1039
|
+
"custom-class",
|
|
1040
|
+
"top",
|
|
1041
|
+
"title",
|
|
1042
|
+
"close-on-press-escape",
|
|
1043
|
+
"close-on-click-modal",
|
|
1044
|
+
"modal",
|
|
1045
|
+
"show-close",
|
|
1046
|
+
"before-close"
|
|
1047
|
+
])) : D("v-if", !0);
|
|
1048
|
+
}
|
|
1049
|
+
var kt = /* @__PURE__ */ t(Dt, [["render", Ot]]), At = {
|
|
1050
|
+
name: "TablePage",
|
|
1051
|
+
inject: ["crud"],
|
|
1052
|
+
data() {
|
|
1053
|
+
return { defaultPage: {
|
|
1054
|
+
single: !0,
|
|
1055
|
+
total: 0,
|
|
1056
|
+
pagerCount: 7,
|
|
1057
|
+
currentPage: 1,
|
|
1058
|
+
pageSize: 10,
|
|
1059
|
+
pageSizes: [
|
|
1060
|
+
10,
|
|
1061
|
+
20,
|
|
1062
|
+
30,
|
|
1063
|
+
40,
|
|
1064
|
+
50,
|
|
1065
|
+
100
|
|
1066
|
+
],
|
|
1067
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
1068
|
+
background: !0
|
|
1069
|
+
} };
|
|
1070
|
+
},
|
|
1071
|
+
computed: { pageFlag() {
|
|
1072
|
+
return this.defaultPage.total !== 0;
|
|
1073
|
+
} },
|
|
1074
|
+
watch: {
|
|
1075
|
+
"crud.page": {
|
|
1076
|
+
handler() {
|
|
1077
|
+
this.pageInit();
|
|
1078
|
+
},
|
|
1079
|
+
deep: !0
|
|
1080
|
+
},
|
|
1081
|
+
pageFlag() {
|
|
1082
|
+
this.crud.getTableHeight();
|
|
1083
|
+
},
|
|
1084
|
+
"defaultPage.total"() {
|
|
1085
|
+
this.defaultPage.total === (this.defaultPage.currentPage - 1) * this.defaultPage.pageSize && this.defaultPage.total !== 0 && (this.defaultPage.currentPage = this.defaultPage.currentPage - 1, this.currentChange(this.defaultPage.currentPage));
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
created() {
|
|
1089
|
+
this.crud.isMobile && (this.defaultPage.layout = "total, sizes, prev, pager, next"), this.pageInit(), this.crud.$emit("on-load", this.defaultPage);
|
|
1090
|
+
},
|
|
1091
|
+
methods: {
|
|
1092
|
+
optVal: h,
|
|
1093
|
+
pageInit() {
|
|
1094
|
+
this.defaultPage = Object.assign(this.defaultPage, this.crud.page), this.updateValue();
|
|
1095
|
+
},
|
|
1096
|
+
updateValue() {
|
|
1097
|
+
this.crud.$emit("update:page", this.defaultPage);
|
|
1098
|
+
},
|
|
1099
|
+
nextClick(e) {
|
|
1100
|
+
this.crud.$emit("next-click", e);
|
|
1101
|
+
},
|
|
1102
|
+
prevClick(e) {
|
|
1103
|
+
this.crud.$emit("prev-click", e);
|
|
1104
|
+
},
|
|
1105
|
+
sizeChange(e) {
|
|
1106
|
+
this.defaultPage.currentPage = 1, this.defaultPage.pageSize = e, this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("size-change", e);
|
|
1107
|
+
},
|
|
1108
|
+
currentChange(e) {
|
|
1109
|
+
this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("current-change", e);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
function jt(e, t, n, r, i, a) {
|
|
1114
|
+
let o = qe, s = Ie;
|
|
1115
|
+
return a.pageFlag && a.optVal(a.crud.tableOption.page, !0) ? (R(), E(s, {
|
|
1116
|
+
key: 0,
|
|
1117
|
+
shadow: a.crud.isCard,
|
|
1118
|
+
class: "avue-pagination"
|
|
1119
|
+
}, {
|
|
1120
|
+
default: W(() => [B(e.$slots, "page"), M(o, {
|
|
1121
|
+
"current-page": i.defaultPage.currentPage,
|
|
1122
|
+
"onUpdate:currentPage": t[0] || (t[0] = (e) => i.defaultPage.currentPage = e),
|
|
1123
|
+
small: a.crud.size === "mini",
|
|
1124
|
+
style: { "margin-top": "25px" },
|
|
1125
|
+
disabled: i.defaultPage.disabled,
|
|
1126
|
+
"hide-on-single-page": i.defaultPage.single,
|
|
1127
|
+
"pager-count": i.defaultPage.pagerCount,
|
|
1128
|
+
background: i.defaultPage.background,
|
|
1129
|
+
"page-size": i.defaultPage.pageSize,
|
|
1130
|
+
"page-sizes": i.defaultPage.pageSizes,
|
|
1131
|
+
layout: i.defaultPage.layout,
|
|
1132
|
+
total: i.defaultPage.total,
|
|
1133
|
+
onSizeChange: a.sizeChange,
|
|
1134
|
+
onPrevClick: a.prevClick,
|
|
1135
|
+
onNextClick: a.nextClick,
|
|
1136
|
+
onCurrentChange: a.currentChange
|
|
1137
|
+
}, null, 8, [
|
|
1138
|
+
"current-page",
|
|
1139
|
+
"small",
|
|
1140
|
+
"disabled",
|
|
1141
|
+
"hide-on-single-page",
|
|
1142
|
+
"pager-count",
|
|
1143
|
+
"background",
|
|
1144
|
+
"page-size",
|
|
1145
|
+
"page-sizes",
|
|
1146
|
+
"layout",
|
|
1147
|
+
"total",
|
|
1148
|
+
"onSizeChange",
|
|
1149
|
+
"onPrevClick",
|
|
1150
|
+
"onNextClick",
|
|
1151
|
+
"onCurrentChange"
|
|
1152
|
+
])]),
|
|
1153
|
+
_: 3
|
|
1154
|
+
}, 8, ["shadow"])) : D("v-if", !0);
|
|
1155
|
+
}
|
|
1156
|
+
var Mt = /* @__PURE__ */ t(At, [["render", jt]]), Z = {}, Nt = {
|
|
1157
|
+
name: "ColumnSlot",
|
|
1158
|
+
inject: ["dynamic", "crud"],
|
|
1159
|
+
props: {
|
|
1160
|
+
column: Object,
|
|
1161
|
+
columnOption: Array
|
|
1162
|
+
},
|
|
1163
|
+
created() {
|
|
1164
|
+
let e = [
|
|
1165
|
+
"getColumnProp",
|
|
1166
|
+
"handleFilterMethod",
|
|
1167
|
+
"handleFilters"
|
|
1168
|
+
];
|
|
1169
|
+
Object.keys(this.dynamic).forEach((t) => {
|
|
1170
|
+
e.includes(t) && (this[t] = this.dynamic[t]);
|
|
1171
|
+
});
|
|
1172
|
+
},
|
|
1173
|
+
methods: {
|
|
1174
|
+
isBlank: q,
|
|
1175
|
+
optVal: h,
|
|
1176
|
+
uploadFun: _,
|
|
1177
|
+
isMediaType(t, n) {
|
|
1178
|
+
return e(t, n);
|
|
1179
|
+
},
|
|
1180
|
+
vaildLabel(e, t, n) {
|
|
1181
|
+
if (e.rules && t.$cellEdit) return n;
|
|
1182
|
+
},
|
|
1183
|
+
columnChange(e, t, n) {
|
|
1184
|
+
let r = `${n}-${t.prop}`;
|
|
1185
|
+
Z[r] || (this.handleChange(t, e), typeof t.change == "function" && t.cell === !0 && t.change({
|
|
1186
|
+
row: e,
|
|
1187
|
+
column: t,
|
|
1188
|
+
index: n,
|
|
1189
|
+
value: e[t.prop]
|
|
1190
|
+
})), Z[r] = !0, this.$nextTick(() => {
|
|
1191
|
+
Z[r] = !1;
|
|
1192
|
+
});
|
|
1193
|
+
},
|
|
1194
|
+
handleChange(e, t) {
|
|
1195
|
+
e.cascader && this.$nextTick(() => {
|
|
1196
|
+
let n = e.cascader;
|
|
1197
|
+
n.forEach((r) => {
|
|
1198
|
+
let i = r, o = t[e.prop], s = t.$index, c = this.findObject(this.columnOption, i);
|
|
1199
|
+
q(c) || (q(this.crud.cascaderDIC[s]) && (this.crud.cascaderDIC[s] = {}), this.crud.cascaderIndexList.includes(s) && n.forEach((e) => {
|
|
1200
|
+
this.crud.cascaderDIC[s][e.prop] = [], n.forEach((e) => t[e] = "");
|
|
1201
|
+
}), !(q(n) || q(o) || q(c)) && b({
|
|
1202
|
+
column: c,
|
|
1203
|
+
value: o,
|
|
1204
|
+
form: t
|
|
1205
|
+
}).then((e) => {
|
|
1206
|
+
let n = e || [];
|
|
1207
|
+
this.crud.cascaderIndexList.includes(s) || this.crud.cascaderIndexList.push(s), this.crud.cascaderDicList[s] || (this.crud.cascaderDicList[s] = {}), this.crud.cascaderDicList[s][i] || (this.crud.cascaderDicList[s][i] = n), this.crud.cascaderDIC[s][i] = n, !q(n[c.cascaderIndex]) && !q(n) && !q(c.cascaderIndex) && (t[i] = n[c.cascaderIndex][(c.props || {}).value || a.value]);
|
|
1208
|
+
}));
|
|
1209
|
+
});
|
|
1210
|
+
});
|
|
1211
|
+
},
|
|
1212
|
+
handleDetail(e, t) {
|
|
1213
|
+
let n = t.parentProp ? (this.crud.cascaderDIC[e.$index] || {})[t.prop] : this.crud.DIC[t.prop], r = Y(e, t, this.crud.tableOption, n);
|
|
1214
|
+
return !q(n) && this.crud.tableOption.filterDic !== !0 && (e[`$${t.prop}`] = r), r;
|
|
1215
|
+
},
|
|
1216
|
+
corArray(e, t) {
|
|
1217
|
+
let n = this.handleDetail(e, t);
|
|
1218
|
+
return Array.isArray(n) || (n = q(n) ? [] : n.split(" | ")), c(n);
|
|
1219
|
+
},
|
|
1220
|
+
openImg(e, t, n) {
|
|
1221
|
+
let r = this.getImgList(e, t);
|
|
1222
|
+
r = r.map((e) => ({
|
|
1223
|
+
thumbUrl: e,
|
|
1224
|
+
url: e,
|
|
1225
|
+
type: t.fileType
|
|
1226
|
+
})), this.$ImagePreview(r, n);
|
|
1227
|
+
},
|
|
1228
|
+
getImgList(e, t) {
|
|
1229
|
+
var n, r;
|
|
1230
|
+
let i = ((n = t.propsHttp) == null ? void 0 : n.home) || "", o = ((r = t.props) == null ? void 0 : r.value) || a.value, s = this.corArray(e, t);
|
|
1231
|
+
return s.forEach((e, t) => {
|
|
1232
|
+
s[t] = i + (e[o] ? e[o] : e);
|
|
1233
|
+
}), s;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
}, Pt = { key: 1 }, Ft = {
|
|
1237
|
+
key: 0,
|
|
1238
|
+
class: "avue-crud__img"
|
|
1239
|
+
}, It = ["src", "onClick"], Lt = { key: 1 }, Rt = { key: 2 }, zt = ["innerHTML"], Bt = ["textContent"];
|
|
1240
|
+
function Vt(e, t, n, r, i, a) {
|
|
1241
|
+
let o = Dn, s = $e, c = C, l = Ge, u = Ce, d = Se, f = w;
|
|
1242
|
+
return e.getColumnProp(n.column, "hide") ? (R(), E(f, {
|
|
1243
|
+
key: n.column.prop,
|
|
1244
|
+
prop: n.column.prop,
|
|
1245
|
+
label: n.column.label,
|
|
1246
|
+
"column-key": n.column.prop,
|
|
1247
|
+
"filter-placement": "bottom-end",
|
|
1248
|
+
filters: e.getColumnProp(n.column, "filters"),
|
|
1249
|
+
"filter-method": e.getColumnProp(n.column, "filterMethod") ? e.handleFilterMethod : void 0,
|
|
1250
|
+
"filter-multiple": a.optVal(n.column.filterMultiple, !0),
|
|
1251
|
+
"show-overflow-tooltip": n.column.overHidden,
|
|
1252
|
+
"min-width": n.column.minWidth,
|
|
1253
|
+
sortable: e.getColumnProp(n.column, "sortable"),
|
|
1254
|
+
"sort-method": n.column.sortMethod,
|
|
1255
|
+
"sort-orders": n.column.sortOrders,
|
|
1256
|
+
"sort-by": n.column.sortBy,
|
|
1257
|
+
resizable: n.column.resizable,
|
|
1258
|
+
"render-header": n.column.renderHeader,
|
|
1259
|
+
align: n.column.align || a.crud.tableOption.align,
|
|
1260
|
+
"header-align": n.column.headerAlign || a.crud.tableOption.headerAlign,
|
|
1261
|
+
width: e.getColumnProp(n.column, "width"),
|
|
1262
|
+
fixed: e.getColumnProp(n.column, "fixed")
|
|
1263
|
+
}, {
|
|
1264
|
+
header: W(({ $index: t }) => [a.crud.getSlotName(n.column, "H", a.crud.$slots) ? B(e.$slots, a.crud.getSlotName(n.column, "H"), I(P({ key: 0 }, {
|
|
1265
|
+
column: n.column,
|
|
1266
|
+
$index: t
|
|
1267
|
+
}))) : (R(), O("span", Pt, U(n.column.label), 1))]),
|
|
1268
|
+
default: W(({ row: t, $index: r }) => [t.$cellEdit && n.column.cell ? (R(), E(c, {
|
|
1269
|
+
key: 0,
|
|
1270
|
+
prop: a.crud.isTree ? "" : `list.${r}.${n.column.prop}`,
|
|
1271
|
+
label: a.vaildLabel(n.column, t, " "),
|
|
1272
|
+
"label-width": a.vaildLabel(n.column, t, "1px"),
|
|
1273
|
+
rules: n.column.rules
|
|
1274
|
+
}, {
|
|
1275
|
+
default: W(() => [M(s, {
|
|
1276
|
+
content: (a.crud.listError[`list.${r}.${n.column.prop}`] || {}).msg,
|
|
1277
|
+
disabled: !(a.crud.listError[`list.${r}.${n.column.prop}`] || {}).valid,
|
|
1278
|
+
placement: "top"
|
|
1279
|
+
}, {
|
|
1280
|
+
default: W(() => [a.crud.getSlotName(n.column, "F", a.crud.$slots) ? B(e.$slots, a.crud.getSlotName(n.column, "F"), I(P({ key: 0 }, {
|
|
1281
|
+
row: t,
|
|
1282
|
+
dic: a.crud.DIC[n.column.prop],
|
|
1283
|
+
size: a.crud.isMediumSize,
|
|
1284
|
+
index: r,
|
|
1285
|
+
disabled: a.crud.btnDisabledList[r],
|
|
1286
|
+
label: a.handleDetail(t, n.column),
|
|
1287
|
+
$cell: t.$cellEdit
|
|
1288
|
+
}))) : (R(), E(o, P({ key: 1 }, a.uploadFun(n.column, a.crud), {
|
|
1289
|
+
modelValue: t[n.column.prop],
|
|
1290
|
+
"onUpdate:modelValue": (e) => t[n.column.prop] = e,
|
|
1291
|
+
column: n.column,
|
|
1292
|
+
size: a.crud.isMediumSize,
|
|
1293
|
+
"table-data": {
|
|
1294
|
+
index: r,
|
|
1295
|
+
row: t,
|
|
1296
|
+
label: a.handleDetail(t, n.column)
|
|
1297
|
+
},
|
|
1298
|
+
dic: (a.crud.cascaderDIC[r] || {})[n.column.prop] || a.crud.DIC[n.column.prop],
|
|
1299
|
+
props: n.column.props || a.crud.tableOption.props,
|
|
1300
|
+
readonly: n.column.readonly,
|
|
1301
|
+
disabled: a.crud.disabled || a.crud.tableOption.disabled || n.column.disabled || a.crud.btnDisabledList[r],
|
|
1302
|
+
clearable: a.optVal(n.column.clearable, !1),
|
|
1303
|
+
"column-slot": a.crud.mainSlot,
|
|
1304
|
+
onChange: (e) => a.columnChange(t, n.column, r)
|
|
1305
|
+
}), A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
|
|
1306
|
+
name: t,
|
|
1307
|
+
fn: W((n) => [B(e.$slots, t, I(N(n)))])
|
|
1308
|
+
}))]), 1040, [
|
|
1309
|
+
"modelValue",
|
|
1310
|
+
"onUpdate:modelValue",
|
|
1311
|
+
"column",
|
|
1312
|
+
"size",
|
|
1313
|
+
"table-data",
|
|
1314
|
+
"dic",
|
|
1315
|
+
"props",
|
|
1316
|
+
"readonly",
|
|
1317
|
+
"disabled",
|
|
1318
|
+
"clearable",
|
|
1319
|
+
"column-slot",
|
|
1320
|
+
"onChange"
|
|
1321
|
+
]))]),
|
|
1322
|
+
_: 2
|
|
1323
|
+
}, 1032, ["content", "disabled"])]),
|
|
1324
|
+
_: 2
|
|
1325
|
+
}, 1032, [
|
|
1326
|
+
"prop",
|
|
1327
|
+
"label",
|
|
1328
|
+
"label-width",
|
|
1329
|
+
"rules"
|
|
1330
|
+
])) : a.crud.$slots[n.column.prop] ? B(e.$slots, n.column.prop, {
|
|
1331
|
+
key: 1,
|
|
1332
|
+
row: t,
|
|
1333
|
+
index: r,
|
|
1334
|
+
dic: a.crud.DIC[n.column.prop],
|
|
1335
|
+
size: a.crud.isMediumSize,
|
|
1336
|
+
label: a.handleDetail(t, n.column)
|
|
1337
|
+
}) : (R(), O(T, { key: 2 }, [["img", "upload"].includes(n.column.type) ? (R(), O("span", Ft, [(R(!0), O(T, null, z(a.getImgList(t, n.column), (e, r) => (R(), O(T, null, [a.isMediaType(e, n.column.fileType) ? (R(), E(H(a.isMediaType(e, n.column.fileType)), {
|
|
1338
|
+
key: r,
|
|
1339
|
+
src: e,
|
|
1340
|
+
onClick: K((e) => a.openImg(t, n.column, r), ["stop"])
|
|
1341
|
+
}, null, 8, ["src", "onClick"])) : (R(), O("i", {
|
|
1342
|
+
key: `e_${r}`,
|
|
1343
|
+
src: e,
|
|
1344
|
+
class: "el-icon-document",
|
|
1345
|
+
onClick: K((e) => a.openImg(t, n.column, r), ["stop"])
|
|
1346
|
+
}, null, 8, It))], 64))), 256))])) : n.column.type === "url" ? (R(), O("span", Lt, [(R(!0), O(T, null, z(a.corArray(t, n.column), (e, t) => (R(), E(l, {
|
|
1347
|
+
key: t,
|
|
1348
|
+
type: "primary",
|
|
1349
|
+
href: e,
|
|
1350
|
+
target: n.column.target || "_blank"
|
|
1351
|
+
}, {
|
|
1352
|
+
default: W(() => [j(U(e), 1)]),
|
|
1353
|
+
_: 2
|
|
1354
|
+
}, 1032, ["href", "target"]))), 128))])) : n.column.type === "rate" ? (R(), O("span", Rt, [M(u, {
|
|
1355
|
+
modelValue: t[n.column.prop],
|
|
1356
|
+
"onUpdate:modelValue": (e) => t[n.column.prop] = e,
|
|
1357
|
+
disabled: ""
|
|
1358
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])])) : n.column.type === "color" ? (R(), O("i", {
|
|
1359
|
+
key: 3,
|
|
1360
|
+
class: "avue-crud__color",
|
|
1361
|
+
style: L({ backgroundColor: t[n.column.prop] })
|
|
1362
|
+
}, null, 4)) : n.column.type === "icon" ? (R(), E(d, {
|
|
1363
|
+
key: 4,
|
|
1364
|
+
text: t[n.column.prop]
|
|
1365
|
+
}, null, 8, ["text"])) : n.column.html ? (R(), O("span", {
|
|
1366
|
+
key: 5,
|
|
1367
|
+
innerHTML: a.handleDetail(t, n.column)
|
|
1368
|
+
}, null, 8, zt)) : (R(), O("span", {
|
|
1369
|
+
key: 6,
|
|
1370
|
+
textContent: U(a.handleDetail(t, n.column))
|
|
1371
|
+
}, null, 8, Bt))], 64))]),
|
|
1372
|
+
_: 3
|
|
1373
|
+
}, 8, [
|
|
1374
|
+
"prop",
|
|
1375
|
+
"label",
|
|
1376
|
+
"column-key",
|
|
1377
|
+
"filters",
|
|
1378
|
+
"filter-method",
|
|
1379
|
+
"filter-multiple",
|
|
1380
|
+
"show-overflow-tooltip",
|
|
1381
|
+
"min-width",
|
|
1382
|
+
"sortable",
|
|
1383
|
+
"sort-method",
|
|
1384
|
+
"sort-orders",
|
|
1385
|
+
"sort-by",
|
|
1386
|
+
"resizable",
|
|
1387
|
+
"render-header",
|
|
1388
|
+
"align",
|
|
1389
|
+
"header-align",
|
|
1390
|
+
"width",
|
|
1391
|
+
"fixed"
|
|
1392
|
+
])) : D("v-if", !0);
|
|
1393
|
+
}
|
|
1394
|
+
var Ht = /* @__PURE__ */ t(Nt, [["render", Vt]]), Ut = {
|
|
1395
|
+
name: "ColumnDynamic",
|
|
1396
|
+
inject: ["dynamic", "crud"],
|
|
1397
|
+
props: { columnOption: Object },
|
|
1398
|
+
created() {
|
|
1399
|
+
let e = [
|
|
1400
|
+
"getColumnProp",
|
|
1401
|
+
"handleFilterMethod",
|
|
1402
|
+
"handleFilters"
|
|
1403
|
+
];
|
|
1404
|
+
Object.keys(this.dynamic).forEach((t) => {
|
|
1405
|
+
e.includes(t) && (this[t] = this.dynamic[t]);
|
|
1406
|
+
});
|
|
1407
|
+
},
|
|
1408
|
+
methods: { optVal: h }
|
|
1409
|
+
};
|
|
1410
|
+
function Wt(e, t, n, r, i, a) {
|
|
1411
|
+
let o = tt("ColumnDynamic", !0), s = Ht, c = w;
|
|
1412
|
+
return e.getColumnProp(n.columnOption, "hide") ? (R(), E(c, {
|
|
1413
|
+
key: n.columnOption.prop,
|
|
1414
|
+
prop: n.columnOption.prop,
|
|
1415
|
+
label: n.columnOption.label,
|
|
1416
|
+
"filter-placement": "bottom-end",
|
|
1417
|
+
filters: e.getColumnProp(n.columnOption, "filters"),
|
|
1418
|
+
"filter-method": e.getColumnProp(n.columnOption, "filterMethod") ? e.handleFilterMethod : void 0,
|
|
1419
|
+
"filter-multiple": a.optVal(n.columnOption.filterMultiple, !0),
|
|
1420
|
+
"show-overflow-tooltip": n.columnOption.overHidden,
|
|
1421
|
+
"min-width": n.columnOption.minWidth,
|
|
1422
|
+
sortable: e.getColumnProp(n.columnOption, "sortable"),
|
|
1423
|
+
"render-header": n.columnOption.renderHeader,
|
|
1424
|
+
align: n.columnOption.align || a.crud.tableOption.align,
|
|
1425
|
+
"header-align": n.columnOption.headerAlign || a.crud.tableOption.headerAlign,
|
|
1426
|
+
width: e.getColumnProp(n.columnOption, "width"),
|
|
1427
|
+
fixed: e.getColumnProp(n.columnOption, "fixed")
|
|
1428
|
+
}, {
|
|
1429
|
+
default: W(() => [(R(!0), O(T, null, z(n.columnOption.children, (t) => (R(), O(T, null, [t.children && t.children.length > 0 ? (R(), E(o, {
|
|
1430
|
+
key: t.prop,
|
|
1431
|
+
"column-option": t
|
|
1432
|
+
}, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
|
|
1433
|
+
name: t,
|
|
1434
|
+
fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
|
|
1435
|
+
}))]), 1032, ["column-option"])) : (R(), E(s, {
|
|
1436
|
+
key: t.prop,
|
|
1437
|
+
column: t,
|
|
1438
|
+
"column-option": n.columnOption.children
|
|
1439
|
+
}, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
|
|
1440
|
+
name: t,
|
|
1441
|
+
fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
|
|
1442
|
+
}))]), 1032, ["column", "column-option"]))], 64))), 256))]),
|
|
1443
|
+
_: 3
|
|
1444
|
+
}, 8, [
|
|
1445
|
+
"prop",
|
|
1446
|
+
"label",
|
|
1447
|
+
"filters",
|
|
1448
|
+
"filter-method",
|
|
1449
|
+
"filter-multiple",
|
|
1450
|
+
"show-overflow-tooltip",
|
|
1451
|
+
"min-width",
|
|
1452
|
+
"sortable",
|
|
1453
|
+
"render-header",
|
|
1454
|
+
"align",
|
|
1455
|
+
"header-align",
|
|
1456
|
+
"width",
|
|
1457
|
+
"fixed"
|
|
1458
|
+
])) : D("v-if", !0);
|
|
1459
|
+
}
|
|
1460
|
+
var Gt = /* @__PURE__ */ t(Ut, [["render", Wt]]), Kt = {
|
|
1461
|
+
name: "Column",
|
|
1462
|
+
inject: ["crud"],
|
|
1463
|
+
provide() {
|
|
1464
|
+
return {
|
|
1465
|
+
crud: this.crud,
|
|
1466
|
+
dynamic: this
|
|
1467
|
+
};
|
|
1468
|
+
},
|
|
1469
|
+
props: { columnOption: Array },
|
|
1470
|
+
computed: { list() {
|
|
1471
|
+
let e = [...this.columnOption];
|
|
1472
|
+
return e = te(e, "index", (e, t) => {
|
|
1473
|
+
var n, r;
|
|
1474
|
+
return ((n = this.crud.objectOption[e.prop]) == null ? void 0 : n.index) - ((r = this.crud.objectOption[t.prop]) == null ? void 0 : r.index);
|
|
1475
|
+
}), e;
|
|
1476
|
+
} },
|
|
1477
|
+
methods: {
|
|
1478
|
+
handleFilterMethod(e, t, n) {
|
|
1479
|
+
let r = this.columnOption.filter((e) => e.prop === n.property)[0];
|
|
1480
|
+
return typeof r.filterMethod == "function" ? r.filterMethod(e, t, r) : t[r.prop] === e;
|
|
1481
|
+
},
|
|
1482
|
+
handleFilters(e, t) {
|
|
1483
|
+
if (t !== !0) return;
|
|
1484
|
+
let n = this.crud.DIC[e.prop] || [], r = [];
|
|
1485
|
+
return q(n) ? this.crud.cellForm.list.forEach((t) => {
|
|
1486
|
+
r.map((e) => e.text).includes(t[e.prop]) || r.push({
|
|
1487
|
+
text: t[e.prop],
|
|
1488
|
+
value: t[e.prop]
|
|
1489
|
+
});
|
|
1490
|
+
}) : n.forEach((t) => {
|
|
1491
|
+
let n = e.props || this.crud.tableOption.props || {};
|
|
1492
|
+
r.push({
|
|
1493
|
+
text: t[n.label || a.label],
|
|
1494
|
+
value: t[n.value || a.value]
|
|
1495
|
+
});
|
|
1496
|
+
}), r;
|
|
1497
|
+
},
|
|
1498
|
+
getColumnProp(e, t) {
|
|
1499
|
+
let n = this.crud.objectOption[e.prop] || {};
|
|
1500
|
+
if (t === "filterMethod") return n == null ? void 0 : n.filters;
|
|
1501
|
+
if (this.crud.isMobile && ["fixed"].includes(t)) return !1;
|
|
1502
|
+
let r = n == null ? void 0 : n[t];
|
|
1503
|
+
if (!(t === "width" && r === 0)) return t === "filters" ? this.handleFilters(e, r) : t === "hide" ? (n == null ? void 0 : n.hide) !== !0 : r;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
function qt(e, t, n, r, i, a) {
|
|
1508
|
+
let o = Gt, s = Ht;
|
|
1509
|
+
return R(), O(T, null, [
|
|
1510
|
+
B(e.$slots, "header"),
|
|
1511
|
+
D(" 动态列 "),
|
|
1512
|
+
(R(!0), O(T, null, z(a.list, (t) => (R(), O(T, null, [t.children && t.children.length > 0 ? (R(), E(o, {
|
|
1513
|
+
key: t.pop,
|
|
1514
|
+
"column-option": t
|
|
1515
|
+
}, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
|
|
1516
|
+
name: t,
|
|
1517
|
+
fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
|
|
1518
|
+
}))]), 1032, ["column-option"])) : (R(), E(s, {
|
|
1519
|
+
key: t.prop,
|
|
1520
|
+
column: t,
|
|
1521
|
+
"column-option": n.columnOption
|
|
1522
|
+
}, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
|
|
1523
|
+
name: t,
|
|
1524
|
+
fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
|
|
1525
|
+
}))]), 1032, ["column", "column-option"]))], 64))), 256)),
|
|
1526
|
+
B(e.$slots, "footer")
|
|
1527
|
+
], 64);
|
|
1528
|
+
}
|
|
1529
|
+
var Jt = /* @__PURE__ */ t(Kt, [["render", qt]]), Q = (() => {
|
|
1530
|
+
function e(e, t) {
|
|
1531
|
+
t.value === !1 ? e.style.display = "none" : e.style.display = "";
|
|
1532
|
+
}
|
|
1533
|
+
return {
|
|
1534
|
+
bind(t, n) {
|
|
1535
|
+
e(t, n);
|
|
1536
|
+
},
|
|
1537
|
+
update(t, n) {
|
|
1538
|
+
e(t, n);
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
})(), Yt = {
|
|
1542
|
+
name: "ColumnMenu",
|
|
1543
|
+
directives: { permission: Q },
|
|
1544
|
+
inject: {
|
|
1545
|
+
crud: { from: "crud" },
|
|
1546
|
+
AVUE: {
|
|
1547
|
+
from: r,
|
|
1548
|
+
default: null
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1551
|
+
data() {
|
|
1552
|
+
return { config: X };
|
|
1553
|
+
},
|
|
1554
|
+
computed: {
|
|
1555
|
+
menuType() {
|
|
1556
|
+
var e;
|
|
1557
|
+
return this.crud.tableOption.menuType || ((e = this.AVUE) == null ? void 0 : e.menuType) || "button";
|
|
1558
|
+
},
|
|
1559
|
+
isIconMenu() {
|
|
1560
|
+
return this.menuType === "icon";
|
|
1561
|
+
},
|
|
1562
|
+
isTextMenu() {
|
|
1563
|
+
return this.menuType === "text";
|
|
1564
|
+
},
|
|
1565
|
+
isMenu() {
|
|
1566
|
+
return this.menuType === "menu";
|
|
1567
|
+
}
|
|
1568
|
+
},
|
|
1569
|
+
methods: {
|
|
1570
|
+
optVal: h,
|
|
1571
|
+
menuText(e) {
|
|
1572
|
+
return ["text", "menu"].includes(this.menuType) ? "text" : e;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
function Xt(e, t, n, r, a, o) {
|
|
1577
|
+
let s = i, c = Ve, l = He, u = Be, d = w, f = V("permission");
|
|
1578
|
+
return R(), O(T, null, [D(" 操作栏 "), o.optVal(o.crud.tableOption.menu, a.config.menu) && o.crud.getPermission("menu") ? (R(), E(d, {
|
|
1579
|
+
key: "menu",
|
|
1580
|
+
class: "avue-crud__btn",
|
|
1581
|
+
prop: "menu",
|
|
1582
|
+
fixed: o.optVal(o.crud.tableOption.menuFixed, a.config.menuFixed),
|
|
1583
|
+
label: o.crud.tableOption.menuTitle || "操作",
|
|
1584
|
+
align: o.crud.tableOption.menuAlign || a.config.menuAlign,
|
|
1585
|
+
"header-align": o.crud.tableOption.menuHeaderAlign || a.config.menuHeaderAlign,
|
|
1586
|
+
width: o.crud.isMobile ? o.crud.tableOption.menuXsWidth || a.config.menuXsWidth : o.crud.tableOption.menuWidth || a.config.menuWidth
|
|
1587
|
+
}, {
|
|
1588
|
+
default: W(({ row: n, $index: r }) => [o.isMenu ? (R(), E(u, {
|
|
1589
|
+
key: 0,
|
|
1590
|
+
size: o.crud.isMediumSize
|
|
1591
|
+
}, {
|
|
1592
|
+
dropdown: W(() => [M(l, null, {
|
|
1593
|
+
default: W(() => [
|
|
1594
|
+
o.optVal(o.crud.tableOption.viewBtn, a.config.viewBtn) ? G((R(), E(c, {
|
|
1595
|
+
key: 0,
|
|
1596
|
+
icon: o.crud.getBtnIcon("viewBtn"),
|
|
1597
|
+
onClick: (e) => o.crud.rowView(n, r)
|
|
1598
|
+
}, {
|
|
1599
|
+
default: W(() => [j(U(o.crud.menuIcon("viewBtn")), 1)]),
|
|
1600
|
+
_: 1
|
|
1601
|
+
}, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("viewBtn", n, r)]]) : D("v-if", !0),
|
|
1602
|
+
o.optVal(o.crud.tableOption.editBtn, a.config.editBtn) ? G((R(), E(c, {
|
|
1603
|
+
key: 1,
|
|
1604
|
+
icon: o.crud.getBtnIcon("editBtn"),
|
|
1605
|
+
onClick: (e) => o.crud.rowEdit(n, r)
|
|
1606
|
+
}, {
|
|
1607
|
+
default: W(() => [j(U(o.crud.menuIcon("editBtn")), 1)]),
|
|
1608
|
+
_: 1
|
|
1609
|
+
}, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("editBtn", n, r)]]) : D("v-if", !0),
|
|
1610
|
+
o.optVal(o.crud.tableOption.copyBtn, a.config.copyBtn) ? G((R(), E(c, {
|
|
1611
|
+
key: 2,
|
|
1612
|
+
icon: o.crud.getBtnIcon("copyBtn"),
|
|
1613
|
+
onClick: (e) => o.crud.rowCopy(n)
|
|
1614
|
+
}, {
|
|
1615
|
+
default: W(() => [j(U(o.crud.menuIcon("copyBtn")), 1)]),
|
|
1616
|
+
_: 1
|
|
1617
|
+
}, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("copyBtn", n, r)]]) : D("v-if", !0),
|
|
1618
|
+
o.optVal(o.crud.tableOption.delBtn, a.config.delBtn) ? G((R(), E(c, {
|
|
1619
|
+
key: 3,
|
|
1620
|
+
icon: o.crud.getBtnIcon("delBtn"),
|
|
1621
|
+
onClick: (e) => o.crud.rowDel(n, r)
|
|
1622
|
+
}, {
|
|
1623
|
+
default: W(() => [j(U(o.crud.menuIcon("delBtn")), 1)]),
|
|
1624
|
+
_: 1
|
|
1625
|
+
}, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("delBtn", n, r)]]) : D("v-if", !0),
|
|
1626
|
+
B(e.$slots, "menuBtn", {
|
|
1627
|
+
row: n,
|
|
1628
|
+
type: o.menuText("primary"),
|
|
1629
|
+
disabled: o.crud.btnDisabled,
|
|
1630
|
+
size: o.crud.isMediumSize,
|
|
1631
|
+
index: r
|
|
1632
|
+
})
|
|
1633
|
+
]),
|
|
1634
|
+
_: 2
|
|
1635
|
+
}, 1024)]),
|
|
1636
|
+
default: W(() => [M(s, {
|
|
1637
|
+
text: "",
|
|
1638
|
+
size: o.crud.isMediumSize
|
|
1639
|
+
}, {
|
|
1640
|
+
default: W(() => [j(U(o.crud.tableOption.menuBtnTitle || "按钮") + " ", 1), t[0] || (t[0] = k("i", { class: "el-icon-arrow-down el-icon--right" }, null, -1))]),
|
|
1641
|
+
_: 1
|
|
1642
|
+
}, 8, ["size"])]),
|
|
1643
|
+
_: 2
|
|
1644
|
+
}, 1032, ["size"])) : [
|
|
1645
|
+
"button",
|
|
1646
|
+
"text",
|
|
1647
|
+
"icon"
|
|
1648
|
+
].includes(o.menuType) ? (R(), O(T, { key: 1 }, [
|
|
1649
|
+
o.optVal(o.crud.tableOption.cellBtn, a.config.cellBtn) ? (R(), O(T, { key: 0 }, [o.optVal(o.crud.tableOption.editBtn, a.config.editBtn) && !n.$cellEdit ? G((R(), E(s, {
|
|
1650
|
+
key: 0,
|
|
1651
|
+
type: o.menuText("primary"),
|
|
1652
|
+
icon: o.crud.getBtnIcon("editBtn"),
|
|
1653
|
+
size: o.crud.isMediumSize,
|
|
1654
|
+
disabled: o.crud.btnDisabledList[r],
|
|
1655
|
+
onClick: K((e) => o.crud.rowCell(n, r), ["stop"])
|
|
1656
|
+
}, {
|
|
1657
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("editBtn")), 1)], 64))]),
|
|
1658
|
+
_: 1
|
|
1659
|
+
}, 8, [
|
|
1660
|
+
"type",
|
|
1661
|
+
"icon",
|
|
1662
|
+
"size",
|
|
1663
|
+
"disabled",
|
|
1664
|
+
"onClick"
|
|
1665
|
+
])), [[f, o.crud.getPermission("editBtn", n, r)]]) : o.optVal(o.crud.tableOption.saveBtn, a.config.saveBtn) && n.$cellEdit ? G((R(), E(s, {
|
|
1666
|
+
key: 1,
|
|
1667
|
+
type: o.menuText("primary"),
|
|
1668
|
+
icon: o.crud.getBtnIcon("saveBtn"),
|
|
1669
|
+
size: o.crud.isMediumSize,
|
|
1670
|
+
disabled: o.crud.btnDisabledList[r],
|
|
1671
|
+
onClick: K((e) => o.crud.rowCell(n, r), ["stop"])
|
|
1672
|
+
}, {
|
|
1673
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("saveBtn")), 1)], 64))]),
|
|
1674
|
+
_: 1
|
|
1675
|
+
}, 8, [
|
|
1676
|
+
"type",
|
|
1677
|
+
"icon",
|
|
1678
|
+
"size",
|
|
1679
|
+
"disabled",
|
|
1680
|
+
"onClick"
|
|
1681
|
+
])), [[f, o.crud.getPermission("saveBtn", n, r)]]) : D("v-if", !0), n.$cellEdit ? (R(), E(s, {
|
|
1682
|
+
key: 2,
|
|
1683
|
+
type: o.menuText("danger"),
|
|
1684
|
+
icon: o.crud.getBtnIcon("cancelBtn"),
|
|
1685
|
+
size: o.crud.isMediumSize,
|
|
1686
|
+
disabled: o.crud.btnDisabledList[r],
|
|
1687
|
+
onClick: K((e) => o.crud.rowCancel(n, r), ["stop"])
|
|
1688
|
+
}, {
|
|
1689
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("cancelBtn")), 1)], 64))]),
|
|
1690
|
+
_: 1
|
|
1691
|
+
}, 8, [
|
|
1692
|
+
"type",
|
|
1693
|
+
"icon",
|
|
1694
|
+
"size",
|
|
1695
|
+
"disabled",
|
|
1696
|
+
"onClick"
|
|
1697
|
+
])) : D("v-if", !0)], 64)) : D("v-if", !0),
|
|
1698
|
+
o.optVal(o.crud.tableOption.viewBtn, a.config.viewBtn) ? G((R(), E(s, {
|
|
1699
|
+
key: 1,
|
|
1700
|
+
type: o.menuText("success"),
|
|
1701
|
+
icon: o.crud.getBtnIcon("viewBtn"),
|
|
1702
|
+
size: o.crud.isMediumSize,
|
|
1703
|
+
disabled: e.btnDisabled,
|
|
1704
|
+
onClick: K((e) => o.crud.rowView(n, r), ["stop"])
|
|
1705
|
+
}, {
|
|
1706
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("viewBtn")), 1)], 64))]),
|
|
1707
|
+
_: 1
|
|
1708
|
+
}, 8, [
|
|
1709
|
+
"type",
|
|
1710
|
+
"icon",
|
|
1711
|
+
"size",
|
|
1712
|
+
"disabled",
|
|
1713
|
+
"onClick"
|
|
1714
|
+
])), [[f, o.crud.getPermission("viewBtn", n, r)]]) : D("v-if", !0),
|
|
1715
|
+
o.optVal(o.crud.tableOption.editBtn, a.config.editBtn) && !o.crud.tableOption.cellBtn ? G((R(), E(s, {
|
|
1716
|
+
key: 2,
|
|
1717
|
+
type: o.menuText("primary"),
|
|
1718
|
+
icon: o.crud.getBtnIcon("editBtn"),
|
|
1719
|
+
size: o.crud.isMediumSize,
|
|
1720
|
+
disabled: e.btnDisabled,
|
|
1721
|
+
onClick: K((e) => o.crud.rowEdit(n, r), ["stop"])
|
|
1722
|
+
}, {
|
|
1723
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("editBtn")), 1)], 64))]),
|
|
1724
|
+
_: 1
|
|
1725
|
+
}, 8, [
|
|
1726
|
+
"type",
|
|
1727
|
+
"icon",
|
|
1728
|
+
"size",
|
|
1729
|
+
"disabled",
|
|
1730
|
+
"onClick"
|
|
1731
|
+
])), [[f, o.crud.getPermission("editBtn", n, r)]]) : D("v-if", !0),
|
|
1732
|
+
o.optVal(o.crud.tableOption.copyBtn, a.config.copyBtn) ? G((R(), E(s, {
|
|
1733
|
+
key: 3,
|
|
1734
|
+
type: o.menuText("primary"),
|
|
1735
|
+
icon: o.crud.getBtnIcon("copyBtn"),
|
|
1736
|
+
size: o.crud.isMediumSize,
|
|
1737
|
+
disabled: e.btnDisabled,
|
|
1738
|
+
onClick: K((e) => o.crud.rowCopy(n), ["stop"])
|
|
1739
|
+
}, {
|
|
1740
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("copyBtn")), 1)], 64))]),
|
|
1741
|
+
_: 1
|
|
1742
|
+
}, 8, [
|
|
1743
|
+
"type",
|
|
1744
|
+
"icon",
|
|
1745
|
+
"size",
|
|
1746
|
+
"disabled",
|
|
1747
|
+
"onClick"
|
|
1748
|
+
])), [[f, o.crud.getPermission("copyBtn", n, r)]]) : D("v-if", !0),
|
|
1749
|
+
o.optVal(o.crud.tableOption.delBtn, a.config.delBtn) && !n.$cellEdit ? G((R(), E(s, {
|
|
1750
|
+
key: 4,
|
|
1751
|
+
type: o.menuText("danger"),
|
|
1752
|
+
icon: o.crud.getBtnIcon("delBtn"),
|
|
1753
|
+
size: o.crud.isMediumSize,
|
|
1754
|
+
disabled: e.btnDisabled,
|
|
1755
|
+
onClick: K((e) => o.crud.rowDel(n, r), ["stop"])
|
|
1756
|
+
}, {
|
|
1757
|
+
default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("delBtn")), 1)], 64))]),
|
|
1758
|
+
_: 1
|
|
1759
|
+
}, 8, [
|
|
1760
|
+
"type",
|
|
1761
|
+
"icon",
|
|
1762
|
+
"size",
|
|
1763
|
+
"disabled",
|
|
1764
|
+
"onClick"
|
|
1765
|
+
])), [[f, o.crud.getPermission("delBtn", n, r)]]) : D("v-if", !0)
|
|
1766
|
+
], 64)) : D("v-if", !0), B(e.$slots, "menu", {
|
|
1767
|
+
row: n,
|
|
1768
|
+
type: o.menuText("primary"),
|
|
1769
|
+
disabled: o.crud.btnDisabled,
|
|
1770
|
+
size: o.crud.isMediumSize,
|
|
1771
|
+
index: r
|
|
1772
|
+
})]),
|
|
1773
|
+
_: 3
|
|
1774
|
+
}, 8, [
|
|
1775
|
+
"fixed",
|
|
1776
|
+
"label",
|
|
1777
|
+
"align",
|
|
1778
|
+
"header-align",
|
|
1779
|
+
"width"
|
|
1780
|
+
])) : D("v-if", !0)], 2112);
|
|
1781
|
+
}
|
|
1782
|
+
var Zt = /* @__PURE__ */ t(Yt, [["render", Xt]]), Qt = {
|
|
1783
|
+
name: "ColumnDefault",
|
|
1784
|
+
inject: ["crud"],
|
|
1785
|
+
data() {
|
|
1786
|
+
return { config: X };
|
|
1787
|
+
},
|
|
1788
|
+
mounted() {
|
|
1789
|
+
this.setSort();
|
|
1790
|
+
},
|
|
1791
|
+
methods: {
|
|
1792
|
+
optVal: h,
|
|
1793
|
+
indexMethod(e) {
|
|
1794
|
+
return e + 1 + ((this.crud.page.currentPage || 1) - 1) * (this.crud.page.pageSize || 10);
|
|
1795
|
+
},
|
|
1796
|
+
setSort() {
|
|
1797
|
+
this.rowDrop(), this.columnDrop();
|
|
1798
|
+
},
|
|
1799
|
+
rowDrop() {
|
|
1800
|
+
let e = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0];
|
|
1801
|
+
this.crud.tableDrop("row", e, (e) => {
|
|
1802
|
+
let t = e.oldIndex, n = e.newIndex, r = this.crud.list.splice(t, 1)[0];
|
|
1803
|
+
this.crud.list.splice(n, 0, r), this.crud.$emit("sortable-change", t, n), this.crud.refreshTable(() => this.rowDrop());
|
|
1804
|
+
});
|
|
1805
|
+
},
|
|
1806
|
+
columnDrop() {
|
|
1807
|
+
let e = this.crud.$refs.table.$el.querySelector(this.config.dropColClass), t = 0;
|
|
1808
|
+
[
|
|
1809
|
+
"selection",
|
|
1810
|
+
"index",
|
|
1811
|
+
"expand"
|
|
1812
|
+
].forEach((e) => {
|
|
1813
|
+
this.crud.tableOption[e] && (t += 1);
|
|
1814
|
+
}), this.crud.tableDrop("column", e, (e) => {
|
|
1815
|
+
this.crud.headerSort(e.oldIndex - t, e.newIndex - t), this.columnDrop();
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
};
|
|
1820
|
+
function $t(e, t, n, r, i, a) {
|
|
1821
|
+
let o = w;
|
|
1822
|
+
return R(), O(T, null, [
|
|
1823
|
+
M(o, { width: "1px" }),
|
|
1824
|
+
D(" 折叠面板 "),
|
|
1825
|
+
a.crud.tableOption.expand ? (R(), E(o, {
|
|
1826
|
+
key: "expand",
|
|
1827
|
+
type: "expand",
|
|
1828
|
+
width: a.crud.tableOption.expandWidth || i.config.expandWidth,
|
|
1829
|
+
fixed: a.optVal(a.crud.tableOption.expandFixed, i.config.expandFixed),
|
|
1830
|
+
align: "center"
|
|
1831
|
+
}, {
|
|
1832
|
+
default: W(({ row: t }) => [B(e.$slots, "expand", {
|
|
1833
|
+
row: t,
|
|
1834
|
+
index: t.$index
|
|
1835
|
+
})]),
|
|
1836
|
+
_: 3
|
|
1837
|
+
}, 8, ["width", "fixed"])) : D("v-if", !0),
|
|
1838
|
+
D(" 选择框 "),
|
|
1839
|
+
a.crud.tableOption.selection ? (R(), E(o, {
|
|
1840
|
+
key: "selection",
|
|
1841
|
+
fixed: a.optVal(a.crud.tableOption.selectionFixed, i.config.selectionFixed),
|
|
1842
|
+
type: "selection",
|
|
1843
|
+
selectable: a.crud.tableOption.selectable,
|
|
1844
|
+
"reserve-selection": a.optVal(a.crud.tableOption.reserveSelection),
|
|
1845
|
+
width: a.crud.tableOption.selectionWidth || i.config.selectionWidth,
|
|
1846
|
+
align: "center"
|
|
1847
|
+
}, null, 8, [
|
|
1848
|
+
"fixed",
|
|
1849
|
+
"selectable",
|
|
1850
|
+
"reserve-selection",
|
|
1851
|
+
"width"
|
|
1852
|
+
])) : D("v-if", !0),
|
|
1853
|
+
D(" 序号 "),
|
|
1854
|
+
a.optVal(a.crud.tableOption.index) ? (R(), E(o, {
|
|
1855
|
+
key: "index",
|
|
1856
|
+
fixed: a.optVal(a.crud.tableOption.indexFixed, i.config.indexFixed),
|
|
1857
|
+
label: a.crud.tableOption.indexLabel || i.config.indexLabel,
|
|
1858
|
+
type: "index",
|
|
1859
|
+
width: a.crud.tableOption.indexWidth || i.config.indexWidth,
|
|
1860
|
+
index: a.indexMethod,
|
|
1861
|
+
align: "center"
|
|
1862
|
+
}, null, 8, [
|
|
1863
|
+
"fixed",
|
|
1864
|
+
"label",
|
|
1865
|
+
"width",
|
|
1866
|
+
"index"
|
|
1867
|
+
])) : D("v-if", !0)
|
|
1868
|
+
], 64);
|
|
1869
|
+
}
|
|
1870
|
+
var en = /* @__PURE__ */ t(Qt, [["render", $t]]), tn = {
|
|
1871
|
+
name: "HeaderMenu",
|
|
1872
|
+
directives: { permission: Q },
|
|
1873
|
+
inject: ["crud"],
|
|
1874
|
+
data() {
|
|
1875
|
+
return {
|
|
1876
|
+
dateCreate: !1,
|
|
1877
|
+
pickerOptions: { shortcuts: [
|
|
1878
|
+
{
|
|
1879
|
+
text: "今日",
|
|
1880
|
+
onClick(e) {
|
|
1881
|
+
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
1882
|
+
n.setTime(n.getTime()), e.$emit("pick", [n, t]);
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
text: "昨日",
|
|
1887
|
+
onClick(e) {
|
|
1888
|
+
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
1889
|
+
n.setTime(n.getTime() - 3600 * 1e3 * 24 * 1), e.$emit("pick", [n, t]);
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
text: "最近一周",
|
|
1894
|
+
onClick(e) {
|
|
1895
|
+
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
1896
|
+
n.setTime(n.getTime() - 3600 * 1e3 * 24 * 7), e.$emit("pick", [n, t]);
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
text: "最近一个月",
|
|
1901
|
+
onClick(e) {
|
|
1902
|
+
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
1903
|
+
n.setTime(n.getTime() - 3600 * 1e3 * 24 * 30), e.$emit("pick", [n, t]);
|
|
1904
|
+
}
|
|
1905
|
+
},
|
|
1906
|
+
{
|
|
1907
|
+
text: "最近三个月",
|
|
1908
|
+
onClick(e) {
|
|
1909
|
+
let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
1910
|
+
n.setTime(n.getTime() - 3600 * 1e3 * 24 * 90), e.$emit("pick", [n, t]);
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
] },
|
|
1914
|
+
config: X
|
|
1915
|
+
};
|
|
1916
|
+
},
|
|
1917
|
+
created() {
|
|
1918
|
+
this.initFun();
|
|
1919
|
+
},
|
|
1920
|
+
methods: {
|
|
1921
|
+
optVal: h,
|
|
1922
|
+
dateChange(e) {
|
|
1923
|
+
this.dateCreate ? this.crud.$emit("date-change", e) : this.dateCreate = !0;
|
|
1924
|
+
},
|
|
1925
|
+
initFun() {
|
|
1926
|
+
this.crud.rowExcel = this.rowExcel, this.crud.rowPrint = this.rowPrint;
|
|
1927
|
+
},
|
|
1928
|
+
rowExcel() {
|
|
1929
|
+
this.crud.$refs.dialogExcel.handleShow();
|
|
1930
|
+
},
|
|
1931
|
+
rowPrint() {
|
|
1932
|
+
this.$Print(this.crud.$refs.table);
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
}, nn = { class: "avue-crud__menu" }, rn = {
|
|
1936
|
+
key: 0,
|
|
1937
|
+
class: "avue-crud__left"
|
|
1938
|
+
}, an = {
|
|
1939
|
+
key: 1,
|
|
1940
|
+
class: "avue-crud__right"
|
|
1941
|
+
};
|
|
1942
|
+
function on(e, t, n, r, a, o) {
|
|
1943
|
+
let s = i, c = he, l = V("permission");
|
|
1944
|
+
return R(), O("div", nn, [o.optVal(o.crud.tableOption.menuLeft, !0) ? (R(), O("div", rn, [
|
|
1945
|
+
o.optVal(o.crud.tableOption.addBtn, a.config.addBtn) ? G((R(), E(s, {
|
|
1946
|
+
key: 0,
|
|
1947
|
+
type: "primary",
|
|
1948
|
+
icon: o.crud.getBtnIcon("addBtn"),
|
|
1949
|
+
size: o.crud.isMediumSize,
|
|
1950
|
+
onClick: o.crud.rowAdd
|
|
1951
|
+
}, {
|
|
1952
|
+
default: W(() => [o.crud.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("addBtn")), 1)], 64))]),
|
|
1953
|
+
_: 1
|
|
1954
|
+
}, 8, [
|
|
1955
|
+
"icon",
|
|
1956
|
+
"size",
|
|
1957
|
+
"onClick"
|
|
1958
|
+
])), [[l, o.crud.getPermission("addBtn")]]) : D("v-if", !0),
|
|
1959
|
+
o.optVal(o.crud.tableOption.addRowBtn, a.config.addRowBtn) ? G((R(), E(s, {
|
|
1960
|
+
key: 1,
|
|
1961
|
+
type: "primary",
|
|
1962
|
+
icon: o.crud.getBtnIcon("addBtn"),
|
|
1963
|
+
size: o.crud.isMediumSize,
|
|
1964
|
+
onClick: o.crud.rowCellAdd
|
|
1965
|
+
}, {
|
|
1966
|
+
default: W(() => [o.crud.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("addBtn")), 1)], 64))]),
|
|
1967
|
+
_: 1
|
|
1968
|
+
}, 8, [
|
|
1969
|
+
"icon",
|
|
1970
|
+
"size",
|
|
1971
|
+
"onClick"
|
|
1972
|
+
])), [[l, o.crud.getPermission("addRowBtn")]]) : D("v-if", !0),
|
|
1973
|
+
B(e.$slots, "menuLeft", { size: o.crud.isMediumSize })
|
|
1974
|
+
])) : D("v-if", !0), o.optVal(o.crud.tableOption.menuRight, !0) ? (R(), O("div", an, [
|
|
1975
|
+
o.optVal(o.crud.tableOption.dateBtn, a.config.dateBtn) ? (R(), E(c, {
|
|
1976
|
+
key: 0,
|
|
1977
|
+
type: "datetimerange",
|
|
1978
|
+
"value-format": "yyyy-MM-dd HH:mm:ss",
|
|
1979
|
+
format: "yyyy-MM-dd HH:mm:ss",
|
|
1980
|
+
"picker-options": a.pickerOptions,
|
|
1981
|
+
style: {
|
|
1982
|
+
display: "inline-block",
|
|
1983
|
+
"margin-right": "20px"
|
|
1984
|
+
},
|
|
1985
|
+
size: o.crud.isMediumSize,
|
|
1986
|
+
onChange: o.dateChange
|
|
1987
|
+
}, null, 8, [
|
|
1988
|
+
"picker-options",
|
|
1989
|
+
"size",
|
|
1990
|
+
"onChange"
|
|
1991
|
+
])) : D("v-if", !0),
|
|
1992
|
+
B(e.$slots, "menuRight", { size: o.crud.isMediumSize }),
|
|
1993
|
+
o.optVal(o.crud.tableOption.excelBtn, a.config.excelBtn) ? G((R(), E(s, {
|
|
1994
|
+
key: 1,
|
|
1995
|
+
icon: o.crud.getBtnIcon("excelBtn"),
|
|
1996
|
+
circle: "",
|
|
1997
|
+
size: o.crud.isMediumSize,
|
|
1998
|
+
onClick: o.rowExcel
|
|
1999
|
+
}, null, 8, [
|
|
2000
|
+
"icon",
|
|
2001
|
+
"size",
|
|
2002
|
+
"onClick"
|
|
2003
|
+
])), [[l, o.crud.getPermission("excelBtn")]]) : D("v-if", !0),
|
|
2004
|
+
o.optVal(o.crud.tableOption.printBtn, a.config.printBtn) ? G((R(), E(s, {
|
|
2005
|
+
key: 2,
|
|
2006
|
+
icon: o.crud.getBtnIcon("printBtn"),
|
|
2007
|
+
circle: "",
|
|
2008
|
+
size: o.crud.isMediumSize,
|
|
2009
|
+
onClick: o.rowPrint
|
|
2010
|
+
}, null, 8, [
|
|
2011
|
+
"icon",
|
|
2012
|
+
"size",
|
|
2013
|
+
"onClick"
|
|
2014
|
+
])), [[l, o.crud.getPermission("printBtn")]]) : D("v-if", !0),
|
|
2015
|
+
o.optVal(o.crud.tableOption.refreshBtn, a.config.refreshBtn) ? G((R(), E(s, {
|
|
2016
|
+
key: 3,
|
|
2017
|
+
icon: o.crud.getBtnIcon("refreshBtn"),
|
|
2018
|
+
circle: "",
|
|
2019
|
+
size: o.crud.isMediumSize,
|
|
2020
|
+
onClick: o.crud.refreshChange
|
|
2021
|
+
}, null, 8, [
|
|
2022
|
+
"icon",
|
|
2023
|
+
"size",
|
|
2024
|
+
"onClick"
|
|
2025
|
+
])), [[l, o.crud.getPermission("refreshBtn")]]) : D("v-if", !0),
|
|
2026
|
+
o.optVal(o.crud.tableOption.columnBtn, a.config.columnBtn) ? G((R(), E(s, {
|
|
2027
|
+
key: 4,
|
|
2028
|
+
icon: o.crud.getBtnIcon("columnBtn"),
|
|
2029
|
+
circle: "",
|
|
2030
|
+
size: o.crud.isMediumSize,
|
|
2031
|
+
onClick: t[0] || (t[0] = (e) => o.crud.$refs.dialogColumn.handleShow())
|
|
2032
|
+
}, null, 8, ["icon", "size"])), [[l, o.crud.getPermission("columnBtn")]]) : D("v-if", !0),
|
|
2033
|
+
(o.crud.$refs.headerSearch || {}).searchFlag && o.optVal(o.crud.tableOption.searchShowBtn, !0) ? (R(), E(s, {
|
|
2034
|
+
key: 5,
|
|
2035
|
+
icon: o.crud.getBtnIcon("searchBtn"),
|
|
2036
|
+
circle: "",
|
|
2037
|
+
size: o.crud.isMediumSize,
|
|
2038
|
+
onClick: t[1] || (t[1] = (e) => o.crud.$refs.headerSearch.handleSearchShow())
|
|
2039
|
+
}, null, 8, ["icon", "size"])) : D("v-if", !0),
|
|
2040
|
+
o.optVal(o.crud.tableOption.filterBtn, a.config.filterBtn) ? G((R(), E(s, {
|
|
2041
|
+
key: 6,
|
|
2042
|
+
icon: o.crud.getBtnIcon("filterBtn"),
|
|
2043
|
+
circle: "",
|
|
2044
|
+
size: o.crud.isMediumSize,
|
|
2045
|
+
onClick: t[2] || (t[2] = (e) => o.crud.$refs.dialogFilter.handleShow())
|
|
2046
|
+
}, null, 8, ["icon", "size"])), [[l, o.crud.getPermission("filterBtn")]]) : D("v-if", !0)
|
|
2047
|
+
])) : D("v-if", !0)]);
|
|
2048
|
+
}
|
|
2049
|
+
var sn = /* @__PURE__ */ t(tn, [["render", on]]), cn = {
|
|
2050
|
+
name: "HeaderSearch",
|
|
2051
|
+
mixins: [y],
|
|
2052
|
+
inject: {
|
|
2053
|
+
crud: { from: "crud" },
|
|
2054
|
+
AVUE: {
|
|
2055
|
+
from: r,
|
|
2056
|
+
default: null
|
|
2057
|
+
}
|
|
2058
|
+
},
|
|
2059
|
+
props: { search: Object },
|
|
2060
|
+
data() {
|
|
2061
|
+
return {
|
|
2062
|
+
show: !1,
|
|
2063
|
+
searchIndex: 2,
|
|
2064
|
+
searchShow: !0
|
|
2065
|
+
};
|
|
2066
|
+
},
|
|
2067
|
+
computed: {
|
|
2068
|
+
searchForm: {
|
|
2069
|
+
get() {
|
|
2070
|
+
return this.crud.search;
|
|
2071
|
+
},
|
|
2072
|
+
set(e) {
|
|
2073
|
+
this.crud.$emit("update:search", e);
|
|
2074
|
+
}
|
|
2075
|
+
},
|
|
2076
|
+
option() {
|
|
2077
|
+
let e = this.crud.option, t = (t = []) => {
|
|
2078
|
+
t = c(t);
|
|
2079
|
+
let n = [], r = 0;
|
|
2080
|
+
return t = t.sort((e, t) => (t.searchOrder || 0) - (e.searchOrder || 0)), t.forEach((t) => {
|
|
2081
|
+
if (t.search) {
|
|
2082
|
+
let i = r < this.searchIndex, a = {};
|
|
2083
|
+
Object.keys(t).forEach((e) => {
|
|
2084
|
+
let n = "search";
|
|
2085
|
+
if (e !== "searchProp" && e.includes(n)) {
|
|
2086
|
+
let r = e.replace(n, "");
|
|
2087
|
+
if (r.length === 0) return;
|
|
2088
|
+
r = r.replace(r[0], r[0].toLowerCase()), a[r] = t[e];
|
|
2089
|
+
}
|
|
2090
|
+
}), t = Object.assign(t, a, {
|
|
2091
|
+
type: oe(t),
|
|
2092
|
+
detail: !1,
|
|
2093
|
+
dicFlag: t.cascader ? !0 : h(t.dicFlag, !1),
|
|
2094
|
+
span: t.searchSpan || e.searchSpan || X.searchSpan,
|
|
2095
|
+
control: t.searchControl,
|
|
2096
|
+
gutter: t.searchGutter || e.searchGutter || X.searchGutter,
|
|
2097
|
+
labelWidth: t.searchLabelWidth || e.searchLabelWidth || X.searchLabelWidth,
|
|
2098
|
+
labelPosition: t.searchLabelPosition || e.searchLabelPosition,
|
|
2099
|
+
size: t.searchSize || e.searchSize,
|
|
2100
|
+
value: t.searchValue,
|
|
2101
|
+
rules: t.searchRules,
|
|
2102
|
+
row: t.searchRow,
|
|
2103
|
+
bind: t.searchBin,
|
|
2104
|
+
disabled: t.searchDisabled,
|
|
2105
|
+
readonly: t.searchReadonly,
|
|
2106
|
+
display: this.isSearchIcon ? this.show ? !0 : i : !0
|
|
2107
|
+
}), n.push(t), r += 1;
|
|
2108
|
+
}
|
|
2109
|
+
}), n;
|
|
2110
|
+
};
|
|
2111
|
+
return ((n) => {
|
|
2112
|
+
let r = c(n);
|
|
2113
|
+
return r.column = t(this.crud.propOption), r = Object.assign(r, {
|
|
2114
|
+
rowKey: e.searchRowKey || "null",
|
|
2115
|
+
tabs: !1,
|
|
2116
|
+
group: !1,
|
|
2117
|
+
printBtn: !1,
|
|
2118
|
+
mockBtn: !1,
|
|
2119
|
+
filterDic: e.searchFilterDic,
|
|
2120
|
+
filterNull: e.searchFilterNull,
|
|
2121
|
+
filterParam: e.searchFilterParam,
|
|
2122
|
+
enter: e.searchEnter,
|
|
2123
|
+
size: e.searchSize,
|
|
2124
|
+
submitText: e.searchBtnText || "搜 索",
|
|
2125
|
+
submitBtn: h(e.searchBtn, X.searchSubBtn),
|
|
2126
|
+
submitIcon: this.crud.getBtnIcon("searchBtn"),
|
|
2127
|
+
emptyText: e.emptyBtnText || "清 空",
|
|
2128
|
+
emptyBtn: h(e.emptyBtn, X.emptyBtn),
|
|
2129
|
+
emptyIcon: this.crud.getBtnIcon("emptyBtn"),
|
|
2130
|
+
menuSpan: this.show || !this.isSearchIcon || e.searchMenuSpan < 6 ? e.searchMenuSpan : 6,
|
|
2131
|
+
menuPosition: e.searchMenuPosition || "center",
|
|
2132
|
+
dicFlag: !1,
|
|
2133
|
+
dicData: this.crud.DIC
|
|
2134
|
+
}), r;
|
|
2135
|
+
})(e);
|
|
2136
|
+
},
|
|
2137
|
+
isSearchIcon() {
|
|
2138
|
+
var e;
|
|
2139
|
+
return h(this.crud.option.searchIcon, (e = this.AVUE) == null ? void 0 : e.searchIcon) && this.searchLen > this.searchIndex;
|
|
2140
|
+
},
|
|
2141
|
+
searchLen() {
|
|
2142
|
+
let e = 0;
|
|
2143
|
+
return this.crud.propOption.forEach((t) => {
|
|
2144
|
+
t.search && e++;
|
|
2145
|
+
}), e;
|
|
2146
|
+
},
|
|
2147
|
+
searchFlag() {
|
|
2148
|
+
return !!this.crud.$slots.search || this.searchLen !== 0;
|
|
2149
|
+
}
|
|
2150
|
+
},
|
|
2151
|
+
watch: {
|
|
2152
|
+
"crud.propOption": {
|
|
2153
|
+
handler() {
|
|
2154
|
+
this.dataFormat();
|
|
2155
|
+
},
|
|
2156
|
+
deep: !0
|
|
2157
|
+
},
|
|
2158
|
+
show() {
|
|
2159
|
+
this.crud.getTableHeight();
|
|
2160
|
+
},
|
|
2161
|
+
searchShow() {
|
|
2162
|
+
this.crud.getTableHeight();
|
|
2163
|
+
},
|
|
2164
|
+
option: {
|
|
2165
|
+
immediate: !0,
|
|
2166
|
+
deep: !0,
|
|
2167
|
+
handler() {
|
|
2168
|
+
var e;
|
|
2169
|
+
this.searchIndex = ((e = this.option) == null ? void 0 : e.searchIndex) || 2;
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
},
|
|
2173
|
+
created() {
|
|
2174
|
+
this.initFun(), this.dataFormat();
|
|
2175
|
+
},
|
|
2176
|
+
methods: {
|
|
2177
|
+
initFun() {
|
|
2178
|
+
["searchReset", "searchChange"].forEach((e) => {
|
|
2179
|
+
this.crud[e] = this[e];
|
|
2180
|
+
});
|
|
2181
|
+
},
|
|
2182
|
+
getSlotName(e) {
|
|
2183
|
+
return e.replace("Search", "");
|
|
2184
|
+
},
|
|
2185
|
+
searchChange(e, t) {
|
|
2186
|
+
e = u(e), this.crud.propOption.forEach((t) => {
|
|
2187
|
+
t.searchProp && (e[t.searchProp] = e[t.prop], delete e[t.prop]);
|
|
2188
|
+
}), this.crud.$emit("search-change", e, t);
|
|
2189
|
+
},
|
|
2190
|
+
resetChange() {
|
|
2191
|
+
this.crud.$emit("search-reset", this.searchForm);
|
|
2192
|
+
},
|
|
2193
|
+
searchReset() {
|
|
2194
|
+
this.$refs.form.resetForm();
|
|
2195
|
+
},
|
|
2196
|
+
handleSearchShow() {
|
|
2197
|
+
this.searchShow = !this.searchShow;
|
|
2198
|
+
},
|
|
2199
|
+
dataFormat() {
|
|
2200
|
+
let e = this.crud.option;
|
|
2201
|
+
this.searchShow = h(e.searchShow, X.searchShow);
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
};
|
|
2205
|
+
function ln(e, t, n, r, a, o) {
|
|
2206
|
+
let s = i, c = $, l = Ie;
|
|
2207
|
+
return o.searchFlag ? G((R(), E(l, {
|
|
2208
|
+
key: 0,
|
|
2209
|
+
shadow: o.crud.isCard,
|
|
2210
|
+
class: "avue-crud__search"
|
|
2211
|
+
}, {
|
|
2212
|
+
default: W(() => [B(e.$slots, "search", {
|
|
2213
|
+
row: o.searchForm,
|
|
2214
|
+
search: o.searchForm,
|
|
2215
|
+
size: o.crud.controlSize
|
|
2216
|
+
}), M(c, {
|
|
2217
|
+
ref: "form",
|
|
2218
|
+
modelValue: o.searchForm,
|
|
2219
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => o.searchForm = e),
|
|
2220
|
+
option: o.option,
|
|
2221
|
+
onSubmit: o.searchChange,
|
|
2222
|
+
onResetChange: o.resetChange
|
|
2223
|
+
}, {
|
|
2224
|
+
menuForm: W((n) => [B(e.$slots, "searchMenu", I(N(Object.assign(n, {
|
|
2225
|
+
search: o.searchForm,
|
|
2226
|
+
row: o.searchForm
|
|
2227
|
+
})))), o.isSearchIcon ? (R(), O(T, { key: 0 }, [a.show === !1 ? (R(), E(s, {
|
|
2228
|
+
key: 0,
|
|
2229
|
+
text: "",
|
|
2230
|
+
icon: "el-icon-arrow-down",
|
|
2231
|
+
onClick: t[0] || (t[0] = (e) => a.show = !0)
|
|
2232
|
+
}, {
|
|
2233
|
+
default: W(() => [...t[3] || (t[3] = [j("展 开", -1)])]),
|
|
2234
|
+
_: 1
|
|
2235
|
+
})) : D("v-if", !0), a.show === !0 ? (R(), E(s, {
|
|
2236
|
+
key: 1,
|
|
2237
|
+
text: "",
|
|
2238
|
+
icon: "el-icon-arrow-up",
|
|
2239
|
+
onClick: t[1] || (t[1] = (e) => a.show = !1)
|
|
2240
|
+
}, {
|
|
2241
|
+
default: W(() => [...t[4] || (t[4] = [j("收 缩", -1)])]),
|
|
2242
|
+
_: 1
|
|
2243
|
+
})) : D("v-if", !0)], 64)) : D("v-if", !0)]),
|
|
2244
|
+
default: W(() => [(R(!0), O(T, null, z(o.crud.searchSlot, (t) => B(e.$slots, t, P({ ref_for: !0 }, Object.assign(e.scope, {
|
|
2245
|
+
search: o.searchForm,
|
|
2246
|
+
row: o.searchForm
|
|
2247
|
+
})))), 256))]),
|
|
2248
|
+
_: 3
|
|
2249
|
+
}, 8, [
|
|
2250
|
+
"modelValue",
|
|
2251
|
+
"option",
|
|
2252
|
+
"onSubmit",
|
|
2253
|
+
"onResetChange"
|
|
2254
|
+
])]),
|
|
2255
|
+
_: 3
|
|
2256
|
+
}, 8, ["shadow"])), [[rt, a.searchShow && o.searchFlag]]) : D("v-if", !0);
|
|
2257
|
+
}
|
|
2258
|
+
var un = /* @__PURE__ */ t(cn, [["render", ln]]), dn = {
|
|
2259
|
+
mixins: [y],
|
|
2260
|
+
inject: { AVUE: {
|
|
2261
|
+
from: r,
|
|
2262
|
+
default: null
|
|
2263
|
+
} },
|
|
2264
|
+
props: {
|
|
2265
|
+
defaults: {
|
|
2266
|
+
type: Object,
|
|
2267
|
+
default() {
|
|
2268
|
+
return {};
|
|
2269
|
+
}
|
|
2270
|
+
},
|
|
2271
|
+
option: {
|
|
2272
|
+
type: Object,
|
|
2273
|
+
required: !0,
|
|
2274
|
+
default: () => ({})
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
watch: {
|
|
2278
|
+
defaults: {
|
|
2279
|
+
handler(e) {
|
|
2280
|
+
this.objectOption = e;
|
|
2281
|
+
},
|
|
2282
|
+
deep: !0
|
|
2283
|
+
},
|
|
2284
|
+
objectOption: {
|
|
2285
|
+
handler(e) {
|
|
2286
|
+
this.$emit("update:defaults", e);
|
|
2287
|
+
},
|
|
2288
|
+
deep: !0
|
|
2289
|
+
},
|
|
2290
|
+
propOption: {
|
|
2291
|
+
handler(e) {
|
|
2292
|
+
let t = {};
|
|
2293
|
+
e.forEach((e) => {
|
|
2294
|
+
t[e.prop] = e;
|
|
2295
|
+
}), this.objectOption = t;
|
|
2296
|
+
},
|
|
2297
|
+
deep: !0
|
|
2298
|
+
},
|
|
2299
|
+
option: {
|
|
2300
|
+
handler() {
|
|
2301
|
+
this.init(!1);
|
|
2302
|
+
},
|
|
2303
|
+
deep: !0
|
|
2304
|
+
}
|
|
2305
|
+
},
|
|
2306
|
+
data() {
|
|
2307
|
+
return {
|
|
2308
|
+
DIC: {},
|
|
2309
|
+
cascaderDIC: {},
|
|
2310
|
+
tableOption: {},
|
|
2311
|
+
isMobile: "",
|
|
2312
|
+
objectOption: {}
|
|
2313
|
+
};
|
|
2314
|
+
},
|
|
2315
|
+
created() {
|
|
2316
|
+
this.init();
|
|
2317
|
+
},
|
|
2318
|
+
computed: {
|
|
2319
|
+
resultOption() {
|
|
2320
|
+
return Object.assign(c(this.tableOption), { column: this.propOption });
|
|
2321
|
+
},
|
|
2322
|
+
rowKey() {
|
|
2323
|
+
return this.tableOption.rowKey || a.rowKey;
|
|
2324
|
+
},
|
|
2325
|
+
formRules() {
|
|
2326
|
+
let e = {};
|
|
2327
|
+
return this.propOption.forEach((t) => {
|
|
2328
|
+
t.rules && t.display !== !1 && (e[t.prop] = t.rules);
|
|
2329
|
+
}), e;
|
|
2330
|
+
},
|
|
2331
|
+
isMediumSize() {
|
|
2332
|
+
return this.controlSize;
|
|
2333
|
+
},
|
|
2334
|
+
controlSize() {
|
|
2335
|
+
var e;
|
|
2336
|
+
return this.tableOption.size || ((e = this.AVUE) == null ? void 0 : e.size);
|
|
2337
|
+
}
|
|
2338
|
+
},
|
|
2339
|
+
methods: {
|
|
2340
|
+
init(e) {
|
|
2341
|
+
this.tableOption = this.option, this.getIsMobile(), this.handleLocalDic(), e !== !1 && this.handleLoadDic();
|
|
2342
|
+
},
|
|
2343
|
+
dicInit(e) {
|
|
2344
|
+
e === "cascader" ? this.handleLoadCascaderDic() : this.handleLoadDic();
|
|
2345
|
+
},
|
|
2346
|
+
getIsMobile() {
|
|
2347
|
+
this.isMobile = document.body.clientWidth <= 768;
|
|
2348
|
+
},
|
|
2349
|
+
updateDic(e, t) {
|
|
2350
|
+
let n = this.findObject(this.propOption, e);
|
|
2351
|
+
q(t) && q(e) ? this.handleLoadDic() : q(t) && !q(n.dicUrl) ? b({ column: n }).then((t) => {
|
|
2352
|
+
this.DIC[e] = t;
|
|
2353
|
+
}) : this.DIC[e] = t;
|
|
2354
|
+
},
|
|
2355
|
+
handleSetDic(e, t = {}) {
|
|
2356
|
+
Object.keys(t).forEach((n) => {
|
|
2357
|
+
e[n] = t[n];
|
|
2358
|
+
});
|
|
2359
|
+
},
|
|
2360
|
+
handleLocalDic() {
|
|
2361
|
+
this.handleSetDic(this.DIC, _e(this.resultOption));
|
|
2362
|
+
},
|
|
2363
|
+
handleLoadDic() {
|
|
2364
|
+
ye(this.resultOption).then((e) => this.handleSetDic(this.DIC, e));
|
|
2365
|
+
},
|
|
2366
|
+
handleLoadCascaderDic() {
|
|
2367
|
+
ve(this.propOption, this.data).then((e) => this.handleSetDic(this.cascaderDIC, e));
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}, fn = {
|
|
2371
|
+
name: "FyCurd",
|
|
2372
|
+
directives: { permission: Q },
|
|
2373
|
+
mixins: [dn],
|
|
2374
|
+
provide() {
|
|
2375
|
+
return { crud: this };
|
|
2376
|
+
},
|
|
2377
|
+
props: {
|
|
2378
|
+
spanMethod: Function,
|
|
2379
|
+
summaryMethod: Function,
|
|
2380
|
+
rowStyle: Function,
|
|
2381
|
+
cellStyle: Function,
|
|
2382
|
+
beforeClose: Function,
|
|
2383
|
+
beforeOpen: Function,
|
|
2384
|
+
rowClassName: Function,
|
|
2385
|
+
cellClassName: Function,
|
|
2386
|
+
headerCellClassName: Function,
|
|
2387
|
+
uploadBefore: Function,
|
|
2388
|
+
uploadAfter: Function,
|
|
2389
|
+
uploadDelete: Function,
|
|
2390
|
+
uploadPreview: Function,
|
|
2391
|
+
uploadError: Function,
|
|
2392
|
+
uploadExceed: Function,
|
|
2393
|
+
permission: {
|
|
2394
|
+
type: [Function, Object],
|
|
2395
|
+
default: () => ({})
|
|
2396
|
+
},
|
|
2397
|
+
modelValue: {
|
|
2398
|
+
type: Object,
|
|
2399
|
+
default: () => ({})
|
|
2400
|
+
},
|
|
2401
|
+
search: {
|
|
2402
|
+
type: Object,
|
|
2403
|
+
default() {
|
|
2404
|
+
return {};
|
|
2405
|
+
}
|
|
2406
|
+
},
|
|
2407
|
+
page: {
|
|
2408
|
+
type: Object,
|
|
2409
|
+
default() {
|
|
2410
|
+
return {};
|
|
2411
|
+
}
|
|
2412
|
+
},
|
|
2413
|
+
tableLoading: {
|
|
2414
|
+
type: Boolean,
|
|
2415
|
+
default: !1
|
|
2416
|
+
},
|
|
2417
|
+
disabled: {
|
|
2418
|
+
type: Boolean,
|
|
2419
|
+
default: !1
|
|
2420
|
+
},
|
|
2421
|
+
data: {
|
|
2422
|
+
type: Array,
|
|
2423
|
+
default: () => []
|
|
2424
|
+
}
|
|
2425
|
+
},
|
|
2426
|
+
emits: [
|
|
2427
|
+
"tree-load",
|
|
2428
|
+
"selection-clear",
|
|
2429
|
+
"header-dragend",
|
|
2430
|
+
"expand-change",
|
|
2431
|
+
"current-row-change",
|
|
2432
|
+
"refresh-change",
|
|
2433
|
+
"selection-change",
|
|
2434
|
+
"select",
|
|
2435
|
+
"select-all",
|
|
2436
|
+
"filter-change",
|
|
2437
|
+
"sort-change",
|
|
2438
|
+
"row-dblclick",
|
|
2439
|
+
"row-click",
|
|
2440
|
+
"cell-mouse-enter",
|
|
2441
|
+
"cell-mouse-leave",
|
|
2442
|
+
"cell-click",
|
|
2443
|
+
"header-click",
|
|
2444
|
+
"row-contextmenu",
|
|
2445
|
+
"header-contextmenu",
|
|
2446
|
+
"cell-dblclick",
|
|
2447
|
+
"row-save",
|
|
2448
|
+
"row-update",
|
|
2449
|
+
"update:modelValue",
|
|
2450
|
+
"change",
|
|
2451
|
+
"row-del"
|
|
2452
|
+
],
|
|
2453
|
+
data() {
|
|
2454
|
+
return {
|
|
2455
|
+
reload: Math.random(),
|
|
2456
|
+
cellForm: { list: [] },
|
|
2457
|
+
config: X,
|
|
2458
|
+
list: [],
|
|
2459
|
+
listError: {},
|
|
2460
|
+
tableForm: {},
|
|
2461
|
+
tableHeight: void 0,
|
|
2462
|
+
tableIndex: -1,
|
|
2463
|
+
tableSelect: [],
|
|
2464
|
+
sumsList: {},
|
|
2465
|
+
cascaderIndexList: [],
|
|
2466
|
+
cascaderDicList: {},
|
|
2467
|
+
cascaderFormList: {},
|
|
2468
|
+
btnDisabledList: {},
|
|
2469
|
+
btnDisabled: !1,
|
|
2470
|
+
default: {}
|
|
2471
|
+
};
|
|
2472
|
+
},
|
|
2473
|
+
computed: {
|
|
2474
|
+
isHeightAuto() {
|
|
2475
|
+
return this.tableOption.height === "auto";
|
|
2476
|
+
},
|
|
2477
|
+
isSortable() {
|
|
2478
|
+
return this.tableOption.sortable;
|
|
2479
|
+
},
|
|
2480
|
+
isRowSort() {
|
|
2481
|
+
return this.tableOption.rowSort;
|
|
2482
|
+
},
|
|
2483
|
+
isColumnSort() {
|
|
2484
|
+
return this.tableOption.columnSort;
|
|
2485
|
+
},
|
|
2486
|
+
rowParentKey() {
|
|
2487
|
+
return this.option.rowParentKey || a.rowParentKey;
|
|
2488
|
+
},
|
|
2489
|
+
childrenKey() {
|
|
2490
|
+
return this.treeProps.children || a.children;
|
|
2491
|
+
},
|
|
2492
|
+
hasChildrenKey() {
|
|
2493
|
+
return this.treeProps.hasChildren || a.hasChildren;
|
|
2494
|
+
},
|
|
2495
|
+
treeProps() {
|
|
2496
|
+
return this.tableOption.treeProps || {};
|
|
2497
|
+
},
|
|
2498
|
+
isAutoHeight() {
|
|
2499
|
+
return this.tableOption.height === "auto";
|
|
2500
|
+
},
|
|
2501
|
+
formSlot() {
|
|
2502
|
+
return this.getSlotList([
|
|
2503
|
+
"Error",
|
|
2504
|
+
"Label",
|
|
2505
|
+
"Type",
|
|
2506
|
+
"Form"
|
|
2507
|
+
], this.$slots, this.propOption);
|
|
2508
|
+
},
|
|
2509
|
+
searchSlot() {
|
|
2510
|
+
return this.getSlotList(["Search"], this.$slots, this.propOption);
|
|
2511
|
+
},
|
|
2512
|
+
mainSlot() {
|
|
2513
|
+
let e = [];
|
|
2514
|
+
return this.propOption.forEach((t) => {
|
|
2515
|
+
this.$slots[t.prop] && e.push(t.prop);
|
|
2516
|
+
}), this.getSlotList(["Header", "Form"], this.$slots, this.propOption).concat(e);
|
|
2517
|
+
},
|
|
2518
|
+
calcHeight() {
|
|
2519
|
+
var e;
|
|
2520
|
+
return (this.tableOption.calcHeight || 0) + ((e = this.AVUE) == null ? void 0 : e.calcHeight);
|
|
2521
|
+
},
|
|
2522
|
+
propOption() {
|
|
2523
|
+
let e = [];
|
|
2524
|
+
function t(n = []) {
|
|
2525
|
+
Array.isArray(n) && n.forEach((n) => {
|
|
2526
|
+
Array.isArray(n.children) ? t(n.children) : e.push(n);
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
return t(this.columnOption), e = ae(e), e;
|
|
2530
|
+
},
|
|
2531
|
+
isShowSummary() {
|
|
2532
|
+
return this.option.showSummary;
|
|
2533
|
+
},
|
|
2534
|
+
isHeader() {
|
|
2535
|
+
let e = !1;
|
|
2536
|
+
return this.columnOption.forEach((t) => {
|
|
2537
|
+
t.children && (e = !0);
|
|
2538
|
+
}), e;
|
|
2539
|
+
},
|
|
2540
|
+
isTree() {
|
|
2541
|
+
let e = !1;
|
|
2542
|
+
return this.data.forEach((t) => {
|
|
2543
|
+
t.children && (e = !0);
|
|
2544
|
+
}), e;
|
|
2545
|
+
},
|
|
2546
|
+
isCard() {
|
|
2547
|
+
return this.option.card ? "always" : "never";
|
|
2548
|
+
},
|
|
2549
|
+
expandLevel() {
|
|
2550
|
+
return this.parentOption.expandLevel || 0;
|
|
2551
|
+
},
|
|
2552
|
+
expandAll() {
|
|
2553
|
+
return this.parentOption.expandAll || !1;
|
|
2554
|
+
},
|
|
2555
|
+
parentOption() {
|
|
2556
|
+
return this.tableOption || {};
|
|
2557
|
+
},
|
|
2558
|
+
columnOption() {
|
|
2559
|
+
return this.tableOption.column || [];
|
|
2560
|
+
},
|
|
2561
|
+
sumColumnList() {
|
|
2562
|
+
return this.tableOption.sumColumnList || [];
|
|
2563
|
+
},
|
|
2564
|
+
selectLen() {
|
|
2565
|
+
return this.tableSelect ? this.tableSelect.length : 0;
|
|
2566
|
+
}
|
|
2567
|
+
},
|
|
2568
|
+
watch: {
|
|
2569
|
+
modelValue: {
|
|
2570
|
+
handler() {
|
|
2571
|
+
this.tableForm = this.modelValue;
|
|
2572
|
+
},
|
|
2573
|
+
immediate: !0,
|
|
2574
|
+
deep: !0
|
|
2575
|
+
},
|
|
2576
|
+
list: {
|
|
2577
|
+
handler() {
|
|
2578
|
+
this.cellForm.list = this.list;
|
|
2579
|
+
},
|
|
2580
|
+
deep: !0
|
|
2581
|
+
},
|
|
2582
|
+
data: {
|
|
2583
|
+
handler() {
|
|
2584
|
+
this.dataInit();
|
|
2585
|
+
},
|
|
2586
|
+
deep: !0
|
|
2587
|
+
}
|
|
2588
|
+
},
|
|
2589
|
+
mounted() {
|
|
2590
|
+
this.dataInit(), this.getTableHeight(), this.refreshTable();
|
|
2591
|
+
},
|
|
2592
|
+
methods: {
|
|
2593
|
+
setPx: f,
|
|
2594
|
+
optVal: h,
|
|
2595
|
+
handleValidate(e, t, n) {
|
|
2596
|
+
this.listError[e] || (this.listError[e] = {
|
|
2597
|
+
valid: !1,
|
|
2598
|
+
msg: ""
|
|
2599
|
+
}), this.listError[e].valid = !t, this.listError[e].msg = n;
|
|
2600
|
+
},
|
|
2601
|
+
getPermission(e, t, n) {
|
|
2602
|
+
return typeof this.permission == "function" ? this.permission(e, t, n) : q(this.permission[e]) ? !0 : this.permission[e];
|
|
2603
|
+
},
|
|
2604
|
+
getTableHeight() {
|
|
2605
|
+
this.isAutoHeight ? this.$nextTick(() => {
|
|
2606
|
+
let e = this.$refs.table, t = this.$refs.tablePage;
|
|
2607
|
+
if (!e) return;
|
|
2608
|
+
let n = e.$el, r = t.$el.offsetHeight || 20;
|
|
2609
|
+
this.tableHeight = document.documentElement.clientHeight - n.offsetTop - r - this.calcHeight;
|
|
2610
|
+
}) : this.tableHeight = this.tableOption.height;
|
|
2611
|
+
},
|
|
2612
|
+
doLayout() {
|
|
2613
|
+
this.$refs.table.doLayout();
|
|
2614
|
+
},
|
|
2615
|
+
refreshTable(e) {
|
|
2616
|
+
this.reload = Math.random(), this.$nextTick(() => {
|
|
2617
|
+
e == null || e();
|
|
2618
|
+
});
|
|
2619
|
+
},
|
|
2620
|
+
treeLoad(e, t, n) {
|
|
2621
|
+
this.$emit("tree-load", e, t, (t) => {
|
|
2622
|
+
e.children = t, n(t);
|
|
2623
|
+
});
|
|
2624
|
+
},
|
|
2625
|
+
menuIcon(e) {
|
|
2626
|
+
return h(this.tableOption[`${e}Text`], de(`crud.${e}`));
|
|
2627
|
+
},
|
|
2628
|
+
getBtnIcon(e) {
|
|
2629
|
+
let t = `${e}Icon`;
|
|
2630
|
+
return this.tableOption[t] || X[t];
|
|
2631
|
+
},
|
|
2632
|
+
validateField(e) {
|
|
2633
|
+
return this.$refs.dialogForm.$refs.tableForm.validateField(e);
|
|
2634
|
+
},
|
|
2635
|
+
selectClear() {
|
|
2636
|
+
this.$emit("selection-clear", c(this.tableSelect)), this.$refs.table.clearSelection();
|
|
2637
|
+
},
|
|
2638
|
+
toggleRowSelection(e, t) {
|
|
2639
|
+
this.$refs.table.toggleRowSelection(e, t);
|
|
2640
|
+
},
|
|
2641
|
+
toggleRowExpansion(e, t) {
|
|
2642
|
+
this.$refs.table.toggleRowExpansion(e, t);
|
|
2643
|
+
},
|
|
2644
|
+
setCurrentRow(e) {
|
|
2645
|
+
this.$refs.table.setCurrentRow(e);
|
|
2646
|
+
},
|
|
2647
|
+
dataInit() {
|
|
2648
|
+
this.list = this.data, this.list.forEach((e, t) => {
|
|
2649
|
+
e.$cellEdit && !this.cascaderFormList[t] && (this.cascaderFormList[t] = c(e)), e.$cellEdit = e.$cellEdit || !1, e.$index = t;
|
|
2650
|
+
});
|
|
2651
|
+
},
|
|
2652
|
+
headerDragend(e, t, n, r) {
|
|
2653
|
+
this.objectOption[n.property] && (this.objectOption[n.property].width = e), this.$emit("header-dragend", e, t, n, r);
|
|
2654
|
+
},
|
|
2655
|
+
headerSort(e, t) {
|
|
2656
|
+
let n = this.columnOption, r = n.splice(e, 1)[0];
|
|
2657
|
+
n.splice(t, 0, r), this.refreshTable();
|
|
2658
|
+
},
|
|
2659
|
+
clearFilter(e) {
|
|
2660
|
+
this.$refs.table.clearFilter(e);
|
|
2661
|
+
},
|
|
2662
|
+
expandChange(e, t) {
|
|
2663
|
+
this.$emit("expand-change", e, t);
|
|
2664
|
+
},
|
|
2665
|
+
currentRowChange(e, t) {
|
|
2666
|
+
this.$emit("current-row-change", e, t);
|
|
2667
|
+
},
|
|
2668
|
+
refreshChange() {
|
|
2669
|
+
this.$emit("refresh-change");
|
|
2670
|
+
},
|
|
2671
|
+
toggleSelection(e) {
|
|
2672
|
+
e ? e.forEach((e) => {
|
|
2673
|
+
this.$refs.table.toggleRowSelection(e);
|
|
2674
|
+
}) : this.$refs.table.clearSelection();
|
|
2675
|
+
},
|
|
2676
|
+
selectionChange(e) {
|
|
2677
|
+
this.tableSelect = e, this.$emit("selection-change", this.tableSelect);
|
|
2678
|
+
},
|
|
2679
|
+
select(e, t) {
|
|
2680
|
+
this.$emit("select", e, t);
|
|
2681
|
+
},
|
|
2682
|
+
selectAll(e) {
|
|
2683
|
+
this.$emit("select-all", e);
|
|
2684
|
+
},
|
|
2685
|
+
filterChange(e) {
|
|
2686
|
+
this.$emit("filter-change", e);
|
|
2687
|
+
},
|
|
2688
|
+
sortChange(e) {
|
|
2689
|
+
this.$emit("sort-change", e);
|
|
2690
|
+
},
|
|
2691
|
+
rowDblclick(e, t) {
|
|
2692
|
+
this.$emit("row-dblclick", e, t);
|
|
2693
|
+
},
|
|
2694
|
+
rowClick(e, t, n) {
|
|
2695
|
+
this.$emit("row-click", e, t, n);
|
|
2696
|
+
},
|
|
2697
|
+
clearSort() {
|
|
2698
|
+
this.$refs.table.clearSort();
|
|
2699
|
+
},
|
|
2700
|
+
cellMouseEnter(e, t, n, r) {
|
|
2701
|
+
this.$emit("cell-mouse-enter", e, t, n, r);
|
|
2702
|
+
},
|
|
2703
|
+
cellMouseLeave(e, t, n, r) {
|
|
2704
|
+
this.$emit("cell-mouse-leave", e, t, n, r);
|
|
2705
|
+
},
|
|
2706
|
+
cellClick(e, t, n, r) {
|
|
2707
|
+
this.$emit("cell-click", e, t, n, r);
|
|
2708
|
+
},
|
|
2709
|
+
headerClick(e, t) {
|
|
2710
|
+
this.$emit("header-click", e, t);
|
|
2711
|
+
},
|
|
2712
|
+
rowContextmenu(e, t, n) {
|
|
2713
|
+
this.$emit("row-contextmenu", e, t, n);
|
|
2714
|
+
},
|
|
2715
|
+
headerContextmenu(e, t) {
|
|
2716
|
+
this.$emit("header-contextmenu", e, t);
|
|
2717
|
+
},
|
|
2718
|
+
cellDblclick(e, t, n, r) {
|
|
2719
|
+
this.$emit("cell-dblclick", e, t, n, r);
|
|
2720
|
+
},
|
|
2721
|
+
rowCellAdd(e = {}) {
|
|
2722
|
+
let t = this.list.length, n = ce(this.propOption).tableForm;
|
|
2723
|
+
e = c({
|
|
2724
|
+
$cellEdit: !0,
|
|
2725
|
+
$index: t,
|
|
2726
|
+
...n,
|
|
2727
|
+
...e
|
|
2728
|
+
}), this.list.push(e);
|
|
2729
|
+
},
|
|
2730
|
+
rowCancel(e, t) {
|
|
2731
|
+
q(e[this.rowKey]) ? (this.list.splice(t, 1), delete this.cascaderDIC[t]) : (this.cascaderFormList[t].$cellEdit = !1, this.cascaderDIC[t] = this.cascaderDicList[t], this.list[t] = this.cascaderFormList[t]), delete this.cascaderDicList[t], delete this.cascaderFormList[t], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1);
|
|
2732
|
+
},
|
|
2733
|
+
rowCell(e, t) {
|
|
2734
|
+
e.$cellEdit ? this.rowCellUpdate(e, t) : this.rowCellEdit(e, t);
|
|
2735
|
+
},
|
|
2736
|
+
rowCellUpdate(e, t) {
|
|
2737
|
+
e = c(e);
|
|
2738
|
+
let n = this.validateCellField(t), r = () => {
|
|
2739
|
+
this.btnDisabledList[t] = !1, this.btnDisabled = !1, this.list[t].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1), delete this.cascaderFormList[t];
|
|
2740
|
+
}, i = () => {
|
|
2741
|
+
this.btnDisabledList[t] = !1, this.btnDisabled = !1;
|
|
2742
|
+
};
|
|
2743
|
+
n && (this.btnDisabledList[t] = !0, this.btnDisabled = !0, q(e[this.rowKey]) ? this.$emit("row-save", e, r, i) : this.$emit("row-update", e, t, r, i));
|
|
2744
|
+
},
|
|
2745
|
+
rowCellEdit(e, t) {
|
|
2746
|
+
e.$cellEdit = !0, this.cascaderFormList[t] = c(e), this.cascaderDicList[t] = c(this.cascaderDIC[t]);
|
|
2747
|
+
},
|
|
2748
|
+
validateCellForm() {
|
|
2749
|
+
return new Promise((e) => {
|
|
2750
|
+
this.$refs.cellForm.validate((t, n) => {
|
|
2751
|
+
e(n);
|
|
2752
|
+
});
|
|
2753
|
+
});
|
|
2754
|
+
},
|
|
2755
|
+
validateCellField(e) {
|
|
2756
|
+
let t = !0;
|
|
2757
|
+
for (let n of this.$refs.cellForm.fields) if (n.prop.split(".")[1] === `${e}` && this.$refs.cellForm.validateField(n.prop, (e) => {
|
|
2758
|
+
e && (t = !1);
|
|
2759
|
+
}), !t) break;
|
|
2760
|
+
return t;
|
|
2761
|
+
},
|
|
2762
|
+
rowAdd() {
|
|
2763
|
+
this.$refs.dialogForm.show("add");
|
|
2764
|
+
},
|
|
2765
|
+
rowSave() {
|
|
2766
|
+
return this.$refs.dialogForm.$refs.tableForm.submit();
|
|
2767
|
+
},
|
|
2768
|
+
rowUpdate() {
|
|
2769
|
+
return this.$refs.dialogForm.$refs.tableForm.submit();
|
|
2770
|
+
},
|
|
2771
|
+
closeDialog() {
|
|
2772
|
+
return this.$refs.dialogForm.closeDialog();
|
|
2773
|
+
},
|
|
2774
|
+
getPropRef(e) {
|
|
2775
|
+
return this.$refs.dialogForm.$refs.tableForm.getPropRef(e);
|
|
2776
|
+
},
|
|
2777
|
+
setVal() {
|
|
2778
|
+
this.$emit("update:modelValue", this.tableForm), this.$emit("change", this.tableForm);
|
|
2779
|
+
},
|
|
2780
|
+
rowEdit(e, t) {
|
|
2781
|
+
this.tableForm = c(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("edit");
|
|
2782
|
+
},
|
|
2783
|
+
rowCopy(e) {
|
|
2784
|
+
this.tableForm = c(e), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
|
|
2785
|
+
},
|
|
2786
|
+
rowView(e, t) {
|
|
2787
|
+
this.tableForm = c(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("view");
|
|
2788
|
+
},
|
|
2789
|
+
rowDel(e, t) {
|
|
2790
|
+
this.$emit("row-del", e, t, () => {
|
|
2791
|
+
let { parentList: t, index: n } = this.findData(e[this.rowKey]);
|
|
2792
|
+
t && t.splice(n, 1);
|
|
2793
|
+
});
|
|
2794
|
+
},
|
|
2795
|
+
tableSpanMethod(e) {
|
|
2796
|
+
if (typeof this.spanMethod == "function") return this.spanMethod(e);
|
|
2797
|
+
},
|
|
2798
|
+
tableSummaryMethod(e) {
|
|
2799
|
+
let t = {};
|
|
2800
|
+
if (typeof this.summaryMethod == "function") return this.summaryMethod(e);
|
|
2801
|
+
let { columns: n, data: r } = e, i = [];
|
|
2802
|
+
return n.length > 0 && n.forEach((e, n) => {
|
|
2803
|
+
let a = this.sumColumnList.find((t) => t.name === e.property);
|
|
2804
|
+
if (a) {
|
|
2805
|
+
let o = a.decimals || 2, s = a.label || "", c = 1;
|
|
2806
|
+
switch (a.type) {
|
|
2807
|
+
case "count":
|
|
2808
|
+
i[n] = s + r.length;
|
|
2809
|
+
break;
|
|
2810
|
+
case "avg":
|
|
2811
|
+
i[n] = r.map((t) => Number(t[e.property])).reduce((e, t) => {
|
|
2812
|
+
let n = Number(t);
|
|
2813
|
+
return isNaN(n) ? e : (e * (c - 1) + t) / c++;
|
|
2814
|
+
}, 0), i[n] = s + i[n].toFixed(o);
|
|
2815
|
+
break;
|
|
2816
|
+
case "sum":
|
|
2817
|
+
i[n] = r.map((t) => Number(t[e.property])).reduce((e, t) => {
|
|
2818
|
+
let n = Number(t);
|
|
2819
|
+
return isNaN(n) ? e : e + t;
|
|
2820
|
+
}, 0), i[n] = s + i[n].toFixed(o);
|
|
2821
|
+
break;
|
|
2822
|
+
}
|
|
2823
|
+
t[e.property] = i[n];
|
|
2824
|
+
} else i[n] = "";
|
|
2825
|
+
}), this.sumsList = t, i;
|
|
2826
|
+
},
|
|
2827
|
+
tableDrop(e, t, n) {
|
|
2828
|
+
if (!(this.isSortable !== !0 && (e === "row" && !this.isRowSort || e === "column" && !this.isColumnSort))) {
|
|
2829
|
+
if (!window.Sortable) {
|
|
2830
|
+
xe.logs("Sortable");
|
|
2831
|
+
return;
|
|
2832
|
+
}
|
|
2833
|
+
window.Sortable.create(t, {
|
|
2834
|
+
ghostClass: X.ghostClass,
|
|
2835
|
+
chosenClass: X.ghostClass,
|
|
2836
|
+
animation: 500,
|
|
2837
|
+
delay: 0,
|
|
2838
|
+
onEnd: (e) => n(e)
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
},
|
|
2842
|
+
findData(e) {
|
|
2843
|
+
let t = {}, n = (r, i) => {
|
|
2844
|
+
r.forEach((a, o) => {
|
|
2845
|
+
a[this.rowKey] === e && (t = {
|
|
2846
|
+
item: a,
|
|
2847
|
+
index: o,
|
|
2848
|
+
parentList: r,
|
|
2849
|
+
parent: i
|
|
2850
|
+
}), a[this.childrenKey] && n(a[this.childrenKey], a);
|
|
2851
|
+
});
|
|
2852
|
+
};
|
|
2853
|
+
return n(this.list), t;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
}, pn = { class: "avue-crud avue-crud--card" }, mn = { class: "avue-crud__tip-name" }, hn = { class: "avue-crud__tip-count" };
|
|
2857
|
+
function gn(e, t, n, r, a, o) {
|
|
2858
|
+
let s = un, c = sn, l = i, u = Qe, d = en, f = Zt, p = Jt, m = Ue, h = Xe, g = We, ee = Mt, te = kt, _ = Et, ne = St, re = _t, ie = V("permission"), v = Ke;
|
|
2859
|
+
return R(), O("div", pn, [
|
|
2860
|
+
e.tableOption.title ? (R(), E(H(e.tableOption.titleSize || "h2"), {
|
|
2861
|
+
key: 0,
|
|
2862
|
+
style: L(e.tableOption.titleStyle)
|
|
2863
|
+
}, {
|
|
2864
|
+
default: W(() => [j(U(e.tableOption.title), 1)]),
|
|
2865
|
+
_: 1
|
|
2866
|
+
}, 8, ["style"])) : D("v-if", !0),
|
|
2867
|
+
D(" 搜索组件 "),
|
|
2868
|
+
M(s, { ref: "headerSearch" }, A({
|
|
2869
|
+
search: W((t) => [B(e.$slots, "search", I(N(t)))]),
|
|
2870
|
+
searchMenu: W((t) => [B(e.$slots, "searchMenu", I(N(t)))]),
|
|
2871
|
+
_: 2
|
|
2872
|
+
}, [z(o.searchSlot, (t) => ({
|
|
2873
|
+
name: t,
|
|
2874
|
+
fn: W((n) => [B(e.$slots, t, I(N(n)))])
|
|
2875
|
+
}))]), 1536),
|
|
2876
|
+
D(" 表格功能列 "),
|
|
2877
|
+
o.optVal(e.tableOption.header, !0) ? (R(), E(c, {
|
|
2878
|
+
key: 1,
|
|
2879
|
+
ref: "headerMenu"
|
|
2880
|
+
}, {
|
|
2881
|
+
menuLeft: W((t) => [B(e.$slots, "menuLeft", I(N(t)))]),
|
|
2882
|
+
menuRight: W((t) => [B(e.$slots, "menuRight", I(N(t)))]),
|
|
2883
|
+
_: 3
|
|
2884
|
+
}, 512)) : D("v-if", !0),
|
|
2885
|
+
o.optVal(e.tableOption.tip, a.config.tip) && e.tableOption.selection ? (R(), E(u, {
|
|
2886
|
+
key: 2,
|
|
2887
|
+
"disable-transitions": "",
|
|
2888
|
+
class: "avue-crud__tip"
|
|
2889
|
+
}, {
|
|
2890
|
+
default: W(() => [
|
|
2891
|
+
k("span", mn, [
|
|
2892
|
+
t[0] || (t[0] = j(" 当前表格已选择 ", -1)),
|
|
2893
|
+
k("span", hn, U(o.selectLen), 1),
|
|
2894
|
+
t[1] || (t[1] = j(" 项 ", -1))
|
|
2895
|
+
]),
|
|
2896
|
+
o.optVal(e.tableOption.selectClearBtn, a.config.selectClearBtn) && e.tableOption.selection ? G((R(), E(l, {
|
|
2897
|
+
key: 0,
|
|
2898
|
+
text: "",
|
|
2899
|
+
onClick: o.selectClear
|
|
2900
|
+
}, {
|
|
2901
|
+
default: W(() => [...t[2] || (t[2] = [j(" 清 空 ", -1)])]),
|
|
2902
|
+
_: 1
|
|
2903
|
+
}, 8, ["onClick"])), [[ie, o.getPermission("selectClearBtn")]]) : D("v-if", !0),
|
|
2904
|
+
B(e.$slots, "tip")
|
|
2905
|
+
]),
|
|
2906
|
+
_: 3
|
|
2907
|
+
})) : D("v-if", !0),
|
|
2908
|
+
B(e.$slots, "header"),
|
|
2909
|
+
M(g, {
|
|
2910
|
+
ref: "cellForm",
|
|
2911
|
+
model: a.cellForm,
|
|
2912
|
+
"show-message": !1,
|
|
2913
|
+
onValidate: o.handleValidate
|
|
2914
|
+
}, {
|
|
2915
|
+
default: W(() => {
|
|
2916
|
+
var t;
|
|
2917
|
+
return [G((R(), E(h, {
|
|
2918
|
+
key: a.reload,
|
|
2919
|
+
ref: "table",
|
|
2920
|
+
data: a.cellForm.list,
|
|
2921
|
+
"row-key": e.rowKey,
|
|
2922
|
+
class: F({ "avue-crud--indeterminate": o.optVal(e.tableOption.indeterminate, !1) }),
|
|
2923
|
+
size: ((t = e.AVUE) == null ? void 0 : t.tableSize) || e.controlSize,
|
|
2924
|
+
lazy: o.optVal(e.tableOption.lazy, !1),
|
|
2925
|
+
load: o.treeLoad,
|
|
2926
|
+
"tree-props": o.treeProps,
|
|
2927
|
+
"expand-row-keys": e.tableOption.expandRowKeys,
|
|
2928
|
+
"default-expand-all": e.tableOption.defaultExpandAll,
|
|
2929
|
+
"highlight-current-row": e.tableOption.highlightCurrentRow,
|
|
2930
|
+
"show-summary": e.tableOption.showSummary,
|
|
2931
|
+
"summary-method": o.tableSummaryMethod,
|
|
2932
|
+
"span-method": o.tableSpanMethod,
|
|
2933
|
+
stripe: e.tableOption.stripe,
|
|
2934
|
+
"show-header": e.tableOption.showHeader,
|
|
2935
|
+
"default-sort": e.tableOption.defaultSort,
|
|
2936
|
+
"row-class-name": n.rowClassName,
|
|
2937
|
+
"cell-class-name": n.cellClassName,
|
|
2938
|
+
"row-style": n.rowStyle,
|
|
2939
|
+
"cell-style": n.cellStyle,
|
|
2940
|
+
fit: e.tableOption.fit,
|
|
2941
|
+
"header-cell-class-name": n.headerCellClassName,
|
|
2942
|
+
"max-height": o.isAutoHeight ? a.tableHeight : e.tableOption.maxHeight,
|
|
2943
|
+
height: a.tableHeight,
|
|
2944
|
+
width: o.setPx(e.tableOption.width, a.config.width),
|
|
2945
|
+
border: e.tableOption.border,
|
|
2946
|
+
onCurrentChange: o.currentRowChange,
|
|
2947
|
+
onExpandChange: o.expandChange,
|
|
2948
|
+
onHeaderDragend: o.headerDragend,
|
|
2949
|
+
onRowClick: o.rowClick,
|
|
2950
|
+
onRowDblclick: o.rowDblclick,
|
|
2951
|
+
onCellMouseEnter: o.cellMouseEnter,
|
|
2952
|
+
onCellMouseLeave: o.cellMouseLeave,
|
|
2953
|
+
onCellClick: o.cellClick,
|
|
2954
|
+
onHeaderClick: o.headerClick,
|
|
2955
|
+
onRowContextmenu: o.rowContextmenu,
|
|
2956
|
+
onHeaderContextmenu: o.headerContextmenu,
|
|
2957
|
+
onCellDblclick: o.cellDblclick,
|
|
2958
|
+
onFilterChange: o.filterChange,
|
|
2959
|
+
onSelectionChange: o.selectionChange,
|
|
2960
|
+
onSelect: o.select,
|
|
2961
|
+
onSelectAll: o.selectAll,
|
|
2962
|
+
onSortChange: o.sortChange
|
|
2963
|
+
}, {
|
|
2964
|
+
empty: W(() => [e.$slots.empty ? B(e.$slots, "empty", { key: 0 }) : (R(), E(m, {
|
|
2965
|
+
key: 1,
|
|
2966
|
+
"image-size": 100,
|
|
2967
|
+
class: "avue-crud__empty",
|
|
2968
|
+
description: e.tableOption.emptyText
|
|
2969
|
+
}, null, 8, ["description"]))]),
|
|
2970
|
+
default: W(() => [M(p, { "column-option": o.columnOption }, A({
|
|
2971
|
+
header: W(() => [M(d, { ref: "columnDefault" }, {
|
|
2972
|
+
expand: W(({ row: t, index: n }) => [B(e.$slots, "expand", {
|
|
2973
|
+
row: t,
|
|
2974
|
+
index: n
|
|
2975
|
+
})]),
|
|
2976
|
+
_: 3
|
|
2977
|
+
}, 512)]),
|
|
2978
|
+
footer: W(() => [M(f, null, {
|
|
2979
|
+
menu: W((t) => [B(e.$slots, "menu", I(N(t)))]),
|
|
2980
|
+
menuBtn: W((t) => [B(e.$slots, "menuBtn", I(N(t)))]),
|
|
2981
|
+
_: 3
|
|
2982
|
+
})]),
|
|
2983
|
+
_: 2
|
|
2984
|
+
}, [z(o.mainSlot, (t) => ({
|
|
2985
|
+
name: t,
|
|
2986
|
+
fn: W((n) => [B(e.$slots, t, I(N(n)))])
|
|
2987
|
+
}))]), 1032, ["column-option"])]),
|
|
2988
|
+
_: 3
|
|
2989
|
+
}, 8, /* @__PURE__ */ "data.row-key.class.size.lazy.load.tree-props.expand-row-keys.default-expand-all.highlight-current-row.show-summary.summary-method.span-method.stripe.show-header.default-sort.row-class-name.cell-class-name.row-style.cell-style.fit.header-cell-class-name.max-height.height.width.border.onCurrentChange.onExpandChange.onHeaderDragend.onRowClick.onRowDblclick.onCellMouseEnter.onCellMouseLeave.onCellClick.onHeaderClick.onRowContextmenu.onHeaderContextmenu.onCellDblclick.onFilterChange.onSelectionChange.onSelect.onSelectAll.onSortChange".split("."))), [[v, n.tableLoading]])];
|
|
2990
|
+
}),
|
|
2991
|
+
_: 3
|
|
2992
|
+
}, 8, ["model", "onValidate"]),
|
|
2993
|
+
B(e.$slots, "footer"),
|
|
2994
|
+
D(" 分页 "),
|
|
2995
|
+
M(ee, { ref: "tablePage" }, null, 512),
|
|
2996
|
+
D(" 表单 "),
|
|
2997
|
+
M(te, { ref: "dialogForm" }, A({
|
|
2998
|
+
menuForm: W((t) => [B(e.$slots, "menuForm", I(N(t)))]),
|
|
2999
|
+
_: 2
|
|
3000
|
+
}, [z(o.formSlot, (t) => ({
|
|
3001
|
+
name: t,
|
|
3002
|
+
fn: W((n) => [B(e.$slots, t, I(N(n)))])
|
|
3003
|
+
}))]), 1536),
|
|
3004
|
+
M(_, { ref: "dialogColumn" }, null, 512),
|
|
3005
|
+
M(ne, { ref: "dialogExcel" }, null, 512),
|
|
3006
|
+
M(re, { ref: "dialogFilter" }, null, 512)
|
|
3007
|
+
]);
|
|
3008
|
+
}
|
|
3009
|
+
var _n = /* @__PURE__ */ t(fn, [["render", gn]]), vn = {
|
|
3010
|
+
name: "FyDynamic",
|
|
3011
|
+
mixins: [se, ue],
|
|
3012
|
+
props: {
|
|
3013
|
+
max: Number,
|
|
3014
|
+
columnSlot: {
|
|
3015
|
+
type: Array,
|
|
3016
|
+
default: () => []
|
|
3017
|
+
},
|
|
3018
|
+
children: {
|
|
3019
|
+
type: Object,
|
|
3020
|
+
default: () => ({})
|
|
3021
|
+
}
|
|
3022
|
+
},
|
|
3023
|
+
data() {
|
|
3024
|
+
return {
|
|
3025
|
+
reload: Math.random(),
|
|
3026
|
+
hoverList: []
|
|
3027
|
+
};
|
|
3028
|
+
},
|
|
3029
|
+
computed: {
|
|
3030
|
+
textLen() {
|
|
3031
|
+
return this.text.length;
|
|
3032
|
+
},
|
|
3033
|
+
maxFlag() {
|
|
3034
|
+
return this.max ? this.text.length !== this.max : !0;
|
|
3035
|
+
},
|
|
3036
|
+
showIndex() {
|
|
3037
|
+
return h(this.children.index, !0);
|
|
3038
|
+
},
|
|
3039
|
+
showType() {
|
|
3040
|
+
return this.children.type || "crud";
|
|
3041
|
+
},
|
|
3042
|
+
isForm() {
|
|
3043
|
+
return this.showType === "form";
|
|
3044
|
+
},
|
|
3045
|
+
isCrud() {
|
|
3046
|
+
return this.showType === "crud";
|
|
3047
|
+
},
|
|
3048
|
+
selectionChange() {
|
|
3049
|
+
return this.children.selectionChange;
|
|
3050
|
+
},
|
|
3051
|
+
sortableChange() {
|
|
3052
|
+
return this.children.sortableChange;
|
|
3053
|
+
},
|
|
3054
|
+
rowAdd() {
|
|
3055
|
+
return this.children.rowAdd;
|
|
3056
|
+
},
|
|
3057
|
+
rowDel() {
|
|
3058
|
+
return this.children.rowDel;
|
|
3059
|
+
},
|
|
3060
|
+
viewBtn() {
|
|
3061
|
+
return this.children.viewBtn === !1;
|
|
3062
|
+
},
|
|
3063
|
+
addBtn() {
|
|
3064
|
+
return this.children.addBtn === !1;
|
|
3065
|
+
},
|
|
3066
|
+
delBtn() {
|
|
3067
|
+
return this.children.delBtn === !1;
|
|
3068
|
+
},
|
|
3069
|
+
valueOption() {
|
|
3070
|
+
let e = {};
|
|
3071
|
+
return this.columnOption.forEach((t) => {
|
|
3072
|
+
t.value && (e[t.prop] = t.value);
|
|
3073
|
+
}), e;
|
|
3074
|
+
},
|
|
3075
|
+
rulesOption() {
|
|
3076
|
+
let e = {};
|
|
3077
|
+
return this.columnOption.forEach((t) => {
|
|
3078
|
+
t.rules && (e[t.prop] = t.rules);
|
|
3079
|
+
}), e;
|
|
3080
|
+
},
|
|
3081
|
+
columnOption() {
|
|
3082
|
+
return this.children.column || [];
|
|
3083
|
+
},
|
|
3084
|
+
option() {
|
|
3085
|
+
return {
|
|
3086
|
+
border: !0,
|
|
3087
|
+
header: !1,
|
|
3088
|
+
menu: !1,
|
|
3089
|
+
size: this.size,
|
|
3090
|
+
disabled: this.disabled,
|
|
3091
|
+
readonly: this.readonly,
|
|
3092
|
+
emptyBtn: !1,
|
|
3093
|
+
submitBtn: !1,
|
|
3094
|
+
...(() => {
|
|
3095
|
+
let e = c(this.children);
|
|
3096
|
+
return delete e.column, e;
|
|
3097
|
+
})(),
|
|
3098
|
+
...(() => {
|
|
3099
|
+
let e = [{
|
|
3100
|
+
label: this.children.indexLabel || "#",
|
|
3101
|
+
prop: "_index",
|
|
3102
|
+
display: this.showIndex,
|
|
3103
|
+
hide: !this.showIndex,
|
|
3104
|
+
fixed: !0,
|
|
3105
|
+
align: "center",
|
|
3106
|
+
headerAlign: "center",
|
|
3107
|
+
span: 24,
|
|
3108
|
+
width: 50
|
|
3109
|
+
}];
|
|
3110
|
+
return this.columnOption.forEach((t) => {
|
|
3111
|
+
e.push(Object.assign(t, { cell: h(t.cell, this.isCrud) }));
|
|
3112
|
+
}), { column: e };
|
|
3113
|
+
})()
|
|
3114
|
+
};
|
|
3115
|
+
}
|
|
3116
|
+
},
|
|
3117
|
+
watch: { text() {
|
|
3118
|
+
this.initData();
|
|
3119
|
+
} },
|
|
3120
|
+
mounted() {
|
|
3121
|
+
this.initData();
|
|
3122
|
+
},
|
|
3123
|
+
methods: {
|
|
3124
|
+
deepClone: c,
|
|
3125
|
+
handleSelectionChange(e) {
|
|
3126
|
+
var t;
|
|
3127
|
+
(t = this.selectionChange) == null || t.call(this, e);
|
|
3128
|
+
},
|
|
3129
|
+
handleSortableChange(e, t, n, r) {
|
|
3130
|
+
var i;
|
|
3131
|
+
(i = this.sortableChange) == null || i.call(this, e, t, n, r);
|
|
3132
|
+
},
|
|
3133
|
+
cellMouseenter(e) {
|
|
3134
|
+
let t = e.$index;
|
|
3135
|
+
this.mouseoverRow(t);
|
|
3136
|
+
},
|
|
3137
|
+
cellMouseLeave(e) {
|
|
3138
|
+
let t = e.$index;
|
|
3139
|
+
this.mouseoutRow(t);
|
|
3140
|
+
},
|
|
3141
|
+
initData() {
|
|
3142
|
+
this.text.forEach((e, t) => {
|
|
3143
|
+
e = Object.assign(e, {
|
|
3144
|
+
$cellEdit: !0,
|
|
3145
|
+
$index: t
|
|
3146
|
+
});
|
|
3147
|
+
});
|
|
3148
|
+
},
|
|
3149
|
+
mouseoverRow(e) {
|
|
3150
|
+
this.delBtn || (this.flagList(), this.hoverList[e] = !0);
|
|
3151
|
+
},
|
|
3152
|
+
mouseoutRow(e) {
|
|
3153
|
+
this.delBtn || (this.flagList(), this.hoverList[e] = !1);
|
|
3154
|
+
},
|
|
3155
|
+
flagList() {
|
|
3156
|
+
this.hoverList.forEach((e, t) => {
|
|
3157
|
+
this.hoverList[t] = !1;
|
|
3158
|
+
});
|
|
3159
|
+
},
|
|
3160
|
+
delRow(e) {
|
|
3161
|
+
let t = () => {
|
|
3162
|
+
let t = c(this.text);
|
|
3163
|
+
t.splice(e, 1), this.text = t, this.reload = Math.random();
|
|
3164
|
+
};
|
|
3165
|
+
typeof this.rowDel == "function" ? this.rowDel(this.text[e], t) : t();
|
|
3166
|
+
},
|
|
3167
|
+
addRow() {
|
|
3168
|
+
let e = (e = {}) => {
|
|
3169
|
+
e = Object.assign(this.valueOption, e, { $index: this.textLen }), this.isCrud ? this.$refs.main.rowCellAdd(e) : this.isForm && this.text.push(e);
|
|
3170
|
+
};
|
|
3171
|
+
typeof this.rowAdd == "function" ? this.rowAdd(e) : e();
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
}, yn = { class: "avue-dynamic__header" }, bn = ["onMouseenter", "onMouseleave"], xn = { key: 1 };
|
|
3175
|
+
function Sn(e, t, n, r, a, o) {
|
|
3176
|
+
let s = i, c = $, l = _n;
|
|
3177
|
+
return R(), O("div", {
|
|
3178
|
+
key: a.reload,
|
|
3179
|
+
class: "avue-dynamic"
|
|
3180
|
+
}, [o.isForm ? (R(), O(T, { key: 0 }, [k("div", yn, [!e.readonly && !e.disabled && !o.addBtn ? (R(), E(s, {
|
|
3181
|
+
key: 0,
|
|
3182
|
+
circle: "",
|
|
3183
|
+
disabled: e.disabled,
|
|
3184
|
+
type: "primary",
|
|
3185
|
+
icon: "el-icon-plus",
|
|
3186
|
+
onClick: o.addRow
|
|
3187
|
+
}, null, 8, ["disabled", "onClick"])) : D("v-if", !0)]), k("div", null, [(R(!0), O(T, null, z(e.text, (t, r) => (R(), O("div", {
|
|
3188
|
+
key: r,
|
|
3189
|
+
class: "avue-dynamic__row",
|
|
3190
|
+
onMouseenter: (e) => o.cellMouseenter({ $index: r }),
|
|
3191
|
+
onMouseleave: (e) => o.cellMouseLeave({ $index: r })
|
|
3192
|
+
}, [!e.readonly && !e.disabled && !o.delBtn && a.hoverList[r] ? (R(), E(s, {
|
|
3193
|
+
key: 0,
|
|
3194
|
+
type: "danger",
|
|
3195
|
+
class: "avue-dynamic__menu",
|
|
3196
|
+
disabled: e.disabled,
|
|
3197
|
+
icon: "el-icon-delete",
|
|
3198
|
+
circle: "",
|
|
3199
|
+
onClick: (e) => o.delRow(t.$index)
|
|
3200
|
+
}, null, 8, ["disabled", "onClick"])) : D("v-if", !0), (R(), E(c, {
|
|
3201
|
+
key: r,
|
|
3202
|
+
ref_for: !0,
|
|
3203
|
+
ref: "main",
|
|
3204
|
+
modelValue: e.text[r],
|
|
3205
|
+
"onUpdate:modelValue": (t) => e.text[r] = t,
|
|
3206
|
+
option: o.deepClone(o.option)
|
|
3207
|
+
}, A({
|
|
3208
|
+
_index: W(({}) => [k("div", null, [k("span", null, U(t.$index + 1), 1)])]),
|
|
3209
|
+
_: 2
|
|
3210
|
+
}, [z(n.columnSlot, (t) => ({
|
|
3211
|
+
name: t,
|
|
3212
|
+
fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, Object.assign(n, { row: e.text[r] })))])
|
|
3213
|
+
}))]), 1032, [
|
|
3214
|
+
"modelValue",
|
|
3215
|
+
"onUpdate:modelValue",
|
|
3216
|
+
"option"
|
|
3217
|
+
]))], 40, bn))), 128))])], 64)) : o.isCrud ? (R(), E(l, {
|
|
3218
|
+
key: 1,
|
|
3219
|
+
ref: "main",
|
|
3220
|
+
option: o.option,
|
|
3221
|
+
disabled: e.disabled,
|
|
3222
|
+
data: e.text,
|
|
3223
|
+
onCellMouseEnter: o.cellMouseenter,
|
|
3224
|
+
onCellMouseLeave: o.cellMouseLeave,
|
|
3225
|
+
onSelectionChange: o.handleSelectionChange,
|
|
3226
|
+
onSortableChange: o.handleSortableChange
|
|
3227
|
+
}, {
|
|
3228
|
+
_indexHeader: W(() => [!(o.addBtn || e.readonly) && o.maxFlag ? (R(), E(s, {
|
|
3229
|
+
key: 0,
|
|
3230
|
+
type: "primary",
|
|
3231
|
+
disabled: e.disabled,
|
|
3232
|
+
icon: "el-icon-plus",
|
|
3233
|
+
circle: "",
|
|
3234
|
+
onClick: t[0] || (t[0] = (e) => o.addRow())
|
|
3235
|
+
}, null, 8, ["disabled"])) : D("v-if", !0)]),
|
|
3236
|
+
_index: W((t) => [!e.readonly && !e.disabled && !o.delBtn && a.hoverList[t.row.$index] ? (R(), E(s, {
|
|
3237
|
+
key: 0,
|
|
3238
|
+
type: "danger",
|
|
3239
|
+
disabled: e.disabled,
|
|
3240
|
+
icon: "el-icon-delete",
|
|
3241
|
+
circle: "",
|
|
3242
|
+
onClick: (e) => o.delRow(t.row.$index)
|
|
3243
|
+
}, null, 8, ["disabled", "onClick"])) : (R(), O("div", xn, U(t.row.$index + 1), 1))]),
|
|
3244
|
+
default: W(() => [(R(!0), O(T, null, z(n.columnSlot, (t) => B(e.$slots, t, P({ ref_for: !0 }, e.scope))), 256))]),
|
|
3245
|
+
_: 3
|
|
3246
|
+
}, 8, [
|
|
3247
|
+
"option",
|
|
3248
|
+
"disabled",
|
|
3249
|
+
"data",
|
|
3250
|
+
"onCellMouseEnter",
|
|
3251
|
+
"onCellMouseLeave",
|
|
3252
|
+
"onSelectionChange",
|
|
3253
|
+
"onSortableChange"
|
|
3254
|
+
])) : D("v-if", !0)]);
|
|
3255
|
+
}
|
|
3256
|
+
var Cn = /* @__PURE__ */ t(vn, [["render", Sn]]), wn = {
|
|
3257
|
+
name: "FormTemp",
|
|
3258
|
+
components: {
|
|
3259
|
+
FyUEditor: et(() => import("../fy-u-editor/index.mjs")),
|
|
3260
|
+
FyInputTable: et(() => import("../fy-input-table/index.mjs")),
|
|
3261
|
+
FyInputTree: Pe,
|
|
3262
|
+
FyArray: fe,
|
|
3263
|
+
FyCascader: pe,
|
|
3264
|
+
FyCheckbox: me,
|
|
3265
|
+
FyDate: he,
|
|
3266
|
+
FyDynamic: Cn,
|
|
3267
|
+
FyInput: ge,
|
|
3268
|
+
FyInputColor: we,
|
|
3269
|
+
FyInputIcon: Te,
|
|
3270
|
+
FyInputMap: Ee,
|
|
3271
|
+
FyInputNumber: De,
|
|
3272
|
+
FyRadio: Oe,
|
|
3273
|
+
FyRate: Ce,
|
|
3274
|
+
FySelect: be,
|
|
3275
|
+
FySlider: ke,
|
|
3276
|
+
FySwitch: Ae,
|
|
3277
|
+
FyTime: je,
|
|
3278
|
+
FyTitle: Me,
|
|
3279
|
+
FyUpload: Ne
|
|
3280
|
+
},
|
|
3281
|
+
mixins: [y],
|
|
3282
|
+
props: {
|
|
3283
|
+
modelValue: [
|
|
3284
|
+
String,
|
|
3285
|
+
Object,
|
|
3286
|
+
Number,
|
|
3287
|
+
Boolean,
|
|
3288
|
+
Array
|
|
3289
|
+
],
|
|
3290
|
+
columnSlot: {
|
|
3291
|
+
type: Array,
|
|
3292
|
+
default: () => []
|
|
3293
|
+
},
|
|
3294
|
+
tableData: {
|
|
3295
|
+
type: Object,
|
|
3296
|
+
default: () => ({})
|
|
3297
|
+
},
|
|
3298
|
+
enter: {
|
|
3299
|
+
type: Boolean,
|
|
3300
|
+
default: !1
|
|
3301
|
+
},
|
|
3302
|
+
type: { type: String },
|
|
3303
|
+
propsHttp: {
|
|
3304
|
+
type: Object,
|
|
3305
|
+
default: () => ({})
|
|
3306
|
+
},
|
|
3307
|
+
props: { type: Object },
|
|
3308
|
+
dic: { type: Array },
|
|
3309
|
+
size: { type: String },
|
|
3310
|
+
disabled: { type: Boolean },
|
|
3311
|
+
readonly: { type: Boolean },
|
|
3312
|
+
column: {
|
|
3313
|
+
type: Object,
|
|
3314
|
+
default: () => ({})
|
|
3315
|
+
}
|
|
3316
|
+
},
|
|
3317
|
+
emits: [
|
|
3318
|
+
"enter",
|
|
3319
|
+
"change",
|
|
3320
|
+
"update:modelValue"
|
|
3321
|
+
],
|
|
3322
|
+
computed: {
|
|
3323
|
+
params() {
|
|
3324
|
+
return this.column.params || {};
|
|
3325
|
+
},
|
|
3326
|
+
event() {
|
|
3327
|
+
return this.column.event || {};
|
|
3328
|
+
},
|
|
3329
|
+
text: {
|
|
3330
|
+
get() {
|
|
3331
|
+
return this.modelValue;
|
|
3332
|
+
},
|
|
3333
|
+
set(e) {
|
|
3334
|
+
this.$emit("update:modelValue", e), this.$emit("change", e);
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
},
|
|
3338
|
+
methods: {
|
|
3339
|
+
uploadFun: _,
|
|
3340
|
+
getComponent: le,
|
|
3341
|
+
getPlaceholder: v,
|
|
3342
|
+
enterChange() {
|
|
3343
|
+
typeof this.column.enter == "function" ? this.column.enter({
|
|
3344
|
+
value: this.text,
|
|
3345
|
+
column: this.column
|
|
3346
|
+
}) : this.enter && this.$emit("enter");
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
}, Tn = ["innerHTML"];
|
|
3350
|
+
function En(e, t, n, r, i, a) {
|
|
3351
|
+
return R(), E(H(a.getComponent(n.column.type, n.column.component)), P(Object.assign(n.column, a.uploadFun(n.column)), {
|
|
3352
|
+
ref: "temp",
|
|
3353
|
+
modelValue: a.text,
|
|
3354
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => a.text = e),
|
|
3355
|
+
column: Object.assign(n.column, a.params),
|
|
3356
|
+
dic: n.dic,
|
|
3357
|
+
disabled: n.column.disabled || n.disabled,
|
|
3358
|
+
readonly: n.column.readonly || n.readonly,
|
|
3359
|
+
placeholder: a.getPlaceholder(n.column),
|
|
3360
|
+
props: n.column.props || n.props,
|
|
3361
|
+
"props-http": n.column.propsHttp || n.propsHttp,
|
|
3362
|
+
size: n.column.size || n.size,
|
|
3363
|
+
"table-data": n.tableData,
|
|
3364
|
+
type: n.type || n.column.type,
|
|
3365
|
+
"column-slot": n.columnSlot
|
|
3366
|
+
}, nt(a.event), { onKeyup: it(a.enterChange, ["enter"]) }), A({
|
|
3367
|
+
default: W(() => [a.params.html ? (R(), O("span", {
|
|
3368
|
+
key: 0,
|
|
3369
|
+
innerHTML: a.params.html
|
|
3370
|
+
}, null, 8, Tn)) : D("v-if", !0)]),
|
|
3371
|
+
_: 2
|
|
3372
|
+
}, [z(e.getSlotName(n.column, "T", e.$slots) ? [n.column] : [], (t) => ({
|
|
3373
|
+
name: t,
|
|
3374
|
+
fn: W((n) => [B(e.$slots, e.getSlotName(t, "T"), I(N(n)))])
|
|
3375
|
+
})), z(n.columnSlot, (t) => ({
|
|
3376
|
+
name: t,
|
|
3377
|
+
fn: W((n) => [B(e.$slots, t, I(N(n || {})))])
|
|
3378
|
+
}))]), 1040, [
|
|
3379
|
+
"modelValue",
|
|
3380
|
+
"column",
|
|
3381
|
+
"dic",
|
|
3382
|
+
"disabled",
|
|
3383
|
+
"readonly",
|
|
3384
|
+
"placeholder",
|
|
3385
|
+
"props",
|
|
3386
|
+
"props-http",
|
|
3387
|
+
"size",
|
|
3388
|
+
"table-data",
|
|
3389
|
+
"type",
|
|
3390
|
+
"column-slot",
|
|
3391
|
+
"onKeyup"
|
|
3392
|
+
]);
|
|
3393
|
+
}
|
|
3394
|
+
var Dn = /* @__PURE__ */ t(wn, [["render", En]]), On = (e, t, n, r) => {
|
|
3395
|
+
if (!r) return;
|
|
3396
|
+
if (!window.Mock) {
|
|
3397
|
+
xe.logs("mock");
|
|
3398
|
+
return;
|
|
3399
|
+
}
|
|
3400
|
+
let i = (window.Mock || {}).Random, a = {};
|
|
3401
|
+
function o({ en: e }) {
|
|
3402
|
+
return e ? i.name(!0) : i.cname();
|
|
3403
|
+
}
|
|
3404
|
+
function s({ max: e, min: t, precision: n }) {
|
|
3405
|
+
if (n) {
|
|
3406
|
+
let r = `${i.float(t, e, n)}`, a = r.indexOf(".") + 1;
|
|
3407
|
+
return Number(r.substring(0, a + n));
|
|
3408
|
+
} else return i.integer(t, e);
|
|
3409
|
+
}
|
|
3410
|
+
function c({ header: e }) {
|
|
3411
|
+
let t = i.url(), n = t.indexOf("://");
|
|
3412
|
+
return t = e === !1 ? t.substring(n + 3) : `http://${t.substring(n + 3)}`, t;
|
|
3413
|
+
}
|
|
3414
|
+
function l({ format: e, now: t }) {
|
|
3415
|
+
return t ? i.now(e) : i.datetime(e);
|
|
3416
|
+
}
|
|
3417
|
+
function u({ min: e, max: t }) {
|
|
3418
|
+
return i.csentence(e, t);
|
|
3419
|
+
}
|
|
3420
|
+
function d() {
|
|
3421
|
+
return i.county(!0);
|
|
3422
|
+
}
|
|
3423
|
+
function f({ dic: e, props: t, columnType: n, multiple: r }) {
|
|
3424
|
+
let i = t.value || "value", a = e.length;
|
|
3425
|
+
if (["checkbox"].includes(n) || r) {
|
|
3426
|
+
let t = s({
|
|
3427
|
+
min: 1,
|
|
3428
|
+
max: a
|
|
3429
|
+
}), n = [];
|
|
3430
|
+
for (let r = 0; r < t; r++) {
|
|
3431
|
+
let t = !0;
|
|
3432
|
+
for (; t;) {
|
|
3433
|
+
let r = e[s({
|
|
3434
|
+
min: 0,
|
|
3435
|
+
max: a - 1
|
|
3436
|
+
})][i];
|
|
3437
|
+
n.includes(r) || (n.push(r), t = !1);
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
return n;
|
|
3441
|
+
} else return e[s({
|
|
3442
|
+
min: 0,
|
|
3443
|
+
max: a - 1
|
|
3444
|
+
})][i];
|
|
3445
|
+
}
|
|
3446
|
+
function p() {
|
|
3447
|
+
Object.keys(e).forEach((r) => {
|
|
3448
|
+
let i = e[r];
|
|
3449
|
+
if (i.mock && typeof i.mock == "object") {
|
|
3450
|
+
let e = i.mock;
|
|
3451
|
+
switch (e.dic = typeof i.dicData == "string" ? t[i.dicData] : i.dicData || [], e.props = i.props || {}, e.columnType = i.type, e.multiple = i.multiple, e.type) {
|
|
3452
|
+
case "name":
|
|
3453
|
+
a[i.prop] = o(e);
|
|
3454
|
+
break;
|
|
3455
|
+
case "number":
|
|
3456
|
+
a[i.prop] = s(e);
|
|
3457
|
+
break;
|
|
3458
|
+
case "datetime":
|
|
3459
|
+
a[i.prop] = l(e);
|
|
3460
|
+
break;
|
|
3461
|
+
case "word":
|
|
3462
|
+
a[i.prop] = u(e);
|
|
3463
|
+
break;
|
|
3464
|
+
case "url":
|
|
3465
|
+
a[i.prop] = c(e);
|
|
3466
|
+
break;
|
|
3467
|
+
case "county":
|
|
3468
|
+
a[i.prop] = d();
|
|
3469
|
+
break;
|
|
3470
|
+
case "dic":
|
|
3471
|
+
a[i.prop] = f(e);
|
|
3472
|
+
break;
|
|
3473
|
+
}
|
|
3474
|
+
} else i.mock instanceof Function && (a[i.prop] = i.mock(n));
|
|
3475
|
+
});
|
|
3476
|
+
}
|
|
3477
|
+
return p(), a;
|
|
3478
|
+
}, kn = {
|
|
3479
|
+
name: "FyForm",
|
|
3480
|
+
mixins: [dn],
|
|
3481
|
+
provide() {
|
|
3482
|
+
return { formSafe: this };
|
|
3483
|
+
},
|
|
3484
|
+
props: {
|
|
3485
|
+
uploadBefore: Function,
|
|
3486
|
+
uploadAfter: Function,
|
|
3487
|
+
uploadDelete: Function,
|
|
3488
|
+
uploadPreview: Function,
|
|
3489
|
+
uploadError: Function,
|
|
3490
|
+
uploadExceed: Function,
|
|
3491
|
+
status: {
|
|
3492
|
+
type: Boolean,
|
|
3493
|
+
default: !1
|
|
3494
|
+
},
|
|
3495
|
+
isCrud: {
|
|
3496
|
+
type: Boolean,
|
|
3497
|
+
default: !1
|
|
3498
|
+
},
|
|
3499
|
+
modelValue: {
|
|
3500
|
+
type: Object,
|
|
3501
|
+
default: () => ({})
|
|
3502
|
+
}
|
|
3503
|
+
},
|
|
3504
|
+
emits: [
|
|
3505
|
+
"submit",
|
|
3506
|
+
"error",
|
|
3507
|
+
"tab-click",
|
|
3508
|
+
"change",
|
|
3509
|
+
"update:modelValue",
|
|
3510
|
+
"reset-change",
|
|
3511
|
+
"update:status",
|
|
3512
|
+
"mock-change"
|
|
3513
|
+
],
|
|
3514
|
+
data() {
|
|
3515
|
+
return {
|
|
3516
|
+
activeName: "",
|
|
3517
|
+
labelWidth: 90,
|
|
3518
|
+
allDisabled: !1,
|
|
3519
|
+
optionIndex: [],
|
|
3520
|
+
optionBox: !1,
|
|
3521
|
+
tableOption: {},
|
|
3522
|
+
itemSpanDefault: 12,
|
|
3523
|
+
form: {},
|
|
3524
|
+
formCreate: !1,
|
|
3525
|
+
formList: [],
|
|
3526
|
+
formBind: {}
|
|
3527
|
+
};
|
|
3528
|
+
},
|
|
3529
|
+
computed: {
|
|
3530
|
+
columnSlot() {
|
|
3531
|
+
return Object.keys(this.$slots).filter((e) => !this.propOption.map((e) => e.prop).includes(e));
|
|
3532
|
+
},
|
|
3533
|
+
labelSuffix() {
|
|
3534
|
+
return this.parentOption.labelSuffix || ":";
|
|
3535
|
+
},
|
|
3536
|
+
isMenu() {
|
|
3537
|
+
return this.columnOption.length !== 1;
|
|
3538
|
+
},
|
|
3539
|
+
isDetail() {
|
|
3540
|
+
return this.detail === !0;
|
|
3541
|
+
},
|
|
3542
|
+
isTabs() {
|
|
3543
|
+
return this.parentOption.tabs === !0;
|
|
3544
|
+
},
|
|
3545
|
+
isAdd() {
|
|
3546
|
+
return this.boxType === "add";
|
|
3547
|
+
},
|
|
3548
|
+
isEdit() {
|
|
3549
|
+
return this.boxType === "edit";
|
|
3550
|
+
},
|
|
3551
|
+
isView() {
|
|
3552
|
+
return this.boxType === "view";
|
|
3553
|
+
},
|
|
3554
|
+
gutter() {
|
|
3555
|
+
return f((this.parentOption.gutter || 10) / 2);
|
|
3556
|
+
},
|
|
3557
|
+
detail() {
|
|
3558
|
+
return this.parentOption.detail;
|
|
3559
|
+
},
|
|
3560
|
+
disabled() {
|
|
3561
|
+
return this.parentOption.disabled;
|
|
3562
|
+
},
|
|
3563
|
+
readonly() {
|
|
3564
|
+
return this.parentOption.readonly;
|
|
3565
|
+
},
|
|
3566
|
+
tabsType() {
|
|
3567
|
+
return this.parentOption.tabsType;
|
|
3568
|
+
},
|
|
3569
|
+
columnLen() {
|
|
3570
|
+
return this.columnOption.length;
|
|
3571
|
+
},
|
|
3572
|
+
dynamicOption() {
|
|
3573
|
+
let e = [];
|
|
3574
|
+
return this.propOption.forEach((t) => {
|
|
3575
|
+
t.type === "dynamic" && this.vaildDisplay(t) && e.push(t);
|
|
3576
|
+
}), e;
|
|
3577
|
+
},
|
|
3578
|
+
propOption() {
|
|
3579
|
+
let e = [];
|
|
3580
|
+
return this.columnOption.forEach((t) => {
|
|
3581
|
+
t.display !== !1 && t.column.forEach((t) => {
|
|
3582
|
+
e.push(t);
|
|
3583
|
+
});
|
|
3584
|
+
}), e;
|
|
3585
|
+
},
|
|
3586
|
+
parentOption() {
|
|
3587
|
+
return this.tableOption || {};
|
|
3588
|
+
},
|
|
3589
|
+
columnOption() {
|
|
3590
|
+
let e = this.tableOption.column || [], t = c(this.tableOption.group) || [], n = this.tableOption.footer || [];
|
|
3591
|
+
return t.unshift({
|
|
3592
|
+
header: !1,
|
|
3593
|
+
column: e
|
|
3594
|
+
}), n.length !== 0 && t.push({
|
|
3595
|
+
header: !1,
|
|
3596
|
+
column: n
|
|
3597
|
+
}), t.forEach((e) => {
|
|
3598
|
+
e.column = e.column || [], e.column.forEach((e, t) => {
|
|
3599
|
+
e.display !== !1 && !this.isMobile && (e = ie(e, this.itemSpanDefault, t === 0));
|
|
3600
|
+
}), e.column = ae(e.column), e.column = e.column.sort((e, t) => (t.order || 0) - (e.order || 0));
|
|
3601
|
+
}), t;
|
|
3602
|
+
},
|
|
3603
|
+
menuPosition() {
|
|
3604
|
+
return this.parentOption.menuPosition ? this.parentOption.menuPosition : "center";
|
|
3605
|
+
},
|
|
3606
|
+
boxType() {
|
|
3607
|
+
return this.parentOption.boxType;
|
|
3608
|
+
},
|
|
3609
|
+
isPrint() {
|
|
3610
|
+
return this.parentOption.printBtn === !0;
|
|
3611
|
+
},
|
|
3612
|
+
tabsActive() {
|
|
3613
|
+
return this.tableOption.tabsActive || "1";
|
|
3614
|
+
},
|
|
3615
|
+
isMock() {
|
|
3616
|
+
return this.parentOption.mockBtn === !0;
|
|
3617
|
+
}
|
|
3618
|
+
},
|
|
3619
|
+
watch: {
|
|
3620
|
+
modelValue: {
|
|
3621
|
+
handler() {
|
|
3622
|
+
this.formCreate && this.setForm();
|
|
3623
|
+
},
|
|
3624
|
+
deep: !0
|
|
3625
|
+
},
|
|
3626
|
+
form: {
|
|
3627
|
+
handler() {
|
|
3628
|
+
this.formCreate && (this.setLabel(), this.setVal());
|
|
3629
|
+
},
|
|
3630
|
+
deep: !0
|
|
3631
|
+
},
|
|
3632
|
+
tabsActive: {
|
|
3633
|
+
handler() {
|
|
3634
|
+
this.activeName = this.tabsActive;
|
|
3635
|
+
},
|
|
3636
|
+
immediate: !0
|
|
3637
|
+
},
|
|
3638
|
+
DIC: {
|
|
3639
|
+
handler() {
|
|
3640
|
+
this.setLabel();
|
|
3641
|
+
},
|
|
3642
|
+
deep: !0,
|
|
3643
|
+
immediate: !0
|
|
3644
|
+
},
|
|
3645
|
+
allDisabled: {
|
|
3646
|
+
handler(e) {
|
|
3647
|
+
this.$emit("update:status", e);
|
|
3648
|
+
},
|
|
3649
|
+
deep: !0,
|
|
3650
|
+
immediate: !0
|
|
3651
|
+
}
|
|
3652
|
+
},
|
|
3653
|
+
mounted() {
|
|
3654
|
+
setTimeout(() => {
|
|
3655
|
+
this.dataFormat();
|
|
3656
|
+
});
|
|
3657
|
+
},
|
|
3658
|
+
beforeUnmount() {
|
|
3659
|
+
Object.keys(this.formBind).forEach((e) => {
|
|
3660
|
+
this.formBind[e].forEach((e) => {
|
|
3661
|
+
e();
|
|
3662
|
+
});
|
|
3663
|
+
});
|
|
3664
|
+
},
|
|
3665
|
+
methods: {
|
|
3666
|
+
setPx: f,
|
|
3667
|
+
deepClone: c,
|
|
3668
|
+
getComponent: le,
|
|
3669
|
+
getPlaceholder: v,
|
|
3670
|
+
uploadFun: _,
|
|
3671
|
+
getDisabled(e) {
|
|
3672
|
+
return this.vaildDetail(e) || this.isDetail || this.vaildDisabled(e) || this.allDisabled;
|
|
3673
|
+
},
|
|
3674
|
+
getSpan(e) {
|
|
3675
|
+
return e.span || this.parentOption.span || this.itemSpanDefault;
|
|
3676
|
+
},
|
|
3677
|
+
isGroupShow(e, t) {
|
|
3678
|
+
return this.isTabs ? `${t}` === this.activeName || t === 0 : !0;
|
|
3679
|
+
},
|
|
3680
|
+
dataFormat() {
|
|
3681
|
+
let e = ce(this.propOption).tableForm, t = this.modelValue, n = {};
|
|
3682
|
+
Object.entries(Object.assign(e, t)).forEach((e) => {
|
|
3683
|
+
let r = e[0], i = e[1];
|
|
3684
|
+
q(t[r]) ? n[r] = i : n[r] = t[r];
|
|
3685
|
+
}), this.form = n, this.setLabel(), this.setControl(), this.setVal(), setTimeout(() => {
|
|
3686
|
+
this.formCreate = !0, this.clearValidate();
|
|
3687
|
+
});
|
|
3688
|
+
},
|
|
3689
|
+
setControl() {
|
|
3690
|
+
this.propOption.forEach((e) => {
|
|
3691
|
+
let t = e.prop, n = e.bind, r = e.control;
|
|
3692
|
+
if (!this.formBind[t]) {
|
|
3693
|
+
let i = [];
|
|
3694
|
+
if (n) {
|
|
3695
|
+
let e = this.$watch(`form.${t}`, (e, t) => {
|
|
3696
|
+
e !== t && p(this.form, n, e);
|
|
3697
|
+
}), r = this.$watch(`form.${n}`, (e, n) => {
|
|
3698
|
+
e !== n && (this.form[t] = e);
|
|
3699
|
+
});
|
|
3700
|
+
i.push(e), i.push(r), this.form[t] = d(this.form, n);
|
|
3701
|
+
}
|
|
3702
|
+
if (r) {
|
|
3703
|
+
let n = () => {
|
|
3704
|
+
let t = r(this.form[e.prop], this.form) || {};
|
|
3705
|
+
Object.keys(t).forEach((e) => {
|
|
3706
|
+
let n = Object.assign(this.objectOption[e] || {}, t[e]);
|
|
3707
|
+
this.objectOption[e] = n, t[e].dicData && (this.DIC[e] = t[e].dicData);
|
|
3708
|
+
});
|
|
3709
|
+
}, a = this.$watch(`form.${t}`, () => {
|
|
3710
|
+
n();
|
|
3711
|
+
});
|
|
3712
|
+
i.push(a), n();
|
|
3713
|
+
}
|
|
3714
|
+
this.formBind[t] = i;
|
|
3715
|
+
}
|
|
3716
|
+
});
|
|
3717
|
+
},
|
|
3718
|
+
setForm() {
|
|
3719
|
+
Object.keys(this.modelValue).forEach((e) => {
|
|
3720
|
+
this.form[e] = this.modelValue[e];
|
|
3721
|
+
});
|
|
3722
|
+
},
|
|
3723
|
+
setVal() {
|
|
3724
|
+
this.$emit("update:modelValue", this.form), this.$emit("change", this.form);
|
|
3725
|
+
},
|
|
3726
|
+
setLabel() {
|
|
3727
|
+
this.tableOption.filterNull === !0 && (this.form = u(this.form, [""], !1)), this.tableOption.filterDic === !0 ? this.form = u(this.form, ["$"], !1) : this.propOption.forEach((e) => {
|
|
3728
|
+
let t = this.DIC[e.prop];
|
|
3729
|
+
if (q(t)) return;
|
|
3730
|
+
let n = Y(this.form, e, this.tableOption, t);
|
|
3731
|
+
n ? this.form[`$${e.prop}`] = n : delete this.form[`$${e.prop}`];
|
|
3732
|
+
});
|
|
3733
|
+
},
|
|
3734
|
+
handleGroupClick(e) {
|
|
3735
|
+
this.$emit("tab-click", e);
|
|
3736
|
+
},
|
|
3737
|
+
handleTabClick(e, t) {
|
|
3738
|
+
this.$emit("tab-click", e, t);
|
|
3739
|
+
},
|
|
3740
|
+
getLabelWidth(e, t) {
|
|
3741
|
+
let n;
|
|
3742
|
+
return n = q(e.labelWidth) ? q(t.labelWidth) ? this.parentOption.labelWidth : t.labelWidth : e.labelWidth, f(n, this.labelWidth);
|
|
3743
|
+
},
|
|
3744
|
+
validateField(e) {
|
|
3745
|
+
return this.$refs.form.validateField(e);
|
|
3746
|
+
},
|
|
3747
|
+
validTip(e) {
|
|
3748
|
+
return !e.tip || e.type === "upload";
|
|
3749
|
+
},
|
|
3750
|
+
getPropRef(e) {
|
|
3751
|
+
return this.$refs[e][0];
|
|
3752
|
+
},
|
|
3753
|
+
handleChange(e, t) {
|
|
3754
|
+
this.$nextTick(() => {
|
|
3755
|
+
let n = t.cascader, r = n.join(",");
|
|
3756
|
+
n.forEach((i) => {
|
|
3757
|
+
let o = i, s = this.form[t.prop], c = this.findObject(e, o);
|
|
3758
|
+
q(c) || (this.formList.includes(r) && n.forEach((e) => {
|
|
3759
|
+
this.form[e] = "", this.DIC[e] = [];
|
|
3760
|
+
}), !(q(n) || q(s) || q(c)) && b({
|
|
3761
|
+
column: c,
|
|
3762
|
+
value: s,
|
|
3763
|
+
form: this.form
|
|
3764
|
+
}).then((e) => {
|
|
3765
|
+
this.formList.includes(r) || this.formList.push(r);
|
|
3766
|
+
let t = e || [];
|
|
3767
|
+
this.DIC[o] = t, !q(t) && !q(t) && !q(c.cascaderIndex) && q(this.form[o]) && (this.form[o] = t[c.cascaderIndex][(c.props || {}).value || a.value]);
|
|
3768
|
+
}));
|
|
3769
|
+
});
|
|
3770
|
+
});
|
|
3771
|
+
},
|
|
3772
|
+
handlePrint() {
|
|
3773
|
+
this.$Print(this.$el);
|
|
3774
|
+
},
|
|
3775
|
+
propChange(e, t) {
|
|
3776
|
+
t.cascader && this.handleChange(e, t);
|
|
3777
|
+
},
|
|
3778
|
+
handleMock() {
|
|
3779
|
+
this.isMock && (this.columnOption.forEach((e) => {
|
|
3780
|
+
let t = On(e.column, this.DIC, this.form, this.isMock);
|
|
3781
|
+
q(t) || Object.keys(t).forEach((e) => {
|
|
3782
|
+
this.form[e] = t[e];
|
|
3783
|
+
});
|
|
3784
|
+
}), this.$nextTick(() => {
|
|
3785
|
+
this.clearValidate(), this.$emit("mock-change", this.form);
|
|
3786
|
+
}));
|
|
3787
|
+
},
|
|
3788
|
+
vaildDetail(e) {
|
|
3789
|
+
let t;
|
|
3790
|
+
if (this.detail) return !1;
|
|
3791
|
+
if (!q(e.detail)) t = "detail";
|
|
3792
|
+
else if (this.isAdd) t = "addDetail";
|
|
3793
|
+
else if (this.isEdit) t = "editDetail";
|
|
3794
|
+
else if (this.isView) return !1;
|
|
3795
|
+
return t ? e[t] === !0 : !1;
|
|
3796
|
+
},
|
|
3797
|
+
vaildDisabled(e) {
|
|
3798
|
+
let t;
|
|
3799
|
+
if (this.disabled) return !0;
|
|
3800
|
+
if (!q(e.disabled)) t = "disabled";
|
|
3801
|
+
else if (this.isAdd) t = "addDisabled";
|
|
3802
|
+
else if (this.isEdit) t = "editDisabled";
|
|
3803
|
+
else if (this.isView) return !0;
|
|
3804
|
+
return t ? e[t] === !0 : !1;
|
|
3805
|
+
},
|
|
3806
|
+
vaildDisplay(e) {
|
|
3807
|
+
let t;
|
|
3808
|
+
return q(e.display) ? this.isAdd ? t = "addDisplay" : this.isEdit ? t = "editDisplay" : this.isView && (t = "viewDisplay") : t = "display", t ? h(e[t], !0) : !0;
|
|
3809
|
+
},
|
|
3810
|
+
clearValidate(e) {
|
|
3811
|
+
var t;
|
|
3812
|
+
(t = this.$refs.form) == null || t.clearValidate(e);
|
|
3813
|
+
},
|
|
3814
|
+
validateCellForm() {
|
|
3815
|
+
return new Promise((e) => {
|
|
3816
|
+
this.$refs.form.validate((t, n) => {
|
|
3817
|
+
e(n);
|
|
3818
|
+
});
|
|
3819
|
+
});
|
|
3820
|
+
},
|
|
3821
|
+
validate(e) {
|
|
3822
|
+
this.$refs.form.validate((t, n) => {
|
|
3823
|
+
let r = [], i = [], a = {};
|
|
3824
|
+
this.dynamicOption.forEach((e) => {
|
|
3825
|
+
let t = e.children.type === "form";
|
|
3826
|
+
i.push(e.prop), t ? q(this.$refs[e.prop][0].$refs.temp.$refs.main) || this.$refs[e.prop][0].$refs.temp.$refs.main.forEach((e) => {
|
|
3827
|
+
r.push(e.validateCellForm());
|
|
3828
|
+
}) : r.push(this.$refs[e.prop][0].$refs.temp.$refs.main.validateCellForm());
|
|
3829
|
+
}), Promise.all(r).then((t) => {
|
|
3830
|
+
t.forEach((e, t) => {
|
|
3831
|
+
q(e) || (a[i[t]] = e);
|
|
3832
|
+
});
|
|
3833
|
+
let r = Object.assign(a, n);
|
|
3834
|
+
q(r) ? (this.show(), e(!0, this.hide)) : e(!1, this.hide, r);
|
|
3835
|
+
});
|
|
3836
|
+
});
|
|
3837
|
+
},
|
|
3838
|
+
resetForm(e = !0) {
|
|
3839
|
+
if (e) {
|
|
3840
|
+
let e = this.propOption.map((e) => e.prop);
|
|
3841
|
+
this.form = g(this.form, e, (this.tableOption.filterParams || []).concat([this.rowKey]));
|
|
3842
|
+
}
|
|
3843
|
+
this.$nextTick(() => {
|
|
3844
|
+
this.clearValidate(), this.$emit("reset-change");
|
|
3845
|
+
});
|
|
3846
|
+
},
|
|
3847
|
+
resetFields() {
|
|
3848
|
+
this.$refs.form.resetFields();
|
|
3849
|
+
},
|
|
3850
|
+
show() {
|
|
3851
|
+
this.allDisabled = !0;
|
|
3852
|
+
},
|
|
3853
|
+
hide() {
|
|
3854
|
+
this.allDisabled = !1;
|
|
3855
|
+
},
|
|
3856
|
+
submit() {
|
|
3857
|
+
this.validate((e, t) => {
|
|
3858
|
+
e ? this.$emit("submit", u(this.form, ["$"]), this.hide) : this.$emit("error", t);
|
|
3859
|
+
});
|
|
3860
|
+
}
|
|
3861
|
+
}
|
|
3862
|
+
}, An = ["innerHTML"];
|
|
3863
|
+
function jn(e, t, n, r, i, a) {
|
|
3864
|
+
var o;
|
|
3865
|
+
let s = Ye, c = Ze, l = $e, u = Dn, d = C, f = x, p = ft, m = lt, h = Je, g = We;
|
|
3866
|
+
return R(), O("div", {
|
|
3867
|
+
class: F(["avue-form", { "avue--detail": a.isDetail }]),
|
|
3868
|
+
style: L({ width: a.setPx(a.parentOption.formWidth, "100%") })
|
|
3869
|
+
}, [M(g, {
|
|
3870
|
+
ref: "form",
|
|
3871
|
+
"status-icon": a.parentOption.statusIcon,
|
|
3872
|
+
model: i.form,
|
|
3873
|
+
"label-suffix": a.labelSuffix,
|
|
3874
|
+
size: ((o = e.AVUE) == null ? void 0 : o.formSize) || e.controlSize,
|
|
3875
|
+
"label-position": a.parentOption.labelPosition,
|
|
3876
|
+
"label-width": a.setPx(a.parentOption.labelWidth, i.labelWidth),
|
|
3877
|
+
onSubmit: t[1] || (t[1] = K(() => {}, ["prevent"]))
|
|
3878
|
+
}, {
|
|
3879
|
+
default: W(() => [M(h, {
|
|
3880
|
+
span: 24,
|
|
3881
|
+
class: F({ "avue-form__tabs": a.isTabs })
|
|
3882
|
+
}, {
|
|
3883
|
+
default: W(() => [(R(!0), O(T, null, z(a.columnOption, (n, r) => (R(), E(m, {
|
|
3884
|
+
key: n.prop,
|
|
3885
|
+
tabs: a.isTabs,
|
|
3886
|
+
arrow: n.arrow,
|
|
3887
|
+
collapse: n.collapse,
|
|
3888
|
+
display: a.vaildDisplay(n),
|
|
3889
|
+
icon: n.icon,
|
|
3890
|
+
index: r,
|
|
3891
|
+
header: !a.isTabs,
|
|
3892
|
+
active: i.activeName,
|
|
3893
|
+
label: n.label,
|
|
3894
|
+
onChange: a.handleGroupClick
|
|
3895
|
+
}, A({
|
|
3896
|
+
tabs: W(() => [a.isTabs && r === 1 ? (R(), E(c, {
|
|
3897
|
+
key: 0,
|
|
3898
|
+
modelValue: i.activeName,
|
|
3899
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => i.activeName = e),
|
|
3900
|
+
class: "avue-form__tabs",
|
|
3901
|
+
type: a.tabsType,
|
|
3902
|
+
onTabClick: a.handleTabClick
|
|
3903
|
+
}, {
|
|
3904
|
+
default: W(() => [(R(!0), O(T, null, z(a.columnOption, (t, n) => (R(), O(T, null, [a.vaildDisplay(t) && n !== 0 ? (R(), E(s, {
|
|
3905
|
+
key: n,
|
|
3906
|
+
name: `${n}`
|
|
3907
|
+
}, {
|
|
3908
|
+
label: W(() => [k("span", null, [e.getSlotName(t, "H", e.$slots) ? B(e.$slots, e.getSlotName(t, "H"), {
|
|
3909
|
+
key: 0,
|
|
3910
|
+
column: e.column
|
|
3911
|
+
}) : (R(), O(T, { key: 1 }, [k("i", { class: F(t.icon) }, "\xA0", 2), j(" " + U(t.label), 1)], 64))])]),
|
|
3912
|
+
_: 2
|
|
3913
|
+
}, 1032, ["name"])) : D("v-if", !0)], 64))), 256))]),
|
|
3914
|
+
_: 3
|
|
3915
|
+
}, 8, [
|
|
3916
|
+
"modelValue",
|
|
3917
|
+
"type",
|
|
3918
|
+
"onTabClick"
|
|
3919
|
+
])) : D("v-if", !0)]),
|
|
3920
|
+
default: W(() => [G(k("div", { class: F(["avue-form__group", { "avue-form__group--flex": n.flex === !1 }]) }, [(R(!0), O(T, null, z(n.column, (r, o) => (R(), O(T, null, [a.vaildDisplay(r) ? (R(), E(f, {
|
|
3921
|
+
key: o,
|
|
3922
|
+
style: L({
|
|
3923
|
+
paddingLeft: a.gutter,
|
|
3924
|
+
paddingRight: a.gutter
|
|
3925
|
+
}),
|
|
3926
|
+
span: a.getSpan(r),
|
|
3927
|
+
md: a.getSpan(r),
|
|
3928
|
+
sm: r.smSpan || n.smSpan || 12,
|
|
3929
|
+
xs: r.xsSpan || n.xmSpan || 24,
|
|
3930
|
+
offset: r.offset || n.offset,
|
|
3931
|
+
push: r.push || n.push,
|
|
3932
|
+
pull: r.pull || n.pull,
|
|
3933
|
+
class: F([
|
|
3934
|
+
"avue-form__row",
|
|
3935
|
+
{ "avue--detail avue--detail__column": a.vaildDetail(r) },
|
|
3936
|
+
r.className
|
|
3937
|
+
])
|
|
3938
|
+
}, {
|
|
3939
|
+
default: W(() => [M(d, {
|
|
3940
|
+
prop: r.prop,
|
|
3941
|
+
label: r.label,
|
|
3942
|
+
rules: r.rules,
|
|
3943
|
+
class: F(`avue-form__item--${r.labelPosition || n.labelPosition || ""}`),
|
|
3944
|
+
"label-position": r.labelPosition || n.labelPosition || a.parentOption.labelPosition,
|
|
3945
|
+
"label-width": a.getLabelWidth(r, n)
|
|
3946
|
+
}, A({
|
|
3947
|
+
default: W(() => [(R(), E(H(a.validTip(r) ? "div" : "elTooltip"), {
|
|
3948
|
+
class: "avue-form-item-input-wrapper",
|
|
3949
|
+
disabled: a.validTip(r),
|
|
3950
|
+
content: r.tip || a.getPlaceholder(r),
|
|
3951
|
+
placement: r.tipPlacement
|
|
3952
|
+
}, {
|
|
3953
|
+
default: W(() => [e.$slots[r.prop] ? B(e.$slots, r.prop, {
|
|
3954
|
+
key: 0,
|
|
3955
|
+
modelValue: i.form[r.prop],
|
|
3956
|
+
column: r,
|
|
3957
|
+
label: i.form[`$${r.prop}`],
|
|
3958
|
+
size: r.size || e.controlSize,
|
|
3959
|
+
readonly: a.readonly || r.readonly,
|
|
3960
|
+
disabled: a.getDisabled(r),
|
|
3961
|
+
dic: e.DIC[r.prop]
|
|
3962
|
+
}) : (R(), E(u, P({
|
|
3963
|
+
key: 1,
|
|
3964
|
+
ref_for: !0,
|
|
3965
|
+
ref: r.prop
|
|
3966
|
+
}, { ref_for: !0 }, a.uploadFun(r), {
|
|
3967
|
+
modelValue: i.form[r.prop],
|
|
3968
|
+
"onUpdate:modelValue": (e) => i.form[r.prop] = e,
|
|
3969
|
+
column: r,
|
|
3970
|
+
dic: e.DIC[r.prop],
|
|
3971
|
+
props: a.parentOption.props,
|
|
3972
|
+
"props-http": a.parentOption.propsHttp,
|
|
3973
|
+
disabled: a.getDisabled(r),
|
|
3974
|
+
readonly: r.readonly || a.readonly,
|
|
3975
|
+
enter: a.parentOption.enter,
|
|
3976
|
+
size: r.size || e.controlSize,
|
|
3977
|
+
"column-slot": a.columnSlot,
|
|
3978
|
+
onEnter: a.submit,
|
|
3979
|
+
onChange: (e) => a.propChange(n.column, r)
|
|
3980
|
+
}), A({
|
|
3981
|
+
default: W(() => [(R(!0), O(T, null, z(e.getSlotName(r, "T", e.$slots) ? [r] : [], (t) => B(e.$slots, e.getSlotName(t, "T"), P({ ref_for: !0 }, e.scope))), 256))]),
|
|
3982
|
+
_: 2
|
|
3983
|
+
}, [z(a.columnSlot, (t) => ({
|
|
3984
|
+
name: t,
|
|
3985
|
+
fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
|
|
3986
|
+
}))]), 1040, [
|
|
3987
|
+
"modelValue",
|
|
3988
|
+
"onUpdate:modelValue",
|
|
3989
|
+
"column",
|
|
3990
|
+
"dic",
|
|
3991
|
+
"props",
|
|
3992
|
+
"props-http",
|
|
3993
|
+
"disabled",
|
|
3994
|
+
"readonly",
|
|
3995
|
+
"enter",
|
|
3996
|
+
"size",
|
|
3997
|
+
"column-slot",
|
|
3998
|
+
"onEnter",
|
|
3999
|
+
"onChange"
|
|
4000
|
+
]))]),
|
|
4001
|
+
_: 2
|
|
4002
|
+
}, 1032, [
|
|
4003
|
+
"disabled",
|
|
4004
|
+
"content",
|
|
4005
|
+
"placement"
|
|
4006
|
+
]))]),
|
|
4007
|
+
_: 2
|
|
4008
|
+
}, [e.getSlotName(r, "L", e.$slots) ? {
|
|
4009
|
+
name: "label",
|
|
4010
|
+
fn: W(() => [B(e.$slots, e.getSlotName(r, "L"), {
|
|
4011
|
+
column: r,
|
|
4012
|
+
modelValue: i.form[r.prop],
|
|
4013
|
+
readonly: r.readonly || a.readonly,
|
|
4014
|
+
disabled: a.getDisabled(r),
|
|
4015
|
+
size: r.size || e.controlSize,
|
|
4016
|
+
dic: e.DIC[r.prop]
|
|
4017
|
+
})]),
|
|
4018
|
+
key: "0"
|
|
4019
|
+
} : r.labelTip ? {
|
|
4020
|
+
name: "label",
|
|
4021
|
+
fn: W(() => [M(l, {
|
|
4022
|
+
class: "item",
|
|
4023
|
+
effect: "dark",
|
|
4024
|
+
placement: r.labelTipPlacement || "top-start"
|
|
4025
|
+
}, {
|
|
4026
|
+
content: W(() => [k("div", { innerHTML: r.labelTip }, null, 8, An)]),
|
|
4027
|
+
default: W(() => [t[2] || (t[2] = k("i", { class: "el-icon-info" }, null, -1))]),
|
|
4028
|
+
_: 2
|
|
4029
|
+
}, 1032, ["placement"]), k("span", null, U(r.label) + U(a.labelSuffix), 1)]),
|
|
4030
|
+
key: "1"
|
|
4031
|
+
} : void 0, e.getSlotName(r, "E", e.$slots) ? {
|
|
4032
|
+
name: "error",
|
|
4033
|
+
fn: W((t) => [B(e.$slots, e.getSlotName(r, "E"), P({ ref_for: !0 }, Object.assign(t, {
|
|
4034
|
+
column: r,
|
|
4035
|
+
value: i.form[r.prop],
|
|
4036
|
+
readonly: a.readonly || r.readonly,
|
|
4037
|
+
disabled: a.getDisabled(r),
|
|
4038
|
+
size: r.size || e.controlSize,
|
|
4039
|
+
dic: e.DIC[r.prop]
|
|
4040
|
+
})))]),
|
|
4041
|
+
key: "2"
|
|
4042
|
+
} : void 0]), 1032, [
|
|
4043
|
+
"prop",
|
|
4044
|
+
"label",
|
|
4045
|
+
"rules",
|
|
4046
|
+
"class",
|
|
4047
|
+
"label-position",
|
|
4048
|
+
"label-width"
|
|
4049
|
+
])]),
|
|
4050
|
+
_: 2
|
|
4051
|
+
}, 1032, [
|
|
4052
|
+
"style",
|
|
4053
|
+
"span",
|
|
4054
|
+
"md",
|
|
4055
|
+
"sm",
|
|
4056
|
+
"xs",
|
|
4057
|
+
"offset",
|
|
4058
|
+
"push",
|
|
4059
|
+
"pull",
|
|
4060
|
+
"class"
|
|
4061
|
+
])) : D("v-if", !0), a.vaildDisplay(r) && r.row && r.span !== 24 && r.count ? (R(), O("div", {
|
|
4062
|
+
key: `line${o}`,
|
|
4063
|
+
class: "avue-form__line",
|
|
4064
|
+
style: L({ width: `${r.count / 24 * 100}%` })
|
|
4065
|
+
}, null, 4)) : D("v-if", !0)], 64))), 256)), !a.isDetail && !a.isMenu ? (R(), E(p, { key: 0 }, {
|
|
4066
|
+
menuForm: W((t) => [B(e.$slots, "menuForm", P({ ref_for: !0 }, t))]),
|
|
4067
|
+
_: 3
|
|
4068
|
+
})) : D("v-if", !0)], 2), [[rt, a.isGroupShow(n, r)]])]),
|
|
4069
|
+
_: 2
|
|
4070
|
+
}, [e.getSlotName(n, "H", e.$slots) ? {
|
|
4071
|
+
name: "header",
|
|
4072
|
+
fn: W(() => [B(e.$slots, e.getSlotName(n, "H"), { column: n })]),
|
|
4073
|
+
key: "0"
|
|
4074
|
+
} : void 0]), 1032, [
|
|
4075
|
+
"tabs",
|
|
4076
|
+
"arrow",
|
|
4077
|
+
"collapse",
|
|
4078
|
+
"display",
|
|
4079
|
+
"icon",
|
|
4080
|
+
"index",
|
|
4081
|
+
"header",
|
|
4082
|
+
"active",
|
|
4083
|
+
"label",
|
|
4084
|
+
"onChange"
|
|
4085
|
+
]))), 128)), !a.isDetail && a.isMenu ? (R(), E(p, { key: 0 }, {
|
|
4086
|
+
menuForm: W((t) => [B(e.$slots, "menuForm", I(N(t)))]),
|
|
4087
|
+
_: 3
|
|
4088
|
+
})) : D("v-if", !0)]),
|
|
4089
|
+
_: 3
|
|
4090
|
+
}, 8, ["class"])]),
|
|
4091
|
+
_: 3
|
|
4092
|
+
}, 8, [
|
|
4093
|
+
"status-icon",
|
|
4094
|
+
"model",
|
|
4095
|
+
"label-suffix",
|
|
4096
|
+
"size",
|
|
4097
|
+
"label-position",
|
|
4098
|
+
"label-width"
|
|
4099
|
+
])], 6);
|
|
4100
|
+
}
|
|
4101
|
+
var $ = /* @__PURE__ */ t(kn, [["render", jn]]);
|
|
4102
|
+
//#endregion
|
|
4103
|
+
export { Q as i, Cn as n, _n as r, $ as t };
|