From d7202063860652ed2de164b012360b0b048d2e0b Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 22 May 2025 15:04:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=9B=91=E6=B5=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8A=98=E7=BA=BF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/monitor_detail.vue | 60 +++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/src/views/wpm_bx/monitor_detail.vue b/src/views/wpm_bx/monitor_detail.vue index d5c32236..a81a7be1 100644 --- a/src/views/wpm_bx/monitor_detail.vue +++ b/src/views/wpm_bx/monitor_detail.vue @@ -3,12 +3,12 @@
- + + +
@@ -57,6 +61,38 @@ export default { mpointList:[], activeName: "", tableHeight:300, + option: { + title: { + text: "", + }, + tooltip: { + trigger: "axis", + }, + grid: { + left: "3%", + right: "4%", + bottom: "3%", + containLabel: true, + }, + // toolbox: { + // feature: { + // saveAsImage: {}, + // }, + // }, + xAxis: { + type: "category", + boundaryGap: false, + data: [], + }, + yAxis: { + type: "value", + }, + series:{ + name: "数据检测", + type: "line", + data: [], + } + } }; }, mounted() { @@ -69,6 +105,7 @@ export default { that.activeName = res[0].name; that.params.mpoint = res[0].id; that.apiObj = that.$API.enm.mplogx; + that.handleClick(); }else{ that.$message.error("该设备没有监测点"); } @@ -81,15 +118,32 @@ export default { that.$nextTick(() => { let height = document.getElementById("tableWap").clientHeight; console.log('height',height) - that.tableHeight = height - 45; + that.tableHeight = height - 345; }) }, handleClick(val){ + console.log('handleClick',val) let that = this; that.mpointList.forEach(item=>{ if(item.name == that.activeName){ + console.log('item',item) + console.log('that.activeName',that.activeName) that.query.mpoint = item.id; that.query.page = 1; + that.option.title.text = that.activeName; + that.option.xAxis.data = []; + that.option.series.data = []; + let params = {}; + params.mpoint = item.id; + params.timex__gte = that.startTime; + params.timex__lte = that.endTime; + params.page = 0; + that.$API.enm.mplogx.req(params).then((res) => { + res.forEach(item=>{ + that.option.xAxis.data.push(item.timex); + that.option.series.data.push(item.val_float); + }) + }) } }) },