import React, { useState, useEffect } from 'react';
import { Col, Row, Button, Modal } from 'antd'
import { router } from 'umi';
import ZmageImg from '../../../components/ZmageImg/ZmageImg'
import request from '../../../utils/request';
import apis from '../../../services/apis';


function body (props) {
  const documentVerifyId = props.location.query.id
  const [data, setData] = useState([])

  useEffect(() => {
    getList()
  }, [])
// , documentVerifyId: documentVerifyId
  function getList (_params) {
    // 网路请求
    console.log(props, '1111')
    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
      console.log('data:', data.imgList)
      setData(data.imgList)
    }).catch(_err => {
      // eslint-disable-next-line no-unused-expressions

    })
  }


  const cancelPage = () => {
    router.push({
      pathname: '/system/document/list',
    });
  }


  return (
    <>
      <div style={{ background: '#ECECEC', padding: '30px' }}>
        <Row gutter={16}>
          {
            // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
            data.map(item =>
              <Col span={6} key={item.documentImgId}>
               <ZmageImg style={{ width: '300px', height: '400px' }} src={item.img} />
              </Col>,
            )
          }
        </Row>
      </div>
      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>

        <Button onClick={cancelPage}>返回</Button>

      </div>


    </>
  )
}

export default body
