diff --git a/apps/web-antd/src/api/member/address/index.ts b/apps/web-antd/src/api/member/address/index.ts new file mode 100644 index 000000000..16b456eaa --- /dev/null +++ b/apps/web-antd/src/api/member/address/index.ts @@ -0,0 +1,20 @@ +import { requestClient } from '#/api/request'; + +export namespace MemberAddressApi { + /** 收件地址信息 */ + export interface Address { + id?: number; + name: string; + mobile: string; + areaId: number; + detailAddress: string; + defaultStatus: boolean; + } +} + +/** 查询用户收件地址列表 */ +export function getAddressList(params: any) { + return requestClient.get('/member/address/list', { + params, + }); +} diff --git a/apps/web-antd/src/api/member/config/index.ts b/apps/web-antd/src/api/member/config/index.ts new file mode 100644 index 000000000..073110d66 --- /dev/null +++ b/apps/web-antd/src/api/member/config/index.ts @@ -0,0 +1,22 @@ +import { requestClient } from '#/api/request'; + +export namespace MemberConfigApi { + /** 积分设置信息 */ + export interface Config { + id?: number; + pointTradeDeductEnable: number; + pointTradeDeductUnitPrice: number; + pointTradeDeductMaxPrice: number; + pointTradeGivePoint: number; + } +} + +/** 查询积分设置详情 */ +export function getConfig() { + return requestClient.get('/member/config/get'); +} + +/** 新增修改积分设置 */ +export function saveConfig(data: MemberConfigApi.Config) { + return requestClient.put('/member/config/save', data); +} diff --git a/apps/web-antd/src/api/member/experience-record/index.ts b/apps/web-antd/src/api/member/experience-record/index.ts new file mode 100644 index 000000000..f36297f1e --- /dev/null +++ b/apps/web-antd/src/api/member/experience-record/index.ts @@ -0,0 +1,33 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MemberExperienceRecordApi { + /** 会员经验记录信息 */ + export interface ExperienceRecord { + id?: number; + userId: number; + bizId: string; + bizType: number; + title: string; + description: string; + experience: number; + totalExperience: number; + } +} + +/** 查询会员经验记录列表 */ +export function getExperienceRecordPage(params: PageParam) { + return requestClient.get< + PageResult + >('/member/experience-record/page', { + params, + }); +} + +/** 查询会员经验记录详情 */ +export function getExperienceRecord(id: number) { + return requestClient.get( + `/member/experience-record/get?id=${id}`, + ); +} diff --git a/apps/web-antd/src/api/member/group/index.ts b/apps/web-antd/src/api/member/group/index.ts new file mode 100644 index 000000000..93c2ca3e9 --- /dev/null +++ b/apps/web-antd/src/api/member/group/index.ts @@ -0,0 +1,50 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MemberGroupApi { + /** 用户分组信息 */ + export interface Group { + id?: number; + name: string; + remark: string; + status: number; + } +} + +/** 查询用户分组列表 */ +export function getGroupPage(params: PageParam) { + return requestClient.get>( + '/member/group/page', + { + params, + }, + ); +} + +/** 查询用户分组详情 */ +export function getGroup(id: number) { + return requestClient.get(`/member/group/get?id=${id}`); +} + +/** 新增用户分组 */ +export function createGroup(data: MemberGroupApi.Group) { + return requestClient.post('/member/group/create', data); +} + +/** 查询用户分组 - 精简信息列表 */ +export function getSimpleGroupList() { + return requestClient.get( + '/member/group/list-all-simple', + ); +} + +/** 修改用户分组 */ +export function updateGroup(data: MemberGroupApi.Group) { + return requestClient.put('/member/group/update', data); +} + +/** 删除用户分组 */ +export function deleteGroup(id: number) { + return requestClient.delete(`/member/group/delete?id=${id}`); +} diff --git a/apps/web-antd/src/api/member/level/index.ts b/apps/web-antd/src/api/member/level/index.ts new file mode 100644 index 000000000..850d9b820 --- /dev/null +++ b/apps/web-antd/src/api/member/level/index.ts @@ -0,0 +1,49 @@ +import { requestClient } from '#/api/request'; + +export namespace MemberLevelApi { + /** 会员等级信息 */ + export interface Level { + id?: number; + name: string; + experience: number; + value: number; + discountPercent: number; + icon: string; + bgUrl: string; + status: number; + } +} + +/** 查询会员等级列表 */ +export function getLevelList(params: MemberLevelApi.Level) { + return requestClient.get('/member/level/list', { + params, + }); +} + +/** 查询会员等级详情 */ +export function getLevel(id: number) { + return requestClient.get(`/member/level/get?id=${id}`); +} + +/** 查询会员等级 - 精简信息列表 */ +export function getSimpleLevelList() { + return requestClient.get( + '/member/level/list-all-simple', + ); +} + +/** 新增会员等级 */ +export function createLevel(data: MemberLevelApi.Level) { + return requestClient.post('/member/level/create', data); +} + +/** 修改会员等级 */ +export function updateLevel(data: MemberLevelApi.Level) { + return requestClient.put('/member/level/update', data); +} + +/** 删除会员等级 */ +export function deleteLevel(id: number) { + return requestClient.delete(`/member/level/delete?id=${id}`); +} diff --git a/apps/web-antd/src/api/member/point/record/index.ts b/apps/web-antd/src/api/member/point/record/index.ts new file mode 100644 index 000000000..7f6797e8a --- /dev/null +++ b/apps/web-antd/src/api/member/point/record/index.ts @@ -0,0 +1,28 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MemberPointRecordApi { + /** 用户积分记录信息 */ + export interface Record { + id?: number; + bizId: string; + bizType: string; + title: string; + description: string; + point: number; + totalPoint: number; + userId: number; + createDate: Date; + } +} + +/** 查询用户积分记录列表 */ +export function getRecordPage(params: PageParam) { + return requestClient.get>( + '/member/point/record/page', + { + params, + }, + ); +} diff --git a/apps/web-antd/src/api/member/signin/config/index.ts b/apps/web-antd/src/api/member/signin/config/index.ts new file mode 100644 index 000000000..cf113b781 --- /dev/null +++ b/apps/web-antd/src/api/member/signin/config/index.ts @@ -0,0 +1,41 @@ +import { requestClient } from '#/api/request'; + +export namespace MemberSignInConfigApi { + /** 积分签到规则信息 */ + export interface SignInConfig { + id?: number; + day?: number; + point?: number; + experience?: number; + status?: number; + } +} + +/** 查询积分签到规则列表 */ +export function getSignInConfigList() { + return requestClient.get( + '/member/sign-in/config/list', + ); +} + +/** 查询积分签到规则详情 */ +export function getSignInConfig(id: number) { + return requestClient.get( + `/member/sign-in/config/get?id=${id}`, + ); +} + +/** 新增积分签到规则 */ +export function createSignInConfig(data: MemberSignInConfigApi.SignInConfig) { + return requestClient.post('/member/sign-in/config/create', data); +} + +/** 修改积分签到规则 */ +export function updateSignInConfig(data: MemberSignInConfigApi.SignInConfig) { + return requestClient.put('/member/sign-in/config/update', data); +} + +/** 删除积分签到规则 */ +export function deleteSignInConfig(id: number) { + return requestClient.delete(`/member/sign-in/config/delete?id=${id}`); +} diff --git a/apps/web-antd/src/api/member/signin/record/index.ts b/apps/web-antd/src/api/member/signin/record/index.ts new file mode 100644 index 000000000..7d5766d66 --- /dev/null +++ b/apps/web-antd/src/api/member/signin/record/index.ts @@ -0,0 +1,23 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MemberSignInRecordApi { + /** 用户签到积分信息 */ + export interface SignInRecord { + id?: number; + userId: number; + day: number; + point: number; + } +} + +/** 查询用户签到积分列表 */ +export function getSignInRecordPage(params: PageParam) { + return requestClient.get>( + '/member/sign-in/record/page', + { + params, + }, + ); +} diff --git a/apps/web-antd/src/api/member/tag/index.ts b/apps/web-antd/src/api/member/tag/index.ts new file mode 100644 index 000000000..d5c2ef44e --- /dev/null +++ b/apps/web-antd/src/api/member/tag/index.ts @@ -0,0 +1,43 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MemberTagApi { + /** 会员标签信息 */ + export interface Tag { + id?: number; + name: string; + } +} + +/** 查询会员标签列表 */ +export function getMemberTagPage(params: PageParam) { + return requestClient.get>('/member/tag/page', { + params, + }); +} + +/** 查询会员标签详情 */ +export function getMemberTag(id: number) { + return requestClient.get(`/member/tag/get?id=${id}`); +} + +/** 查询会员标签 - 精简信息列表 */ +export function getSimpleTagList() { + return requestClient.get('/member/tag/list-all-simple'); +} + +/** 新增会员标签 */ +export function createMemberTag(data: MemberTagApi.Tag) { + return requestClient.post('/member/tag/create', data); +} + +/** 修改会员标签 */ +export function updateMemberTag(data: MemberTagApi.Tag) { + return requestClient.put('/member/tag/update', data); +} + +/** 删除会员标签 */ +export function deleteMemberTag(id: number) { + return requestClient.delete(`/member/tag/delete?id=${id}`); +} diff --git a/apps/web-antd/src/api/member/user/index.ts b/apps/web-antd/src/api/member/user/index.ts new file mode 100644 index 000000000..e8a5a35b7 --- /dev/null +++ b/apps/web-antd/src/api/member/user/index.ts @@ -0,0 +1,70 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MemberUserApi { + /** 会员用户信息 */ + export interface User { + id?: number; + avatar?: string; + birthday?: number; + createTime?: number; + loginDate?: number; + loginIp: string; + mark: string; + mobile: string; + name?: string; + nickname?: string; + registerIp: string; + sex: number; + status: number; + areaId?: number; + areaName?: string; + levelName: null | string; + point?: null | number; + totalPoint?: null | number; + experience?: null | number; + } + + /** 会员用户等级更新信息 */ + export interface UserLevelUpdate { + id: number; + levelId: number; + } + + /** 会员用户积分更新信息 */ + export interface UserPointUpdate { + id: number; + point: number; + } +} + +/** 查询会员用户列表 */ +export function getUserPage(params: PageParam) { + return requestClient.get>( + '/member/user/page', + { + params, + }, + ); +} + +/** 查询会员用户详情 */ +export function getUser(id: number) { + return requestClient.get(`/member/user/get?id=${id}`); +} + +/** 修改会员用户 */ +export function updateUser(data: MemberUserApi.User) { + return requestClient.put('/member/user/update', data); +} + +/** 修改会员用户等级 */ +export function updateUserLevel(data: MemberUserApi.UserLevelUpdate) { + return requestClient.put('/member/user/update-level', data); +} + +/** 修改会员用户积分 */ +export function updateUserPoint(data: MemberUserApi.UserPointUpdate) { + return requestClient.put('/member/user/update-point', data); +} diff --git a/apps/web-antd/src/router/routes/modules/member.ts b/apps/web-antd/src/router/routes/modules/member.ts new file mode 100644 index 000000000..4f4e81723 --- /dev/null +++ b/apps/web-antd/src/router/routes/modules/member.ts @@ -0,0 +1,16 @@ +import type { RouteRecordRaw } from 'vue-router'; + +const routes: RouteRecordRaw[] = [ + { + path: '/member/user/detail', + component: () => import('#/views/member/user/modules/detail.vue'), + name: 'MemberUserDetail', + meta: { + title: '会员详情', + icon: 'lucide:user', + hideInMenu: true, + }, + }, +]; + +export default routes; diff --git a/apps/web-antd/src/utils/download.ts b/apps/web-antd/src/utils/download.ts index acb0129c8..f7cf56596 100644 --- a/apps/web-antd/src/utils/download.ts +++ b/apps/web-antd/src/utils/download.ts @@ -2,6 +2,7 @@ * 下载工具模块 * 提供多种文件格式的下载功能 */ +// 请使用 @vben/utils/download 代替 packages/@core/base/shared/src/utils/download.ts /** * 图片下载配置接口 diff --git a/apps/web-antd/src/utils/index.ts b/apps/web-antd/src/utils/index.ts index 479a35472..b33984b78 100644 --- a/apps/web-antd/src/utils/index.ts +++ b/apps/web-antd/src/utils/index.ts @@ -6,4 +6,3 @@ export * from './formatTime'; export * from './formCreate'; export * from './rangePickerProps'; export * from './routerHelper'; -export * from './validator'; diff --git a/apps/web-antd/src/utils/validator.ts b/apps/web-antd/src/utils/validator.ts deleted file mode 100644 index 3ae62f787..000000000 --- a/apps/web-antd/src/utils/validator.ts +++ /dev/null @@ -1,17 +0,0 @@ -// 参数校验,对标 Hutool 的 Validator 工具类 - -/** 手机号正则表达式(中国) */ -const MOBILE_REGEX = /(?:0|86|\+86)?1[3-9]\d{9}/; - -/** - * 验证是否为手机号码(中国) - * - * @param value 值 - * @returns 是否为手机号码(中国) - */ -export function isMobile(value?: null | string): boolean { - if (!value) { - return false; - } - return MOBILE_REGEX.test(value); -} diff --git a/apps/web-antd/src/views/crm/clue/data.ts b/apps/web-antd/src/views/crm/clue/data.ts index 74edf0faf..28e561915 100644 --- a/apps/web-antd/src/views/crm/clue/data.ts +++ b/apps/web-antd/src/views/crm/clue/data.ts @@ -8,6 +8,7 @@ import { h } from 'vue'; import { useAccess } from '@vben/access'; import { formatDateTime } from '@vben/utils'; +import { getAreaTree } from '#/api/system/area'; import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; @@ -92,9 +93,10 @@ export function useFormSchema(): VbenFormSchema[] { { fieldName: 'areaId', label: '地址', - component: 'Cascader', + component: 'ApiTreeSelect', componentProps: { - api: 'getAreaTree', + api: () => getAreaTree(), + fieldNames: { label: 'name', value: 'id', children: 'children' }, }, }, { diff --git a/apps/web-antd/src/views/crm/customer/data.ts b/apps/web-antd/src/views/crm/customer/data.ts index 87cdb42df..6ca6636ff 100644 --- a/apps/web-antd/src/views/crm/customer/data.ts +++ b/apps/web-antd/src/views/crm/customer/data.ts @@ -8,6 +8,7 @@ import { h } from 'vue'; import { useAccess } from '@vben/access'; import { formatDateTime } from '@vben/utils'; +import { getAreaTree } from '#/api/system/area'; import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; @@ -92,9 +93,10 @@ export function useFormSchema(): VbenFormSchema[] { { fieldName: 'areaId', label: '地址', - component: 'Cascader', + component: 'ApiTreeSelect', componentProps: { - api: 'getAreaTree', + api: () => getAreaTree(), + fieldNames: { label: 'name', value: 'id', children: 'children' }, }, }, { diff --git a/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue b/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue index dcac73c0d..b09c1bf29 100644 --- a/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue +++ b/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue @@ -3,7 +3,7 @@ import type { InfraApiAccessLogApi } from '#/api/infra/api-access-log'; import { ref } from 'vue'; -import { useVbenModal } from '@vben/common-ui'; +import { JsonViewer, useVbenModal } from '@vben/common-ui'; import { formatDateTime } from '@vben/utils'; import { Descriptions } from 'ant-design-vue'; @@ -71,7 +71,7 @@ const [Modal, modalApi] = useVbenModal({ {{ formData?.requestMethod }} {{ formData?.requestUrl }} - {{ formData?.requestParams }} + {{ formData?.responseBody }} diff --git a/apps/web-antd/src/views/infra/apiErrorLog/modules/detail.vue b/apps/web-antd/src/views/infra/apiErrorLog/modules/detail.vue index 9b9257c34..ff5aba82e 100644 --- a/apps/web-antd/src/views/infra/apiErrorLog/modules/detail.vue +++ b/apps/web-antd/src/views/infra/apiErrorLog/modules/detail.vue @@ -3,10 +3,10 @@ import type { InfraApiErrorLogApi } from '#/api/infra/api-error-log'; import { ref } from 'vue'; -import { useVbenModal } from '@vben/common-ui'; +import { JsonViewer, useVbenModal } from '@vben/common-ui'; import { formatDateTime } from '@vben/utils'; -import { Descriptions, Input } from 'ant-design-vue'; +import { Descriptions } from 'ant-design-vue'; import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE } from '#/utils'; @@ -71,7 +71,7 @@ const [Modal, modalApi] = useVbenModal({ {{ formData?.requestMethod }} {{ formData?.requestUrl }} - {{ formData?.requestParams }} + {{ formatDateTime(formData?.exceptionTime || '') }} @@ -80,11 +80,7 @@ const [Modal, modalApi] = useVbenModal({ {{ formData?.exceptionName }} - + +
diff --git a/apps/web-antd/src/views/infra/demo/demo01/index.vue b/apps/web-antd/src/views/infra/demo/demo01/index.vue index 6226f4036..47841830c 100644 --- a/apps/web-antd/src/views/infra/demo/demo01/index.vue +++ b/apps/web-antd/src/views/infra/demo/demo01/index.vue @@ -1,19 +1,15 @@ @@ -154,34 +133,56 @@ const [Grid, gridApi] = useVbenVxeGrid({ + diff --git a/apps/web-antd/src/views/member/config/index.vue b/apps/web-antd/src/views/member/config/index.vue index 3bcd2e0a5..b0e17b485 100644 --- a/apps/web-antd/src/views/member/config/index.vue +++ b/apps/web-antd/src/views/member/config/index.vue @@ -1,34 +1,114 @@ diff --git a/apps/web-antd/src/views/member/group/data.ts b/apps/web-antd/src/views/member/group/data.ts new file mode 100644 index 000000000..e7466bd3e --- /dev/null +++ b/apps/web-antd/src/views/member/group/data.ts @@ -0,0 +1,88 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { z } from '#/adapter/form'; +import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '分组名称', + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '分组名称', + component: 'Input', + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'name', + title: '分组名称', + }, + { + field: 'status', + title: '状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/member/group/index.vue b/apps/web-antd/src/views/member/group/index.vue index 692c3f277..b4de637e7 100644 --- a/apps/web-antd/src/views/member/group/index.vue +++ b/apps/web-antd/src/views/member/group/index.vue @@ -1,34 +1,127 @@ diff --git a/apps/web-antd/src/views/member/group/modules/form.vue b/apps/web-antd/src/views/member/group/modules/form.vue new file mode 100644 index 000000000..19f88b3e7 --- /dev/null +++ b/apps/web-antd/src/views/member/group/modules/form.vue @@ -0,0 +1,82 @@ + + + diff --git a/apps/web-antd/src/views/member/level/data.ts b/apps/web-antd/src/views/member/level/data.ts new file mode 100644 index 000000000..f9597b326 --- /dev/null +++ b/apps/web-antd/src/views/member/level/data.ts @@ -0,0 +1,158 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { z } from '#/adapter/form'; +import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '等级名称', + }, + { + component: 'InputNumber', + fieldName: 'level', + label: '等级', + componentProps: { + min: 0, + precision: 0, + }, + }, + { + fieldName: 'experience', + label: '升级经验', + component: 'InputNumber', + componentProps: { + min: 0, + precision: 0, + }, + }, + { + fieldName: 'discountPercent', + label: '享受折扣(%)', + component: 'InputNumber', + componentProps: { + min: 0, + max: 100, + precision: 0, + }, + }, + { + component: 'ImageUpload', + fieldName: 'icon', + label: '等级图标', + componentProps: { + maxSize: 1, + }, + }, + { + component: 'ImageUpload', + fieldName: 'backgroundUrl', + label: '等级背景图', + componentProps: { + maxSize: 1, + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '等级名称', + component: 'Input', + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'icon', + title: '等级图标', + cellRender: { + name: 'CellImage', + }, + }, + { + field: 'backgroundUrl', + title: '等级背景图', + cellRender: { + name: 'CellImage', + }, + }, + { + field: 'name', + title: '等级名称', + }, + { + field: 'level', + title: '等级', + }, + { + field: 'experience', + title: '升级经验', + }, + { + field: 'discountPercent', + title: '享受折扣(%)', + }, + { + field: 'status', + title: '状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/member/level/index.vue b/apps/web-antd/src/views/member/level/index.vue index 70fdaaf1c..a2dec54f7 100644 --- a/apps/web-antd/src/views/member/level/index.vue +++ b/apps/web-antd/src/views/member/level/index.vue @@ -1,34 +1,128 @@ diff --git a/apps/web-antd/src/views/member/level/modules/form.vue b/apps/web-antd/src/views/member/level/modules/form.vue new file mode 100644 index 000000000..a47230a9b --- /dev/null +++ b/apps/web-antd/src/views/member/level/modules/form.vue @@ -0,0 +1,82 @@ + + + diff --git a/apps/web-antd/src/views/member/point/record/data.ts b/apps/web-antd/src/views/member/point/record/data.ts new file mode 100644 index 000000000..153895546 --- /dev/null +++ b/apps/web-antd/src/views/member/point/record/data.ts @@ -0,0 +1,101 @@ +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'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'nickname', + label: '用户', + component: 'Input', + }, + { + fieldName: 'bizType', + label: '业务类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.MEMBER_POINT_BIZ_TYPE, 'number'), + }, + }, + { + fieldName: 'title', + label: '积分标题', + component: 'Input', + }, + { + fieldName: 'createDate', + label: '获得时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'createTime', + title: '获得时间', + formatter: 'formatDateTime', + }, + { + field: 'nickname', + title: '用户', + }, + { + field: 'point', + title: '获得积分', + slots: { + default: ({ row }) => { + return h( + Tag, + { + class: 'mr-5px', + color: row.point > 0 ? 'blue' : 'red', + }, + () => (row.point > 0 ? `+${row.point}` : row.point), + ); + }, + }, + }, + { + field: 'totalPoint', + title: '总积分', + }, + { + field: 'title', + title: '标题', + }, + { + field: 'description', + title: '描述', + }, + { + field: 'bizId', + title: '业务编码', + }, + { + field: 'bizType', + title: '业务类型', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.MEMBER_POINT_BIZ_TYPE }, + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/member/point/record/index.vue b/apps/web-antd/src/views/member/point/record/index.vue index 50ce2e1aa..2a29563a2 100644 --- a/apps/web-antd/src/views/member/point/record/index.vue +++ b/apps/web-antd/src/views/member/point/record/index.vue @@ -1,34 +1,46 @@ diff --git a/apps/web-antd/src/views/member/signin/config/data.ts b/apps/web-antd/src/views/member/signin/config/data.ts new file mode 100644 index 000000000..be1d8e272 --- /dev/null +++ b/apps/web-antd/src/views/member/signin/config/data.ts @@ -0,0 +1,101 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { z } from '#/adapter/form'; +import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'InputNumber', + fieldName: 'day', + label: '签到天数', + help: '只允许设置 1-7,默认签到 7 天为一个周期', + componentProps: { + min: 1, + max: 7, + precision: 0, + }, + }, + { + component: 'InputNumber', + fieldName: 'point', + label: '获得积分', + componentProps: { + min: 0, + precision: 0, + }, + }, + { + component: 'InputNumber', + fieldName: 'experience', + label: '奖励经验', + componentProps: { + min: 0, + precision: 0, + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'day', + title: '签到天数', + formatter: ({ cellValue }) => ['第', cellValue, '天'].join(' '), + }, + { + field: 'point', + title: '获得积分', + }, + { + field: 'experience', + title: '奖励经验', + }, + { + field: 'status', + title: '状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/member/signin/config/index.vue b/apps/web-antd/src/views/member/signin/config/index.vue index 1f2de1f06..42b5ef26b 100644 --- a/apps/web-antd/src/views/member/signin/config/index.vue +++ b/apps/web-antd/src/views/member/signin/config/index.vue @@ -1,34 +1,126 @@ diff --git a/apps/web-antd/src/views/member/signin/config/modules/form.vue b/apps/web-antd/src/views/member/signin/config/modules/form.vue new file mode 100644 index 000000000..f95f33adb --- /dev/null +++ b/apps/web-antd/src/views/member/signin/config/modules/form.vue @@ -0,0 +1,89 @@ + + + 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..059f2566b --- /dev/null +++ b/apps/web-antd/src/views/member/signin/record/data.ts @@ -0,0 +1,73 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { h } from 'vue'; + +import { Tag } from 'ant-design-vue'; + +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: ({ row }) => { + return h( + Tag, + { + class: 'mr-5px', + color: row.point > 0 ? 'blue' : 'red', + }, + () => (row.point > 0 ? `+${row.point}` : row.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..f129dc098 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,46 @@ diff --git a/apps/web-antd/src/views/member/tag/data.ts b/apps/web-antd/src/views/member/tag/data.ts new file mode 100644 index 000000000..73728e0c3 --- /dev/null +++ b/apps/web-antd/src/views/member/tag/data.ts @@ -0,0 +1,71 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { getRangePickerDefaultProps } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '标签名称', + rules: 'required', + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '标签名称', + component: 'Input', + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + minWidth: 200, + }, + { + field: 'name', + title: '标签名称', + minWidth: 200, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 150, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/member/tag/index.vue b/apps/web-antd/src/views/member/tag/index.vue index 532f0a838..1f59e7584 100644 --- a/apps/web-antd/src/views/member/tag/index.vue +++ b/apps/web-antd/src/views/member/tag/index.vue @@ -1,34 +1,134 @@ diff --git a/apps/web-antd/src/views/member/tag/modules/form.vue b/apps/web-antd/src/views/member/tag/modules/form.vue new file mode 100644 index 000000000..267bcde26 --- /dev/null +++ b/apps/web-antd/src/views/member/tag/modules/form.vue @@ -0,0 +1,88 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-account-info.vue b/apps/web-antd/src/views/member/user/components/user-account-info.vue new file mode 100644 index 000000000..097d9beba --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-account-info.vue @@ -0,0 +1,82 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-address-list.vue b/apps/web-antd/src/views/member/user/components/user-address-list.vue new file mode 100644 index 000000000..729cf4d70 --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-address-list.vue @@ -0,0 +1,87 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-balance-list.vue b/apps/web-antd/src/views/member/user/components/user-balance-list.vue new file mode 100644 index 000000000..e560e9032 --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-balance-list.vue @@ -0,0 +1,68 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-basic-info.vue b/apps/web-antd/src/views/member/user/components/user-basic-info.vue new file mode 100644 index 000000000..f0b4601ef --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-basic-info.vue @@ -0,0 +1,96 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-experience-record-list.vue b/apps/web-antd/src/views/member/user/components/user-experience-record-list.vue new file mode 100644 index 000000000..f1b6729f2 --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-experience-record-list.vue @@ -0,0 +1,130 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-point-list.vue b/apps/web-antd/src/views/member/user/components/user-point-list.vue new file mode 100644 index 000000000..295acf0cf --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-point-list.vue @@ -0,0 +1,73 @@ + + + diff --git a/apps/web-antd/src/views/member/user/components/user-sign-list.vue b/apps/web-antd/src/views/member/user/components/user-sign-list.vue new file mode 100644 index 000000000..e6a8a9e35 --- /dev/null +++ b/apps/web-antd/src/views/member/user/components/user-sign-list.vue @@ -0,0 +1,64 @@ + + + diff --git a/apps/web-antd/src/views/member/user/data.ts b/apps/web-antd/src/views/member/user/data.ts new file mode 100644 index 000000000..1232cca3a --- /dev/null +++ b/apps/web-antd/src/views/member/user/data.ts @@ -0,0 +1,452 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { h } from 'vue'; + +import { Tag } from 'ant-design-vue'; + +import { z } from '#/adapter/form'; +import { getSimpleGroupList } from '#/api/member/group'; +import { getSimpleLevelList } from '#/api/member/level'; +import { getSimpleTagList } from '#/api/member/tag'; +import { getAreaTree } from '#/api/system/area'; +import { + CommonStatusEnum, + convertToInteger, + DICT_TYPE, + formatToFraction, + getDictOptions, + getRangePickerDefaultProps, +} from '#/utils'; + +/** 修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Input', + fieldName: 'mobile', + label: '手机号', + rules: 'required', + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE).optional(), + }, + { + component: 'Input', + fieldName: 'nickname', + label: '用户昵称', + }, + { + component: 'ImageUpload', + fieldName: 'avatar', + label: '头像', + componentProps: { + maxSize: 1, + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '真实名字', + }, + { + fieldName: 'sex', + label: '用户性别', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + component: 'DatePicker', + fieldName: 'birthday', + label: '出生日期', + componentProps: { + format: 'YYYY-MM-DD', + }, + }, + { + component: 'ApiTreeSelect', + fieldName: 'areaId', + label: '所在地', + componentProps: { + api: () => getAreaTree(), + fieldNames: { label: 'name', value: 'id', children: 'children' }, + }, + }, + { + component: 'ApiSelect', + fieldName: 'tagIds', + label: '用户标签', + componentProps: { + api: () => getSimpleTagList(), + fieldNames: { label: 'name', value: 'id' }, + mode: 'multiple', + }, + }, + { + component: 'ApiSelect', + fieldName: 'groupId', + label: '用户分组', + componentProps: { + api: () => getSimpleGroupList(), + fieldNames: { label: 'name', value: 'id' }, + }, + }, + { + component: 'Textarea', + fieldName: 'mark', + label: '会员备注', + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'nickname', + label: '用户昵称', + component: 'Input', + }, + { + fieldName: 'mobile', + label: '手机号', + component: 'Input', + }, + { + fieldName: 'loginDate', + label: '登录时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + }, + }, + { + fieldName: 'createTime', + label: '注册时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + }, + }, + { + fieldName: 'tagIds', + label: '用户标签', + component: 'ApiSelect', + componentProps: { + api: () => getSimpleTagList(), + fieldNames: { label: 'name', value: 'id' }, + mode: 'multiple', + }, + }, + { + fieldName: 'levelId', + label: '用户等级', + component: 'ApiSelect', + componentProps: { + api: () => getSimpleLevelList(), + fieldNames: { label: 'name', value: 'id' }, + }, + }, + { + fieldName: 'groupId', + label: '用户分组', + component: 'ApiSelect', + componentProps: { + api: () => getSimpleGroupList(), + fieldNames: { label: 'name', value: 'id' }, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + }, + { + field: 'id', + title: '用户编号', + }, + { + field: 'avatar', + title: '头像', + slots: { + default: ({ row }) => { + return h('img', { + src: row.avatar, + style: { width: '40px' }, + }); + }, + }, + }, + { + field: 'mobile', + title: '手机号', + }, + { + field: 'nickname', + title: '昵称', + }, + { + field: 'levelName', + title: '等级', + }, + { + field: 'groupName', + title: '分组', + }, + { + field: 'tagNames', + title: '用户标签', + slots: { + default: ({ row }) => { + return row.tagNames?.map((tagName: string, index: number) => { + return h( + Tag, + { + key: index, + class: 'mr-5px', + color: 'blue', + }, + () => tagName, + ); + }); + }, + }, + }, + { + field: 'point', + title: '积分', + }, + { + field: 'status', + title: '状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'loginDate', + title: '登录时间', + formatter: 'formatDateTime', + }, + { + field: 'createTime', + title: '注册时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 200, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 修改用户等级 */ +export function useLeavelFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + label: '用户编号', + componentProps: { + disabled: true, + }, + }, + { + component: 'Input', + fieldName: 'nickname', + label: '用户昵称', + componentProps: { + disabled: true, + }, + }, + { + fieldName: 'point', + label: '用户等级', + component: 'ApiSelect', + componentProps: { + api: () => getSimpleLevelList(), + fieldNames: { label: 'name', value: 'id' }, + }, + }, + { + component: 'Textarea', + fieldName: 'reason', + label: '修改原因', + rules: 'required', + }, + ]; +} + +/** 修改用户余额 */ +export function useBalanceFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + label: '用户编号', + componentProps: { + disabled: true, + }, + }, + { + component: 'Input', + fieldName: 'nickname', + label: '用户昵称', + componentProps: { + disabled: true, + }, + }, + { + component: 'Input', + fieldName: 'balance', + label: '变动前余额(元)', + componentProps: { + disabled: true, + }, + }, + { + component: 'RadioGroup', + fieldName: 'changeType', + label: '变动类型', + componentProps: { + options: [ + { label: '增加', value: 1 }, + { label: '减少', value: -1 }, + ], + buttonStyle: 'solid', + optionType: 'button', + }, + defaultValue: 1, + }, + { + component: 'InputNumber', + fieldName: 'changeBalance', + label: '变动余额(元)', + rules: 'required', + componentProps: { + min: 0, + precision: 2, + step: 0.1, + }, + defaultValue: 0, + }, + { + component: 'Input', + fieldName: 'balanceResult', + label: '变动后余额(元)', + dependencies: { + triggerFields: ['changeBalance', 'changeType'], + disabled: true, + trigger(values, form) { + form.setFieldValue( + 'balanceResult', + formatToFraction( + convertToInteger(values.balance) + + convertToInteger(values.changeBalance) * values.changeType, + ), + ); + }, + }, + }, + ]; +} + +/** 修改用户积分 */ +export function usePointFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + label: '用户编号', + componentProps: { + disabled: true, + }, + }, + { + component: 'Input', + fieldName: 'nickname', + label: '用户昵称', + componentProps: { + disabled: true, + }, + }, + { + component: 'Input', + fieldName: 'point', + label: '变动前积分', + componentProps: { + disabled: true, + }, + }, + { + component: 'RadioGroup', + fieldName: 'changeType', + label: '变动类型', + componentProps: { + options: [ + { label: '增加', value: 1 }, + { label: '减少', value: -1 }, + ], + buttonStyle: 'solid', + optionType: 'button', + }, + defaultValue: 1, + }, + { + component: 'InputNumber', + fieldName: 'changePoint', + label: '变动积分', + rules: 'required', + componentProps: { + min: 0, + precision: 0, + }, + defaultValue: 0, + }, + { + component: 'Input', + fieldName: 'pointResult', + label: '变动后积分', + dependencies: { + triggerFields: ['changePoint', 'changeType'], + disabled: true, + trigger(values, form) { + form.setFieldValue( + 'pointResult', + values.point + values.changePoint * values.changeType || + values.point, + ); + }, + }, + rules: z.number().min(0), + }, + ]; +} diff --git a/apps/web-antd/src/views/member/user/index.vue b/apps/web-antd/src/views/member/user/index.vue index 19068b619..ae7343a3d 100644 --- a/apps/web-antd/src/views/member/user/index.vue +++ b/apps/web-antd/src/views/member/user/index.vue @@ -1,34 +1,196 @@ diff --git a/apps/web-antd/src/views/member/user/modules/balance-form.vue b/apps/web-antd/src/views/member/user/modules/balance-form.vue new file mode 100644 index 000000000..3c0b7377f --- /dev/null +++ b/apps/web-antd/src/views/member/user/modules/balance-form.vue @@ -0,0 +1,93 @@ + + + diff --git a/apps/web-antd/src/views/member/user/modules/detail.vue b/apps/web-antd/src/views/member/user/modules/detail.vue new file mode 100644 index 000000000..9c09a37eb --- /dev/null +++ b/apps/web-antd/src/views/member/user/modules/detail.vue @@ -0,0 +1,135 @@ + + diff --git a/apps/web-antd/src/views/member/user/modules/form.vue b/apps/web-antd/src/views/member/user/modules/form.vue new file mode 100644 index 000000000..d0cf808e8 --- /dev/null +++ b/apps/web-antd/src/views/member/user/modules/form.vue @@ -0,0 +1,77 @@ + + + diff --git a/apps/web-antd/src/views/member/user/modules/leavel-form.vue b/apps/web-antd/src/views/member/user/modules/leavel-form.vue new file mode 100644 index 000000000..88df806d9 --- /dev/null +++ b/apps/web-antd/src/views/member/user/modules/leavel-form.vue @@ -0,0 +1,77 @@ + + + diff --git a/apps/web-antd/src/views/member/user/modules/point-form.vue b/apps/web-antd/src/views/member/user/modules/point-form.vue new file mode 100644 index 000000000..df19e48c7 --- /dev/null +++ b/apps/web-antd/src/views/member/user/modules/point-form.vue @@ -0,0 +1,77 @@ + + + diff --git a/apps/web-antd/src/views/pay/notify/data.ts b/apps/web-antd/src/views/pay/notify/data.ts index adb419578..7fc2e6354 100644 --- a/apps/web-antd/src/views/pay/notify/data.ts +++ b/apps/web-antd/src/views/pay/notify/data.ts @@ -2,7 +2,7 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { getAppList } from '#/api/pay/app'; -import { DICT_TYPE, getDictOptions } from '#/utils'; +import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { @@ -54,11 +54,10 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'createTime', label: '创建时间', - component: 'DatePicker', + component: 'RangePicker', componentProps: { - type: 'daterange', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')], + ...getRangePickerDefaultProps(), + allowClear: true, }, }, ]; diff --git a/apps/web-antd/src/views/pay/order/data.ts b/apps/web-antd/src/views/pay/order/data.ts index b52b5bf26..9a05cc0cd 100644 --- a/apps/web-antd/src/views/pay/order/data.ts +++ b/apps/web-antd/src/views/pay/order/data.ts @@ -116,7 +116,6 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { title: '支付时间', field: 'successTime', - minWidth: 180, formatter: 'formatDateTime', }, { @@ -129,7 +128,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, { title: '操作', - width: 80, + width: 100, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antd/src/views/pay/order/index.vue b/apps/web-antd/src/views/pay/order/index.vue index 47eac2349..96432d852 100644 --- a/apps/web-antd/src/views/pay/order/index.vue +++ b/apps/web-antd/src/views/pay/order/index.vue @@ -31,8 +31,12 @@ function handleDetail(row: PayOrderApi.Order) { const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), + collapsed: false, }, gridOptions: { + cellConfig: { + height: 80, + }, columns: useGridColumns(), height: 'auto', keepSource: true, @@ -49,6 +53,9 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isCurrent: true, + isHover: true, + resizable: true, }, toolbarConfig: { refresh: { code: 'query' }, @@ -90,16 +97,18 @@ const [Grid, gridApi] = useVbenVxeGrid({ /> diff --git a/apps/web-antd/src/views/pay/refund/data.ts b/apps/web-antd/src/views/pay/refund/data.ts index 010777464..9a02febef 100644 --- a/apps/web-antd/src/views/pay/refund/data.ts +++ b/apps/web-antd/src/views/pay/refund/data.ts @@ -2,7 +2,12 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { getAppList } from '#/api/pay/app'; -import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '#/utils'; +import { + DICT_TYPE, + getIntDictOptions, + getRangePickerDefaultProps, + getStrDictOptions, +} from '#/utils'; /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { @@ -64,11 +69,10 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'createTime', label: '创建时间', - component: 'DatePicker', + component: 'RangePicker', componentProps: { - type: 'daterange', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')], + ...getRangePickerDefaultProps(), + allowClear: true, }, }, ]; @@ -80,76 +84,41 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', - minWidth: 100, - }, - { - field: 'createTime', - title: '创建时间', - minWidth: 180, - formatter: 'formatDateTime', - }, - { - field: 'payPrice', - title: '支付金额', - minWidth: 120, - cellRender: { - name: 'CellTag', - props: { - type: 'success', - content: '¥{payPrice}', - formatter: (value: number) => (value / 100).toFixed(2), - }, - }, - }, - { - field: 'refundPrice', - title: '退款金额', - minWidth: 120, - cellRender: { - name: 'CellTag', - props: { - type: 'danger', - content: '¥{refundPrice}', - formatter: (value: number) => (value / 100).toFixed(2), - }, - }, }, { field: 'merchantRefundId', title: '退款订单号', - minWidth: 300, - cellRender: { - name: 'CellTag', - props: { - type: 'info', - content: '商户 {merchantRefundId}', - }, - }, }, { field: 'channelRefundNo', title: '渠道退款单号', - minWidth: 200, - cellRender: { - name: 'CellTag', - props: { - type: 'success', - content: '{channelRefundNo}', - }, - }, + }, + { + field: 'payPrice', + title: '支付金额', + formatter: 'formatFraction', + }, + { + field: 'refundPrice', + title: '退款金额', + formatter: 'formatFraction', }, { field: 'status', title: '退款状态', - minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.PAY_REFUND_STATUS }, }, }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, { title: '操作', - width: 80, + width: 100, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antd/src/views/system/notify/template/index.vue b/apps/web-antd/src/views/system/notify/template/index.vue index 4d4369e5b..6a54e8286 100644 --- a/apps/web-antd/src/views/system/notify/template/index.vue +++ b/apps/web-antd/src/views/system/notify/template/index.vue @@ -117,7 +117,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ + diff --git a/apps/web-antd/src/views/system/post/index.vue b/apps/web-antd/src/views/system/post/index.vue index f0dbaa359..c17270606 100644 --- a/apps/web-antd/src/views/system/post/index.vue +++ b/apps/web-antd/src/views/system/post/index.vue @@ -96,7 +96,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ + diff --git a/apps/web-antd/src/views/system/sms/log/data.ts b/apps/web-antd/src/views/system/sms/log/data.ts index b4f5de358..4b4d632b0 100644 --- a/apps/web-antd/src/views/system/sms/log/data.ts +++ b/apps/web-antd/src/views/system/sms/log/data.ts @@ -84,18 +84,10 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', - minWidth: 100, - }, - { - field: 'createTime', - title: '创建时间', - minWidth: 180, - formatter: 'formatDateTime', }, { field: 'mobile', title: '手机号', - minWidth: 120, }, { field: 'templateContent', @@ -105,7 +97,6 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'sendStatus', title: '发送状态', - minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS }, @@ -114,13 +105,11 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'sendTime', title: '发送时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'receiveStatus', title: '接收状态', - minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS }, @@ -129,13 +118,11 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'receiveTime', title: '接收时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'channelCode', title: '短信渠道', - minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, @@ -144,17 +131,20 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'templateId', title: '模板编号', - minWidth: 100, }, { field: 'templateType', title: '短信类型', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE }, }, }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, { title: '操作', width: 80, diff --git a/apps/web-antd/src/views/system/sms/template/data.ts b/apps/web-antd/src/views/system/sms/template/data.ts index f24f7cfd2..f56273cdb 100644 --- a/apps/web-antd/src/views/system/sms/template/data.ts +++ b/apps/web-antd/src/views/system/sms/template/data.ts @@ -78,6 +78,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'Textarea', componentProps: { placeholder: '请输入模板内容', + rows: 4, }, rules: 'required', }, @@ -204,12 +205,10 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', - minWidth: 100, }, { field: 'type', title: '短信类型', - minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE }, @@ -218,12 +217,10 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'name', title: '模板名称', - minWidth: 120, }, { field: 'code', title: '模板编码', - minWidth: 120, }, { field: 'content', @@ -233,26 +230,18 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'status', title: '开启状态', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.COMMON_STATUS }, }, }, - { - field: 'remark', - title: '备注', - minWidth: 120, - }, { field: 'apiTemplateId', title: '短信 API 的模板编号', - minWidth: 180, }, { field: 'channelCode', title: '短信渠道', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, @@ -261,9 +250,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, + { + field: 'remark', + title: '备注', + }, { title: '操作', width: 220, diff --git a/apps/web-antd/src/views/system/sms/template/modules/form.vue b/apps/web-antd/src/views/system/sms/template/modules/form.vue index 8edbc735c..2bca1fd5f 100644 --- a/apps/web-antd/src/views/system/sms/template/modules/form.vue +++ b/apps/web-antd/src/views/system/sms/template/modules/form.vue @@ -31,7 +31,7 @@ const [Form, formApi] = useVbenForm({ class: 'w-full', }, formItemClass: 'col-span-2', - labelWidth: 80, + labelWidth: 120, }, layout: 'horizontal', schema: useFormSchema(), @@ -83,7 +83,7 @@ const [Modal, modalApi] = useVbenModal({ diff --git a/apps/web-antd/src/views/system/sms/template/modules/send-form.vue b/apps/web-antd/src/views/system/sms/template/modules/send-form.vue index ff495de5d..ae82a3b32 100644 --- a/apps/web-antd/src/views/system/sms/template/modules/send-form.vue +++ b/apps/web-antd/src/views/system/sms/template/modules/send-form.vue @@ -103,7 +103,7 @@ const buildFormSchema = () => {