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

This commit is contained in:
YunaiV
2025-10-05 22:06:58 +08:00
parent 25e434276a
commit b587032597
4 changed files with 100 additions and 91 deletions

View File

@@ -1,17 +1,17 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayTransferApi } from '#/api/pay/transfer';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { erpPriceInputFormatter, formatDateTime } from '@vben/utils';
import { Tag } from 'ant-design-vue';
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */
@@ -75,7 +75,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
},
},
{
fieldName: 'accountNo',
fieldName: 'userAccount',
label: '收款人账号',
component: 'Input',
componentProps: {
@@ -110,96 +110,95 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'id',
title: '编号',
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
},
{
field: 'appName',
title: '支付应用',
minWidth: 100,
},
{
field: 'price',
title: '转账金额',
minWidth: 120,
formatter: 'formatAmount2',
},
{
field: 'merchantTransferId',
title: '转账单号',
minWidth: 350,
slots: {
default: 'no',
},
},
{
field: 'status',
title: '转账状态',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.PAY_TRANSFER_STATUS },
},
},
{
field: 'type',
title: '类型',
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.PAY_TRANSFER_TYPE },
},
},
{
field: 'channelCode',
title: '支付渠道',
title: '转账渠道',
minWidth: 140,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.PAY_CHANNEL_CODE },
},
},
{
field: 'merchantTransferId',
title: '商户单号',
field: 'createTime',
title: '创建时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'channelTransferNo',
title: '渠道单号',
field: 'successTime',
title: '转账时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'subject',
title: '转账标题',
minWidth: 150,
},
{
field: 'appName',
title: '支付应用',
minWidth: 150,
},
{
field: 'userName',
title: '收款人姓名',
minWidth: 150,
},
{
field: 'accountNo',
title: '收款账号',
field: 'userAccount',
title: '收款账号',
minWidth: 200,
},
{
title: '操作',
width: 120,
width: 80,
fixed: 'right',
slots: { default: 'actions' },
},
];
}
/** 详情的配置 */
/** 详情的字段 */
export function useDetailSchema(): DescriptionItemSchema[] {
return [
{
field: 'id',
label: '编号',
},
{
field: 'merchantTransferId',
label: '商户单号',
content: (data) => {
return h(Tag, {
color: 'blue',
content: data?.merchantTransferId,
});
},
content: (data: PayTransferApi.Transfer) =>
h(Tag, {}, () => data?.merchantTransferId || '-'),
},
{
field: 'no',
label: '转账单号',
content: (data) => {
return h(Tag, {
color: 'blue',
content: data?.no,
});
},
content: (data: PayTransferApi.Transfer) =>
h(Tag, { color: 'orange' }, () => data?.no || '-'),
},
{
field: 'appId',
@@ -208,7 +207,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '转账状态',
content: (data) =>
content: (data: any) =>
h(DictTag, {
type: DICT_TYPE.PAY_TRANSFER_STATUS,
value: data?.status,
@@ -217,22 +216,24 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'price',
label: '转账金额',
content: (data) => {
return h(Tag, {
color: 'blue',
content: `${erpPriceInputFormatter(data?.price)}`,
});
},
content: (data: PayTransferApi.Transfer) =>
h(
Tag,
{ color: 'success' },
() => `${erpPriceInputFormatter(data?.price || 0)}`,
),
},
{
field: 'successTime',
label: '转账时间',
content: (data) => formatDateTime(data?.successTime) as string,
content: (data: PayTransferApi.Transfer) =>
formatDateTime(data?.successTime) as string,
},
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
content: (data: PayTransferApi.Transfer) =>
formatDateTime(data?.createTime) as string,
},
{
field: 'userName',
@@ -245,25 +246,23 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'channelCode',
label: '支付渠道',
content: (data) =>
content: (data: PayTransferApi.Transfer) =>
h(DictTag, {
type: DICT_TYPE.PAY_CHANNEL_CODE,
value: data?.channelCode,
}),
},
{
field: 'channelCode',
field: 'userIp',
label: '支付 IP',
},
{
field: 'channelTransferNo',
label: '渠道单号',
content: (data) => {
return h(Tag, {
color: 'blue',
content: data?.channelTransferNo,
});
},
content: (data: PayTransferApi.Transfer) =>
data?.channelTransferNo
? h(Tag, { color: 'success' }, () => data.channelTransferNo)
: '',
},
{
field: 'notifyUrl',