diff --git a/.umirc.ts b/.umirc.ts index a997f8a..25a176a 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -2,7 +2,7 @@ * @Author: Chengliang 1546584672@qq.com * @Date: 2022-08-04 10:22:55 * @LastEditors: Chengliang 1546584672@qq.com - * @LastEditTime: 2022-12-02 11:42:11 + * @LastEditTime: 2022-12-02 16:08:52 * @FilePath: /org-chart-frant/.umirc.ts * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -26,7 +26,7 @@ export default defineConfig({ proxy: { '/api': { // 标识需要进行转换的请求的url - target: 'http://192.168.0.152:8093/api', // 服务端域名 / http://localhost:8686 + target: 'http://192.168.0.152:8093//api', // 服务端域名 / http://localhost:8686 changeOrigin: true, // 允许域名进行转换 pathRewrite: { '^/api': '' }, // 将请求url里的ci去掉 }, diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 4844ee6..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx index 433eada..0be3406 100644 --- a/src/components/topBar/index.jsx +++ b/src/components/topBar/index.jsx @@ -23,6 +23,7 @@ export class TopBar extends React.Component { this.state = { fclasslist: [], companylist: [], //下拉框跟节点 + treeExpandedKeys: [], companyData: [], departmentData: [], companyTreeData: [], @@ -127,6 +128,7 @@ export class TopBar extends React.Component { requestData, departmentData: [], deptartmentTreeData: [], + treeExpandedKeys: [], }); this.getDepartmentTreeList(company); }; @@ -170,6 +172,12 @@ export class TopBar extends React.Component { return arr.join(','); }; + onTreeExpand = (expandedKeys) => { + this.setState({ + treeExpandedKeys: expandedKeys, + }); + }; + componentDidMount() { fetch(this.props.url) .then((res) => res.json()) @@ -199,7 +207,8 @@ export class TopBar extends React.Component { ); render() { - const { companyTreeData, deptartmentTreeData } = this.state; + const { companyTreeData, deptartmentTreeData, treeExpandedKeys } = + this.state; return (