feat:【mall 商城】分销用户的迁移(antd 30%)

This commit is contained in:
YunaiV
2025-10-09 13:29:18 +08:00
parent 96a1232b1e
commit f2c34d42b0
2 changed files with 76 additions and 79 deletions

View File

@@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallBrokerageUserApi } from '#/api/mall/trade/brokerage/user';
import { fenToYuan } from '@vben/utils';
@@ -29,6 +30,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
{ label: '无', value: false },
],
},
defaultValue: true,
},
{
fieldName: 'createTime',
@@ -43,7 +45,12 @@ export function useGridFormSchema(): VbenFormSchema[] {
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions['columns'] {
export function useGridColumns<T = MallBrokerageUserApi.BrokerageUser>(
onBrokerageEnabledChange?: (
newEnabled: boolean,
row: T,
) => PromiseLike<boolean | undefined>,
): VxeTableGridOptions['columns'] {
return [
{
field: 'id',
@@ -56,11 +63,6 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
minWidth: 70,
cellRender: {
name: 'CellImage',
props: {
width: 24,
height: 24,
shape: 'circle',
},
},
},
{
@@ -111,7 +113,17 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
field: 'brokerageEnabled',
title: '推广资格',
minWidth: 80,
slots: { default: 'brokerageEnabled' },
align: 'center',
cellRender: {
attrs: { beforeChange: onBrokerageEnabledChange },
name: 'CellSwitch',
props: {
checkedValue: true,
uncheckedValue: false,
checkedChildren: '有',
unCheckedChildren: '无',
},
},
},
{
field: 'brokerageTime',