<!-- 比例查询 -->
<template>
    <app-view>
        <!-- 表格数据 -->
        <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
            <!-- 比例 -->
            <template #depositrate="{ value }">
                {{ parsePercent(value) }}
            </template>
            <!-- 操作 -->
            <template #operate="{ row }">
                <app-auth-operation :options="{ selectedRow: row }" />
            </template>
        </app-table>
    </app-view>
</template>

<script lang="ts" setup>
import { shallowRef } from 'vue'
import { ElMessage } from 'element-plus'
import { parsePercent } from '@/filters'
import { useRequest } from '@/hooks/request'
import { queryMyDeposit } from '@/services/api/common'
import AppTable from '@pc/components/base/table/index.vue'
import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'

const { loading, dataList } = useRequest(queryMyDeposit, {
    onError: (err) => {
        ElMessage.error(err)
    }
})

const tableColumns = shallowRef<Model.TableColumn[]>([
    { prop: 'depositrate', label: '比例' },
    { prop: 'depositqty', label: '剩余量' },
    { prop: 'operate', label: '操作', width: 160, fixed: 'right' }
])
</script>