Browse Source

fix: 【水闸、堤防-水雨情智能分析】折线图显示部分,鼠标移入后出现点位偏移

sy-water-data-board-ui
yantingyu 1 year ago
parent
commit
3cc7008f16
  1. 32
      src/views/dike/runManage/waterRainReport/smartAnalyse/index.vue
  2. 39
      src/views/sluice/runManage/waterRainReport/smartAnalyse/index.vue

32
src/views/dike/runManage/waterRainReport/smartAnalyse/index.vue

@ -76,8 +76,8 @@
<span class="data">{{ analysisData.exceedGateFlowCount }}</span>
</div>
</div>
<div class="statistical-chart water-level" ref="water-level"></div>
<div class="statistical-chart water-flow" ref="water-flow"></div>
<div id="water-level" class="statistical-chart water-level" ref="water-level" :style="{'zoom': zoom}"></div>
<div id="water-flow" class="statistical-chart water-flow" ref="water-flow" :style="{'zoom': zoom}"></div>
</div>
</div>
</div>
@ -114,7 +114,11 @@ export default {
exceedWarningCount: 0, //
exceedRainfallCount: 0, // 50mm/h
exceedGateFlowCount: 0 // 100m³
}
},
currentDike: null,
zoom: 1,
levelChart:null,
flowChart:null
};
},
@ -163,6 +167,7 @@ export default {
},
//
handleRowChange(row) {
this.currentDike = row;
getDikeExceedApi(row.dikeCode).then((res) => {
if (!res.success) return;
const data = res.data;
@ -176,7 +181,9 @@ export default {
getRainfallAndGateFlowApi(row.dikeCode).then((res) => {
if (!res.success) return;
const data = res.data.rainfallAndGateFlowMap; //{2024-03-04:{rainfall: '0.0', gateFlow: '0.0'}......}
this.$echarts.init(this.$refs['water-flow']).setOption({
if(this.flowChart) this.flowChart.dispose();
this.flowChart = this.$echarts.init(document.getElementById('water-flow'))
this.flowChart.setOption({
title: {
text: '流量监测',
textStyle: {
@ -255,12 +262,17 @@ export default {
}
]
});
this.$nextTick(() => {
this.flowChart.resize();
});
});
getWaterLevelInfoApi(row.dikeCode).then((res) => {
if (!res.success) return;
let data = res.data.waterLevelMap; // {2024-03-04:{waterLevel: '0.0', floodLevel: '12', warningLevel: '38'}.....}
this.$echarts.init(this.$refs['water-level']).setOption({
if(this.levelChart) this.levelChart.dispose();
this.levelChart = this.$echarts.init(document.getElementById('water-level'))
this.levelChart.setOption({
title: {
text: '水位监测',
textStyle: {
@ -333,14 +345,24 @@ export default {
}
]
});
this.$nextTick(() => {
this.levelChart.resize();
});
});
}
},
async mounted() {
this.zoom = 1 / document.body.style.zoom;
await this.getDikeStatisticalList();
this.getAreasOptions();
this.$refs.table.setCurrentRow(this.tableData[0]); //handleRowChange
window.onresize = ()=> {
this.zoom = 1 / document.body.style.zoom;
this.handleRowChange(this.currentDike)
};
}
};
</script>

39
src/views/sluice/runManage/waterRainReport/smartAnalyse/index.vue

@ -76,8 +76,8 @@
<span class="data">{{ analysisData.exceedGateFlowCount }}</span>
</div>
</div>
<div class="statistical-chart water-level" ref="water-level"></div>
<div class="statistical-chart water-flow" ref="water-flow"></div>
<div id="water-level" class="statistical-chart water-level" ref="water-level" :style="{'zoom': zoom}"></div>
<div id="water-flow" class="statistical-chart water-flow" ref="water-flow" :style="{'zoom': zoom}"></div>
</div>
</div>
</div>
@ -114,7 +114,11 @@ export default {
exceedWarningCount: 0, //
exceedRainfallCount: 0, // 50mm/h
exceedGateFlowCount: 0 // 100m³
}
},
currentSluice:null, //
zoom: 1,
flowChart: null,
levelChart: null,
};
},
@ -126,7 +130,7 @@ export default {
pageNum: this.pageConfig.pageNum,
data: {
basin: this.basin,
adcd: this.region //
adcd: this.region, //
}
};
const res = await getSluiceStatisticalListApi(params);
@ -163,6 +167,7 @@ export default {
},
//
handleRowChange(row) {
this.currentSluice = row;
getSluiceExceedApi(row.wagaCode).then((res) => {
if (!res.success) return;
const data = res.data;
@ -176,7 +181,9 @@ export default {
getRainfallAndGateFlowApi(row.wagaCode).then((res) => {
if (!res.success) return;
const data = res.data.rainfallAndGateFlowMap; //{2024-03-04:{rainfall: '0.0', gateFlow: '0.0'}......}
this.$echarts.init(this.$refs['water-flow']).setOption({
if(this.flowChart) this.flowChart.dispose();
this.flowChart = this.$echarts.init(document.getElementById('water-flow'));
this.flowChart.setOption({
title: {
text: '流量监测',
textStyle: {
@ -186,7 +193,8 @@ export default {
}
},
tooltip: {
trigger: 'axis'
trigger: 'axis',
// show:false
},
legend: {
right: 'center',
@ -255,12 +263,17 @@ export default {
}
]
});
this.$nextTick(() => {
this.flowChart.resize();
});
});
getWaterLevelInfoApi(row.wagaCode).then((res) => {
if (!res.success) return;
let data = res.data.waterLevelMap; // {2024-03-04:{waterLevel: '0.0', floodLevel: '12', warningLevel: '38'}.....}
this.$echarts.init(this.$refs['water-level']).setOption({
if(this.levelChart) this.flowChart.dispose();
this.levelChart = this.$echarts.init(document.getElementById('water-level'));
this.levelChart.setOption({
title: {
text: '水位监测',
textStyle: {
@ -270,7 +283,8 @@ export default {
}
},
tooltip: {
trigger: 'axis'
trigger: 'axis',
// show:false
},
legend: {
right: 'center',
@ -333,14 +347,23 @@ export default {
}
]
});
this.$nextTick(() => {
this.levelChart.resize();
});
});
}
},
async mounted() {
this.zoom = 1 / document.body.style.zoom;
await this.getSluiceStatisticalList();
this.getAreasOptions();
this.$refs.table.setCurrentRow(this.tableData[0]); //handleRowChange
window.onresize = ()=> {
this.zoom = 1 / document.body.style.zoom;
this.handleRowChange(this.currentSluice)
};
}
};
</script>

Loading…
Cancel
Save