From 2e3c43091a0b713d50f336eb6c7e2fbf742ceb46 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 28 May 2025 21:06:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=AD=BE=E5=88=B0=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/member/signin/record/data.ts | 58 +++++++++++++++ .../src/views/member/signin/record/index.vue | 70 ++++++++++++------- 2 files changed, 103 insertions(+), 25 deletions(-) create mode 100644 apps/web-antd/src/views/member/signin/record/data.ts diff --git a/apps/web-antd/src/views/member/signin/record/data.ts b/apps/web-antd/src/views/member/signin/record/data.ts new file mode 100644 index 000000000..c5e3f5433 --- /dev/null +++ b/apps/web-antd/src/views/member/signin/record/data.ts @@ -0,0 +1,58 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { getRangePickerDefaultProps } from '#/utils'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'nickname', + label: '签到用户', + component: 'Input', + }, + { + fieldName: 'day', + label: '签到天数', + component: 'Input', + }, + { + fieldName: 'createTime', + label: '签到时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'nickname', + title: '签到用户', + }, + { + field: 'day', + title: '签到天数', + formatter: ({ cellValue }) => ['第', cellValue, '天'].join(' '), + }, + { + field: 'point', + title: '获得积分', + slots: { default: 'point' }, + }, + { + field: 'createTime', + title: '签到时间', + formatter: 'formatDateTime', + }, + ]; +} diff --git a/apps/web-antd/src/views/member/signin/record/index.vue b/apps/web-antd/src/views/member/signin/record/index.vue index 06baddb46..d1595cfcf 100644 --- a/apps/web-antd/src/views/member/signin/record/index.vue +++ b/apps/web-antd/src/views/member/signin/record/index.vue @@ -1,34 +1,54 @@