perf: point
parent
8ad0bbc427
commit
9cd67c1590
|
@ -1,6 +1,10 @@
|
|||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
import { h } from 'vue';
|
||||
|
||||
import { Tag } from 'ant-design-vue';
|
||||
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
|
@ -56,7 +60,18 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||
{
|
||||
field: 'point',
|
||||
title: '获得积分',
|
||||
slots: { default: 'point' },
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return h(
|
||||
Tag,
|
||||
{
|
||||
class: 'mr-5px',
|
||||
color: row.point > 0 ? 'blue' : 'red',
|
||||
},
|
||||
() => (row.point > 0 ? `+${row.point}` : row.point),
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'totalPoint',
|
||||
|
|
|
@ -4,8 +4,6 @@ import type { MemberPointRecordApi } from '#/api/member/point/record';
|
|||
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { getRecordPage } from '#/api/member/point/record';
|
||||
|
||||
|
@ -43,12 +41,6 @@ const [Grid] = useVbenVxeGrid({
|
|||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<Grid table-title="积分记录列表">
|
||||
<template #point="{ row }">
|
||||
<Tag :color="row.point > 0 ? '#108ee9' : '#f50'">
|
||||
{{ row.point > 0 ? `+${row.point}` : row.point }}
|
||||
</Tag>
|
||||
</template>
|
||||
</Grid>
|
||||
<Grid table-title="积分记录列表" />
|
||||
</Page>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue