From dd7e4d951391021ba85dd04f2820c7249a55e2c1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 6 Oct 2025 20:15:17 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90ele?= =?UTF-8?q?=E3=80=91=E3=80=90pay=20=E6=94=AF=E4=BB=98=E3=80=91pay/demo/wit?= =?UTF-8?q?hdraw=20=E8=BF=81=E7=A7=BB=20ele=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/pay/demo/withdraw/data.ts | 26 ++++++++++++++----- .../src/views/pay/demo/withdraw/index.vue | 17 ++++++------ .../views/pay/demo/withdraw/modules/form.vue | 2 +- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/apps/web-antd/src/views/pay/demo/withdraw/data.ts b/apps/web-antd/src/views/pay/demo/withdraw/data.ts index ebf9b8553..43395ea45 100644 --- a/apps/web-antd/src/views/pay/demo/withdraw/data.ts +++ b/apps/web-antd/src/views/pay/demo/withdraw/data.ts @@ -2,28 +2,29 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { DICT_TYPE } from '@vben/constants'; +import { formatDateTime } from '@vben/utils'; /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ { - component: 'Input', fieldName: 'id', + component: 'Input', dependencies: { triggerFields: [''], show: () => false, }, }, { - component: 'Input', fieldName: 'subject', label: '提现标题', + component: 'Input', rules: 'required', }, { - component: 'InputNumber', fieldName: 'price', label: '提现金额', + component: 'InputNumber', rules: 'required', componentProps: { min: 1, @@ -32,9 +33,9 @@ export function useFormSchema(): VbenFormSchema[] { }, }, { - component: 'Select', fieldName: 'type', label: '提现类型', + component: 'Select', rules: 'required', componentProps: { options: [ @@ -45,15 +46,15 @@ export function useFormSchema(): VbenFormSchema[] { }, }, { - component: 'Input', fieldName: 'userName', label: '收款人姓名', + component: 'Input', rules: 'required', }, { - component: 'Input', fieldName: 'userAccount', label: '收款人账号', + component: 'Input', rules: 'required', }, ]; @@ -65,41 +66,50 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '提现单编号', + minWidth: 100, }, { field: 'subject', title: '提现标题', + minWidth: 150, }, { field: 'type', title: '提现类型', + minWidth: 100, slots: { default: 'type' }, }, { field: 'price', title: '提现金额', + minWidth: 100, formatter: 'formatAmount2', }, { field: 'userName', title: '收款人姓名', + minWidth: 120, }, { field: 'userAccount', title: '收款人账号', + minWidth: 150, }, { field: 'status', title: '提现状态', + minWidth: 100, slots: { default: 'status' }, }, { field: 'payTransferId', title: '转账单号', + minWidth: 120, }, { field: 'transferChannelCode', title: '转账渠道', + minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.PAY_CHANNEL_CODE }, @@ -108,15 +118,17 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'transferTime', title: '转账时间', + minWidth: 180, formatter: 'formatDateTime', }, { field: 'transferErrorMsg', title: '转账失败原因', + minWidth: 150, }, { title: '操作', - width: 130, + width: 220, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antd/src/views/pay/demo/withdraw/index.vue b/apps/web-antd/src/views/pay/demo/withdraw/index.vue index 8f856b0f4..3df3c06ad 100644 --- a/apps/web-antd/src/views/pay/demo/withdraw/index.vue +++ b/apps/web-antd/src/views/pay/demo/withdraw/index.vue @@ -12,7 +12,6 @@ import { getDemoWithdrawPage, transferDemoWithdraw, } from '#/api/pay/demo/withdraw'; -import { $t } from '#/locales'; import { useGridColumns } from './data'; import Form from './modules/form.vue'; @@ -23,7 +22,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -40,10 +39,8 @@ async function handleTransfer(row: DemoWithdrawApi.Withdraw) { }); try { const payTransferId = await transferDemoWithdraw(row.id as number); - message.success({ - content: `转账提交成功,转账单号:${payTransferId}`, - }); - onRefresh(); + message.success(`转账提交成功,转账单号:${payTransferId}`); + handleRefresh(); } finally { hideLoading(); } @@ -67,6 +64,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -89,13 +87,13 @@ const [Grid, gridApi] = useVbenVxeGrid({ /> - +