2025-06-26 01:29:16 +08:00
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding" style="margin-top:25px;">
|
|
|
|
|
<div slot="header">
|
|
|
|
|
<span class="card-title">策略模板曲线展示</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="height: 360px" id="tempChart"/>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"></style>
|
|
|
|
|
<script>
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
import resize from '@/mixins/ems/resize'
|
2025-07-13 16:13:45 +08:00
|
|
|
import {curveList} from '@/api/ems/dzjk'
|
2025-06-26 01:29:16 +08:00
|
|
|
export default {
|
2025-07-13 16:13:45 +08:00
|
|
|
inject:['$home'],
|
2025-06-26 01:29:16 +08:00
|
|
|
mixins: [resize],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
chart: null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
2025-07-13 16:13:45 +08:00
|
|
|
this.destoryChart()
|
2025-06-26 01:29:16 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2025-07-13 16:13:45 +08:00
|
|
|
destoryChart(){
|
|
|
|
|
if (!this.chart) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.chart.dispose()
|
|
|
|
|
this.chart = null
|
|
|
|
|
},
|
|
|
|
|
changeSiteId(){
|
|
|
|
|
this.destoryChart()
|
|
|
|
|
},
|
|
|
|
|
init(){
|
|
|
|
|
if(!this.chart){
|
|
|
|
|
this.chart = echarts.init(document.getElementById('tempChart'))
|
|
|
|
|
}
|
|
|
|
|
const strategyId = this.$home.updateStrategyId
|
|
|
|
|
const siteId=this.$home.siteId
|
|
|
|
|
curveList({strategyId,siteId}).then(response => {
|
|
|
|
|
this.setOption(response?.data || [])
|
|
|
|
|
})
|
2025-06-26 01:29:16 +08:00
|
|
|
},
|
2025-07-13 16:13:45 +08:00
|
|
|
setOption(data) {
|
|
|
|
|
if(!this.chart) return
|
2025-06-26 01:29:16 +08:00
|
|
|
this.chart.setOption({
|
|
|
|
|
color:['#FFBD00','#3C81FF'],
|
|
|
|
|
legend: {
|
|
|
|
|
left: 'center',
|
|
|
|
|
bottom: '10',
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
|
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
textStyle:{
|
|
|
|
|
color:"#333333",
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
data: ['01:00','02:00','03:00','05:00','06:00','07:00','08:00','09:00','10:00'],
|
|
|
|
|
axisLine: {
|
|
|
|
|
lineStyle:{
|
|
|
|
|
color: '#333333',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLine: {
|
|
|
|
|
lineStyle:{
|
|
|
|
|
color: '#333333',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name:'模板一',
|
|
|
|
|
data: [80,92,1,34,90,130,320,80,9,91],
|
|
|
|
|
type: 'line',
|
|
|
|
|
},{
|
|
|
|
|
name:'模板二',
|
|
|
|
|
data: [820,932,901,934,1290,1330,1320,820,932,901],
|
|
|
|
|
type: 'line',
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|