|
@ -40,6 +40,7 @@ |
|
|
placeholder="请输入关键词" |
|
|
placeholder="请输入关键词" |
|
|
:remote-method="remoteMethod" |
|
|
:remote-method="remoteMethod" |
|
|
:loading="loading" |
|
|
:loading="loading" |
|
|
|
|
|
@keyup.enter.native="remoteMethod(formData.location)" |
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="(item, index) in searchOptions" |
|
|
v-for="(item, index) in searchOptions" |
|
@ -241,7 +242,17 @@ export default { |
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
console.log('详情数据', data); |
|
|
console.log('详情数据', data); |
|
|
this.formData = { ...data }; |
|
|
this.formData = { ...data }; |
|
|
|
|
|
// this.remoteMethod("青岛"); |
|
|
|
|
|
// this.list = this.searchOptions.map(item => { |
|
|
|
|
|
// return { value: item.value, label: item.label }; |
|
|
|
|
|
// }); |
|
|
|
|
|
// this.formData.location.push(this.list[0].value); |
|
|
|
|
|
// this.remoteMethod(this.list[0].label);//调用远程搜索函数 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.remoteMethod("对对对"); |
|
|
this.initMap(); |
|
|
this.initMap(); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg); |
|
|
this.$message.error(msg); |
|
|
} |
|
|
} |
|
@ -367,6 +378,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async remoteMethod(query) { |
|
|
async remoteMethod(query) { |
|
|
|
|
|
console.log("query",query) |
|
|
if (query !== '') { |
|
|
if (query !== '') { |
|
|
this.loading = true; |
|
|
this.loading = true; |
|
|
const { msg, data } = await map.searchNearby(query); |
|
|
const { msg, data } = await map.searchNearby(query); |
|
@ -379,6 +391,7 @@ export default { |
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
return { value: `${item.id}`, label: `${item.address + item.name}` }; |
|
|
return { value: `${item.id}`, label: `${item.address + item.name}` }; |
|
|
}); |
|
|
}); |
|
|
|
|
|
console.log("this.searchOptions",this.searchOptions ) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.searchOptions = [ |
|
|
this.searchOptions = [ |
|
|