修改品牌组件
This commit is contained in:
@@ -4,19 +4,28 @@ export async function pageBrand(params) {
|
||||
const res = await request.get('/common/autoBrand', {
|
||||
params
|
||||
});
|
||||
return res.data;
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function pageSeries(params) {
|
||||
const res = await request.get('/common/autoSeries', {
|
||||
params
|
||||
});
|
||||
return res.data;
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function pageAutoCar(params) {
|
||||
const res = await request.get('/common/autoCar', {
|
||||
params
|
||||
});
|
||||
return res.data;
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -114,8 +114,9 @@
|
||||
async loadBrands(filter = '') {
|
||||
this.brandLoading = true;
|
||||
try {
|
||||
const res = await pageBrand({ nameLike: filter });
|
||||
this.brandList = res;
|
||||
pageBrand({ nameLike: filter }).then((res) => {
|
||||
this.brandList = res;
|
||||
});
|
||||
this.seriesList = [];
|
||||
this.modelList = [];
|
||||
} catch (error) {
|
||||
@@ -128,8 +129,9 @@
|
||||
async loadSeriesList(brandId) {
|
||||
this.seriesLoading = true;
|
||||
try {
|
||||
const res = await pageSeries({ brandId });
|
||||
this.seriesList = res;
|
||||
pageSeries({ brandId }).then((res) => {
|
||||
this.seriesList = res;
|
||||
});
|
||||
this.modelList = [];
|
||||
} catch (error) {
|
||||
this.$message.error('车系加载失败');
|
||||
|
||||
Reference in New Issue
Block a user