33 lines
701 B
JavaScript
33 lines
701 B
JavaScript
|
|
import { request } from "@cqsjjb/jjb-common-lib/http";
|
|||
|
|
import { useEffect, useState } from "react";
|
|||
|
|
import BasicLeftTree from "../../Basic";
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 部门左侧树组件(港务局版本)
|
|||
|
|
*/
|
|||
|
|
function DepartmentLeftTree(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} {...restProps} />
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
DepartmentLeftTree.displayName = "DepartmentLeftTree";
|
|||
|
|
|
|||
|
|
export default DepartmentLeftTree;
|