Bladeren bron

绑图表数据

mw_666 4 jaren geleden
bovenliggende
commit
85a2b8d0ba
2 gewijzigde bestanden met toevoegingen van 87 en 130 verwijderingen
  1. 1 1
      src/views/WindSite/pages/Home/Home.vue
  2. 86 129
      src/views/WindSite/pages/Tower.vue

+ 1 - 1
src/views/WindSite/pages/Home/Home.vue

@@ -310,7 +310,7 @@
 							value: [],
 							value: [],
 						},
 						},
 					],
 					],
-					units: ["", ""],
+					units: ["(万KWh)", ""],
 				},
 				},
 
 
 				// 4小时功率曲线图
 				// 4小时功率曲线图

+ 86 - 129
src/views/WindSite/pages/Tower.vue

@@ -43,7 +43,7 @@
         </div>
         </div>
       </div>
       </div>
     </Panel>
     </Panel>
-    <toolbar-panel class="rose-chart" title="功率曲线">
+    <toolbar-panel class="rose-chart" title="72小时功率曲线">
       <!-- <template v-slot:tools>
       <!-- <template v-slot:tools>
       </template> -->
       </template> -->
       <!-- <template v-slot:default> -->
       <!-- <template v-slot:default> -->
@@ -98,20 +98,20 @@ export default {
       cftmap: {},
       cftmap: {},
       glvos: [],
       glvos: [],
       rmgtmap: {
       rmgtmap: {
-        indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
+        indicator: ["N0", "N1"],
         data: [
         data: [
           {
           {
-            value: [44200, 14200, 20000, 35000, 50000, 38000],
+            value: [44200, 14200],
             name: "",
             name: "",
           },
           },
         ],
         ],
       },
       },
       rmgtTitle: "",
       rmgtTitle: "",
       ymgtmap: {
       ymgtmap: {
-        indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
+        indicator: ["N0", "N1"],
         data: [
         data: [
           {
           {
-            value: [44200, 14200, 20000, 35000, 50000, 38000],
+            value: [0, 14200],
             name: "",
             name: "",
           },
           },
         ],
         ],
@@ -141,127 +141,84 @@ export default {
   // 函数
   // 函数
   methods: {
   methods: {
     requestLine() {
     requestLine() {
-      let that = this;
+		 let that = this;
-      that.API.requestData({
+		that.API.requestData({
-        method: "POST",
+		  method: "POST",
-        subUrl: "genreset/findPowerInfo",
+		  subUrl: "/monitor/findCftInfo",
-        timeout: 60000,
+		  timeout: 60000,
-        data: {
+		  data: {
-          id: that.wpId,
+		    wpId: that.wpId,
-        },
+		  },
-        success(res) {
+		success(res) {
-
+			var data = res.data;
-          let rdlKey = ["value1", "value2", "value3", "speed"];
+			that.cftmap = data.cftmap;
-          let DayPower = {
+			// 日资源玫瑰图
-            // 图表所用单位
+			var rmgtmapIndicator = [],
-            units: ["(万kWh)", "(m/s)"],
+				rmgtmapData = [];
-            value: [
+			data.rmgtmap.data.forEach(item =>{
-              {
+				rmgtmapIndicator.push(item.name);
-                title: "发电量",
+				rmgtmapData.push(item.data1)
-                yAxisIndex: 0,
+			})
-                value: [],
+			that.rmgtmap = {
-              },
+				indicator: rmgtmapIndicator,
-              {
+				data: [{value: rmgtmapData}]
-                title: "上网电量",
+			};
-                yAxisIndex: 0,
+			// 月资源玫瑰图
-                value: [],
+			var ymgtmapIndicator = [],
-              },
+				ymgtmapData = [];
-              {
+			data.ymgtmap.data.forEach(item =>{
-                title: "购网电量",
+				ymgtmapIndicator.push(item.name);
-                yAxisIndex: 0,
+				ymgtmapData.push(item.data1)
-                value: [],
+			})
-              },
+			that.ymgtmap = {
-              {
+				indicator: ymgtmapIndicator,
-                title: "实时风速",
+				data: [{value: ymgtmapData}]
-                yAxisIndex: 1,
+			};
-                value: [],
+			
-              },
+			// 72小时功率曲线图
-            ],
+			let glKey = ["value2","value1","value5","value4","value7","value6"];
-          };
+			let Powertrend = [
-
+			  {
-          let glKey = [
+			    title: "实发功率",
-            "value1",
+			    smooth: true,
-            "value2",
+			    value: [],
-            "value3",
+			  },
-            "value4",
+			  {
-            "value5",
+			    title: "理论功率",
-            "value6",
+			    smooth: true,
-            "value7",
+			    value: [],
-          ];
+			  },
-          let Powertrend = [
+			  {
-            {
+			    title: "保证功率",
-              title: "应发功率",
+			    smooth: true,
-              smooth: true,
+			    value: [],
-              value: [],
+			  },
-            },
+			  {
-            {
+			    title: "4小时预测功率",
-              title: "实发功率",
+			    smooth: true,
-              smooth: true,
+			    value: [],
-              value: [],
+			  },
-            },
+			  {
-            {
+			    title: "24小时预测功率",
-              title: "理论功率",
+			    smooth: true,
-              smooth: true,
+			    value: [],
-              value: [],
+			  },
-            },
+			  {
-            {
+			    title: "平均风速",
-              title: "4小时预测功率",
+			    smooth: true,
-              smooth: true,
+			    value: [],
-              value: [],
+			  },
-            },
+			];
-            {
+			glKey.forEach((keyEle, keyIndex) => {
-              title: "保证功率",
+			  res.data.glvos.forEach((cEle) => {
-              smooth: true,
+			    Powertrend[keyIndex].value.push({
-              value: [],
+			      text: new Date(cEle.time).formatDate("hh:mm"),
-            },
+			      value: cEle[keyEle],
-            {
+			    });
-              title: "平均风速",
+			  });
-              smooth: true,
+			});
-              value: [],
+			that.Powertrend = Powertrend;
-            },
+		}})
-            {
-              title: "24小时预测功率",
-              smooth: true,
-              value: [],
-            },
-          ];
-
-          rdlKey.forEach((keyEle, keyIndex) => {
-            res.data.rdlvos.forEach((cEle) => {
-              DayPower.value[keyIndex].value.push({
-                text: cEle.timestr,
-                value: cEle[keyEle],
-              });
-            });
-          });
-
-          glKey.forEach((keyEle, keyIndex) => {
-            res.data.glvos.forEach((cEle) => {
-              Powertrend[keyIndex].value.push({
-                text: new Date(cEle.time).formatDate("hh:mm"),
-                value: cEle[keyEle],
-              });
-            });
-          });
-
-          that.DayPower = DayPower;
-          that.Powertrend = Powertrend;
-        },
-      });
-    },
-    requestData(showLoading) {
-      let that = this;
-      that.API.requestData({
-        showLoading,
-        method: "POST",
-        subUrl: "monitor/findCftInfo",
-        data: {
-          wpId: that.wpId,
-        },
-        success(res) {
-          that.cftmap = res.data.cftmap;
-        },
-      });
     },
     },
     getWp () {
     getWp () {
       let that = this;
       let that = this;
@@ -307,7 +264,7 @@ export default {
       });
       });
       this.wpId = res.code;
       this.wpId = res.code;
       this.renderBtnActiveIndex ();
       this.renderBtnActiveIndex ();
-      this.requestData(false);
+      // this.requestData(false);
       this.requestLine();
       this.requestLine();
     },
     },
   },
   },
@@ -317,10 +274,10 @@ export default {
     that.wpId = that.$route.params.wpId;
     that.wpId = that.$route.params.wpId;
     that.getWp();
     that.getWp();
     that.$nextTick(() => {
     that.$nextTick(() => {
-      that.requestData(false);
+      // that.requestData(false);
       that.requestLine();
       that.requestLine();
       that.timmer = setInterval(() => {
       that.timmer = setInterval(() => {
-        that.requestData(false);
+        // that.requestData(false);
         that.requestLine();
         that.requestLine();
       }, 60 * 1000);
       }, 60 * 1000);
     });
     });