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

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

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: '请选择文章分类',
@@ -144,7 +144,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,
fieldNames: { label: 'name', value: 'id', children: 'children' },
placeholder: '请选择省市区',
},
@@ -146,7 +146,7 @@ export function useBindFormSchema(): VbenFormSchema[] {
label: '门店店员',
rules: 'required',
componentProps: {
api: () => getSimpleUserList(),
api: getSimpleUserList,
labelField: 'nickname',
valueField: 'id',
mode: 'tags',

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: '请选择自提门店',
@@ -369,7 +369,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: '请选择物流公司',