picModal.jsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from "react";
  2. import { Spin, Button, Tabs, Table, message, Modal } from "antd";
  3. const ShowModal = React.createClass({
  4. getInitialState() {
  5. return {
  6. newVisible: false,
  7. };
  8. },
  9. componentWillReceiveProps(nextProps) {
  10. this.setState({
  11. newVisible: nextProps.ShowModal,
  12. });
  13. },
  14. handleOk() {
  15. this.setState({
  16. newVisible: false,
  17. });
  18. // window.setTimeout( () => {
  19. // this.setState({
  20. // newVisible: true
  21. // });
  22. // },)
  23. },
  24. render() {
  25. return (
  26. <div>
  27. {this.props.picUrl.map(item => {
  28. <Upload
  29. className="demandDetailShow-upload"
  30. listType="picture-card"
  31. fileList={
  32. item
  33. ? splitUrl(
  34. item,
  35. ",",
  36. globalConfig.avatarHost + "/upload"
  37. )
  38. : []
  39. }
  40. onPreview={(file) => {
  41. this.setState({
  42. previewImage: file.url || file.thumbUrl,
  43. previewVisible: true,
  44. });
  45. }}
  46. />;
  47. })}
  48. </div>
  49. );
  50. },
  51. });
  52. export default ShowModal;