|
|
@ -23,6 +23,7 @@ export class TopBar extends React.Component {
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
fclasslist: [],
|
|
|
|
fclasslist: [],
|
|
|
|
companylist: [], //下拉框跟节点
|
|
|
|
companylist: [], //下拉框跟节点
|
|
|
|
|
|
|
|
treeExpandedKeys: [],
|
|
|
|
companyData: [],
|
|
|
|
companyData: [],
|
|
|
|
departmentData: [],
|
|
|
|
departmentData: [],
|
|
|
|
companyTreeData: [],
|
|
|
|
companyTreeData: [],
|
|
|
@ -127,6 +128,7 @@ export class TopBar extends React.Component {
|
|
|
|
requestData,
|
|
|
|
requestData,
|
|
|
|
departmentData: [],
|
|
|
|
departmentData: [],
|
|
|
|
deptartmentTreeData: [],
|
|
|
|
deptartmentTreeData: [],
|
|
|
|
|
|
|
|
treeExpandedKeys: [],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.getDepartmentTreeList(company);
|
|
|
|
this.getDepartmentTreeList(company);
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -170,6 +172,12 @@ export class TopBar extends React.Component {
|
|
|
|
return arr.join(',');
|
|
|
|
return arr.join(',');
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onTreeExpand = (expandedKeys) => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
treeExpandedKeys: expandedKeys,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
fetch(this.props.url)
|
|
|
|
fetch(this.props.url)
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => res.json())
|
|
|
@ -199,7 +207,8 @@ export class TopBar extends React.Component {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { companyTreeData, deptartmentTreeData } = this.state;
|
|
|
|
const { companyTreeData, deptartmentTreeData, treeExpandedKeys } =
|
|
|
|
|
|
|
|
this.state;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={style.topbarWrapper}>
|
|
|
|
<div className={style.topbarWrapper}>
|
|
|
@ -248,6 +257,7 @@ export class TopBar extends React.Component {
|
|
|
|
treeDataSimpleMode
|
|
|
|
treeDataSimpleMode
|
|
|
|
treeCheckable
|
|
|
|
treeCheckable
|
|
|
|
treeCheckStrictly
|
|
|
|
treeCheckStrictly
|
|
|
|
|
|
|
|
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
|
|
style={{ width: '80%' }}
|
|
|
|
style={{ width: '80%' }}
|
|
|
|
value={this.state.companyData}
|
|
|
|
value={this.state.companyData}
|
|
|
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
|
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
|
@ -265,6 +275,8 @@ export class TopBar extends React.Component {
|
|
|
|
allowClear
|
|
|
|
allowClear
|
|
|
|
treeDataSimpleMode
|
|
|
|
treeDataSimpleMode
|
|
|
|
treeCheckable
|
|
|
|
treeCheckable
|
|
|
|
|
|
|
|
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
|
|
|
|
|
|
treeExpandedKeys={treeExpandedKeys}
|
|
|
|
treeCheckStrictly
|
|
|
|
treeCheckStrictly
|
|
|
|
style={{ width: '80%' }}
|
|
|
|
style={{ width: '80%' }}
|
|
|
|
value={this.state.departmentData}
|
|
|
|
value={this.state.departmentData}
|
|
|
@ -273,6 +285,7 @@ export class TopBar extends React.Component {
|
|
|
|
onChange={this.onDepartmentChange}
|
|
|
|
onChange={this.onDepartmentChange}
|
|
|
|
loadData={this.onDepartmentLoadData}
|
|
|
|
loadData={this.onDepartmentLoadData}
|
|
|
|
treeData={deptartmentTreeData}
|
|
|
|
treeData={deptartmentTreeData}
|
|
|
|
|
|
|
|
onTreeExpand={this.onTreeExpand}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|