<template>
  <!-- 资金汇总 -->
  <mtp-table-scroll>
    <template #default="{ scroll }">
      <a-table :columns="getColumns()" class="srcollYTable" :scroll="scroll" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :expandIcon="expandIcon" :expandIconAsCell="false" :rowKey="(record,index)=>index" :data-source="tradeAccountList"></a-table>
    </template>
  </mtp-table-scroll>
  <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
</template>

<script lang="ts">
import MtpTableScroll from '@/common/components/tableScroll/index.vue';
import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
import { BtnList, defineComponent } from '@/common/export/commonTable';
import { getRecordItemTab } from '@/common/setup/order/orderData';
import { expandIcon } from '@/common/setup/table/clolumn';
import { handleComposeOrderTable } from '@/common/setup/table/compose';
import { ComposeOrderTableParam } from '@/common/setup/table/interface';
import { Taaccount } from '@/services/go/TaAccount/interface';
import { getColumns } from './setup';
import { useTradeAccount } from '@/hooks/account';

export default defineComponent({
  name: enumOrderComponents.funding_information_funding_summary,
  components: {
    MtpTableScroll,
    BtnList,
  },
  setup() {
    const { loading, tradeAccountList } = useTradeAccount();

    // 表格通用逻辑
    const param: ComposeOrderTableParam = {
      queryFn: () => { },
      recordList: getRecordItemTab(),
    };

    return {
      ...handleComposeOrderTable<Taaccount>(param),
      loading,
      tradeAccountList,
      expandIcon,
      getColumns,
    };
  },
});
</script>