@dt-frames/ui 3.0.1 → 4.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/dist/es/_virtual/preload-helper.mjs +1 -0
- package/dist/es/assets/node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress-BgDCIyLK.css +1 -0
- package/dist/es/components/drawer/index.d.ts +5 -0
- package/dist/es/components/drawer/index.mjs +1 -0
- package/{es → dist/es}/components/drawer/src/hooks/useDrawer.d.ts +1 -1
- package/dist/es/components/drawer/src/index.d.ts +20 -0
- package/dist/es/components/drawer/src/types/index.d.ts +208 -0
- package/dist/es/components/drawer/src/types/index.ts +223 -0
- package/dist/es/components/form/index.d.ts +9 -0
- package/dist/es/components/form/index.mjs +1 -0
- package/dist/es/components/form/src/conponents/FormButtons.d.ts +29 -0
- package/dist/es/components/form/src/conponents/FormItems.d.ts +19 -0
- package/dist/es/components/form/src/conponents/RadioGroup.d.ts +10 -0
- package/{es/components/form/src/components → dist/es/components/form/src/conponents}/componentMap.d.ts +1 -1
- package/dist/es/components/form/src/hooks/useForm.d.ts +8 -0
- package/dist/es/components/form/src/hooks/useFormActions.d.ts +32 -0
- package/dist/es/components/form/src/hooks/useFormEvent.d.ts +29 -0
- package/dist/es/components/form/src/hooks/useFormValues.d.ts +13 -0
- package/dist/es/components/form/src/index.d.ts +493 -0
- package/dist/es/components/form/src/types/form.d.ts +355 -0
- package/dist/es/components/form/src/types/form.ts +391 -0
- package/dist/es/components/form/src/types/item.d.ts +3036 -0
- package/dist/es/components/form/src/types/item.ts +3169 -0
- package/dist/es/components/form/src/utils/index.d.ts +16 -0
- package/dist/es/components/form/styles/index.scss +10 -0
- package/dist/es/components/hover-card/index.d.ts +7 -0
- package/dist/es/components/hover-card/index.mjs +1 -0
- package/dist/es/components/hover-card/src/hover-card-content.d.ts +24 -0
- package/dist/es/components/hover-card/src/hover-card-trigger.d.ts +18 -0
- package/dist/es/components/hover-card/src/hover-card.d.ts +22 -0
- package/dist/es/components/icon/index.d.ts +4 -0
- package/dist/es/components/icon/index.mjs +1 -0
- package/dist/es/components/icon/src/index.d.ts +31 -0
- package/dist/es/components/icon/src/types/index.d.ts +6 -0
- package/dist/es/components/icon-picker/index.d.ts +4 -0
- package/dist/es/components/icon-picker/index.mjs +9 -0
- package/dist/es/components/icon-picker/src/components/IconPicker.d.ts +23 -0
- package/dist/es/components/icon-picker/src/components/SelectIcon.d.ts +39 -0
- package/dist/es/components/icon-picker/src/icon.d.ts +13 -0
- package/dist/es/components/icon-picker/src/index.d.ts +27 -0
- package/dist/es/components/icon-picker/styles/index.scss +0 -0
- package/dist/es/components/iframe/index.d.ts +4 -0
- package/dist/es/components/iframe/index.mjs +1 -0
- package/dist/es/components/iframe/src/index.d.ts +46 -0
- package/dist/es/components/modal/index.d.ts +7 -0
- package/dist/es/components/modal/index.mjs +1 -0
- package/dist/es/components/modal/src/components/Header.d.ts +8 -0
- package/dist/es/components/modal/src/hooks/useModal.d.ts +24 -0
- package/dist/es/components/modal/src/index.d.ts +822 -0
- package/dist/es/components/modal/src/types/modal.d.ts +246 -0
- package/dist/es/components/modal/src/types/modal.ts +265 -0
- package/dist/es/components/modal/styles/index.scss +8 -0
- package/dist/es/components/table/index.d.ts +9 -0
- package/dist/es/components/table/index.mjs +1 -0
- package/dist/es/components/table/src/components/Pagination.d.ts +15 -0
- package/dist/es/components/table/src/components/TableAction.d.ts +18 -0
- package/dist/es/components/table/src/components/TableHeader.d.ts +28 -0
- package/dist/es/components/table/src/components/TableLoading.d.ts +2 -0
- package/dist/es/components/table/src/components/tableSetting/Column.d.ts +222 -0
- package/dist/es/components/table/src/components/tableSetting/Download.d.ts +6 -0
- package/dist/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +2 -0
- package/dist/es/components/table/src/components/tableSetting/Fullscreen.d.ts +2 -0
- package/dist/es/components/table/src/components/tableSetting/Search.d.ts +5 -0
- package/dist/es/components/table/src/components/tableSetting/index.d.ts +7 -0
- package/dist/es/components/table/src/hooks/useColumns.d.ts +18 -0
- package/dist/es/components/table/src/hooks/useDataSource.d.ts +17 -0
- package/dist/es/components/table/src/hooks/useLoading.d.ts +7 -0
- package/dist/es/components/table/src/hooks/usePagination.d.ts +9 -0
- package/dist/es/components/table/src/hooks/useRowSelection.d.ts +7 -0
- package/dist/es/components/table/src/hooks/useTable.d.ts +3 -0
- package/dist/es/components/table/src/hooks/useTableIns.d.ts +12 -0
- package/dist/es/components/table/src/index.d.ts +775 -0
- package/dist/es/components/table/src/types/pagination.d.ts +100 -0
- package/dist/es/components/table/src/types/pagination.ts +102 -0
- package/dist/es/components/table/src/types/table.d.ts +632 -0
- package/dist/es/components/table/src/types/table.ts +668 -0
- package/dist/es/components/table/styles/index.scss +66 -0
- package/dist/es/components/tree/index.d.ts +7 -0
- package/dist/es/components/tree/index.mjs +1 -0
- package/dist/es/components/tree/src/components/ContextMenu.d.ts +80 -0
- package/dist/es/components/tree/src/components/TreeHeader.d.ts +31 -0
- package/dist/es/components/tree/src/hooks/useContextMenu.d.ts +11 -0
- package/dist/es/components/tree/src/hooks/useTree.d.ts +2 -0
- package/dist/es/components/tree/src/index.d.ts +116 -0
- package/dist/es/components/tree/src/types/index.d.ts +758 -0
- package/dist/es/components/tree/src/types/index.ts +788 -0
- package/dist/es/components/tree/styles/index.scss +15 -0
- package/dist/es/components/upload/assets/docx-preview-BLYEK_jf.js +38 -0
- package/dist/es/components/upload/assets/index-CUsgWuYW.css +1 -0
- package/dist/es/components/upload/assets/nprogress-BgDCIyLK.css +1 -0
- package/dist/es/components/upload/index.d.ts +6 -0
- package/dist/es/components/upload/index.mjs +1 -0
- package/dist/es/components/upload/src/components/PdfView.d.ts +2 -0
- package/dist/es/components/upload/src/components/WordView.d.ts +4 -0
- package/dist/es/components/upload/src/hooks/useFile.d.ts +14 -0
- package/dist/es/components/upload/src/index.d.ts +23 -0
- package/dist/es/components/upload/src/types/index.d.ts +229 -0
- package/dist/es/components/upload/src/utils/index.d.ts +15 -0
- package/dist/es/components/upload/styles/index.scss +0 -0
- package/dist/es/components/virtual-list/index.d.ts +4 -0
- package/dist/es/components/virtual-list/index.mjs +1 -0
- package/dist/es/components/virtual-list/src/index.d.ts +32 -0
- package/dist/es/components/virtual-list/src/types/index.d.ts +26 -0
- package/dist/es/components/virtual-list/styles/index.scss +0 -0
- package/dist/es/components/vxe-table/index.d.ts +7 -0
- package/dist/es/components/vxe-table/index.mjs +1 -0
- package/dist/es/components/vxe-table/src/components/Header.d.ts +28 -0
- package/dist/es/components/vxe-table/src/components/Pagination.d.ts +15 -0
- package/dist/es/components/vxe-table/src/components/RenderCell.d.ts +10 -0
- package/dist/es/components/vxe-table/src/components/TableAction.d.ts +18 -0
- package/dist/es/components/vxe-table/src/components/tableSetting/Column.d.ts +222 -0
- package/dist/es/components/vxe-table/src/components/tableSetting/Download.d.ts +6 -0
- package/dist/es/components/vxe-table/src/components/tableSetting/DownloadCtrl.d.ts +2 -0
- package/dist/es/components/vxe-table/src/components/tableSetting/Fullscreen.d.ts +2 -0
- package/dist/es/components/vxe-table/src/components/tableSetting/index.d.ts +7 -0
- package/dist/es/components/vxe-table/src/helper/index.d.ts +7 -0
- package/dist/es/components/vxe-table/src/hooks/useColumns.d.ts +5 -0
- package/dist/es/components/vxe-table/src/hooks/usePagination.d.ts +7 -0
- package/dist/es/components/vxe-table/src/hooks/useTableIns.d.ts +15 -0
- package/dist/es/components/vxe-table/src/hooks/useVxeTable.d.ts +2 -0
- package/dist/es/components/vxe-table/src/index.d.ts +155 -0
- package/dist/es/components/vxe-table/src/types/index.d.ts +181 -0
- package/dist/es/components/vxe-table/src/types/pagination.d.ts +100 -0
- package/dist/es/components/vxe-table/src/types/table.d.ts +25 -0
- package/dist/es/components/vxe-table/src/utils/index.d.ts +5 -0
- package/dist/es/components/vxe-table/styles/index.scss +6 -0
- package/dist/es/hooks/useCurd.d.ts +4 -0
- package/dist/es/hooks/useCurd.mjs +1 -0
- package/dist/es/hooks/useDownload.d.ts +9 -0
- package/dist/es/hooks/useDownload.mjs +1 -0
- package/dist/es/hooks/useSource.d.ts +10 -0
- package/dist/es/hooks/useSource.mjs +1 -0
- package/dist/es/index.d.ts +11 -0
- package/dist/es/index.mjs +1 -0
- package/dist/es/init/config.d.ts +6 -0
- package/dist/es/init/config.mjs +1 -0
- package/dist/es/init/index.d.ts +11 -0
- package/dist/es/init/index.mjs +1 -0
- package/dist/es/init/types/appConf.d.ts +331 -0
- package/dist/es/init/vxeTable.d.ts +5 -0
- package/dist/es/layout/assets/avator-uscRzRXF.png +0 -0
- package/dist/es/layout/index.d.ts +11 -0
- package/dist/es/layout/index.mjs +3 -0
- package/dist/es/layout/src/components/LayoutContent.d.ts +22 -0
- package/dist/es/layout/src/components/LayoutFooter.d.ts +23 -0
- package/dist/es/layout/src/components/LayoutHeader.d.ts +49 -0
- package/dist/es/layout/src/components/LayoutSidebar.d.ts +116 -0
- package/dist/es/layout/src/components/LayoutTabbar.d.ts +20 -0
- package/dist/es/layout/src/components/content/Content.d.ts +2 -0
- package/dist/es/layout/src/components/footer/CopyRight.d.ts +15 -0
- package/dist/es/layout/src/components/header/ArrowRight.d.ts +2 -0
- package/dist/es/layout/src/components/header/Breadcrumb.d.ts +13 -0
- package/dist/es/layout/src/components/header/FullScreen.d.ts +2 -0
- package/dist/es/layout/src/components/header/GlobalSearch.d.ts +417 -0
- package/dist/es/layout/src/components/header/Header.d.ts +22 -0
- package/dist/es/layout/src/components/header/IconButton.d.ts +29 -0
- package/dist/es/layout/src/components/header/LanguageToggle.d.ts +8 -0
- package/dist/es/layout/src/components/header/Logo.d.ts +54 -0
- package/dist/es/layout/src/components/header/User.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/block/block.d.ts +22 -0
- package/dist/es/layout/src/components/header/perferences/block/component/CheckboxItem.d.ts +38 -0
- package/dist/es/layout/src/components/header/perferences/block/component/InputItem.d.ts +35 -0
- package/dist/es/layout/src/components/header/perferences/block/component/NumberItem.d.ts +36 -0
- package/dist/es/layout/src/components/header/perferences/block/component/SelectItem.d.ts +35 -0
- package/dist/es/layout/src/components/header/perferences/block/component/SwitchItem.d.ts +33 -0
- package/dist/es/layout/src/components/header/perferences/block/component/ToggleItem.d.ts +32 -0
- package/dist/es/layout/src/components/header/perferences/block/general/Animation.d.ts +18 -0
- package/dist/es/layout/src/components/header/perferences/block/general/General.d.ts +18 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Breadcrumb.d.ts +24 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Content.d.ts +9 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Copyright.d.ts +27 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Footer.d.ts +12 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Header.d.ts +19 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Layout.d.ts +10 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Navigation.d.ts +19 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Sidebar.d.ts +35 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Tabbar.d.ts +39 -0
- package/dist/es/layout/src/components/header/perferences/block/layout/Widget.d.ts +33 -0
- package/dist/es/layout/src/components/header/perferences/block/shortcut-keys/Global.d.ts +18 -0
- package/dist/es/layout/src/components/header/perferences/block/theme/BuiltinTheme.d.ts +16 -0
- package/dist/es/layout/src/components/header/perferences/block/theme/ColorMode.d.ts +12 -0
- package/dist/es/layout/src/components/header/perferences/block/theme/Radius.d.ts +9 -0
- package/dist/es/layout/src/components/header/perferences/block/theme/Theme.d.ts +15 -0
- package/dist/es/layout/src/components/header/perferences/icons/content-compact.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/full-content.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/header-mixed-nav.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/header-nav.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/header-sidebar-nav.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/index.d.ts +10 -0
- package/dist/es/layout/src/components/header/perferences/icons/mixed-nav.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/sidebar-mixed-nav.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/icons/sidebar-nav.d.ts +2 -0
- package/dist/es/layout/src/components/header/perferences/preferences-button.d.ts +6 -0
- package/dist/es/layout/src/components/header/perferences/preferences-drawer.d.ts +223 -0
- package/dist/es/layout/src/components/header/perferences/preferences.d.ts +27 -0
- package/dist/es/layout/src/components/lockscreen/Lockscreen.d.ts +2 -0
- package/{es/theme/src/components/header/components/lock → dist/es/layout/src/components/lockscreen}/Recharge.d.ts +3 -3
- package/dist/es/layout/src/components/lockscreen/useBattery.d.ts +16 -0
- package/dist/es/layout/src/components/lockscreen/useTime.d.ts +3 -0
- package/dist/es/layout/src/components/menu/ExtraMenu.d.ts +11 -0
- package/dist/es/layout/src/components/menu/Menu.d.ts +12 -0
- package/dist/es/layout/src/components/menu/MixedMenu.d.ts +11 -0
- package/dist/es/layout/src/components/menu/SidebarCollapseButton.d.ts +9 -0
- package/dist/es/layout/src/components/menu/SidebarFixedButton.d.ts +9 -0
- package/dist/es/layout/src/components/menu/basic-menu/BasicMenu.d.ts +37 -0
- package/dist/es/layout/src/components/menu/basic-menu/CollapseTransition.d.ts +17 -0
- package/dist/es/layout/src/components/menu/basic-menu/HoverCard.d.ts +29 -0
- package/dist/es/layout/src/components/menu/basic-menu/Menu.d.ts +5 -0
- package/dist/es/layout/src/components/menu/basic-menu/MenuBadge.d.ts +6 -0
- package/dist/es/layout/src/components/menu/basic-menu/MenuBadgeDot.d.ts +10 -0
- package/dist/es/layout/src/components/menu/basic-menu/MenuItem.d.ts +28 -0
- package/dist/es/layout/src/components/menu/basic-menu/NoramalMenu.d.ts +14 -0
- package/dist/es/layout/src/components/menu/basic-menu/SubMenu.d.ts +6 -0
- package/dist/es/layout/src/components/menu/basic-menu/SubMenuCom.d.ts +25 -0
- package/dist/es/layout/src/components/menu/basic-menu/SubMenuContent.d.ts +27 -0
- package/dist/es/layout/src/components/menu/basic-menu/index.d.ts +2 -0
- package/dist/es/layout/src/components/menu/basic-menu/type.d.ts +127 -0
- package/dist/es/layout/src/components/menu/hooks/useMenu.d.ts +9 -0
- package/dist/es/layout/src/components/menu/hooks/useMenuScroll.d.ts +9 -0
- package/dist/es/layout/src/components/tabbar/Tabbar.d.ts +6 -0
- package/dist/es/layout/src/components/tabbar/hooks/useTab.d.ts +25 -0
- package/dist/es/layout/src/components/tabbar/hooks/useTabbar.d.ts +15 -0
- package/dist/es/layout/src/components/tabbar/hooks/useTabsDrag.d.ts +8 -0
- package/dist/es/layout/src/components/tabbar/hooks/useTabsViewScroll.d.ts +11 -0
- package/dist/es/layout/src/components/tabbar/tabsView/TabsContent.d.ts +959 -0
- package/dist/es/layout/src/components/tabbar/tabsView/ToolScreen.d.ts +9 -0
- package/dist/es/layout/src/components/tabbar/tabsView/ToolsMore.d.ts +6 -0
- package/dist/es/layout/src/components/tabbar/tabsView/types.d.ts +68 -0
- package/dist/es/layout/src/const/constants.d.ts +13 -0
- package/dist/es/layout/src/const/preferences.config.d.ts +8 -0
- package/dist/es/layout/src/hooks/useContext.d.ts +6 -0
- package/dist/es/layout/src/hooks/useDesignTokens.d.ts +1 -0
- package/dist/es/layout/src/hooks/useExtraMenu.d.ts +12 -0
- package/dist/es/layout/src/hooks/useLayoutStyle.d.ts +36 -0
- package/dist/es/layout/src/hooks/useMenu.d.ts +4 -0
- package/dist/es/layout/src/hooks/useMixedMenu.d.ts +13 -0
- package/dist/es/layout/src/hooks/useNavigation.d.ts +5 -0
- package/dist/es/layout/src/hooks/useTheme.d.ts +34 -0
- package/dist/es/layout/src/index.d.ts +28 -0
- package/dist/es/layout/src/layout.d.ts +71 -0
- package/dist/es/layout/src/stores/preferences.store.d.ts +66 -0
- package/dist/es/layout/src/stores/useTabbar.store.d.ts +185 -0
- package/dist/es/layout/src/types/basic.type.d.ts +5 -0
- package/dist/es/layout/src/types/menu.type.d.ts +102 -0
- package/dist/es/layout/src/types/perferences.type.d.ts +287 -0
- package/dist/es/layout/src/types/route.type.d.ts +109 -0
- package/dist/es/layout/src/utils/color.d.ts +19 -0
- package/dist/es/layout/src/utils/css.d.ts +14 -0
- package/dist/es/layout/src/utils/diff.d.ts +6 -0
- package/dist/es/layout/src/utils/dom.d.ts +6 -0
- package/dist/es/layout/src/utils/letter.d.ts +20 -0
- package/dist/es/layout/src/utils/menu.d.ts +20 -0
- package/dist/es/layout/styles/css/animation.css +299 -0
- package/dist/es/layout/styles/css/dark.css +232 -0
- package/dist/es/layout/styles/css/default.css +174 -0
- package/dist/es/layout/styles/css/uncss.css +109 -0
- package/dist/es/layout/styles/index.scss +871 -0
- package/dist/es/lib/components/drawer/index.d.ts +5 -0
- package/dist/es/lib/components/drawer/src/hooks/useDrawer.d.ts +3 -0
- package/dist/es/lib/components/drawer/src/types/index.d.ts +208 -0
- package/dist/es/lib/components/form/index.d.ts +9 -0
- package/dist/es/lib/components/form/src/conponents/componentMap.d.ts +4 -0
- package/dist/es/lib/components/form/src/hooks/useForm.d.ts +8 -0
- package/dist/es/lib/components/form/src/hooks/useFormActions.d.ts +32 -0
- package/dist/es/lib/components/form/src/hooks/useFormEvent.d.ts +29 -0
- package/dist/es/lib/components/form/src/hooks/useFormValues.d.ts +13 -0
- package/dist/es/lib/components/form/src/types/form.d.ts +355 -0
- package/dist/es/lib/components/form/src/types/item.d.ts +3170 -0
- package/dist/es/lib/components/form/src/utils/index.d.ts +16 -0
- package/dist/es/lib/components/hover-card/index.d.ts +7 -0
- package/dist/es/lib/components/icon/index.d.ts +4 -0
- package/dist/es/lib/components/icon-picker/index.d.ts +4 -0
- package/dist/es/lib/components/icon-picker/src/icon.d.ts +13 -0
- package/dist/es/lib/components/iframe/index.d.ts +4 -0
- package/dist/es/lib/components/modal/index.d.ts +7 -0
- package/dist/es/lib/components/modal/src/hooks/useModal.d.ts +24 -0
- package/dist/es/lib/components/modal/src/types/modal.d.ts +246 -0
- package/dist/es/lib/components/table/index.d.ts +9 -0
- package/dist/es/lib/components/table/src/hooks/useColumns.d.ts +18 -0
- package/dist/es/lib/components/table/src/hooks/useDataSource.d.ts +17 -0
- package/dist/es/lib/components/table/src/hooks/useLoading.d.ts +7 -0
- package/dist/es/lib/components/table/src/hooks/usePagination.d.ts +9 -0
- package/dist/es/lib/components/table/src/hooks/useRowSelection.d.ts +7 -0
- package/dist/es/lib/components/table/src/hooks/useTable.d.ts +3 -0
- package/dist/es/lib/components/table/src/hooks/useTableIns.d.ts +12 -0
- package/dist/es/lib/components/table/src/types/pagination.d.ts +100 -0
- package/dist/es/lib/components/table/src/types/table.d.ts +632 -0
- package/dist/es/lib/components/tree/index.d.ts +7 -0
- package/dist/es/lib/components/tree/src/enums/index.d.ts +6 -0
- package/dist/es/lib/components/tree/src/hooks/useContextMenu.d.ts +11 -0
- package/dist/es/lib/components/tree/src/hooks/useTree.d.ts +2 -0
- package/dist/es/lib/components/tree/src/types/index.d.ts +758 -0
- package/dist/es/lib/components/upload/index.d.ts +4 -0
- package/dist/es/lib/components/upload/src/hooks/useFile.d.ts +14 -0
- package/dist/es/lib/components/upload/src/types/index.d.ts +88 -0
- package/dist/es/lib/components/upload/src/utils/index.d.ts +15 -0
- package/dist/es/lib/components/virtual-list/index.d.ts +4 -0
- package/dist/es/lib/components/virtual-list/src/types/index.d.ts +26 -0
- package/dist/es/lib/components/vxe-table/index.d.ts +7 -0
- package/dist/es/lib/components/vxe-table/src/helper/index.d.ts +7 -0
- package/dist/es/lib/components/vxe-table/src/hooks/useColumns.d.ts +5 -0
- package/dist/es/lib/components/vxe-table/src/hooks/usePagination.d.ts +7 -0
- package/dist/es/lib/components/vxe-table/src/hooks/useTableIns.d.ts +15 -0
- package/dist/es/lib/components/vxe-table/src/hooks/useVxeTable.d.ts +2 -0
- package/dist/es/lib/components/vxe-table/src/types/index.d.ts +181 -0
- package/dist/es/lib/components/vxe-table/src/types/pagination.d.ts +100 -0
- package/dist/es/lib/components/vxe-table/src/types/table.d.ts +25 -0
- package/dist/es/lib/components/vxe-table/src/utils/index.d.ts +5 -0
- package/dist/es/lib/hooks/useCurd.d.ts +4 -0
- package/dist/es/lib/hooks/useDownload.d.ts +9 -0
- package/dist/es/lib/hooks/useSource.d.ts +10 -0
- package/dist/es/lib/index.d.ts +10 -0
- package/dist/es/lib/init/config.d.ts +6 -0
- package/dist/es/lib/init/index.d.ts +11 -0
- package/dist/es/lib/init/types/appConf.d.ts +331 -0
- package/dist/es/lib/init/vxeTable.d.ts +9 -0
- package/dist/es/lib/layout/index.d.ts +11 -0
- package/dist/es/lib/layout/src/components/header/perferences/icons/index.d.ts +10 -0
- package/dist/es/lib/layout/src/components/lockscreen/lockscreen.store.d.ts +9 -0
- package/dist/es/lib/layout/src/components/lockscreen/useBattery.d.ts +16 -0
- package/dist/es/lib/layout/src/components/lockscreen/useTime.d.ts +3 -0
- package/dist/es/lib/layout/src/components/menu/basic-menu/index.d.ts +2 -0
- package/dist/es/lib/layout/src/components/menu/basic-menu/type.d.ts +127 -0
- package/dist/es/lib/layout/src/components/menu/hooks/useMenu.d.ts +9 -0
- package/dist/es/lib/layout/src/components/menu/hooks/useMenuScroll.d.ts +9 -0
- package/dist/es/lib/layout/src/components/tabbar/hooks/useTab.d.ts +25 -0
- package/dist/es/lib/layout/src/components/tabbar/hooks/useTabbar.d.ts +15 -0
- package/dist/es/lib/layout/src/components/tabbar/hooks/useTabsDrag.d.ts +8 -0
- package/dist/es/lib/layout/src/components/tabbar/hooks/useTabsViewScroll.d.ts +11 -0
- package/dist/es/lib/layout/src/components/tabbar/tabsView/types.d.ts +68 -0
- package/dist/es/lib/layout/src/const/constants.d.ts +13 -0
- package/dist/es/lib/layout/src/const/preferences.config.d.ts +8 -0
- package/dist/es/lib/layout/src/hooks/useContext.d.ts +6 -0
- package/dist/es/lib/layout/src/hooks/useDesignTokens.d.ts +1 -0
- package/dist/es/lib/layout/src/hooks/useExtraMenu.d.ts +12 -0
- package/dist/es/lib/layout/src/hooks/useLayoutStyle.d.ts +36 -0
- package/dist/es/lib/layout/src/hooks/useMenu.d.ts +4 -0
- package/dist/es/lib/layout/src/hooks/useMixedMenu.d.ts +13 -0
- package/dist/es/lib/layout/src/hooks/useNavigation.d.ts +5 -0
- package/dist/es/lib/layout/src/hooks/useTheme.d.ts +34 -0
- package/dist/es/lib/layout/src/stores/preferences.store.d.ts +66 -0
- package/dist/es/lib/layout/src/stores/useTabbar.store.d.ts +185 -0
- package/dist/es/lib/layout/src/types/basic.type.d.ts +5 -0
- package/dist/es/lib/layout/src/types/menu.type.d.ts +102 -0
- package/dist/es/lib/layout/src/types/perferences.type.d.ts +287 -0
- package/dist/es/lib/layout/src/types/route.type.d.ts +109 -0
- package/dist/es/lib/layout/src/utils/color.d.ts +19 -0
- package/dist/es/lib/layout/src/utils/css.d.ts +14 -0
- package/dist/es/lib/layout/src/utils/diff.d.ts +6 -0
- package/dist/es/lib/layout/src/utils/dom.d.ts +6 -0
- package/dist/es/lib/layout/src/utils/letter.d.ts +20 -0
- package/dist/es/lib/layout/src/utils/menu.d.ts +20 -0
- package/dist/es/lib/router/goPage.d.ts +1 -0
- package/dist/es/lib/router/guard.d.ts +3 -0
- package/dist/es/lib/router/index.d.ts +8 -0
- package/dist/es/lib/stores/access.store.d.ts +59 -0
- package/dist/es/lib/stores/app.store.d.ts +11 -0
- package/dist/es/lib/stores/auth.store.d.ts +35 -0
- package/dist/es/lib/stores/user.store.d.ts +19 -0
- package/dist/es/lib/types/curd.type.d.ts +55 -0
- package/dist/es/lib/types/source.type.d.ts +177 -0
- package/dist/es/lib/types/user.type.d.ts +32 -0
- package/dist/es/lib/utils/api.d.ts +2 -0
- package/dist/es/lib/utils/index.d.ts +4 -0
- package/dist/es/lib/utils/namespace.d.ts +17 -0
- package/dist/es/lib/utils/progress.d.ts +11 -0
- package/dist/es/lib/utils/useAuth.d.ts +3 -0
- package/dist/es/lib/utils/withInstall.d.ts +4 -0
- package/dist/es/mock/userInfo.d.ts +13 -0
- package/dist/es/mock/userInfo.mjs +1 -0
- package/dist/es/pages/iframe.d.ts +4 -0
- package/dist/es/pages/iframe.vue.mjs +1 -0
- package/dist/es/pages/iframe.vue2.mjs +1 -0
- package/dist/es/pages/init-project.d.ts +2 -0
- package/dist/es/pages/init-project.vue.mjs +1 -0
- package/dist/es/pages/init-project.vue2.mjs +1 -0
- package/dist/es/pages/not-found.d.ts +2 -0
- package/dist/es/pages/not-found.vue.mjs +1 -0
- package/dist/es/pages/not-found.vue2.mjs +1 -0
- package/dist/es/router/goPage.d.ts +1 -0
- package/dist/es/router/goPage.mjs +1 -0
- package/dist/es/router/guard.d.ts +3 -0
- package/dist/es/router/guard.mjs +1 -0
- package/dist/es/router/index.d.ts +8 -0
- package/dist/es/router/index.mjs +2 -0
- package/dist/es/src/index.d.ts +34 -0
- package/dist/es/src/types/index.d.ts +6 -0
- package/dist/es/stores/access.store.d.ts +59 -0
- package/dist/es/stores/access.store.mjs +1 -0
- package/dist/es/stores/app.store.d.ts +11 -0
- package/dist/es/stores/app.store.mjs +1 -0
- package/dist/es/stores/auth.store.d.ts +35 -0
- package/dist/es/stores/auth.store.mjs +1 -0
- package/dist/es/stores/user.store.d.ts +19 -0
- package/dist/es/stores/user.store.mjs +1 -0
- package/dist/es/types/curd.type.d.ts +55 -0
- package/dist/es/types/source.type.d.ts +177 -0
- package/dist/es/types/user.type.d.ts +32 -0
- package/dist/es/utils/api.d.ts +2 -0
- package/dist/es/utils/index.d.ts +4 -0
- package/dist/es/utils/namespace.d.ts +17 -0
- package/dist/es/utils/namespace.mjs +1 -0
- package/dist/es/utils/progress.d.ts +11 -0
- package/dist/es/utils/progress.mjs +2 -0
- package/dist/es/utils/useAuth.d.ts +3 -0
- package/dist/es/utils/withInstall.d.ts +4 -0
- package/dist/es/utils/withInstall.mjs +1 -0
- package/dist/es/vite.config.d.ts +30 -0
- package/index.d.ts +83 -12
- package/index.ts +16 -0
- package/package.json +75 -49
- package/README.md +0 -18
- package/es/assets/fonts/iconfont.css +0 -7266
- package/es/assets/fonts/iconfont.eot +0 -0
- package/es/assets/fonts/iconfont.svg +0 -5445
- package/es/assets/fonts/iconfont.ttf +0 -0
- package/es/assets/fonts/iconfont.woff +0 -0
- package/es/assets/fonts/iconfont.woff2 +0 -0
- package/es/assets/icons/ui-blank.svg +0 -1
- package/es/assets/icons/ui-docx.svg +0 -1
- package/es/assets/icons/ui-exl.svg +0 -1
- package/es/assets/icons/ui-forder-open.svg +0 -1
- package/es/assets/icons/ui-forder.svg +0 -1
- package/es/assets/icons/ui-jpg.svg +0 -1
- package/es/assets/icons/ui-pdf.svg +0 -1
- package/es/assets/icons/ui-ppt.svg +0 -1
- package/es/assets/icons/ui-rar.svg +0 -1
- package/es/assets/icons/ui-table-empty.svg +0 -1
- package/es/assets/icons/ui-txt.svg +0 -1
- package/es/assets/imgs/header/avatar.png +0 -0
- package/es/assets/imgs/logo/logo.png +0 -0
- package/es/assets/imgs/table/empty.png +0 -0
- package/es/assets/index.e67ea2f5.css +0 -1
- package/es/assets/locales/en.d.ts +0 -104
- package/es/assets/locales/en.ts +0 -104
- package/es/assets/locales/index.d.ts +0 -2
- package/es/assets/locales/index.ts +0 -5
- package/es/assets/locales/zh.d.ts +0 -105
- package/es/assets/locales/zh.ts +0 -105
- package/es/assets/test.ts +0 -1
- package/es/components/container/index.d.ts +0 -3
- package/es/components/container/index.js +0 -367
- package/es/components/container/src/components/bar.d.ts +0 -14
- package/es/components/container/src/hooks/scroll.d.ts +0 -10
- package/es/components/container/src/index.scss +0 -57
- package/es/components/container/src/types/index.d.ts +0 -22
- package/es/components/container/src/utils/scroll.d.ts +0 -5
- package/es/components/curd/index.d.ts +0 -4
- package/es/components/curd/index.js +0 -141
- package/es/components/curd/src/components/props.d.ts +0 -53
- package/es/components/curd/src/components/types/curd.type.d.ts +0 -13
- package/es/components/curd/src/hooks/useCurd.d.ts +0 -3
- package/es/components/curd/src/props.d.ts +0 -138
- package/es/components/curd/src/types/curd.type.d.ts +0 -59
- package/es/components/drawer/index.d.ts +0 -3
- package/es/components/drawer/index.js +0 -299
- package/es/components/drawer/src/components/DrawerFooter.d.ts +0 -54
- package/es/components/drawer/src/index.d.ts +0 -16
- package/es/components/drawer/src/index.scss +0 -24
- package/es/components/drawer/src/props.d.ts +0 -2
- package/es/components/drawer/src/type/drawer.type.d.ts +0 -62
- package/es/components/form/index.d.ts +0 -7
- package/es/components/form/index.js +0 -1604
- package/es/components/form/src/components/DynanicInput.d.ts +0 -2
- package/es/components/form/src/components/FormButtons.d.ts +0 -84
- package/es/components/form/src/components/FormInputUseDialog.d.ts +0 -2
- package/es/components/form/src/components/FormItem.d.ts +0 -55
- package/es/components/form/src/components/RadioButton.d.ts +0 -26
- package/es/components/form/src/components/index.d.ts +0 -2
- package/es/components/form/src/hooks/useForm.d.ts +0 -6
- package/es/components/form/src/hooks/useFormActions.d.ts +0 -45
- package/es/components/form/src/hooks/useFormEvent.d.ts +0 -27
- package/es/components/form/src/hooks/useFormValue.d.ts +0 -3
- package/es/components/form/src/hooks/useFormValues.d.ts +0 -13
- package/es/components/form/src/hooks/useLabelWidth.d.ts +0 -6
- package/es/components/form/src/index.d.ts +0 -358
- package/es/components/form/src/index.scss +0 -162
- package/es/components/form/src/props.d.ts +0 -165
- package/es/components/form/src/types/actions.type.d.ts +0 -15
- package/es/components/form/src/types/form.type.d.ts +0 -113
- package/es/components/form/src/types/items.type.d.ts +0 -417
- package/es/components/form/src/utils/helper.d.ts +0 -21
- package/es/components/icons/index.d.ts +0 -2
- package/es/components/icons/index.js +0 -100
- package/es/components/icons/src/SvgIcon.d.ts +0 -37
- package/es/components/icons/src/index.scss +0 -3
- package/es/components/iframe/index.d.ts +0 -2
- package/es/components/iframe/index.js +0 -83
- package/es/components/iframe/src/index.d.ts +0 -43
- package/es/components/iframe/src/index.scss +0 -20
- package/es/components/modal/index.d.ts +0 -5
- package/es/components/modal/index.js +0 -636
- package/es/components/modal/src/components/CloseIcon.d.ts +0 -24
- package/es/components/modal/src/components/Modal.d.ts +0 -201
- package/es/components/modal/src/components/ModalFooter.d.ts +0 -54
- package/es/components/modal/src/hooks/useDrag.d.ts +0 -6
- package/es/components/modal/src/hooks/useFullScreen.d.ts +0 -6
- package/es/components/modal/src/hooks/useModal.d.ts +0 -5
- package/es/components/modal/src/index.d.ts +0 -216
- package/es/components/modal/src/index.scss +0 -104
- package/es/components/modal/src/props.d.ts +0 -94
- package/es/components/modal/src/types/index.type.d.ts +0 -18
- package/es/components/source/index.d.ts +0 -2
- package/es/components/source/index.js +0 -448
- package/es/components/source/src/hooks/useDownload.d.ts +0 -8
- package/es/components/source/src/hooks/useSource.d.ts +0 -61
- package/es/components/source/src/types/source.type.d.ts +0 -34
- package/es/components/table/index.d.ts +0 -8
- package/es/components/table/index.js +0 -2356
- package/es/components/table/src/components/TableAction.d.ts +0 -75
- package/es/components/table/src/components/TableHeader.d.ts +0 -35
- package/es/components/table/src/components/TableRender.d.ts +0 -13
- package/es/components/table/src/components/editTable/CellComponent.d.ts +0 -22
- package/es/components/table/src/components/editTable/EditTableCell.d.ts +0 -52
- package/es/components/table/src/components/editTable/componentMap.d.ts +0 -4
- package/es/components/table/src/components/editTable/index.d.ts +0 -9
- package/es/components/table/src/components/editTable/props.d.ts +0 -27
- package/es/components/table/src/components/tableSetting/Column.d.ts +0 -4
- package/es/components/table/src/components/tableSetting/Download.d.ts +0 -11
- package/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +0 -2
- package/es/components/table/src/components/tableSetting/Fullscreen.d.ts +0 -2
- package/es/components/table/src/components/tableSetting/index.d.ts +0 -17
- package/es/components/table/src/hooks/useColumns.d.ts +0 -14
- package/es/components/table/src/hooks/useCustomRow.d.ts +0 -20
- package/es/components/table/src/hooks/useDataSource.d.ts +0 -14
- package/es/components/table/src/hooks/useHeader.d.ts +0 -8
- package/es/components/table/src/hooks/useHeaderCode.d.ts +0 -3
- package/es/components/table/src/hooks/useLoading.d.ts +0 -6
- package/es/components/table/src/hooks/usePagination.d.ts +0 -7
- package/es/components/table/src/hooks/useRowSelection.d.ts +0 -12
- package/es/components/table/src/hooks/useTable.d.ts +0 -9
- package/es/components/table/src/hooks/useTableInstance.d.ts +0 -16
- package/es/components/table/src/hooks/useTableScroll.d.ts +0 -12
- package/es/components/table/src/hooks/useTableStyle.d.ts +0 -5
- package/es/components/table/src/index.d.ts +0 -470
- package/es/components/table/src/index.scss +0 -310
- package/es/components/table/src/props.d.ts +0 -205
- package/es/components/table/src/types/actions.type.d.ts +0 -21
- package/es/components/table/src/types/header.type.d.ts +0 -23
- package/es/components/table/src/types/table.type.d.ts +0 -167
- package/es/components/tree/index.d.ts +0 -3
- package/es/components/tree/index.js +0 -1199
- package/es/components/tree/src/basicProps.d.ts +0 -190
- package/es/components/tree/src/components/ContextMenu.d.ts +0 -70
- package/es/components/tree/src/components/TreeHeader.d.ts +0 -78
- package/es/components/tree/src/hooks/useContextMenu.d.ts +0 -2
- package/es/components/tree/src/hooks/useMethod.d.ts +0 -16
- package/es/components/tree/src/hooks/useTree.d.ts +0 -5
- package/es/components/tree/src/index.d.ts +0 -300
- package/es/components/tree/src/index.scss +0 -178
- package/es/components/tree/src/types/action.type.d.ts +0 -64
- package/es/components/tree/src/types/menu.d.ts +0 -36
- package/es/components/tree/src/types/tree.d.ts +0 -31
- package/es/components/tree/src/utils/tree.d.ts +0 -7
- package/es/components/upload/index.d.ts +0 -4
- package/es/components/upload/index.js +0 -664
- package/es/components/upload/src/basicProps.d.ts +0 -95
- package/es/components/upload/src/components/PdfView.d.ts +0 -2
- package/es/components/upload/src/components/WordView.d.ts +0 -2
- package/es/components/upload/src/hooks/useFile.d.ts +0 -17
- package/es/components/upload/src/index.d.ts +0 -209
- package/es/components/upload/src/index.scss +0 -89
- package/es/components/upload/src/type/file.d.ts +0 -17
- package/es/components/upload/src/utils/fileSize.d.ts +0 -1
- package/es/components/upload/src/utils/upload.d.ts +0 -2
- package/es/components/vxe_table/index.d.ts +0 -4
- package/es/components/vxe_table/index.js +0 -1162
- package/es/components/vxe_table/src/components/AApiSelect.d.ts +0 -12
- package/es/components/vxe_table/src/components/AAutoComplete.d.ts +0 -2
- package/es/components/vxe_table/src/components/AButton.d.ts +0 -12
- package/es/components/vxe_table/src/components/AButtonGroup.d.ts +0 -2
- package/es/components/vxe_table/src/components/ACascader.d.ts +0 -2
- package/es/components/vxe_table/src/components/ACheckbox.d.ts +0 -2
- package/es/components/vxe_table/src/components/ACheckboxGroup.d.ts +0 -6
- package/es/components/vxe_table/src/components/ADatePicker.d.ts +0 -4
- package/es/components/vxe_table/src/components/AEmpty.d.ts +0 -6
- package/es/components/vxe_table/src/components/AInput.d.ts +0 -2
- package/es/components/vxe_table/src/components/AInputNumber.d.ts +0 -2
- package/es/components/vxe_table/src/components/AInputSearch.d.ts +0 -2
- package/es/components/vxe_table/src/components/AMonthPicker.d.ts +0 -2
- package/es/components/vxe_table/src/components/ARadioGroup.d.ts +0 -6
- package/es/components/vxe_table/src/components/ARangePicker.d.ts +0 -2
- package/es/components/vxe_table/src/components/ARate.d.ts +0 -2
- package/es/components/vxe_table/src/components/ASelect.d.ts +0 -2
- package/es/components/vxe_table/src/components/ASwitch.d.ts +0 -2
- package/es/components/vxe_table/src/components/ATimePicker.d.ts +0 -2
- package/es/components/vxe_table/src/components/ATreeSelect.d.ts +0 -2
- package/es/components/vxe_table/src/components/AWeekPicker.d.ts +0 -2
- package/es/components/vxe_table/src/components/AYearPicker.d.ts +0 -2
- package/es/components/vxe_table/src/components/Select.d.ts +0 -2
- package/es/components/vxe_table/src/components/common.d.ts +0 -52
- package/es/components/vxe_table/src/components/componentMap.d.ts +0 -3
- package/es/components/vxe_table/src/components/index.d.ts +0 -4
- package/es/components/vxe_table/src/hooks/useColumns.d.ts +0 -1
- package/es/components/vxe_table/src/hooks/useComponents.d.ts +0 -2
- package/es/components/vxe_table/src/hooks/useHeader.d.ts +0 -6
- package/es/components/vxe_table/src/hooks/useProps.d.ts +0 -3
- package/es/components/vxe_table/src/hooks/useVxeTable.d.ts +0 -7
- package/es/components/vxe_table/src/index.d.ts +0 -26
- package/es/components/vxe_table/src/index.scss +0 -13
- package/es/components/vxe_table/src/props.d.ts +0 -1
- package/es/components/vxe_table/src/types/componentType.d.ts +0 -1
- package/es/components/vxe_table/src/types/vxeTable.type.d.ts +0 -45
- package/es/components/vxe_table/src/utils/index.d.ts +0 -6
- package/es/directives/index.d.ts +0 -4
- package/es/directives/index.js +0 -30
- package/es/directives/permission.d.ts +0 -2
- package/es/theme/index.d.ts +0 -12
- package/es/theme/index.js +0 -3792
- package/es/theme/src/components/content/index.d.ts +0 -2
- package/es/theme/src/components/feature/BackTop.d.ts +0 -2
- package/es/theme/src/components/feature/index.d.ts +0 -2
- package/es/theme/src/components/footer/index.d.ts +0 -2
- package/es/theme/src/components/header/MultipleHeader.d.ts +0 -2
- package/es/theme/src/components/header/components/BreadCrumb.d.ts +0 -2
- package/es/theme/src/components/header/components/FullScreen.d.ts +0 -2
- package/es/theme/src/components/header/components/LangPicker.d.ts +0 -12
- package/es/theme/src/components/header/components/Logo.d.ts +0 -22
- package/es/theme/src/components/header/components/MenuFilter.d.ts +0 -2
- package/es/theme/src/components/header/components/Notice.d.ts +0 -2
- package/es/theme/src/components/header/components/SettintTheme.d.ts +0 -2
- package/es/theme/src/components/header/components/Size.d.ts +0 -2
- package/es/theme/src/components/header/components/Trigger.d.ts +0 -6
- package/es/theme/src/components/header/components/UserInfo.d.ts +0 -2
- package/es/theme/src/components/header/components/lock/Lockscreen.d.ts +0 -2
- package/es/theme/src/components/header/components/lock/useBattery.d.ts +0 -11
- package/es/theme/src/components/header/components/lock/useTime.d.ts +0 -7
- package/es/theme/src/components/header/components/theme-drawer/Color.d.ts +0 -26
- package/es/theme/src/components/header/components/theme-drawer/ColorPrimary.d.ts +0 -27
- package/es/theme/src/components/header/components/theme-drawer/Feature.d.ts +0 -2
- package/es/theme/src/components/header/components/theme-drawer/InputNumber.d.ts +0 -28
- package/es/theme/src/components/header/components/theme-drawer/MenuType.d.ts +0 -2
- package/es/theme/src/components/header/components/theme-drawer/Select.d.ts +0 -44
- package/es/theme/src/components/header/components/theme-drawer/Switch.d.ts +0 -29
- package/es/theme/src/components/header/components/theme-drawer/Var.d.ts +0 -2
- package/es/theme/src/components/header/components/theme-drawer/styles/GlobalStyle.d.ts +0 -2
- package/es/theme/src/components/header/components/theme-drawer/styles/MenuStyle.d.ts +0 -2
- package/es/theme/src/components/header/helper/changeTheme.d.ts +0 -15
- package/es/theme/src/components/header/helper/menuTree.d.ts +0 -4
- package/es/theme/src/components/header/index.d.ts +0 -8
- package/es/theme/src/components/sider/components/DragBar.d.ts +0 -2
- package/es/theme/src/components/sider/components/LayoutMenu.d.ts +0 -22
- package/es/theme/src/components/sider/components/MixSider.d.ts +0 -2
- package/es/theme/src/components/sider/components/SiderTrigger.d.ts +0 -14
- package/es/theme/src/components/sider/components/basic-menu/basic-menu-item.d.ts +0 -35
- package/es/theme/src/components/sider/components/basic-menu/basic-sub-menu-item.d.ts +0 -35
- package/es/theme/src/components/sider/components/basic-menu/index.d.ts +0 -64
- package/es/theme/src/components/sider/components/basic-menu/menu-item-content.d.ts +0 -22
- package/es/theme/src/components/sider/components/basic-menu/props.d.ts +0 -52
- package/es/theme/src/components/sider/helper/sider.d.ts +0 -12
- package/es/theme/src/components/sider/helper/split-menu.d.ts +0 -10
- package/es/theme/src/components/sider/index.d.ts +0 -2
- package/es/theme/src/components/tabs/components/TabContent.d.ts +0 -19
- package/es/theme/src/components/tabs/components/TabRedo.d.ts +0 -2
- package/es/theme/src/components/tabs/hooks/useMultifyTabs.d.ts +0 -7
- package/es/theme/src/components/tabs/hooks/useTabDropdown.d.ts +0 -14
- package/es/theme/src/components/tabs/hooks/useTabs.d.ts +0 -10
- package/es/theme/src/components/tabs/index.d.ts +0 -2
- package/es/theme/src/consts/color.d.ts +0 -3
- package/es/theme/src/consts/index.d.ts +0 -14
- package/es/theme/src/enums/index.d.ts +0 -34
- package/es/theme/src/hooks/index.d.ts +0 -6
- package/es/theme/src/hooks/useDragLine.d.ts +0 -2
- package/es/theme/src/hooks/useHeader.d.ts +0 -25
- package/es/theme/src/hooks/useMenu.d.ts +0 -29
- package/es/theme/src/hooks/useMultifyTab.d.ts +0 -8
- package/es/theme/src/hooks/useOpenKeys.d.ts +0 -7
- package/es/theme/src/hooks/useTheme.d.ts +0 -27
- package/es/theme/src/index.d.ts +0 -2
- package/es/theme/src/index.scss +0 -1134
- package/es/theme/src/stores/index.d.ts +0 -3
- package/es/theme/src/stores/routeReuse.store.d.ts +0 -23
- package/es/theme/src/stores/theme.store.d.ts +0 -13
- package/es/theme/src/transition.scss +0 -105
- package/es/theme/src/types/menu.type.d.ts +0 -16
- package/es/theme/src/types/theme.type.d.ts +0 -81
- package/es/theme/src/utils/color.d.ts +0 -14
- package/es/theme/src/utils/index.d.ts +0 -3
- package/es/theme/src/utils.ts/index.d.ts +0 -3
- package/index.js +0 -44
- package/manualContentPath.js +0 -192
- package/tsconfig.json +0 -31
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.ts +0 -82
- /package/{es/theme/src/types/index.d.ts → dist/es/components/drawer/styles/index.scss} +0 -0
- /package/{es → dist/es}/components/tree/src/enums/index.d.ts +0 -0
- /package/{es/theme/src/stores → dist/es/layout/src/components/lockscreen}/lockscreen.store.d.ts +0 -0
|
@@ -1,2356 +0,0 @@
|
|
|
1
|
-
import { useAppStore, error, http, getIsZH, getSlot, isProd, getDynamicProps, getLocal, CacheKey, isBoolean, isFunction, getPopupContainer, useI18n, isNumber, isArray, isObject, isString, message, isNullOrUnDef, getDictValueByCode, formatNumber, isVnode } from "@dt-frames/core";
|
|
2
|
-
import { useSlots, unref, ref, watch, onUnmounted, toRaw, defineComponent, computed, useAttrs, resolveDirective, openBlock, createElementBlock, normalizeClass, Fragment, renderList, withDirectives, createTextVNode, toDisplayString, createCommentVNode, createBlock, withCtx, createVNode, createElementVNode, normalizeStyle, provide, inject, h, mergeProps, markRaw, reactive, watchEffect, isRef, nextTick, normalizeProps, renderSlot, onMounted, createSlots, guardReactiveProps } from "vue";
|
|
3
|
-
import { MenuItem, Menu, Dropdown, Tooltip, Checkbox as Checkbox$1, Divider, Col, Row, Button, CheckboxGroup, Popover as Popover$1, Table } from "ant-design-vue/es";
|
|
4
|
-
import { takeRight, omit, cloneDeep, isEqual } from "lodash-es";
|
|
5
|
-
import { useTheme, useHeader } from "../../theme/index";
|
|
6
|
-
import { Input, InputNumber, Select, TreeSelect, Switch, Checkbox, DatePicker, TimePicker, Popover, Tag } from "ant-design-vue";
|
|
7
|
-
import { useFullscreen } from "@vueuse/core";
|
|
8
|
-
import { useModal, DtModal, useModalOut } from "../modal";
|
|
9
|
-
import Sortablejs from "sortablejs";
|
|
10
|
-
import { DtFormButtons } from "../form";
|
|
11
|
-
import dayjs from "dayjs";
|
|
12
|
-
import { Icon } from "../icons";
|
|
13
|
-
const codeMap = /* @__PURE__ */ new Map();
|
|
14
|
-
function useHeaderCode(code, changeColumns) {
|
|
15
|
-
const { appConf } = useAppStore();
|
|
16
|
-
const slots = useSlots();
|
|
17
|
-
if (!appConf.pages.queryColumnApi) {
|
|
18
|
-
error("\u8BF7\u5728init.config.ts\u4E2D\u914D\u7F6EqueryColumnApi\uFF01");
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const getAlign = (key) => key === 0 ? "center" : key === 2 ? "right" : "left";
|
|
22
|
-
const renderCell = (type, slot, ctx) => {
|
|
23
|
-
switch (type) {
|
|
24
|
-
case 0:
|
|
25
|
-
return { date: ctx };
|
|
26
|
-
case 1:
|
|
27
|
-
return { dict: ctx };
|
|
28
|
-
case 5:
|
|
29
|
-
return { percent: ctx };
|
|
30
|
-
case 7:
|
|
31
|
-
if (!appConf.structure[ctx]) {
|
|
32
|
-
error(`\u672A\u627E\u5230structure: ${ctx} !`);
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
return { dict: { ...appConf.structure[ctx], struCode: ctx } };
|
|
36
|
-
case 10:
|
|
37
|
-
return getSlot(slots, slot);
|
|
38
|
-
case 11:
|
|
39
|
-
return { number: ctx };
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
function getColumns() {
|
|
43
|
-
if (codeMap.get(code)) {
|
|
44
|
-
changeColumns(codeMap.get(code));
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
http.post(
|
|
48
|
-
appConf.pages.queryColumnApi,
|
|
49
|
-
{ tableCode: code }
|
|
50
|
-
).then((rsp) => {
|
|
51
|
-
handleData(rsp);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function handleData(data) {
|
|
55
|
-
let rows = [];
|
|
56
|
-
data.forEach((it) => {
|
|
57
|
-
let obj = {
|
|
58
|
-
title: unref(getIsZH) ? it.cloumnName : it.cloumnEngName,
|
|
59
|
-
dataIndex: it.cloumnCode,
|
|
60
|
-
sorter: Boolean(it.ifOrder),
|
|
61
|
-
align: getAlign(it.textAlign),
|
|
62
|
-
show: Boolean(it.ifDisplay),
|
|
63
|
-
defaultHidden: !Boolean(it.ifDisplay)
|
|
64
|
-
};
|
|
65
|
-
if (it.cloumnType !== void 0)
|
|
66
|
-
obj.render = renderCell(it.cloumnType, it.slot, it.dictCode);
|
|
67
|
-
if (it.width)
|
|
68
|
-
obj.width = Number(it.width);
|
|
69
|
-
rows.push(obj);
|
|
70
|
-
});
|
|
71
|
-
codeMap.set(code, rows);
|
|
72
|
-
changeColumns(rows);
|
|
73
|
-
}
|
|
74
|
-
getColumns();
|
|
75
|
-
}
|
|
76
|
-
function useTable(props2) {
|
|
77
|
-
const tableRef = ref(null);
|
|
78
|
-
const loadedRef = ref(false);
|
|
79
|
-
let stopWatch;
|
|
80
|
-
function registerTable(instance) {
|
|
81
|
-
if (unref(loadedRef) && isProd() && instance === unref(tableRef))
|
|
82
|
-
return;
|
|
83
|
-
if (props2?.columnCode) {
|
|
84
|
-
useHeaderCode(
|
|
85
|
-
props2.columnCode,
|
|
86
|
-
(columns) => {
|
|
87
|
-
props2.columns = columns;
|
|
88
|
-
instance.setProps(getDynamicProps(props2));
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
tableRef.value = instance;
|
|
93
|
-
loadedRef.value = true;
|
|
94
|
-
stopWatch?.();
|
|
95
|
-
stopWatch = watch(
|
|
96
|
-
() => props2,
|
|
97
|
-
() => {
|
|
98
|
-
props2 && instance.setProps(getDynamicProps(props2));
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
immediate: true,
|
|
102
|
-
deep: true
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
onUnmounted(() => {
|
|
106
|
-
tableRef.value = null;
|
|
107
|
-
loadedRef.value = null;
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
function getTableInstance2() {
|
|
111
|
-
const table = unref(tableRef);
|
|
112
|
-
if (!table) {
|
|
113
|
-
error("\u6CA1\u6709table\u8868\u5355\u5B9E\u4F8B");
|
|
114
|
-
}
|
|
115
|
-
return table;
|
|
116
|
-
}
|
|
117
|
-
const methods = {
|
|
118
|
-
setProps: (props22) => getTableInstance2().setProps(props22),
|
|
119
|
-
setLoading: (loading) => getTableInstance2().setLoading(loading),
|
|
120
|
-
clearSelectedRowKeys: () => getTableInstance2().clearSelectedRowKeys(),
|
|
121
|
-
getSelectRows: () => getTableInstance2().getSelectRows(),
|
|
122
|
-
getSelectedRowKeys: () => getTableInstance2().getSelectedRowKeys(),
|
|
123
|
-
setSelectedRowKeys: (keys) => getTableInstance2().setSelectedRowKeys(keys),
|
|
124
|
-
getRowSelection: () => toRaw(getTableInstance2().getRowSelection()),
|
|
125
|
-
getColumns: (opt) => toRaw(getTableInstance2().getColumns(opt)),
|
|
126
|
-
setColumns: (columns) => getTableInstance2().setColumns(columns),
|
|
127
|
-
setColumnsByDataIndex: (dataIndex, value) => {
|
|
128
|
-
return getTableInstance2().setColumnsByDataIndex(dataIndex, value);
|
|
129
|
-
},
|
|
130
|
-
getCacheColumns: () => toRaw(getTableInstance2().getCacheColumns()),
|
|
131
|
-
findTableDataRecord: (rowKey) => getTableInstance2().findTableDataRecord(rowKey),
|
|
132
|
-
updateTableDataRecord: (rowKey, record) => getTableInstance2().updateTableDataRecord(rowKey, record),
|
|
133
|
-
getPagination: () => getTableInstance2().getPagination()
|
|
134
|
-
};
|
|
135
|
-
return [registerTable, methods];
|
|
136
|
-
}
|
|
137
|
-
const _hoisted_1$8 = ["onClick"];
|
|
138
|
-
const _hoisted_2$2 = {
|
|
139
|
-
key: 0,
|
|
140
|
-
class: "dt-table-action-btn w-8 inline-block"
|
|
141
|
-
};
|
|
142
|
-
const _hoisted_3$2 = { key: 0 };
|
|
143
|
-
const _hoisted_4$2 = { class: "text-13 opacity-80" };
|
|
144
|
-
const _hoisted_5$1 = { class: "dt-table-action-btn w-8 inline-block" };
|
|
145
|
-
const _hoisted_6 = ["onClick"];
|
|
146
|
-
const _hoisted_7 = /* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-settings dt-table-action-dropdown cursor-pointer" }, null, -1);
|
|
147
|
-
const _hoisted_8 = { class: "text-13 opacity-90" };
|
|
148
|
-
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
149
|
-
__name: "TableAction",
|
|
150
|
-
props: {
|
|
151
|
-
fixed: {
|
|
152
|
-
type: String,
|
|
153
|
-
default: "right"
|
|
154
|
-
},
|
|
155
|
-
expand: {
|
|
156
|
-
type: Boolean,
|
|
157
|
-
default: false
|
|
158
|
-
},
|
|
159
|
-
expandNum: {
|
|
160
|
-
type: Number
|
|
161
|
-
},
|
|
162
|
-
width: {
|
|
163
|
-
type: String,
|
|
164
|
-
default: "70px"
|
|
165
|
-
},
|
|
166
|
-
btns: {
|
|
167
|
-
type: Array,
|
|
168
|
-
default: () => []
|
|
169
|
-
},
|
|
170
|
-
flag: {
|
|
171
|
-
type: String
|
|
172
|
-
},
|
|
173
|
-
record: {
|
|
174
|
-
type: Object,
|
|
175
|
-
default: {}
|
|
176
|
-
},
|
|
177
|
-
index: {
|
|
178
|
-
type: Number
|
|
179
|
-
},
|
|
180
|
-
authPrefix: {
|
|
181
|
-
type: String
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
setup(__props) {
|
|
185
|
-
const props2 = __props;
|
|
186
|
-
const actionBtns = ref([]);
|
|
187
|
-
const { getVars } = useTheme();
|
|
188
|
-
const { getUiSize } = useHeader();
|
|
189
|
-
const getAuth = (auth) => {
|
|
190
|
-
const { authPrefix } = props2;
|
|
191
|
-
if (auth && auth.includes(":")) {
|
|
192
|
-
return auth;
|
|
193
|
-
} else if (authPrefix && auth) {
|
|
194
|
-
return `${authPrefix}:${auth}`;
|
|
195
|
-
}
|
|
196
|
-
return auth ?? null;
|
|
197
|
-
};
|
|
198
|
-
const { appConf } = useAppStore();
|
|
199
|
-
const getExpandNum = computed(() => {
|
|
200
|
-
return props2.expandNum || appConf?.ui?.table?.expandNum;
|
|
201
|
-
});
|
|
202
|
-
const showMore = computed(() => {
|
|
203
|
-
if (!unref(getExpandNum)) {
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
let allAuths = getLocal(CacheKey.AUTHS);
|
|
207
|
-
let remainBtnNum = unref(actionBtns).length - unref(getExpandNum);
|
|
208
|
-
let remainBtn = takeRight(unref(actionBtns), remainBtnNum);
|
|
209
|
-
return remainBtn.filter((it) => {
|
|
210
|
-
if (it.ifShow) {
|
|
211
|
-
return it.auth ? allAuths.includes(getAuth(it.auth)) : true;
|
|
212
|
-
}
|
|
213
|
-
return false;
|
|
214
|
-
}).length;
|
|
215
|
-
});
|
|
216
|
-
function handleAction(it) {
|
|
217
|
-
if (isFunction(it.onClick)) {
|
|
218
|
-
it.onClick(props2.record, props2.index);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
const attrs = useAttrs();
|
|
222
|
-
function getPopupContainer$1() {
|
|
223
|
-
return isFunction(attrs.getPopupContainer) ? attrs.getPopupContainer() : getPopupContainer();
|
|
224
|
-
}
|
|
225
|
-
const getLabel = (it, record) => {
|
|
226
|
-
const label = isFunction(it.label) ? it.label(record) : it.label;
|
|
227
|
-
const enLabel = isFunction(it.enLabel) ? it.enLabel(record) : it.enLabel;
|
|
228
|
-
if (!unref(getIsZH)) {
|
|
229
|
-
return enLabel || label;
|
|
230
|
-
}
|
|
231
|
-
return label;
|
|
232
|
-
};
|
|
233
|
-
watch(
|
|
234
|
-
() => [
|
|
235
|
-
unref(props2.btns),
|
|
236
|
-
unref(props2.record)
|
|
237
|
-
],
|
|
238
|
-
([btns]) => {
|
|
239
|
-
actionBtns.value = btns.map((it) => {
|
|
240
|
-
return {
|
|
241
|
-
...it,
|
|
242
|
-
ifShow: isBoolean(it.show) ? it.show : isFunction(it.show) ? it.show(props2.record) : true,
|
|
243
|
-
icon: () => isFunction(it.icon) ? it.icon(props2.record) : it.icon,
|
|
244
|
-
label: () => getLabel(it, props2.record)
|
|
245
|
-
};
|
|
246
|
-
});
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
immediate: true,
|
|
250
|
-
deep: true
|
|
251
|
-
}
|
|
252
|
-
);
|
|
253
|
-
return (_ctx, _cache) => {
|
|
254
|
-
const _component_AMenuItem = MenuItem;
|
|
255
|
-
const _component_AMenu = Menu;
|
|
256
|
-
const _component_ADropdown = Dropdown;
|
|
257
|
-
const _component_ATooltip = Tooltip;
|
|
258
|
-
const _directive_auth = resolveDirective("auth");
|
|
259
|
-
return props2.expand ? (openBlock(), createElementBlock("div", {
|
|
260
|
-
key: 0,
|
|
261
|
-
class: normalizeClass([unref(getExpandNum) ? "dt-expand-has-collapse" : "", "dt-table-action"])
|
|
262
|
-
}, [
|
|
263
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(actionBtns), (item, index) => {
|
|
264
|
-
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
265
|
-
item.ifShow && unref(getExpandNum) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
266
|
-
index < unref(getExpandNum) ? withDirectives((openBlock(), createElementBlock("span", {
|
|
267
|
-
key: 0,
|
|
268
|
-
class: normalizeClass(["dt-table-action-btn w-8 inline-block", `text-${unref(getUiSize)}`]),
|
|
269
|
-
onClick: ($event) => handleAction(item)
|
|
270
|
-
}, [
|
|
271
|
-
createTextVNode(toDisplayString(item.label()), 1)
|
|
272
|
-
], 10, _hoisted_1$8)), [
|
|
273
|
-
[_directive_auth, getAuth(item.auth)]
|
|
274
|
-
]) : createCommentVNode("", true),
|
|
275
|
-
index >= unref(getExpandNum) && index === unref(actionBtns).length - 1 ? (openBlock(), createBlock(_component_ADropdown, {
|
|
276
|
-
key: 1,
|
|
277
|
-
"get-popup-container": getPopupContainer$1,
|
|
278
|
-
trigger: ["click"],
|
|
279
|
-
destroyPopupOnHide: true
|
|
280
|
-
}, {
|
|
281
|
-
overlay: withCtx(() => [
|
|
282
|
-
createVNode(_component_AMenu, { class: "dt-action-select flex flex-col" }, {
|
|
283
|
-
default: withCtx(() => [
|
|
284
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(actionBtns), (item1, index1) => {
|
|
285
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
286
|
-
index1 >= unref(getExpandNum) && item1.ifShow ? withDirectives((openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
287
|
-
createVNode(_component_AMenuItem, {
|
|
288
|
-
onClick: ($event) => handleAction(item1)
|
|
289
|
-
}, {
|
|
290
|
-
default: withCtx(() => [
|
|
291
|
-
createElementVNode("span", _hoisted_4$2, toDisplayString(item1.label()), 1)
|
|
292
|
-
]),
|
|
293
|
-
_: 2
|
|
294
|
-
}, 1032, ["onClick"])
|
|
295
|
-
])), [
|
|
296
|
-
[_directive_auth, getAuth(item1.auth)]
|
|
297
|
-
]) : createCommentVNode("", true)
|
|
298
|
-
], 64);
|
|
299
|
-
}), 256))
|
|
300
|
-
]),
|
|
301
|
-
_: 1
|
|
302
|
-
})
|
|
303
|
-
]),
|
|
304
|
-
default: withCtx(() => [
|
|
305
|
-
unref(showMore) ? (openBlock(), createElementBlock("span", _hoisted_2$2, " \u66F4\u591A ")) : createCommentVNode("", true)
|
|
306
|
-
]),
|
|
307
|
-
_: 1
|
|
308
|
-
})) : createCommentVNode("", true)
|
|
309
|
-
], 64)) : createCommentVNode("", true),
|
|
310
|
-
item.ifShow && !unref(getExpandNum) ? (openBlock(), createBlock(_component_ATooltip, {
|
|
311
|
-
key: 1,
|
|
312
|
-
placement: "bottom"
|
|
313
|
-
}, {
|
|
314
|
-
title: withCtx(() => [
|
|
315
|
-
createTextVNode(toDisplayString(item.label()), 1)
|
|
316
|
-
]),
|
|
317
|
-
default: withCtx(() => [
|
|
318
|
-
createElementVNode("span", _hoisted_5$1, [
|
|
319
|
-
createElementVNode("i", {
|
|
320
|
-
class: normalizeClass(["i cursor-pointer", item.icon()]),
|
|
321
|
-
style: normalizeStyle({
|
|
322
|
-
color: item.color || unref(getVars).token.colorPrimary
|
|
323
|
-
}),
|
|
324
|
-
onClick: ($event) => handleAction(item)
|
|
325
|
-
}, null, 14, _hoisted_6)
|
|
326
|
-
])
|
|
327
|
-
]),
|
|
328
|
-
_: 2
|
|
329
|
-
}, 1024)) : createCommentVNode("", true)
|
|
330
|
-
], 64);
|
|
331
|
-
}), 128))
|
|
332
|
-
], 2)) : (openBlock(), createBlock(_component_ADropdown, {
|
|
333
|
-
key: 1,
|
|
334
|
-
"get-popup-container": getPopupContainer$1,
|
|
335
|
-
trigger: ["click"]
|
|
336
|
-
}, {
|
|
337
|
-
overlay: withCtx(() => [
|
|
338
|
-
createVNode(_component_AMenu, {
|
|
339
|
-
class: normalizeClass(["dt-table-action flex flex-col", `dt-table-action-${unref(getUiSize)}`])
|
|
340
|
-
}, {
|
|
341
|
-
default: withCtx(() => [
|
|
342
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(actionBtns), (item) => {
|
|
343
|
-
return withDirectives((openBlock(), createElementBlock("span", null, [
|
|
344
|
-
item.ifShow ? (openBlock(), createBlock(_component_AMenuItem, {
|
|
345
|
-
key: 0,
|
|
346
|
-
onClick: ($event) => handleAction(item)
|
|
347
|
-
}, {
|
|
348
|
-
default: withCtx(() => [
|
|
349
|
-
createElementVNode("i", {
|
|
350
|
-
class: normalizeClass(["i text-base opacity-90 pr-2", item.icon()])
|
|
351
|
-
}, null, 2),
|
|
352
|
-
createElementVNode("span", _hoisted_8, toDisplayString(item.label()), 1)
|
|
353
|
-
]),
|
|
354
|
-
_: 2
|
|
355
|
-
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
356
|
-
])), [
|
|
357
|
-
[_directive_auth, getAuth(item.auth)]
|
|
358
|
-
]);
|
|
359
|
-
}), 256))
|
|
360
|
-
]),
|
|
361
|
-
_: 1
|
|
362
|
-
}, 8, ["class"])
|
|
363
|
-
]),
|
|
364
|
-
default: withCtx(() => [
|
|
365
|
-
_hoisted_7
|
|
366
|
-
]),
|
|
367
|
-
_: 1
|
|
368
|
-
}));
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
const tableKey = Symbol("dt-page");
|
|
373
|
-
function createTableInstance(instance) {
|
|
374
|
-
provide(tableKey, instance);
|
|
375
|
-
}
|
|
376
|
-
function getTableInstance() {
|
|
377
|
-
return inject(tableKey);
|
|
378
|
-
}
|
|
379
|
-
const componentMap = /* @__PURE__ */ new Map();
|
|
380
|
-
componentMap.set("Input", Input);
|
|
381
|
-
componentMap.set("InputNumber", InputNumber);
|
|
382
|
-
componentMap.set("Select", Select);
|
|
383
|
-
componentMap.set("TreeSelect", TreeSelect);
|
|
384
|
-
componentMap.set("Switch", Switch);
|
|
385
|
-
componentMap.set("Checkbox", Checkbox);
|
|
386
|
-
componentMap.set("DatePicker", DatePicker);
|
|
387
|
-
componentMap.set("TimePicker", TimePicker);
|
|
388
|
-
const CellComponent = ({
|
|
389
|
-
component = "Input",
|
|
390
|
-
rule = true,
|
|
391
|
-
ruleMessage,
|
|
392
|
-
popoverVisible,
|
|
393
|
-
getPopupContainer: getPopupContainer2
|
|
394
|
-
}, { attrs }) => {
|
|
395
|
-
const Comp = componentMap.get(component);
|
|
396
|
-
if (["Radio", "Checkbox"].includes(attrs.component)) {
|
|
397
|
-
attrs.class += " ROB";
|
|
398
|
-
}
|
|
399
|
-
const DefaultComp = h(Comp, attrs);
|
|
400
|
-
if (!rule)
|
|
401
|
-
return DefaultComp;
|
|
402
|
-
return h(
|
|
403
|
-
Popover,
|
|
404
|
-
{
|
|
405
|
-
overlayClassName: "edit-cell-rule-popover",
|
|
406
|
-
visible: !!popoverVisible,
|
|
407
|
-
...getPopupContainer2 ? { getPopupContainer: getPopupContainer2 } : {}
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
default: () => DefaultComp,
|
|
411
|
-
content: () => ruleMessage
|
|
412
|
-
}
|
|
413
|
-
);
|
|
414
|
-
};
|
|
415
|
-
const basicProps = {
|
|
416
|
-
value: {
|
|
417
|
-
type: [String, Number, Boolean, Object],
|
|
418
|
-
default: ""
|
|
419
|
-
},
|
|
420
|
-
record: {
|
|
421
|
-
type: Object
|
|
422
|
-
},
|
|
423
|
-
column: {
|
|
424
|
-
type: Object,
|
|
425
|
-
default: () => ({})
|
|
426
|
-
},
|
|
427
|
-
index: Number
|
|
428
|
-
};
|
|
429
|
-
const _hoisted_1$7 = { class: "editable-cell" };
|
|
430
|
-
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
431
|
-
__name: "EditTableCell",
|
|
432
|
-
props: basicProps,
|
|
433
|
-
setup(__props) {
|
|
434
|
-
const props2 = __props;
|
|
435
|
-
const { getUiSize } = useHeader();
|
|
436
|
-
const { t } = useI18n("UI");
|
|
437
|
-
const { editRule, align = "left" } = props2.column;
|
|
438
|
-
const table = getTableInstance();
|
|
439
|
-
const ruleMessage = ref("");
|
|
440
|
-
const ruleVisible = ref(false);
|
|
441
|
-
const optionsRef = ref([]);
|
|
442
|
-
const currentValueRef = ref(props2.value);
|
|
443
|
-
const getComponent = computed(() => props2.column?.editComponent || "Input");
|
|
444
|
-
const getRuleVisible = computed(() => {
|
|
445
|
-
return unref(ruleMessage) && unref(ruleVisible);
|
|
446
|
-
});
|
|
447
|
-
const getWrapperClass = computed(() => {
|
|
448
|
-
return `edit-cell-align-${align}`;
|
|
449
|
-
});
|
|
450
|
-
const getIsCheckComp = computed(() => {
|
|
451
|
-
const component = unref(getComponent);
|
|
452
|
-
return ["Checkbox", "Switch"].includes(component);
|
|
453
|
-
});
|
|
454
|
-
const createPlaceholderMessage = (component) => {
|
|
455
|
-
if (component.includes("Input")) {
|
|
456
|
-
return t("PLEASE_INPUT");
|
|
457
|
-
}
|
|
458
|
-
return t("PLEASE_SELECT");
|
|
459
|
-
};
|
|
460
|
-
const setTableValue = () => {
|
|
461
|
-
props2.record[props2.column.dataIndex] = unref(currentValueRef);
|
|
462
|
-
};
|
|
463
|
-
const getComponentProps = computed(() => {
|
|
464
|
-
const isCheckValue = unref(getIsCheckComp);
|
|
465
|
-
const valueField = isCheckValue ? "checked" : "value";
|
|
466
|
-
const val = unref(currentValueRef);
|
|
467
|
-
let compProps = props2.column?.editComponentProps ?? {};
|
|
468
|
-
const { record, column, index } = props2;
|
|
469
|
-
if (isFunction(compProps)) {
|
|
470
|
-
compProps = compProps({ text: val, record, column, index }) ?? {};
|
|
471
|
-
}
|
|
472
|
-
if (unref(getComponent) === "InputNumber") {
|
|
473
|
-
compProps = {
|
|
474
|
-
formatter: (value) => `${value}`.replace(/[1-9]\d{0,2}(?=(\d{3})+$)/g, "$&,"),
|
|
475
|
-
parser: (value) => value.replace(/\$\s?|(,*)/g, ""),
|
|
476
|
-
...compProps
|
|
477
|
-
};
|
|
478
|
-
}
|
|
479
|
-
return {
|
|
480
|
-
size: "small",
|
|
481
|
-
dropdownClassName: unref(getUiSize),
|
|
482
|
-
getPopupContainer: () => document.body,
|
|
483
|
-
placeholder: createPlaceholderMessage(unref(getComponent)),
|
|
484
|
-
...compProps,
|
|
485
|
-
[valueField]: val
|
|
486
|
-
};
|
|
487
|
-
});
|
|
488
|
-
async function handleChange(e) {
|
|
489
|
-
const component = unref(getComponent);
|
|
490
|
-
if (component === "Checkbox") {
|
|
491
|
-
currentValueRef.value = e.target.checked;
|
|
492
|
-
} else if (e?.target && Reflect.has(e.target, "value")) {
|
|
493
|
-
currentValueRef.value = e.target.value;
|
|
494
|
-
} else {
|
|
495
|
-
currentValueRef.value = e;
|
|
496
|
-
}
|
|
497
|
-
const onChange = unref(getComponentProps)?.onChange;
|
|
498
|
-
if (onChange && isFunction(onChange))
|
|
499
|
-
onChange(...arguments, props2);
|
|
500
|
-
setTableValue();
|
|
501
|
-
table.emits?.("edit-change", {
|
|
502
|
-
column: props2.column,
|
|
503
|
-
value: unref(currentValueRef),
|
|
504
|
-
record: toRaw(props2.record),
|
|
505
|
-
index: props2.index
|
|
506
|
-
});
|
|
507
|
-
handleSubmitRule();
|
|
508
|
-
}
|
|
509
|
-
async function handleSubmitRule() {
|
|
510
|
-
const { column, record } = props2;
|
|
511
|
-
const { editRule: editRule2 } = column;
|
|
512
|
-
const currentValue = unref(currentValueRef);
|
|
513
|
-
if (editRule2) {
|
|
514
|
-
if (isBoolean(editRule2) && !currentValue && !isNumber(currentValue)) {
|
|
515
|
-
ruleVisible.value = true;
|
|
516
|
-
const component = unref(getComponent);
|
|
517
|
-
ruleMessage.value = createPlaceholderMessage(component);
|
|
518
|
-
return false;
|
|
519
|
-
}
|
|
520
|
-
if (isFunction(editRule2)) {
|
|
521
|
-
const res = await editRule2(currentValue, record);
|
|
522
|
-
if (!!res) {
|
|
523
|
-
ruleMessage.value = res;
|
|
524
|
-
ruleVisible.value = true;
|
|
525
|
-
return false;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
ruleMessage.value = "";
|
|
530
|
-
return true;
|
|
531
|
-
}
|
|
532
|
-
function handleOptionsChange(options) {
|
|
533
|
-
optionsRef.value = options;
|
|
534
|
-
}
|
|
535
|
-
return (_ctx, _cache) => {
|
|
536
|
-
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
537
|
-
createVNode(unref(CellComponent), mergeProps({ ref: "elRef" }, unref(omit)(unref(getComponentProps), "onChange"), {
|
|
538
|
-
component: _ctx.column?.editComponent,
|
|
539
|
-
popoverVisible: unref(getRuleVisible),
|
|
540
|
-
rule: unref(editRule),
|
|
541
|
-
ruleMessage: unref(ruleMessage),
|
|
542
|
-
class: unref(getWrapperClass),
|
|
543
|
-
onChange: handleChange,
|
|
544
|
-
onOptionsChange: handleOptionsChange
|
|
545
|
-
}), null, 16, ["component", "popoverVisible", "rule", "ruleMessage", "class"])
|
|
546
|
-
]);
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
function renderEditCell(column) {
|
|
551
|
-
return ({ text: value, record, index }) => {
|
|
552
|
-
record.onValid = async () => {
|
|
553
|
-
if (isArray(record?.validCbs)) {
|
|
554
|
-
const validFns = (record?.validCbs || []).map((fn) => fn());
|
|
555
|
-
const res = await Promise.all(validFns);
|
|
556
|
-
return res.every((item) => !!item);
|
|
557
|
-
}
|
|
558
|
-
return false;
|
|
559
|
-
};
|
|
560
|
-
record.onEdit = async (edit, submit = false) => {
|
|
561
|
-
if (!submit) {
|
|
562
|
-
record.editable = edit;
|
|
563
|
-
}
|
|
564
|
-
if (!edit && submit) {
|
|
565
|
-
if (!await record.onValid())
|
|
566
|
-
return false;
|
|
567
|
-
const res = await record.onSubmitEdit?.();
|
|
568
|
-
if (res) {
|
|
569
|
-
record.editable = false;
|
|
570
|
-
return true;
|
|
571
|
-
}
|
|
572
|
-
return false;
|
|
573
|
-
}
|
|
574
|
-
if (!edit && !submit) {
|
|
575
|
-
record.onCancelEdit?.();
|
|
576
|
-
}
|
|
577
|
-
return true;
|
|
578
|
-
};
|
|
579
|
-
return h(_sfc_main$8, {
|
|
580
|
-
value,
|
|
581
|
-
record,
|
|
582
|
-
column,
|
|
583
|
-
index
|
|
584
|
-
});
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
const INDEX_FLAG = "INDEX";
|
|
588
|
-
const ACTION_COLUMN = "ACTION";
|
|
589
|
-
function handleItem(item, ellipsis) {
|
|
590
|
-
const { appConf } = useAppStore();
|
|
591
|
-
const { align } = appConf.ui.table;
|
|
592
|
-
const { key, dataIndex, children } = item;
|
|
593
|
-
item.align = item.align || align;
|
|
594
|
-
if (ellipsis) {
|
|
595
|
-
if (!key) {
|
|
596
|
-
item.key = dataIndex && dataIndex.toString();
|
|
597
|
-
}
|
|
598
|
-
if (!isBoolean(item.ellipsis)) {
|
|
599
|
-
item = Object.assign(item, {
|
|
600
|
-
ellipsis
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
if (children && children.length) {
|
|
605
|
-
handleChildren(children, !!ellipsis);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
function handleChildren(children, ellipsis) {
|
|
609
|
-
if (!children) {
|
|
610
|
-
return;
|
|
611
|
-
}
|
|
612
|
-
children.forEach((item) => {
|
|
613
|
-
const { children: children2 } = item;
|
|
614
|
-
handleItem(item, ellipsis);
|
|
615
|
-
handleChildren(children2, ellipsis);
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
619
|
-
const { t } = useI18n("UI");
|
|
620
|
-
const { showIndexColumn, indexColumnProps, isTreeTable, virtual } = unref(propsRef);
|
|
621
|
-
let pushIndexColumns = false;
|
|
622
|
-
if (unref(isTreeTable)) {
|
|
623
|
-
return;
|
|
624
|
-
}
|
|
625
|
-
columns.forEach(() => {
|
|
626
|
-
const indIndex = columns.findIndex((column) => column.flag === INDEX_FLAG);
|
|
627
|
-
if (showIndexColumn) {
|
|
628
|
-
pushIndexColumns = indIndex === -1;
|
|
629
|
-
} else if (!showIndexColumn && indIndex !== -1) {
|
|
630
|
-
columns.splice(indIndex, 1);
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
if (!pushIndexColumns) {
|
|
634
|
-
return;
|
|
635
|
-
}
|
|
636
|
-
const isFixedLeft = columns.some((item) => item.fixed === "left");
|
|
637
|
-
columns.unshift({
|
|
638
|
-
flag: INDEX_FLAG,
|
|
639
|
-
width: unref(getIsZH) ? 50 : 70,
|
|
640
|
-
title: t("NUMBER"),
|
|
641
|
-
align: "center",
|
|
642
|
-
customRender: ({ index, renderIndex, record }) => {
|
|
643
|
-
if (virtual && record?.index) {
|
|
644
|
-
return record?.index;
|
|
645
|
-
}
|
|
646
|
-
const getPagination = unref(getPaginationRef);
|
|
647
|
-
const { appConf } = useAppStore();
|
|
648
|
-
const { defaultPageSize } = appConf.ui.table;
|
|
649
|
-
if (isBoolean(getPagination)) {
|
|
650
|
-
return `${index + 1}`;
|
|
651
|
-
}
|
|
652
|
-
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
653
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
|
|
654
|
-
},
|
|
655
|
-
...isFixedLeft ? {
|
|
656
|
-
fixed: "left"
|
|
657
|
-
} : {},
|
|
658
|
-
...indexColumnProps
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
function handleActionColumn(propsRef, columns) {
|
|
662
|
-
const { appConf } = useAppStore();
|
|
663
|
-
const { t } = useI18n("UI");
|
|
664
|
-
const defaultButtons = [
|
|
665
|
-
{
|
|
666
|
-
label: t("EDIT"),
|
|
667
|
-
icon: "mdi:text-box-edit-outline",
|
|
668
|
-
onClick: (row, index) => {
|
|
669
|
-
unref(propsRef).onOpenEditDialog(row, index, unref(propsRef).rowKey);
|
|
670
|
-
}
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
label: t("DELETE"),
|
|
674
|
-
icon: "mdi:delete-outline",
|
|
675
|
-
onClick: unref(propsRef).onDelete,
|
|
676
|
-
color: "#ed6f6f"
|
|
677
|
-
}
|
|
678
|
-
];
|
|
679
|
-
const { operations = defaultButtons, expandActions = false, authPrefix } = unref(propsRef);
|
|
680
|
-
if (!operations || isObject(operations) && !operations?.btns?.length || isArray(operations) && !operations.length) {
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
const hasIndex = columns.findIndex((column) => column.flag === ACTION_COLUMN);
|
|
684
|
-
if (hasIndex === -1) {
|
|
685
|
-
const column = isObject(operations) ? {
|
|
686
|
-
expand: appConf?.ui?.table?.expandActions,
|
|
687
|
-
btns: defaultButtons,
|
|
688
|
-
...operations
|
|
689
|
-
} : isArray(operations) ? { expand: appConf?.ui?.table?.expandActions, btns: operations } : {};
|
|
690
|
-
const expand = column.expand ? column.expand : expandActions;
|
|
691
|
-
const expandNum = (isObject(operations) ? operations?.expandNum : appConf?.ui?.table?.expandNum) || null;
|
|
692
|
-
const allAuths = getLocal(CacheKey.AUTHS);
|
|
693
|
-
const getAuth = (auth) => {
|
|
694
|
-
if (auth && auth.includes(":")) {
|
|
695
|
-
return auth;
|
|
696
|
-
} else if (authPrefix && auth) {
|
|
697
|
-
return `${authPrefix}:${auth}`;
|
|
698
|
-
}
|
|
699
|
-
return auth ?? null;
|
|
700
|
-
};
|
|
701
|
-
const getWidth = () => {
|
|
702
|
-
let w = 0;
|
|
703
|
-
if (expand) {
|
|
704
|
-
if (expandNum) {
|
|
705
|
-
let showMore = false;
|
|
706
|
-
column.btns.forEach((btn, index) => {
|
|
707
|
-
if (index < expandNum && (btn.auth && allAuths.includes(getAuth(btn.auth)) || !btn.auth)) {
|
|
708
|
-
w += (unref(getIsZH) ? btn.label.length : btn.enLabel.length) * 14 + 8;
|
|
709
|
-
} else if (btn.auth && allAuths.includes(getAuth(btn.auth)) || !btn.auth) {
|
|
710
|
-
showMore = true;
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
w += (showMore ? 36 : 0) + 30;
|
|
714
|
-
} else {
|
|
715
|
-
w = column.btns.length * 32 + 20;
|
|
716
|
-
}
|
|
717
|
-
} else {
|
|
718
|
-
w = unref(getIsZH) ? 70 : 90;
|
|
719
|
-
}
|
|
720
|
-
return w;
|
|
721
|
-
};
|
|
722
|
-
const columnObj = {
|
|
723
|
-
fixed: "right",
|
|
724
|
-
title: t("ACTIONS"),
|
|
725
|
-
align: "center",
|
|
726
|
-
width: `${getWidth()}px`,
|
|
727
|
-
...column,
|
|
728
|
-
expand: expand || column.expand,
|
|
729
|
-
flag: ACTION_COLUMN
|
|
730
|
-
};
|
|
731
|
-
columns.push({
|
|
732
|
-
...columnObj,
|
|
733
|
-
customRender: ({ record, index }) => {
|
|
734
|
-
return h(
|
|
735
|
-
_sfc_main$9,
|
|
736
|
-
omit(
|
|
737
|
-
{
|
|
738
|
-
...columnObj,
|
|
739
|
-
authPrefix,
|
|
740
|
-
record,
|
|
741
|
-
index
|
|
742
|
-
},
|
|
743
|
-
"align"
|
|
744
|
-
)
|
|
745
|
-
);
|
|
746
|
-
}
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
function sortFixedColumn(columns) {
|
|
751
|
-
const fixedLeftColumn = [];
|
|
752
|
-
const fixedRightColumn = [];
|
|
753
|
-
const defaultColumn = [];
|
|
754
|
-
for (const column of columns) {
|
|
755
|
-
if (column.defaultHidden) {
|
|
756
|
-
continue;
|
|
757
|
-
}
|
|
758
|
-
if (column.fixed === "left") {
|
|
759
|
-
fixedLeftColumn.push(column);
|
|
760
|
-
continue;
|
|
761
|
-
}
|
|
762
|
-
if (column.fixed === "right") {
|
|
763
|
-
fixedRightColumn.push(column);
|
|
764
|
-
continue;
|
|
765
|
-
}
|
|
766
|
-
defaultColumn.push(column);
|
|
767
|
-
}
|
|
768
|
-
return [...fixedLeftColumn, ...defaultColumn, ...fixedRightColumn];
|
|
769
|
-
}
|
|
770
|
-
function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
771
|
-
const columnsRef = ref(unref(propsRef).columns);
|
|
772
|
-
let cacheColumns = unref(propsRef).columns;
|
|
773
|
-
const { appConf } = useAppStore();
|
|
774
|
-
const getColumnsRef = computed(() => {
|
|
775
|
-
const columns = cloneDeep(unref(columnsRef));
|
|
776
|
-
const { ellipsis } = unref(propsRef);
|
|
777
|
-
columns.forEach((it) => {
|
|
778
|
-
it.class = it.class ?? "";
|
|
779
|
-
if (!it.class.split(" ").includes("__column")) {
|
|
780
|
-
it.class = `${it.class} __column`;
|
|
781
|
-
}
|
|
782
|
-
const { customRender, render } = it;
|
|
783
|
-
if (it.sorter && isBoolean(it.sorter) && appConf?.ui?.table?.multipleSorter) {
|
|
784
|
-
it.sorter = {
|
|
785
|
-
multiple: Number(it.sorter)
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
handleItem(
|
|
789
|
-
it,
|
|
790
|
-
Reflect.has(it, "ellipsis") ? !!it.ellipsis : !!ellipsis && !render && !customRender
|
|
791
|
-
);
|
|
792
|
-
});
|
|
793
|
-
handleIndexColumn(propsRef, getPaginationRef, columns);
|
|
794
|
-
handleActionColumn(propsRef, columns);
|
|
795
|
-
return columns;
|
|
796
|
-
});
|
|
797
|
-
const getViewColumns = computed(() => {
|
|
798
|
-
const viewColumns = sortFixedColumn(unref(getColumnsRef));
|
|
799
|
-
const columns = cloneDeep(viewColumns);
|
|
800
|
-
return columns.filter((column) => isIfShow(column)).map((column) => {
|
|
801
|
-
if (column.edit) {
|
|
802
|
-
column.customRender = renderEditCell(column);
|
|
803
|
-
}
|
|
804
|
-
return column;
|
|
805
|
-
});
|
|
806
|
-
});
|
|
807
|
-
function isIfShow(column) {
|
|
808
|
-
const ifShow = column.show;
|
|
809
|
-
return isBoolean(ifShow) ? ifShow : isFunction(ifShow) ? ifShow(column) : true;
|
|
810
|
-
}
|
|
811
|
-
function addResize() {
|
|
812
|
-
const { resizable, minWidth = 50, maxWidth = 700 } = unref(propsRef);
|
|
813
|
-
const els = unref(tableElRef)?.$el.querySelectorAll(".__column"), scrollBarW = 10;
|
|
814
|
-
let allWidth = 0, columnAllWidth = 0, noWidthNum = 0, avgWidth = 0;
|
|
815
|
-
for (let i = 0; i < els?.length; i++) {
|
|
816
|
-
allWidth += els[i].offsetWidth ?? 0;
|
|
817
|
-
}
|
|
818
|
-
columnsRef.value.forEach((it) => {
|
|
819
|
-
if (isIfShow(it)) {
|
|
820
|
-
if (it.width) {
|
|
821
|
-
columnAllWidth += parseInt(`${it.width}`);
|
|
822
|
-
} else {
|
|
823
|
-
noWidthNum++;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
avgWidth = (allWidth - columnAllWidth - scrollBarW) / noWidthNum;
|
|
828
|
-
columnsRef.value.forEach((it) => {
|
|
829
|
-
it.width = it.width || Math.round(avgWidth);
|
|
830
|
-
if (Reflect.has(it, "resizable") ? !!it.resizable : resizable) {
|
|
831
|
-
it.resizable = true;
|
|
832
|
-
it.minWidth = it.minWidth || minWidth;
|
|
833
|
-
it.maxWidth = it.maxWidth || maxWidth;
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
|
-
function getColumns(opt) {
|
|
838
|
-
const { ignoreIndex, ignoreAction, sort } = opt || {};
|
|
839
|
-
let columns = toRaw(unref(getColumnsRef));
|
|
840
|
-
if (ignoreIndex) {
|
|
841
|
-
columns = columns.filter((it) => it.flag !== INDEX_FLAG);
|
|
842
|
-
}
|
|
843
|
-
if (ignoreAction) {
|
|
844
|
-
columns = columns.filter((it) => it.flag !== ACTION_COLUMN);
|
|
845
|
-
}
|
|
846
|
-
if (sort) {
|
|
847
|
-
columns = sortFixedColumn(columns);
|
|
848
|
-
}
|
|
849
|
-
return columns;
|
|
850
|
-
}
|
|
851
|
-
function setColumns(columnList = []) {
|
|
852
|
-
const columns = cloneDeep(columnList);
|
|
853
|
-
if (!isArray(columns) || !columns.length) {
|
|
854
|
-
columnsRef.value = [];
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
const cacheKeys = cacheColumns.map((item) => item.dataIndex);
|
|
858
|
-
if (!isString(columns[0])) {
|
|
859
|
-
columnsRef.value = columns;
|
|
860
|
-
} else {
|
|
861
|
-
const columnKeys = columns;
|
|
862
|
-
const newColumns = [];
|
|
863
|
-
cacheColumns.forEach((it) => {
|
|
864
|
-
newColumns.push({
|
|
865
|
-
...it,
|
|
866
|
-
show: true,
|
|
867
|
-
defaultHidden: !columnKeys.includes(it.dataIndex || it.key)
|
|
868
|
-
});
|
|
869
|
-
});
|
|
870
|
-
if (!isEqual(cacheKeys, columns)) {
|
|
871
|
-
newColumns.sort((prev, next) => {
|
|
872
|
-
return columnKeys.indexOf(prev.dataIndex) - columnKeys.indexOf(next.dataIndex);
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
columnsRef.value = newColumns;
|
|
876
|
-
cacheColumns = [...newColumns];
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
function setColumnsByDataIndex(dataIndex, value) {
|
|
880
|
-
if (!dataIndex || !value) {
|
|
881
|
-
return;
|
|
882
|
-
}
|
|
883
|
-
cacheColumns.forEach((item) => {
|
|
884
|
-
if (item.dataIndex === dataIndex) {
|
|
885
|
-
Object.assign(item, value);
|
|
886
|
-
}
|
|
887
|
-
});
|
|
888
|
-
columnsRef.value = [...cacheColumns];
|
|
889
|
-
}
|
|
890
|
-
function getCacheColumns() {
|
|
891
|
-
return cacheColumns;
|
|
892
|
-
}
|
|
893
|
-
watch(
|
|
894
|
-
() => unref(propsRef).columns,
|
|
895
|
-
(columns) => {
|
|
896
|
-
columnsRef.value = columns;
|
|
897
|
-
cacheColumns = columns.filter((it) => !it.flag) ?? [];
|
|
898
|
-
setTimeout(() => {
|
|
899
|
-
addResize();
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
);
|
|
903
|
-
return {
|
|
904
|
-
getViewColumns,
|
|
905
|
-
getColumnsRef,
|
|
906
|
-
getColumns,
|
|
907
|
-
setColumns,
|
|
908
|
-
setColumnsByDataIndex,
|
|
909
|
-
getCacheColumns
|
|
910
|
-
};
|
|
911
|
-
}
|
|
912
|
-
function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearSelectedRowKeys, emits }) {
|
|
913
|
-
const customRow = (record, index) => {
|
|
914
|
-
return {
|
|
915
|
-
onClick: (e) => {
|
|
916
|
-
e?.stopPropagation();
|
|
917
|
-
function handleClick() {
|
|
918
|
-
const { rowSelection, rowKey, clickToSelectRow } = unref(propsRef);
|
|
919
|
-
if (!rowSelection) {
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
const keys = getSelectedRowKeys() || [];
|
|
923
|
-
const key = record[rowKey];
|
|
924
|
-
if (!key) {
|
|
925
|
-
return;
|
|
926
|
-
}
|
|
927
|
-
const isCheckbox = rowSelection.type === "checkbox";
|
|
928
|
-
const isRadio = rowSelection.type === "radio";
|
|
929
|
-
if (clickToSelectRow) {
|
|
930
|
-
if (isCheckbox) {
|
|
931
|
-
if (keys.includes(key)) {
|
|
932
|
-
setSelectedRowKeys(keys.filter((it) => it !== key));
|
|
933
|
-
} else {
|
|
934
|
-
setSelectedRowKeys([...keys, key]);
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
if (isRadio) {
|
|
938
|
-
setSelectedRowKeys([key]);
|
|
939
|
-
}
|
|
940
|
-
return;
|
|
941
|
-
}
|
|
942
|
-
if (isCheckbox) {
|
|
943
|
-
const td = e.composedPath?.().find((dom) => dom.tagName === "TD");
|
|
944
|
-
if (!td) {
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
if (td.querySelector(".ROB") && !clickToSelectRow) {
|
|
948
|
-
return;
|
|
949
|
-
}
|
|
950
|
-
const checkBox = td.querySelector("input[type=checkbox]");
|
|
951
|
-
if (!checkBox || checkBox.hasAttribute("disabled")) {
|
|
952
|
-
return;
|
|
953
|
-
}
|
|
954
|
-
if (!keys.includes(key)) {
|
|
955
|
-
setSelectedRowKeys([...keys, key]);
|
|
956
|
-
return;
|
|
957
|
-
}
|
|
958
|
-
const keyIndex = keys.findIndex((item) => item === key);
|
|
959
|
-
keys.splice(keyIndex, 1);
|
|
960
|
-
setSelectedRowKeys(keys);
|
|
961
|
-
return;
|
|
962
|
-
}
|
|
963
|
-
if (isRadio) {
|
|
964
|
-
if (!keys.includes(key)) {
|
|
965
|
-
if (keys.length) {
|
|
966
|
-
clearSelectedRowKeys();
|
|
967
|
-
}
|
|
968
|
-
setSelectedRowKeys([key]);
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
clearSelectedRowKeys();
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
handleClick();
|
|
975
|
-
emits("row-click", record, index, e);
|
|
976
|
-
},
|
|
977
|
-
onDblclick: (event) => {
|
|
978
|
-
emits("row-dbClick", record, index, event);
|
|
979
|
-
},
|
|
980
|
-
onContextmenu: (event) => {
|
|
981
|
-
emits("row-contextmenu", record, index, event);
|
|
982
|
-
},
|
|
983
|
-
onMouseenter: (event) => {
|
|
984
|
-
emits("row-mouseenter", record, index, event);
|
|
985
|
-
},
|
|
986
|
-
onMouseleave: (event) => {
|
|
987
|
-
emits("row-mouseleave", record, index, event);
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
};
|
|
991
|
-
return {
|
|
992
|
-
customRow
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
function useDataSource(propsRef, { setPagination, clearSelectedRowKeys }) {
|
|
996
|
-
const dataSourceRef = ref([]);
|
|
997
|
-
watch(
|
|
998
|
-
() => unref(propsRef).dataSource,
|
|
999
|
-
(dataSource) => {
|
|
1000
|
-
dataSource && (dataSourceRef.value = dataSource);
|
|
1001
|
-
},
|
|
1002
|
-
{
|
|
1003
|
-
immediate: true
|
|
1004
|
-
}
|
|
1005
|
-
);
|
|
1006
|
-
const getDataSourceRef = computed(() => {
|
|
1007
|
-
return markRaw(unref(dataSourceRef));
|
|
1008
|
-
});
|
|
1009
|
-
function handleTableChange(pagination, filters, sorter) {
|
|
1010
|
-
const { sortFn, filterFn, onTableChange: onTableChange2, clearSelectOnPageChange } = unref(propsRef);
|
|
1011
|
-
const { appConf: appConf2 } = useAppStore();
|
|
1012
|
-
const { current = 1, pageSize = appConf2.ui.table.defaultPageSize } = pagination;
|
|
1013
|
-
if (clearSelectOnPageChange) {
|
|
1014
|
-
clearSelectedRowKeys();
|
|
1015
|
-
}
|
|
1016
|
-
setPagination(pagination);
|
|
1017
|
-
const params = {};
|
|
1018
|
-
if (sorter && isFunction(sortFn)) {
|
|
1019
|
-
params.sortInfo = sortFn(sorter);
|
|
1020
|
-
}
|
|
1021
|
-
if (filters && isFunction(filterFn)) {
|
|
1022
|
-
params.filterInfo = filterFn(filters);
|
|
1023
|
-
}
|
|
1024
|
-
return onTableChange2({
|
|
1025
|
-
pagination: {
|
|
1026
|
-
current,
|
|
1027
|
-
pageSize
|
|
1028
|
-
},
|
|
1029
|
-
sort: sorter,
|
|
1030
|
-
filter: toRaw(unref(params.filterInfo)),
|
|
1031
|
-
showBtnLoading: false
|
|
1032
|
-
});
|
|
1033
|
-
}
|
|
1034
|
-
const { defSort, onTableChange } = unref(propsRef);
|
|
1035
|
-
const { appConf } = useAppStore();
|
|
1036
|
-
onTableChange(
|
|
1037
|
-
{
|
|
1038
|
-
pagination: {
|
|
1039
|
-
current: 1,
|
|
1040
|
-
pageSize: appConf.ui.table.defaultPageSize
|
|
1041
|
-
},
|
|
1042
|
-
sort: defSort,
|
|
1043
|
-
filter: null,
|
|
1044
|
-
showBtnLoading: false
|
|
1045
|
-
},
|
|
1046
|
-
false
|
|
1047
|
-
);
|
|
1048
|
-
function updateTableDataRecord(rowKey, record) {
|
|
1049
|
-
const row = findTableDataRecord(rowKey);
|
|
1050
|
-
if (row) {
|
|
1051
|
-
for (const field in record) {
|
|
1052
|
-
row[field] = record[field];
|
|
1053
|
-
}
|
|
1054
|
-
return row;
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
function findTableDataRecord(rowKey) {
|
|
1058
|
-
if (!dataSourceRef.value || dataSourceRef.value.length == 0 || !rowKey) {
|
|
1059
|
-
return;
|
|
1060
|
-
}
|
|
1061
|
-
const { childrenColumnName = "children" } = unref(propsRef);
|
|
1062
|
-
const findRow = (array) => {
|
|
1063
|
-
let ret;
|
|
1064
|
-
array.some(function iter(r) {
|
|
1065
|
-
if (Reflect.has(r, unref(propsRef).rowKey) && r[unref(propsRef).rowKey] === rowKey) {
|
|
1066
|
-
ret = r;
|
|
1067
|
-
return true;
|
|
1068
|
-
}
|
|
1069
|
-
return r[childrenColumnName] && r[childrenColumnName].some(iter);
|
|
1070
|
-
});
|
|
1071
|
-
return ret;
|
|
1072
|
-
};
|
|
1073
|
-
return findRow(dataSourceRef.value);
|
|
1074
|
-
}
|
|
1075
|
-
return {
|
|
1076
|
-
getDataSourceRef,
|
|
1077
|
-
handleTableChange,
|
|
1078
|
-
updateTableDataRecord,
|
|
1079
|
-
findTableDataRecord
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
const _hoisted_1$6 = { key: 0 };
|
|
1083
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1084
|
-
__name: "Fullscreen",
|
|
1085
|
-
setup(__props) {
|
|
1086
|
-
const { t } = useI18n("UI");
|
|
1087
|
-
const table = getTableInstance();
|
|
1088
|
-
const wrapEl = ref(null);
|
|
1089
|
-
const { toggle, isFullscreen } = useFullscreen(wrapEl);
|
|
1090
|
-
watch(
|
|
1091
|
-
() => table.tableElRef.value,
|
|
1092
|
-
(v) => {
|
|
1093
|
-
const getParent = (el) => {
|
|
1094
|
-
if (!el || !el.parentNode)
|
|
1095
|
-
return null;
|
|
1096
|
-
if (el.parentNode.className?.indexOf("dt-layout-content") !== -1) {
|
|
1097
|
-
wrapEl.value = el.parentNode;
|
|
1098
|
-
} else {
|
|
1099
|
-
getParent(el.parentNode);
|
|
1100
|
-
}
|
|
1101
|
-
};
|
|
1102
|
-
getParent(v.$el);
|
|
1103
|
-
}
|
|
1104
|
-
);
|
|
1105
|
-
return (_ctx, _cache) => {
|
|
1106
|
-
const _component_ATooltip = Tooltip;
|
|
1107
|
-
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
1108
|
-
title: withCtx(() => [
|
|
1109
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("", true)
|
|
1110
|
-
]),
|
|
1111
|
-
default: withCtx(() => [
|
|
1112
|
-
createElementVNode("span", {
|
|
1113
|
-
class: "flex",
|
|
1114
|
-
onClick: _cache[0] || (_cache[0] = (...args) => unref(toggle) && unref(toggle)(...args))
|
|
1115
|
-
}, [
|
|
1116
|
-
createElementVNode("i", {
|
|
1117
|
-
class: normalizeClass(["i w-7 leading-7 text-center cursor-pointer", unref(isFullscreen) ? "ic:baseline-fullscreen-exit" : "ic:baseline-fullscreen"])
|
|
1118
|
-
}, null, 2)
|
|
1119
|
-
])
|
|
1120
|
-
]),
|
|
1121
|
-
_: 1
|
|
1122
|
-
});
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
});
|
|
1126
|
-
const _hoisted_1$5 = { class: "column-select" };
|
|
1127
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1128
|
-
__name: "DownloadCtrl",
|
|
1129
|
-
setup(__props) {
|
|
1130
|
-
const { t } = useI18n("UI");
|
|
1131
|
-
const state = reactive({
|
|
1132
|
-
indeterminate: false,
|
|
1133
|
-
checkAll: false
|
|
1134
|
-
});
|
|
1135
|
-
const modalData = ref([]);
|
|
1136
|
-
const onCheckAllChange = (e) => {
|
|
1137
|
-
modalData.value?.map((it) => it.show = e.target.checked);
|
|
1138
|
-
};
|
|
1139
|
-
const [registerDialog, { closeModal }] = useModal(
|
|
1140
|
-
{
|
|
1141
|
-
width: "60%",
|
|
1142
|
-
title: t("SETTING_EXPORT_COLUMN")
|
|
1143
|
-
},
|
|
1144
|
-
(data) => {
|
|
1145
|
-
modalData.value = data;
|
|
1146
|
-
}
|
|
1147
|
-
);
|
|
1148
|
-
function save() {
|
|
1149
|
-
let columns = unref(modalData)?.filter((it) => it.show);
|
|
1150
|
-
if (!columns.length) {
|
|
1151
|
-
message.error(t("NO_EXPORT_COLUMN"));
|
|
1152
|
-
return;
|
|
1153
|
-
}
|
|
1154
|
-
closeModal(columns);
|
|
1155
|
-
}
|
|
1156
|
-
watch(
|
|
1157
|
-
() => unref(modalData),
|
|
1158
|
-
(v) => {
|
|
1159
|
-
if (isArray(v)) {
|
|
1160
|
-
let showLens = v.filter((it) => it.show).length;
|
|
1161
|
-
Object.assign(state, {
|
|
1162
|
-
checkAll: showLens === v.length,
|
|
1163
|
-
indeterminate: showLens !== v.length && showLens > 0
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
|
-
},
|
|
1167
|
-
{
|
|
1168
|
-
deep: true
|
|
1169
|
-
}
|
|
1170
|
-
);
|
|
1171
|
-
return (_ctx, _cache) => {
|
|
1172
|
-
const _component_ACheckbox = Checkbox$1;
|
|
1173
|
-
const _component_ADivider = Divider;
|
|
1174
|
-
const _component_ACol = Col;
|
|
1175
|
-
const _component_ARow = Row;
|
|
1176
|
-
return openBlock(), createBlock(unref(DtModal), {
|
|
1177
|
-
onRegister: unref(registerDialog),
|
|
1178
|
-
onSave: save
|
|
1179
|
-
}, {
|
|
1180
|
-
default: withCtx(() => [
|
|
1181
|
-
createElementVNode("div", _hoisted_1$5, [
|
|
1182
|
-
createVNode(_component_ACheckbox, {
|
|
1183
|
-
checked: unref(state).checkAll,
|
|
1184
|
-
"onUpdate:checked": _cache[0] || (_cache[0] = ($event) => unref(state).checkAll = $event),
|
|
1185
|
-
indeterminate: unref(state).indeterminate,
|
|
1186
|
-
onChange: onCheckAllChange
|
|
1187
|
-
}, {
|
|
1188
|
-
default: withCtx(() => [
|
|
1189
|
-
createTextVNode(toDisplayString(unref(t)("SELECT_ALL")), 1)
|
|
1190
|
-
]),
|
|
1191
|
-
_: 1
|
|
1192
|
-
}, 8, ["checked", "indeterminate"]),
|
|
1193
|
-
createVNode(_component_ADivider, { dashed: "" }),
|
|
1194
|
-
createVNode(_component_ARow, null, {
|
|
1195
|
-
default: withCtx(() => [
|
|
1196
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(modalData), (it) => {
|
|
1197
|
-
return openBlock(), createBlock(_component_ACol, { span: 8 }, {
|
|
1198
|
-
default: withCtx(() => [
|
|
1199
|
-
createVNode(_component_ACheckbox, {
|
|
1200
|
-
checked: it.show,
|
|
1201
|
-
"onUpdate:checked": ($event) => it.show = $event
|
|
1202
|
-
}, {
|
|
1203
|
-
default: withCtx(() => [
|
|
1204
|
-
createTextVNode(toDisplayString(it.title), 1)
|
|
1205
|
-
]),
|
|
1206
|
-
_: 2
|
|
1207
|
-
}, 1032, ["checked", "onUpdate:checked"])
|
|
1208
|
-
]),
|
|
1209
|
-
_: 2
|
|
1210
|
-
}, 1024);
|
|
1211
|
-
}), 256))
|
|
1212
|
-
]),
|
|
1213
|
-
_: 1
|
|
1214
|
-
})
|
|
1215
|
-
])
|
|
1216
|
-
]),
|
|
1217
|
-
_: 1
|
|
1218
|
-
}, 8, ["onRegister"]);
|
|
1219
|
-
};
|
|
1220
|
-
}
|
|
1221
|
-
});
|
|
1222
|
-
const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("span", { class: "flex" }, [
|
|
1223
|
-
/* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-download w-7 leading-7 text-center cursor-pointer" })
|
|
1224
|
-
], -1);
|
|
1225
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1226
|
-
__name: "Download",
|
|
1227
|
-
props: {
|
|
1228
|
-
download: {
|
|
1229
|
-
type: [Boolean, Object]
|
|
1230
|
-
}
|
|
1231
|
-
},
|
|
1232
|
-
setup(__props) {
|
|
1233
|
-
const props2 = __props;
|
|
1234
|
-
const table = getTableInstance();
|
|
1235
|
-
const [registerDialog, { openModal }] = useModalOut();
|
|
1236
|
-
const { appConf } = useAppStore();
|
|
1237
|
-
const getPopupContainer$1 = () => document.getElementById("dt-layout-content") || getPopupContainer();
|
|
1238
|
-
const { t } = useI18n("UI");
|
|
1239
|
-
const isInclude = (type) => {
|
|
1240
|
-
return isBoolean(props2.download) && props2.download && appConf?.ui?.table?.exportTable.includes(type) || isArray(props2.download) && props2.download.includes(type);
|
|
1241
|
-
};
|
|
1242
|
-
const showCurrentDownload = computed(() => isInclude("current"));
|
|
1243
|
-
const showSelectedDownload = computed(() => isInclude("select"));
|
|
1244
|
-
const showBackDownload = computed(() => isInclude("all"));
|
|
1245
|
-
function handleTitleClick({ key }) {
|
|
1246
|
-
const { onDownload, columns: allColumns, dataSource } = unref(table.getBind);
|
|
1247
|
-
const excludesFlag = ["ACTION", "CHECKBOX", "RADIO"];
|
|
1248
|
-
const columns = allColumns.filter((it) => !excludesFlag.includes(it.flag));
|
|
1249
|
-
openModal(columns, (selectColumns) => {
|
|
1250
|
-
onDownload({
|
|
1251
|
-
type: key,
|
|
1252
|
-
columns: selectColumns,
|
|
1253
|
-
rows: key === "select" ? table.getSelectRows() : key === "current" ? dataSource : []
|
|
1254
|
-
});
|
|
1255
|
-
});
|
|
1256
|
-
}
|
|
1257
|
-
return (_ctx, _cache) => {
|
|
1258
|
-
const _component_AMenuItem = MenuItem;
|
|
1259
|
-
const _component_AMenu = Menu;
|
|
1260
|
-
const _component_ADropdown = Dropdown;
|
|
1261
|
-
const _component_ATooltip = Tooltip;
|
|
1262
|
-
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
1263
|
-
title: withCtx(() => [
|
|
1264
|
-
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT")), 1)
|
|
1265
|
-
]),
|
|
1266
|
-
default: withCtx(() => [
|
|
1267
|
-
createVNode(_component_ADropdown, {
|
|
1268
|
-
placement: "bottom",
|
|
1269
|
-
trigger: ["click"],
|
|
1270
|
-
getPopupContainer: getPopupContainer$1
|
|
1271
|
-
}, {
|
|
1272
|
-
overlay: withCtx(() => [
|
|
1273
|
-
createVNode(_component_AMenu, { onClick: handleTitleClick }, {
|
|
1274
|
-
default: withCtx(() => [
|
|
1275
|
-
unref(showCurrentDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "current" }, {
|
|
1276
|
-
default: withCtx(() => [
|
|
1277
|
-
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_CURRENT_PAGE")), 1)
|
|
1278
|
-
]),
|
|
1279
|
-
_: 1
|
|
1280
|
-
})) : createCommentVNode("", true),
|
|
1281
|
-
unref(showSelectedDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "select" }, {
|
|
1282
|
-
default: withCtx(() => [
|
|
1283
|
-
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_SELECT_COLUMN")), 1)
|
|
1284
|
-
]),
|
|
1285
|
-
_: 1
|
|
1286
|
-
})) : createCommentVNode("", true),
|
|
1287
|
-
unref(showBackDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "all" }, {
|
|
1288
|
-
default: withCtx(() => [
|
|
1289
|
-
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_ALL")), 1)
|
|
1290
|
-
]),
|
|
1291
|
-
_: 1
|
|
1292
|
-
})) : createCommentVNode("", true)
|
|
1293
|
-
]),
|
|
1294
|
-
_: 1
|
|
1295
|
-
})
|
|
1296
|
-
]),
|
|
1297
|
-
default: withCtx(() => [
|
|
1298
|
-
_hoisted_1$4
|
|
1299
|
-
]),
|
|
1300
|
-
_: 1
|
|
1301
|
-
}),
|
|
1302
|
-
createVNode(_sfc_main$6, { onRegister: unref(registerDialog) }, null, 8, ["onRegister"])
|
|
1303
|
-
]),
|
|
1304
|
-
_: 1
|
|
1305
|
-
});
|
|
1306
|
-
};
|
|
1307
|
-
}
|
|
1308
|
-
});
|
|
1309
|
-
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("i", { class: "i ant-design:drag-outlined drag-icon cursor-pointer" }, null, -1);
|
|
1310
|
-
const _hoisted_2$1 = ["onClick"];
|
|
1311
|
-
const _hoisted_3$1 = ["onClick"];
|
|
1312
|
-
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("i", { class: "i ant-design:setting-outlined w-7 leading-7 text-center cursor-pointer" }, null, -1);
|
|
1313
|
-
const prefixCls = "column-setting";
|
|
1314
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1315
|
-
__name: "Column",
|
|
1316
|
-
emits: ["columns-change"],
|
|
1317
|
-
setup(__props, { emit: emits }) {
|
|
1318
|
-
const attrs = useAttrs();
|
|
1319
|
-
const { t } = useI18n("UI");
|
|
1320
|
-
const table = getTableInstance();
|
|
1321
|
-
const defaultRowSelection = omit(table.getRowSelection(), "selectedRowKeys");
|
|
1322
|
-
const cachePlainOptions = ref([]);
|
|
1323
|
-
const plainOptions = ref([]);
|
|
1324
|
-
const plainSortOptions = ref([]);
|
|
1325
|
-
const columnListRef = ref(null);
|
|
1326
|
-
const checkIndex = ref(false);
|
|
1327
|
-
const checkSelect = ref(false);
|
|
1328
|
-
const getValues = computed(() => {
|
|
1329
|
-
return unref(table?.getBind);
|
|
1330
|
-
});
|
|
1331
|
-
let sortable;
|
|
1332
|
-
let sortableOrder = [];
|
|
1333
|
-
const state = reactive({
|
|
1334
|
-
checkAll: true,
|
|
1335
|
-
checkedList: [],
|
|
1336
|
-
defaultCheckList: []
|
|
1337
|
-
});
|
|
1338
|
-
const indeterminate = computed(() => {
|
|
1339
|
-
let len = plainOptions.value.length;
|
|
1340
|
-
let checkedLen = state.checkedList.length;
|
|
1341
|
-
unref(checkIndex) && checkedLen--;
|
|
1342
|
-
return checkedLen > 0 && checkedLen < len;
|
|
1343
|
-
});
|
|
1344
|
-
watchEffect(() => {
|
|
1345
|
-
const columns = table.getColumns();
|
|
1346
|
-
if (columns && columns.length) {
|
|
1347
|
-
init();
|
|
1348
|
-
}
|
|
1349
|
-
});
|
|
1350
|
-
watchEffect(() => {
|
|
1351
|
-
const values = unref(getValues);
|
|
1352
|
-
checkIndex.value = !!values.showIndexColumn;
|
|
1353
|
-
checkSelect.value = !!values.rowSelection;
|
|
1354
|
-
});
|
|
1355
|
-
let inited = false;
|
|
1356
|
-
function handleOpenChange() {
|
|
1357
|
-
if (inited)
|
|
1358
|
-
return;
|
|
1359
|
-
nextTick(() => {
|
|
1360
|
-
const columnListEl = unref(columnListRef);
|
|
1361
|
-
if (!columnListEl)
|
|
1362
|
-
return;
|
|
1363
|
-
const el = columnListEl.$el;
|
|
1364
|
-
if (!el)
|
|
1365
|
-
return;
|
|
1366
|
-
sortable = Sortablejs.create(unref(el), {
|
|
1367
|
-
animation: 500,
|
|
1368
|
-
delay: 400,
|
|
1369
|
-
delayOnTouchOnly: true,
|
|
1370
|
-
handle: ".drag-icon ",
|
|
1371
|
-
onEnd: (evt) => {
|
|
1372
|
-
const { oldIndex, newIndex } = evt;
|
|
1373
|
-
if (isNullOrUnDef(oldIndex) || isNullOrUnDef(newIndex) || oldIndex === newIndex) {
|
|
1374
|
-
return;
|
|
1375
|
-
}
|
|
1376
|
-
const columns = cloneDeep(plainSortOptions.value);
|
|
1377
|
-
if (oldIndex > newIndex) {
|
|
1378
|
-
columns.splice(newIndex, 0, columns[oldIndex]);
|
|
1379
|
-
columns.splice(oldIndex + 1, 1);
|
|
1380
|
-
} else {
|
|
1381
|
-
columns.splice(newIndex + 1, 0, columns[oldIndex]);
|
|
1382
|
-
columns.splice(oldIndex, 1);
|
|
1383
|
-
}
|
|
1384
|
-
plainSortOptions.value = columns;
|
|
1385
|
-
setColumns(
|
|
1386
|
-
columns.map((col) => col.value).filter((value) => state.checkedList.includes(value))
|
|
1387
|
-
);
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
sortableOrder = sortable.toArray();
|
|
1391
|
-
inited = true;
|
|
1392
|
-
});
|
|
1393
|
-
}
|
|
1394
|
-
function onCheckAllChange(e) {
|
|
1395
|
-
const checkList = plainOptions.value.map((item) => item.value);
|
|
1396
|
-
if (e.target.checked) {
|
|
1397
|
-
state.checkedList = checkList;
|
|
1398
|
-
setColumns(checkList);
|
|
1399
|
-
} else {
|
|
1400
|
-
state.checkedList = [];
|
|
1401
|
-
setColumns([]);
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
function handleIndexCheckChange(e) {
|
|
1405
|
-
table.setProps({
|
|
1406
|
-
showIndexColumn: e.target.checked
|
|
1407
|
-
});
|
|
1408
|
-
}
|
|
1409
|
-
function handleSelectCheckChange(e) {
|
|
1410
|
-
table.setProps({
|
|
1411
|
-
rowSelection: e.target.checked ? defaultRowSelection : null
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
function onChange(checkedList) {
|
|
1415
|
-
const len = plainSortOptions.value.length;
|
|
1416
|
-
state.checkAll = checkedList.length === len;
|
|
1417
|
-
const sortList = unref(plainSortOptions).map((item) => item.value);
|
|
1418
|
-
checkedList.sort((prev, next) => {
|
|
1419
|
-
return sortList.indexOf(prev) - sortList.indexOf(next);
|
|
1420
|
-
});
|
|
1421
|
-
setColumns(checkedList);
|
|
1422
|
-
}
|
|
1423
|
-
function reset() {
|
|
1424
|
-
state.checkedList = [...state.defaultCheckList];
|
|
1425
|
-
state.checkAll = true;
|
|
1426
|
-
plainOptions.value = unref(cachePlainOptions);
|
|
1427
|
-
plainSortOptions.value = unref(cachePlainOptions);
|
|
1428
|
-
setColumns(table.getCacheColumns());
|
|
1429
|
-
sortable.sort(sortableOrder);
|
|
1430
|
-
}
|
|
1431
|
-
function getColumns() {
|
|
1432
|
-
return table.getColumns({
|
|
1433
|
-
ignoreIndex: true,
|
|
1434
|
-
ignoreAction: true
|
|
1435
|
-
}).reduce((ret, it) => {
|
|
1436
|
-
ret.push({
|
|
1437
|
-
label: it.title,
|
|
1438
|
-
value: it.dataIndex || it.title,
|
|
1439
|
-
...it
|
|
1440
|
-
});
|
|
1441
|
-
return ret;
|
|
1442
|
-
}, []);
|
|
1443
|
-
}
|
|
1444
|
-
function handleColumnFixed(item, fixed) {
|
|
1445
|
-
if (!state.checkedList.includes(item.dataIndex))
|
|
1446
|
-
return;
|
|
1447
|
-
const columns = getColumns();
|
|
1448
|
-
const isFixed = item.fixed === fixed ? false : fixed;
|
|
1449
|
-
const index = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
1450
|
-
if (index !== -1) {
|
|
1451
|
-
columns[index].fixed = isFixed;
|
|
1452
|
-
}
|
|
1453
|
-
item.fixed = isFixed;
|
|
1454
|
-
if (isFixed && !item.width) {
|
|
1455
|
-
item.width = 100;
|
|
1456
|
-
}
|
|
1457
|
-
table.setColumnsByDataIndex?.(item.dataIndex, { fixed: isFixed });
|
|
1458
|
-
setColumns(columns);
|
|
1459
|
-
}
|
|
1460
|
-
function setColumns(columns) {
|
|
1461
|
-
table.setColumns(columns);
|
|
1462
|
-
const data = unref(plainSortOptions).map((col) => {
|
|
1463
|
-
const visable = columns.findIndex(
|
|
1464
|
-
(c) => c === col.value || typeof c !== "string" && c.dataIndex === col.value
|
|
1465
|
-
) !== -1;
|
|
1466
|
-
return { dataIndex: col.value, fixed: col.fixed, visable };
|
|
1467
|
-
});
|
|
1468
|
-
emits("columns-change", data);
|
|
1469
|
-
}
|
|
1470
|
-
function init() {
|
|
1471
|
-
const columns = getColumns();
|
|
1472
|
-
const checkList = table.getColumns({ ignoreAction: true }).map((it) => it.defaultHidden ? "" : it.dataIndex || it.title).filter(Boolean);
|
|
1473
|
-
if (!plainOptions.value.length) {
|
|
1474
|
-
plainOptions.value = columns;
|
|
1475
|
-
plainSortOptions.value = columns;
|
|
1476
|
-
cachePlainOptions.value = cloneDeep(columns);
|
|
1477
|
-
state.defaultCheckList = checkList;
|
|
1478
|
-
} else {
|
|
1479
|
-
unref(plainOptions).forEach(
|
|
1480
|
-
(it) => it.fixed === columns.find((col) => col.dataIndex === it.dataIndex)?.fixed
|
|
1481
|
-
);
|
|
1482
|
-
}
|
|
1483
|
-
state.isInit = true;
|
|
1484
|
-
state.checkedList = checkList;
|
|
1485
|
-
}
|
|
1486
|
-
function getPopupContainer$1() {
|
|
1487
|
-
return isFunction(attrs.getPopupContainer) ? attrs.getPopupContainer() : document.getElementById("dt-layout-content") || getPopupContainer();
|
|
1488
|
-
}
|
|
1489
|
-
return (_ctx, _cache) => {
|
|
1490
|
-
const _component_ACheckbox = Checkbox$1;
|
|
1491
|
-
const _component_AButton = Button;
|
|
1492
|
-
const _component_ATooltip = Tooltip;
|
|
1493
|
-
const _component_ADivider = Divider;
|
|
1494
|
-
const _component_ACheckboxGroup = CheckboxGroup;
|
|
1495
|
-
const _component_APopover = Popover$1;
|
|
1496
|
-
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
1497
|
-
title: withCtx(() => [
|
|
1498
|
-
createElementVNode("span", null, toDisplayString(unref(t)("COLUMN_CONTROL")), 1)
|
|
1499
|
-
]),
|
|
1500
|
-
default: withCtx(() => [
|
|
1501
|
-
createVNode(_component_APopover, {
|
|
1502
|
-
placement: "bottomLeft",
|
|
1503
|
-
trigger: "click",
|
|
1504
|
-
overlayClassName: `${prefixCls}__cloumn-list`,
|
|
1505
|
-
onOpenChange: handleOpenChange,
|
|
1506
|
-
getPopupContainer: getPopupContainer$1
|
|
1507
|
-
}, {
|
|
1508
|
-
title: withCtx(() => [
|
|
1509
|
-
createElementVNode("div", {
|
|
1510
|
-
class: normalizeClass(`${prefixCls}__popover-title flex`)
|
|
1511
|
-
}, [
|
|
1512
|
-
createVNode(_component_ACheckbox, {
|
|
1513
|
-
indeterminate: unref(indeterminate),
|
|
1514
|
-
checked: unref(state).checkAll,
|
|
1515
|
-
"onUpdate:checked": _cache[0] || (_cache[0] = ($event) => unref(state).checkAll = $event),
|
|
1516
|
-
onChange: onCheckAllChange
|
|
1517
|
-
}, {
|
|
1518
|
-
default: withCtx(() => [
|
|
1519
|
-
createTextVNode(toDisplayString(unref(t)("COLUMN_SHOW")), 1)
|
|
1520
|
-
]),
|
|
1521
|
-
_: 1
|
|
1522
|
-
}, 8, ["indeterminate", "checked"]),
|
|
1523
|
-
createVNode(_component_ACheckbox, {
|
|
1524
|
-
checked: unref(checkIndex),
|
|
1525
|
-
"onUpdate:checked": _cache[1] || (_cache[1] = ($event) => isRef(checkIndex) ? checkIndex.value = $event : null),
|
|
1526
|
-
onChange: handleIndexCheckChange
|
|
1527
|
-
}, {
|
|
1528
|
-
default: withCtx(() => [
|
|
1529
|
-
createTextVNode(toDisplayString(unref(t)("INDEX")), 1)
|
|
1530
|
-
]),
|
|
1531
|
-
_: 1
|
|
1532
|
-
}, 8, ["checked"]),
|
|
1533
|
-
createVNode(_component_ACheckbox, {
|
|
1534
|
-
checked: unref(checkSelect),
|
|
1535
|
-
"onUpdate:checked": _cache[2] || (_cache[2] = ($event) => isRef(checkSelect) ? checkSelect.value = $event : null),
|
|
1536
|
-
onChange: handleSelectCheckChange,
|
|
1537
|
-
disabled: !unref(defaultRowSelection)
|
|
1538
|
-
}, {
|
|
1539
|
-
default: withCtx(() => [
|
|
1540
|
-
createTextVNode(toDisplayString(unref(t)("CHECKBOX")), 1)
|
|
1541
|
-
]),
|
|
1542
|
-
_: 1
|
|
1543
|
-
}, 8, ["checked", "disabled"]),
|
|
1544
|
-
createVNode(_component_AButton, {
|
|
1545
|
-
type: "link",
|
|
1546
|
-
onClick: reset
|
|
1547
|
-
}, {
|
|
1548
|
-
default: withCtx(() => [
|
|
1549
|
-
createTextVNode(toDisplayString(unref(t)("RESET")), 1)
|
|
1550
|
-
]),
|
|
1551
|
-
_: 1
|
|
1552
|
-
})
|
|
1553
|
-
], 2)
|
|
1554
|
-
]),
|
|
1555
|
-
content: withCtx(() => [
|
|
1556
|
-
createVNode(_component_ACheckboxGroup, {
|
|
1557
|
-
value: unref(state).checkedList,
|
|
1558
|
-
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => unref(state).checkedList = $event),
|
|
1559
|
-
onChange,
|
|
1560
|
-
ref_key: "columnListRef",
|
|
1561
|
-
ref: columnListRef
|
|
1562
|
-
}, {
|
|
1563
|
-
default: withCtx(() => [
|
|
1564
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(plainOptions), (item) => {
|
|
1565
|
-
return openBlock(), createElementBlock("div", {
|
|
1566
|
-
key: item.value,
|
|
1567
|
-
class: normalizeClass(`${prefixCls}__check-item flex pt-1 pr-4 pb-2 items-center`)
|
|
1568
|
-
}, [
|
|
1569
|
-
_hoisted_1$3,
|
|
1570
|
-
createVNode(_component_ACheckbox, {
|
|
1571
|
-
value: item.value
|
|
1572
|
-
}, {
|
|
1573
|
-
default: withCtx(() => [
|
|
1574
|
-
createTextVNode(toDisplayString(item.label), 1)
|
|
1575
|
-
]),
|
|
1576
|
-
_: 2
|
|
1577
|
-
}, 1032, ["value"]),
|
|
1578
|
-
createVNode(_component_ATooltip, {
|
|
1579
|
-
placement: "bottomLeft",
|
|
1580
|
-
mouseLeaveDelay: 0.4,
|
|
1581
|
-
getPopupContainer: getPopupContainer$1
|
|
1582
|
-
}, {
|
|
1583
|
-
title: withCtx(() => [
|
|
1584
|
-
createTextVNode(toDisplayString(unref(t)("FIXED_TO_LEFT")), 1)
|
|
1585
|
-
]),
|
|
1586
|
-
default: withCtx(() => [
|
|
1587
|
-
createElementVNode("span", {
|
|
1588
|
-
class: normalizeClass({
|
|
1589
|
-
disabled: !unref(state).checkedList.includes(item.value),
|
|
1590
|
-
active: item.fixed === "left"
|
|
1591
|
-
})
|
|
1592
|
-
}, [
|
|
1593
|
-
createElementVNode("i", {
|
|
1594
|
-
class: normalizeClass(["i mdi:arrow-collapse-left cursor-pointer", `${prefixCls}__fixed-left`]),
|
|
1595
|
-
onClick: ($event) => handleColumnFixed(item, "left")
|
|
1596
|
-
}, null, 10, _hoisted_2$1)
|
|
1597
|
-
], 2)
|
|
1598
|
-
]),
|
|
1599
|
-
_: 2
|
|
1600
|
-
}, 1024),
|
|
1601
|
-
createVNode(_component_ADivider, { type: "vertical" }),
|
|
1602
|
-
createVNode(_component_ATooltip, {
|
|
1603
|
-
placement: "bottomLeft",
|
|
1604
|
-
mouseLeaveDelay: 0.4,
|
|
1605
|
-
getPopupContainer: getPopupContainer$1
|
|
1606
|
-
}, {
|
|
1607
|
-
title: withCtx(() => [
|
|
1608
|
-
createTextVNode(toDisplayString(unref(t)("FIXED_TO_RIGHT")), 1)
|
|
1609
|
-
]),
|
|
1610
|
-
default: withCtx(() => [
|
|
1611
|
-
createElementVNode("span", {
|
|
1612
|
-
class: normalizeClass({
|
|
1613
|
-
disabled: !unref(state).checkedList.includes(item.value),
|
|
1614
|
-
active: item.fixed === "right"
|
|
1615
|
-
})
|
|
1616
|
-
}, [
|
|
1617
|
-
createElementVNode("i", {
|
|
1618
|
-
class: normalizeClass(["i mdi:arrow-collapse-right cursor-pointer", `${prefixCls}__fixed-right`]),
|
|
1619
|
-
onClick: ($event) => handleColumnFixed(item, "right")
|
|
1620
|
-
}, null, 10, _hoisted_3$1)
|
|
1621
|
-
], 2)
|
|
1622
|
-
]),
|
|
1623
|
-
_: 2
|
|
1624
|
-
}, 1024)
|
|
1625
|
-
], 2);
|
|
1626
|
-
}), 128))
|
|
1627
|
-
]),
|
|
1628
|
-
_: 1
|
|
1629
|
-
}, 8, ["value"])
|
|
1630
|
-
]),
|
|
1631
|
-
default: withCtx(() => [
|
|
1632
|
-
_hoisted_4$1
|
|
1633
|
-
]),
|
|
1634
|
-
_: 1
|
|
1635
|
-
}, 8, ["overlayClassName"])
|
|
1636
|
-
]),
|
|
1637
|
-
_: 1
|
|
1638
|
-
});
|
|
1639
|
-
};
|
|
1640
|
-
}
|
|
1641
|
-
});
|
|
1642
|
-
const _hoisted_1$2 = { class: "flex dt-table-setting" };
|
|
1643
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1644
|
-
__name: "index",
|
|
1645
|
-
props: {
|
|
1646
|
-
setting: {
|
|
1647
|
-
type: [Object, Boolean],
|
|
1648
|
-
default: () => ({})
|
|
1649
|
-
}
|
|
1650
|
-
},
|
|
1651
|
-
emits: ["columns-change"],
|
|
1652
|
-
setup(__props, { emit: emits }) {
|
|
1653
|
-
const props2 = __props;
|
|
1654
|
-
const getSetting = computed(() => {
|
|
1655
|
-
return {
|
|
1656
|
-
download: true,
|
|
1657
|
-
setting: true,
|
|
1658
|
-
fullscreen: true,
|
|
1659
|
-
...isBoolean(props2.setting) && props2.setting === true ? {} : props2.setting
|
|
1660
|
-
};
|
|
1661
|
-
});
|
|
1662
|
-
function handleColumnChange(data) {
|
|
1663
|
-
emits("columns-change", data);
|
|
1664
|
-
}
|
|
1665
|
-
return (_ctx, _cache) => {
|
|
1666
|
-
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
1667
|
-
unref(getSetting).download ? (openBlock(), createBlock(_sfc_main$5, normalizeProps(mergeProps({ key: 0 }, unref(getSetting))), null, 16)) : createCommentVNode("", true),
|
|
1668
|
-
unref(getSetting).setting ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1669
|
-
key: 1,
|
|
1670
|
-
onColumnsChange: handleColumnChange
|
|
1671
|
-
})) : createCommentVNode("", true),
|
|
1672
|
-
unref(getSetting).fullscreen ? (openBlock(), createBlock(_sfc_main$7, { key: 2 })) : createCommentVNode("", true)
|
|
1673
|
-
]);
|
|
1674
|
-
};
|
|
1675
|
-
}
|
|
1676
|
-
});
|
|
1677
|
-
const _hoisted_1$1 = { class: "dt-table-header" };
|
|
1678
|
-
const _hoisted_2 = { class: "flex flex-row justify-between" };
|
|
1679
|
-
const _hoisted_3 = { class: "flex flex-row flex-1 gap-3" };
|
|
1680
|
-
const _hoisted_4 = { key: 0 };
|
|
1681
|
-
const _hoisted_5 = {
|
|
1682
|
-
key: 0,
|
|
1683
|
-
class: "border dt-table-header-top text-12 bg-gray-100 mt-1 py-1 px-3 border-dashed"
|
|
1684
|
-
};
|
|
1685
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1686
|
-
__name: "TableHeader",
|
|
1687
|
-
props: {
|
|
1688
|
-
tableSetting: {
|
|
1689
|
-
type: [Object, Boolean]
|
|
1690
|
-
},
|
|
1691
|
-
toolbar: {
|
|
1692
|
-
type: Array,
|
|
1693
|
-
default: () => []
|
|
1694
|
-
},
|
|
1695
|
-
authPrefix: {
|
|
1696
|
-
type: String
|
|
1697
|
-
}
|
|
1698
|
-
},
|
|
1699
|
-
setup(__props) {
|
|
1700
|
-
const props2 = __props;
|
|
1701
|
-
const getActionsProps = {
|
|
1702
|
-
mode: "dialog",
|
|
1703
|
-
showAdvancedButton: false,
|
|
1704
|
-
show: true,
|
|
1705
|
-
buttonList: props2.toolbar,
|
|
1706
|
-
authPrefix: props2.authPrefix
|
|
1707
|
-
};
|
|
1708
|
-
return (_ctx, _cache) => {
|
|
1709
|
-
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1710
|
-
createElementVNode("div", _hoisted_2, [
|
|
1711
|
-
createElementVNode("div", _hoisted_3, [
|
|
1712
|
-
getActionsProps?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, getActionsProps)), null, 16)) : createCommentVNode("", true),
|
|
1713
|
-
renderSlot(_ctx.$slots, "toolbar")
|
|
1714
|
-
]),
|
|
1715
|
-
__props.tableSetting ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1716
|
-
createVNode(_sfc_main$3, { setting: __props.tableSetting }, null, 8, ["setting"])
|
|
1717
|
-
])) : createCommentVNode("", true)
|
|
1718
|
-
]),
|
|
1719
|
-
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1720
|
-
renderSlot(_ctx.$slots, "headerTop")
|
|
1721
|
-
])) : createCommentVNode("", true)
|
|
1722
|
-
]);
|
|
1723
|
-
};
|
|
1724
|
-
}
|
|
1725
|
-
});
|
|
1726
|
-
function useTableHeader(propsRef, slots, handlers) {
|
|
1727
|
-
const { t } = useI18n("UI");
|
|
1728
|
-
const getHeaderProps = computed(() => {
|
|
1729
|
-
const TABLE_TOOLS = [
|
|
1730
|
-
{ t: "\u65B0\u589E", label: t("ADD"), preIcon: "mdi:plus", type: "primary", auth: "add", onClick: unref(propsRef).onOpenAddDialog },
|
|
1731
|
-
{ t: "\u5220\u9664", label: t("DELETE"), preIcon: "mdi:delete-outline", auth: "delete", onClick: unref(propsRef).onDeletes }
|
|
1732
|
-
];
|
|
1733
|
-
const { tableSetting, toolbar = TABLE_TOOLS, authPrefix } = unref(propsRef);
|
|
1734
|
-
const hideTitle = (!toolbar || !toolbar.filter((it) => it.show ?? true).length) && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
1735
|
-
return {
|
|
1736
|
-
title: hideTitle ? null : () => h(
|
|
1737
|
-
_sfc_main$2,
|
|
1738
|
-
{
|
|
1739
|
-
tableSetting,
|
|
1740
|
-
toolbar,
|
|
1741
|
-
authPrefix,
|
|
1742
|
-
onColumnsChange: handlers.onColumnsChange
|
|
1743
|
-
},
|
|
1744
|
-
{
|
|
1745
|
-
...slots.toolbar ? {
|
|
1746
|
-
toolbar: () => getSlot(slots, "toolbar")
|
|
1747
|
-
} : {},
|
|
1748
|
-
...slots.headerTop ? {
|
|
1749
|
-
headerTop: () => getSlot(slots, "headerTop")
|
|
1750
|
-
} : {}
|
|
1751
|
-
}
|
|
1752
|
-
)
|
|
1753
|
-
};
|
|
1754
|
-
});
|
|
1755
|
-
return {
|
|
1756
|
-
getHeaderProps
|
|
1757
|
-
};
|
|
1758
|
-
}
|
|
1759
|
-
function useLoading(props2) {
|
|
1760
|
-
const loadingRef = ref(unref(props2).loading);
|
|
1761
|
-
watch(
|
|
1762
|
-
() => unref(props2).loading,
|
|
1763
|
-
(loading) => {
|
|
1764
|
-
loadingRef.value = loading;
|
|
1765
|
-
}
|
|
1766
|
-
);
|
|
1767
|
-
const getLoading = computed(() => unref(loadingRef));
|
|
1768
|
-
function setLoading(loading) {
|
|
1769
|
-
loadingRef.value = loading;
|
|
1770
|
-
}
|
|
1771
|
-
return {
|
|
1772
|
-
getLoading,
|
|
1773
|
-
setLoading
|
|
1774
|
-
};
|
|
1775
|
-
}
|
|
1776
|
-
function usePagination(props2) {
|
|
1777
|
-
const { t } = useI18n("UI");
|
|
1778
|
-
const paginationRef = ref();
|
|
1779
|
-
watch(
|
|
1780
|
-
() => unref(props2).pagination,
|
|
1781
|
-
(pagination) => {
|
|
1782
|
-
if (!isBoolean(pagination) && pagination) {
|
|
1783
|
-
paginationRef.value = {
|
|
1784
|
-
...unref(paginationRef),
|
|
1785
|
-
...pagination ?? {}
|
|
1786
|
-
};
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
);
|
|
1790
|
-
const getPaginationInfo = computed(() => {
|
|
1791
|
-
let { pagination } = unref(props2);
|
|
1792
|
-
if (isBoolean(pagination) && !pagination) {
|
|
1793
|
-
return false;
|
|
1794
|
-
}
|
|
1795
|
-
if (!pagination) {
|
|
1796
|
-
pagination = {
|
|
1797
|
-
pageSize: useAppStore().appConf.ui.table.defaultPageSize,
|
|
1798
|
-
current: 1
|
|
1799
|
-
};
|
|
1800
|
-
}
|
|
1801
|
-
const { defaultPageSize, pageSizeOptions } = {
|
|
1802
|
-
...useAppStore().appConf.ui.table,
|
|
1803
|
-
...pagination
|
|
1804
|
-
};
|
|
1805
|
-
return {
|
|
1806
|
-
current: 1,
|
|
1807
|
-
pageSize: defaultPageSize,
|
|
1808
|
-
defaultPageSize,
|
|
1809
|
-
showTotal: (total, range) => t("TOTAL_PAGE", { total }),
|
|
1810
|
-
showSizeChanger: true,
|
|
1811
|
-
pageSizeOptions,
|
|
1812
|
-
showQuickJumper: true,
|
|
1813
|
-
class: `dt-pagination`,
|
|
1814
|
-
...isBoolean(pagination) ? {} : pagination,
|
|
1815
|
-
...unref(paginationRef)
|
|
1816
|
-
};
|
|
1817
|
-
});
|
|
1818
|
-
function setPagination(info) {
|
|
1819
|
-
const paginationInfo = unref(getPaginationInfo);
|
|
1820
|
-
paginationRef.value = {
|
|
1821
|
-
...!isBoolean(paginationInfo) ? paginationInfo : {},
|
|
1822
|
-
...info
|
|
1823
|
-
};
|
|
1824
|
-
}
|
|
1825
|
-
function getPagination() {
|
|
1826
|
-
return unref(getPaginationInfo);
|
|
1827
|
-
}
|
|
1828
|
-
return {
|
|
1829
|
-
getPaginationInfo,
|
|
1830
|
-
setPagination,
|
|
1831
|
-
getPagination
|
|
1832
|
-
};
|
|
1833
|
-
}
|
|
1834
|
-
const DEFAULT_CONFIG = {
|
|
1835
|
-
id: "id",
|
|
1836
|
-
children: "children",
|
|
1837
|
-
pid: "pid"
|
|
1838
|
-
};
|
|
1839
|
-
function useRowSelection(propsRef, emit) {
|
|
1840
|
-
const selectedRowKeysRef = ref([]);
|
|
1841
|
-
const selectedRowRef = ref([]);
|
|
1842
|
-
const getRowSelectionRef = computed(() => {
|
|
1843
|
-
const { rowSelection, showCheckboxColumn, checkStrictly } = unref(propsRef);
|
|
1844
|
-
if (!rowSelection && !showCheckboxColumn) {
|
|
1845
|
-
return null;
|
|
1846
|
-
}
|
|
1847
|
-
if (isBoolean(showCheckboxColumn)) {
|
|
1848
|
-
if (showCheckboxColumn && rowSelection) {
|
|
1849
|
-
rowSelection.type = "checkbox";
|
|
1850
|
-
} else {
|
|
1851
|
-
return null;
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
return {
|
|
1855
|
-
checkStrictly,
|
|
1856
|
-
selectedRowKeys: unref(selectedRowKeysRef),
|
|
1857
|
-
onChange: (selectedRowKeys) => setSelectedRowKeys(selectedRowKeys),
|
|
1858
|
-
...omit(rowSelection, ["onChange"])
|
|
1859
|
-
};
|
|
1860
|
-
});
|
|
1861
|
-
function findeNodeAll(tree, func, config = {}) {
|
|
1862
|
-
const _config = Object.assign({}, DEFAULT_CONFIG, config), result = [], list = [...tree];
|
|
1863
|
-
for (const node of list) {
|
|
1864
|
-
func(node) && result.push(node);
|
|
1865
|
-
node[_config?.children] && list.push(...node[_config?.children]);
|
|
1866
|
-
}
|
|
1867
|
-
return result;
|
|
1868
|
-
}
|
|
1869
|
-
function setSelectedRowKeys(rowKeys) {
|
|
1870
|
-
selectedRowKeysRef.value = rowKeys;
|
|
1871
|
-
const allSelectedRows = findeNodeAll(
|
|
1872
|
-
toRaw(unref(propsRef).dataSource).concat(toRaw(unref(selectedRowRef))),
|
|
1873
|
-
(item) => rowKeys.includes(item[unref(propsRef).rowKey]),
|
|
1874
|
-
{
|
|
1875
|
-
children: propsRef.value.childrenColumnName ?? "children"
|
|
1876
|
-
}
|
|
1877
|
-
);
|
|
1878
|
-
const trueSelectedRows = [];
|
|
1879
|
-
rowKeys.forEach((key) => {
|
|
1880
|
-
const found = allSelectedRows.find((item) => item[unref(propsRef).rowKey] === key);
|
|
1881
|
-
found && trueSelectedRows.push(found);
|
|
1882
|
-
});
|
|
1883
|
-
selectedRowRef.value = trueSelectedRows;
|
|
1884
|
-
}
|
|
1885
|
-
function clearSelectedRowKeys() {
|
|
1886
|
-
selectedRowKeysRef.value = [];
|
|
1887
|
-
selectedRowRef.value = [];
|
|
1888
|
-
}
|
|
1889
|
-
function getRowSelection() {
|
|
1890
|
-
return unref(getRowSelectionRef);
|
|
1891
|
-
}
|
|
1892
|
-
function getSelectedRowKeys() {
|
|
1893
|
-
return unref(selectedRowKeysRef);
|
|
1894
|
-
}
|
|
1895
|
-
function getSelectRows() {
|
|
1896
|
-
return unref(selectedRowRef);
|
|
1897
|
-
}
|
|
1898
|
-
watch(
|
|
1899
|
-
() => unref(propsRef).rowSelection?.selectedRowKeys,
|
|
1900
|
-
(v) => {
|
|
1901
|
-
setSelectedRowKeys(v);
|
|
1902
|
-
}
|
|
1903
|
-
);
|
|
1904
|
-
watch(
|
|
1905
|
-
() => unref(selectedRowKeysRef),
|
|
1906
|
-
() => {
|
|
1907
|
-
nextTick(() => {
|
|
1908
|
-
const { rowSelection } = unref(propsRef);
|
|
1909
|
-
if (rowSelection) {
|
|
1910
|
-
const { onChange } = rowSelection;
|
|
1911
|
-
if (onChange && isFunction(onChange)) {
|
|
1912
|
-
onChange(getSelectedRowKeys(), getSelectRows());
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
emit("selection-change", {
|
|
1916
|
-
keys: getSelectedRowKeys(),
|
|
1917
|
-
rows: getSelectRows()
|
|
1918
|
-
});
|
|
1919
|
-
});
|
|
1920
|
-
},
|
|
1921
|
-
{ deep: true }
|
|
1922
|
-
);
|
|
1923
|
-
return {
|
|
1924
|
-
getRowSelectionRef,
|
|
1925
|
-
clearSelectedRowKeys,
|
|
1926
|
-
getRowSelection,
|
|
1927
|
-
getSelectedRowKeys,
|
|
1928
|
-
getSelectRows,
|
|
1929
|
-
setSelectedRowKeys
|
|
1930
|
-
};
|
|
1931
|
-
}
|
|
1932
|
-
function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
1933
|
-
const getScrollX = computed(() => {
|
|
1934
|
-
let width = 0;
|
|
1935
|
-
if (unref(rowSelectionRef)) {
|
|
1936
|
-
width += 50;
|
|
1937
|
-
}
|
|
1938
|
-
const NORMAL_WIDTH = 120;
|
|
1939
|
-
const columns = unref(columnsRef).filter((item) => !item.defaultHidden);
|
|
1940
|
-
columns.forEach((item) => {
|
|
1941
|
-
width += Number.parseInt(item.width) || NORMAL_WIDTH;
|
|
1942
|
-
});
|
|
1943
|
-
const table = unref(tableElRef);
|
|
1944
|
-
const tableWidth = table?.$el?.offsetWidth ?? 0;
|
|
1945
|
-
return tableWidth > width ? "100%" : width;
|
|
1946
|
-
});
|
|
1947
|
-
const getScrollRef = computed(() => {
|
|
1948
|
-
const { scroll } = unref(propsRef);
|
|
1949
|
-
return {
|
|
1950
|
-
x: unref(getScrollX),
|
|
1951
|
-
y: "100%",
|
|
1952
|
-
scrollToFirstRowOnChange: false,
|
|
1953
|
-
...scroll
|
|
1954
|
-
};
|
|
1955
|
-
});
|
|
1956
|
-
return {
|
|
1957
|
-
getScrollRef
|
|
1958
|
-
};
|
|
1959
|
-
}
|
|
1960
|
-
function useTableStyle(propsRef) {
|
|
1961
|
-
function getRowClassName(record, index) {
|
|
1962
|
-
const { striped, rowClassName } = unref(propsRef);
|
|
1963
|
-
const classNames = [];
|
|
1964
|
-
if (striped) {
|
|
1965
|
-
classNames.push(index % 2 === 1 ? "table-striped" : "");
|
|
1966
|
-
}
|
|
1967
|
-
if (rowClassName && isFunction(rowClassName)) {
|
|
1968
|
-
classNames.push(rowClassName(record, index));
|
|
1969
|
-
}
|
|
1970
|
-
return classNames.filter((cls) => !!cls).join(" ");
|
|
1971
|
-
}
|
|
1972
|
-
return {
|
|
1973
|
-
getRowClassName
|
|
1974
|
-
};
|
|
1975
|
-
}
|
|
1976
|
-
const props = {
|
|
1977
|
-
column: Object,
|
|
1978
|
-
record: Object,
|
|
1979
|
-
index: Number
|
|
1980
|
-
};
|
|
1981
|
-
const _sfc_main$1 = {
|
|
1982
|
-
name: "TableRender",
|
|
1983
|
-
props,
|
|
1984
|
-
setup(props2, {}) {
|
|
1985
|
-
let renderText = ref(null);
|
|
1986
|
-
watch(() => [props2.record, props2.column], (v) => {
|
|
1987
|
-
if (v) {
|
|
1988
|
-
renderCell();
|
|
1989
|
-
}
|
|
1990
|
-
}, {
|
|
1991
|
-
immediate: true,
|
|
1992
|
-
deep: true
|
|
1993
|
-
});
|
|
1994
|
-
function renderCell() {
|
|
1995
|
-
const {
|
|
1996
|
-
column,
|
|
1997
|
-
record,
|
|
1998
|
-
index
|
|
1999
|
-
} = props2;
|
|
2000
|
-
const {
|
|
2001
|
-
render,
|
|
2002
|
-
dataIndex
|
|
2003
|
-
} = column;
|
|
2004
|
-
const text = record[dataIndex.toString()];
|
|
2005
|
-
if (isObject(render)) {
|
|
2006
|
-
const {
|
|
2007
|
-
dict,
|
|
2008
|
-
date,
|
|
2009
|
-
number,
|
|
2010
|
-
percent,
|
|
2011
|
-
struc,
|
|
2012
|
-
tag,
|
|
2013
|
-
link
|
|
2014
|
-
} = render;
|
|
2015
|
-
if (struc) {
|
|
2016
|
-
const {
|
|
2017
|
-
appConf
|
|
2018
|
-
} = useAppStore();
|
|
2019
|
-
let apiStruc = appConf.structure[struc];
|
|
2020
|
-
if (!apiStruc) {
|
|
2021
|
-
error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
|
|
2022
|
-
} else {
|
|
2023
|
-
renderText = computed(() => getDictValueByCode(text, apiStruc));
|
|
2024
|
-
}
|
|
2025
|
-
} else if (dict) {
|
|
2026
|
-
renderText = computed(() => getDictValueByCode(text, dict));
|
|
2027
|
-
} else if (date) {
|
|
2028
|
-
renderText.value = (text && dayjs(text).format(date || "YYYY-MM-DD")) ?? "";
|
|
2029
|
-
} else if (number) {
|
|
2030
|
-
renderText.value = formatNumber(text, number);
|
|
2031
|
-
} else if (percent) {
|
|
2032
|
-
renderText.value = formatNumber((text || 0) * 100, percent) + "%";
|
|
2033
|
-
} else if (tag && isFunction(tag)) {
|
|
2034
|
-
renderText.value = createVNode(Tag, {
|
|
2035
|
-
"color": tag(record).color
|
|
2036
|
-
}, {
|
|
2037
|
-
default: () => [tag(record).text]
|
|
2038
|
-
});
|
|
2039
|
-
} else if (link) {
|
|
2040
|
-
let txt = link.text ?? text;
|
|
2041
|
-
renderText.value = createVNode("a", {
|
|
2042
|
-
"class": "primary-color-link",
|
|
2043
|
-
"onClick": () => link(record, index)
|
|
2044
|
-
}, [txt]);
|
|
2045
|
-
} else if (isVnode(render)) {
|
|
2046
|
-
renderText.value = createVNode(Fragment, null, [createTextVNode(" "), render, createTextVNode(" ")]);
|
|
2047
|
-
} else if (render.setup) {
|
|
2048
|
-
renderText.value = createVNode(render, {
|
|
2049
|
-
...record,
|
|
2050
|
-
text
|
|
2051
|
-
});
|
|
2052
|
-
}
|
|
2053
|
-
} else if (isFunction(render)) {
|
|
2054
|
-
let afterRenderData = render(record, index, text);
|
|
2055
|
-
if (afterRenderData.__v_isRef) {
|
|
2056
|
-
renderText = afterRenderData;
|
|
2057
|
-
} else if (afterRenderData.setup) {
|
|
2058
|
-
renderText.value = createVNode(afterRenderData, {
|
|
2059
|
-
...record,
|
|
2060
|
-
text
|
|
2061
|
-
});
|
|
2062
|
-
} else {
|
|
2063
|
-
renderText.value = isVnode(afterRenderData) ? createVNode(Fragment, null, [afterRenderData]) : afterRenderData;
|
|
2064
|
-
}
|
|
2065
|
-
} else {
|
|
2066
|
-
renderText.value = unref(text);
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
return () => createVNode("span", null, [unref(renderText)]);
|
|
2070
|
-
}
|
|
2071
|
-
};
|
|
2072
|
-
const DEFAULT_SORT_FN = (sortInfo) => {
|
|
2073
|
-
const { field, order } = sortInfo;
|
|
2074
|
-
return field && order ? { field, order } : {};
|
|
2075
|
-
};
|
|
2076
|
-
const TableProps = {
|
|
2077
|
-
autoFetch: { type: Boolean, default: false },
|
|
2078
|
-
authPrefix: { type: String },
|
|
2079
|
-
clickToSelectRow: { type: Boolean, default: false },
|
|
2080
|
-
tableSetting: { type: [Boolean, Object], default: () => ({}) },
|
|
2081
|
-
striped: { type: Boolean, default: true },
|
|
2082
|
-
clearSelectOnPageChange: { type: Boolean, default: false },
|
|
2083
|
-
resizable: { type: Boolean, default: true },
|
|
2084
|
-
minWidth: { type: Number },
|
|
2085
|
-
maxWidth: { type: Number },
|
|
2086
|
-
virtual: { type: Boolean, default: false },
|
|
2087
|
-
sortFn: { type: Function, default: DEFAULT_SORT_FN },
|
|
2088
|
-
defSort: { type: Object, default: null },
|
|
2089
|
-
filterFn: {
|
|
2090
|
-
type: Function,
|
|
2091
|
-
default: (data) => {
|
|
2092
|
-
return data;
|
|
2093
|
-
}
|
|
2094
|
-
},
|
|
2095
|
-
rowKey: {
|
|
2096
|
-
type: [String, Number],
|
|
2097
|
-
default: "id"
|
|
2098
|
-
},
|
|
2099
|
-
columnCode: { type: String, default: "" },
|
|
2100
|
-
columns: { type: [Array], default: () => [] },
|
|
2101
|
-
slotsTemplate: { type: Object, default: () => ({}) },
|
|
2102
|
-
showIndexColumn: { type: Boolean, default: false },
|
|
2103
|
-
showCheckboxColumn: { type: Boolean, default: true },
|
|
2104
|
-
expandActions: { type: Boolean, default: false },
|
|
2105
|
-
ellipsis: { type: Boolean, default: true },
|
|
2106
|
-
dataSource: { type: Array, default: null },
|
|
2107
|
-
bordered: { type: Boolean, default: true },
|
|
2108
|
-
pagination: {
|
|
2109
|
-
type: [Object, Boolean],
|
|
2110
|
-
default: null
|
|
2111
|
-
},
|
|
2112
|
-
loading: { type: Boolean, default: false },
|
|
2113
|
-
rowClassName: { type: Function },
|
|
2114
|
-
scroll: {
|
|
2115
|
-
type: Object,
|
|
2116
|
-
default: {}
|
|
2117
|
-
},
|
|
2118
|
-
onTableChange: {
|
|
2119
|
-
type: Function,
|
|
2120
|
-
default: () => ({})
|
|
2121
|
-
},
|
|
2122
|
-
onDownload: {
|
|
2123
|
-
type: Function,
|
|
2124
|
-
default: (excelData) => ({})
|
|
2125
|
-
},
|
|
2126
|
-
rowSelection: {
|
|
2127
|
-
type: Object,
|
|
2128
|
-
default: {
|
|
2129
|
-
type: "checkbox",
|
|
2130
|
-
fixed: true
|
|
2131
|
-
}
|
|
2132
|
-
},
|
|
2133
|
-
customRow: { type: Function, default: () => ({}) },
|
|
2134
|
-
childrenColumnName: { type: String, default: "children" },
|
|
2135
|
-
defaultExpandAllRows: { type: Boolean, default: false },
|
|
2136
|
-
defaultExpandedRowKeys: { type: [Array], default: () => [] },
|
|
2137
|
-
expandedRowKeys: { type: [Array], default: () => [] },
|
|
2138
|
-
expandFixed: { type: [Boolean, String], default: false },
|
|
2139
|
-
expandRowByClick: { type: Boolean, default: false },
|
|
2140
|
-
indentSize: { type: Number, default: 15 },
|
|
2141
|
-
indexColumnProps: { type: [Array], default: () => [] },
|
|
2142
|
-
isTreeTable: { type: Boolean, default: false },
|
|
2143
|
-
checkStrictly: { type: Boolean, default: false },
|
|
2144
|
-
operations: { type: Object },
|
|
2145
|
-
toolbar: { type: Array },
|
|
2146
|
-
registerInstance: {
|
|
2147
|
-
type: Function
|
|
2148
|
-
},
|
|
2149
|
-
onSearch: {
|
|
2150
|
-
type: Function,
|
|
2151
|
-
default: (params) => {
|
|
2152
|
-
}
|
|
2153
|
-
},
|
|
2154
|
-
onOpenAddDialog: {
|
|
2155
|
-
type: Function,
|
|
2156
|
-
default: (params) => ({})
|
|
2157
|
-
},
|
|
2158
|
-
onOpenEditDialog: {
|
|
2159
|
-
type: Function,
|
|
2160
|
-
default: (row, index) => ({})
|
|
2161
|
-
},
|
|
2162
|
-
onDelete: {
|
|
2163
|
-
type: Function,
|
|
2164
|
-
default: (row, index) => ({})
|
|
2165
|
-
},
|
|
2166
|
-
onDeletes: {
|
|
2167
|
-
type: Function,
|
|
2168
|
-
default: (params) => ({})
|
|
2169
|
-
}
|
|
2170
|
-
};
|
|
2171
|
-
const _hoisted_1 = /* @__PURE__ */ createElementVNode("span", { class: "block pb-2" }, "\u62B1\u6B49, \u627E\u4E0D\u5230\u60A8\u60F3\u8981\u7684\u6570\u636E~", -1);
|
|
2172
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2173
|
-
__name: "index",
|
|
2174
|
-
props: TableProps,
|
|
2175
|
-
emits: [
|
|
2176
|
-
"register",
|
|
2177
|
-
"selection-change",
|
|
2178
|
-
"columns-change",
|
|
2179
|
-
"row-click",
|
|
2180
|
-
"row-dbClick",
|
|
2181
|
-
"row-contextmenu",
|
|
2182
|
-
"row-mouseenter",
|
|
2183
|
-
"row-mouseleave",
|
|
2184
|
-
"edit-change"
|
|
2185
|
-
],
|
|
2186
|
-
setup(__props, { emit: emits }) {
|
|
2187
|
-
const props2 = __props;
|
|
2188
|
-
const tableElRef = ref(null);
|
|
2189
|
-
const attrs = useAttrs();
|
|
2190
|
-
const slots = useSlots();
|
|
2191
|
-
const innerPropsRef = ref();
|
|
2192
|
-
const getProps = computed(() => {
|
|
2193
|
-
return { ...props2, ...unref(innerPropsRef) };
|
|
2194
|
-
});
|
|
2195
|
-
const { getRowClassName } = useTableStyle(getProps);
|
|
2196
|
-
const tableCls = computed(() => {
|
|
2197
|
-
return ["dt-table", "box-border", { "dt-table-no-pagation": !unref(getProps).pagination }];
|
|
2198
|
-
});
|
|
2199
|
-
const { getLoading, setLoading } = useLoading(getProps);
|
|
2200
|
-
const { getPaginationInfo, setPagination, getPagination } = usePagination(getProps);
|
|
2201
|
-
const {
|
|
2202
|
-
getViewColumns,
|
|
2203
|
-
getColumnsRef,
|
|
2204
|
-
getColumns,
|
|
2205
|
-
setColumns,
|
|
2206
|
-
setColumnsByDataIndex,
|
|
2207
|
-
getCacheColumns
|
|
2208
|
-
} = useColumns(getProps, getPaginationInfo, tableElRef);
|
|
2209
|
-
const {
|
|
2210
|
-
getRowSelectionRef,
|
|
2211
|
-
clearSelectedRowKeys,
|
|
2212
|
-
getRowSelection,
|
|
2213
|
-
getSelectRows,
|
|
2214
|
-
getSelectedRowKeys,
|
|
2215
|
-
setSelectedRowKeys
|
|
2216
|
-
} = useRowSelection(getProps, emits);
|
|
2217
|
-
const { getScrollRef } = useTableScroll(
|
|
2218
|
-
getProps,
|
|
2219
|
-
tableElRef,
|
|
2220
|
-
getColumnsRef,
|
|
2221
|
-
getRowSelectionRef
|
|
2222
|
-
);
|
|
2223
|
-
const handlers = {
|
|
2224
|
-
onColumnsChange: (data) => {
|
|
2225
|
-
emits("columns-change", data);
|
|
2226
|
-
unref(getProps).onColumnsChange?.(data);
|
|
2227
|
-
}
|
|
2228
|
-
};
|
|
2229
|
-
const { getHeaderProps } = useTableHeader(getProps, slots, handlers);
|
|
2230
|
-
const { customRow } = useCustomRow(getProps, {
|
|
2231
|
-
setSelectedRowKeys,
|
|
2232
|
-
getSelectedRowKeys,
|
|
2233
|
-
clearSelectedRowKeys,
|
|
2234
|
-
emits
|
|
2235
|
-
});
|
|
2236
|
-
const { getDataSourceRef, handleTableChange, findTableDataRecord, updateTableDataRecord } = useDataSource(
|
|
2237
|
-
getProps,
|
|
2238
|
-
{
|
|
2239
|
-
setPagination,
|
|
2240
|
-
clearSelectedRowKeys
|
|
2241
|
-
}
|
|
2242
|
-
);
|
|
2243
|
-
const getBind = computed(() => {
|
|
2244
|
-
return {
|
|
2245
|
-
...attrs,
|
|
2246
|
-
...unref(getProps),
|
|
2247
|
-
...unref(getHeaderProps),
|
|
2248
|
-
scroll: unref(getScrollRef),
|
|
2249
|
-
loading: unref(getLoading),
|
|
2250
|
-
dataSource: unref(getDataSourceRef),
|
|
2251
|
-
pagination: toRaw(unref(getPaginationInfo)),
|
|
2252
|
-
rowSelection: unref(getRowSelectionRef),
|
|
2253
|
-
rowKey: unref(getProps).rowKey,
|
|
2254
|
-
columns: unref(getViewColumns),
|
|
2255
|
-
tableLayout: "fixed",
|
|
2256
|
-
class: unref(tableCls),
|
|
2257
|
-
customRow,
|
|
2258
|
-
onChange: handleTableChange,
|
|
2259
|
-
...unref(getProps).resizable ? {
|
|
2260
|
-
onResizeColumn: (w, col) => {
|
|
2261
|
-
col.width = w;
|
|
2262
|
-
setColumnsByDataIndex(`${col.dataIndex}`, col);
|
|
2263
|
-
}
|
|
2264
|
-
} : {}
|
|
2265
|
-
};
|
|
2266
|
-
});
|
|
2267
|
-
function setProps(props22) {
|
|
2268
|
-
let allProps = {
|
|
2269
|
-
...unref(innerPropsRef),
|
|
2270
|
-
...props22
|
|
2271
|
-
};
|
|
2272
|
-
if (isObject(props22.tableSetting)) {
|
|
2273
|
-
let historyTableSetting = unref(innerPropsRef)?.tableSetting;
|
|
2274
|
-
allProps.tableSetting = {
|
|
2275
|
-
...isBoolean(historyTableSetting) ? {} : historyTableSetting,
|
|
2276
|
-
...props22.tableSetting
|
|
2277
|
-
};
|
|
2278
|
-
}
|
|
2279
|
-
innerPropsRef.value = allProps;
|
|
2280
|
-
}
|
|
2281
|
-
const tableAction = {
|
|
2282
|
-
setProps,
|
|
2283
|
-
setLoading,
|
|
2284
|
-
clearSelectedRowKeys,
|
|
2285
|
-
getSelectRows,
|
|
2286
|
-
getSelectedRowKeys,
|
|
2287
|
-
setSelectedRowKeys,
|
|
2288
|
-
getRowSelection,
|
|
2289
|
-
getColumns,
|
|
2290
|
-
setColumns,
|
|
2291
|
-
setColumnsByDataIndex,
|
|
2292
|
-
getCacheColumns,
|
|
2293
|
-
findTableDataRecord,
|
|
2294
|
-
updateTableDataRecord,
|
|
2295
|
-
getPagination,
|
|
2296
|
-
emits
|
|
2297
|
-
};
|
|
2298
|
-
createTableInstance({ ...tableAction, tableElRef, getBind, getProps });
|
|
2299
|
-
emits("register", tableAction);
|
|
2300
|
-
if (unref(innerPropsRef)?.registerInstance) {
|
|
2301
|
-
unref(innerPropsRef)?.registerInstance({
|
|
2302
|
-
...tableAction,
|
|
2303
|
-
rowKey: unref(innerPropsRef).rowKey
|
|
2304
|
-
});
|
|
2305
|
-
}
|
|
2306
|
-
onMounted(() => {
|
|
2307
|
-
if (unref(getProps).autoFetch) {
|
|
2308
|
-
unref(getProps)?.onSearch({});
|
|
2309
|
-
}
|
|
2310
|
-
});
|
|
2311
|
-
return (_ctx, _cache) => {
|
|
2312
|
-
const _component_ATable = Table;
|
|
2313
|
-
return openBlock(), createBlock(_component_ATable, mergeProps({
|
|
2314
|
-
ref_key: "tableElRef",
|
|
2315
|
-
ref: tableElRef
|
|
2316
|
-
}, getBind.value, {
|
|
2317
|
-
"row-class-name": unref(getRowClassName),
|
|
2318
|
-
onChange: unref(handleTableChange)
|
|
2319
|
-
}), createSlots({
|
|
2320
|
-
bodyCell: withCtx(({ column, record, index }) => [
|
|
2321
|
-
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2322
|
-
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2323
|
-
column.render && !column.slot && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(_sfc_main$1, {
|
|
2324
|
-
key: 2,
|
|
2325
|
-
column,
|
|
2326
|
-
record,
|
|
2327
|
-
index
|
|
2328
|
-
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
2329
|
-
]),
|
|
2330
|
-
emptyText: withCtx(() => [
|
|
2331
|
-
createVNode(unref(Icon), {
|
|
2332
|
-
name: "svg ui-table-empty",
|
|
2333
|
-
size: 250,
|
|
2334
|
-
className: "w-72 m-auto my-5"
|
|
2335
|
-
}),
|
|
2336
|
-
_hoisted_1
|
|
2337
|
-
]),
|
|
2338
|
-
_: 2
|
|
2339
|
-
}, [
|
|
2340
|
-
renderList(Object.keys(_ctx.$slots), (item) => {
|
|
2341
|
-
return {
|
|
2342
|
-
name: item,
|
|
2343
|
-
fn: withCtx((data) => [
|
|
2344
|
-
renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
|
|
2345
|
-
])
|
|
2346
|
-
};
|
|
2347
|
-
})
|
|
2348
|
-
]), 1040, ["row-class-name", "onChange"]);
|
|
2349
|
-
};
|
|
2350
|
-
}
|
|
2351
|
-
});
|
|
2352
|
-
export {
|
|
2353
|
-
_sfc_main as DtTable,
|
|
2354
|
-
_sfc_main$2 as DtTableHeader,
|
|
2355
|
-
useTable
|
|
2356
|
-
};
|