Просмотр исходного кода

功率预测问题(sunzehao提交)修改

wangb 5 месяцев назад
Родитель
Сommit
6e52ec1c18

+ 1 - 1
components.d.ts

@@ -166,7 +166,7 @@ declare module 'vue' {
     StrightLineChart: typeof import('./src/components/chart/line/stright-line-chart.vue')['default']
     SubmitBtn: typeof import('./src/components/generatingCapacityComponent/SubmitBtn.vue')['default']
     SvgDraw: typeof import('./src/components/coms/icon/svg-draw.vue')['default']
-    SvgIcon: typeof import('./src/components/powerPredictionComponent/svgIcon/index.vue')['default']
+    SvgIcon: typeof import('./src/components/coms/icon/svg-icon.vue')['default']
     SvgPageShow: typeof import('./src/components/powerPredictionComponent/powerControlSvg/svgPageShow.vue')['default']
     Tab: typeof import('./src/components/coms/tabs/tab.vue')['default']
     Table: typeof import('./src/components/generatingCapacityComponent/table.vue')['default']

+ 21 - 17
src/components/powerPredictionComponent/homePageAssembly/globalDialogPage.vue

@@ -38,7 +38,7 @@
                 <div class="main_charts">
                     <div id="centerCharts" class="chartsStyle"></div>
                 </div>
-                <div class="warn-table" style="margin-top: 20px" v-show="title === '功率预测'">
+                <div class="warn-table" style="margin-top: 20px" v-if="title === '功率预测'">
                     <el-table :data="tableData" ref="report-table_power" max-height="45vh" style="width: 100%"
                         :header-cell-style="{
                         padding: '4px',
@@ -79,7 +79,7 @@
                         </el-table-column>
                     </el-table>
                 </div>
-                <div class="warn-table" v-show="title === '风速预测' || title === '辐照度预测'">
+                <div class="warn-table" v-if="title === '风速预测' || title === '辐照度预测'">
                     <el-table :data="tableData" ref="report-table_wind" max-height="400px" style="width: 100%"
                         :header-cell-style="{
                         padding: '4px',
@@ -307,21 +307,25 @@
                             }
                         }
                         if (datas.data.dataFormatList.length > 0) {
-                            datas.data.dataFormatList.forEach((iten) => {
-                                legend.push(iten.name);
-                                let seriesObj = {
-                                    name: iten.name,
-                                    type: "line",
-                                    data: iten.data.map((it) => {
-                                        return this.$utils.isHasNum(it);
-                                    }),
-                                    symbol: "none",
-                                };
-                                series.push(seriesObj);
-                            });
+                            let powerArr = ["理论", "可用", "AGC", "超短期", "短期", "实际"]
+                            powerArr.forEach(it =>{
+                                datas.data.dataFormatList.forEach((iten) => {
+                                    if (it === iten.name) {
+                                        legend.push(iten.name);
+                                        let seriesObj = {
+                                            name: iten.name,
+                                            type: "line",
+                                            data: iten.data.map((it) => {
+                                                return this.$utils.isHasNum(it);
+                                            }),
+                                            symbol: "none",
+                                        };
+                                        series.push(seriesObj);
+                                    }
+                                });
+                            })
                         }
-                        let color = ['#5470c6', '#91cc75', '#fac858', '#39d93d', '#ee6666', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
-                        this.getglobalLine("centerCharts", "功率", xAxis, legend, series, color);
+                        this.getglobalLine("centerCharts", "功率", xAxis, legend, series);
                     }
                 });
             },
@@ -459,7 +463,7 @@
                         if (datas.data.dataFormatList) {
                             datas.data.dataFormatList.forEach((item) => {
                                 for (let i in item) {
-                                    if (i !== "dataTime" && i !== "monthList") {
+                                    if (i !== "dataTime") {
                                         if (item[i] !== null && item[i] !== "NaN") {
                                             item[i] = item[i].toFixed(3);
                                         } else {

+ 35 - 18
src/components/powerPredictionComponent/panoramicPowerDialog/panoramaPowerDialogPage.vue

@@ -234,36 +234,53 @@
                             xAxis = datas.data.dateList;
                         }
                     }
-                    if (datas.data.dataFormatList.length > 0) {
-                        datas.data.dataFormatList.forEach((iten) => {
-                            legend.push(iten.name);
-                            let seriesObj = {
-                                name: iten.name,
-                                type: "line",
-                                data: iten.data.map((it) => {
-                                    return this.$utils.isHasNum(it);
-                                }),
-                                symbol: "none",
-                            };
-                            series.push(seriesObj);
-                        });
-                    }
-                    let color = ['#5470c6', '#91cc75', '#fac858', '#39d93d', '#ee6666', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
                     if (name === "功率") {
-                        this.getglobalLine("centerCharts", name, xAxis, legend, series, color);
+                        if (datas.data.dataFormatList.length > 0) {
+                            let powerArr = ["理论", "可用", "AGC", "超短期", "短期", "实际"]
+                            powerArr.forEach(it =>{
+                                datas.data.dataFormatList.forEach((iten) => {
+                                    if (it === iten.name) {
+                                        legend.push(iten.name);
+                                        let seriesObj = {
+                                            name: iten.name,
+                                            type: "line",
+                                            data: iten.data.map((it) => {
+                                                return this.$utils.isHasNum(it);
+                                            }),
+                                            symbol: "none",
+                                        };
+                                        series.push(seriesObj);
+                                    }
+                                });
+                            })
+                        }
+                        this.getglobalLine("centerCharts", name, xAxis, legend, series);
                     } else {
+                        if (datas.data.dataFormatList.length > 0) {
+                            datas.data.dataFormatList.forEach((iten) => {
+                                legend.push(iten.name);
+                                let seriesObj = {
+                                    name: iten.name,
+                                    type: "line",
+                                    data: iten.data.map((it) => {
+                                        return this.$utils.isHasNum(it);
+                                    }),
+                                    symbol: "none",
+                                };
+                                series.push(seriesObj);
+                            });
+                        }
                         this.getglobalLine("windCharts", name, xAxis, legend, series);
                     }
                 }
             },
-            getglobalLine(name, title, xAxis, legend, series, color) {
+            getglobalLine(name, title, xAxis, legend, series) {
                 let Yname =
                     title === "功率" ? "兆瓦(Mw)" : title === "风速" ? "m/s" : "W/㎡";
                 let option = {
                     title: {
                         text: title,
                     },
-                    color: color,
                     tooltip: {
                         trigger: "axis",
                     },

+ 19 - 16
src/components/powerPredictionComponent/powerPredictionDialog/predictionDialogPage.vue

@@ -267,21 +267,25 @@
                             }
                         }
                         if (datas.data.dataFormatList.length > 0) {
-                            datas.data.dataFormatList.forEach((iten) => {
-                                legend.push(iten.name);
-                                let seriesObj = {
-                                    name: iten.name,
-                                    type: "line",
-                                    data: iten.data.map((it) => {
-                                        return this.$utils.isHasNum(it);
-                                    }),
-                                    symbol: "none",
-                                };
-                                series.push(seriesObj);
-                            });
+                            let powerArr = ["理论", "可用", "AGC", "超短期", "短期", "实际"]
+                            powerArr.forEach(it =>{
+                                datas.data.dataFormatList.forEach((iten) => {
+                                    if (it === iten.name) {
+                                        legend.push(iten.name);
+                                        let seriesObj = {
+                                            name: iten.name,
+                                            type: "line",
+                                            data: iten.data.map((it) => {
+                                                return this.$utils.isHasNum(it);
+                                            }),
+                                            symbol: "none",
+                                        };
+                                        series.push(seriesObj);
+                                    }
+                                });
+                            })
                         }
-                        let color = ['#5470c6', '#91cc75', '#fac858', '#39d93d', '#ee6666', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
-                        this.getglobalLine("centerCharts", "功率", xAxis, legend, series, color);
+                        this.getglobalLine("centerCharts", "功率", xAxis, legend, series);
                     }
                 });
             },
@@ -336,7 +340,7 @@
                     }
                 });
             },
-            getglobalLine(name, title, xAxis, legend, series, color) {
+            getglobalLine(name, title, xAxis, legend, series) {
                 let dark = this.from === "index" ? "dark" : "";
                 let yxname = title === "功率" ? "兆瓦(Mw)" : "m/s";
                 let dom = document.getElementById(name);
@@ -348,7 +352,6 @@
                     title: {
                         text: title,
                     },
-                    color: color,
                     tooltip: {
                         trigger: "axis",
                     },

+ 105 - 98
src/views/powerPrediction/homePageNoMap.vue

@@ -23,7 +23,7 @@
               justify-content: end;
               margin-right: 53px;
             ">
-                        <div v-for="item in showpowerLegend" :key="item.name">
+                        <!-- <div v-for="item in showpowerLegend" :key="item.name">
                             <span class="lineColor" :style="{ background: item.color }"></span>
                             <span class="powerLegendColor" :style="{ background: item.color }"></span>
                             <span :style="!theme ? 'color: #fff' : ''" style="
@@ -32,7 +32,7 @@
                   position: relative;
                   top: 1px;
                 ">{{ item.name }}</span>
-                        </div>
+                        </div> -->
                     </div>
                     <div class="chart-name">
                         <div class="point point-left bottom"></div>
@@ -1578,20 +1578,25 @@
                             });
                         }
                         if (datas.data.dataFormatList.length > 0) {
-                            datas.data.dataFormatList.forEach((iten) => {
-                                if (iten.name !== "短期") {
-                                    legend.push(iten.name);
-                                    let seriesObj = {
-                                        name: iten.name,
-                                        type: "line",
-                                        data: iten.data.map((it) => {
-                                            return that.$utils.isHasNum(it);
-                                        }),
-                                        symbol: "none",
-                                    };
-                                    series.push(seriesObj);
-                                }
-                            });
+                            let powerArr = ["理论功率", "可用功率", "AGC", "超短期", "短期", "实际"]
+                            powerArr.forEach(it =>{
+                                datas.data.dataFormatList.forEach((iten) => {
+                                    // if (iten.name !== "短期") {
+                                    if (it === iten.name) {
+                                        legend.push(iten.name);
+                                        let seriesObj = {
+                                            name: iten.name,
+                                            type: "line",
+                                            data: iten.data.map((it) => {
+                                                return that.$utils.isHasNum(it);
+                                            }),
+                                            symbol: "none",
+                                        };
+                                        series.push(seriesObj);
+                                    }
+                                    // }
+                                });
+                            })
                         }
                         that.getPowerLine("lineChart", "今日功率预测", xAxis, legend, series);
                     }
@@ -1655,65 +1660,65 @@
                     },
                     tooltip: {
                         trigger: "axis",
-                        formatter: name === "lineChart" ?
-                            (item) => {
-                                let str =
-                                    `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
-                                let strMsg = "";
-                                if (item.length > 1) {
-                                    item.forEach((it, index) => {
-                                        // if (index !== 3) {
-                                        if (it.seriesName !== "超短期") {
-                                            strMsg = `<div style="margin-bottom: 5px">
-                                        <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
-                                        <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
-                                            </div>`;
-
-                                            // this.showpowerLegend[index].name = it.seriesName;
-                                            // this.showpowerLegend[index].color = it.color;
-                                        } else {
-                                            if (it.axisValue === "00:15:00") {
-                                                it.color = "#e96366";
-                                            }
-                                            strMsg = `<div style="margin-bottom: 5px">
-                                        <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
-                                          it.color
-                                        };\"></span>&nbsp;
-                                        <span style="display:inline-block;">${
-                                          it.color === "#e96366" ? "超短期" : "短期"
-                                        }:</span>&nbsp;&nbsp;<span>${it.value}</span>
-                                            </div>`;
-                                            // if (it.color === "#e96366") {
-                                            //     this.showpowerLegend[index].name = "超短期";
-                                            // } else {
-                                            //     this.showpowerLegend[index].name = "短期";
-                                            // }
-                                            // this.showpowerLegend[index].color = it.color;
-                                        }
-                                        str = str + strMsg;
-                                    });
-                                } else {
-                                    if (item[0].axisValue === "00:15:00") {
-                                        item[0].color = "#e96366";
-                                    }
-                                    strMsg = `<div style="margin-bottom: 5px">
-                                    <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
-                                        item[0].color
-                                    };\"></span>&nbsp;
-                                    <span style="display:inline-block;">${
-                                        item[0].color === "#e96366" ? "超短期" : "短期"
-                                    }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
-                                        </div>`;
-                                    // if (item[0].color === "#e96366") {
-                                    //     this.showpowerLegend[3].name = "超短期";
-                                    // } else {
-                                    //     this.showpowerLegend[3].name = "短期";
-                                    // }
-                                    // this.showpowerLegend[3].color = item[0].color;
-                                    str = str + strMsg;
-                                }
-                                return str;
-                            } : "",
+                        // formatter: name === "lineChart" ?
+                        //     (item) => {
+                        //         let str =
+                        //             `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
+                        //         let strMsg = "";
+                        //         if (item.length > 1) {
+                        //             item.forEach((it, index) => {
+                        //                 // if (index !== 3) {
+                        //                 if (it.seriesName !== "超短期") {
+                        //                     strMsg = `<div style="margin-bottom: 5px">
+                        //                 <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
+                        //                 <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
+                        //                     </div>`;
+
+                        //                     // this.showpowerLegend[index].name = it.seriesName;
+                        //                     // this.showpowerLegend[index].color = it.color;
+                        //                 } else {
+                        //                     if (it.axisValue === "00:15:00") {
+                        //                         it.color = "#e96366";
+                        //                     }
+                        //                     strMsg = `<div style="margin-bottom: 5px">
+                        //                 <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
+                        //                   it.color
+                        //                 };\"></span>&nbsp;
+                        //                 <span style="display:inline-block;">${
+                        //                   it.color === "#e96366" ? "超短期" : "短期"
+                        //                 }:</span>&nbsp;&nbsp;<span>${it.value}</span>
+                        //                     </div>`;
+                        //                     // if (it.color === "#e96366") {
+                        //                     //     this.showpowerLegend[index].name = "超短期";
+                        //                     // } else {
+                        //                     //     this.showpowerLegend[index].name = "短期";
+                        //                     // }
+                        //                     // this.showpowerLegend[index].color = it.color;
+                        //                 }
+                        //                 str = str + strMsg;
+                        //             });
+                        //         } else {
+                        //             if (item[0].axisValue === "00:15:00") {
+                        //                 item[0].color = "#e96366";
+                        //             }
+                        //             strMsg = `<div style="margin-bottom: 5px">
+                        //             <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
+                        //                 item[0].color
+                        //             };\"></span>&nbsp;
+                        //             <span style="display:inline-block;">${
+                        //                 item[0].color === "#e96366" ? "超短期" : "短期"
+                        //             }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
+                        //                 </div>`;
+                        //             // if (item[0].color === "#e96366") {
+                        //             //     this.showpowerLegend[3].name = "超短期";
+                        //             // } else {
+                        //             //     this.showpowerLegend[3].name = "短期";
+                        //             // }
+                        //             // this.showpowerLegend[3].color = item[0].color;
+                        //             str = str + strMsg;
+                        //         }
+                        //         return str;
+                        //     } : "",
                     },
                     // axisPointer: {
                     //     link: {
@@ -1741,7 +1746,7 @@
                         right: name !== "lineChart1" ? "20" : "20%",
                         data: legend,
                         // show: name === 'lineChart' ? false : true
-                        show: false,
+                        show: true,
                         // formatter: name === 'lineChart' ? (name, type) => {
                         //     // debugger
                         //     if (!type) {
@@ -1887,28 +1892,29 @@
                             });
                         }
                         if (datas.data.dataFormatList.length > 0) {
-                            datas.data.dataFormatList.forEach((iten, index) => {
-                                legend.push(iten.name);
-                                let seriesObj = {
-                                    name: iten.name,
-                                    type: "bar",
-                                    barGap: 0,
-                                    emphasis: {
-                                        focus: "series",
-                                    },
-                                    data: iten.data.map((it) => {
-                                        return that.$utils.isHasNum(it);
-                                    }),
-                                    // itemStyle:{
-                                    //     normal: {
-                                    //         color: color[index]
-                                    //     }
-                                    // }
-                                };
-                                series.push(seriesObj);
-                            });
+                            let powerArr = ["装机", "理论", "可用", "预测", "实时"]
+                            powerArr.forEach(it =>{
+                                datas.data.dataFormatList.forEach((iten, index) => {
+                                    if (it === iten.name) {
+                                        legend.push(iten.name);
+                                        let seriesObj = {
+                                            name: iten.name,
+                                            type: "bar",
+                                            barGap: 0,
+                                            emphasis: {
+                                                focus: "series",
+                                            },
+                                            data: iten.data.map((it) => {
+                                                return that.$utils.isHasNum(it);
+                                            }),
+                                        };
+                                        series.push(seriesObj);
+                                    }
+                                });
+                            })
                         }
-                        that.getPowerBar("barChart", "功率统计", xAxis, legend, series);
+                        let color = ['#ea7ccc', '#5470c6', '#91cc75', '#ee6666', '#73c0de', '#fc8452', '#9a60b4', ]
+                        that.getPowerBar("barChart", "功率统计", xAxis, legend, series, color);
                     }
                 });
             },
@@ -1961,7 +1967,7 @@
                     }
                 });
             },
-            getPowerBar(name, title, xAxis, legend, series) {
+            getPowerBar(name, title, xAxis, legend, series, color) {
                 let option = {
                     title: {
                         text: title,
@@ -1970,6 +1976,7 @@
                             fontWeight: "bold",
                         },
                     },
+                    color: color,
                     tooltip: {
                         trigger: "axis",
                         axisPointer: {

+ 96 - 91
src/views/powerPrediction/panoramicPower.vue

@@ -33,7 +33,7 @@
                 justify-content: end;
                 margin-right: 5px;
               ">
-                            <div v-for="it in item.showpowerLegend" :key="it.name">
+                            <!-- <div v-for="it in item.showpowerLegend" :key="it.name">
                                 <span class="lineColor" :style="{ background: it.color }"></span>
                                 <span class="powerLegendColor" :style="{ background: it.color }"></span>
                                 <span :style="!theme ? 'color: #fff' : ''" style="
@@ -42,7 +42,7 @@
                     position: relative;
                     top: 1px;
                   ">{{ it.name }}</span>
-                            </div>
+                            </div> -->
                         </div>
                         <div class="chart-name">
                             <div class="point point-left bottom"></div>
@@ -560,21 +560,26 @@
                                 let legend = [];
                                 let series = [];
                                 let namess = "";
-                                for (let i = 0; i < item.dataFormatList.length; i++) {
-                                    if (item.dataFormatList[i].name !== "短期") {
-                                        legend.push(item.dataFormatList[i].name);
-                                        namess = item.name;
-                                        let seriesObj = {
-                                            name: item.dataFormatList[i].name,
-                                            type: "line",
-                                            data: item.dataFormatList[i].data.map((it) => {
-                                                return this.$utils.isHasNum(it);
-                                            }),
-                                            symbol: "none",
-                                        };
-                                        series.push(seriesObj);
+                                let powerArr = ["理论", "可用", "AGC", "超短期", "短期", "实际"]
+                                powerArr.forEach(it =>{
+                                    for (let i = 0; i < item.dataFormatList.length; i++) {
+                                        // if (item.dataFormatList[i].name !== "短期") {
+                                        if (it === item.dataFormatList[i].name) {
+                                            legend.push(item.dataFormatList[i].name);
+                                            namess = item.name;
+                                            let seriesObj = {
+                                                name: item.dataFormatList[i].name,
+                                                type: "line",
+                                                data: item.dataFormatList[i].data.map((it) => {
+                                                    return this.$utils.isHasNum(it);
+                                                }),
+                                                symbol: "none",
+                                            };
+                                            series.push(seriesObj);
+                                        }
+                                        // }
                                     }
-                                }
+                                })
                                 this.$nextTick(() => {
                                     this.getPowerLine(namess, index, xAxis, legend, series);
                                 });
@@ -596,72 +601,72 @@
                     },
                     tooltip: {
                         trigger: "axis",
-                        formatter: (item) => {
-                            // debugger
+                        // formatter: (item) => {
+                        //     // debugger
 
-                            let str =
-                                `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
-                            let strMsg = "";
-                            if (item.length > 1) {
-                                item.forEach((it, index) => {
-                                    // if (index !== 3) {
-                                    if (it.seriesName !== "超短期") {
-                                        strMsg = `<div style="margin-bottom: 5px">
-                                        <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
-                                        <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
-                                            </div>`;
-                                        // this.chartsData[numxc].showpowerLegend[index].name =
-                                        //     it.seriesName;
-                                        // this.chartsData[numxc].showpowerLegend[index].color = it.color;
-                                    } else {
-                                        if (it.axisValue === "00:15:00") {
-                                            it.color = "#e96366";
-                                        }
-                                        strMsg = `<div style="margin-bottom: 5px">
-                                        <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
-                                          it.color
-                                        };\"></span>&nbsp;
-                                        <span style="display:inline-block;">${
-                                          it.color === "#e96366" ? "超短期" : "短期"
-                                        }:</span>&nbsp;&nbsp;<span>${it.value}</span>
-                                            </div>`;
-                                        // if (it.color === "#e96366") {
-                                        //     this.chartsData[numxc].showpowerLegend[index].name = "超短期";
-                                        // } else {
-                                        //     this.chartsData[numxc].showpowerLegend[index].name = "短期";
-                                        // }
-                                        // this.chartsData[numxc].showpowerLegend[index].color = it.color;
-                                    }
-                                    str = str + strMsg;
-                                });
-                            } else {
-                                if (item[0].axisValue === "00:15:00") {
-                                    item[0].color = "#e96366";
-                                }
-                                strMsg = `<div style="margin-bottom: 5px">
-                                <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
-                                    item[0].color
-                                };\"></span>&nbsp;
-                                <span style="display:inline-block;">${
-                                    item[0].color === "#e96366" ? "超短期" : "短期"
-                                }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
-                                    </div>`;
-                                // if (item[0].color === "#e96366") {
-                                //     this.chartsData[numxc].showpowerLegend[3].name = "超短期";
-                                // } else {
-                                //     this.chartsData[numxc].showpowerLegend[3].name = "短期";
-                                // }
-                                // this.chartsData[numxc].showpowerLegend[3].color = item[0].color;
-                                str = str + strMsg;
-                            }
-                            return str;
-                        },
+                        //     let str =
+                        //         `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
+                        //     let strMsg = "";
+                        //     if (item.length > 1) {
+                        //         item.forEach((it, index) => {
+                        //             // if (index !== 3) {
+                        //             if (it.seriesName !== "超短期") {
+                        //                 strMsg = `<div style="margin-bottom: 5px">
+                        //                 <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
+                        //                 <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
+                        //                     </div>`;
+                        //                 // this.chartsData[numxc].showpowerLegend[index].name =
+                        //                 //     it.seriesName;
+                        //                 // this.chartsData[numxc].showpowerLegend[index].color = it.color;
+                        //             } else {
+                        //                 if (it.axisValue === "00:15:00") {
+                        //                     it.color = "#e96366";
+                        //                 }
+                        //                 strMsg = `<div style="margin-bottom: 5px">
+                        //                 <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
+                        //                   it.color
+                        //                 };\"></span>&nbsp;
+                        //                 <span style="display:inline-block;">${
+                        //                   it.color === "#e96366" ? "超短期" : "短期"
+                        //                 }:</span>&nbsp;&nbsp;<span>${it.value}</span>
+                        //                     </div>`;
+                        //                 // if (it.color === "#e96366") {
+                        //                 //     this.chartsData[numxc].showpowerLegend[index].name = "超短期";
+                        //                 // } else {
+                        //                 //     this.chartsData[numxc].showpowerLegend[index].name = "短期";
+                        //                 // }
+                        //                 // this.chartsData[numxc].showpowerLegend[index].color = it.color;
+                        //             }
+                        //             str = str + strMsg;
+                        //         });
+                        //     } else {
+                        //         if (item[0].axisValue === "00:15:00") {
+                        //             item[0].color = "#e96366";
+                        //         }
+                        //         strMsg = `<div style="margin-bottom: 5px">
+                        //         <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
+                        //             item[0].color
+                        //         };\"></span>&nbsp;
+                        //         <span style="display:inline-block;">${
+                        //             item[0].color === "#e96366" ? "超短期" : "短期"
+                        //         }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
+                        //             </div>`;
+                        //         // if (item[0].color === "#e96366") {
+                        //         //     this.chartsData[numxc].showpowerLegend[3].name = "超短期";
+                        //         // } else {
+                        //         //     this.chartsData[numxc].showpowerLegend[3].name = "短期";
+                        //         // }
+                        //         // this.chartsData[numxc].showpowerLegend[3].color = item[0].color;
+                        //         str = str + strMsg;
+                        //     }
+                        //     return str;
+                        // },
                     },
                     legend: {
                         top: 0,
                         right: 0,
                         data: legend,
-                        show: false,
+                        show: true,
                     },
                     grid: {
                         left: "5%",
@@ -706,22 +711,22 @@
                     }
                 });
                 if (num > 0) {
-                    option.visualMap = {
-                        show: false,
-                        dimension: 0,
-                        seriesIndex: 3,
+                    // option.visualMap = {
+                    //     show: false,
+                    //     dimension: 0,
+                    //     seriesIndex: 3,
 
-                        pieces: [{
-                                gt: 0,
-                                lte: num,
-                                color: "#e96366",
-                            },
-                            {
-                                gt: num,
-                                color: "#39d93d",
-                            },
-                        ],
-                    };
+                    //     pieces: [{
+                    //             gt: 0,
+                    //             lte: num,
+                    //             color: "#e96366",
+                    //         },
+                    //         {
+                    //             gt: num,
+                    //             color: "#39d93d",
+                    //         },
+                    //     ],
+                    // };
                 }
                 if (!this.theme) {
                     option.backgroundColor = "";

+ 94 - 90
src/views/powerPrediction/powerPredictionPage.vue

@@ -50,7 +50,7 @@
                 justify-content: end;
                 margin-right: 23px;
               ">
-                            <div v-for="item in showpowerLegend" :key="item.name">
+                            <!-- <div v-for="item in showpowerLegend" :key="item.name">
                                 <span class="lineColor" :style="{ background: item.color }"></span>
                                 <span class="powerLegendColor" :style="{ background: item.color }"></span>
                                 <span :style="!theme ? 'color: #fff' : ''" style="
@@ -59,7 +59,7 @@
                     position: relative;
                     top: 1px;
                   ">{{ item.name }}</span>
-                            </div>
+                            </div> -->
                         </div>
                         <div class="chart-name">
                             <div class="point point-left bottom"></div>
@@ -921,20 +921,24 @@
                             });
                         }
                         if (datas.data.dataFormatList.length > 0) {
-                            datas.data.dataFormatList.forEach((iten) => {
-                                if (iten.name !== "短期") {
-                                    legend.push(iten.name);
-                                    let seriesObj = {
-                                        name: iten.name,
-                                        type: "line",
-                                        data: iten.data.map((it) => {
-                                            return this.$utils.isHasNum(it);
-                                        }),
-                                        symbol: "none",
-                                    };
-                                    series.push(seriesObj);
-                                }
-                            });
+                            let powerArr = ["理论", "可用", "AGC", "超短期", "短期", "实际"]
+                            powerArr.forEach(it =>{
+                                datas.data.dataFormatList.forEach((iten) => {
+                                    if (it === iten.name) {
+                                        legend.push(iten.name);
+                                        let seriesObj = {
+                                            name: iten.name,
+                                            type: "line",
+                                            data: iten.data.map((it) => {
+                                                return this.$utils.isHasNum(it);
+                                            }),
+                                            symbol: "none",
+                                        };
+                                        series.push(seriesObj);
+                                    }
+                                });
+                                
+                            })
                         }
                         this.getPowerLine("powerChart", "功率预测", xAxis, legend, series);
                     }
@@ -999,71 +1003,71 @@
                     },
                     tooltip: {
                         trigger: "axis",
-                        formatter: name === "powerChart" ?
-                            (item) => {
-                                let str =
-                                    `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
-                                let strMsg = "";
-                                if (item.length > 1) {
-                                    item.forEach((it, index) => {
-                                        // if (index !== 3) {
-                                        if (it.seriesName !== "超短期") {
-                                            strMsg = `<div style="margin-bottom: 5px">
-                                        <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
-                                        <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
-                                            </div>`;
-                                            // this.showpowerLegend[index].name = it.seriesName;
-                                            // this.showpowerLegend[index].color = it.color;
-                                        } else {
-                                            if (it.axisValue === "00:15:00") {
-                                                it.color = "#e96366";
-                                            }
-                                            strMsg = `<div style="margin-bottom: 5px">
-                                        <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
-                                          it.color
-                                        };\"></span>&nbsp;
-                                        <span style="display:inline-block;">${
-                                          it.color === "#e96366" ? "超短期" : "短期"
-                                        }:</span>&nbsp;&nbsp;<span>${it.value}</span>
-                                            </div>`;
-                                            // if (it.color === "#e96366") {
-                                            //     this.showpowerLegend[index].name = "超短期";
-                                            // } else {
-                                            //     this.showpowerLegend[index].name = "短期";
-                                            // }
-                                            // this.showpowerLegend[index].color = it.color;
-                                        }
-                                        str = str + strMsg;
-                                    });
-                                } else {
-                                    if (item[0].axisValue === "00:15:00") {
-                                        item[0].color = "#e96366";
-                                    }
-                                    strMsg = `<div style="margin-bottom: 5px">
-                                    <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
-                                        item[0].color
-                                    };\"></span>&nbsp;
-                                    <span style="display:inline-block;">${
-                                        item[0].color === "#e96366" ? "超短期" : "短期"
-                                    }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
-                                        </div>`;
-                                    // if (item[0].color === "#e96366") {
-                                    //     this.showpowerLegend[3].name = "超短期";
-                                    // } else {
-                                    //     this.showpowerLegend[3].name = "短期";
-                                    // }
-                                    // this.showpowerLegend[3].color = item[0].color;
-                                    str = str + strMsg;
-                                }
-                                return str;
-                            } : "",
+                        // formatter: name === "powerChart" ?
+                        //     (item) => {
+                        //         let str =
+                        //             `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
+                        //         let strMsg = "";
+                        //         if (item.length > 1) {
+                        //             item.forEach((it, index) => {
+                        //                 // if (index !== 3) {
+                        //                 if (it.seriesName !== "超短期") {
+                        //                     strMsg = `<div style="margin-bottom: 5px">
+                        //                 <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
+                        //                 <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
+                        //                     </div>`;
+                        //                     // this.showpowerLegend[index].name = it.seriesName;
+                        //                     // this.showpowerLegend[index].color = it.color;
+                        //                 } else {
+                        //                     if (it.axisValue === "00:15:00") {
+                        //                         it.color = "#e96366";
+                        //                     }
+                        //                     strMsg = `<div style="margin-bottom: 5px">
+                        //                 <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
+                        //                   it.color
+                        //                 };\"></span>&nbsp;
+                        //                 <span style="display:inline-block;">${
+                        //                   it.color === "#e96366" ? "超短期" : "短期"
+                        //                 }:</span>&nbsp;&nbsp;<span>${it.value}</span>
+                        //                     </div>`;
+                        //                     // if (it.color === "#e96366") {
+                        //                     //     this.showpowerLegend[index].name = "超短期";
+                        //                     // } else {
+                        //                     //     this.showpowerLegend[index].name = "短期";
+                        //                     // }
+                        //                     // this.showpowerLegend[index].color = it.color;
+                        //                 }
+                        //                 str = str + strMsg;
+                        //             });
+                        //         } else {
+                        //             if (item[0].axisValue === "00:15:00") {
+                        //                 item[0].color = "#e96366";
+                        //             }
+                        //             strMsg = `<div style="margin-bottom: 5px">
+                        //             <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
+                        //                 item[0].color
+                        //             };\"></span>&nbsp;
+                        //             <span style="display:inline-block;">${
+                        //                 item[0].color === "#e96366" ? "超短期" : "短期"
+                        //             }:</span>&nbsp;&nbsp;<span>${item[0].value}</span>
+                        //                 </div>`;
+                        //             // if (item[0].color === "#e96366") {
+                        //             //     this.showpowerLegend[3].name = "超短期";
+                        //             // } else {
+                        //             //     this.showpowerLegend[3].name = "短期";
+                        //             // }
+                        //             // this.showpowerLegend[3].color = item[0].color;
+                        //             str = str + strMsg;
+                        //         }
+                        //         return str;
+                        //     } : "",
                     },
                     legend: {
                         // width: '380',
                         right: "20",
                         data: legend,
                         // show: name === 'powerChart' ? false : true
-                        show: false,
+                        show: true,
                     },
                     grid: {
                         left: "5%",
@@ -1109,22 +1113,22 @@
                         }
                     });
                     if (num > 0) {
-                        option.visualMap = {
-                            show: false,
-                            dimension: 0,
-                            seriesIndex: 3,
+                        // option.visualMap = {
+                        //     show: false,
+                        //     dimension: 0,
+                        //     seriesIndex: 3,
 
-                            pieces: [{
-                                    gt: 0,
-                                    lte: num,
-                                    color: "#e96366",
-                                },
-                                {
-                                    gt: num,
-                                    color: "#39d93d",
-                                },
-                            ],
-                        };
+                        //     pieces: [{
+                        //             gt: 0,
+                        //             lte: num,
+                        //             color: "#e96366",
+                        //         },
+                        //         {
+                        //             gt: num,
+                        //             color: "#39d93d",
+                        //         },
+                        //     ],
+                        // };
                     }
                 } else {
                     option.legend.show = true;