Files
iot-device-management-frontend/apps/web-antd/src/views/pay/wallet/balance/data.ts

91 lines
1.9 KiB
TypeScript
Raw Normal View History

2025-05-27 15:31:19 +08:00
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VbenFormSchema } from '#/adapter/form';
2025-09-05 12:24:16 +08:00
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { getRangePickerDefaultProps } from '#/utils';
2025-05-27 15:31:19 +08:00
/** 列表的搜索表单 */
2025-09-02 23:29:53 +08:00
// TODO @xingyu少了 placeholder
2025-05-27 15:31:19 +08:00
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'userId',
label: '用户编号',
component: 'Input',
},
{
fieldName: 'userType',
label: '用户类型',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'),
},
},
{
fieldName: 'createTime',
label: '创建时间',
component: 'RangePicker',
componentProps: {
allowClear: true,
...getRangePickerDefaultProps(),
},
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
title: '编号',
field: 'id',
},
{
title: '用户编号',
field: 'userId',
},
{
title: '用户类型',
field: 'userType',
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.USER_TYPE },
},
},
{
title: '余额',
field: 'balance',
2025-06-08 18:22:55 +08:00
formatter: 'formatAmount2',
2025-05-27 15:31:19 +08:00
},
{
title: '累计支出',
field: 'totalExpense',
2025-06-08 18:22:55 +08:00
formatter: 'formatAmount2',
2025-05-27 15:31:19 +08:00
},
{
title: '累计充值',
field: 'totalRecharge',
2025-06-08 18:22:55 +08:00
formatter: 'formatAmount2',
2025-05-27 15:31:19 +08:00
},
{
title: '冻结金额',
field: 'freezePrice',
2025-06-08 18:22:55 +08:00
formatter: 'formatAmount2',
2025-05-27 15:31:19 +08:00
},
{
title: '创建时间',
field: 'createTime',
formatter: 'formatDateTime',
},
{
title: '操作',
field: 'actions',
fixed: 'right',
slots: { default: 'actions' },
},
];
}