From 740da3f5451656a68e5cc595f5ad0e70a2117221 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 10 Oct 2025 09:30:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90mall=20=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E3=80=91=E5=88=86=E9=94=80=E7=94=A8=E6=88=B7=E7=9A=84=20list?= =?UTF-8?q?=20modal=20=E8=BF=81=E7=A7=BB=EF=BC=88antd=20100%=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/trade/brokerage/record/index.vue | 1 - .../views/mall/trade/brokerage/user/data.ts | 175 ++++++++++++++++++ .../brokerage/user/modules/create-form.vue | 9 +- .../user/modules/order-list-modal.vue | 140 +------------- .../brokerage/user/modules/update-form.vue | 9 +- .../user/modules/user-list-modal.vue | 122 +----------- .../mall/trade/brokerage/withdraw/data.ts | 4 +- 7 files changed, 206 insertions(+), 254 deletions(-) diff --git a/apps/web-antd/src/views/mall/trade/brokerage/record/index.vue b/apps/web-antd/src/views/mall/trade/brokerage/record/index.vue index 17a2ad396..a95964874 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/record/index.vue +++ b/apps/web-antd/src/views/mall/trade/brokerage/record/index.vue @@ -19,7 +19,6 @@ const [Grid] = useVbenVxeGrid({ columns: useGridColumns(), height: 'auto', keepSource: true, - showOverflow: 'tooltip', proxyConfig: { ajax: { query: async ({ page }, formValues) => { diff --git a/apps/web-antd/src/views/mall/trade/brokerage/user/data.ts b/apps/web-antd/src/views/mall/trade/brokerage/user/data.ts index e6f60dd46..e3d30da08 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/user/data.ts +++ b/apps/web-antd/src/views/mall/trade/brokerage/user/data.ts @@ -2,6 +2,8 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MallBrokerageUserApi } from '#/api/mall/trade/brokerage/user'; +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; import { fenToYuan } from '@vben/utils'; import { getRangePickerDefaultProps } from '#/utils'; @@ -180,3 +182,176 @@ export function useUpdateFormSchema(): VbenFormSchema[] { }, ]; } + +/** 用户列表弹窗搜索表单配置 */ +export function useUserListFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'level', + label: '用户类型', + component: 'Select', + componentProps: { + options: [ + { label: '全部', value: undefined }, + { label: '一级推广人', value: '1' }, + { label: '二级推广人', value: '2' }, + ], + }, + }, + { + fieldName: 'bindUserTime', + label: '绑定时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 用户列表弹窗表格列配置 */ +export function useUserListColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '用户编号', + minWidth: 80, + }, + { + field: 'avatar', + title: '头像', + minWidth: 70, + cellRender: { + name: 'CellImage', + props: { + width: 24, + height: 24, + shape: 'circle', + }, + }, + }, + { + field: 'nickname', + title: '昵称', + minWidth: 80, + }, + { + field: 'brokerageUserCount', + title: '推广人数', + minWidth: 80, + }, + { + field: 'brokerageOrderCount', + title: '推广订单数量', + minWidth: 110, + }, + { + field: 'brokerageEnabled', + title: '推广资格', + minWidth: 80, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'bindUserTime', + title: '绑定时间', + width: 180, + formatter: 'formatDateTime', + }, + ]; +} + +/** 推广订单列表弹窗搜索表单配置 */ +export function useOrderListFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'sourceUserLevel', + label: '用户类型', + component: 'Select', + componentProps: { + options: [ + { label: '全部', value: 0 }, + { label: '一级推广人', value: 1 }, + { label: '二级推广人', value: 2 }, + ], + }, + defaultValue: 0, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + placeholder: '请选择状态', + allowClear: true, + options: getDictOptions(DICT_TYPE.BROKERAGE_RECORD_STATUS, 'number'), + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 推广订单列表弹窗表格列配置 */ +export function useOrderListColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'bizId', + title: '订单编号', + minWidth: 80, + }, + { + field: 'sourceUserId', + title: '用户编号', + minWidth: 80, + }, + { + field: 'sourceUserAvatar', + title: '头像', + minWidth: 70, + cellRender: { + name: 'CellImage', + props: { + width: 24, + height: 24, + }, + }, + }, + { + field: 'sourceUserNickname', + title: '昵称', + minWidth: 80, + }, + { + field: 'price', + title: '佣金', + minWidth: 100, + formatter: ({ row }) => `¥${fenToYuan(row.price)}`, + }, + { + field: 'status', + title: '状态', + minWidth: 85, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.BROKERAGE_RECORD_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + width: 180, + formatter: 'formatDateTime', + }, + ]; +} diff --git a/apps/web-antd/src/views/mall/trade/brokerage/user/modules/create-form.vue b/apps/web-antd/src/views/mall/trade/brokerage/user/modules/create-form.vue index 3caa0718b..501883f62 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/user/modules/create-form.vue +++ b/apps/web-antd/src/views/mall/trade/brokerage/user/modules/create-form.vue @@ -4,6 +4,7 @@ import type { MallBrokerageUserApi } from '#/api/mall/trade/brokerage/user'; import { ref } from 'vue'; import { useVbenModal } from '@vben/common-ui'; +import { DICT_TYPE } from '@vben/constants'; import { $t } from '@vben/locales'; import { formatDate, isEmpty } from '@vben/utils'; @@ -14,7 +15,6 @@ import { Divider, InputSearch, message, - Tag, } from 'ant-design-vue'; import { useVbenForm } from '#/adapter/form'; @@ -23,6 +23,7 @@ import { getBrokerageUser, } from '#/api/mall/trade/brokerage/user'; import { getUser } from '#/api/member/user'; +import { DictTag } from '#/components/dict-tag'; import { useCreateFormSchema } from '../data'; @@ -154,8 +155,10 @@ async function handleSearchUser(id: number, userType: string) { {{ bindUser?.nickname }} - - + {{ formatDate(bindUser?.brokerageTime) }} diff --git a/apps/web-antd/src/views/mall/trade/brokerage/user/modules/order-list-modal.vue b/apps/web-antd/src/views/mall/trade/brokerage/user/modules/order-list-modal.vue index c9742b6ae..019308cf6 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/user/modules/order-list-modal.vue +++ b/apps/web-antd/src/views/mall/trade/brokerage/user/modules/order-list-modal.vue @@ -1,150 +1,28 @@