修改报表导出

master
夜笙歌 6 months ago
parent 86e4b721f5
commit 4b56063a50

@ -1,20 +1,25 @@
<template> <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> </template>
<script> <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 { getTestTemp } from '@/api/report/temperatureHistory' import Chart from "@//components/board/Chart";
import { parseTime } from '@/utils/ruoyi'
const animationDuration = 3000 const animationDuration = 3000
export default { export default {
mixins: [resize], components: {Chart},
props: { props: {
className: { className: {
type: String, type: String,
@ -66,46 +71,87 @@ export default {
methods: { methods: {
// //
openDifference() { openDifference() {
// this.form.cpno = row.cpno;
getTestTemp(this.queryParams).then(response => { getTestTemp(this.queryParams).then(response => {
this.reportDetailList = response.data.tempList this.reportDetailList = response.data.tempList
this.open = true this.$refs.chart1.setData({
this.title = '测温报表曲线' xAxis: {
this.testTime = response.data.tempList[0] data: response.data.tempList[0],
this.initChart() 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}℃'
} }
)
}, },
initChart() { series: response.data.tempList.map((e,i)=>{
this.chart = echarts.init(this.$el, 'macarons') if(i === 0){
this.xdata = this.testTime return
var series = [] }
for (var i = 1; i < this.reportDetailList.length; i++) { return {
series.push({
name: '温度' + [i], name: '温度' + [i],
type: 'line', type: 'line',
data: this.reportDetailList[i] data: this.reportDetailList[i],
})
} }
})
this.chart.setOption({ })
this.$refs.chart2.setData({
xAxis: { xAxis: {
data: this.testTime, data: response.data.vList[0],
axisLine: { axisLine: {
// show:true, // show:true,
onZero: false onZero: false,
} },
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999',
},
},
}, },
legend: { 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: { yAxis: {
scale: true, scale: true,
type: 'value' type: 'value',
axisLabel: {
formatter: '{value}℃'
}
}, },
series: series series: response.data.vList.map((e,i)=>{
if(i === 0){
return
}
return {
name: '温度' + [i],
type: 'line',
data: this.reportDetailList[i],
}
})
}) })
} }
)
},
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

@ -35,8 +35,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://10.41.11.35:6061`, target: `http://10.41.11.243:6061`,
target: `http://10.100.72.10:8080`, // target: `http://10.100.72.10:8080`,
// target: `http://192.168.1.118:6061`, // target: `http://192.168.1.118:6061`,
// target: `http://localhost:6061`, // target: `http://localhost:6061`,
changeOrigin: true, changeOrigin: true,

Loading…
Cancel
Save