Browse Source

打log

yantai_master
mk 2 years ago
parent
commit
f4d075eab6
  1. 5
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  2. 9
      src/views/modules/cpts/base/cpts/edit.vue

5
src/views/modules/communityService/sqzzz/cpts/edit.vue

@ -402,11 +402,15 @@ export default {
this.dataForm.latitude = latitude this.dataForm.latitude = latitude
this.dataForm.longitude = longitude this.dataForm.longitude = longitude
} }
console.log(this.dataForm,'社区自组织表单');
this.$nextTick(() => { this.$nextTick(() => {
if (!map) { if (!map) {
console.log('地图初始化',this.dataForm);
this.initMap(this.dataForm.latitude, this.dataForm.longitude); this.initMap(this.dataForm.latitude, this.dataForm.longitude);
} else { } else {
console.log('地图没有初始化',this.dataForm);
console.log(map);
map.setCenter(this.dataForm.latitude, this.dataForm.longitude); map.setCenter(this.dataForm.latitude, this.dataForm.longitude);
map.setMarker(this.dataForm.latitude, this.dataForm.longitude); map.setMarker(this.dataForm.latitude, this.dataForm.longitude);
} }
@ -425,7 +429,6 @@ export default {
rotation: 45, // rotation: 45, //
} }
); );
// //
map.on("dragend", (e) => { map.on("dragend", (e) => {
this.handleMoveCenter(e); this.handleMoveCenter(e);

9
src/views/modules/cpts/base/cpts/edit.vue

@ -528,7 +528,6 @@ export default {
} else if (item.type == "address") { } else if (item.type == "address") {
this.$nextTick(async () => { this.$nextTick(async () => {
await nextTick(300); await nextTick(300);
this.initMap(item); this.initMap(item);
}); });
} }
@ -661,7 +660,8 @@ export default {
// init // init
initMap(item) { initMap(item) {
let { latitude, longitude } = this.$store.state.user; let { latitude, longitude } = this.$store.state.user;
console.log(item,'item');
console.log(latitude, longitude,'组件坐标');
map = new daiMap( map = new daiMap(
document.getElementById("app_base"), document.getElementById("app_base"),
{ latitude, longitude }, { latitude, longitude },
@ -671,6 +671,7 @@ export default {
rotation: 45, // rotation: 45, //
} }
); );
map.setMarker(latitude, longitude);
// //
map.on("dragend", (e) => { map.on("dragend", (e) => {
@ -697,15 +698,13 @@ export default {
console.log("handleMoveCenter", e); console.log("handleMoveCenter", e);
// //
const { lat, lng } = map.getCenter(); const { lat, lng } = map.getCenter();
console.log("getCenter", lat); console.log("getCenter", lat,lng);
this.fmData[item.supKeys[0]] = parseFloat(lng); this.fmData[item.supKeys[0]] = parseFloat(lng);
this.fmData[item.supKeys[1]] = parseFloat(lat); this.fmData[item.supKeys[1]] = parseFloat(lat);
if(this.formType!= 'watch'){ if(this.formType!= 'watch'){
map.setMarker(lat, lng); map.setMarker(lat, lng);
} }
console.log("setMarker", lat);
let { msg, data } = await map.getAddress(lat, lng); let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") { if (msg == "success") {
this.fmData[item.keyName] = data.address; this.fmData[item.keyName] = data.address;

Loading…
Cancel
Save