Ben Lin
2024-10-22 78999ce1626d2a786f3a705281eeba79c2f1d6dd
src/components/Tree/src/types/tree.ts
@@ -1,7 +1,7 @@
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,
@@ -48,7 +48,7 @@
  },
  renderIcon: {
    type: Function as PropType<(params: Recordable) => string>,
    type: Function as PropType<(...params: any[]) => string>,
  },
  helpMessage: {
@@ -105,14 +105,14 @@
    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,
  },
@@ -173,12 +173,13 @@
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;
@@ -190,7 +191,7 @@
  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;