1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 20:01:10 +00:00

change weixin department style (#3897)

This commit is contained in:
Michael An
2019-07-23 17:48:15 +08:00
committed by Daniel Pan
parent 6f2c6ae16d
commit e2e90770f6
2 changed files with 22 additions and 5 deletions

View File

@@ -50,8 +50,9 @@
position: absolute; position: absolute;
top: 20%; top: 20%;
left: 0.3rem; left: 0.3rem;
color: silver;
} }
.tree-node-inner:hover { .tree-node-inner-hover {
background-color: #FFEFB2; background-color: #FFEFB2;
border-radius: 0.25rem; border-radius: 0.25rem;
cursor: pointer; cursor: pointer;
@@ -61,6 +62,14 @@
border-radius: 4px; border-radius: 4px;
background-color: #feac74 !important; background-color: #feac74 !important;
} }
.tree-node-hight-light i {
color: #fff;
}
.tree-node-hight-light .attr-action-icon,
.tree-node-hight-light .attr-action-icon:focus,
.tree-node-hight-light .attr-action-icon:hover {
color: #fff !important;
}
.tree-node-text { .tree-node-text {
padding-left: 1.3rem; padding-left: 1.3rem;
width: calc(100% - 1.3rem); width: calc(100% - 1.3rem);

View File

@@ -32,7 +32,8 @@ class WorkWeixinDepartmentsTreeNode extends Component {
}); });
}; };
dropdownToggle = () => { dropdownToggle = (e) => {
e.stopPropagation();
this.setState({ dropdownOpen: !this.state.dropdownOpen }); this.setState({ dropdownOpen: !this.state.dropdownOpen });
}; };
@@ -41,9 +42,15 @@ class WorkWeixinDepartmentsTreeNode extends Component {
}; };
onMouseLeave = () => { onMouseLeave = () => {
if (this.state.dropdownOpen) return;
this.setState({ active: false }); this.setState({ active: false });
}; };
importDepartmentDialogToggle = (depart) => {
this.setState({ active: false });
this.props.importDepartmentDialogToggle(depart);
}
componentDidMount() { componentDidMount() {
if (this.props.index === 0) { if (this.props.index === 0) {
this.setState({ isChildrenShow: true }); this.setState({ isChildrenShow: true });
@@ -61,7 +68,7 @@ class WorkWeixinDepartmentsTreeNode extends Component {
isChildrenShow={this.state.isChildrenShow} isChildrenShow={this.state.isChildrenShow}
onChangeDepartment={this.props.onChangeDepartment} onChangeDepartment={this.props.onChangeDepartment}
checkedDepartmentId={this.props.checkedDepartmentId} checkedDepartmentId={this.props.checkedDepartmentId}
importDepartmentDialogToggle={this.props.importDepartmentDialogToggle} importDepartmentDialogToggle={this.importDepartmentDialogToggle}
/> />
); );
}); });
@@ -76,6 +83,7 @@ class WorkWeixinDepartmentsTreeNode extends Component {
}); });
let nodeInnerClass = classNames({ let nodeInnerClass = classNames({
'tree-node-inner': true, 'tree-node-inner': true,
'tree-node-inner-hover': this.state.active,
'tree-node-hight-light': checkedDepartmentId === department.id 'tree-node-hight-light': checkedDepartmentId === department.id
}); });
return ( return (
@@ -92,7 +100,7 @@ class WorkWeixinDepartmentsTreeNode extends Component {
{isPro && {isPro &&
<Dropdown <Dropdown
isOpen={this.state.dropdownOpen} isOpen={this.state.dropdownOpen}
toggle={this.dropdownToggle} toggle={(e) => this.dropdownToggle(e)}
direction="down" direction="down"
style={this.state.active ? {} : { opacity: 0 }} style={this.state.active ? {} : { opacity: 0 }}
> >
@@ -106,7 +114,7 @@ class WorkWeixinDepartmentsTreeNode extends Component {
</DropdownToggle> </DropdownToggle>
<DropdownMenu className="drop-list" right={true}> <DropdownMenu className="drop-list" right={true}>
<DropdownItem <DropdownItem
onClick={this.props.importDepartmentDialogToggle.bind(this, department)} onClick={this.importDepartmentDialogToggle.bind(this, department)}
id={department.id} id={department.id}
>{'导入部门'}</DropdownItem> >{'导入部门'}</DropdownItem>
</DropdownMenu> </DropdownMenu>