From d6f574e14622d83bead9fd962e62c21693d596c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=86=E4=B9=90?= <342503599@qq.com> Date: Thu, 25 Aug 2022 14:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=B1=E5=9F=BA=E5=9D=91(=E6=B5=8B=E7=82=B9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7):=E9=A1=B9=E7=9B=AE=E7=9B=91=E6=B5=8B?= =?UTF-8?q?=E8=AF=A6=E8=AF=B7echsrts=E5=9B=BE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deepFoundationPitManage/monitorData.vue | 49 ++++++++++++++----- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/src/views/projectFront/deepFoundationPitManage/monitorData.vue b/src/views/projectFront/deepFoundationPitManage/monitorData.vue index bbe0fcde..243b6d89 100644 --- a/src/views/projectFront/deepFoundationPitManage/monitorData.vue +++ b/src/views/projectFront/deepFoundationPitManage/monitorData.vue @@ -395,7 +395,7 @@ :value="item.measurePointNumber" > - 传感器编号: + 传感器编号: -
+
{{$t('message.deepFoundConfig.echartTitle')}}
+
+ + + {{$t('message.deepFoundConfig.noData')}} +
@@ -613,7 +620,8 @@ export default { options: [], getSensorList: [], // 传感器列表 checkList: "", - checkList2: "", + checkList2: {}, + firstSelect: "", dateTime: [], searchDate: 1, pointList: [], @@ -658,7 +666,7 @@ export default { relaId: this.relaId, projectSn: this.projectSn, startTime: this.dateTime != null ? this.dateTime[0] : "", - endTime: this.dateTime != null ? this.dateTime[1] : "", + endTime: this.dateTime != null ? this.dateTime[1] : "" }).then(res => { console.log("有数据吗", res); if (res.code == 200 && res.result) { @@ -1716,22 +1724,29 @@ export default { // this.createdEchart7() }, checkNum(val) { + this.firstSelect = val; console.log("当前选择", val); - getSensorListApi({ measurePointNumber: val }).then(res => { + getSensorListApi({ measurePointNumber: this.firstSelect }).then(res => { if (res.code == 200 && res.result) { + console.log("---------", res); this.getSensorList = res.result; + if (this.getSensorList.length != 0) { + this.checkList2 = this.getSensorList[0].sensorSn; + this.getEchartsData(); + } } }); }, + getEchartsData(val) { console.log("第二个选择", val); selectDeepExcavationCurrentDataListApi({ measurePointNumber: this.checkList, relaId: this.relaId, - sensorSn : val, + sensorSn: val, projectSn: this.projectSn, startTime: this.dateTime != null ? this.dateTime[0] : "", - endTime: this.dateTime != null ? this.dateTime[1] : "", + endTime: this.dateTime != null ? this.dateTime[1] : "" }).then(res => { // console.log("有数据吗", res); if (res.code == 200 && res.result) { @@ -1755,15 +1770,25 @@ export default { }); }, checkDateTime(val) { - if(this.checkList == '' || this.checkList2 == '' ){ - this.$message({ - message: '请先选择传感器名称和编号哦!', - type: 'warning' + if (this.checkList == "" || this.checkList2 == "") { + this.$message({ + message: "请先选择传感器名称和编号哦!", + type: "warning" }); - } + } console.log(val); this.selectDeepExcavationCurrentDataList(); } + }, + watch: { + firstSelect: { + handler(newval, oldval) { + if (newval != oldval) { + (this.checkList2 = ""), this.getEchartsData(); + } + }, + immediate: true + } } };