2025-11-03 16:50:34 +08:00
|
|
|
|
import type { TreeSelectProps } from "antd/es/tree-select";
|
|
|
|
|
|
import type { FC } from "react";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 组件属性
|
|
|
|
|
|
*/
|
|
|
|
|
|
export interface BasicSelectTreeProps extends TreeSelectProps {
|
|
|
|
|
|
/** 树形数据 label 字段,默认 name */
|
|
|
|
|
|
nameKey?: string;
|
|
|
|
|
|
/** 树形数据 value 字段,默认 id */
|
|
|
|
|
|
idKey?: string;
|
|
|
|
|
|
/** 树形数据 children 字段,默认 childrenList */
|
|
|
|
|
|
childrenKey?: string;
|
|
|
|
|
|
/** 决定 onGetNodePaths 是否包含自身节点,默认 true */
|
|
|
|
|
|
onGetNodePathsIsIncludeOneself?: boolean;
|
|
|
|
|
|
/** 获取父级节点 */
|
|
|
|
|
|
onGetNodePaths?: (nodes: Record<string, any>[]) => void;
|
2025-11-06 09:38:23 +08:00
|
|
|
|
/** 占位符 */
|
|
|
|
|
|
placeholder?: string;
|
2025-11-06 14:31:25 +08:00
|
|
|
|
/** 控制只能选择到第几级 */
|
|
|
|
|
|
level?: number;
|
2025-11-03 16:50:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 基础下拉树组件(不建议直接使用此组件,二次继承使用)
|
|
|
|
|
|
*/
|
|
|
|
|
|
declare const BasicSelectTree: FC<BasicSelectTreeProps>;
|
|
|
|
|
|
|
2025-11-06 14:31:25 +08:00
|
|
|
|
export default BasicSelectTree;
|