
export function getSpotWarrantBargainColumns() {
    const columns = [
        { title: '挂牌方', key: 'matchusername', align: 'center', width: 120 },
        { title: '挂牌类型', key: 'buyorsell', align: 'center', width: 100 },
        { title: '品种', key: 'deliverygoodsname', align: 'center', width: 200 },
        { title: '商品', key: 'wrtypename', align: 'center', width: 400 },
        { title: '仓库', key: 'warehousename', align: 'center', width: 140 },
        { title: '价格', key: 'fixedprice', align: 'center' },
        { title: '数量', key: 'orderqty', align: 'center', width: 120 },
        // { title: '整单', key: 'canpart', align: 'center', width: 80 },
        { title: '挂牌有效期', key: 'validtime', align: 'center', width: 120 },
        { title: '履约保证金', key: 'marginvalue', align: 'center', width: 120 },
        { title: '履约模板', key: 'templatename', align: 'center', width: 160 },
        { title: '最新议价价格', key: 'applyprice', align: 'center', width: 120 },
        { title: '最新议价数量', key: 'applyqty', align: 'center', width: 120 },
        { title: '最新议价时间', key: 'applytime', align: 'center', width: 160 },
        { title: '最新议价状态', key: 'applystatus', align: 'center', width: 140 },
    ];
    return columns.map(el => {
        const slots = { customRender: el.key };
        return { ...el, slots, dataIndex: el.key };
    })
}

export function getSpotWarrantBargainDetailColumns(is: boolean) {
    const columns = [
        { title: '数量', key: 'applyqty', dataIndex: 'applyqty', align: 'center' },
        { title: '价格', key: 'applyprice', dataIndex: 'applyprice', align: 'center' },
        { title: '时间', key: 'applytime', dataIndex: 'applytime', align: 'center', slots: { customRender: 'applytime' } },
        { title: '状态', key: 'applystatus', dataIndex: 'applystatus', align: 'center', slots: { customRender: 'applystatus' } },
    ];
    function isMy() {
        return is
    }
    function getColums() {
        return isMy() ? columns : [...columns, { title: '议价人', key: 'username', dataIndex: 'username', align: 'center' }]
    }
    return { isMy, getColums }
}
