picturesWall.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import React, { Component } from "react";
  2. import { Modal, Icon, Upload } from "antd";
  3. import { timingSafeEqual } from "crypto";
  4. import ImgList from "../../../../common/imgList";
  5. class PicturesWall extends Component {
  6. constructor(props) {
  7. super(props);
  8. this.state = {
  9. fileList: this.props.pictureUrl
  10. };
  11. this.handleChange = this.handleChange.bind(this);
  12. }
  13. handleChange(info) {
  14. let fileList = info.fileList;
  15. this.setState({
  16. fileList
  17. });
  18. this.props.fileList(fileList);
  19. }
  20. componentWillReceiveProps(nextProps) {
  21. this.state.fileList = nextProps.pictureUrl;
  22. }
  23. render() {
  24. const { fileList } = this.state;
  25. const { orderNo = undefined, deleteApi = "", sign = "" } = this.props
  26. return (
  27. <div style={{ display: "inline-block" }}>
  28. <ImgList
  29. deleteApi={deleteApi}
  30. orderNo={orderNo}
  31. sign={sign}
  32. domId={this.props.domId}
  33. uploadConfig={{
  34. action: globalConfig.context + this.props.url,
  35. data: {
  36. orderNo: orderNo,
  37. sign: this.props.sign,
  38. },
  39. multiple: true,
  40. listType: "picture-card",
  41. }}
  42. onChange={(infor) => {
  43. this.handleChange(infor)
  44. }}
  45. fileList={fileList}
  46. />
  47. </div>
  48. );
  49. }
  50. }
  51. export default PicturesWall;