<!-- 会员中心-我的出入金 -->
<template>
    <app-view>
        <template #header>
            <app-filter v-bind="{ selectList, buttonList }" />
        </template>
        <app-table :data="dataList" v-model:columns="columns" :loading="loading">
            <template #header>
                <app-auth-operation :menus="['deposit', 'withdraw']" @closed="getAccountInOutApply" />
            </template>
            <!-- 申请状态 -->
            <template #applystatus="{ value }">
                {{ getApplyStatusName(value) }}
            </template>
            <!-- 申请类型 -->
            <template #executetype="{ value }">
                {{ getExecuteTypeName(value) }}
            </template>
            <!-- 操作 -->
            <template #operate="{ row }">
                <app-auth-operation :menus="['cancel']" :options="{ selectedRow: row }"
                    @closed="getAccountInOutApply" />
            </template>
        </app-table>
    </app-view>
</template>

<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { useAccountInOut } from '@/business/bank'
import { getApplyStatusName, getExecuteTypeName } from '@/constants/bank'
import AppTable from '@pc/components/base/table/index.vue'
import AppFilter from '@pc/components/base/table-filter/index.vue'
import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'

const { dataList, columns, selectList, buttonList, loading, getAccountInOutApply } = useAccountInOut()

getAccountInOutApply().catch((err) => ElMessage.error(err))
</script>