import React, { useState, useEffect } from 'react';
import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, notification } from 'antd';
import moment from 'moment';
import request from '../../../utils/request';
import apis from '../../../services/apis';
import { router } from 'umi';

import SealList from './components/SealList'
import Authorize from './components/Authorize'



const { Option } = Select
const { TabPane } = Tabs;

const formItemLayout = {
  labelCol: {
    xs: { span: 24 },
    sm: { span: 2 },
  },
  wrapperCol: {
    xs: { span: 24 },
    sm: { span: 16 },
  },
};

function openNotificationWithIcon(type, message) {
  notification[type]({
    message,
    description:
      '',
  });
}

function EditHouse(props) {
  const [tab, setTab] = useState('sealList')
  const companyId = props.location.query.id;
  function tabsCallback(e) {
    setTab(e)
  }

  // building 回调
  function buildingOnSuccess(e) {
    setBuildingData(e)
  }

  return (
    <>
      <Tabs type="card" value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
        <TabPane tab="印章列表" key="sealList" ></TabPane>
        <TabPane tab="自动签章授权" key="authorize" ></TabPane>
      </Tabs>
      <div style={{ marginTop: '20px' }}>
        { (tab === 'sealList' && <SealList companyId={companyId}/>)}
        { (tab === 'authorize' && <Authorize companyId={companyId}/>)}
      </div>
    </>
  )
}

const WrappedEditHouseForm = Form.create({ name: 'editHouse' })(EditHouse);

export default WrappedEditHouseForm
