Commit b91fe379 authored by 单奇雲's avatar 单奇雲

优化代码

parent f0de9c50
...@@ -20,7 +20,7 @@ class PlanTreeView extends Component { ...@@ -20,7 +20,7 @@ class PlanTreeView extends Component {
componentDidMount() { componentDidMount() {
this.getPlanTree(); this.getPlanTree();
let viewSideDiv = document.getElementsByClassName('aaa')[0]; let viewSideDiv = document.getElementsByClassName('plan-tree')[0];
viewSideDiv && viewSideDiv.addEventListener('click', this.props.onRightCancel); viewSideDiv && viewSideDiv.addEventListener('click', this.props.onRightCancel);
} }
...@@ -134,7 +134,7 @@ class PlanTreeView extends Component { ...@@ -134,7 +134,7 @@ class PlanTreeView extends Component {
let { expandedKeys, selectedKeys, treeData,autoExpandParent } = this.state; let { expandedKeys, selectedKeys, treeData,autoExpandParent } = this.state;
let { activeKey, onRightClick } = this.props; let { activeKey, onRightClick } = this.props;
return ( return (
<div className='aaa'> <div className='plan-tree'>
<Tree <Tree
showIcon showIcon
expandedKeys={expandedKeys} expandedKeys={expandedKeys}
......
...@@ -138,12 +138,11 @@ class PublishView extends Component { ...@@ -138,12 +138,11 @@ class PublishView extends Component {
}); });
} }
} }
/////////////////////////////////////////////////////
// tree列表上右键事件 // tree列表上右键事件
onRightClick = e => { onRightClick = e => {
let { activeKey } = this.state; let { activeKey } = this.state;
if( activeKey === 'textPlan'){//文本预案添加发布,导出功能 if( activeKey === 'textPlan' && e.node.props.type === 'textNode'){//文本预案添加发布,导出功能 并为文本
console.log("asdfasdfasdf") console.log("asdfasdfasdf")
this.setState({ this.setState({
rightClickNodeTreeItem: { rightClickNodeTreeItem: {
...@@ -254,8 +253,6 @@ class PublishView extends Component { ...@@ -254,8 +253,6 @@ class PublishView extends Component {
}); });
} }
////////////////////////////////////////////
render() { render() {
const { activeKey,visible,animateDelay,shareVisible } = this.state; const { activeKey,visible,animateDelay,shareVisible } = this.state;
const animateProps = { const animateProps = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment