| | |
| | | import type { ExtractPropTypes } from 'vue'; |
| | | import type { TreeDataItem } from 'ant-design-vue/es/tree/Tree'; |
| | | |
| | | import { buildProps } from '/@/utils/props'; |
| | | import { buildProps } from '@/utils/props'; |
| | | |
| | | export enum ToolbarEnum { |
| | | SELECT_ALL, |
| | |
| | | }, |
| | | |
| | | renderIcon: { |
| | | type: Function as PropType<(params: Recordable) => string>, |
| | | type: Function as PropType<(...params: any[]) => string>, |
| | | }, |
| | | |
| | | helpMessage: { |
| | |
| | | type: [Array, Object] as PropType<CheckKeys>, |
| | | default: () => [], |
| | | }, |
| | | |
| | | |
| | | halfCheckedKeys: { |
| | | type: Array as PropType<CheckKeys>, |
| | | type: [Array, Object] as PropType<KeyType[]>, |
| | | default: () => [], |
| | | }, |
| | | |
| | | beforeRightClick: { |
| | | type: Function as PropType<(...arg: any) => ContextMenuItem[] | ContextMenuOptions>, |
| | | type: Function as PropType<(...arg: any) => Promise<ContextMenuItem[] | ContextMenuOptions>>, |
| | | default: undefined, |
| | | }, |
| | | |
| | |
| | | |
| | | export interface InsertNodeParams { |
| | | parentKey: string | null; |
| | | node: TreeDataItem; |
| | | node?: TreeDataItem; |
| | | list?: TreeDataItem[]; |
| | | push?: 'push' | 'unshift'; |
| | | } |
| | | |
| | | export interface TreeActionType { |
| | | getTreeData: () => TreeDataItem[]; |
| | | checkAll: (checkAll: boolean) => void; |
| | | expandAll: (expandAll: boolean) => void; |
| | | setExpandedKeys: (keys: KeyType[]) => void; |
| | |
| | | filterByLevel: (level: number) => void; |
| | | insertNodeByKey: (opt: InsertNodeParams) => void; |
| | | insertNodesByKey: (opt: InsertNodeParams) => void; |
| | | deleteNodeByKey: (key: string) => void; |
| | | deleteNodeByKey: (key: string, list?: TreeDataItem[]) => void; |
| | | updateNodeByKey: (key: string, node: Omit<TreeDataItem, 'key'>) => void; |
| | | setSearchValue: (value: string) => void; |
| | | getSearchValue: () => string; |