feat:简化 ApiSelect 的 api 写法~

This commit is contained in:
YunaiV
2025-10-21 09:06:17 +08:00
parent 3b4c01cedf
commit ad00cf839c
103 changed files with 224 additions and 238 deletions

View File

@@ -40,7 +40,7 @@ export function useFormSchema(): VbenFormSchema[] {
disabled: (values) => values.id,
},
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
@@ -54,7 +54,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '客户名称',
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
@@ -80,7 +80,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '商机状态组',
component: 'ApiSelect',
componentProps: {
api: () => getBusinessStatusTypeSimpleList(),
api: getBusinessStatusTypeSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择商机状态组',

View File

@@ -53,7 +53,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '负责人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
allowClear: true,
@@ -121,7 +121,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '地址',
component: 'ApiTreeSelect',
componentProps: {
api: () => getAreaTree(),
api: getAreaTree,
fieldNames: { label: 'name', value: 'id', children: 'children' },
placeholder: '请选择地址',
},

View File

@@ -41,7 +41,7 @@ export function useFormSchema(): VbenFormSchema[] {
disabled: (values) => values.id,
},
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
@@ -54,7 +54,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
@@ -134,7 +134,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '直属上级',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleContactList(),
api: getSimpleContactList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择直属上级',
@@ -145,7 +145,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '地址',
component: 'ApiTreeSelect',
componentProps: {
api: () => getAreaTree(),
api: getAreaTree,
fieldNames: { label: 'name', value: 'id', children: 'children' },
placeholder: '请选择地址',
},
@@ -188,7 +188,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '客户',
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',

View File

@@ -46,7 +46,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '负责人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
},
@@ -63,7 +63,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
@@ -137,7 +137,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '公司签约人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
},
@@ -263,7 +263,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '客户',
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',

View File

@@ -60,7 +60,7 @@ export function useFormSchema(): VbenFormSchema[] {
disabled: (values) => values.id,
},
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
@@ -130,7 +130,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '地址',
component: 'ApiTreeSelect',
componentProps: {
api: () => getAreaTree(),
api: getAreaTree,
fieldNames: { label: 'name', value: 'id', children: 'children' },
placeholder: '请选择地址',
allowClear: true,
@@ -220,7 +220,7 @@ export function useImportFormSchema(): VbenFormSchema[] {
label: '负责人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',

View File

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

View File

@@ -34,7 +34,7 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] {
label: '规则适用人群',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
mode: 'multiple',

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

@@ -42,7 +42,7 @@ export function useFormSchema(): VbenFormSchema[] {
disabled: (values) => values.id,
},
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',

View File

@@ -44,7 +44,7 @@ export function useFormSchema(): VbenFormSchema[] {
disabled: (values) => values.id,
},
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',
@@ -58,7 +58,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
@@ -188,7 +188,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '客户',
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',

View File

@@ -28,7 +28,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '负责人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
},
@@ -45,7 +45,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
rules: 'required',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',
@@ -153,7 +153,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '客户',
component: 'ApiSelect',
componentProps: {
api: () => getCustomerSimpleList(),
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择客户',

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: '请选择员工',