Ver código fonte

冷量曲线bug

guoxiaohuan 4 anos atrás
pai
commit
9919a32ded
1 arquivos alterados com 58 adições e 22 exclusões
  1. 58 22
      src/components/strategyLine.vue

+ 58 - 22
src/components/strategyLine.vue

@@ -75,6 +75,7 @@ export default {
             this.loadY1 = []
             this.loadY2 = []
             this.loadY3 = []
+            this.loadY4 = []
             this.chillerList.forEach(el => {
                 el.value = el.time.slice(0, 2) + ':' + el.time.slice(2, 4)
                 this.dataX.push(el.value)
@@ -83,7 +84,15 @@ export default {
                 this.dataY2.push(el.meanTindoor == '-9999' ? undefined : el.meanTindoor)
                 this.dataY3.push(el.maxTindoor == '-9999' ? undefined : el.maxTindoor)
                 this.loadY1.push(el.nowPlantLoad == '-9999' && el.nowPlantLoad == '-9998' ? undefined : el.nowPlantLoad)
-                this.loadY2.push(el.predictedLoadUpLimit != '-9999' && el.predictedLoadUpLimit != '-9998' ? el.predictedLoadUpLimit : undefined)
+                this.loadY2.push({
+                    predictedLoadUpLimit:
+                        el.predictedLoadUpLimit != '-9999' && el.predictedLoadUpLimit != '-9998' ? el.predictedLoadUpLimit : undefined,
+                    predictedLoadDownLimit:
+                        el.predictedLoadDownLimit != '-9999' && el.predictedLoadDownLimit != '-9998' ? el.predictedLoadDownLimit : undefined
+                })
+                this.loadY4 = this.loadY2.map(value => {
+                    return value.predictedLoadUpLimit - value.predictedLoadDownLimit
+                })
                 this.loadY3.push(el.predictedLoadDownLimit != '-9999' && el.predictedLoadDownLimit != '-9998' ? el.predictedLoadDownLimit : undefined)
             })
             let arr = []
@@ -187,6 +196,7 @@ export default {
         drawRight() {
             var RightLine = echarts.init(document.getElementById('RightLine'))
             RightLine.setOption({
+                backgroundColor: '#fff',
                 tooltip: {
                     trigger: 'axis',
                     axisPointer: {
@@ -208,16 +218,18 @@ export default {
                             val3 = ''
                         data.forEach(i => {
                             if (i.seriesName == '预测冷量上限') {
-                                val1 = `<br/>预测冷量上限:${i.value ? i.value.toFixed(1) : '--'}`
+                                val1 = `${i.value ? i.value.toFixed(1) : '--'}`
                             }
                             if (i.seriesName == '预测冷量下限') {
-                                val2 = `<br/>预测冷量下限:${i.value ? i.value.toFixed(1) : '--'}`
+                                val2 = `${i.value ? i.value.toFixed(1) : '--'}`
                             }
                             if (i.seriesName == '实际供冷量') {
-                                val3 = `<br/>实际供冷量:${i.value ? i.value.toFixed(1) : '--'}`
+                                val3 = `${i.value ? i.value.toFixed(1) : '--'}`
                             }
                         })
-                        return `${data[0].name}${val1}${val2}${val3}`
+                        return `${data[0].name}<br/>预测冷量上限:${(Number(val1) + Number(val2)).toFixed(
+                            1
+                        )}<br/>预测冷量下限:${val2}<br/>实际供冷量:${val3}`
                     }
                 },
                 grid: {
@@ -248,29 +260,53 @@ export default {
                         }
                     },
                     {
-                        name: '预测冷量限',
+                        name: '预测冷量限',
                         type: 'line',
-                        data: this.loadY2,
-                        color: '#B6E0FF',
-                        lineStyle: {
-                            opacity: 0
-                        },
-                        stack: 'confidence-band',
-                        symbol: 'none'
+                        stack: '总量',
+
+                        areaStyle: {},
+                        data: this.loadY3,
+                        itemStyle: {
+                            color: '#fff'
+                        }
                     },
                     {
-                        name: '预测冷量限',
+                        name: '预测冷量限',
                         type: 'line',
-                        data: this.loadY3,
+                        stack: '总量',
+                        areaStyle: {},
                         color: '#B6E0FF',
-                        areaStyle: {
-                            normal: {
-                                color: '#B6E0FF'
-                            }
-                        },
-                        stack: 'confidence-band',
-                        symbol: 'none'
+                        data: this.loadY4
                     }
+                    // {
+                    //     name: '预测冷量上限',
+                    //     type: 'line',
+                    //     data: this.loadY2,
+                    //     color: '#B6E0FF',
+                    //     areaStyle: {
+                    //         normal: {
+                    //             color: '#B6E0FF'
+                    //         }
+                    //     }
+                    //     // lineStyle: {
+                    //     //     opacity: 0
+                    //     // },
+                    //     // stack: 'confidence-band',
+                    //     // symbol: 'none'
+                    // },
+                    // {
+                    //     name: '预测冷量下限',
+                    //     type: 'line',
+                    //     data: this.loadY3,
+                    //     color: '#B6E0FF',
+                    //     areaStyle: {
+                    //         normal: {
+                    //             color: '#fff'
+                    //         }
+                    //     }
+                    //     // stack: 'confidence-band',
+                    //     // symbol: 'none'
+                    // }
                 ]
             })
         }