diff --git a/src/assets/image/enticon.png b/src/assets/image/enticon.png new file mode 100644 index 0000000..a8de825 Binary files /dev/null and b/src/assets/image/enticon.png differ diff --git a/src/pages/Home/index.vue b/src/pages/Home/index.vue index 7ff989b..d8b67f2 100644 --- a/src/pages/Home/index.vue +++ b/src/pages/Home/index.vue @@ -203,6 +203,10 @@ +
+ + 企业信息 +
@@ -556,7 +560,8 @@ export default { dialogVisible: false, inforname: '', loading: true, - zoomData: 10, + iniZoomData: 11, + normalZoomData: 12, focusZoomData: 14, isShowLightNumber: '1', switchValue: true, @@ -633,7 +638,7 @@ export default { setTimeout(() => { getCompanyList().then(res => { that.entList = res.result.map(item => { - item.type = 'cusLocaltion'; + item.type = 'ent'; item.longitude = item.entLong; item.latitude = item.entLat; item.name = item.entName; @@ -656,7 +661,7 @@ export default { // console.log(that.entList,'111222') that.$nextTick(() => { - that.initMap(that.zoomData, that.isShowLightNumber); + that.initMap(that.iniZoomData, that.isShowLightNumber); }) }); }, 2000) @@ -687,13 +692,13 @@ export default { mapTypeSwitch() { this.mapTypeFlag = !this.mapTypeFlag if (this.mapTypeFlag == true) {//正常模式 - // this.zoomData = 14 + // this.iniZoomData = 14 if (this.isShowLight == undefined) { let isShowLight = '1' - this.initMap(this.zoomData, isShowLight); + this.initMap(this.iniZoomData, isShowLight); } else { let isShowLight = this.isShowLight - this.initMap(this.zoomData, isShowLight); + this.initMap(this.iniZoomData, isShowLight); } setTimeout(() => { this.$nextTick(() => { @@ -701,11 +706,11 @@ export default { }) }, 1000) } else {// 地图模式 - // this.zoomData = 15 + // this.iniZoomData = 15 if (this.isShowLight == undefined) { - this.initMap(this.zoomData, '1'); + this.initMap(this.iniZoomData, '1'); } else { - this.initMap(this.zoomData, this.isShowLight); + this.initMap(this.iniZoomData, this.isShowLight); } } }, @@ -758,11 +763,11 @@ export default { if (value == true) { let isShowLight = '1' this.isShowLight = isShowLight - this.initMap(this.zoomData, isShowLight) + this.initMap(this.iniZoomData, isShowLight) } else { let isShowLight = '' this.isShowLight = isShowLight - this.initMap(this.zoomData, isShowLight) + this.initMap(this.iniZoomData, isShowLight) } }, scaleChange(e) { @@ -840,7 +845,7 @@ export default { offset: new AMap.Pixel(item.width, item.height),//偏移量 title: item.name, label: { - content: item.type == "cusLocaltion"? item.name : '', + content: item.type == "ent"? item.name : '', direction: 'top' }, extData: { @@ -866,7 +871,7 @@ export default { // console.log('soil click', ) }) this.markersSoil.push(marker); - } else if(item.type == "cusLocaltion"){//企业类型 + } else if(item.type == "ent"){//企业类型 marker.on("click", e => { this.qyinformation= e.target.getExtData().item if(this.qyinformation.entPics){ @@ -877,6 +882,7 @@ export default { console.log("this.qyinformation",this.qyinformation) this.qyinfordtdialogTableVisible = true }) + this.markersOrient.push(marker); } else { this.markersOther.push(marker) } @@ -886,7 +892,8 @@ export default { // that.aMap.setFitView(null, false, [100,400,200,200], 16); // that.aMap.setFitView(); setTimeout(() => { - that.aMap.setFitView(null, false, [130, 380, 480, 480], 12); + that.switchIcon('1'); + // that.aMap.setFitView(null, false, [130, 380, 480, 480], 12); // let temp = that.aMap.getCenter();//矫正显示标点位置在正中心 // that.aMap.setZoomAndCenter(that.aMap.getZoom()-1, [temp.lng, temp.lat - 0.15]); }, 2000) @@ -1172,15 +1179,22 @@ export default { this.lastClickIcon = '' } else { this.lastClickIcon = flag; - if (flag == 'livestock') { - arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("livestock") != -1); - } else if (flag == 'orient') { - arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("orient") != -1); - } else if (flag == 'watershed') { - arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("watershed") != -1); - } else if (flag == 'soil') { + if (flag == 'soil') { arr = this.markersSoil; + } else { + arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf(flag) != -1); } + // if (flag == 'livestock') { + // arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("livestock") != -1); + // } else if (flag == 'orient') { + // arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("orient") != -1); + // } else if (flag == 'watershed') { + // arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("watershed") != -1); + // } else if (flag == 'soil') { + // arr = this.markersSoil; + // } else if (flag == 'ent') { + // arr = this.markersSoil; + // } } if (arr && arr.length > 0) { arr.map(item => { @@ -1192,7 +1206,7 @@ export default { // that.aMap.setZoomAndCenter(that.aMap.getZoom()-2, [temp.lng, temp.lat - 0.15]); // },2000) } else { - that.aMap.setFitView(null, false, [100, 400, 360, 360], that.zoomData); + that.aMap.setFitView(null, false, [100, 400, 360, 360], that.normalZoomData); } } },