<template>
  <!-- 提货查询 -->
  <section>
    <a-table :columns="columns"
             class="srcollYTable expandLeftTable"
             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
             :pagination="false"
             :loading="loading"
             :expandedRowKeys="expandedRowKeys"
             :customRow="Rowclick"
             :expandIcon="expandIcon"
             :expandIconAsCell="false"
             rowKey="key"
             :data-source="tableList">
      <!-- applytype 类型-->
      <template #applytype="{ record }">
        <span>{{ getPickUpStatusName(record.applytype) }}</span>
      </template>

      <!-- applystatus 状态 -->
      <template #applystatus="{ record }">
        <span>{{ getPickUpTypeName(record.applystatus) }}</span>
      </template>

    </a-table>
  </section>
</template>

<script lang="ts">
import { queryTableList, defineComponent } from '@/common/export/commonTable';
import { queryWrOutInApply } from '@/services/go/wrtrade';
import { WrOutInApply } 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';
import { getPickUpStatusName, getPickUpTypeName } from '@/common/constants/enumsName';
import { EnumRouterName } from '@/common/constants/enumRouterName';

export default defineComponent({
    name: EnumRouterName.search_pickup_query_tab,
    setup() {
        // 表格列表数据
        const { loading, tableList, queryTable } = queryTableList<WrOutInApply>();
        // 获取列表数据
        const queryTableAction = () => {
            queryTable(queryWrOutInApply);
        };
        // 表格通用逻辑
        const param: ComposeOrderTableParam = {
            queryFn: queryTableAction,
            tableName: 'table_pcweb_spot_trade_bottom_spot_warrant_pick_up',
            recordList: getRecordItemTab(),
        };
        return {
            ...handleComposeOrderTable<WrOutInApply>(param),
            loading,
            tableList,
            expandIcon,
            getPickUpStatusName,
            getPickUpTypeName,
        };
    },
});
</script>

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