This commit is contained in:
2026-02-08 17:01:33 +08:00
parent 0668eea99b
commit 3211cc32ce
76 changed files with 5054 additions and 2423 deletions

View File

@@ -1,6 +1,8 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { getLevelName } from '#/utils/agent';
// 表单配置
export function useFormSchema(): VbenFormSchema[] {
return [
@@ -11,10 +13,18 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
},
{
component: 'Input',
fieldName: 'level_name',
label: '等级名称',
component: 'Select',
fieldName: 'level',
label: '等级',
rules: 'required',
componentProps: {
disabled: true,
options: [
{ label: '普通代理', value: 1 },
{ label: '黄金代理', value: 2 },
{ label: '钻石代理', value: 3 },
],
},
},
{
component: 'Input',
@@ -23,13 +33,9 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
},
{
component: 'DatePicker',
fieldName: 'membership_expiry_time',
label: '会员到期时间',
rules: 'required',
componentProps: {
showTime: true,
},
component: 'Input',
fieldName: 'wechat_id',
label: '微信号',
},
];
}
@@ -47,6 +53,24 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'region',
label: '区域',
},
{
component: 'Select',
fieldName: 'level',
label: '等级',
componentProps: {
allowClear: true,
options: [
{ label: '普通代理', value: 1 },
{ label: '黄金代理', value: 2 },
{ label: '钻石代理', value: 3 },
],
},
},
{
component: 'InputNumber',
fieldName: 'team_leader_id',
label: '团队首领ID',
},
{
component: 'RangePicker',
fieldName: 'create_time',
@@ -71,14 +95,16 @@ export function useColumns(): VxeTableGridOptions['columns'] {
width: 100,
},
{
field: 'level_name',
title: '等级名称',
field: 'agent_code',
title: '代理编码',
width: 100,
},
{
field: 'level',
title: '等级',
width: 120,
formatter: ({ cellValue }: { cellValue: string }) => {
if (cellValue === '' || cellValue === 'normal') {
return '普通代理';
}
return cellValue;
formatter: ({ cellValue }: { cellValue: number }) => {
return getLevelName(cellValue);
},
},
{
@@ -95,41 +121,25 @@ export function useColumns(): VxeTableGridOptions['columns'] {
cellRender: {
name: 'CellTag',
options: [
{ value: 'approved', color: 'success', label: '已认证' },
{ value: 'pending', color: 'warning', label: '审核中' },
{ value: 'rejected', color: 'error', label: '已拒绝' },
{ value: '', color: 'default', label: '未认证' },
{ value: true, color: 'success', label: '已认证' },
{ value: false, color: 'default', label: '未认证' },
],
},
field: 'real_name_status',
field: 'is_real_name',
title: '实名认证状态',
width: 120,
},
{
field: 'real_name',
title: '实名姓名',
field: 'wechat_id',
title: '微信号',
width: 120,
formatter: ({ cellValue }: { cellValue: string }) => {
if (!cellValue) return '-';
return cellValue;
},
visible: false,
},
{
field: 'id_card',
title: '身份证号',
width: 180,
formatter: ({ cellValue }: { cellValue: string }) => {
if (!cellValue) return '-';
// 只显示前6位和后4位中间用*代替
return `${cellValue.slice(0, 6)}${'*'.repeat(8)}${cellValue.slice(-4)}`;
},
},
{
field: 'membership_expiry_time',
title: '会员到期时间',
width: 160,
sortable: true,
sortType: 'string' as const,
field: 'team_leader_id',
title: '团队首领ID',
width: 120,
visible: false,
},
{
field: 'balance',