修改地图等通用问题
This commit is contained in:
parent
370172dd56
commit
e152ec17df
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name" : "稷山县县面源污染监测平台",
|
||||
"name" : "稷山县面源污染监测平台",
|
||||
"appid" : "__UNI__A58A5D7",
|
||||
"description" : "",
|
||||
"versionName" : "2.2.22",
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县县现代农业发展中心</text>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县农业农村局</text>
|
||||
<!-- <view class="loginpage">
|
||||
<image class="bigimg" src="../../static/dls.jpg" mode=""></image>
|
||||
<view class="padding text-center margin-top">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县县现代农业发展中心</text>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县农业农村局</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "稷山县县小流域面源污染监测",
|
||||
"navigationBarTitleText": "稷山县小流域面源污染监测",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -335,18 +335,12 @@
|
|||
},
|
||||
// banner跳转
|
||||
banlick(index){
|
||||
if (index==0) {
|
||||
uni.navigateTo({
|
||||
url: '/packDetail/pages/vidio/soilindex'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/packDetail/pages/Site/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -11,16 +11,10 @@
|
|||
畜禽污染监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('orient')">
|
||||
<image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
农田污染监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('enterprise')">
|
||||
<image src="../../static/qiyebzIcon.png" mode="" style="width: 40rpx; height: 40rpx;"></image>
|
||||
<view class="textss">
|
||||
企业监测点
|
||||
企业点位
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -62,9 +56,6 @@
|
|||
<text class="value">{{ currentEnterprise.createTime || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="popup-footer">
|
||||
<button class="btn-detail" @click="goEnterpriseDetail">查看详情</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -97,7 +88,6 @@
|
|||
currentEnterprise: {},
|
||||
currentMarkerId: null,
|
||||
maxMarkerId: 0,
|
||||
// 添加调试开关
|
||||
debugMode: true
|
||||
};
|
||||
},
|
||||
|
|
@ -139,14 +129,13 @@
|
|||
this.allStationList.push(...this.cusLocationList);
|
||||
this.allStationList.push(...this.soilStationList);
|
||||
this.allStationList.forEach((item, index) => {
|
||||
item.id = index + 1; // 从1开始
|
||||
item.id = index + 1;
|
||||
});
|
||||
|
||||
this.issscd = false
|
||||
this.isssscd = false
|
||||
this.isSoilShow = false
|
||||
|
||||
// 设置初始最大ID
|
||||
this.maxMarkerId = this.allStationList.length + 1;
|
||||
|
||||
this.enterpriseRender();
|
||||
|
|
@ -168,7 +157,10 @@
|
|||
if (res.data.data && res.data.data.result) {
|
||||
this.enterpriseList = res.data.data.result;
|
||||
this.renderEnterpriseMarkers();
|
||||
// 数据加载完成后调整地图视野显示全部点位
|
||||
this.$nextTick(() => {
|
||||
this.ensureAllMarkersVisible();
|
||||
});
|
||||
}
|
||||
uni.hideLoading();
|
||||
}).catch(err => {
|
||||
|
|
@ -187,7 +179,6 @@
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
this.enterpriseList.forEach((item, index) => {
|
||||
const lat = Number(item.entLat);
|
||||
const lng = Number(item.entLong);
|
||||
|
|
@ -224,7 +215,6 @@
|
|||
joinCluster: false,
|
||||
zIndex: this.markersZIndex++,
|
||||
enterpriseData: item,
|
||||
// 添加callout显示企业名称
|
||||
callout: {
|
||||
content: item.entName || '企业',
|
||||
color: '#FFFFFF',
|
||||
|
|
@ -238,21 +228,17 @@
|
|||
|
||||
this.markers.push(markerItem);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
markertap(e) {
|
||||
const index = e.detail.markerId;
|
||||
// 查找匹配的marker
|
||||
const marker = this.markers.find(m => Number(m.id) === Number(index));
|
||||
|
||||
|
||||
if (!marker) {
|
||||
console.warn('未找到对应的marker, ID:', index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (marker.stationType === 'enterprise') {
|
||||
this.currentEnterprise = marker.enterpriseData || {
|
||||
entName: marker.stationName || '企业名称',
|
||||
|
|
@ -270,8 +256,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// 原有的监测站逻辑
|
||||
if (['orient', 'livestock'].includes(marker.stationType)) {
|
||||
// 监测站逻辑
|
||||
if (marker.stationType === 'livestock') {
|
||||
uni.navigateTo({
|
||||
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
|
||||
})
|
||||
|
|
@ -282,7 +268,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
// 关闭企业信息弹窗
|
||||
closePopup() {
|
||||
this.showEnterprisePopup = false;
|
||||
this.currentEnterprise = {};
|
||||
|
|
@ -424,7 +409,7 @@
|
|||
try {
|
||||
this.mapCtx.includePoints({
|
||||
points: validPoints,
|
||||
padding: [80, 80, 80, 80]
|
||||
padding: [120, 120, 120, 120]
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('调整地图视野异常:', e);
|
||||
|
|
@ -499,7 +484,7 @@
|
|||
|
||||
if (regionName === 'enterprise') {
|
||||
markers = this.markers.filter(item => item.stationType === 'enterprise');
|
||||
} else if (regionName === 'orient' || regionName === 'livestock' || regionName === 'watershed') {
|
||||
} else if (regionName === 'livestock') {
|
||||
markers = this.markers.filter(item => item.stationType === regionName);
|
||||
} else if (regionName === 'soil') {
|
||||
markers = this.markers.filter(item => item.type === 'soil' || item.deviceType === 'soil');
|
||||
|
|
@ -527,7 +512,6 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 样式保持不变 */
|
||||
.bgimg {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
|
@ -631,7 +615,6 @@
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
/* 企业信息弹窗样式 */
|
||||
.enterprise-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue