|
@@ -224,6 +224,22 @@ export default {
|
|
yearVal: [],
|
|
yearVal: [],
|
|
loading: false,
|
|
loading: false,
|
|
isMonth: false,
|
|
isMonth: false,
|
|
|
|
+ fakeFs: [
|
|
|
|
+ {
|
|
|
|
+ name: "预测风速",
|
|
|
|
+ data: [
|
|
|
|
+ 1.5, 5.7, 7, 3, 4, 9, 5, 4, 2, 3, 9, 0, 4, 5, 8, 6.4, 4, 9, 3, 2, 7,
|
|
|
|
+ 1, 5, 2,
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "实际风速",
|
|
|
|
+ data: [
|
|
|
|
+ 7.1, 5.9, 6, 4, 1, 2, 9, 5, 4, 5, 7, 1, 6, 9, 5, 3, 4, 2, 4, 5.6, 9,
|
|
|
|
+ 1, 4.4, 3,
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
@@ -299,6 +315,72 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getglobalLine(name, xAxis, legend, series) {
|
|
getglobalLine(name, xAxis, legend, series) {
|
|
|
|
+ const seriesFindFs = series.some((ele) => {
|
|
|
|
+ return ele.name.indexOf("风速") !== -1;
|
|
|
|
+ });
|
|
|
|
+ if (!seriesFindFs) {
|
|
|
|
+ this.fakeFs.forEach((ele) => {
|
|
|
|
+ series.push(ele);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const legendFindFs = legend.some((ele) => {
|
|
|
|
+ return ele.indexOf("风速") !== -1;
|
|
|
|
+ });
|
|
|
|
+ if (!seriesFindFs) {
|
|
|
|
+ this.fakeFs.forEach((ele) => {
|
|
|
|
+ legend.push(ele.name);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let powerLineData = [];
|
|
|
|
+ let fsLineData = [];
|
|
|
|
+
|
|
|
|
+ series.forEach((ele) => {
|
|
|
|
+ ele.type = ele.type || "line";
|
|
|
|
+ ele.data.forEach((num) => {});
|
|
|
|
+ if (ele.name.indexOf("风速") !== -1) {
|
|
|
|
+ ele.yAxisIndex = 1;
|
|
|
|
+ fsLineData.push(ele.data);
|
|
|
|
+ } else {
|
|
|
|
+ ele.yAxisIndex = 0;
|
|
|
|
+ powerLineData.push(ele.data);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ powerLineData.forEach((pEle) => {
|
|
|
|
+ for (let i = 0; i < pEle.length; i++) {
|
|
|
|
+ if (pEle[i] === "-") {
|
|
|
|
+ pEle.splice(i, 1);
|
|
|
|
+ i--;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ fsLineData.forEach((pEle) => {
|
|
|
|
+ for (let i = 0; i < pEle.length; i++) {
|
|
|
|
+ if (pEle[i] === "-") {
|
|
|
|
+ pEle.splice(i, 1);
|
|
|
|
+ i--;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ console.log(111, powerLineData);
|
|
|
|
+ console.log(222, fsLineData);
|
|
|
|
+
|
|
|
|
+ const allPowerData = [].concat(...powerLineData);
|
|
|
|
+ const powerMin = Math.min(...allPowerData);
|
|
|
|
+ const powerMax = Math.max(...allPowerData);
|
|
|
|
+
|
|
|
|
+ const allWindData = [].concat(...fsLineData);
|
|
|
|
+ const windSpeedMin = Math.min(...allWindData);
|
|
|
|
+ const windSpeedMax = Math.max(...allWindData);
|
|
|
|
+
|
|
|
|
+ const splitNumber = 5;
|
|
|
|
+
|
|
|
|
+ console.log(123, series);
|
|
|
|
+
|
|
let option = {
|
|
let option = {
|
|
title: {
|
|
title: {
|
|
text: "电量",
|
|
text: "电量",
|
|
@@ -321,10 +403,52 @@ export default {
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
data: xAxis,
|
|
data: xAxis,
|
|
},
|
|
},
|
|
- yAxis: {
|
|
|
|
- type: "value",
|
|
|
|
- name: "万千瓦时(Wkw/h)",
|
|
|
|
- },
|
|
|
|
|
|
+ yAxis: [
|
|
|
|
+ {
|
|
|
|
+ type: "value",
|
|
|
|
+ name: "万千瓦时(Wkw/h)",
|
|
|
|
+ splitLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: this.$store.state.theme ? "#000" : "#ccc",
|
|
|
|
+ type: "dashed", // 修改为虚线
|
|
|
|
+ opacity: 0.2,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ min: powerMin,
|
|
|
|
+ max: powerMax, // 动态设置最大值
|
|
|
|
+ interval: parseFloat(
|
|
|
|
+ ((powerMax - powerMin) / splitNumber).toFixed(4)
|
|
|
|
+ ),
|
|
|
|
+ splitNumber,
|
|
|
|
+ axisLabel: {
|
|
|
|
+ formatter(value) {
|
|
|
|
+ return parseInt(value);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "value",
|
|
|
|
+ name: "风速(m/s)",
|
|
|
|
+ splitLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: this.$store.state.theme ? "#000" : "#ccc",
|
|
|
|
+ type: "dashed", // 修改为虚线
|
|
|
|
+ opacity: 0.2,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ min: windSpeedMin,
|
|
|
|
+ max: windSpeedMax, // 动态设置最大值
|
|
|
|
+ splitNumber,
|
|
|
|
+ interval: parseFloat(
|
|
|
|
+ ((windSpeedMax - windSpeedMin) / splitNumber).toFixed(4)
|
|
|
|
+ ),
|
|
|
|
+ axisLabel: {
|
|
|
|
+ formatter(value) {
|
|
|
|
+ return parseFloat(value.toFixed(1));
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
series: series,
|
|
series: series,
|
|
};
|
|
};
|
|
if (this.from === "index") {
|
|
if (this.from === "index") {
|