trunk/pc4mobx/organization/components/tree/side.js

44 lines
931 B
JavaScript
Raw Normal View History

2022-05-05 15:57:07 +08:00
import React from 'react';
import { WeaSlideModal } from 'ecCom';
import { Button } from 'antd';
export default class SidePage extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
data:{}
}
}
componentDidMount() {
this.props.onRef(this)
}
componentDidUpdate(prevProps, prevState) {
if (prevProps.data !== this.props.data) {
}
}
openSide = (data) => {
this.setState({ visible: true,
data:data})
}
render() {
const { visible,data } = this.state;
return (
<WeaSlideModal visible={visible}
top={20}
width={30}
height={70}
direction={'right'}
measure={'%'}
title={'详细信息'}
content={(<div>{JSON.stringify(data)}</div>)}
onClose={() => this.setState({ visible: false })}
onAnimationEnd={() => console.log('onAnimationEnd')} />
)
}
}