<template>
  <!-- 定投流水查询 -->
  <div class="platinum_fixed_investment_flow_query">
    <Filter @search="updateColumn" />
    <contextMenu :contextMenuList="firstBtn">
      <a-table :columns="columns"
               class="srcollYTable"
               :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
               :pagination="false"
               :expandedRowKeys="expandedRowKeys"
               :customRow="Rowclick"
               rowKey="key"
               :data-source="tableList">
        <template #triggerstatus="{ record }">
          <a>{{ record.triggerstatus === 1 ? "成功" : "失败" }}</a>
        </template>
      </a-table>
    </contextMenu>
  </div>
</template>

<script lang="ts">
import { defineComponent, initData, getTableColumns, getTableEvent, contextMenu, queryTableList, BtnList, _getBtnList } from '@/common/export/table';
import { queryRSTriggerLog } from '@/services/go/ermcp/qhj';
import { QhjRSTriggerLog } from '@/services/go/ermcp/qhj/interface';
import Filter from './compoments/filter/index.vue';

export default defineComponent({
    name: 'platinum_fixed_investment_flow_query',
    components: { Filter, contextMenu, BtnList },
    setup() {
        // 表头数据
        const { columns, registerColumn, updateColumn } = getTableColumns();
        // 表格事件
        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<QhjRSTriggerLog>({});
        // 表格操作按钮列表
        const [firstBtn] = _getBtnList('platinum_fixed_investment_flow_query', false).value;
        // 表格列表数据
        const { loading, tableList, queryTable } = queryTableList<QhjRSTriggerLog>();
        initData(() => {
            // 获取列表数据
            queryTable(queryRSTriggerLog);
            // 注册表头信息 过滤
            registerColumn('table_pcweb_qhj_fixed_investment_flow_query', ['goodsid', 'accountid', 'triggertime']);
        });

        return {
            columns,

            expandedRowKeys,
            selectedRow,
            Rowclick,
            firstBtn,
            loading,
            tableList,
            updateColumn,
            queryTable,
            btnClick,
        };
    },
});
</script>