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

This commit is contained in:
YunaiV
2025-10-06 10:40:20 +08:00
parent 96026b85b5
commit c168045639
4 changed files with 259 additions and 114 deletions

View File

@@ -1,10 +1,16 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayNotifyApi } from '#/api/pay/notify';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { formatDateTime } from '@vben/utils';
import { getAppList } from '#/api/pay/app';
import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */
@@ -23,7 +29,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
}));
},
autoSelect: 'first',
placeholder: '请选择数据源',
placeholder: '请选择应用编号',
},
},
{
@@ -41,6 +47,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '关联编号',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入关联编号',
},
},
@@ -59,9 +66,28 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '商户订单编号',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入商户订单编号',
},
},
{
fieldName: 'merchantRefundId',
label: '商户退款编号',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入商户退款编号',
},
},
{
fieldName: 'merchantTransferId',
label: '商户转账编号',
component: 'Input',
componentProps: {
allowClear: true,
placeholder: '请输入商户转账编号',
},
},
{
fieldName: 'createTime',
label: '创建时间',
@@ -81,18 +107,25 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'id',
title: '任务编号',
minWidth: 100,
},
{
field: 'appName',
title: '应用编号',
title: '应用名称',
minWidth: 150,
},
{
field: 'merchantOrderId',
title: '商户订单编号',
field: 'merchantInfo',
title: '商户单信息',
minWidth: 240,
slots: {
default: 'merchantInfo',
},
},
{
field: 'type',
title: '通知类型',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.PAY_NOTIFY_TYPE },
@@ -101,10 +134,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'dataId',
title: '关联编号',
minWidth: 120,
},
{
field: 'status',
title: '通知状态',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.PAY_NOTIFY_STATUS },
@@ -113,16 +148,19 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'lastExecuteTime',
title: '最后通知时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'nextNotifyTime',
title: '下次通知时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'notifyTimes',
title: '通知次数',
minWidth: 120,
cellRender: {
name: 'CellTag',
props: {
@@ -140,41 +178,110 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
];
}
/** 详情列表的字段 */
export const detailColumns = [
{
title: '日志编号',
dataIndex: 'id',
key: 'id',
width: 120,
ellipsis: false,
},
{
title: '通知状态',
dataIndex: 'status',
key: 'status',
width: 120,
ellipsis: false,
},
{
title: '通知次数',
dataIndex: 'notifyTimes',
key: 'notifyTimes',
width: 120,
ellipsis: false,
},
{
title: '通知时间',
dataIndex: 'lastExecuteTime',
key: 'lastExecuteTime',
width: 120,
ellipsis: false,
},
{
title: '响应结果',
dataIndex: 'response',
key: 'response',
width: 120,
ellipsis: false,
},
];
/** 详情的字段 */
export function useDetailSchema(): DescriptionItemSchema[] {
return [
{
field: 'appId',
label: '应用编号',
},
{
field: 'appName',
label: '应用名称',
},
{
field: 'type',
label: '通知类型',
content: (data: PayNotifyApi.NotifyTask) =>
h(DictTag, {
type: DICT_TYPE.PAY_NOTIFY_TYPE,
value: data?.type,
}),
},
{
field: 'dataId',
label: '关联编号',
},
{
field: 'status',
label: '通知状态',
content: (data: PayNotifyApi.NotifyTask) =>
h(DictTag, {
type: DICT_TYPE.PAY_NOTIFY_STATUS,
value: data?.status,
}),
},
{
field: 'merchantOrderId',
label: '商户订单编号',
},
{
field: 'lastExecuteTime',
label: '最后通知时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.lastExecuteTime) as string,
},
{
field: 'nextNotifyTime',
label: '下次通知时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.nextNotifyTime) as string,
},
{
field: 'notifyTimes',
label: '通知次数',
},
{
field: 'maxNotifyTimes',
label: '最大通知次数',
},
{
field: 'createTime',
label: '创建时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.createTime) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.updateTime) as string,
},
];
}
/** 详情的日志字段 */
export function useDetailLogColumns(): VxeTableGridOptions['columns'] {
return [
{
field: 'id',
title: '日志编号',
minWidth: 120,
},
{
field: 'status',
title: '通知状态',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.PAY_NOTIFY_STATUS },
},
},
{
field: 'notifyTimes',
title: '通知次数',
minWidth: 120,
},
{
field: 'createTime',
title: '通知时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'response',
title: '响应结果',
minWidth: 200,
},
];
}