+
小流域监测站
@@ -562,6 +562,7 @@ export default {
soidShowFlag: false,
soilDataId: '',
tabsLoading: false,
+ lastZIndex: 1,
};
},
created() {
@@ -767,7 +768,7 @@ export default {
viewMode: '3D',
resizeEnable: true,
zoom: zoomnum,
- center: [111.436625, 36.771975],//默认的地图中心经纬度
+ center: [112.83100231396601, 36.872032399813556],//默认的地图中心经纬度
mapStyle: 'amap://styles/blue',
dragEnable: true,//地图是否可通过鼠标拖拽平移,默认为true。此属性可被setStatus/getStatus 方法控制
jogEnable: true,//地图是否使用缓动效果,默认值为true。此属性可被setStatus/getStatus 方法控制
@@ -783,10 +784,15 @@ export default {
});
that.aMap.on('complete', (e) => {
var markerData = res.result;
- let Marker = markerData.filter(ele => ele.type != 'light');//其他类型
+ let Marker = markerData.filter(ele => ele.type != 'light').sort((a,b) => {
+ if (b.type=='soil') return 1;
+ if (b.type!='soil') return -1;
+ return 0;
+ });//其他类型
+ console.log(Marker,'Marker')
Marker.map(item => {
let marker = new AMap.Marker({
- zIndex: item.type == 'orient' ? 1000 : 500,
+ zIndex: item.type == 'soil' ? that.lastZIndex : (that.lastZIndex+1),
icon: this.urlimg + item.picUrl,
position: [item.longitude, item.latitude],
offset: new AMap.Pixel(item.width, item.height),//偏移量
@@ -796,7 +802,8 @@ export default {
extPics: item.extPics,
notes: item.notes,
name: item.name,
- item: item
+ item: item,
+ stationType: item.type
}
});
if (item.type == 'orient' || item.type == 'livestock' || item.type == 'watershed') {//监测站弹窗
@@ -804,16 +811,16 @@ export default {
let indexnumb = e.target.getExtData().ids.slice(-1);
this.qcdtinfor = this.stationInfoList[indexnumb]
this.qcdtdialogTableVisible = true
- console.log('livestock or orient', this.qyinformation)
+ // console.log('livestock or orient', this.qyinformation)
})
this.markersOrient.push(marker)
} else if(item.type == 'soil'){//土壤弹窗,长期监测站
marker.on('click', e => {
this.soilDataId = e.target.getExtData()
this.soidShowFlag = true
- console.log('soil click', )
+ // console.log('soil click', )
})
- this.markersSoil.push(marker)
+ this.markersSoil.push(marker);
} else {
this.markersOther.push(marker)
}
@@ -823,7 +830,7 @@ export default {
// that.aMap.setFitView(null, false, [100,400,200,200], 16);
that.aMap.setFitView();
setTimeout(() => {
- that.aMap.setFitView(null, false, [130, 380, 200, 200], 16);
+ that.aMap.setFitView(null, false, [130, 380, 480, 480], 16);
// let temp = that.aMap.getCenter();//矫正显示标点位置在正中心
// that.aMap.setZoomAndCenter(that.aMap.getZoom()-1, [temp.lng, temp.lat - 0.15]);
}, 2000)
@@ -1046,15 +1053,15 @@ export default {
// 跳转页面3
jumpStationPage(e) {
let stationCode = e.stationCode
- if (e.stationType == 'livestock') {
- this.$router.push({path: '/CqyzList', query: {stationCode: stationCode}})
- // this.$message({
- // message: '站点正在建设中......',
- // showClose: true,
- // });
- } else {
+ // if (e.stationType == 'livestock') {
+ // this.$router.push({path: '/CqyzList', query: {stationCode: stationCode}})
+ // // this.$message({
+ // // message: '站点正在建设中......',
+ // // showClose: true,
+ // // });
+ // } else {
this.$router.push({path: '/MywrList', query: {stationCode: stationCode}})
- }
+ // }
},
// 弹窗退出登录
handleClosetuichu(done) {
@@ -1109,22 +1116,27 @@ export default {
this.lastClickIcon = ''
} else {
this.lastClickIcon = flag;
- if (flag == 'duizhuhe') {
- arr = this.markersOrient.filter(item => item.getExtData().name.indexOf("对竹河") != -1);
- } else if (flag == 'tuanbaihe') {
- arr = this.markersOrient.filter(item => item.getExtData().name.indexOf("团柏河") != -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;
}
}
if (arr && arr.length > 0) {
- that.aMap.setFitView(arr, false, [200, 500, 300, 300], 16);
+ arr.map(item => {
+ item.setzIndex((that.lastZIndex+=2));
+ });
+ that.aMap.setFitView(arr, false, [200, 500, 360, 360], 16);
// setTimeout(() => {
// let temp = that.aMap.getCenter();//矫正显示标点位置在正中心
// that.aMap.setZoomAndCenter(that.aMap.getZoom()-2, [temp.lng, temp.lat - 0.15]);
// },2000)
} else {
- that.aMap.setFitView(null, false, [100, 400, 200, 200], 16);
+ that.aMap.setFitView(null, false, [100, 400, 360, 360], 16);
}
}
},
diff --git a/src/pages/MywrList/index.vue b/src/pages/MywrList/index.vue
index 7fc00b4..d3d5a60 100644
--- a/src/pages/MywrList/index.vue
+++ b/src/pages/MywrList/index.vue
@@ -370,7 +370,8 @@