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

This commit is contained in:
YunaiV
2025-10-06 11:11:51 +08:00
parent c168045639
commit 0627f5072d
5 changed files with 274 additions and 133 deletions

View File

@@ -1,9 +1,12 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayNotifyApi } from '#/api/pay/notify';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { ElTag } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getNotifyTaskPage } from '#/api/pay/notify';
@@ -16,12 +19,12 @@ const [DetailModal, detailModalApi] = useVbenModal({
});
/** 刷新表格 */
function onRefresh() {
function handleRefresh() {
gridApi.query();
}
/** 查看详情 */
function handleDetail(row: any) {
function handleDetail(row: PayNotifyApi.NotifyTask) {
detailModalApi.setData(row).open();
}
@@ -30,6 +33,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
schema: useGridFormSchema(),
},
gridOptions: {
cellConfig: {
height: 80,
},
columns: useGridColumns(),
height: 'auto',
keepSource: true,
@@ -46,12 +52,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
} as VxeTableGridOptions<any>,
} as VxeTableGridOptions<PayNotifyApi.NotifyTask>,
});
</script>
<template>
@@ -60,8 +67,24 @@ const [Grid, gridApi] = useVbenVxeGrid({
<DocAlert title="支付功能开启" url="https://doc.iocoder.cn/pay/build/" />
</template>
<DetailModal @success="onRefresh" />
<Grid table-title="支付通知列表">
<DetailModal @success="handleRefresh" />
<Grid table-title="通知列表">
<template #merchantInfo="{ row }">
<div class="flex flex-col gap-1 text-left">
<p class="text-sm" v-if="row.merchantOrderId">
<ElTag size="small" type="primary">商户订单编号</ElTag>
{{ row.merchantOrderId }}
</p>
<p class="text-sm" v-if="row.merchantRefundId">
<ElTag size="small" type="warning">商户退款编号</ElTag>
{{ row.merchantRefundId }}
</p>
<p class="text-sm" v-if="row.merchantTransferId">
<ElTag size="small" type="success">商户转账编号</ElTag>
{{ row.merchantTransferId }}
</p>
</div>
</template>
<template #actions="{ row }">
<TableAction
:actions="[