From ca076b2f811e11bd2b417ab3cc716643fc471eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=86=E4=B9=90?= <342503599@qq.com> Date: Mon, 10 Oct 2022 11:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=B1=E5=9F=BA=E5=9D=91(=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE)=EF=BC=9Aechartsy=E8=BD=B4=E5=8F=98=E5=8C=96?= =?UTF-8?q?=20=E4=BB=A5=E5=8F=8A=E5=8D=95=E4=BD=8D=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/http.js | 1 - .../deepFoundationPitManage/monitorData.vue | 68 +++++++++++++------ 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/assets/js/http.js b/src/assets/js/http.js index e39128ae..0c074036 100644 --- a/src/assets/js/http.js +++ b/src/assets/js/http.js @@ -40,7 +40,6 @@ if (process.env.NODE_ENV == 'development') { // axios.defaults.baseURL = 'http://124.71.178.44:100/' // 河南 // tag: 本地 // axios.defaults.baseURL = 'http://192.168.34.174:6023/' // 老大本地 - // axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1 axios.defaults.baseURL = 'http://192.168.34.216:6023/' // 邱平毅本地 // axios.defaults.baseURL ='http://124.71.67.160:8088/' //中建四局线上 // axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1 diff --git a/src/views/projectFront/deepFoundationPitManage/monitorData.vue b/src/views/projectFront/deepFoundationPitManage/monitorData.vue index a8591386..28a96f85 100644 --- a/src/views/projectFront/deepFoundationPitManage/monitorData.vue +++ b/src/views/projectFront/deepFoundationPitManage/monitorData.vue @@ -684,8 +684,8 @@ export default { echartData7: { xAxis: [], data: [], - unit: 'mm' - } + }, + unit:'mm',//单位 }; }, created() { @@ -716,8 +716,8 @@ export default { pageNo:this.pageNo1, pageSize:this.pageSize1, }).then(res => { - this.echartData7.unit = res.result.unit; - console.log("默认第一次进来的时候单位", res.result) + this.unit = res.result.unit; + console.log("默认第一次进来的时候单位", this.unit) if (res.code == 200 && res.result) { this.total1 = res.result.data.total this.tableData2 = res.result.data.records; @@ -1598,8 +1598,19 @@ export default { }, yAxis: { type: "value", - // name:'单位/mm', - name:`${'单位/'} ${this.echartData7.unit }`, + 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: { lineStyle: { @@ -1617,18 +1628,30 @@ export default { color: "#7F8694" } }, - dataZoom: [ + dataZoom:[ { - type: 'inside', - start: 0, - end: 20 + type: 'inside', // 放大和缩小 + orient: 'vertical', }, - { - start: 0, - end: 20, - top:"90%", - } + // { + // type: 'inside', + // } ], + // dataZoom: [ + // // { + // // type: 'inside', + // // start: 0, + // // end: 20 + // // }, + // // { + // // start: 0, + // // end: 20, + // // top:"90%", + // // } + // // { + // // orient: 'vertical', + // // } + // ], axisPointer: { lineStyle: { color: "#F4F5F8", @@ -1721,6 +1744,7 @@ export default { return timer; }, showDetail(val) { + console.log('unit',this.unit) // console.log('当前点击的详情',val) this.dateTime = [] this.pageSize1= 10, @@ -1728,11 +1752,11 @@ export default { this.visibleDialog = true; this.relaId = val.id; this.selectDeepExcavationAllMeasurePointList(); // 获取测点名称 - // this.$nextTick(() => { - // // this.createdEchart5() - // // this.createdEchart6() - // this.createdEchart7(); - // }); + this.$nextTick(() => { + // this.createdEchart5() + // this.createdEchart6() + this.createdEchart7(); + }); }, checkDate(val) { this.searchDate = val; @@ -1830,8 +1854,8 @@ export default { pageNo:this.pageNo1, pageSize:this.pageSize1, }).then(res => { - this.echartData7.unit = res.result.unit - console.log('第二个选择时的单位',res.result) + this.unit = res.result.unit + // console.log('第二个选择时的单位',this.unit) if (res.code == 200 && res.result) { this.total1 = res.result.data.total this.tableData2 = res.result.data.records;