|
|
@ -137,21 +137,26 @@ |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<div style="width: 500px"> |
|
|
|
<el-select v-model="searchValue" |
|
|
|
filterable |
|
|
|
style="width: 500px" |
|
|
|
remote |
|
|
|
:reserve-keyword="true" |
|
|
|
placeholder="请输入关键词" |
|
|
|
:remote-method="remoteMethod" |
|
|
|
:loading="loading"> |
|
|
|
<el-option v-for="(item,index) in searchOptions" |
|
|
|
@click.native="handleClickKey(index)" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-form-item prop="location" style="display: block"> |
|
|
|
<el-select |
|
|
|
v-model="formData.location" |
|
|
|
filterable |
|
|
|
remote |
|
|
|
:reserve-keyword="true" |
|
|
|
placeholder="请输入关键词" |
|
|
|
:remote-method="remoteMethod" |
|
|
|
:loading="loading" |
|
|
|
@keyup.enter.native="remoteMethod(formData.location)" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in searchOptions" |
|
|
|
@click.native="handleClickKey(index)" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<div id="app_event" |
|
|
|
class="div_map"></div> |
|
|
|
</div> |
|
|
@ -191,7 +196,7 @@ |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in gridList" |
|
|
|
@click.native="handleChangeGrid" |
|
|
|
:key="item.value" |
|
|
|
:key=`abc-${value}` |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
@ -230,7 +235,6 @@ import { requestPost } from "@/js/dai/request"; |
|
|
|
import formVltHelper from "dai-js/tools/formVltHelper"; |
|
|
|
import daiMap from "@/utils/dai-map"; |
|
|
|
import { isCard } from "@/utils/validate"; |
|
|
|
|
|
|
|
let loading; // 加载动画 |
|
|
|
var map; |
|
|
|
var search; |
|
|
@ -575,12 +579,12 @@ export default { |
|
|
|
|
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap (latitude, longitude) { |
|
|
|
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
map = new daiMap( |
|
|
|
document.getElementById("app_event"), |
|
|
|
{ latitude, longitude }, |
|
|
|
{ |
|
|
|
zoom: 16.2, // 设置地图缩放级别 |
|
|
|
zoom: 17.2, // 设置地图缩放级别 |
|
|
|
pitch: 43.5, // 设置俯仰角 |
|
|
|
rotation: 45, // 设置地图旋转角度 |
|
|
|
} |
|
|
@ -593,6 +597,7 @@ export default { |
|
|
|
|
|
|
|
map.setCenter(latitude, longitude); |
|
|
|
map.setMarker(latitude, longitude); |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -603,7 +608,7 @@ export default { |
|
|
|
this.formData.latitude = lat; |
|
|
|
this.formData.longitude = lng; |
|
|
|
map.setMarker(lat, lng); |
|
|
|
|
|
|
|
this.$EventBus.$emit('map',{lat,lng}) |
|
|
|
let { msg, data } = await map.getAddress(lat, lng); |
|
|
|
if (msg == "success") { |
|
|
|
this.formData.address = data.address |
|
|
@ -614,34 +619,29 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async remoteMethod (query) { |
|
|
|
|
|
|
|
if (query !== '') { |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
const { msg, data } = await map.searchNearby(query); |
|
|
|
this.loading = false; |
|
|
|
this.resultList = [] |
|
|
|
|
|
|
|
if (msg == "success" && data.resultList && data.resultList.length > 0) { |
|
|
|
|
|
|
|
if (data.resultList && data.resultList.length > 0) { |
|
|
|
this.resultList = data.resultList |
|
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
|
return { value: `${item.hotPointID}`, label: `${item.address + item.name}` }; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = [ |
|
|
|
{ |
|
|
|
value: '0', |
|
|
|
label: '未检索到结果' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = []; |
|
|
|
} |
|
|
|
this.loading = true; |
|
|
|
const { msg, data } = await map.searchNearby(query); |
|
|
|
this.loading = false; |
|
|
|
this.resultList = []; |
|
|
|
if (msg == 'success' && data.resultList && data.resultList.length > 0) { |
|
|
|
if (data.resultList && data.resultList.length > 0) { |
|
|
|
this.resultList = data.resultList; |
|
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
|
return { value: `${item.id}`, label: `${item.address + item.name}` }; |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = [ |
|
|
|
{ |
|
|
|
value: '0', |
|
|
|
label: '未检索到结果' |
|
|
|
} |
|
|
|
]; |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = []; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleClickKey (index) { |
|
|
|