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

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

View File

@@ -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

@@ -10,7 +10,7 @@ import { useUserStore } from '@vben/stores';
import { getSimpleDeliveryPickUpStoreList } from '#/api/mall/trade/delivery/pickUpStore';
import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 **/
/** 关联数据 */
const userStore = useUserStore();
const pickUpStoreList = ref<MallDeliveryPickUpStoreApi.PickUpStore[]>([]);
getSimpleDeliveryPickUpStoreList().then((res) => {
@@ -40,10 +40,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Select',
componentProps: {
options: pickUpStoreList,
fieldNames: {
label: 'name',
value: 'id',
},
labelField: 'name',
valueField: 'id',
placeholder: '请选择自提门店',
},
defaultValue: pickUpStoreList.value[0]?.id,

View File

@@ -147,7 +147,8 @@ export function useBindFormSchema(): VbenFormSchema[] {
rules: 'required',
componentProps: {
api: () => getSimpleUserList(),
fieldNames: { label: 'nickname', value: 'id' },
labelField: 'nickname',
valueField: 'id',
mode: 'tags',
allowClear: true,
placeholder: '请选择门店店员',

View File

@@ -74,11 +74,9 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '快递公司',
component: 'ApiSelect',
componentProps: {
api: getSimpleDeliveryExpressList,
fieldNames: {
label: 'name',
value: 'id',
},
api: () => getSimpleDeliveryExpressList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择快递公司',
allowClear: true,
},
@@ -92,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: '请选择自提门店',
allowClear: true,
},
@@ -374,11 +370,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,
},
@@ -428,11 +422,9 @@ export function useDeliveryFormSchema(): VbenFormSchema[] {
label: '物流公司',
component: 'ApiSelect',
componentProps: {
api: getSimpleDeliveryExpressList,
fieldNames: {
label: 'name',
value: 'id',
},
api: () => getSimpleDeliveryExpressList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择物流公司',
},
dependencies: {