33 lines
730 B
JavaScript
33 lines
730 B
JavaScript
import { request } from "@cqsjjb/jjb-common-lib/http";
|
|
import { useEffect, useState } from "react";
|
|
import BasicLeftTree from "../../Basic";
|
|
|
|
/**
|
|
* 部门左侧树组件(港务局版本)
|
|
*/
|
|
function DepartmentSelectTree(props) {
|
|
const {
|
|
params = {},
|
|
...restProps
|
|
} = props;
|
|
|
|
const [treeData, setTreeData] = useState([]);
|
|
|
|
const getData = async () => {
|
|
const { data } = await request("/basic-info/department/listTree", "post", params);
|
|
setTreeData(data);
|
|
};
|
|
|
|
useEffect(() => {
|
|
getData();
|
|
}, []);
|
|
|
|
return (
|
|
<BasicLeftTree treeData={treeData} placeholder="部门" {...restProps} />
|
|
);
|
|
}
|
|
|
|
DepartmentSelectTree.displayName = "DepartmentSelectTree";
|
|
|
|
export default DepartmentSelectTree;
|