This commit is contained in:
@@ -280,7 +280,9 @@
|
||||
})),
|
||||
config: {
|
||||
clearable: true,
|
||||
filterable: true
|
||||
filterable: true,
|
||||
remote: true,
|
||||
remoteMethod: (query: string) => searchShops(query)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -534,6 +536,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索店铺(用于搜索表单远程搜索)
|
||||
const searchShops = async (query: string) => {
|
||||
try {
|
||||
const params: any = {
|
||||
page: 1,
|
||||
page_size: 20
|
||||
}
|
||||
if (query) {
|
||||
params.shop_name = query
|
||||
}
|
||||
const res = await ShopService.getShops(params)
|
||||
if (res.code === 0) {
|
||||
shopOptions.value = res.data.items || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Search shops failed:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 处理店铺选择变化
|
||||
const handleShopChange = (value: any) => {
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user