|
|
@ -1,13 +1,10 @@ |
|
|
|
<template> |
|
|
|
<div style="height:250px;width:100%;margin-top: 30px;" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import * as echarts from 'echarts' |
|
|
|
require('echarts/theme/macarons') // echarts theme |
|
|
|
|
|
|
|
const animationDuration = 3000 |
|
|
|
|
|
|
|
export default { |
|
|
|
props: { |
|
|
|
dataList: { |
|
|
@ -49,44 +46,40 @@ export default { |
|
|
|
let receivableArray = [] |
|
|
|
this.xDataArray = [] |
|
|
|
this.seriesArray = [] |
|
|
|
if (newValue.length > 0) { |
|
|
|
if (currentValue && currentValue.SortKeys) { |
|
|
|
this.xDataArray = currentValue.SortKeys |
|
|
|
this.maxValue = currentValue.PeriodOnPeriodUpperLimit |
|
|
|
this.minValue = currentValue.PeriodOverPeriodLowerLimit |
|
|
|
} |
|
|
|
if (currentValue && currentValue.SortKeys) { |
|
|
|
this.xDataArray = currentValue.SortKeys |
|
|
|
this.maxValue = currentValue.PeriodOnPeriodUpperLimit |
|
|
|
this.minValue = currentValue.PeriodOverPeriodLowerLimit |
|
|
|
} |
|
|
|
newValue.forEach(el => { |
|
|
|
receivableArray = [] |
|
|
|
this.xDataArray.forEach(elChild => { |
|
|
|
receivableArray.push(el.Item[elChild]) |
|
|
|
}) |
|
|
|
this.seriesArray.push({ |
|
|
|
type: 'line', |
|
|
|
data: receivableArray, |
|
|
|
markLine: { |
|
|
|
data: [ |
|
|
|
{ |
|
|
|
name: '预警上限值', |
|
|
|
yAxis: this.maxValue, |
|
|
|
label: { |
|
|
|
formatter: '{b}', |
|
|
|
position: 'end' |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '预警下限值', |
|
|
|
yAxis: this.minValue, |
|
|
|
label: { |
|
|
|
formatter: '{b}', |
|
|
|
position: 'end' |
|
|
|
} |
|
|
|
receivableArray = [] |
|
|
|
this.xDataArray.forEach(elChild => { |
|
|
|
receivableArray.push(currentValue.Item[elChild]) |
|
|
|
}) |
|
|
|
this.seriesArray.push({ |
|
|
|
type: 'line', |
|
|
|
data: receivableArray, |
|
|
|
markLine: { |
|
|
|
data: [ |
|
|
|
{ |
|
|
|
name: '预警上限值', |
|
|
|
yAxis: this.maxValue, |
|
|
|
label: { |
|
|
|
formatter: '{b}', |
|
|
|
position: 'end' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
animationDuration |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '预警下限值', |
|
|
|
yAxis: this.minValue, |
|
|
|
label: { |
|
|
|
formatter: '{b}', |
|
|
|
position: 'end' |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
animationDuration |
|
|
|
}) |
|
|
|
this.initChart() |
|
|
|
}, |
|
|
|
deep: true |
|
|
|