From ae210f8a7a1af38e08ef06864d492ac0ea3a63d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=86=E4=B9=90?= <342503599@qq.com> Date: Thu, 13 Oct 2022 16:06:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=B1=E5=9F=BA=E5=9D=91(=E7=9B=91=E6=B5=8B)?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E9=A2=84=E8=AD=A6=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deepFoundationPitManage/monitorData.vue | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/src/views/projectFront/deepFoundationPitManage/monitorData.vue b/src/views/projectFront/deepFoundationPitManage/monitorData.vue index 49781ada..25866978 100644 --- a/src/views/projectFront/deepFoundationPitManage/monitorData.vue +++ b/src/views/projectFront/deepFoundationPitManage/monitorData.vue @@ -686,6 +686,8 @@ export default { data: [], }, unit:'mm',//单位 + max:'', + min:'', }; }, created() { @@ -716,6 +718,9 @@ export default { pageNo:this.pageNo1, pageSize:this.pageSize1, }).then(res => { + this.max = res.result.alarmValue; + this.min = res.result.alarmValue * ('-1'); + console.log('默认第一次进来的报警值',this.max,this.min) this.unit = res.result.unit; console.log("默认第一次进来的时候单位", this.unit) if (res.code == 200 && res.result) { @@ -1576,7 +1581,7 @@ export default { grid: { top: "30px", left: "60px", - right: "35px", + right: "65px", bottom: "50px" }, xAxis: { @@ -1598,18 +1603,20 @@ export default { }, yAxis: { type: "value", - max:function(obj){//解决因数据值范围相差太大或是太小曲线显示不美观问题 - var ma=obj.max; - var mi=obj.min; - var val=Math.ceil((ma+(ma-mi)/2)) - return val - }, - min:function(obj){ - var ma=obj.max; - var mi=obj.min; - var val=Math.ceil((mi-(ma-mi)/2)) - return mi==0?0:val - }, + // max:this.max + 1, + min:this.min -1, + // max:function(obj){//解决因数据值范围相差太大或是太小曲线显示不美观问题 + // var ma=obj.max; + // var mi=obj.min; + // var val=Math.ceil((ma+(ma-mi)/2)) + // return val + // }, + // min:function(obj){ + // var ma=obj.max; + // var mi=obj.min; + // var val=Math.ceil((mi-(ma-mi)/2)) + // return mi==0?0:val + // }, name:`单位/${ this.unit }`, boundaryGap: [0, '100%'], splitLine: { @@ -1694,7 +1701,7 @@ export default { position:"end", }, data:[{ - silent:false, + silent:true, // 警告线的样式 lineStyle:{ type:"solid", @@ -1702,9 +1709,22 @@ export default { }, label:{ position:'end', - formatter:'报警值(3)' + formatter:`报警值(${this.max})` }, - yAxis:3 + yAxis:this.max + }, + { + silent:true, + // 警告线的样式 + lineStyle:{ + type:"solid", + color:"#f76462", + }, + label:{ + position:'end', + formatter:`报警值(${this.min})` + }, + yAxis:this.min }] } // markLine:{ @@ -1874,7 +1894,9 @@ export default { pageSize:this.pageSize1, }).then(res => { this.unit = res.result.unit - // console.log('第二个选择时的单位',this.unit) + this.max = res.result.alarmValue; + this.min = res.result.alarmValue * ('-1'); + console.log('第二个选择时的单位',this.unit) if (res.code == 200 && res.result) { this.total1 = res.result.data.total this.tableData2 = res.result.data.records;