Ben Lin
2024-05-01 4a1a5b96689ce49cba56f7b668d73ed5edc7ff2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export type tableColumn = Record<string, string>;
export interface State {
  /** 组件实例 */
  transferRef: any;
  /** 显示在右侧框数据的 key 集合 */
  targetKeys: string[];
  originTargetKeys: string[];
  /** 数据源,其中的数据将会被渲染到左边一栏 */
  dataSource: TransferData[];
  /** 往父级组件传递的数据 */
  emitKeys: string[];
  leftColumns: TableColumns[];
  rightColumns: TableColumns[];
  /** 编辑 key */
  editKey: string[];
  titles: string[];
}
 
export interface TransferData {
  key: string;
  title: string;
  description: string;
  disabled: boolean;
}
 
export interface UseTreeTransfer {
  state: State;
  /** 穿梭更改 */
  onChange: (targetKeys: string[], direction: string) => void;
  seDatas: (
    titles: string[],
    dataSource: TransferData[],
    targetKeys: string[],
    rightColumns: [],
    leftColumns: [],
  ) => void;
}
 
export interface TransferProps {
  /** 组件实例 */
  transferRef: any;
  dataSource: TransferData[];
  /** 编辑 key */
  editKey: string[];
  leftColumns: TableColumns[];
  rightColumns: TableColumns[];
  titles: string[];
}
 
export interface TableColumns {
  dataIndex: string;
  title: string;
}