增加IndustrySelectTree和IndustryCascader

master
LiuJiaNan 2025-11-21 09:02:03 +08:00
parent e2298ec8f2
commit 79e6a81ab0
5 changed files with 82 additions and 0 deletions

17
components/Cascader/Industry/index.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
import type { FC } from "react";
import type { BasicCascaderProps } from "../Basic";
/**
*
*/
export interface IndustryCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> {
/** 占位符,默认为"行业类型" */
placeholder?: string;
}
/**
*
*/
declare const IndustryCascader: FC<IndustryCascaderProps>;
export default IndustryCascader;

View File

@ -0,0 +1,20 @@
import Industry from "../../../json/industry.json";
import BasicCascader from "../Basic";
/**
* 行业类型级联组件
*/
function IndustryCascader(props) {
const {
placeholder = "行业类型",
...restProps
} = props;
return (
<BasicCascader data={Industry} placeholder={placeholder} nameKey="dict_label" idKey="dict_value" childrenKey="childrenList" {...restProps} />
);
}
IndustryCascader.displayName = "IndustryCascader";
export default IndustryCascader;

View File

@ -0,0 +1,17 @@
import type { FC } from "react";
import type { BasicSelectTreeProps } from "../Basic";
/**
*
*/
export interface IndustrySelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> {
/** 占位符,默认"行业类型" */
placeholder?: string;
}
/**
*
*/
declare const IndustrySelectTree: FC<IndustrySelectTreeProps>;
export default IndustrySelectTree;

View File

@ -0,0 +1,27 @@
import Industry from "../../../json/industry.json";
import BasicSelectTree from "../Basic";
/**
* 行业类型下拉树组件
*/
function IndustrySelectTree(props) {
const {
placeholder = "行业类型",
...restProps
} = props;
return (
<BasicSelectTree
treeData={Industry}
placeholder={placeholder}
nameKey="dict_label"
idKey="dict_value"
childrenKey="childrenList"
{...restProps}
/>
);
}
IndustrySelectTree.displayName = "IndustrySelectTree";
export default IndustrySelectTree;

1
json/industry.json Normal file

File diff suppressed because one or more lines are too long