picturesWall.js 1.1 KB

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