From b61a58243715fe9a7c5b1d9362017563f078d2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Tue, 21 May 2024 13:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E8=A1=A8=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../temperatureRecordReport/tempTest.vue | 92 ++++++++----------- 1 file changed, 37 insertions(+), 55 deletions(-) diff --git a/src/views/report/temperatureRecordReport/tempTest.vue b/src/views/report/temperatureRecordReport/tempTest.vue index 962fe55..e847c6c 100644 --- a/src/views/report/temperatureRecordReport/tempTest.vue +++ b/src/views/report/temperatureRecordReport/tempTest.vue @@ -75,7 +75,7 @@ export default { this.reportDetailList = response.data.tempList this.$refs.chart1.setData({ xAxis: { - data: response.data.tempList[0], + data: response.data.tempList[0], axisLine: { // show:true, onZero: false, @@ -91,72 +91,54 @@ export default { }, }, legend: { - data: ['温度1', '温度2', '温度3', '温度4', '温度5', '温度6', '温度7', '温度8', '温度9', '温度10', '温度11', '室温'] + // data: ['温度1', '温度2', '温度3', '温度4', '温度5', '温度6', '温度7', '温度8', '温度9', '温度10', '温度11', '室温'] }, - yAxis: { - scale: true, - type: 'value', - axisLabel: { - formatter: '{value}℃' + yAxis: [ + { + scale: true, + type: 'value', + axisLabel: { + formatter: '{value}℃' + } + }, + { + scale: true, + // min:0, + type: 'value', + axisLabel: { + formatter: '{value}V' + } } - }, - series: response.data.tempList.map((e,i)=>{ - if(i === 0){ + ], + series: response.data.tempList.map((e, i) => { + if (i === 0) { return } return { name: '温度' + [i], type: 'line', data: this.reportDetailList[i], - label:{ - show:true, - position:'top' + label: { + show: true, + position: 'top' } } - }) - }) - this.$refs.chart2.setData({ - xAxis: { - data: response.data.vList[0], - axisLine: { - // show:true, - onZero: false, - }, - }, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - crossStyle: { - color: '#999', - }, - }, - }, - legend: { - data: ['温度1', '温度2', '温度3', '温度4', '温度5', '温度6', '温度7', '温度8', '温度9', '温度10', '温度11', '室温'] - }, - yAxis: { - scale: true, - type: 'value', - axisLabel: { - formatter: '{value}℃' - } - }, - series: response.data.vList.map((e,i)=>{ - if(i === 0){ - return - } - return { - name: '温度' + [i], - type: 'line', - data: this.reportDetailList[i], - label:{ - show:true, - position:'top' + }).concat(response.data.vList.map((e, i) => { + if (i === 0) { + return + } + return { + name: '电压' + [i], + yAxisIndex:1, + type: 'line', + data: this.reportDetailList[i], + label: { + show: true, + position: 'top' + } } - } + })) }) - }) } ) },