feat: 统一 api 组件的调用方法

This commit is contained in:
xingyu4j
2025-10-20 10:41:57 +08:00
parent c6ef77694e
commit 30c7727361
88 changed files with 22772 additions and 554 deletions

View File

@@ -41,10 +41,8 @@ export function useFormSchema(): VbenFormSchema[] {
},
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
allowClear: true,
},
@@ -57,10 +55,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
allowClear: true,
},
@@ -85,10 +81,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getBusinessStatusTypeSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择商机状态组',
allowClear: true,
},

View File

@@ -53,7 +53,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '负责人',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
allowClear: true,

View File

@@ -42,10 +42,8 @@ export function useFormSchema(): VbenFormSchema[] {
},
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
},
defaultValue: userStore.userInfo?.id,
@@ -57,10 +55,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
},
},
@@ -139,10 +135,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleContactList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择直属上级',
},
},
@@ -195,10 +189,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
},
},

View File

@@ -47,10 +47,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
},
dependencies: {
triggerFields: ['id'],
@@ -66,10 +64,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
},
},
@@ -142,10 +138,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
},
defaultValue: userStore.userInfo?.id,
},
@@ -270,10 +264,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
allowClear: true,
},

View File

@@ -61,10 +61,8 @@ export function useFormSchema(): VbenFormSchema[] {
},
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
allowClear: true,
},
@@ -223,10 +221,8 @@ export function useImportFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
allowClear: true,
class: 'w-full',

View File

@@ -28,10 +28,8 @@ export function useDistributeFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
},
defaultValue: userStore.userInfo?.id,
rules: 'required',

View File

@@ -34,11 +34,9 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] {
label: '规则适用人群',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
fieldNames: {
label: 'nickname',
value: 'id',
},
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
mode: 'multiple',
allowClear: true,
placeholder: '请选择规则适用人群',

View File

@@ -85,8 +85,9 @@ export function useFormSchema(
});
return res.list;
},
labelField: 'name',
valueField: 'id',
mode: 'multiple',
fieldNames: { label: 'name', value: 'id' },
},
},
{
@@ -105,8 +106,9 @@ export function useFormSchema(
});
return res.list;
},
labelField: 'name',
valueField: 'id',
mode: 'multiple',
fieldNames: { label: 'name', value: 'id' },
},
},
];

View File

@@ -23,7 +23,7 @@ export function useTransferFormSchema(): VbenFormSchema[] {
label: '选择新负责人',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
},
@@ -116,7 +116,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '选择人员',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
},

View File

@@ -43,10 +43,8 @@ export function useFormSchema(): VbenFormSchema[] {
},
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
allowClear: true,
},

View File

@@ -45,10 +45,8 @@ export function useFormSchema(): VbenFormSchema[] {
},
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
allowClear: true,
},
@@ -61,10 +59,8 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
},
dependencies: {
@@ -193,10 +189,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
allowClear: true,
},

View File

@@ -29,10 +29,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
fieldNames: {
label: 'nickname',
value: 'id',
},
labelField: 'nickname',
valueField: 'id',
},
dependencies: {
triggerFields: ['id'],
@@ -48,11 +46,10 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
allowClear: true,
},
},
{
@@ -63,6 +60,7 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
options: [],
placeholder: '请选择合同',
allowClear: true,
},
dependencies: {
triggerFields: ['customerId'],
@@ -156,10 +154,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
allowClear: true,
},

View File

@@ -99,7 +99,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '员工',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择员工',

View File

@@ -73,7 +73,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '员工',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
allowClear: true,
labelField: 'nickname',
valueField: 'id',

View File

@@ -64,7 +64,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '员工',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择员工',

View File

@@ -68,7 +68,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '员工',
component: 'ApiSelect',
componentProps: {
api: getSimpleUserList,
api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择员工',