messageDesc.jsx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import React from 'react';
  2. import { Modal } from 'antd';
  3. import NewForm from '@/administration/messagePush/messagePhoto/messageForm';
  4. import NewDetaiel from '@/administration/messagePush/messagePhoto/messageDetails';
  5. class DemandDesc extends React.Component {
  6. constructor(props) {
  7. super(props);
  8. this.state = {
  9. loading: false,
  10. pictureUrl: [],
  11. showState:false
  12. };
  13. }
  14. handleCancel() {
  15. this.setState({
  16. visible: false,
  17. });
  18. this.props.closeDesc(false, false);
  19. }
  20. handOk() {
  21. this.setState({
  22. visible: false,
  23. });
  24. this.props.closeDesc(false, true);
  25. }
  26. componentWillReceiveProps(nextProps) {
  27. this.state.visible = nextProps.showDesc;
  28. }
  29. render() {
  30. let data = this.props.data || [];
  31. return (
  32. <div className="patent-desc">
  33. <Modal
  34. maskClosable={false}
  35. visible={this.state.visible}
  36. onOk={this.handOk.bind(this)}
  37. onCancel={this.handleCancel.bind(this)}
  38. width="400px"
  39. title={!data.id ? '新建消息' : '消息详情'}
  40. footer=""
  41. className="admin-desc-content"
  42. >
  43. <div>
  44. <div>
  45. {data.isSend?
  46. <NewDetaiel
  47. closeDesc={this.handleCancel.bind(this)}
  48. data={this.props.data}
  49. visible={this.state.visible}
  50. handOk={this.handOk.bind(this)}
  51. />
  52. :
  53. <NewForm
  54. closeDesc={this.handleCancel.bind(this)}
  55. data={this.props.data}
  56. visible={this.state.visible}
  57. handOk={this.handOk.bind(this)}
  58. />
  59. }
  60. </div>
  61. </div>
  62. </Modal>
  63. </div>
  64. );
  65. }
  66. }
  67. export default DemandDesc;