<template>
    <!--  单据记录 预售仓单 委托记录 -->
    <div class="topTableHeight">
        <a-table
            :columns="columns"
            class="srcollYTable expandLeftTable"
            :scroll="{ x: '100%', y: '190px' }"
            :pagination="false"
            :loading="loading"
            :expandedRowKeys="expandedRowKeys"
            :customRow="Rowclick"
            :expandIcon="expandIcon"
            :expandIconAsCell="false"
            rowKey="key"
            :data-source="tableList"
        >
            <!--  委托状态-->
            <template #wrtradeorderstatus="{ record }">
                <a>{{ getWrTradeOrderStatusName(record.wrtradeorderstatus) }}</a>
            </template>
            <!-- 挂牌类型 -->
            <template #wrtradetype="{ record }">
                <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
            </template>
        </a-table>
    </div>
</template>

<script lang="ts">
import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
import { queryTableList, BtnList, defineAsyncComponent, defineComponent, ModalEnum } from '@/common/export/commonTable';
import { queryWrOrderDetail } from '@/services/go/wrtrade';
import { QueryWrOrderDetailReq, WrOrderDetail } from '@/services/go/wrtrade/interface';
import { getRecordItemTab } from '@/common/setup/order/orderData';
import { handleComposeOrderTable } from '@/common/setup/table/compose';
import { ComposeOrderTableParam } from '@/common/setup/table/interface';
import { getWrOrderTypeName, getWrTradeOrderStatusName } from '@/common/constants/enumsName';
import { BtnListType } from '@/common/components/btnList/interface';
import { expandIcon } from '@/common/setup/table/clolumn';
import { EnumRouterName } from '@/common/constants/enumRouterName';

export default defineComponent({
    name: EnumRouterName.search_pre_sale_warehouse_receipt_commission_record,
    setup() {
        // 表格列表数据
        const { loading, tableList, queryTable } = queryTableList<WrOrderDetail>();
        // 获取列表数据
        const queryTableAction = () => {
            const param: QueryWrOrderDetailReq = {
                haswr: 0,
            };
            queryTable(queryWrOrderDetail, param);
        };
        // 表格通用逻辑
        const param: ComposeOrderTableParam = {
            queryFn: queryTableAction,
            tableName: 'table_pcweb_spot_trade_bottom_pre_sale_pending_order',
            recordList: getRecordItemTab(),
        };
        return {
            ...handleComposeOrderTable<WrOrderDetail>(param),
            loading,
            tableList,
            expandIcon,
            getWrTradeOrderStatusName,
            getWrOrderTypeName,
        };
    },
});
</script>

<style lang="less">
</style>;
