fast-element-plus 2.0.0 → 2.0.1
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/CHANGELOG.md +11 -0
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/dist/components/button/src/button.mjs +1 -1
- package/dist/components/carNumber/src/carNumber.mjs +2 -3
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.mjs +2 -2
- package/dist/components/dialog/src/dialog.mjs +1 -1
- package/dist/components/drawer/src/drawer.mjs +1 -1
- package/dist/components/form/src/form.mjs +1 -2
- package/dist/components/form/src/form.mjs.map +1 -1
- package/dist/components/form/src/formItem.mjs +1 -1
- package/dist/components/iconSelector/src/iconSelector.mjs +1 -2
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +2 -5
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.mjs +1 -3
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +1 -1
- package/dist/components/select/src/select.mjs +2 -9
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.mjs +1 -1
- package/dist/components/selectPage/src/selectPage.mjs +2 -9
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.mjs +2 -9
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/src/table.mjs +1 -9
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.mjs +1 -6
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/src/tableColumnSettingDialog.mjs +1 -1
- package/dist/components/table/src/tablePagination.mjs +1 -2
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/components/table/src/tableSearchFormItem.mjs +1 -1
- package/dist/components/table/src/useTable.mjs +1 -2
- package/dist/components/table/src/useTable.mjs.map +1 -1
- package/dist/components/table/utils/table.mjs +1 -3
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/components/tree/src/tree.mjs +2 -7
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.mjs +2 -9
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.mjs +1 -3
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/upload/src/useUpload.mjs +3 -5
- package/dist/components/upload/src/useUpload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.mjs +1 -3
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.mjs +1 -2
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/element-plus.mjs +1 -2
- package/dist/element-plus.mjs.map +1 -1
- package/dist/hooks/use-screenFull/index.mjs +13 -13
- package/dist/hooks/use-screenFull/index.mjs.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/index.mjs +2 -3
- package/dist/index.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +0 -13
- package/dist/components/index.mjs +0 -124
- package/dist/components/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs +0 -100
- package/dist/node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@vueuse_shared@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.mjs +0 -25
- package/dist/node_modules/.pnpm/@vueuse_shared@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.mjs +0 -1997
- package/dist/node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.mjs +0 -30
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.mjs +0 -30
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.mjs +0 -30
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Set.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Set.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.mjs +0 -23
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Stack.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Stack.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_apply.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_apply.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.mjs +0 -22
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.mjs +0 -26
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.mjs +0 -20
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.mjs +0 -23
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.mjs +0 -118
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.mjs +0 -31
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.mjs +0 -22
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.mjs +0 -26
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.mjs +0 -61
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.mjs +0 -37
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.mjs +0 -47
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.mjs +0 -22
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.mjs +0 -23
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.mjs +0 -25
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.mjs +0 -29
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.mjs +0 -17
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.mjs +0 -31
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.mjs +0 -16
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castPath.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castPath.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.mjs +0 -30
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.mjs +0 -13
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.mjs +0 -57
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.mjs +0 -77
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.mjs +0 -56
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.mjs +0 -7
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getNative.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getNative.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.mjs +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.mjs +0 -38
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getTag.mjs +0 -45
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getTag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.mjs +0 -16
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.mjs +0 -17
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.mjs +0 -20
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.mjs +0 -22
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.mjs +0 -66
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.mjs +0 -20
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.mjs +0 -22
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKey.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKey.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.mjs +0 -16
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.mjs +0 -16
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.mjs +0 -25
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.mjs +0 -23
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.mjs +0 -20
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.mjs +0 -22
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.mjs +0 -7
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.mjs +0 -7
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.mjs +0 -20
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.mjs +0 -28
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_parent.mjs +0 -18
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_parent.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_root.mjs +0 -10
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_root.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.mjs +0 -17
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToString.mjs +0 -16
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.mjs +0 -29
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.mjs +0 -17
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.mjs +0 -19
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.mjs +0 -17
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.mjs +0 -17
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.mjs +0 -35
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.mjs +0 -25
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toKey.mjs +0 -20
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toKey.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toSource.mjs +0 -25
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toSource.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/constant.mjs +0 -29
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/constant.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.mjs +0 -40
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs +0 -23
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.mjs +0 -24
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.mjs +0 -36
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs +0 -29
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.mjs +0 -35
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBoolean.mjs +0 -29
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBoolean.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.mjs +0 -31
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.mjs +0 -37
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.mjs +0 -34
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.mjs +0 -36
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isMap.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isMap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs +0 -28
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs +0 -25
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs +0 -38
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.mjs +0 -34
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.mjs +0 -32
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.mjs +0 -54
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSet.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSet.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs +0 -30
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.mjs +0 -29
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.mjs +0 -27
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.mjs +0 -25
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.mjs +0 -39
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.mjs +0 -34
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.mjs +0 -23
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.mjs +0 -65
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/omit.mjs +0 -52
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/omit.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.mjs +0 -26
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.mjs +0 -21
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.mjs.map +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.mjs +0 -30
- package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs +0 -120
- package/dist/node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.mjs +0 -1925
- package/dist/node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.mjs.map +0 -1
|
@@ -5,9 +5,9 @@ import { useRender } from "../../../utils/vue/render.mjs";
|
|
|
5
5
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
6
6
|
import { FaDialog } from "../../dialog/index.mjs";
|
|
7
7
|
import { tableStateKey } from "./useTable.mjs";
|
|
8
|
-
import { Sortable } from "../../../node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.mjs";
|
|
9
8
|
import { Fragment, createTextVNode, createVNode, defineComponent, inject, mergeProps, onBeforeUnmount, reactive, ref } from "vue";
|
|
10
9
|
import { ElInput, ElInputNumber, ElMessage, ElNotification, ElRadio, ElRadioGroup, ElSwitch, ElTable, ElTableColumn, ElText } from "element-plus";
|
|
10
|
+
import Sortable from "sortablejs";
|
|
11
11
|
//#region src/components/table/src/tableColumnSettingDialog.tsx
|
|
12
12
|
var tableColumnSettingDialog_default = defineComponent({
|
|
13
13
|
name: "FaTableColumnsSettingDialog",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { definePropType } from "../../../utils/vue/props.mjs";
|
|
2
2
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
3
|
-
import isNumber from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs";
|
|
4
|
-
import isNull from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs";
|
|
5
3
|
import { tableStateKey } from "./useTable.mjs";
|
|
6
4
|
import { createVNode, defineComponent, inject, mergeProps } from "vue";
|
|
7
5
|
import { ElNotification, ElPagination } from "element-plus";
|
|
6
|
+
import { isNull, isNumber } from "lodash-unified";
|
|
8
7
|
//#region src/components/table/src/tablePagination.tsx
|
|
9
8
|
var tablePagination_default = defineComponent({
|
|
10
9
|
name: "FaTablePagination",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tablePagination.mjs","names":["onUpdate:currentPage"],"sources":["../../../../src/components/table/src/tablePagination.tsx"],"sourcesContent":["import { defineComponent, inject } from \"vue\";\nimport { ElNotification, ElPagination } from \"element-plus\";\nimport { isNull, isNumber } from \"lodash-unified\";\nimport { definePropType, useRender } from \"../../../utils\";\nimport { tableStateKey } from \"./useTable\";\n\nexport default defineComponent({\n\tname: \"FaTablePagination\",\n\tprops: {\n\t\t/** @description 页码 */\n\t\tpageSizes: {\n\t\t\ttype: definePropType<number[]>(Array),\n\t\t\tdefault: [20, 30, 50, 100],\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 页码改变 */\n\t\tsizeChange: (pageSize: number) => isNumber(pageSize) || isNull(pageSize),\n\t\t/** @description 当前页数改变 */\n\t\tcurrentChange: (currentPage: number) => isNumber(currentPage) || isNull(currentPage),\n\t},\n\tsetup(props, { emit }) {\n\t\tconst tableState = inject(tableStateKey);\n\t\tif (tableState === undefined) {\n\t\t\tthrow new Error(\"FaTablePagination 必须在 FaTable 内部渲染。\");\n\t\t}\n\n\t\tconst handleSizeChange = (pageSize: number): void => {\n\t\t\tif (pageSize > 100) {\n\t\t\t\tElNotification({\n\t\t\t\t\ttitle: \"欢迎\",\n\t\t\t\t\tmessage: \"当前页码已经超过100条/页,可能会造成页面卡顿。\",\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tduration: 2000,\n\t\t\t\t});\n\t\t\t}\n\t\t\temit(\"sizeChange\", pageSize);\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<ElPagination\n\t\t\t\t{...{\n\t\t\t\t\t\"onUpdate:currentPage\": (currentPage: number) => emit(\"currentChange\", currentPage),\n\t\t\t\t\t\"onUpdate:pageSize\": handleSizeChange,\n\t\t\t\t}}\n\t\t\t\tclass=\"fa-table-pagination\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tcurrentPage={tableState.tablePagination.pageIndex}\n\t\t\t\tpageSize={tableState.tablePagination.pageSize}\n\t\t\t\tpageSizes={props.pageSizes}\n\t\t\t\tbackground\n\t\t\t\tlayout=\"jumper, prev, pager, next, sizes, total\"\n\t\t\t\ttotal={tableState.tablePagination.totalRows}\n\t\t\t/>\n\t\t));\n\t},\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tablePagination.mjs","names":["onUpdate:currentPage"],"sources":["../../../../src/components/table/src/tablePagination.tsx"],"sourcesContent":["import { defineComponent, inject } from \"vue\";\nimport { ElNotification, ElPagination } from \"element-plus\";\nimport { isNull, isNumber } from \"lodash-unified\";\nimport { definePropType, useRender } from \"../../../utils\";\nimport { tableStateKey } from \"./useTable\";\n\nexport default defineComponent({\n\tname: \"FaTablePagination\",\n\tprops: {\n\t\t/** @description 页码 */\n\t\tpageSizes: {\n\t\t\ttype: definePropType<number[]>(Array),\n\t\t\tdefault: [20, 30, 50, 100],\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 页码改变 */\n\t\tsizeChange: (pageSize: number) => isNumber(pageSize) || isNull(pageSize),\n\t\t/** @description 当前页数改变 */\n\t\tcurrentChange: (currentPage: number) => isNumber(currentPage) || isNull(currentPage),\n\t},\n\tsetup(props, { emit }) {\n\t\tconst tableState = inject(tableStateKey);\n\t\tif (tableState === undefined) {\n\t\t\tthrow new Error(\"FaTablePagination 必须在 FaTable 内部渲染。\");\n\t\t}\n\n\t\tconst handleSizeChange = (pageSize: number): void => {\n\t\t\tif (pageSize > 100) {\n\t\t\t\tElNotification({\n\t\t\t\t\ttitle: \"欢迎\",\n\t\t\t\t\tmessage: \"当前页码已经超过100条/页,可能会造成页面卡顿。\",\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tduration: 2000,\n\t\t\t\t});\n\t\t\t}\n\t\t\temit(\"sizeChange\", pageSize);\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<ElPagination\n\t\t\t\t{...{\n\t\t\t\t\t\"onUpdate:currentPage\": (currentPage: number) => emit(\"currentChange\", currentPage),\n\t\t\t\t\t\"onUpdate:pageSize\": handleSizeChange,\n\t\t\t\t}}\n\t\t\t\tclass=\"fa-table-pagination\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tcurrentPage={tableState.tablePagination.pageIndex}\n\t\t\t\tpageSize={tableState.tablePagination.pageSize}\n\t\t\t\tpageSizes={props.pageSizes}\n\t\t\t\tbackground\n\t\t\t\tlayout=\"jumper, prev, pager, next, sizes, total\"\n\t\t\t\ttotal={tableState.tablePagination.totalRows}\n\t\t\t/>\n\t\t));\n\t},\n});\n"],"mappings":";;;;;;;AAMA,IAAA,0BAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;AAEN,WAAW;EACV,MAAM,eAAyB,KAAK;EACpC,SAAS;GAAC;GAAI;GAAI;GAAI;EAAG;CAC1B,EACD;CACA,OAAO;;EAEN,aAAa,aAAqB,SAAS,QAAQ,KAAK,OAAO,QAAQ;;EAEvE,gBAAgB,gBAAwB,SAAS,WAAW,KAAK,OAAO,WAAW;CACpF;CACA,MAAM,OAAO,EAAE,QAAQ;EACtB,MAAM,aAAa,OAAO,aAAa;EACvC,IAAI,eAAe,KAAA,GAClB,MAAM,IAAI,MAAM,qCAAqC;EAGtD,MAAM,oBAAoB,aAA2B;GACpD,IAAI,WAAW,KACd,eAAe;IACd,OAAO;IACP,SAAS;IACT,MAAM;IACN,UAAU;GACX,CAAC;GAEF,KAAK,cAAc,QAAQ;EAC5B;EAEA,gBAAU,YAAA,cAAA,WAAA;GAGP,yBAAyB,gBAAwB,KAAK,iBAAiB,WAAW;GAClF,qBAAqB;EAAgB,GAAA;GAAA,SAAA;GAAA,QAAA;GAAA,eAIzB,WAAW,gBAAgB;GAAS,YACvC,WAAW,gBAAgB;GAAQ,aAClC,MAAM;GAAS,cAAA;GAAA,UAAA;GAAA,SAGnB,WAAW,gBAAgB;EAAS,CAAA,GAAA,IAAA,CAE5C;CACF;AACD,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { definePropType } from "../../../utils/vue/props.mjs";
|
|
|
3
3
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
4
4
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
5
5
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
6
|
-
import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
|
|
7
6
|
import { getTableDefaultSlots } from "./table.type.mjs";
|
|
8
7
|
import { enumMapKey, tableStateKey } from "./useTable.mjs";
|
|
9
8
|
import { Fragment, createVNode, defineComponent, h, inject, reactive, resolveComponent } from "vue";
|
|
10
9
|
import { ElOption } from "element-plus";
|
|
10
|
+
import { isString } from "lodash-unified";
|
|
11
11
|
//#region src/components/table/src/tableSearchFormItem.tsx
|
|
12
12
|
/**
|
|
13
13
|
* 已知默认支持的el组件:
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { debounce } from "../../../utils/async/index.mjs";
|
|
2
2
|
import { callOptionalFunction } from "../../../utils/vue/func.mjs";
|
|
3
|
-
import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
|
|
4
|
-
import isFunction from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.mjs";
|
|
5
3
|
import { tableUtil } from "../utils/table.mjs";
|
|
6
4
|
import { getTableDefaultSlots } from "./table.type.mjs";
|
|
7
5
|
import { computed, nextTick, provide, reactive, ref, watch } from "vue";
|
|
8
6
|
import { dayjs, useGlobalSize } from "element-plus";
|
|
7
|
+
import { isArray, isFunction } from "lodash-unified";
|
|
9
8
|
//#region src/components/table/src/useTable.ts
|
|
10
9
|
/** FaTable 状态的依赖注入键。 */
|
|
11
10
|
const tableStateKey = Symbol("tableState");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTable.mjs","names":[],"sources":["../../../../src/components/table/src/useTable.ts"],"sourcesContent":["import { computed, nextTick, provide, reactive, ref, watch } from \"vue\";\nimport { dayjs, useGlobalSize } from \"element-plus\";\nimport { isArray, isFunction } from \"lodash-unified\";\nimport { callOptionalFunction, debounce, type makeSlots } from \"../../../utils\";\nimport { tableUtil } from \"../utils/table\";\nimport { getTableDefaultSlots } from \"./table.type\";\nimport type { PagedInput, PagedResult } from \"./page.type\";\nimport type { FaTableSlots, faTableEmits, faTableProps } from \"./table\";\nimport type { FaTableRow, FaTableState } from \"./table.state\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx } from \"./table.type\";\nimport type { TableInstance } from \"element-plus\";\nimport type { ExtractPropTypes, InjectionKey, Ref, SetupContext } from \"vue\";\n\n/** FaTable 状态的依赖注入键。 */\nexport const tableStateKey: InjectionKey<FaTableState> = Symbol(\"tableState\");\n/** FaTable 枚举映射的依赖注入键。 */\nexport const enumMapKey: InjectionKey<Map<string, FaTableEnumColumnCtx[]>> = Symbol(\"enumMap\");\n\ntype TableSetupContext = SetupContext<typeof faTableEmits, ReturnType<typeof makeSlots<FaTableSlots>>>;\n\ninterface TableComposable {\n\t_globalSize: ReturnType<typeof useGlobalSize>;\n\tstate: FaTableState;\n\telementRef: Ref<HTMLElement | undefined>;\n\ttableRef: Ref<TableInstance | undefined>;\n\thandleTableColumnAutoWidth: () => void;\n\tgetRequestParam: () => PagedInput;\n\tloadTableColumns: () => void;\n\thandleSizeChange: (pageSize: number) => void;\n\thandlePaginationChange: (value: number) => void;\n\tdefaultSearchTime: () => void;\n\ttableSearch: () => Promise<void>;\n\ttableReset: () => Promise<void>;\n\tdoRender: () => Promise<void>;\n\tdoLoading: (loadingFunction: () => void | Promise<void>, loadingText?: string) => void;\n\thandleCustomCellClick: (emitName: string, context: { row: FaTableRow; column: FaTableColumnCtx; $index: number }) => void;\n}\n\n/**\n * 创建 FaTable 的状态和操作方法。\n *\n * @param props - FaTable 的 Props。\n * @param slots - FaTable 的插槽。\n * @param emit - FaTable 的事件触发器。\n * @returns FaTable 的状态、引用和操作方法。\n */\nexport const useTable = (\n\tprops: ExtractPropTypes<typeof faTableProps>,\n\tslots: TableSetupContext[\"slots\"],\n\temit: TableSetupContext[\"emit\"]\n): TableComposable => {\n\tconst _globalSize = useGlobalSize();\n\n\tconst elementRef = ref<HTMLElement>();\n\tconst tableRef = ref<TableInstance>();\n\n\t/**\n\t * 定义 enumMap 存储 enum 值(避免异步请求无法格式化单元格内容 || 无法填充搜索下拉选择)\n\t */\n\tconst enumMap = reactive(new Map<string, FaTableEnumColumnCtx[]>());\n\tprovide(enumMapKey, enumMap);\n\n\tconst state: FaTableState = reactive({\n\t\tloading: false,\n\t\tloadingText: \"加载中...\",\n\t\torgColumns: [],\n\t\ttableColumns: computed(() => state.orgColumns.filter((f) => f.prop && !f.pureSearch)),\n\t\tsearchColumns: computed(() =>\n\t\t\tstate.orgColumns\n\t\t\t\t.filter((item) => item.pureSearch === true || item.search !== undefined)\n\t\t\t\t.sort((a, b) => {\n\t\t\t\t\treturn (a.search?.order ?? 0) - (b.search?.order ?? 0);\n\t\t\t\t})\n\t\t),\n\t\tspanColumns: computed(() => [\n\t\t\t...state.orgColumns.flatMap((column) => (column.spanProp ? [{ prop: column.prop ?? \"\", spanProp: column.spanProp }] : [])),\n\t\t\t...(props.props.span\n\t\t\t\t? [\n\t\t\t\t\t\t{ prop: \"__table-index\", spanProp: props.props.span },\n\t\t\t\t\t\t{ prop: \"__table-selection\", spanProp: props.props.span },\n\t\t\t\t\t\t{ prop: \"__table-operation\", spanProp: props.props.span },\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t]),\n\t\ttableData: [],\n\t\ttableSpanData: computed(() => {\n\t\t\tif (state.spanColumns?.length > 0 && state.tableData?.length > 0) {\n\t\t\t\tconst result: Record<string, number[]> = {};\n\t\t\t\tconst spanIndexes: Record<string, number> = {};\n\t\t\t\tstate.spanColumns.forEach((item) => {\n\t\t\t\t\tresult[item.prop] = new Array<number>(state.tableData.length).fill(1, 0, 1).fill(0, 1);\n\t\t\t\t\tspanIndexes[item.prop] = 0;\n\t\t\t\t});\n\t\t\t\tfor (let i = 1; i < state.tableData.length; i++) {\n\t\t\t\t\tstate.spanColumns.forEach((item) => {\n\t\t\t\t\t\tconst currentRow = state.tableData[i];\n\t\t\t\t\t\tconst previousRow = state.tableData[i - 1];\n\t\t\t\t\t\tconst spanValues = result[item.prop];\n\t\t\t\t\t\tconst spanIndex = spanIndexes[item.prop];\n\t\t\t\t\t\tif (currentRow === undefined || previousRow === undefined || spanValues === undefined || spanIndex === undefined) return;\n\t\t\t\t\t\tif (currentRow[item.spanProp] === previousRow[item.spanProp]) {\n\t\t\t\t\t\t\tspanValues[spanIndex] = (spanValues[spanIndex] ?? 0) + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tspanIndexes[item.prop] = i;\n\t\t\t\t\t\t\tspanValues[i] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn {};\n\t\t}),\n\t\ttablePagination: {\n\t\t\tpageIndex: 1,\n\t\t\tpageSize: 20,\n\t\t\ttotalRows: 0,\n\t\t},\n\t\tinitParam: {},\n\t\tsearchParam: {},\n\t\tsearchValueUpdate: \"\",\n\t\tsearchForm: props.searchForm,\n\t\tselected: false,\n\t\tselectedList: [],\n\t\tselectedListIds: computed(() =>\n\t\t\tstate.selectedList.flatMap((item) => {\n\t\t\t\tconst rowKey = isFunction(props.rowKey) ? props.rowKey(item) : tableUtil.handleRowAccordingToProp(item, props.rowKey);\n\t\t\t\treturn typeof rowKey === \"string\" || typeof rowKey === \"number\" ? [rowKey] : [];\n\t\t\t})\n\t\t),\n\t\tindeterminateSelectedListIds: [],\n\t\toperationColumnWidth: computed(() => {\n\t\t\tconst findAutoCol = state.autoColumnWidth.find((f) => f.prop === \"__table-operation\");\n\t\t\tif (findAutoCol) {\n\t\t\t\treturn `${findAutoCol.width}px`;\n\t\t\t}\n\t\t\tswitch (_globalSize.value) {\n\t\t\t\tcase \"large\":\n\t\t\t\tcase \"default\":\n\t\t\t\t\treturn \"54px\";\n\t\t\t\tcase \"small\":\n\t\t\t\t\treturn \"42px\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn \"auto\";\n\t\t\t}\n\t\t}),\n\t\timagePreview: false,\n\t\tpreviewList: [],\n\t\ttableWidth: 0,\n\t\ttableHeight: 0,\n\t\tautoColumnWidth: [],\n\t});\n\tlet requestVersion = 0;\n\n\tprovide(tableStateKey, state);\n\n\tconst handleTableColumnAutoWidth = (): void => {\n\t\tstate.loading = true;\n\t\tstate.loadingText = \"加载中...\";\n\t\tstate.autoColumnWidth = [];\n\t\tconst autoWidthColumns = state.tableColumns.filter((f) => f.autoWidth);\n\t\tif (slots?.operation) {\n\t\t\t// 操作列自动宽度\n\t\t\tautoWidthColumns.push({\n\t\t\t\tprop: \"__table-operation\",\n\t\t\t});\n\t\t}\n\t\tif (autoWidthColumns.length > 0) {\n\t\t\t// padding24/16 + border1\n\t\t\tconst otherWidth = _globalSize.value === \"default\" ? 25 : 17;\n\t\t\tvoid nextTick(() => {\n\t\t\t\tconst tableDom = document.querySelector(`.fa-table__${props.tableKey}`);\n\t\t\t\tif (tableDom) {\n\t\t\t\t\tautoWidthColumns.forEach((item) => {\n\t\t\t\t\t\tconst headerColumnDom = tableDom.querySelector(`.__fa-table__auto-width-column__cell-header__${item?.prop}`);\n\t\t\t\t\t\tconst cellColumnDoms = tableDom.querySelectorAll(`.__fa-table__auto-width-column__cell__${item?.prop}`);\n\t\t\t\t\t\tlet maxWidth = 0;\n\t\t\t\t\t\tif (headerColumnDom) {\n\t\t\t\t\t\t\tmaxWidth = Math.ceil(headerColumnDom.scrollWidth) + otherWidth;\n\t\t\t\t\t\t\tif (item?.sortable) {\n\t\t\t\t\t\t\t\tmaxWidth += 24;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcellColumnDoms.forEach((cellDom) => {\n\t\t\t\t\t\t\tconst curWidth = Math.ceil(cellDom.scrollWidth) + otherWidth;\n\t\t\t\t\t\t\tif (curWidth > maxWidth) {\n\t\t\t\t\t\t\t\tmaxWidth = curWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconst findInfo = state.autoColumnWidth.find((f) => f.prop === item?.prop);\n\t\t\t\t\t\tif (findInfo) {\n\t\t\t\t\t\t\tfindInfo.width = Math.max(findInfo.width, maxWidth);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (item.prop) {\n\t\t\t\t\t\t\t\tstate.autoColumnWidth.push({\n\t\t\t\t\t\t\t\t\tprop: item.prop,\n\t\t\t\t\t\t\t\t\twidth: maxWidth,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}).finally(() => {\n\t\t\t\tstate.loading = false;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tstate.loading = false;\n\t};\n\n\tconst handleTableData = (data: FaTableRow[]): FaTableRow[] => {\n\t\tif (props.treeData) {\n\t\t\tconst result: FaTableRow[] = [];\n\t\t\tdata.forEach((row) => {\n\t\t\t\tconst rowList = row[props.props.children ?? \"children\"];\n\t\t\t\tif (isArray(rowList)) {\n\t\t\t\t\t// 如果 rowList 是数组,遍历并合并每个子项\n\t\t\t\t\tconst childRows: unknown[] = rowList;\n\t\t\t\t\tchildRows.forEach((childRow) => {\n\t\t\t\t\t\tresult.push(typeof childRow === \"object\" && childRow !== null ? { ...row, ...childRow } : row);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tresult.push(typeof rowList === \"object\" && rowList !== null ? { ...row, ...rowList } : row);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn data;\n\t\t}\n\t};\n\n\tconst getRequestParam = (): PagedInput => {\n\t\tconst params = { ...state.searchParam, ...(props.pagination ? state.tablePagination : {}) };\n\t\t// 删除总条数\n\t\tdelete params.totalRows;\n\t\treturn params;\n\t};\n\n\tconst loadData = async (): Promise<void> => {\n\t\tconst currentRequestVersion = ++requestVersion;\n\t\tstate.loading = true;\n\t\tstate.loadingText = \"加载中...\";\n\t\tif (props.requestApi) {\n\t\t\tconst params = getRequestParam();\n\t\t\temit(\"refresh\", params);\n\t\t\tlet pageData: FaTableRow[];\n\t\t\ttry {\n\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 数据回调\n\t\t\t\tprops.dataCallback?.(resData);\n\t\t\t\t// 解析 API 接口返回的分页数据(如果有分页更新分页信息)\n\t\t\t\tif (props.pagination) {\n\t\t\t\t\tif (isArray(resData)) {\n\t\t\t\t\t\tpageData = resData;\n\t\t\t\t\t\tstate.tablePagination.totalRows = resData.length;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst pageRes = resData as PagedResult;\n\t\t\t\t\t\tpageData = pageRes.rows ?? [];\n\t\t\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\t\t\tpageIndex: pageRes.pageIndex ?? state.tablePagination.pageIndex,\n\t\t\t\t\t\t\tpageSize: pageRes.pageSize ?? state.tablePagination.pageSize,\n\t\t\t\t\t\t\ttotalRows: pageRes.totalRows ?? pageData.length,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tpageData = resData as FaTableRow[];\n\t\t\t\t\t// 更新分页信息\n\t\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\t\tpageIndex: 1,\n\t\t\t\t\t\tpageSize: 0,\n\t\t\t\t\t\ttotalRows: pageData.length,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tstate.tableData = handleTableData(pageData);\n\t\t\t} catch (error) {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\tstate.tableData = [];\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t}\n\t\t} else {\n\t\t\temit(\"refresh\", { searchValue: state.searchParam.searchValue });\n\t\t\tlet _value = handleTableData([...props.data]);\n\t\t\t_value = _value.filter((f) => {\n\t\t\t\tconst searchValue = state.searchParam.searchValue;\n\t\t\t\tif (typeof searchValue !== \"string\" || searchValue.length === 0) return true;\n\t\t\t\treturn state.tableColumns.some((col) => {\n\t\t\t\t\tconst value = tableUtil.handleRowAccordingToProp(f, col.prop ?? \"\");\n\t\t\t\t\tconst text =\n\t\t\t\t\t\ttypeof value === \"string\" || typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\"\n\t\t\t\t\t\t\t? String(value)\n\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\treturn text.toLowerCase().includes(searchValue.toLowerCase());\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (isArray(state.searchParam.sortList) && state.searchParam.sortList.length > 0) {\n\t\t\t\t_value = _value.sort(tableUtil.arrayDynamicSort(state.searchParam.sortList));\n\t\t\t}\n\t\t\tif (props.pagination) {\n\t\t\t\t// 更新分页信息\n\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\ttotalRows: _value.length,\n\t\t\t\t});\n\t\t\t\tconst pageStart = (state.tablePagination.pageIndex - 1) * state.tablePagination.pageSize;\n\t\t\t\tconst pageEnd = pageStart + state.tablePagination.pageSize;\n\t\t\t\tstate.tableData = _value.slice(pageStart, pageEnd);\n\t\t\t} else {\n\t\t\t\tstate.tableData = _value;\n\t\t\t\t// 更新分页信息\n\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\tpageIndex: 1,\n\t\t\t\t\tpageSize: 0,\n\t\t\t\t\ttotalRows: _value.length,\n\t\t\t\t});\n\t\t\t}\n\t\t\tstate.loading = false;\n\t\t}\n\t\thandleTableColumnAutoWidth();\n\t};\n\n\tconst cloneColumns = (columns: FaTableColumnCtx[]): FaTableColumnCtx[] =>\n\t\tcolumns.map((column) => ({\n\t\t\t...column,\n\t\t\t...(column.search && { search: { ...column.search, ...(column.search.props && { props: { ...column.search.props } }) } }),\n\t\t\t...(column._children && { _children: cloneColumns(column._children) }),\n\t\t}));\n\n\tconst loadTableColumns = (): void => {\n\t\tlet columns: FaTableColumnCtx[] = props.columns ? cloneColumns(props.columns) : [];\n\t\t// 默认值处理\n\t\tcolumns.forEach((col) => {\n\t\t\t// 处理搜索项的 key 和 label\n\t\t\tif (col.pureSearch || col.search) {\n\t\t\t\tcol.search ??= { el: \"\" };\n\t\t\t\tcol.search.key ??= col.prop;\n\t\t\t\tcol.search.label ??= col.label;\n\t\t\t\t// 处理默认值\n\t\t\t\tif (col.search.key && col.search.defaultValue !== undefined) {\n\t\t\t\t\tstate.searchParam[col.search.key] = col.search.defaultValue;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 排序\n\t\tcolumns = columns.sort((a, b) => {\n\t\t\treturn (a.order ?? 0) - (b.order ?? 0);\n\t\t});\n\n\t\t// TODO:这里的扁平化暂时没用到\n\t\tstate.orgColumns = tableUtil.flatColumns(columns, enumMap);\n\t};\n\n\tconst handleSizeChange = (pageSize: number): void => {\n\t\tstate.tablePagination.pageIndex = 1;\n\t\tstate.tablePagination.pageSize = pageSize;\n\t\temit(\"sizeChange\", pageSize);\n\t\temit(\"paginationChange\", 1, pageSize);\n\t\tvoid loadData();\n\t};\n\tconst handlePaginationChange = (val: number): void => {\n\t\tstate.tablePagination.pageIndex = val;\n\t\temit(\"paginationChange\", val, state.tablePagination.pageSize);\n\t\tvoid loadData();\n\t};\n\n\tconst updatedTotalParam = (): void => {\n\t\t// 处理查询参数,可以给查询参数加自定义前缀操作\n\t\tconst newSearchParam: Record<string, unknown> = {};\n\t\t// 防止手动清空输入框携带参数(这里可以自定义查询参数前缀)\n\t\tfor (const key in state.searchParam) {\n\t\t\t// * 某些情况下参数为 false/0 也应该携带参数\n\t\t\tif (state.searchParam[key] || state.searchParam[key] === false || state.searchParam[key] === 0) {\n\t\t\t\tnewSearchParam[key] = state.searchParam[key];\n\t\t\t}\n\t\t\t// 处理某些情况下如果为空字符串,其实是不需要传到后端的\n\t\t\telse if (!state.searchParam[key]) {\n\t\t\t\tdelete state.searchParam[key];\n\t\t\t}\n\t\t}\n\t\tObject.assign(state.searchParam, newSearchParam);\n\t};\n\n\tconst defaultSearchTime = (): void => {\n\t\tif (props.hideSearchTime) {\n\t\t\tstate.searchParam.searchTimeList = undefined;\n\t\t} else {\n\t\t\tconst end = new Date();\n\t\t\tconst start = new Date();\n\t\t\tif (props.futureSearchTime) {\n\t\t\t\tswitch (props.dataSearchRange) {\n\t\t\t\t\tcase \"Past1D\":\n\t\t\t\t\t\tend.setDate(end.getDate() + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3D\":\n\t\t\t\t\t\tend.setDate(end.getDate() + 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1W\":\n\t\t\t\t\t\tend.setDate(end.getDate() + 7);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1M\":\n\t\t\t\t\t\tend.setMonth(end.getMonth() + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3M\":\n\t\t\t\t\t\tend.setMonth(end.getMonth() + 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past6M\":\n\t\t\t\t\t\tend.setMonth(end.getMonth() + 6);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1Y\":\n\t\t\t\t\t\tend.setFullYear(end.getFullYear() + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3Y\":\n\t\t\t\t\t\tend.setFullYear(end.getFullYear() + 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (props.dataSearchRange) {\n\t\t\t\t\tcase \"Past1D\":\n\t\t\t\t\t\tstart.setDate(start.getDate() - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3D\":\n\t\t\t\t\t\tstart.setDate(start.getDate() - 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1W\":\n\t\t\t\t\t\tstart.setDate(start.getDate() - 7);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1M\":\n\t\t\t\t\t\tstart.setMonth(start.getMonth() - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3M\":\n\t\t\t\t\t\tstart.setMonth(start.getMonth() - 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past6M\":\n\t\t\t\t\t\tstart.setMonth(start.getMonth() - 6);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1Y\":\n\t\t\t\t\t\tstart.setFullYear(start.getFullYear() - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3Y\":\n\t\t\t\t\t\tstart.setFullYear(start.getFullYear() - 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tstate.searchParam.searchTimeList = [dayjs(start).format(\"YYYY-MM-DD 00:00:00\"), dayjs(end).format(\"YYYY-MM-DD 23:59:59\")];\n\t\t}\n\t};\n\n\tconst tableSearch = async (): Promise<void> => {\n\t\t// 重置到第一页\n\t\tstate.tablePagination.pageIndex = 1;\n\t\tupdatedTotalParam();\n\t\tawait loadData();\n\t};\n\tconst renderTable = debounce((): Promise<void> => {\n\t\tloadTableColumns();\n\t\treturn tableSearch();\n\t}, 300);\n\n\tconst tableReset = async (): Promise<void> => {\n\t\t// 重置到第一页\n\t\tstate.tablePagination.pageIndex = 1;\n\t\t// 清除搜索条件\n\t\tstate.searchParam = {};\n\t\tdefaultSearchTime();\n\t\t// 重置搜索表单的时候,如果有默认搜索参数,则重置默认的搜索参数\n\t\tif (typeof state.initParam === \"object\" && state.initParam !== null) {\n\t\t\tObject.assign(state.searchParam, state.initParam);\n\t\t}\n\t\temit(\"reset\", state.searchParam);\n\t\tawait loadData();\n\t};\n\n\tconst doRender = async (): Promise<void> => {\n\t\tstate.orgColumns = [];\n\t\tstate.autoColumnWidth = [];\n\t\tstate.tableData = [];\n\t\tawait renderTable();\n\t};\n\n\tconst doLoading = (loadingFunction: () => void | Promise<void>, loadingText = \"加载中...\"): void => {\n\t\tstate.loading = true;\n\t\tstate.loadingText = loadingText;\n\t\tvoid callOptionalFunction(loadingFunction).finally(() => {\n\t\t\tstate.loading = false;\n\t\t});\n\t};\n\n\tconst handleCustomCellClick = (\n\t\temitName: string,\n\t\t{ row, column, $index }: { row: FaTableRow; column: FaTableColumnCtx; $index: number }\n\t): void => {\n\t\temit(\"customCellClick\", emitName, { row, column, $index, ...getTableDefaultSlots(state) });\n\t};\n\n\twatch(\n\t\t() => props.tableKey,\n\t\t() => doRender()\n\t);\n\n\twatch(\n\t\t() => props.searchForm,\n\t\t(newValue) => {\n\t\t\tstate.searchForm = newValue;\n\t\t}\n\t);\n\n\treturn {\n\t\t_globalSize,\n\t\tstate,\n\t\telementRef,\n\t\ttableRef,\n\t\thandleTableColumnAutoWidth,\n\t\tgetRequestParam,\n\t\tloadTableColumns,\n\t\thandleSizeChange,\n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EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"useTable.mjs","names":[],"sources":["../../../../src/components/table/src/useTable.ts"],"sourcesContent":["import { computed, nextTick, provide, reactive, ref, watch } from \"vue\";\nimport { dayjs, useGlobalSize } from \"element-plus\";\nimport { isArray, isFunction } from \"lodash-unified\";\nimport { callOptionalFunction, debounce, type makeSlots } from \"../../../utils\";\nimport { tableUtil } from \"../utils/table\";\nimport { getTableDefaultSlots } from \"./table.type\";\nimport type { PagedInput, PagedResult } from \"./page.type\";\nimport type { FaTableSlots, faTableEmits, faTableProps } from \"./table\";\nimport type { FaTableRow, FaTableState } from \"./table.state\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx } from \"./table.type\";\nimport type { TableInstance } from \"element-plus\";\nimport type { ExtractPropTypes, InjectionKey, Ref, SetupContext } from \"vue\";\n\n/** FaTable 状态的依赖注入键。 */\nexport const tableStateKey: InjectionKey<FaTableState> = Symbol(\"tableState\");\n/** FaTable 枚举映射的依赖注入键。 */\nexport const enumMapKey: InjectionKey<Map<string, FaTableEnumColumnCtx[]>> = Symbol(\"enumMap\");\n\ntype TableSetupContext = SetupContext<typeof faTableEmits, ReturnType<typeof makeSlots<FaTableSlots>>>;\n\ninterface TableComposable {\n\t_globalSize: ReturnType<typeof useGlobalSize>;\n\tstate: FaTableState;\n\telementRef: Ref<HTMLElement | undefined>;\n\ttableRef: Ref<TableInstance | undefined>;\n\thandleTableColumnAutoWidth: () => void;\n\tgetRequestParam: () => PagedInput;\n\tloadTableColumns: () => void;\n\thandleSizeChange: (pageSize: number) => void;\n\thandlePaginationChange: (value: number) => void;\n\tdefaultSearchTime: () => void;\n\ttableSearch: () => Promise<void>;\n\ttableReset: () => Promise<void>;\n\tdoRender: () => Promise<void>;\n\tdoLoading: (loadingFunction: () => void | Promise<void>, loadingText?: string) => void;\n\thandleCustomCellClick: (emitName: string, context: { row: FaTableRow; column: FaTableColumnCtx; $index: number }) => void;\n}\n\n/**\n * 创建 FaTable 的状态和操作方法。\n *\n * @param props - FaTable 的 Props。\n * @param slots - FaTable 的插槽。\n * @param emit - FaTable 的事件触发器。\n * @returns FaTable 的状态、引用和操作方法。\n */\nexport const useTable = (\n\tprops: ExtractPropTypes<typeof faTableProps>,\n\tslots: TableSetupContext[\"slots\"],\n\temit: TableSetupContext[\"emit\"]\n): TableComposable => {\n\tconst _globalSize = useGlobalSize();\n\n\tconst elementRef = ref<HTMLElement>();\n\tconst tableRef = ref<TableInstance>();\n\n\t/**\n\t * 定义 enumMap 存储 enum 值(避免异步请求无法格式化单元格内容 || 无法填充搜索下拉选择)\n\t */\n\tconst enumMap = reactive(new Map<string, FaTableEnumColumnCtx[]>());\n\tprovide(enumMapKey, enumMap);\n\n\tconst state: FaTableState = reactive({\n\t\tloading: false,\n\t\tloadingText: \"加载中...\",\n\t\torgColumns: [],\n\t\ttableColumns: computed(() => state.orgColumns.filter((f) => f.prop && !f.pureSearch)),\n\t\tsearchColumns: computed(() =>\n\t\t\tstate.orgColumns\n\t\t\t\t.filter((item) => item.pureSearch === true || item.search !== undefined)\n\t\t\t\t.sort((a, b) => {\n\t\t\t\t\treturn (a.search?.order ?? 0) - (b.search?.order ?? 0);\n\t\t\t\t})\n\t\t),\n\t\tspanColumns: computed(() => [\n\t\t\t...state.orgColumns.flatMap((column) => (column.spanProp ? [{ prop: column.prop ?? \"\", spanProp: column.spanProp }] : [])),\n\t\t\t...(props.props.span\n\t\t\t\t? [\n\t\t\t\t\t\t{ prop: \"__table-index\", spanProp: props.props.span },\n\t\t\t\t\t\t{ prop: \"__table-selection\", spanProp: props.props.span },\n\t\t\t\t\t\t{ prop: \"__table-operation\", spanProp: props.props.span },\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t]),\n\t\ttableData: [],\n\t\ttableSpanData: computed(() => {\n\t\t\tif (state.spanColumns?.length > 0 && state.tableData?.length > 0) {\n\t\t\t\tconst result: Record<string, number[]> = {};\n\t\t\t\tconst spanIndexes: Record<string, number> = {};\n\t\t\t\tstate.spanColumns.forEach((item) => {\n\t\t\t\t\tresult[item.prop] = new Array<number>(state.tableData.length).fill(1, 0, 1).fill(0, 1);\n\t\t\t\t\tspanIndexes[item.prop] = 0;\n\t\t\t\t});\n\t\t\t\tfor (let i = 1; i < state.tableData.length; i++) {\n\t\t\t\t\tstate.spanColumns.forEach((item) => {\n\t\t\t\t\t\tconst currentRow = state.tableData[i];\n\t\t\t\t\t\tconst previousRow = state.tableData[i - 1];\n\t\t\t\t\t\tconst spanValues = result[item.prop];\n\t\t\t\t\t\tconst spanIndex = spanIndexes[item.prop];\n\t\t\t\t\t\tif (currentRow === undefined || previousRow === undefined || spanValues === undefined || spanIndex === undefined) return;\n\t\t\t\t\t\tif (currentRow[item.spanProp] === previousRow[item.spanProp]) {\n\t\t\t\t\t\t\tspanValues[spanIndex] = (spanValues[spanIndex] ?? 0) + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tspanIndexes[item.prop] = i;\n\t\t\t\t\t\t\tspanValues[i] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn {};\n\t\t}),\n\t\ttablePagination: {\n\t\t\tpageIndex: 1,\n\t\t\tpageSize: 20,\n\t\t\ttotalRows: 0,\n\t\t},\n\t\tinitParam: {},\n\t\tsearchParam: {},\n\t\tsearchValueUpdate: \"\",\n\t\tsearchForm: props.searchForm,\n\t\tselected: false,\n\t\tselectedList: [],\n\t\tselectedListIds: computed(() =>\n\t\t\tstate.selectedList.flatMap((item) => {\n\t\t\t\tconst rowKey = isFunction(props.rowKey) ? props.rowKey(item) : tableUtil.handleRowAccordingToProp(item, props.rowKey);\n\t\t\t\treturn typeof rowKey === \"string\" || typeof rowKey === \"number\" ? [rowKey] : [];\n\t\t\t})\n\t\t),\n\t\tindeterminateSelectedListIds: [],\n\t\toperationColumnWidth: computed(() => {\n\t\t\tconst findAutoCol = state.autoColumnWidth.find((f) => f.prop === \"__table-operation\");\n\t\t\tif (findAutoCol) {\n\t\t\t\treturn `${findAutoCol.width}px`;\n\t\t\t}\n\t\t\tswitch (_globalSize.value) {\n\t\t\t\tcase \"large\":\n\t\t\t\tcase \"default\":\n\t\t\t\t\treturn \"54px\";\n\t\t\t\tcase \"small\":\n\t\t\t\t\treturn \"42px\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn \"auto\";\n\t\t\t}\n\t\t}),\n\t\timagePreview: false,\n\t\tpreviewList: [],\n\t\ttableWidth: 0,\n\t\ttableHeight: 0,\n\t\tautoColumnWidth: [],\n\t});\n\tlet requestVersion = 0;\n\n\tprovide(tableStateKey, state);\n\n\tconst handleTableColumnAutoWidth = (): void => {\n\t\tstate.loading = true;\n\t\tstate.loadingText = \"加载中...\";\n\t\tstate.autoColumnWidth = [];\n\t\tconst autoWidthColumns = state.tableColumns.filter((f) => f.autoWidth);\n\t\tif (slots?.operation) {\n\t\t\t// 操作列自动宽度\n\t\t\tautoWidthColumns.push({\n\t\t\t\tprop: \"__table-operation\",\n\t\t\t});\n\t\t}\n\t\tif (autoWidthColumns.length > 0) {\n\t\t\t// padding24/16 + border1\n\t\t\tconst otherWidth = _globalSize.value === \"default\" ? 25 : 17;\n\t\t\tvoid nextTick(() => {\n\t\t\t\tconst tableDom = document.querySelector(`.fa-table__${props.tableKey}`);\n\t\t\t\tif (tableDom) {\n\t\t\t\t\tautoWidthColumns.forEach((item) => {\n\t\t\t\t\t\tconst headerColumnDom = tableDom.querySelector(`.__fa-table__auto-width-column__cell-header__${item?.prop}`);\n\t\t\t\t\t\tconst cellColumnDoms = tableDom.querySelectorAll(`.__fa-table__auto-width-column__cell__${item?.prop}`);\n\t\t\t\t\t\tlet maxWidth = 0;\n\t\t\t\t\t\tif (headerColumnDom) {\n\t\t\t\t\t\t\tmaxWidth = Math.ceil(headerColumnDom.scrollWidth) + otherWidth;\n\t\t\t\t\t\t\tif (item?.sortable) {\n\t\t\t\t\t\t\t\tmaxWidth += 24;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcellColumnDoms.forEach((cellDom) => {\n\t\t\t\t\t\t\tconst curWidth = Math.ceil(cellDom.scrollWidth) + otherWidth;\n\t\t\t\t\t\t\tif (curWidth > maxWidth) {\n\t\t\t\t\t\t\t\tmaxWidth = curWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconst findInfo = state.autoColumnWidth.find((f) => f.prop === item?.prop);\n\t\t\t\t\t\tif (findInfo) {\n\t\t\t\t\t\t\tfindInfo.width = Math.max(findInfo.width, maxWidth);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (item.prop) {\n\t\t\t\t\t\t\t\tstate.autoColumnWidth.push({\n\t\t\t\t\t\t\t\t\tprop: item.prop,\n\t\t\t\t\t\t\t\t\twidth: maxWidth,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}).finally(() => {\n\t\t\t\tstate.loading = false;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tstate.loading = false;\n\t};\n\n\tconst handleTableData = (data: FaTableRow[]): FaTableRow[] => {\n\t\tif (props.treeData) {\n\t\t\tconst result: FaTableRow[] = [];\n\t\t\tdata.forEach((row) => {\n\t\t\t\tconst rowList = row[props.props.children ?? \"children\"];\n\t\t\t\tif (isArray(rowList)) {\n\t\t\t\t\t// 如果 rowList 是数组,遍历并合并每个子项\n\t\t\t\t\tconst childRows: unknown[] = rowList;\n\t\t\t\t\tchildRows.forEach((childRow) => {\n\t\t\t\t\t\tresult.push(typeof childRow === \"object\" && childRow !== null ? { ...row, ...childRow } : row);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tresult.push(typeof rowList === \"object\" && rowList !== null ? { ...row, ...rowList } : row);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn data;\n\t\t}\n\t};\n\n\tconst getRequestParam = (): PagedInput => {\n\t\tconst params = { ...state.searchParam, ...(props.pagination ? state.tablePagination : {}) };\n\t\t// 删除总条数\n\t\tdelete params.totalRows;\n\t\treturn params;\n\t};\n\n\tconst loadData = async (): Promise<void> => {\n\t\tconst currentRequestVersion = ++requestVersion;\n\t\tstate.loading = true;\n\t\tstate.loadingText = \"加载中...\";\n\t\tif (props.requestApi) {\n\t\t\tconst params = getRequestParam();\n\t\t\temit(\"refresh\", params);\n\t\t\tlet pageData: FaTableRow[];\n\t\t\ttry {\n\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 数据回调\n\t\t\t\tprops.dataCallback?.(resData);\n\t\t\t\t// 解析 API 接口返回的分页数据(如果有分页更新分页信息)\n\t\t\t\tif (props.pagination) {\n\t\t\t\t\tif (isArray(resData)) {\n\t\t\t\t\t\tpageData = resData;\n\t\t\t\t\t\tstate.tablePagination.totalRows = resData.length;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst pageRes = resData as PagedResult;\n\t\t\t\t\t\tpageData = pageRes.rows ?? [];\n\t\t\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\t\t\tpageIndex: pageRes.pageIndex ?? state.tablePagination.pageIndex,\n\t\t\t\t\t\t\tpageSize: pageRes.pageSize ?? state.tablePagination.pageSize,\n\t\t\t\t\t\t\ttotalRows: pageRes.totalRows ?? pageData.length,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tpageData = resData as FaTableRow[];\n\t\t\t\t\t// 更新分页信息\n\t\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\t\tpageIndex: 1,\n\t\t\t\t\t\tpageSize: 0,\n\t\t\t\t\t\ttotalRows: pageData.length,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tstate.tableData = handleTableData(pageData);\n\t\t\t} catch (error) {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\tstate.tableData = [];\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t}\n\t\t} else {\n\t\t\temit(\"refresh\", { searchValue: state.searchParam.searchValue });\n\t\t\tlet _value = handleTableData([...props.data]);\n\t\t\t_value = _value.filter((f) => {\n\t\t\t\tconst searchValue = state.searchParam.searchValue;\n\t\t\t\tif (typeof searchValue !== \"string\" || searchValue.length === 0) return true;\n\t\t\t\treturn state.tableColumns.some((col) => {\n\t\t\t\t\tconst value = tableUtil.handleRowAccordingToProp(f, col.prop ?? \"\");\n\t\t\t\t\tconst text =\n\t\t\t\t\t\ttypeof value === \"string\" || typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\"\n\t\t\t\t\t\t\t? String(value)\n\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\treturn text.toLowerCase().includes(searchValue.toLowerCase());\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (isArray(state.searchParam.sortList) && state.searchParam.sortList.length > 0) {\n\t\t\t\t_value = _value.sort(tableUtil.arrayDynamicSort(state.searchParam.sortList));\n\t\t\t}\n\t\t\tif (props.pagination) {\n\t\t\t\t// 更新分页信息\n\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\ttotalRows: _value.length,\n\t\t\t\t});\n\t\t\t\tconst pageStart = (state.tablePagination.pageIndex - 1) * state.tablePagination.pageSize;\n\t\t\t\tconst pageEnd = pageStart + state.tablePagination.pageSize;\n\t\t\t\tstate.tableData = _value.slice(pageStart, pageEnd);\n\t\t\t} else {\n\t\t\t\tstate.tableData = _value;\n\t\t\t\t// 更新分页信息\n\t\t\t\tObject.assign(state.tablePagination, {\n\t\t\t\t\tpageIndex: 1,\n\t\t\t\t\tpageSize: 0,\n\t\t\t\t\ttotalRows: _value.length,\n\t\t\t\t});\n\t\t\t}\n\t\t\tstate.loading = false;\n\t\t}\n\t\thandleTableColumnAutoWidth();\n\t};\n\n\tconst cloneColumns = (columns: FaTableColumnCtx[]): FaTableColumnCtx[] =>\n\t\tcolumns.map((column) => ({\n\t\t\t...column,\n\t\t\t...(column.search && { search: { ...column.search, ...(column.search.props && { props: { ...column.search.props } }) } }),\n\t\t\t...(column._children && { _children: cloneColumns(column._children) }),\n\t\t}));\n\n\tconst loadTableColumns = (): void => {\n\t\tlet columns: FaTableColumnCtx[] = props.columns ? cloneColumns(props.columns) : [];\n\t\t// 默认值处理\n\t\tcolumns.forEach((col) => {\n\t\t\t// 处理搜索项的 key 和 label\n\t\t\tif (col.pureSearch || col.search) {\n\t\t\t\tcol.search ??= { el: \"\" };\n\t\t\t\tcol.search.key ??= col.prop;\n\t\t\t\tcol.search.label ??= col.label;\n\t\t\t\t// 处理默认值\n\t\t\t\tif (col.search.key && col.search.defaultValue !== undefined) {\n\t\t\t\t\tstate.searchParam[col.search.key] = col.search.defaultValue;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 排序\n\t\tcolumns = columns.sort((a, b) => {\n\t\t\treturn (a.order ?? 0) - (b.order ?? 0);\n\t\t});\n\n\t\t// TODO:这里的扁平化暂时没用到\n\t\tstate.orgColumns = tableUtil.flatColumns(columns, enumMap);\n\t};\n\n\tconst handleSizeChange = (pageSize: number): void => {\n\t\tstate.tablePagination.pageIndex = 1;\n\t\tstate.tablePagination.pageSize = pageSize;\n\t\temit(\"sizeChange\", pageSize);\n\t\temit(\"paginationChange\", 1, pageSize);\n\t\tvoid loadData();\n\t};\n\tconst handlePaginationChange = (val: number): void => {\n\t\tstate.tablePagination.pageIndex = val;\n\t\temit(\"paginationChange\", val, state.tablePagination.pageSize);\n\t\tvoid loadData();\n\t};\n\n\tconst updatedTotalParam = (): void => {\n\t\t// 处理查询参数,可以给查询参数加自定义前缀操作\n\t\tconst newSearchParam: Record<string, unknown> = {};\n\t\t// 防止手动清空输入框携带参数(这里可以自定义查询参数前缀)\n\t\tfor (const key in state.searchParam) {\n\t\t\t// * 某些情况下参数为 false/0 也应该携带参数\n\t\t\tif (state.searchParam[key] || state.searchParam[key] === false || state.searchParam[key] === 0) {\n\t\t\t\tnewSearchParam[key] = state.searchParam[key];\n\t\t\t}\n\t\t\t// 处理某些情况下如果为空字符串,其实是不需要传到后端的\n\t\t\telse if (!state.searchParam[key]) {\n\t\t\t\tdelete state.searchParam[key];\n\t\t\t}\n\t\t}\n\t\tObject.assign(state.searchParam, newSearchParam);\n\t};\n\n\tconst defaultSearchTime = (): void => {\n\t\tif (props.hideSearchTime) {\n\t\t\tstate.searchParam.searchTimeList = undefined;\n\t\t} else {\n\t\t\tconst end = new Date();\n\t\t\tconst start = new Date();\n\t\t\tif (props.futureSearchTime) {\n\t\t\t\tswitch (props.dataSearchRange) {\n\t\t\t\t\tcase \"Past1D\":\n\t\t\t\t\t\tend.setDate(end.getDate() + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3D\":\n\t\t\t\t\t\tend.setDate(end.getDate() + 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1W\":\n\t\t\t\t\t\tend.setDate(end.getDate() + 7);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1M\":\n\t\t\t\t\t\tend.setMonth(end.getMonth() + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3M\":\n\t\t\t\t\t\tend.setMonth(end.getMonth() + 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past6M\":\n\t\t\t\t\t\tend.setMonth(end.getMonth() + 6);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1Y\":\n\t\t\t\t\t\tend.setFullYear(end.getFullYear() + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3Y\":\n\t\t\t\t\t\tend.setFullYear(end.getFullYear() + 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (props.dataSearchRange) {\n\t\t\t\t\tcase \"Past1D\":\n\t\t\t\t\t\tstart.setDate(start.getDate() - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3D\":\n\t\t\t\t\t\tstart.setDate(start.getDate() - 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1W\":\n\t\t\t\t\t\tstart.setDate(start.getDate() - 7);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1M\":\n\t\t\t\t\t\tstart.setMonth(start.getMonth() - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3M\":\n\t\t\t\t\t\tstart.setMonth(start.getMonth() - 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past6M\":\n\t\t\t\t\t\tstart.setMonth(start.getMonth() - 6);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past1Y\":\n\t\t\t\t\t\tstart.setFullYear(start.getFullYear() - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Past3Y\":\n\t\t\t\t\t\tstart.setFullYear(start.getFullYear() - 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tstate.searchParam.searchTimeList = [dayjs(start).format(\"YYYY-MM-DD 00:00:00\"), dayjs(end).format(\"YYYY-MM-DD 23:59:59\")];\n\t\t}\n\t};\n\n\tconst tableSearch = async (): Promise<void> => {\n\t\t// 重置到第一页\n\t\tstate.tablePagination.pageIndex = 1;\n\t\tupdatedTotalParam();\n\t\tawait loadData();\n\t};\n\tconst renderTable = debounce((): Promise<void> => {\n\t\tloadTableColumns();\n\t\treturn tableSearch();\n\t}, 300);\n\n\tconst tableReset = async (): Promise<void> => {\n\t\t// 重置到第一页\n\t\tstate.tablePagination.pageIndex = 1;\n\t\t// 清除搜索条件\n\t\tstate.searchParam = {};\n\t\tdefaultSearchTime();\n\t\t// 重置搜索表单的时候,如果有默认搜索参数,则重置默认的搜索参数\n\t\tif (typeof state.initParam === \"object\" && state.initParam !== null) {\n\t\t\tObject.assign(state.searchParam, state.initParam);\n\t\t}\n\t\temit(\"reset\", state.searchParam);\n\t\tawait loadData();\n\t};\n\n\tconst doRender = async (): Promise<void> => {\n\t\tstate.orgColumns = [];\n\t\tstate.autoColumnWidth = [];\n\t\tstate.tableData = [];\n\t\tawait renderTable();\n\t};\n\n\tconst doLoading = (loadingFunction: () => void | Promise<void>, loadingText = \"加载中...\"): void => {\n\t\tstate.loading = true;\n\t\tstate.loadingText = loadingText;\n\t\tvoid callOptionalFunction(loadingFunction).finally(() => {\n\t\t\tstate.loading = false;\n\t\t});\n\t};\n\n\tconst handleCustomCellClick = (\n\t\temitName: string,\n\t\t{ row, column, $index }: { row: FaTableRow; column: FaTableColumnCtx; $index: number }\n\t): void => {\n\t\temit(\"customCellClick\", emitName, { row, column, $index, ...getTableDefaultSlots(state) });\n\t};\n\n\twatch(\n\t\t() => props.tableKey,\n\t\t() => doRender()\n\t);\n\n\twatch(\n\t\t() => props.searchForm,\n\t\t(newValue) => {\n\t\t\tstate.searchForm = newValue;\n\t\t}\n\t);\n\n\treturn {\n\t\t_globalSize,\n\t\tstate,\n\t\telementRef,\n\t\ttableRef,\n\t\thandleTableColumnAutoWidth,\n\t\tgetRequestParam,\n\t\tloadTableColumns,\n\t\thandleSizeChange,\n\t\thandlePaginationChange,\n\t\tdefaultSearchTime,\n\t\ttableSearch,\n\t\ttableReset,\n\t\tdoRender,\n\t\tdoLoading,\n\t\thandleCustomCellClick,\n\t};\n};\n"],"mappings":";;;;;;;;;AAcA,MAAa,gBAA4C,OAAO,YAAY;;AAE5E,MAAa,aAAgE,OAAO,SAAS;;;;;;;;;AA8B7F,MAAa,YACZ,OACA,OACA,SACqB;CACrB,MAAM,cAAc,cAAc;CAElC,MAAM,aAAa,IAAiB;CACpC,MAAM,WAAW,IAAmB;;;;CAKpC,MAAM,UAAU,yBAAS,IAAI,IAAoC,CAAC;CAClE,QAAQ,YAAY,OAAO;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,OAAO,YAAY;CACpB,GAAG,GAAG;CAEN,MAAM,aAAa,YAA2B;EAE7C,MAAM,gBAAgB,YAAY;EAElC,MAAM,cAAc,CAAC;EACrB,kBAAkB;EAElB,IAAI,OAAO,MAAM,cAAc,YAAY,MAAM,cAAc,MAC9D,OAAO,OAAO,MAAM,aAAa,MAAM,SAAS;EAEjD,KAAK,SAAS,MAAM,WAAW;EAC/B,MAAM,SAAS;CAChB;CAEA,MAAM,WAAW,YAA2B;EAC3C,MAAM,aAAa,CAAC;EACpB,MAAM,kBAAkB,CAAC;EACzB,MAAM,YAAY,CAAC;EACnB,MAAM,YAAY;CACnB;CAEA,MAAM,aAAa,iBAA6C,cAAc,aAAmB;EAChG,MAAM,UAAU;EAChB,MAAM,cAAc;EACpB,qBAA0B,eAAe,CAAC,CAAC,cAAc;GACxD,MAAM,UAAU;EACjB,CAAC;CACF;CAEA,MAAM,yBACL,UACA,EAAE,KAAK,QAAQ,aACL;EACV,KAAK,mBAAmB,UAAU;GAAE;GAAK;GAAQ;GAAQ,GAAG,qBAAqB,KAAK;EAAE,CAAC;CAC1F;CAEA,YACO,MAAM,gBACN,SAAS,CAChB;CAEA,YACO,MAAM,aACX,aAAa;EACb,MAAM,aAAa;CACpB,CACD;CAEA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import isArray from "
|
|
2
|
-
import isFunction from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.mjs";
|
|
3
|
-
import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
|
|
1
|
+
import { isArray, isFunction, isString } from "lodash-unified";
|
|
4
2
|
//#region src/components/table/utils/table.ts
|
|
5
3
|
/**
|
|
6
4
|
* 表格工具类
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../src/components/table/utils/table.ts"],"sourcesContent":["import { isArray, isFunction, isString } from \"lodash-unified\";\nimport type { PagedSortInput } from \"../src/page.type\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx, FaTableEnumColumnType } from \"../src/table.type\";\n\n/**\n * 表格工具类\n */\nexport const tableUtil = {\n\t/**\n\t * @description 处理无数据情况\n\t * @param {String} callValue 需要处理的值\n\t */\n\tformatValue(callValue: unknown): unknown {\n\t\t// 如果当前值为数组,使用 / 拼接(根据需求自定义)\n\t\tif (isArray(callValue)) return callValue.length ? callValue.join(` , `) : null;\n\t\treturn callValue;\n\t},\n\t/**\n\t * @description 处理 prop 为多级嵌套的情况(列如: prop:user.name)\n\t * @param {Object} row 当前行数据\n\t * @param {String} prop 当前 prop\n\t */\n\thandleRowAccordingToProp(row: Record<string, unknown>, prop: string): unknown {\n\t\tlet value: unknown = row;\n\t\tfor (const item of prop.split(\".\")) {\n\t\t\tif (typeof value !== \"object\" || value === null) return undefined;\n\t\t\tvalue = (value as Record<string, unknown>)[item];\n\t\t}\n\t\treturn value;\n\t},\n\t/**\n\t * @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop\n\t * @param {String} prop 当前 prop\n\t */\n\thandleProp(prop: string): string {\n\t\tconst propArr = prop.split(\".\");\n\t\tif (propArr.length === 1) return prop;\n\t\treturn propArr.at(-1) ?? prop;\n\t},\n\t/**\n\t * @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)\n\t * @param {String} callValue 当前单元格值\n\t * @param {Array} enumData 字典列表\n\t * @param {Array} fieldNames 指定 label && value 的 key 值\n\t * @param {String} type 过滤类型(目前只有 tag)\n\t */\n\tfilterEnum(callValue: unknown, enumData: FaTableEnumColumnCtx[], fieldNames?: { label: string; value: string }, type?: \"tag\"): unknown {\n\t\tconst value = fieldNames?.value ?? \"value\";\n\t\tconst label = fieldNames?.label ?? \"label\";\n\t\tlet filterData: FaTableEnumColumnCtx | undefined;\n\t\tif (isArray(enumData)) {\n\t\t\tfilterData = enumData.find((item) => (item as unknown as Record<string, unknown>)[value] === callValue);\n\t\t}\n\t\tif (type === \"tag\") {\n\t\t\treturn filterData?.type ?? \"info\";\n\t\t}\n\t\treturn filterData ? (filterData as unknown as Record<string, unknown>)[label] : null;\n\t},\n\t/**\n\t * 数组动态排序\n\t */\n\tarrayDynamicSort(sortList: PagedSortInput[]): (a: Record<string, unknown>, b: Record<string, unknown>) => number {\n\t\treturn (a, b) => {\n\t\t\tif (sortList && sortList.length > 0) {\n\t\t\t\tfor (const condition of sortList) {\n\t\t\t\t\tconst property = condition.enField;\n\t\t\t\t\tconst order = condition.mode;\n\t\t\t\t\tif (!property) continue;\n\n\t\t\t\t\tconst aValue = a[property];\n\t\t\t\t\tconst bValue = b[property];\n\n\t\t\t\t\tif (typeof aValue === \"string\" && typeof bValue === \"string\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tconst comparison = aValue.localeCompare(bValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tconst comparison = bValue.localeCompare(aValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (typeof aValue === \"number\" && typeof bValue === \"number\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tif (aValue < bValue) return -1;\n\t\t\t\t\t\t\tif (aValue > bValue) return 1;\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tif (aValue > bValue) return -1;\n\t\t\t\t\t\t\tif (aValue < bValue) return 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t};\n\t},\n\t/**\n\t * 设置枚举\n\t */\n\tsetEnumMap(columnEnum: FaTableEnumColumnType, prop: string, enumMap: Map<string, FaTableEnumColumnCtx[]>): void {\n\t\tif (!columnEnum) return;\n\t\tif (isFunction(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum());\n\t\t} else if (isArray(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum);\n\t\t}\n\t},\n\t/**\n\t * 扁平化 columns\n\t */\n\tflatColumns(columns: FaTableColumnCtx[], enumMap?: Map<string, FaTableEnumColumnCtx[]>): FaTableColumnCtx[] {\n\t\tconst flatArr: FaTableColumnCtx[] = [];\n\t\tcolumns.forEach((col) => {\n\t\t\tif (col._children?.length) {\n\t\t\t\tflatArr.push(...this.flatColumns(col._children));\n\t\t\t}\n\n\t\t\tflatArr.push(col);\n\n\t\t\t// 给每一项 column 添加 show && filterEnum 默认属性\n\t\t\tcol.show ??= true;\n\t\t\t// col.filterEnum = col.filterEnum ?? col.tag ?? false;\n\n\t\t\tlet enumKey = col.prop ?? col.search?.key;\n\n\t\t\tif (col.enum && isString(col.enum)) {\n\t\t\t\tenumKey = col.enum;\n\t\t\t}\n\n\t\t\t// 设置 enumMap\n\t\t\tif (col.enum && enumKey && enumMap) this.setEnumMap(col.enum, enumKey, enumMap);\n\t\t});\n\t\treturn flatArr.filter((item) => !item._children?.length);\n\t},\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../src/components/table/utils/table.ts"],"sourcesContent":["import { isArray, isFunction, isString } from \"lodash-unified\";\nimport type { PagedSortInput } from \"../src/page.type\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx, FaTableEnumColumnType } from \"../src/table.type\";\n\n/**\n * 表格工具类\n */\nexport const tableUtil = {\n\t/**\n\t * @description 处理无数据情况\n\t * @param {String} callValue 需要处理的值\n\t */\n\tformatValue(callValue: unknown): unknown {\n\t\t// 如果当前值为数组,使用 / 拼接(根据需求自定义)\n\t\tif (isArray(callValue)) return callValue.length ? callValue.join(` , `) : null;\n\t\treturn callValue;\n\t},\n\t/**\n\t * @description 处理 prop 为多级嵌套的情况(列如: prop:user.name)\n\t * @param {Object} row 当前行数据\n\t * @param {String} prop 当前 prop\n\t */\n\thandleRowAccordingToProp(row: Record<string, unknown>, prop: string): unknown {\n\t\tlet value: unknown = row;\n\t\tfor (const item of prop.split(\".\")) {\n\t\t\tif (typeof value !== \"object\" || value === null) return undefined;\n\t\t\tvalue = (value as Record<string, unknown>)[item];\n\t\t}\n\t\treturn value;\n\t},\n\t/**\n\t * @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop\n\t * @param {String} prop 当前 prop\n\t */\n\thandleProp(prop: string): string {\n\t\tconst propArr = prop.split(\".\");\n\t\tif (propArr.length === 1) return prop;\n\t\treturn propArr.at(-1) ?? prop;\n\t},\n\t/**\n\t * @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)\n\t * @param {String} callValue 当前单元格值\n\t * @param {Array} enumData 字典列表\n\t * @param {Array} fieldNames 指定 label && value 的 key 值\n\t * @param {String} type 过滤类型(目前只有 tag)\n\t */\n\tfilterEnum(callValue: unknown, enumData: FaTableEnumColumnCtx[], fieldNames?: { label: string; value: string }, type?: \"tag\"): unknown {\n\t\tconst value = fieldNames?.value ?? \"value\";\n\t\tconst label = fieldNames?.label ?? \"label\";\n\t\tlet filterData: FaTableEnumColumnCtx | undefined;\n\t\tif (isArray(enumData)) {\n\t\t\tfilterData = enumData.find((item) => (item as unknown as Record<string, unknown>)[value] === callValue);\n\t\t}\n\t\tif (type === \"tag\") {\n\t\t\treturn filterData?.type ?? \"info\";\n\t\t}\n\t\treturn filterData ? (filterData as unknown as Record<string, unknown>)[label] : null;\n\t},\n\t/**\n\t * 数组动态排序\n\t */\n\tarrayDynamicSort(sortList: PagedSortInput[]): (a: Record<string, unknown>, b: Record<string, unknown>) => number {\n\t\treturn (a, b) => {\n\t\t\tif (sortList && sortList.length > 0) {\n\t\t\t\tfor (const condition of sortList) {\n\t\t\t\t\tconst property = condition.enField;\n\t\t\t\t\tconst order = condition.mode;\n\t\t\t\t\tif (!property) continue;\n\n\t\t\t\t\tconst aValue = a[property];\n\t\t\t\t\tconst bValue = b[property];\n\n\t\t\t\t\tif (typeof aValue === \"string\" && typeof bValue === \"string\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tconst comparison = aValue.localeCompare(bValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tconst comparison = bValue.localeCompare(aValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (typeof aValue === \"number\" && typeof bValue === \"number\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tif (aValue < bValue) return -1;\n\t\t\t\t\t\t\tif (aValue > bValue) return 1;\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tif (aValue > bValue) return -1;\n\t\t\t\t\t\t\tif (aValue < bValue) return 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t};\n\t},\n\t/**\n\t * 设置枚举\n\t */\n\tsetEnumMap(columnEnum: FaTableEnumColumnType, prop: string, enumMap: Map<string, FaTableEnumColumnCtx[]>): void {\n\t\tif (!columnEnum) return;\n\t\tif (isFunction(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum());\n\t\t} else if (isArray(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum);\n\t\t}\n\t},\n\t/**\n\t * 扁平化 columns\n\t */\n\tflatColumns(columns: FaTableColumnCtx[], enumMap?: Map<string, FaTableEnumColumnCtx[]>): FaTableColumnCtx[] {\n\t\tconst flatArr: FaTableColumnCtx[] = [];\n\t\tcolumns.forEach((col) => {\n\t\t\tif (col._children?.length) {\n\t\t\t\tflatArr.push(...this.flatColumns(col._children));\n\t\t\t}\n\n\t\t\tflatArr.push(col);\n\n\t\t\t// 给每一项 column 添加 show && filterEnum 默认属性\n\t\t\tcol.show ??= true;\n\t\t\t// col.filterEnum = col.filterEnum ?? col.tag ?? false;\n\n\t\t\tlet enumKey = col.prop ?? col.search?.key;\n\n\t\t\tif (col.enum && isString(col.enum)) {\n\t\t\t\tenumKey = col.enum;\n\t\t\t}\n\n\t\t\t// 设置 enumMap\n\t\t\tif (col.enum && enumKey && enumMap) this.setEnumMap(col.enum, enumKey, enumMap);\n\t\t});\n\t\treturn flatArr.filter((item) => !item._children?.length);\n\t},\n};\n"],"mappings":";;;;;AAOA,MAAa,YAAY;;;;;CAKxB,YAAY,WAA6B;EAExC,IAAI,QAAQ,SAAS,GAAG,OAAO,UAAU,SAAS,UAAU,KAAK,KAAK,IAAI;EAC1E,OAAO;CACR;;;;;;CAMA,yBAAyB,KAA8B,MAAuB;EAC7E,IAAI,QAAiB;EACrB,KAAK,MAAM,QAAQ,KAAK,MAAM,GAAG,GAAG;GACnC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;GACxD,QAAS,MAAkC;EAC5C;EACA,OAAO;CACR;;;;;CAKA,WAAW,MAAsB;EAChC,MAAM,UAAU,KAAK,MAAM,GAAG;EAC9B,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,OAAO,QAAQ,GAAG,EAAE,KAAK;CAC1B;;;;;;;;CAQA,WAAW,WAAoB,UAAkC,YAA+C,MAAuB;EACtI,MAAM,QAAQ,YAAY,SAAS;EACnC,MAAM,QAAQ,YAAY,SAAS;EACnC,IAAI;EACJ,IAAI,QAAQ,QAAQ,GACnB,aAAa,SAAS,MAAM,SAAU,KAA4C,W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AG;GAGhB,IAAI,SAAS;GAGb,IAAI,UAAU,IAAI,QAAQ,IAAI,QAAQ;GAEtC,IAAI,IAAI,QAAQ,SAAS,IAAI,IAAI,GAChC,UAAU,IAAI;GAIf,IAAI,IAAI,QAAQ,WAAW,SAAS,KAAK,WAAW,IAAI,MAAM,SAAS,OAAO;EAC/E,CAAC;EACD,OAAO,QAAQ,QAAQ,SAAS,CAAC,KAAK,WAAW,MAAM;CACxD;AACD"}
|
|
@@ -5,16 +5,11 @@ import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
|
5
5
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
6
6
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
7
7
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
8
|
-
import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
|
|
9
|
-
import isObject from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.mjs";
|
|
10
|
-
import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
|
|
11
|
-
import isBoolean from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBoolean.mjs";
|
|
12
|
-
import isNumber from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs";
|
|
13
|
-
import isNull from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs";
|
|
14
|
-
import { useVModel } from "../../../node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
15
8
|
import { computed, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, onMounted, reactive, ref, resolveDirective, watch, withDirectives } from "vue";
|
|
16
9
|
import { Expand, Fold } from "@element-plus/icons-vue";
|
|
17
10
|
import { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from "element-plus";
|
|
11
|
+
import { isArray, isBoolean, isNull, isNumber, isObject, isString } from "lodash-unified";
|
|
12
|
+
import { useVModel } from "@vueuse/core";
|
|
18
13
|
//#region src/components/tree/src/tree.tsx
|
|
19
14
|
/** FaTree 的运行时 Props 定义。 */
|
|
20
15
|
const faTreeProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterNodeMethodFunction, FilterValue, TreeNode, TreeNodeData } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\n/** FaTree 的运行时 Props 定义。 */\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: \"\",\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: unknown) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<unknown>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义。 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n};\n\n/** FaTree 的插槽参数。 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: TreeNode; data: ElTreeOutput };\n}\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null>(props.modelValue),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: props.hamburger || false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addCssUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.orgTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tlet curSelectedData: string | number | undefined;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tconst currentKey: unknown = treeRef.value?.getCurrentKey();\n\t\t\t\tif (typeof currentKey === \"string\" || typeof currentKey === \"number\") curSelectedData = currentKey;\n\t\t\t}\n\t\t\tlet treeData: ElTreeOutput[];\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = {\n\t\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\t\tsearchValue: state.searchValue,\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tconst responseData = await props.requestApi(params);\n\t\t\t\t\ttreeData = responseData.map((item) => ({ ...item }));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data.map((item) => ({ ...item }));\n\t\t\t}\n\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true });\n\t\t\t}\n\t\t\tstate.orgTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChangeCallBack\", state.treeData);\n\t\t\tconst selectedKey = curSelectedData ?? props.modelValue ?? props.defaultSelection;\n\t\t\tif (props.nodeKey && (typeof selectedKey === \"string\" || typeof selectedKey === \"number\")) {\n\t\t\t\tvoid nextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value?.setCurrentKey(selectedKey);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.orgTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((item) => ({ ...item, [props.props.children ?? \"children\"]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = data[\"all\"] ? [data[\"label\"]] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) =>\n\t\t\t\ttypeof label === \"string\" || typeof label === \"number\" ? String(label).includes(filterText) : false\n\t\t\t);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!data[\"all\"] && (node.key === undefined || node.key === null)) return;\n\t\t\tstate.value = data[\"all\"] ? (props.allValue ?? null) : (node.key ?? null);\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tstate.value = newValue ?? null;\n\t\t\t\tif (typeof newValue === \"string\" || typeof newValue === \"number\") treeRef.value?.setCurrentKey(newValue);\n\t\t\t}\n\t\t);\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\t\tconst elTreeEmits = useEmits(treeEmits, emit, [\"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": state.hamburger || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title !== undefined || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\tonInput={(value) => treeRef.value?.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\t{...elTreeEmits.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data[\"all\"] ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div>{data[\"all\"] ? data.label : slots.label ? slots.label({ node, data }) : node.label}</div>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{!data[\"all\"] && slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** @description 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,MAAa,cAAc;CAC1B,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAA0D;GAAC;GAAQ;GAAQ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,WAAW;;GAEtD,mBAAmB,eAAe,QAAQ,OAAO,iBAAiB;;GAElE,iBAAiB,eAAe,QAAQ,OAAO,eAAe;;GAE9D,iBAAiB,eAAe,QAAQ,OAAO,eAAe;;GAE9D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,YAAY,eAAe,QAAQ,OAAO,UAAU;;GAEpD,qBAAqB,eAAe,QAAQ,OAAO,mBAAmB;;GAEtE,oBAAoB,eAAe,QAAQ,OAAO,kBAAkB;;GAEpE,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,SAAS,eAAe,QAAQ,OAAO,OAAO;;GAE9C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,cAAc,eAAe,QAAQ,OAAO,YAAY;;GAExD,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterNodeMethodFunction, FilterValue, TreeNode, TreeNodeData } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\n/** FaTree 的运行时 Props 定义。 */\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: \"\",\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: unknown) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<unknown>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义。 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n};\n\n/** FaTree 的插槽参数。 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: TreeNode; data: ElTreeOutput };\n}\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null>(props.modelValue),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: props.hamburger || false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addCssUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.orgTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tlet curSelectedData: string | number | undefined;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tconst currentKey: unknown = treeRef.value?.getCurrentKey();\n\t\t\t\tif (typeof currentKey === \"string\" || typeof currentKey === \"number\") curSelectedData = currentKey;\n\t\t\t}\n\t\t\tlet treeData: ElTreeOutput[];\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = {\n\t\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\t\tsearchValue: state.searchValue,\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tconst responseData = await props.requestApi(params);\n\t\t\t\t\ttreeData = responseData.map((item) => ({ ...item }));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data.map((item) => ({ ...item }));\n\t\t\t}\n\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true });\n\t\t\t}\n\t\t\tstate.orgTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChangeCallBack\", state.treeData);\n\t\t\tconst selectedKey = curSelectedData ?? props.modelValue ?? props.defaultSelection;\n\t\t\tif (props.nodeKey && (typeof selectedKey === \"string\" || typeof selectedKey === \"number\")) {\n\t\t\t\tvoid nextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value?.setCurrentKey(selectedKey);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.orgTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((item) => ({ ...item, [props.props.children ?? \"children\"]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = data[\"all\"] ? [data[\"label\"]] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) =>\n\t\t\t\ttypeof label === \"string\" || typeof label === \"number\" ? String(label).includes(filterText) : false\n\t\t\t);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!data[\"all\"] && (node.key === undefined || node.key === null)) return;\n\t\t\tstate.value = data[\"all\"] ? (props.allValue ?? null) : (node.key ?? null);\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tstate.value = newValue ?? null;\n\t\t\t\tif (typeof newValue === \"string\" || typeof newValue === \"number\") treeRef.value?.setCurrentKey(newValue);\n\t\t\t}\n\t\t);\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\t\tconst elTreeEmits = useEmits(treeEmits, emit, [\"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": state.hamburger || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title !== undefined || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\tonInput={(value) => treeRef.value?.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\t{...elTreeEmits.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data[\"all\"] ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div>{data[\"all\"] ? data.label : slots.label ? slots.label({ node, data }) : node.label}</div>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{!data[\"all\"] && slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** @description 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAWA,MAAa,cAAc;CAC1B,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,OAAO;;CAEP,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,kBAAkB,CAAC,QAAQ,MAAM;;CAEjC,OAAO;;CAEP,WAAW;;CAEX,SAAS;;CAET,YAAY;;CAEZ,UAAU;EACT,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS;CACV;;CAEA,MAAM;EACL,MAAM,eAA+B,KAAK;EAC1C,eAA+B,CAAA;CAChC;;CAEA,YAAY,EACX,MAAM,eAA8D,QAAQ,EAC7E;;CAEA,WAAW,eAAwB;EAAC;EAAQ;EAAQ;CAAM,CAAC;AAC5D;;AAGA,MAAa,cAAc;CAC1B,GAAG;;CAEH,sBAAsB,UACrB,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,UAAU,KAAK,KAAK,SAAS,KAAK,KAAK,OAAO,KAAK;;CAE1F,iBAAiB,UAA2B,SAAS,KAAK,KAAK,OAAO,KAAK;;CAE3E,qBAAqB,SAAkC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D,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
|
|
@@ -5,17 +5,10 @@ import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
|
5
5
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
6
6
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
7
7
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
8
|
-
import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
|
|
9
|
-
import isObject from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.mjs";
|
|
10
|
-
import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
|
|
11
|
-
import isBoolean from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBoolean.mjs";
|
|
12
|
-
import isEqual from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.mjs";
|
|
13
|
-
import isNumber from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs";
|
|
14
|
-
import isNil from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs";
|
|
15
|
-
import isNull from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs";
|
|
16
|
-
import { useVModel } from "../../../node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
17
8
|
import { computed, createVNode, defineComponent, mergeProps, onMounted, reactive, ref, watch } from "vue";
|
|
18
9
|
import { ElTreeSelect, selectEmits, selectProps, treeEmits, treeProps } from "element-plus";
|
|
10
|
+
import { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from "lodash-unified";
|
|
11
|
+
import { useVModel } from "@vueuse/core";
|
|
19
12
|
//#region src/components/treeSelect/src/treeSelect.tsx
|
|
20
13
|
const ElTreeSelectWithClear = ElTreeSelect;
|
|
21
14
|
/** FaTreeSelect 的运行时 Props 定义。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeSelect.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/treeSelect/src/treeSelect.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElTreeSelect, selectEmits, selectProps, treeEmits, treeProps } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { type SelectComponentProps } from \"../../select/src/select\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select\";\nimport type { FilterNodeMethodFunction, FilterValue, TreeNode, TreeNodeData } from \"../../tree/src/tree.props\";\nimport type { SelectInstance, TreeInstance } from \"element-plus\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\n/** 补充 Element Plus TreeSelect 运行时支持但类型声明缺失的 clear 事件。 */\ntype ElTreeSelectWithClearType = typeof ElTreeSelect &\n\t(new () => {\n\t\t$props: InstanceType<typeof ElTreeSelect>[\"$props\"] & {\n\t\t\tonClear?: () => void;\n\t\t};\n\t});\n\nconst ElTreeSelectWithClear = ElTreeSelect as ElTreeSelectWithClearType;\n\n/** Element Plus TreeSelect 运行时实际暴露的方法集合。 */\ntype ElTreeSelectExposes = Pick<SelectInstance, \"focus\" | \"blur\" | \"selectedLabel\"> &\n\tPick<\n\t\tTreeInstance,\n\t\t| \"filter\"\n\t\t| \"updateKeyChildren\"\n\t\t| \"getCheckedNodes\"\n\t\t| \"setCheckedNodes\"\n\t\t| \"getCheckedKeys\"\n\t\t| \"setCheckedKeys\"\n\t\t| \"setChecked\"\n\t\t| \"getHalfCheckedNodes\"\n\t\t| \"getHalfCheckedKeys\"\n\t\t| \"getCurrentKey\"\n\t\t| \"getCurrentNode\"\n\t\t| \"setCurrentKey\"\n\t\t| \"setCurrentNode\"\n\t\t| \"getNode\"\n\t\t| \"remove\"\n\t\t| \"append\"\n\t\t| \"insertBefore\"\n\t\t| \"insertAfter\"\n\t> & {\n\t\ttreeRef: TreeInstance;\n\t\tselectRef: SelectInstance;\n\t};\n\n/** FaTreeSelect 的运行时 Props 定义。 */\nexport const faTreeSelectProps = {\n\t...selectProps,\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/**\n\t * 懒加载节点的缓存数据,结构与数据相同,用于获取未加载数据的标签\n\t * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data\n\t */\n\tcacheData: {\n\t\ttype: definePropType<\n\t\t\t{\n\t\t\t\tvalue: string | number | boolean | object;\n\t\t\t\tcurrentLabel: string | number;\n\t\t\t\tisDisabled: boolean;\n\t\t\t}[]\n\t\t>(Array),\n\t\tdefault: [] as {\n\t\t\tvalue: string | number | boolean | object;\n\t\t\tcurrentLabel: string | number;\n\t\t\tisDisabled: boolean;\n\t\t}[],\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。 */\n\texpandOnClickNode: Boolean,\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: (): Partial<SelectComponentProps> => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: unknown) => Promise<ElSelectorOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<unknown>([String, Number, Object]),\n};\n\n/** FaTreeSelect 的运行时 Emits 定义。 */\nexport const faTreeSelectEmits = {\n\t...selectEmits,\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: unknown, _value?: ElSelectorModelValue): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n};\n\n/** FaTreeSelect 的插槽参数。 */\nexport interface FaTreeSelectSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElSelectorOutput };\n\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaTreeSelect\",\n\tprops: faTreeSelectProps,\n\temits: faTreeSelectEmits,\n\tslots: makeSlots<FaTreeSelectSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data?.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst treeSelectRef = ref<ElTreeSelectExposes>();\n\t\tlet requestVersion = 0;\n\n\t\tconst handleData = (data: ElSelectorOutput[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t.map((item): ElSelectorOutput => {\n\t\t\t\t\tconst value = item[props.nodeKey];\n\t\t\t\t\tconst label = typeof props.props.label === \"function\" ? props.props.label(item) : item[props.props.label ?? \"label\"];\n\t\t\t\t\tconst hide = typeof props.props.hide === \"function\" ? props.props.hide(item) : item[props.props.hide ?? \"hide\"];\n\t\t\t\t\tconst disabled =\n\t\t\t\t\t\ttypeof props.props.disabled === \"function\" ? props.props.disabled(item) : item[props.props.disabled ?? \"disabled\"];\n\t\t\t\t\tconst children = item[props.props.children ?? \"children\"];\n\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: Array.isArray(children) ? handleData(children as ElSelectorOutput[]) : [],\n\t\t\t\t\t\tdisabled: typeof disabled === \"boolean\" ? disabled : undefined,\n\t\t\t\t\t\thide: typeof hide === \"boolean\" ? hide : undefined,\n\t\t\t\t\t\tlabel: typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.filter((item) => item.hide !== true);\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\tstate.selectorData = handleData(resData);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = handleData(props.data);\n\t\t\t}\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) => label.includes(filterText));\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleChange = (value?: ElSelectorModelValue, data?: ElSelectorOutput): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((item) => item.label ?? \"\");\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata ??= state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data?.label ?? null;\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data ?? null, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElSelectorOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否开启了 checkStrictly\n\t\t\tif (props.checkStrictly) {\n\t\t\t\thandleChange(data.value, data);\n\t\t\t} else {\n\t\t\t\tif (node.isLeaf) {\n\t\t\t\t\thandleChange(data.value, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\t/**\n\t\t * 下拉框出现/隐藏时触发\n\t\t */\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\tprops.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tif (firstItem?.value !== undefined) {\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\thandleChange([firstItem.value]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandleChange(firstItem.value, firstItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data?.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elTreeSelectProps = useProps(props, { ...selectProps, ...treeProps }, [\n\t\t\t\"modelValue\",\n\t\t\t\"popperClass\",\n\t\t\t\"lazy\",\n\t\t\t\"loading\",\n\t\t\t\"expandOnClickNode\",\n\t\t\t\"filterNodeMethod\",\n\t\t\t\"props\",\n\t\t]);\n\t\tconst elTreeSelectEmits = useEmits({ ...selectEmits, ...treeEmits }, emit, [\"update:modelValue\", \"clear\", \"visible-change\", \"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElTreeSelectWithClear\n\t\t\t\t{...elTreeSelectProps.value}\n\t\t\t\t{...elTreeSelectEmits.value}\n\t\t\t\tref={treeSelectRef}\n\t\t\t\tclass=\"fa-tree-select\"\n\t\t\t\tpopperClass={[\"fa-tree-select-dropdown\", props.popperClass]}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tlazy={false}\n\t\t\t\tloading={state.loading}\n\t\t\t\tdata={state.selectorData}\n\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\tfilterNodeMethod={handleFilterNode as typeof props.filterNodeMethod}\n\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElSelectorOutput }): VNode[] => slots.default?.({ node, data }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElTreeSelectWithClear>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点。 */\n\t\t\tfocus: computed(() => treeSelectRef.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框。 */\n\t\t\tblur: computed(() => treeSelectRef.value?.blur),\n\t\t\t/** @description 获取当前选中的标签。 */\n\t\t\tselectedLabel: computed(() => treeSelectRef.value?.selectedLabel),\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏。 */\n\t\t\tfilter: computed(() => treeSelectRef.value?.filter),\n\t\t\t/** @description 为节点设置新数据,只有设置 node-key 时可用。 */\n\t\t\tupdateKeyChildren: computed(() => treeSelectRef.value?.updateKeyChildren),\n\t\t\t/** @description 获取当前选中的节点。 */\n\t\t\tgetCheckedNodes: computed(() => treeSelectRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置当前选中的节点。 */\n\t\t\tsetCheckedNodes: computed(() => treeSelectRef.value?.setCheckedNodes),\n\t\t\t/** @description 获取当前选中的节点 Key。 */\n\t\t\tgetCheckedKeys: computed(() => treeSelectRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置当前选中的节点 Key。 */\n\t\t\tsetCheckedKeys: computed(() => treeSelectRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点选中状态。 */\n\t\t\tsetChecked: computed(() => treeSelectRef.value?.setChecked),\n\t\t\t/** @description 获取当前半选中的节点。 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeSelectRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 获取当前半选中的节点 Key。 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeSelectRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 获取当前节点 Key。 */\n\t\t\tgetCurrentKey: computed(() => treeSelectRef.value?.getCurrentKey),\n\t\t\t/** @description 获取当前节点。 */\n\t\t\tgetCurrentNode: computed(() => treeSelectRef.value?.getCurrentNode),\n\t\t\t/** @description 设置当前节点 Key。 */\n\t\t\tsetCurrentKey: computed(() => treeSelectRef.value?.setCurrentKey),\n\t\t\t/** @description 设置当前节点。 */\n\t\t\tsetCurrentNode: computed(() => treeSelectRef.value?.setCurrentNode),\n\t\t\t/** @description 根据数据或 Key 获取节点。 */\n\t\t\tgetNode: computed(() => treeSelectRef.value?.getNode),\n\t\t\t/** @description 删除节点。 */\n\t\t\tremove: computed(() => treeSelectRef.value?.remove),\n\t\t\t/** @description 追加子节点。 */\n\t\t\tappend: computed(() => treeSelectRef.value?.append),\n\t\t\t/** @description 在指定节点前插入节点。 */\n\t\t\tinsertBefore: computed(() => treeSelectRef.value?.insertBefore),\n\t\t\t/** @description 在指定节点后插入节点。 */\n\t\t\tinsertAfter: computed(() => treeSelectRef.value?.insertAfter),\n\t\t\t/** @description Element Plus Tree 实例。 */\n\t\t\ttreeRef: computed(() => treeSelectRef.value?.treeRef),\n\t\t\t/** @description Element Plus Select 实例。 */\n\t\t\tselectRef: computed(() => treeSelectRef.value?.selectRef),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,wBAAwB;;AA8B9B,MAAa,oBAAoB;CAChC,GAAG;CACH,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;;;;CAKA,WAAW;EACV,MAAM,eAMJ,KAAK;EACP,SAAS,CAAA;CAKV;;CAEA,UAAU;EACT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AAe,cAAc,OAAO,cAAc;;GAElE,eAAe,eAAe,cAAc,OAAO,aAAa;;GAEhE,gBAAgB,eAAe,cAAc,OAAO,cAAc;;GAElE,SAAS,eAAe,cAAc,OAAO,OAAO;;GAEpD,QAAQ,eAAe,cAAc,OAAO,MAAM;;GAElD,QAAQ,eAAe,cAAc,OAAO,MAAM;;GAElD,cAAc,eAAe,cAAc,OAAO,YAAY;;GAE9D,aAAa,eAAe,cAAc,OAAO,WAAW;;GAE5D,SAAS,eAAe,cAAc,OAAO,OAAO;;GAEpD,WAAW,eAAe,cAAc,OAAO,SAAS;;GAExD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;;GAET,eAAe,UAA2D,aAAa,KAAK;;GAE5F,sBAAsB,aAAa,IAAI;EACxC,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"treeSelect.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/treeSelect/src/treeSelect.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElTreeSelect, selectEmits, selectProps, treeEmits, treeProps } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { type SelectComponentProps } from \"../../select/src/select\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select\";\nimport type { FilterNodeMethodFunction, FilterValue, TreeNode, TreeNodeData } from \"../../tree/src/tree.props\";\nimport type { SelectInstance, TreeInstance } from \"element-plus\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\n/** 补充 Element Plus TreeSelect 运行时支持但类型声明缺失的 clear 事件。 */\ntype ElTreeSelectWithClearType = typeof ElTreeSelect &\n\t(new () => {\n\t\t$props: InstanceType<typeof ElTreeSelect>[\"$props\"] & {\n\t\t\tonClear?: () => void;\n\t\t};\n\t});\n\nconst ElTreeSelectWithClear = ElTreeSelect as ElTreeSelectWithClearType;\n\n/** Element Plus TreeSelect 运行时实际暴露的方法集合。 */\ntype ElTreeSelectExposes = Pick<SelectInstance, \"focus\" | \"blur\" | \"selectedLabel\"> &\n\tPick<\n\t\tTreeInstance,\n\t\t| \"filter\"\n\t\t| \"updateKeyChildren\"\n\t\t| \"getCheckedNodes\"\n\t\t| \"setCheckedNodes\"\n\t\t| \"getCheckedKeys\"\n\t\t| \"setCheckedKeys\"\n\t\t| \"setChecked\"\n\t\t| \"getHalfCheckedNodes\"\n\t\t| \"getHalfCheckedKeys\"\n\t\t| \"getCurrentKey\"\n\t\t| \"getCurrentNode\"\n\t\t| \"setCurrentKey\"\n\t\t| \"setCurrentNode\"\n\t\t| \"getNode\"\n\t\t| \"remove\"\n\t\t| \"append\"\n\t\t| \"insertBefore\"\n\t\t| \"insertAfter\"\n\t> & {\n\t\ttreeRef: TreeInstance;\n\t\tselectRef: SelectInstance;\n\t};\n\n/** FaTreeSelect 的运行时 Props 定义。 */\nexport const faTreeSelectProps = {\n\t...selectProps,\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/**\n\t * 懒加载节点的缓存数据,结构与数据相同,用于获取未加载数据的标签\n\t * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data\n\t */\n\tcacheData: {\n\t\ttype: definePropType<\n\t\t\t{\n\t\t\t\tvalue: string | number | boolean | object;\n\t\t\t\tcurrentLabel: string | number;\n\t\t\t\tisDisabled: boolean;\n\t\t\t}[]\n\t\t>(Array),\n\t\tdefault: [] as {\n\t\t\tvalue: string | number | boolean | object;\n\t\t\tcurrentLabel: string | number;\n\t\t\tisDisabled: boolean;\n\t\t}[],\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。 */\n\texpandOnClickNode: Boolean,\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: (): Partial<SelectComponentProps> => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: unknown) => Promise<ElSelectorOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<unknown>([String, Number, Object]),\n};\n\n/** FaTreeSelect 的运行时 Emits 定义。 */\nexport const faTreeSelectEmits = {\n\t...selectEmits,\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: unknown, _value?: ElSelectorModelValue): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n};\n\n/** FaTreeSelect 的插槽参数。 */\nexport interface FaTreeSelectSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElSelectorOutput };\n\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaTreeSelect\",\n\tprops: faTreeSelectProps,\n\temits: faTreeSelectEmits,\n\tslots: makeSlots<FaTreeSelectSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data?.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst treeSelectRef = ref<ElTreeSelectExposes>();\n\t\tlet requestVersion = 0;\n\n\t\tconst handleData = (data: ElSelectorOutput[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t.map((item): ElSelectorOutput => {\n\t\t\t\t\tconst value = item[props.nodeKey];\n\t\t\t\t\tconst label = typeof props.props.label === \"function\" ? props.props.label(item) : item[props.props.label ?? \"label\"];\n\t\t\t\t\tconst hide = typeof props.props.hide === \"function\" ? props.props.hide(item) : item[props.props.hide ?? \"hide\"];\n\t\t\t\t\tconst disabled =\n\t\t\t\t\t\ttypeof props.props.disabled === \"function\" ? props.props.disabled(item) : item[props.props.disabled ?? \"disabled\"];\n\t\t\t\t\tconst children = item[props.props.children ?? \"children\"];\n\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: Array.isArray(children) ? handleData(children as ElSelectorOutput[]) : [],\n\t\t\t\t\t\tdisabled: typeof disabled === \"boolean\" ? disabled : undefined,\n\t\t\t\t\t\thide: typeof hide === \"boolean\" ? hide : undefined,\n\t\t\t\t\t\tlabel: typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.filter((item) => item.hide !== true);\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\tstate.selectorData = handleData(resData);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = handleData(props.data);\n\t\t\t}\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) => label.includes(filterText));\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleChange = (value?: ElSelectorModelValue, data?: ElSelectorOutput): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((item) => item.label ?? \"\");\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata ??= state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data?.label ?? null;\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data ?? null, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElSelectorOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否开启了 checkStrictly\n\t\t\tif (props.checkStrictly) {\n\t\t\t\thandleChange(data.value, data);\n\t\t\t} else {\n\t\t\t\tif (node.isLeaf) {\n\t\t\t\t\thandleChange(data.value, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\t/**\n\t\t * 下拉框出现/隐藏时触发\n\t\t */\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\tprops.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaTreeSelect]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tif (firstItem?.value !== undefined) {\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\thandleChange([firstItem.value]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandleChange(firstItem.value, firstItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data?.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elTreeSelectProps = useProps(props, { ...selectProps, ...treeProps }, [\n\t\t\t\"modelValue\",\n\t\t\t\"popperClass\",\n\t\t\t\"lazy\",\n\t\t\t\"loading\",\n\t\t\t\"expandOnClickNode\",\n\t\t\t\"filterNodeMethod\",\n\t\t\t\"props\",\n\t\t]);\n\t\tconst elTreeSelectEmits = useEmits({ ...selectEmits, ...treeEmits }, emit, [\"update:modelValue\", \"clear\", \"visible-change\", \"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElTreeSelectWithClear\n\t\t\t\t{...elTreeSelectProps.value}\n\t\t\t\t{...elTreeSelectEmits.value}\n\t\t\t\tref={treeSelectRef}\n\t\t\t\tclass=\"fa-tree-select\"\n\t\t\t\tpopperClass={[\"fa-tree-select-dropdown\", props.popperClass]}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tlazy={false}\n\t\t\t\tloading={state.loading}\n\t\t\t\tdata={state.selectorData}\n\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\tfilterNodeMethod={handleFilterNode as typeof props.filterNodeMethod}\n\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElSelectorOutput }): VNode[] => slots.default?.({ node, data }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElTreeSelectWithClear>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点。 */\n\t\t\tfocus: computed(() => treeSelectRef.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框。 */\n\t\t\tblur: computed(() => treeSelectRef.value?.blur),\n\t\t\t/** @description 获取当前选中的标签。 */\n\t\t\tselectedLabel: computed(() => treeSelectRef.value?.selectedLabel),\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏。 */\n\t\t\tfilter: computed(() => treeSelectRef.value?.filter),\n\t\t\t/** @description 为节点设置新数据,只有设置 node-key 时可用。 */\n\t\t\tupdateKeyChildren: computed(() => treeSelectRef.value?.updateKeyChildren),\n\t\t\t/** @description 获取当前选中的节点。 */\n\t\t\tgetCheckedNodes: computed(() => treeSelectRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置当前选中的节点。 */\n\t\t\tsetCheckedNodes: computed(() => treeSelectRef.value?.setCheckedNodes),\n\t\t\t/** @description 获取当前选中的节点 Key。 */\n\t\t\tgetCheckedKeys: computed(() => treeSelectRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置当前选中的节点 Key。 */\n\t\t\tsetCheckedKeys: computed(() => treeSelectRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点选中状态。 */\n\t\t\tsetChecked: computed(() => treeSelectRef.value?.setChecked),\n\t\t\t/** @description 获取当前半选中的节点。 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeSelectRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 获取当前半选中的节点 Key。 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeSelectRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 获取当前节点 Key。 */\n\t\t\tgetCurrentKey: computed(() => treeSelectRef.value?.getCurrentKey),\n\t\t\t/** @description 获取当前节点。 */\n\t\t\tgetCurrentNode: computed(() => treeSelectRef.value?.getCurrentNode),\n\t\t\t/** @description 设置当前节点 Key。 */\n\t\t\tsetCurrentKey: computed(() => treeSelectRef.value?.setCurrentKey),\n\t\t\t/** @description 设置当前节点。 */\n\t\t\tsetCurrentNode: computed(() => treeSelectRef.value?.setCurrentNode),\n\t\t\t/** @description 根据数据或 Key 获取节点。 */\n\t\t\tgetNode: computed(() => treeSelectRef.value?.getNode),\n\t\t\t/** @description 删除节点。 */\n\t\t\tremove: computed(() => treeSelectRef.value?.remove),\n\t\t\t/** @description 追加子节点。 */\n\t\t\tappend: computed(() => treeSelectRef.value?.append),\n\t\t\t/** @description 在指定节点前插入节点。 */\n\t\t\tinsertBefore: computed(() => treeSelectRef.value?.insertBefore),\n\t\t\t/** @description 在指定节点后插入节点。 */\n\t\t\tinsertAfter: computed(() => treeSelectRef.value?.insertAfter),\n\t\t\t/** @description Element Plus Tree 实例。 */\n\t\t\ttreeRef: computed(() => treeSelectRef.value?.treeRef),\n\t\t\t/** @description Element Plus Select 实例。 */\n\t\t\tselectRef: computed(() => treeSelectRef.value?.selectRef),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAM,wBAAwB;;AA8B9B,MAAa,oBAAoB;CAChC,GAAG;CACH,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;;;;CAKA,WAAW;EACV,MAAM,eAMJ,KAAK;EACP,SAAS,CAAA;CAKV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;EACX,MAAM;EACN,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;EACpB,MAAM;EACN,SAAS;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;;CAEnB,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAAqC;GAAC;GAAQ;GAAQ;GAAS;GAAQ;EAAK,CAAC;EACnF,SAAS,KAAA;CACV;;CAEA,OAAO,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAE/D,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,YAAY;;CAEZ,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,iBAAiB;;CAEjB,OAAO;EACN,MAAM,eAAqC,MAAM;EACjD,gBAA+C;GAC9C,OAAO;GACP,MAAM;GACN,UAAU;GACV,UAAU;EACX;CACD;;CAEA,MAAM;EACL,MAAM,eAAmC,KAAK;EAC9C,eAAmC,CAAA;CACpC;;CAE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