import React, { useState, useEffect } from 'react';
import {
  Modal,
  Form,
  Select,
  Radio,
  Checkbox,
  Input,
  Row,
  Col,
  Button,
  InputNumber,
  Tree,
  Tooltip,
  Dropdown,
  message,
} from 'antd';
import Icon from '@/tenants-ui/SgIcon';
import styles from './index.less';
import cx from 'classnames';
import { useModel, history } from 'umi';
import { EllipsisOutlined } from '@ant-design/icons';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import AreaTree from '../areaTree';
import iconClose from '@/assets/images/page-person-import/close-icon.svg';

import moment from 'moment';
const importTitleIcon = require('@/assets/images/page-person-import/import-icon.svg');
import { queryUserInfo, saveUserInfo, deleteUser } from '@/services/sagacare_service/member';
import Uploader from './Uploader';

const ImportModal = ({ onClose, onUploadDone }) => {
  const { initialState } = useModel('@@initialState');

  return (
    <>
      <Modal open closable={false} footer={null} width={760}>
        <div className={styles.modalmain}>
          <div className={styles.header}>
            <div
              className={styles.close}
              onClick={() => {
                onClose();
              }}
            >
              <img src={iconClose} alt="" />
            </div>

            <div className={styles.title}>
              <img src={importTitleIcon} alt="" />
              <span>批量导入成员</span>
            </div>
          </div>
          <div className={styles.content}>
            <div className={styles.comTitle}>
              <span>1/</span>
              <span>下载表格模版，将需要导入的成员信息填入模版</span>
              <a
                href={`http://wechat.sagacloud.cn/saga/image/sagaManagerControl/成员导入模板.xls`}
                target="downloadFile"
                download
                rel="noreferrer"
              >
                下载表格模版
              </a>
            </div>
            <Uploader
              onUploadDone={(info) => {
                console.log(info);
                onUploadDone(info);
              }}
            />
          </div>
        </div>
      </Modal>
    </>
  );
};

export default ImportModal;
