feat: 统一 api 组件的调用方法
This commit is contained in:
@@ -23,7 +23,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '商品',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSpuSimpleList,
|
||||
api: () => getSpuSimpleList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择商品',
|
||||
|
||||
@@ -113,7 +113,7 @@ export function useValueFormSchema(): VbenFormSchema[] {
|
||||
component: 'ApiSelect',
|
||||
componentProps: (values) => {
|
||||
return {
|
||||
api: getPropertySimpleList,
|
||||
api: () => getPropertySimpleList(),
|
||||
placeholder: '请选择属性',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
@@ -153,7 +153,7 @@ export function useValueGridFormSchema(): VbenFormSchema[] {
|
||||
label: '属性项',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getPropertySimpleList,
|
||||
api: () => getPropertySimpleList(),
|
||||
placeholder: '请选择属性项',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
|
||||
@@ -181,7 +181,7 @@ export function useDeliveryFormSchema(): VbenFormSchema[] {
|
||||
label: '运费模板',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleTemplateList,
|
||||
api: () => getSimpleTemplateList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
},
|
||||
|
||||
@@ -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: '请选择文章分类',
|
||||
|
||||
@@ -74,7 +74,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '快递公司',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleDeliveryExpressList,
|
||||
api: () => getSimpleDeliveryExpressList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择快递公司',
|
||||
@@ -90,11 +90,9 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '自提门店',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleDeliveryPickUpStoreList,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
api: () => getSimpleDeliveryPickUpStoreList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择自提门店',
|
||||
clearable: true,
|
||||
},
|
||||
@@ -374,11 +372,9 @@ export function useAddressFormSchema(): VbenFormSchema[] {
|
||||
component: 'ApiTreeSelect',
|
||||
componentProps: {
|
||||
api: () => getAreaTree(),
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
},
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
childrenField: 'children',
|
||||
placeholder: '请选择收件人所在地',
|
||||
treeDefaultExpandAll: true,
|
||||
},
|
||||
@@ -426,7 +422,7 @@ export function useDeliveryFormSchema(): VbenFormSchema[] {
|
||||
label: '物流公司',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleDeliveryExpressList,
|
||||
api: () => getSimpleDeliveryExpressList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择物流公司',
|
||||
|
||||
Reference in New Issue
Block a user