feat:【antd】【ele】【member 会员】point 迁移 ele

This commit is contained in:
YunaiV
2025-10-07 10:40:29 +08:00
parent 960413ed58
commit 7b7323d519
2 changed files with 28 additions and 5 deletions

View File

@@ -3,11 +3,11 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { h } from 'vue'; import { h } from 'vue';
import { ElTag } from 'element-plus';
import { DICT_TYPE } from '@vben/constants'; import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
import { ElTag } from 'element-plus';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */ /** 列表的搜索表单 */
@@ -17,12 +17,17 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'nickname', fieldName: 'nickname',
label: '用户', label: '用户',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入用户昵称',
clearable: true,
},
}, },
{ {
fieldName: 'bizType', fieldName: 'bizType',
label: '业务类型', label: '业务类型',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
placeholder: '请选择业务类型',
clearable: true, clearable: true,
options: getDictOptions(DICT_TYPE.MEMBER_POINT_BIZ_TYPE, 'number'), options: getDictOptions(DICT_TYPE.MEMBER_POINT_BIZ_TYPE, 'number'),
}, },
@@ -31,6 +36,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'title', fieldName: 'title',
label: '积分标题', label: '积分标题',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入积分标题',
clearable: true,
},
}, },
{ {
fieldName: 'createDate', fieldName: 'createDate',
@@ -50,26 +59,29 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{ {
field: 'id', field: 'id',
title: '编号', title: '编号',
minWidth: 100,
}, },
{ {
field: 'createTime', field: 'createTime',
title: '获得时间', title: '获得时间',
minWidth: 180,
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
field: 'nickname', field: 'nickname',
title: '用户', title: '用户',
minWidth: 150,
}, },
{ {
field: 'point', field: 'point',
title: '获得积分', title: '获得积分',
minWidth: 120,
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
return h( return h(
ElTag, ElTag,
{ {
class: 'mr-1', type: row.point > 0 ? 'primary' : 'danger',
color: row.point > 0 ? 'blue' : 'red',
}, },
() => (row.point > 0 ? `+${row.point}` : row.point), () => (row.point > 0 ? `+${row.point}` : row.point),
); );
@@ -79,22 +91,27 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{ {
field: 'totalPoint', field: 'totalPoint',
title: '总积分', title: '总积分',
minWidth: 100,
}, },
{ {
field: 'title', field: 'title',
title: '标题', title: '标题',
minWidth: 200,
}, },
{ {
field: 'description', field: 'description',
title: '描述', title: '描述',
minWidth: 200,
}, },
{ {
field: 'bizId', field: 'bizId',
title: '业务编码', title: '业务编码',
minWidth: 120,
}, },
{ {
field: 'bizType', field: 'bizType',
title: '业务类型', title: '业务类型',
minWidth: 120,
cellRender: { cellRender: {
name: 'CellDict', name: 'CellDict',
props: { type: DICT_TYPE.MEMBER_POINT_BIZ_TYPE }, props: { type: DICT_TYPE.MEMBER_POINT_BIZ_TYPE },

View File

@@ -2,7 +2,7 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MemberPointRecordApi } from '#/api/member/point/record'; import type { MemberPointRecordApi } from '#/api/member/point/record';
import { Page } from '@vben/common-ui'; import { DocAlert, Page } from '@vben/common-ui';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getRecordPage } from '#/api/member/point/record'; import { getRecordPage } from '#/api/member/point/record';
@@ -30,6 +30,7 @@ const [Grid] = useVbenVxeGrid({
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
isHover: true,
}, },
toolbarConfig: { toolbarConfig: {
refresh: true, refresh: true,
@@ -41,6 +42,11 @@ const [Grid] = useVbenVxeGrid({
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<DocAlert
title="会员等级、积分、签到"
url="https://doc.iocoder.cn/member/level/"
/>
<Grid table-title="积分记录列表" /> <Grid table-title="积分记录列表" />
</Page> </Page>
</template> </template>