/* * @Description: antd组件设置 * @FilePath: \base-framework\packages\ui\ant-ui\src\context.ts * @Author: freud * @Date: 2023-07-11 09:16:30 * @LastEditTime: 2023-10-27 09:28:02 * @LastEditors: freud * @Reference: */ import { componentSetting, RoleEnum } from '@eciol/shared'; import { AnyNormalFunction } from '@eciol/types'; import { VXETable } from 'vxe-table'; interface ContextOptions { componentSetting: typeof componentSetting; usePermission: AnyNormalFunction< any, { hasPermission: (value?: RoleEnum | RoleEnum[] | string | string[], def?: boolean) => boolean } >; useAppStore: any; localeList: any; initRequest: AnyNormalFunction; } let context: ContextOptions = { componentSetting, usePermission: () => ({ hasPermission: () => true }), useAppStore: () => ({}), localeList: [], initRequest() {}, }; const initAntdComponentSetting = (func: AnyNormalFunction) => { context = func(); VXETable.setup(context.componentSetting.vxeTable); }; export { context, initAntdComponentSetting };