feat:【antd】【crm】客户限制配置的重构与修复部分缺陷
This commit is contained in:
@@ -3,6 +3,7 @@ import type { VbenFormSchema } from '@vben/common-ui';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
import { handleTree } from '@vben/utils';
|
||||
|
||||
import { LimitConfType } from '#/api/crm/customer/limitConfig';
|
||||
@@ -20,6 +21,14 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] {
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'type',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'userIds',
|
||||
label: '规则适用人群',
|
||||
@@ -30,10 +39,10 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] {
|
||||
label: 'nickname',
|
||||
value: 'id',
|
||||
},
|
||||
mode: 'tags',
|
||||
mode: 'multiple',
|
||||
allowClear: true,
|
||||
placeholder: '请选择规则适用人群',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
fieldName: 'deptIds',
|
||||
@@ -49,7 +58,6 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] {
|
||||
placeholder: '请选择规则适用部门',
|
||||
treeDefaultExpandAll: true,
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
fieldName: 'maxCount',
|
||||
@@ -58,21 +66,29 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] {
|
||||
? '拥有客户数上限'
|
||||
: '锁定客户数上限',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: `请输入${
|
||||
LimitConfType.CUSTOMER_QUANTITY_LIMIT === confType
|
||||
? '拥有客户数上限'
|
||||
: '锁定客户数上限'
|
||||
}`,
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
fieldName: 'dealCountEnabled',
|
||||
label: '成交客户是否占用拥有客户数',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: true },
|
||||
{ label: '否', value: false },
|
||||
],
|
||||
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => confType === LimitConfType.CUSTOMER_QUANTITY_LIMIT,
|
||||
},
|
||||
defaultValue: false,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user