import React, { useEffect, useRef, useState } from "react";
import {
    Button,
    Tooltip,
    Row,
    Divider,
    Drawer,
    Table,
    Col,
    Steps,
    Card,
} from "antd";
import AutoTable from "@/components/AutoTable";
import { useRequest } from "umi";
import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch";
import Details from "@/components/Details";
import { gongyiDetail } from "@/utils/detailTotalCard";
import Coltext from "@/components/Coltext";
import DrawInitForm from "@/components/DrawInitForm";
import styles from "./index.less";
import {
    PlusSquareOutlined,
    MinusSquareOutlined,
    MinusCircleOutlined,
    ArrowDownOutlined,
    ArrowUpOutlined,
} from "@ant-design/icons";


function Instore(props) {
    const [activeTabKey, onTabChange] = useState("1");
    const [drawprops, setdrawprops] = useState({
        title: "",
        visible: false,
        onClose: () => {
            setdrawprops(s => ({
                ...s,
                visible: false,
            }))
        },
        fields: defaultFields
    });


    const tableprops = {
        ...props,
        addconfig: {
            premkey: "sysDepartment_save",
            btnprops: {},
            onClick: () => {
                setdrawprops(s => ({
                    ...s,
                    visible: true,
                    title: "新增",
                    width:600
                }))
            },
        },
        exportconfig: {
            premkey: "sysDepartment_save",
            btnprops: {
            },
            onClick: () => {
                alert(1)
            },
        },
        pageextra: activeTabKey == "1" ? "add" : "none",
        tabList: [
            {
                tab: "未完成",
                key: "1"
            }, {
                tab: "已完成",
                key: "2"
            }
        ],
        activeTabKey,
        onTabChange
    }


    return (
        <div>
            <AutoTable
                {
                ...tableprops
                }



            ></AutoTable>

            <DrawInitForm
                {...drawprops}
            />



        </div>
    );
}

export default Instore;