更新提现相关功能,新增已批准提现列表页面及路由,优化提现和待审核提现页面的数据获取逻辑,添加过滤功能

This commit is contained in:
tiezi
2025-12-18 20:29:42 +07:00
parent df876ffc3c
commit 609aceee16
12 changed files with 331 additions and 37 deletions

View File

@@ -1,56 +1,108 @@
<script lang="ts" setup>
import { h, ref, useTemplateRef } from 'vue';
import { NInputNumber, useDialog, useMessage } from 'naive-ui';
import { useTemplateRef } from 'vue';
import { NDatePicker, useDialog, useMessage } from 'naive-ui';
import { client, safeClient } from '@/service/api';
import { DepositTypeEnum } from '@/enum';
import type { TableBaseColumns, TableFetchData, TableInst } from '@/components/table';
const dialog = useDialog();
const message = useMessage();
const tableInst = useTemplateRef<TableInst>('tableInst');
const fetchData: TableFetchData = () => {
const fetchData: TableFetchData = ({ pagination, filter }) => {
return safeClient(() =>
client.api.admin.transfer.get({
query: {}
query: {
...pagination,
...filter
}
})
);
};
const columns: TableBaseColumns = [
{
title: 'ID',
title: '订单ID',
key: 'id'
},
{
title: 'orderNo',
title: '订单号',
key: 'orderNo'
},
{
title: 'fromUserId',
title: '转出用户ID',
key: 'fromUserId'
},
{
title: 'toUserId',
title: '转入用户ID',
key: 'toUserId'
},
{
title: 'assetCode',
title: '资产代码',
key: 'assetCode'
},
{
title: 'amount',
title: '转账金额',
key: 'amount'
},
{
title: 'fee',
title: '手续费',
key: 'fee'
},
{
title: '操作',
fixed: 'right',
key: 'operation',
width: 160,
operations: (row: any) => [
{
contentText: '编辑',
type: 'primary',
onClick: () => {
tableInst.value?.reload();
}
},
{
contentText: '删除',
type: 'error',
ghost: true,
size: 'small',
onClick: async () => {
dialog.create({
title: '提示',
positiveText: '是',
negativeText: '否',
content: '确认删除该银行信息?',
onPositiveClick: async () => {
safeClient(() =>
client.api.admin.deposit.reject({ orderId: row.id as string }).post({
reviewNote: '管理员拒绝充值'
})
);
// tableInst.value?.reload();
message.success('删除成功');
}
});
}
}
]
}
];
const filterColumns: TableFilterColumns = [
{
title: '资产代码',
key: 'assetCode'
},
{
title: '转账金额',
key: 'amount',
component: NDatePicker
}
];
</script>
<template>
<TableBase ref="tableInst" :columns="columns" :fetch-data="fetchData" />
<TableBase ref="tableInst" :columns="columns" :filter-columns="filterColumns" :fetch-data="fetchData" />
</template>
<style lang="css" scoped></style>