<template>
  <!--  单据记录 预售仓单 成交记录 -->
  <mtp-table-scroll>
    <template #default="{ scroll }">
      <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :pagination="false" :loading="loading" :customRow="Rowclick" :rowKey="(record, index) => index" :data-source="tableList"></a-table>
    </template>
  </mtp-table-scroll>
</template>

<script lang="ts">
import MtpTableScroll from '@/common/components/tableScroll/index.vue';
import { queryTableList, defineComponent } from '@/common/export/commonTable';
import { queryWrTradeDetail } from '@/services/go/wrtrade';
import { QueryWrSpecialMatchOrderReq, WrSpecialMatchOrder } 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 { expandIcon } from '@/common/setup/table/clolumn';

export default defineComponent({
  components: {
    MtpTableScroll
  },
  setup() {
    // 表格列表数据
    const { loading, tableList, queryTable } = queryTableList<WrSpecialMatchOrder>();

    // 获取列表数据
    const queryTableAction = () => {
      const param: QueryWrSpecialMatchOrderReq = {
        haswr: 0,
      };
      queryTable(queryWrTradeDetail, param);
    }

    // 表格通用逻辑
    const param: ComposeOrderTableParam = {
      queryFn: queryTableAction,
      tableName: 'table_pcweb_spot_trade_bottom_pre_sale_make_deal',
      recordList: getRecordItemTab(),
    }

    return {
      ...handleComposeOrderTable<WrSpecialMatchOrder>(param),
      loading,
      tableList,
      expandIcon,
    }
  }
})
</script>