// 数电的开票
import ProTable, { ActionType } from "@ant-design/pro-table";
import { FormInstance } from "antd";
import { useRef } from "react";
import { connect } from "umi";



const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
    const actionRef = useRef<ActionType>();
    const formRef = useRef<FormInstance>();

    const columns: any = []

    return (
        <div>
            <ProTable
                actionRef={actionRef}
                formRef={formRef}
                columns={columns}
                bordered
                expandable={{
                    expandRowByClick: true
                }}
                rowKey={(record) => {
                    return `${record?.id}`
                }}
                scroll={{ x: "100%", y: 'calc(100vh - 400px)' }}
                headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>待开票列表</span>}
                search={{ span: 6 }}
                request={async (params: any) => {

                    if (tableData.list && tableData.list.length > 0) {
                        return {
                            data: tableData.list,
                            success: true,
                            total: tableData.total,  // 总数据条数
                            current: tableData.pageNo, // 当前页码
                            pageSize: tableData.pageSize, // 每页条数
                        }
                    }
                    return { data: [], success: true }
                }}
            />
        </div>
    )
}


export default connect(({ user }: ConnectState) => ({
    currentUser: user.data
}))(DigitalElectronics);