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

@@ -51,7 +51,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
placeholder: '请选择成员',
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
mode: 'tags',

View File

@@ -25,7 +25,7 @@ export function useImportTableFormSchema(): VbenFormSchema[] {
label: '数据源',
component: 'ApiSelect',
componentProps: {
api: () => getDataSourceConfigList(),
api: getDataSourceConfigList,
labelField: 'name',
valueField: 'id',
autoSelect: 'first',

View File

@@ -23,7 +23,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '商品',
component: 'ApiSelect',
componentProps: {
api: () => getSpuSimpleList(),
api: getSpuSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择商品',

View File

@@ -113,7 +113,7 @@ export function useValueFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: (values) => {
return {
api: () => getPropertySimpleList(),
api: getPropertySimpleList,
placeholder: '请选择属性',
labelField: 'name',
valueField: 'id',

View File

@@ -50,7 +50,7 @@ export function useInfoFormSchema(): VbenFormSchema[] {
label: '商品品牌',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleBrandList(),
api: getSimpleBrandList,
labelField: 'name',
valueField: 'id',
allowClear: true,
@@ -181,7 +181,7 @@ export function useDeliveryFormSchema(): VbenFormSchema[] {
label: '运费模板',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleTemplateList(),
api: getSimpleTemplateList,
labelField: 'name',
valueField: 'id',
},

View File

@@ -38,7 +38,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '文章分类',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleArticleCategoryList(),
api: getSimpleArticleCategoryList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择文章分类',
@@ -140,7 +140,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '文章分类',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleArticleCategoryList(),
api: getSimpleArticleCategoryList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择文章分类',

View File

@@ -65,7 +65,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiTreeSelect',
rules: 'required',
componentProps: {
api: () => getAreaTree(),
api: getAreaTree,
labelField: 'name',
valueField: 'id',
childrenField: 'children',
@@ -147,7 +147,7 @@ export function useBindFormSchema(): VbenFormSchema[] {
label: '门店店员',
rules: 'required',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
multiple: true,

View File

@@ -74,7 +74,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '快递公司',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleDeliveryExpressList(),
api: getSimpleDeliveryExpressList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择快递公司',
@@ -90,7 +90,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '自提门店',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleDeliveryPickUpStoreList(),
api: getSimpleDeliveryPickUpStoreList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择自提门店',
@@ -371,7 +371,7 @@ export function useAddressFormSchema(): VbenFormSchema[] {
label: '所在地',
component: 'ApiTreeSelect',
componentProps: {
api: () => getAreaTree(),
api: getAreaTree,
labelField: 'name',
valueField: 'id',
childrenField: 'children',
@@ -422,7 +422,7 @@ export function useDeliveryFormSchema(): VbenFormSchema[] {
label: '物流公司',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleDeliveryExpressList(),
api: getSimpleDeliveryExpressList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择物流公司',

View File

@@ -86,7 +86,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '所在地',
component: 'ApiTreeSelect',
componentProps: {
api: () => getAreaTree(),
api: getAreaTree,
labelField: 'name',
valueField: 'id',
childrenField: 'children',
@@ -98,7 +98,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '用户标签',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleTagList(),
api: getSimpleTagList,
labelField: 'name',
valueField: 'id',
multiple: true,
@@ -110,7 +110,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '用户分组',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleGroupList(),
api: getSimpleGroupList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择用户分组',
@@ -171,7 +171,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '用户标签',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleTagList(),
api: getSimpleTagList,
labelField: 'name',
valueField: 'id',
multiple: true,
@@ -184,7 +184,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '用户等级',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleLevelList(),
api: getSimpleLevelList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择用户等级',
@@ -196,7 +196,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '用户分组',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleGroupList(),
api: getSimpleGroupList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择用户分组',
@@ -325,7 +325,7 @@ export function useLevelFormSchema(): VbenFormSchema[] {
label: '用户等级',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleLevelList(),
api: getSimpleLevelList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择用户等级',

View File

@@ -104,7 +104,7 @@ const [Grid] = useVbenVxeGrid({
component: 'ApiSelect',
componentProps: {
clearable: true,
api: () => getSimpleDeliveryExpressList(),
api: getSimpleDeliveryExpressList,
labelField: 'name',
valueField: 'id',
placeholder: '全部',
@@ -120,7 +120,7 @@ const [Grid] = useVbenVxeGrid({
label: '自提门店',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleDeliveryPickUpStoreList(),
api: getSimpleDeliveryPickUpStoreList,
labelField: 'name',
valueField: 'id',
},

View File

@@ -21,7 +21,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '应用编号',
component: 'ApiSelect',
componentProps: {
api: () => getAppList(),
api: getAppList,
labelField: 'name',
valueField: 'id',
autoSelect: 'first',

View File

@@ -74,7 +74,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '负责人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择负责人',

View File

@@ -183,7 +183,7 @@ export function useDataFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: (values) => {
return {
api: () => getSimpleDictTypeList(),
api: getSimpleDictTypeList,
placeholder: '请输入字典类型',
labelField: 'name',
valueField: 'type',

View File

@@ -59,7 +59,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '邮箱账号',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleMailAccountList(),
api: getSimpleMailAccountList,
labelField: 'mail',
valueField: 'id',
clearable: true,

View File

@@ -42,7 +42,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '邮箱账号',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleMailAccountList(),
api: getSimpleMailAccountList,
labelField: 'mail',
valueField: 'id',
placeholder: '请选择邮箱账号',
@@ -177,7 +177,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '邮箱账号',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleMailAccountList(),
api: getSimpleMailAccountList,
labelField: 'mail',
valueField: 'id',
clearable: true,

View File

@@ -193,7 +193,7 @@ export function useSendNotifyFormSchema(): VbenFormSchema[] {
label: '接收人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
placeholder: '请选择接收人',

View File

@@ -16,7 +16,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '操作人',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
clearable: true,

View File

@@ -30,7 +30,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '短信渠道',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleSmsChannelList(),
api: getSimpleSmsChannelList,
labelField: 'signature',
valueField: 'id',
clearable: true,

View File

@@ -52,7 +52,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '短信渠道',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleSmsChannelList(),
api: getSimpleSmsChannelList,
labelField: 'signature',
valueField: 'id',
placeholder: '请选择短信渠道',
@@ -144,7 +144,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '短信渠道',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleSmsChannelList(),
api: getSimpleSmsChannelList,
labelField: 'signature',
valueField: 'id',
clearable: true,

View File

@@ -35,7 +35,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '租户套餐',
component: 'ApiSelect',
componentProps: {
api: () => getTenantPackageList(),
api: getTenantPackageList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择租户套餐',

View File

@@ -70,7 +70,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '岗位',
component: 'ApiSelect',
componentProps: {
api: () => getSimplePostList(),
api: getSimplePostList,
labelField: 'name',
valueField: 'id',
multiple: true,
@@ -212,7 +212,7 @@ export function useAssignRoleFormSchema(): VbenFormSchema[] {
label: '角色',
component: 'ApiSelect',
componentProps: {
api: () => getSimpleRoleList(),
api: getSimpleRoleList,
labelField: 'name',
valueField: 'id',
multiple: true,