修复地图搜索不展示搜索结果问题

This commit is contained in:
2025-02-12 15:00:13 +08:00
parent c37166e38c
commit 0e3759b34d
5 changed files with 25 additions and 30 deletions

View File

@@ -132,12 +132,7 @@
<el-input v-model="state.form.lat" placeholder="纬度" disabled></el-input>
</el-col>
<el-col :span="4">
<el-button
type="primary"
plain
icon="el-icon-place"
@click="state.showLocation = true"
>
<el-button type="primary" plain icon="place" @click="state.showLocation = true">
选择坐标
</el-button>
</el-col>
@@ -179,26 +174,10 @@
:visible="true"
@select="onSearchResult"
@choose="onSearchResult"
city="西安"
></el-amap-search-box>
</el-amap>
</div>
<!-- <div class="search_box">
<el-amap-search-box
:search-option="searchOption"
:on-search-result="onSearchResult"
></el-amap-search-box>
</div> -->
<div class="search_wrap">
<div class="item" v-for="item in state.locationSearchList" :key="item.id">
<div class="left">
<div class="name">{{ item.name }}-{{ item.address }}</div>
<div class="location">经纬度{{ item.lng }},{{ item.lat }}</div>
</div>
<div class="btn">
<el-button type="primary" @click="selectLocationHandle(item)">选择</el-button>
</div>
</div>
</div>
</div>
</el-dialog>
<el-dialog
@@ -249,7 +228,7 @@ import uploadImg from "@/assets/images/upload.png";
// { geocode, ShopApi.getList }
import ShopApi from "@/api/account/shop";
const validateLogo = (rule, value, callback) => {
if (!this.form.logo) {
if (!state.form.logo) {
callback(new Error("请上传门店logo"));
} else {
callback();
@@ -407,7 +386,7 @@ function submitHandle() {
state.formLoading = false;
$notify({
title: "成功",
message: `${this.form.id ? "编辑" : "添加"}成功`,
message: `${state.form.id ? "编辑" : "添加"}成功`,
type: "success",
});
close();
@@ -427,7 +406,7 @@ function handleSuccess(response, file, fileList) {
}
function handleBeforeRemove(file, fileList) {
for (let i = 0; i < state.files.length; i++) {
if (this.files[i].uid === file.uid) {
if (state.files[i].uid === file.uid) {
crudQiNiu.del([state.files[i].id]).then((res) => {});
return true;
}
@@ -472,7 +451,7 @@ function uploadClose() {
state.showUpload = false;
}
function reset() {
state.form = { ...this.resetForm };
state.form = { ...state.resetForm };
}
defineExpose({
show,
@@ -517,7 +496,8 @@ defineExpose({
}
}
}
.amap-sug-result {
z-index: 1000;
z-index: 2000;
}
</style>