diff --git a/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts b/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts index 6cba23c16e1d8e26ec979de6155962b4f6648c25..52bc962909ce980d6339e0d063a61e3e8775b472 100644 --- a/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts +++ b/apps/web-antd/src/api/mall/promotion/coupon/coupon.ts @@ -40,9 +40,9 @@ export namespace MallCouponApi { } /** 发送优惠券 */ - export interface SendCoupon { + export interface CouponSendReqVO { /** 优惠券编号 */ - couponId: number; + templateId: number; /** 用户编号数组 */ userIds: number[]; } @@ -62,6 +62,6 @@ export function getCouponPage(params: PageParam) { } /** 发送优惠券 */ -export function sendCoupon(data: MallCouponApi.SendCoupon) { +export function sendCoupon(data: MallCouponApi.CouponSendReqVO) { return requestClient.post('/promotion/coupon/send', data); } diff --git a/apps/web-antd/src/api/member/level/index.ts b/apps/web-antd/src/api/member/level/index.ts index 850d9b8203190cef38d0139dbd8e5ee0e7799152..a856e505b682b42e51e3bf4ec6b2278bee624d12 100644 --- a/apps/web-antd/src/api/member/level/index.ts +++ b/apps/web-antd/src/api/member/level/index.ts @@ -11,6 +11,7 @@ export namespace MemberLevelApi { icon: string; bgUrl: string; status: number; + createTime?: Date; } } diff --git a/apps/web-antd/src/api/member/user/index.ts b/apps/web-antd/src/api/member/user/index.ts index e8a5a35b71ee21c140d5f9c2bb852af44ebfd74c..e02f332eddfeca9a56c7f1066fd28e73b8654574 100644 --- a/apps/web-antd/src/api/member/user/index.ts +++ b/apps/web-antd/src/api/member/user/index.ts @@ -20,20 +20,20 @@ export namespace MemberUserApi { status: number; areaId?: number; areaName?: string; - levelName: null | string; - point?: null | number; - totalPoint?: null | number; - experience?: null | number; + levelName: string; + point?: number; + totalPoint?: number; + experience?: number; } /** 会员用户等级更新信息 */ - export interface UserLevelUpdate { + export interface UserUpdateLevelReqVO { id: number; levelId: number; } /** 会员用户积分更新信息 */ - export interface UserPointUpdate { + export interface UserPointUpdateReqVO { id: number; point: number; } @@ -60,11 +60,11 @@ export function updateUser(data: MemberUserApi.User) { } /** 修改会员用户等级 */ -export function updateUserLevel(data: MemberUserApi.UserLevelUpdate) { +export function updateUserLevel(data: MemberUserApi.UserUpdateLevelReqVO) { return requestClient.put('/member/user/update-level', data); } /** 修改会员用户积分 */ -export function updateUserPoint(data: MemberUserApi.UserPointUpdate) { +export function updateUserPoint(data: MemberUserApi.UserPointUpdateReqVO) { return requestClient.put('/member/user/update-point', data); } diff --git a/apps/web-antd/src/api/pay/wallet/balance/index.ts b/apps/web-antd/src/api/pay/wallet/balance/index.ts index e3440f9117821268608ebf2f46223f1ae7269149..fc061d6d8c6b93ba0c7708add4bdc03e4dbbbaee 100644 --- a/apps/web-antd/src/api/pay/wallet/balance/index.ts +++ b/apps/web-antd/src/api/pay/wallet/balance/index.ts @@ -28,6 +28,12 @@ export namespace PayWalletApi { totalRecharge?: number; freezePrice?: number; } + + /** 钱包修改余额 */ + export interface PayWalletUpdateBalanceReqVO { + userId: number; + balance: number; + } } /** 查询用户钱包详情 */ @@ -48,6 +54,8 @@ export function getWalletPage(params: PayWalletApi.WalletPageReqVO) { } /** 修改会员钱包余额 */ -export function updateWalletBalance(data: PayWalletApi.Wallet) { +export function updateWalletBalance( + data: PayWalletApi.PayWalletUpdateBalanceReqVO, +) { return requestClient.put('/pay/wallet/update-balance', data); } diff --git a/apps/web-antd/src/router/routes/modules/member.ts b/apps/web-antd/src/router/routes/modules/member.ts index 4f4e81723922facf951bb8c543bb17622a6bbf73..fc8bece088067ac33c36254abfa49c191f92a53a 100644 --- a/apps/web-antd/src/router/routes/modules/member.ts +++ b/apps/web-antd/src/router/routes/modules/member.ts @@ -3,11 +3,12 @@ import type { RouteRecordRaw } from 'vue-router'; const routes: RouteRecordRaw[] = [ { path: '/member/user/detail', - component: () => import('#/views/member/user/modules/detail.vue'), + component: () => import('#/views/member/user/detail/index.vue'), name: 'MemberUserDetail', meta: { title: '会员详情', icon: 'lucide:user', + activePath: '/member/user', hideInMenu: true, }, }, diff --git a/apps/web-antd/src/views/ai/chat/index/data.ts b/apps/web-antd/src/views/ai/chat/index/data.ts index a33776f768ed4d531ad6d46f83925dcc86d79513..8cc4ed6f36ce12400989474276e989314aad907f 100644 --- a/apps/web-antd/src/views/ai/chat/index/data.ts +++ b/apps/web-antd/src/views/ai/chat/index/data.ts @@ -41,7 +41,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '温度参数', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入温度参数', class: 'w-full', precision: 2, @@ -55,7 +54,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '回复数 Token 数', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入回复数 Token 数', class: 'w-full', min: 0, @@ -68,7 +66,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '上下文数量', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入上下文数量', class: 'w-full', min: 0, diff --git a/apps/web-antd/src/views/ai/knowledge/document/data.ts b/apps/web-antd/src/views/ai/knowledge/document/data.ts index d093ea03a78cbd0fbbbe4df57c89a6f56c89ab31..a6433040ac77582b7619bedbe90137635760ec56 100644 --- a/apps/web-antd/src/views/ai/knowledge/document/data.ts +++ b/apps/web-antd/src/views/ai/knowledge/document/data.ts @@ -50,7 +50,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '检索 topK', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入检索 topK', class: 'w-full', min: 0, @@ -63,7 +62,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '检索相似度阈值', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入检索相似度阈值', class: 'w-full', min: 0, diff --git a/apps/web-antd/src/views/ai/knowledge/knowledge/data.ts b/apps/web-antd/src/views/ai/knowledge/knowledge/data.ts index 37c5cb99be49e62bb8c54663df23fdff5499d1d4..9bdbf5b25ffba9a3c52e332a3b7c1e17c7372c40 100644 --- a/apps/web-antd/src/views/ai/knowledge/knowledge/data.ts +++ b/apps/web-antd/src/views/ai/knowledge/knowledge/data.ts @@ -52,7 +52,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '检索 topK', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入检索 topK', class: 'w-full', min: 0, @@ -65,7 +64,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '检索相似度阈值', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入检索相似度阈值', class: 'w-full', min: 0, diff --git a/apps/web-antd/src/views/ai/model/chatRole/data.ts b/apps/web-antd/src/views/ai/model/chatRole/data.ts index 81b3c9a16cd4cc9c349aa1d69fd9d769deda0027..2e1bc63bf066ef50693d0058de41f0f20559739b 100644 --- a/apps/web-antd/src/views/ai/model/chatRole/data.ts +++ b/apps/web-antd/src/views/ai/model/chatRole/data.ts @@ -136,7 +136,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '角色排序', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入角色排序', class: 'w-full', }, diff --git a/apps/web-antd/src/views/ai/model/model/data.ts b/apps/web-antd/src/views/ai/model/model/data.ts index 4c11b9e5fcc45f9ee0c10fed1b712dae12030ab7..31f3ab05b55a7f7b9216c1a639b404816e1bffa1 100644 --- a/apps/web-antd/src/views/ai/model/model/data.ts +++ b/apps/web-antd/src/views/ai/model/model/data.ts @@ -72,7 +72,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '模型排序', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入模型排序', class: 'w-full', }, @@ -94,7 +93,6 @@ export function useFormSchema(): VbenFormSchema[] { label: '温度参数', component: 'InputNumber', componentProps: { - controlsPosition: 'right', placeholder: '请输入温度参数', class: 'w-full', min: 0, @@ -115,7 +113,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { min: 0, max: 8192, - controlsPosition: 'right', placeholder: '请输入回复数 Token 数', class: 'w-full', }, @@ -134,7 +131,6 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { min: 0, max: 20, - controlsPosition: 'right', placeholder: '请输入上下文数量', class: 'w-full', }, diff --git a/apps/web-antd/src/views/bpm/category/data.ts b/apps/web-antd/src/views/bpm/category/data.ts index 9269546fa24727c4d11854237fa3249eeef5654a..0667efbc332b16b6c0fa51512b8d60177f8b2bb5 100644 --- a/apps/web-antd/src/views/bpm/category/data.ts +++ b/apps/web-antd/src/views/bpm/category/data.ts @@ -61,7 +61,6 @@ export function useFormSchema(): VbenFormSchema[] { component: 'InputNumber', componentProps: { min: 0, - controlsPosition: 'right', placeholder: '请输入分类排序', class: 'w-full', }, diff --git a/apps/web-antd/src/views/crm/contract/config/data.ts b/apps/web-antd/src/views/crm/contract/config/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..2792b36015607665f28006318f1d9bb7e7fcbee6 --- /dev/null +++ b/apps/web-antd/src/views/crm/contract/config/data.ts @@ -0,0 +1,37 @@ +import type { VbenFormSchema } from '#/adapter/form'; + +export const schema: VbenFormSchema[] = [ + { + component: 'RadioGroup', + fieldName: 'notifyEnabled', + label: '提前提醒设置', + componentProps: { + options: [ + { label: '提醒', value: true }, + { label: '不提醒', value: false }, + ], + }, + defaultValue: true, + }, + { + component: 'InputNumber', + fieldName: 'notifyDays', + componentProps: { + min: 0, + precision: 0, + }, + renderComponentContent: () => ({ + addonBefore: () => '提前', + addonAfter: () => '天提醒', + }), + dependencies: { + triggerFields: ['notifyEnabled'], + show: (values) => values.notifyEnabled, + trigger(values) { + if (!values.notifyEnabled) { + values.notifyDays = undefined; + } + }, + }, + }, +]; diff --git a/apps/web-antd/src/views/crm/contract/config/index.vue b/apps/web-antd/src/views/crm/contract/config/index.vue index 932dbe30e57793d15031005280809365062490cf..d85040bccec1b0d0eae46bf436a36fc40c541386 100644 --- a/apps/web-antd/src/views/crm/contract/config/index.vue +++ b/apps/web-antd/src/views/crm/contract/config/index.vue @@ -1,5 +1,4 @@ + + diff --git a/apps/web-antd/src/views/mall/trade/config/index.vue b/apps/web-antd/src/views/mall/trade/config/index.vue index 247c634a70f97e8918ada43cd34221b7eb43a7ec..e683fe21bd70582f4a22f6ca5894c1efbd3ccfeb 100644 --- a/apps/web-antd/src/views/mall/trade/config/index.vue +++ b/apps/web-antd/src/views/mall/trade/config/index.vue @@ -64,7 +64,6 @@ const [Form, formApi] = useVbenForm({ labelClass: 'w-2/6', }, wrapperClass: 'grid-cols-1', - actionWrapperClass: 'text-center', handleSubmit: onSubmit, layout: 'horizontal', resetButtonOptions: { diff --git a/apps/web-antd/src/views/member/config/data.ts b/apps/web-antd/src/views/member/config/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f168418cc30a3680f73fe4d2032c6384342619c --- /dev/null +++ b/apps/web-antd/src/views/member/config/data.ts @@ -0,0 +1,52 @@ +import type { VbenFormSchema } from '#/adapter/form'; + +export const schema: VbenFormSchema[] = [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Switch', + fieldName: 'pointTradeDeductEnable', + label: '积分抵扣', + help: '下单积分是否抵用订单金额', + }, + { + component: 'InputNumber', + fieldName: 'pointTradeDeductUnitPrice', + label: '积分抵扣', + help: '积分抵用比例(1 积分抵多少金额),单位:元', + componentProps: { + min: 0, + precision: 2, + class: 'w-full', + placeholder: '请输入积分抵扣单价', + }, + }, + { + component: 'InputNumber', + fieldName: 'pointTradeDeductMaxPrice', + label: '积分抵扣最大值', + help: '单次下单积分使用上限,0 不限制', + componentProps: { + min: 0, + class: 'w-full', + placeholder: '请输入积分抵扣最大值', + }, + }, + { + component: 'InputNumber', + fieldName: 'pointTradeGivePoint', + label: '1 元赠送多少分', + help: '下单支付金额按比例赠送积分(实际支付 1 元赠送多少积分)', + componentProps: { + min: 0, + class: 'w-full', + placeholder: '请输入赠送积分比例', + }, + }, +]; diff --git a/apps/web-antd/src/views/member/config/index.vue b/apps/web-antd/src/views/member/config/index.vue index b0e17b485eac5b91a12fa028781a54b6ece120c6..3c5e0407b3565816fa8247e726e19173c1fb97b6 100644 --- a/apps/web-antd/src/views/member/config/index.vue +++ b/apps/web-antd/src/views/member/config/index.vue @@ -4,6 +4,7 @@ import type { MemberConfigApi } from '#/api/member/config'; import { onMounted, ref } from 'vue'; import { Page } from '@vben/common-ui'; +import { fenToYuan, yuanToFen } from '@vben/utils'; import { Card, message } from 'ant-design-vue'; @@ -11,95 +12,47 @@ import { useVbenForm } from '#/adapter/form'; import { getConfig, saveConfig } from '#/api/member/config'; import { $t } from '#/locales'; -const emit = defineEmits(['success']); +import { schema } from './data'; + const formData = ref(); const [Form, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 - labelClass: 'w-2/6', + labelWidth: 120, }, layout: 'horizontal', - wrapperClass: 'grid-cols-1', - actionWrapperClass: 'text-center', - schema: [ - { - component: 'Input', - fieldName: 'id', - dependencies: { - triggerFields: [''], - show: () => false, - }, - }, - { - component: 'Switch', - fieldName: 'pointTradeDeductEnable', - label: '积分抵扣', - help: '开启后,用户可以积分抵扣', - }, - { - component: 'InputNumber', - fieldName: 'pointTradeDeductUnitPrice', - label: '积分抵扣单价', - help: '用户每消费1元,可以抵扣多少积分', - componentProps: { - min: 0, - precision: 2, - class: 'w-full', - }, - }, - { - component: 'InputNumber', - fieldName: 'pointTradeDeductMaxPrice', - label: '积分抵扣最大值', - help: '单次下单积分使用上限,0 不限制', - componentProps: { - min: 0, - class: 'w-full', - }, - }, - { - component: 'InputNumber', - fieldName: 'pointTradeGivePoint', - label: '1 元赠送多少分', - help: '下单支付金额按比例赠送积分(实际支付 1 元赠送多少积分)', - componentProps: { - min: 0, - class: 'w-full', - }, - }, - ], - // 提交函数 - handleSubmit: onSubmit, + schema, + handleSubmit, }); -async function onSubmit() { +/** 提交表单 */ +async function handleSubmit() { const { valid } = await formApi.validate(); if (!valid) { return; } // 提交表单 const data = (await formApi.getValues()) as MemberConfigApi.Config; - formApi.setState({ commonConfig: { disabled: true } }); - try { - await saveConfig(data); - // 关闭并提示 - emit('success'); - message.success($t('ui.actionMessage.operationSuccess')); - } finally { - formApi.setState({ commonConfig: { disabled: false } }); - } + // 转换金额单位 + data.pointTradeDeductUnitPrice = yuanToFen(data.pointTradeDeductUnitPrice); + await saveConfig(data); + // 关闭并提示 + message.success($t('ui.actionMessage.operationSuccess')); } +/** 获取配置 */ async function getConfigInfo() { - try { - const res = await getConfig(); - formData.value = res; - } catch (error) { - console.error(error); - } + const res = await getConfig(); + formData.value = res; + // 转换金额单位 + res.pointTradeDeductUnitPrice = Number.parseFloat( + fenToYuan(res.pointTradeDeductUnitPrice), + ); + // 设置到 values + await formApi.setValues(res); } +/** 初始化 */ onMounted(() => { getConfigInfo(); }); diff --git a/apps/web-antd/src/views/member/group/data.ts b/apps/web-antd/src/views/member/group/data.ts index 938774138d02ba19cc776b354c8110bbb2b855ac..7f8c1afcde200051d793591edd8e9dfbddf6ed63 100644 --- a/apps/web-antd/src/views/member/group/data.ts +++ b/apps/web-antd/src/views/member/group/data.ts @@ -10,17 +10,18 @@ import { z } from '#/adapter/form'; export function useFormSchema(): VbenFormSchema[] { return [ { - component: 'Input', fieldName: 'id', + component: 'Input', dependencies: { triggerFields: [''], show: () => false, }, }, { - component: 'Input', fieldName: 'name', label: '分组名称', + component: 'Input', + rules: 'required', }, { fieldName: 'status', @@ -33,6 +34,14 @@ export function useFormSchema(): VbenFormSchema[] { }, rules: z.number().default(CommonStatusEnum.ENABLE), }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + }, + }, ]; } @@ -43,14 +52,28 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'name', label: '分组名称', component: 'Input', + componentProps: { + placeholder: '请输入分组名称', + allowClear: true, + }, }, { fieldName: 'status', label: '状态', component: 'Select', componentProps: { - allowClear: true, options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + placeholder: ['开始日期', '结束日期'], + allowClear: true, }, }, ]; @@ -62,14 +85,23 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', + minWidth: 100, }, { field: 'name', title: '分组名称', + minWidth: 150, + }, + { + field: 'remark', + title: '备注', + minWidth: 200, + showOverflow: 'tooltip', }, { field: 'status', title: '状态', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.COMMON_STATUS }, @@ -78,6 +110,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'createTime', title: '创建时间', + minWidth: 180, formatter: 'formatDateTime', }, { diff --git a/apps/web-antd/src/views/member/group/index.vue b/apps/web-antd/src/views/member/group/index.vue index b7da6c8cdee1cf908f65e87455ec79728a2f094d..095a95d5668ccb4963015009e1b1dc91ac73404c 100644 --- a/apps/web-antd/src/views/member/group/index.vue +++ b/apps/web-antd/src/views/member/group/index.vue @@ -19,7 +19,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -40,11 +40,9 @@ async function handleDelete(row: MemberGroupApi.Group) { duration: 0, }); try { - await deleteGroup(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - }); - onRefresh(); + await deleteGroup(row.id!); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); } finally { hideLoading(); } @@ -71,6 +69,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -82,7 +81,7 @@ const [Grid, gridApi] = useVbenVxeGrid({