|
|
|
@ -1,20 +1,25 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div :class="className" :style="{height:height,width:width}"/>
|
|
|
|
|
<div>
|
|
|
|
|
<div :class="className" :style="{height:height,width:width}">
|
|
|
|
|
<Chart ref="chart1"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div :class="className" :style="{height:height,width:width}">
|
|
|
|
|
<Chart ref="chart2"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
|
|
|
|
|
require('echarts/theme/macarons') // echarts theme
|
|
|
|
|
import resize from '@/views/dashboard/mixins/resize'
|
|
|
|
|
import { getTestTemp } from '@/api/report/temperatureHistory'
|
|
|
|
|
import { parseTime } from '@/utils/ruoyi'
|
|
|
|
|
|
|
|
|
|
import {getTestTemp} from '@/api/report/temperatureHistory'
|
|
|
|
|
import Chart from "@//components/board/Chart";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const animationDuration = 3000
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [resize],
|
|
|
|
|
components: {Chart},
|
|
|
|
|
props: {
|
|
|
|
|
className: {
|
|
|
|
|
type: String,
|
|
|
|
@ -66,46 +71,87 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
// 详情表
|
|
|
|
|
openDifference() {
|
|
|
|
|
// this.form.cpno = row.cpno;
|
|
|
|
|
getTestTemp(this.queryParams).then(response => {
|
|
|
|
|
this.reportDetailList = response.data.tempList
|
|
|
|
|
this.open = true
|
|
|
|
|
this.title = '测温报表曲线'
|
|
|
|
|
this.testTime = response.data.tempList[0]
|
|
|
|
|
this.initChart()
|
|
|
|
|
this.$refs.chart1.setData({
|
|
|
|
|
xAxis: {
|
|
|
|
|
data: response.data.tempList[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.tempList.map((e,i)=>{
|
|
|
|
|
if(i === 0){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
name: '温度' + [i],
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: this.reportDetailList[i],
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
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],
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
initChart() {
|
|
|
|
|
this.chart = echarts.init(this.$el, 'macarons')
|
|
|
|
|
this.xdata = this.testTime
|
|
|
|
|
var series = []
|
|
|
|
|
for (var i = 1; i < this.reportDetailList.length; i++) {
|
|
|
|
|
series.push({
|
|
|
|
|
name: '温度' + [i],
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: this.reportDetailList[i]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.chart.setOption({
|
|
|
|
|
xAxis: {
|
|
|
|
|
data: this.testTime,
|
|
|
|
|
axisLine: {
|
|
|
|
|
// show:true,
|
|
|
|
|
onZero: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: ['温度1', '温度2', '温度3', '温度4', '温度5', '温度6', '温度7', '温度8', '温度9', '温度10', '温度11', '室温']
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
scale: true,
|
|
|
|
|
type: 'value'
|
|
|
|
|
},
|
|
|
|
|
series: series
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|