Browse Source

党建活动

dev-烟台中转登录
jiangyy 3 years ago
parent
commit
34d825708e
  1. 140
      src/views/modules/communityParty/regionalParty/activitysDetail.vue
  2. 196
      src/views/modules/communityParty/regionalParty/activitysForm.vue
  3. 141
      src/views/modules/communityParty/regionalParty/unitsDetail.vue
  4. 191
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  5. 215
      src/views/modules/partymember/icpartyorg-add-or-update.vue

140
src/views/modules/communityParty/regionalParty/activitysDetail.vue

@ -43,7 +43,7 @@
<span class="info-title-2">活动地图</span>
<div class="div_map">
<div id="app_act_detail"></div>
<div id="app_detail_activity"></div>
</div>
</div>
@ -101,7 +101,7 @@ export default {
diaDestroy () {
if (map) {
map.destroy()
// map.destroy()
}
},
@ -120,122 +120,54 @@ export default {
this.initLoading = true
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.$nextTick(() => {
this.initMap()
if (!map) {
this.initMap(latitude, longitude)
} else {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}
})
this.endLoading()
},
// init
initMap () {
//
var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_act_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
// init
initMap (latitude, longitude) {
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
map = new daiMap(
document.getElementById("app_detail_activity"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address
//
});
},
//

196
src/views/modules/communityParty/regionalParty/activitysForm.vue

@ -241,6 +241,10 @@ export default {
}
return {
formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false,
@ -255,7 +259,7 @@ export default {
},
components: { Tinymce },
mounted () {
this.initMap()
// this.initMap()
},
@ -270,13 +274,6 @@ export default {
await this.loadService()
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
this.formType = type
if (activityId) {
@ -284,11 +281,17 @@ export default {
this.formData.id = activityId
await this.loadFormData()
} else {
this.formData.latitude = latitude
this.formData.longitude = longitude
}
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.$nextTick(() => {
if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
} else {
map.setCenter(this.formData.latitude, this.formData.longitude);
map.setMarker(this.formData.latitude, this.formData.longitude);
}
})
this.endLoading()
},
@ -351,8 +354,7 @@ export default {
}
console.log(this.formData.content)
// map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude)))
// this.setMarker(this.formData.latitude, this.formData.longitude)
} else {
this.$message.error(msg)
}
@ -404,118 +406,90 @@ export default {
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 16.2, //
pitch: 43.5, //
rotation: 45 //
})
initMap (latitude, longitude) {
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
map = new daiMap(
document.getElementById("app_activity"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchNearby({
keyword: this.keyWords,
radius: 1000,
autoExtend: true,
center: map.getCenter(),
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
async handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
const { lat, lng } = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
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 {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
this.searchOptions = [];
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.address = result.result.address
//
});
},
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.address = selPosition.address + selPosition.name
},
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.activityId = ''
this.keyWords = ''
this.formData = {

141
src/views/modules/communityParty/regionalParty/unitsDetail.vue

@ -45,7 +45,7 @@
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
<div id="app_detail_unit"></div>
</div>
</div>
@ -96,7 +96,7 @@ export default {
diaDestroy () {
if (map) {
map.destroy()
// map.destroy()
}
},
@ -107,22 +107,11 @@ export default {
this.initLoading = true
console.log(this.formData)
// await nextTick(200)
this.$nextTick(() => {
this.initMap()
})
this.endLoading()
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
@ -130,116 +119,44 @@ export default {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
// debugger
console.log('lat' + latitude + ',lon' + longitude)
var center = new window.TMap.LatLng(latitude, longitude)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
this.$nextTick(() => {
if (!map) {
this.initMap(latitude, longitude)
} else {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
this.endLoading()
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
// init
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_detail_unit"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address
//
});
},
//
startLoading () {
loading = Loading.service({

191
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -176,6 +176,10 @@ export default {
}
return {
formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false,
@ -202,13 +206,7 @@ export default {
await this.loadService()
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
this.formType = type
if (unitId) {
@ -216,14 +214,13 @@ export default {
this.formData.id = unitId
await this.loadFormData()
} else {
this.formData.latitude = latitude
this.formData.longitude = longitude
}
this.$nextTick(() => {
this.initMap()
this.setMarker(this.formData.latitude, this.formData.longitude)
})
// if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
// }
@ -266,8 +263,7 @@ export default {
}
this.formData = { ...data }
// map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
// this.setMarker(this.formData.latitude, this.formData.longitude)
} else {
this.$message.error(msg)
}
@ -333,123 +329,94 @@ export default {
},
// init
initMap () {
//
var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 16.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
initMap (latitude, longitude) {
geocoder = new TMap.service.Geocoder(); //
map = new daiMap(
document.getElementById("app_unit"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchNearby({
keyword: this.keyWords,
radius: 1000,
autoExtend: true,
center: map.getCenter(),
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
async handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
const { lat, lng } = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
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 {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
this.searchOptions = [];
}
},
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.address = result.result.address
//
});
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.address = selPosition.address + selPosition.name
},
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
if (map) {
console.log(map)
map.destroy()
// map.destroy()
}
this.unitId = ''
this.keyWords = ''

215
src/views/modules/partymember/icpartyorg-add-or-update.vue

@ -88,7 +88,6 @@
</el-form-item>
<el-form-item label="地图位置"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width: 500px">
<el-select v-model="searchValue"
@ -110,9 +109,15 @@
class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="详细地址"
prop="address">
<el-input style="width: 300px"
v-model="dataForm.address"
placeholder="详细地址"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button @click="handleCancle">{{ $t("cancel") }}</el-button>
<el-button type="primary"
@click="dataFormSubmitHandle()">{{
$t("confirm")
@ -134,6 +139,11 @@ import debounce from "lodash/debounce";
export default {
data () {
return {
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
visible: false,
keyWords: "",
dataForm: {
@ -168,6 +178,15 @@ export default {
};
},
methods: {
handleCancle () {
this.resetData()
this.visible = false
},
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
},
init () {
this.visible = true;
this.agencyId = localStorage.getItem("agencyId");
@ -184,7 +203,15 @@ export default {
this.getInfo();
} else {
this.setPartyOrgType();
this.initMap();
let { latitude, longitude } = this.$store.state.user;
this.$nextTick(() => {
if (!map) {
this.initMap(latitude, longitude);
} else {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}
})
if (this.dataForm.orgId) {
this.dataForm.mySelectOrg = this.dataForm.orgId;
this.dataForm.orgPid = this.dataForm.orgId;
@ -372,7 +399,15 @@ export default {
this.getInfoAgencyLisy();
//
this.getOrgList();
this.initMap();
this.$nextTick(() => {
if (!map) {
this.initMap(this.dataForm.latitude, this.dataForm.longitude);
} else {
map.setCenter(this.dataForm.latitude, this.dataForm.longitude);
map.setMarker(this.dataForm.latitude, this.dataForm.longitude);
}
})
})
.catch(() => { });
},
@ -395,128 +430,84 @@ export default {
.catch(() => { });
},
// init
initMap () {
document.getElementById("app").innerHTML = "";
if (document.getElementById("app")) {
document.getElementById("mapSeach_id").style.display = "block";
// document.getElementById('lon_lat_id').style.display = "block"
}
initMap (latitude, longitude) {
//
var center = new window.TMap.LatLng(
this.dataForm.latitude ? this.dataForm.latitude : 36.0722275,
this.dataForm.longitude ? this.dataForm.longitude : 120.38945519
map = new daiMap(
document.getElementById("app_icparty"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), {
center: center, //
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
});
search = new window.TMap.service.Search({ pageSize: 10 });
//
markers = new TMap.MultiMarker({
map: map,
geometries: [],
//
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
infoWindowList = Array(10);
geocoder = new TMap.service.Geocoder(); //
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
//
map.on("panend", () => {
this.handleMoveCenter();
});
this.handleMoveCenter();
this.convert();
},
setMarker (lat, lng) {
markers.setGeometries([]);
markers.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close();
});
infoWindowList.length = 0;
markers.setGeometries([]);
//
search
.searchNearby({
keyword: this.keyWords,
radius: 1000,
autoExtend: true,
center: map.getCenter(),
})
.then((result) => {
let { data } = result;
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng },
} = data[0];
map.setCenter(new TMap.LatLng(lat, lng));
this.setMarker(lat, lng);
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
this.convert();
} else {
this.$message.error("未检索到相关位置坐标");
}
});
},
handleMoveCenter () {
async handleMoveCenter () {
//
const center = map.getCenter();
const lat = center.getLat();
const lng = center.getLng();
if (lng === 120.38945519) {
this.dataForm.latitude = "";
this.dataForm.longitude = "";
} else {
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
const { lat, lng } = map.getCenter();
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.dataForm.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
this.setMarker(lat, lng);
this.convert(lat, lng);
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(':');
let location;
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
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 {
location = new TMap.LatLng(
this.dataForm.latitude,
this.dataForm.longitude
);
this.searchOptions = [];
}
// map.setCenter(location);
markers.updateGeometries([
{
id: "main", //
position: location,
},
]);
//
geocoder.getAddress({ location: location }).then((result) => {
this.dataForm.address = result.result.address;
//
});
},
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.dataForm.latitude = lonlat[1];
this.dataForm.longitude = lonlat[0];
this.dataForm.address = selPosition.address + selPosition.name
},
//
dataFormSubmitHandle: debounce(
@ -550,7 +541,9 @@ export default {
type: "success",
duration: 500,
onClose: () => {
this.resetData()
this.visible = false;
this.$emit("refreshDataList");
},
});

Loading…
Cancel
Save