Browse Source

电量预测【未完成】

wangmengwei@gyee-china.com 3 years ago
parent
commit
2e537d8fe8

+ 1 - 0
src/views/MalfunctionWarning/components/records.vue

@@ -286,6 +286,7 @@ export default {
             res[that.current]?.coordinate.bar?.sort(that.Compare("value"));
             that.barList = res[that.current]?.coordinate.bar?.slice(0, 5);
             that.recordList = res;
+			console.log(res)
           }
         },
       });

+ 28 - 15
src/views/MalfunctionWarning/components/testReport.vue

@@ -57,7 +57,7 @@
 					</div>
 					<div class="resultContent">
 						该模型训练和测试的准确率分别为<text style="color: #dc143c">{{result[0]}} 和 {{result[1]}}</text>;
-						误差率分别为<text style="color: #dc143c">{{result[2]}} 和 {{result[3]}}</text>;<br>
+						误差率分别为<text style="color: #dc143c">{{result2[0]}} 和 {{result2[1]}}</text>;<br>
 						该模型训练所倚重的测点比重分别为:<text style="color: #dc143c" v-for="(item,index) in proportionList" :key="index">{{item.name+item.percent+(index != (proportionList.length-1)?'、':'')}}</text>。<br>
 						模型训练过程所有测点倚重占比如下表所示:
 					</div>
@@ -90,6 +90,7 @@
 		data() {
 			return {
 				result:[],
+				result2:[],
 				modelName:'',
 				lossList: {},
 				accuracyList: {},
@@ -154,34 +155,46 @@
 			    subUrl: "api/supervised/history",
 			    success(res) {
 			      if (res) {
-					  let data = []
-					res.forEach(ele=>{
-						if(ele.name === name){
-							ele.coordinate = JSON.parse(ele.coordinate);
-							ele.coordinate.bar = JSON.parse(ele.coordinate.bar);
-							data = ele;
-						}
-					})
+					let data = res.find(ele=>{
+						  return ele.name === name
+					  });
+					  
+					data.coordinate = JSON.parse(data?.coordinate);
+					data.coordinate.bar = JSON.parse(data?.coordinate.bar);
 					
 					that.lossList.loss = data?.coordinate.loss;
 					that.lossList.val_loss = data?.coordinate.val_loss;
+					
 					that.BaseLine = parseFloat(data?.coordinate.BaseLine);
 					that.accuracyList.accuracy = data?.coordinate.accuracy;
 					that.accuracyList.val_accuracy = data?.coordinate.val_accuracy;
 					
 					data?.coordinate.bar?.sort(that.Compare("value"));
 					that.barList = data?.coordinate.bar?.slice(0, 5);
-					// result 顺序:accuracy-val_accuracy-loss-val_loss
-					let result = [that.accuracyList.accuracy.sort().pop(),that.accuracyList.val_accuracy.sort().pop(),that.lossList.loss.sort().pop(),that.lossList.val_loss.sort().pop()]
-					result.forEach((ele,index)=>{
-						result[index] = (ele*100).toFixed(3)+'%'
-					})
-					that.result = result;
+					
+					let accuracy = that.accuracyList.accuracy.sort()[that.accuracyList.accuracy.length-1];
+					let val_accuracy = that.accuracyList.val_accuracy.sort()[that.accuracyList.val_accuracy.length-1];
+					let loss = that.lossList.loss.sort()[that.lossList.loss.length-1];
+					let val_loss = that.lossList.val_loss.sort()[that.lossList.val_loss.length-1];
+					that.endResult(accuracy,val_accuracy,loss,val_loss);
+					
 					that.jzxF(data?.coordinate.bar);
 			      }
 			    },
 			  });
 			},
+			endResult(accuracy,val_accuracy,loss,val_loss){//取数组最后一位
+				let result = [accuracy,val_accuracy];
+				result.forEach((ele,index)=>{
+					result[index] = (ele*100).toFixed(3)+'%'
+				})
+				let result2 = [loss,val_loss];
+				result2.forEach((ele,index)=>{
+					result2[index] = ele.toFixed(2)
+				})
+				this.result = result;
+				this.result2 = result2;
+			},
 			Compare(property) {
 			  return function (a, b) {
 			    var value1 = a[property];

+ 17 - 17
src/views/layout/Menu.vue

@@ -336,23 +336,23 @@ export default {
               icon: "svg-qxfx",
               path: "/decision/fs",
             },
-            // {
-            //   text: "电量预测",
-            //   icon: "svg-dlyc",
-            //   path: "/decision/nhycfsdl",
-            //   children: [
-            //     {
-            //       text: "预测拟合风速电量",
-            //       icon: "svg-wind-sitenhycfsdl",
-            //       path: "/decision/nhycfsdl",
-            //     },
-            //     {
-            //       text: "修正预测风速电量",
-            //       icon: "svg-wind-site",
-            //       path: "/decision/xzycfsdl",
-            //     },
-            //   ],
-            // },
+            {
+              text: "电量预测",
+              icon: "svg-dlyc",
+              path: "/decision/nhycfsdl",
+              children: [
+                {
+                  text: "预测拟合风速电量",
+                  icon: "svg-wind-sitenhycfsdl",
+                  path: "/decision/nhycfsdl",
+                },
+                {
+                  text: "修正预测风速电量",
+                  icon: "svg-wind-site",
+                  path: "/decision/xzycfsdl",
+                },
+              ],
+            },
             // {
             //   text: "单机分析",
             //   icon: "svg-wind-site",

File diff suppressed because it is too large
+ 191 - 26
src/views/report/nhycfsdl.vue