feat:【antd】【ele】【pay 支付】pay/transfer 迁移 ele 版本

This commit is contained in:
YunaiV
2025-10-06 09:18:37 +08:00
parent b587032597
commit fcc6162692
3 changed files with 109 additions and 109 deletions

View File

@@ -3,10 +3,11 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayTransferApi } from '#/api/pay/transfer';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart } from '@vben/utils';
import { ElTag } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { exportTransfer, getTransferPage } from '#/api/pay/transfer';
import { getTransferPage } from '#/api/pay/transfer';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
@@ -18,16 +19,10 @@ const [DetailModal, detailModalApi] = useVbenModal({
});
/** 刷新表格 */
function onRefresh() {
function handleRefresh() {
gridApi.query();
}
/** 导出表格 */
async function handleExport() {
const data = await exportTransfer(await gridApi.formApi.getValues());
downloadFileFromBlobPart({ fileName: '转账单.xls', source: data });
}
/** 查看转账详情 */
function handleDetail(row: PayTransferApi.Transfer) {
detailModalApi.setData(row).open();
@@ -38,6 +33,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
schema: useGridFormSchema(),
},
gridOptions: {
cellConfig: {
height: 80,
},
columns: useGridColumns(),
height: 'auto',
keepSource: true,
@@ -54,6 +52,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
@@ -69,21 +68,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
<DocAlert title="转账管理" url="https://doc.iocoder.cn/pay/transfer/" />
</template>
<DetailModal @success="onRefresh" />
<DetailModal @success="handleRefresh" />
<Grid table-title="转账单列表">
<template #toolbar-tools>
<TableAction
:actions="[
{
label: $t('ui.actionTitle.export'),
type: 'primary',
icon: ACTION_ICON.DOWNLOAD,
auth: ['pay:transfer:export'],
onClick: handleExport,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
@@ -98,6 +84,21 @@ const [Grid, gridApi] = useVbenVxeGrid({
]"
/>
</template>
<template #no="{ row }">
<div class="flex flex-col gap-1 text-left">
<p class="text-sm">
<ElTag size="small" type="primary"> 商户</ElTag>
{{ row.merchantTransferId }}
</p>
<p class="text-sm" v-if="row.no">
<ElTag size="small" type="warning">转账</ElTag> {{ row.no }}
</p>
<p class="text-sm" v-if="row.channelTransferNo">
<ElTag size="small" type="success">渠道</ElTag>
{{ row.channelTransferNo }}
</p>
</div>
</template>
</Grid>
</Page>
</template>