import React from "react";
import { Spin, Button, Tabs, Table, message, Modal } from "antd";

const ShowModal = React.createClass({
  getInitialState() {
    return {
      newVisible: false,
    };
  },
  componentWillReceiveProps(nextProps) {
    this.setState({
      newVisible: nextProps.ShowModal,
    });
  },
  handleOk() {
    this.setState({
      newVisible: false,
    });
    // window.setTimeout( () => {
    //   this.setState({
    //     newVisible: true
    //   });
    // },)
  },
  render() {
    return (
      <div>
          {this.props.picUrl.map(item => {
              <Upload
                className="demandDetailShow-upload"
                listType="picture-card"
                fileList={
                  item
                    ? splitUrl(
                        item,
                        ",",
                        globalConfig.avatarHost + "/upload"
                      )
                    : []
                }
                onPreview={(file) => {
                  this.setState({
                    previewImage: file.url || file.thumbUrl,
                    previewVisible: true,
                  });
                }}
              />;
          })}
      </div>
    );
  },
});

export default ShowModal;
