bannerDes.jsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import React from 'react';
  2. import { Modal, Spin } from 'antd';
  3. import BannerForm from '@/administration/banner/bannerForm';
  4. class DemandDesc extends React.Component {
  5. constructor(props) {
  6. super(props);
  7. this.state = {
  8. loading: false,
  9. pictureUrl: [],
  10. showState:false
  11. };
  12. }
  13. handleCancel() {
  14. this.setState({
  15. visible: false,
  16. });
  17. this.props.closeDesc(false, false);
  18. }
  19. handOk() {
  20. this.setState({
  21. visible: false,
  22. });
  23. this.props.closeDesc(false, true);
  24. }
  25. componentWillReceiveProps(nextProps) {
  26. this.state.visible = nextProps.showDesc;
  27. }
  28. render() {
  29. let data = this.props.data || {releaseStatus:0};
  30. return (
  31. <div className="patent-desc">
  32. <Modal
  33. maskClosable={false}
  34. visible={this.state.visible}
  35. onOk={this.handOk.bind(this)}
  36. onCancel={this.handleCancel.bind(this)}
  37. width="600px"
  38. title={data.id?'修改轮播图':'新建轮播图'}
  39. footer=""
  40. className="admin-desc-content"
  41. >
  42. <div>
  43. <div>
  44. <BannerForm
  45. closeDesc={this.handleCancel.bind(this)}
  46. data={this.props.data}
  47. visible={this.state.visible}
  48. handOk={this.handOk.bind(this)}
  49. />
  50. </div>
  51. </div>
  52. </Modal>
  53. </div>
  54. );
  55. }
  56. }
  57. export default DemandDesc;