lining 3 years ago
parent
commit
35e6387afc

+ 115 - 3
src/api/economic/index.js

@@ -367,12 +367,125 @@ const  goodnessGetplotBands = (data) => {
         data:data
     });
 };
+const  goodnessPlotBandAjax = (data) => {
+    return request({
+        url: `goodness/plotBandAjax`,
+        method: "post",
+        data:data
+    });
+};
+const  goodnessFindRealPowerCharBy24 = (data) => {
+    return request({
+        url: `goodness/findRealPowerCharBy24`,
+        method: "post",
+        data:data
+    });
+};
+const  goodnessBjjllist = (data) => {
+    return request({
+        url: `goodness/bjjllist`,
+        method: "post",
+        data:data
+    });
+};
 
+const  goodnessGzjllist = (data) => {
+    return request({
+        url: `goodness/gzjllist`,
+        method: "post",
+        data:data
+    });
+};
+const  goodnessXdjllist = (data) => {
+    return request({
+        url: `goodness/xdjllist`,
+        method: "post",
+        data:data
+    });
+};
+const  goodnessWadAjax = (data) => {
+    return request({
+        url: `goodness/wadAjax`,
+        method: "post",
+        data:data
+    });
+};
 
+const  goodnessBphlist = (data) => {
+    return request({
+        url: `goodness/bjphlist`,
+        method: "post",
+        data:data
+    });
+};
+const  goodnessGlchat = (data) => {
+    return request({
+        url: `goodness/glchat`,
+        method: "post",
+        data:data
+    });
+};
+const  goodnessFjfzy = (data) => {
+    return request({
+        url: `goodness/fjfzy`,
+        method: "post",
+        data:data
+    });
+};
+const  requestData1 = (data) => {
+    return request({
+        url: `${data.subUrl}`,
+        method: "post",
+        data:data
+    });
+};
+//znzhfx.vue
+const  singleanalysisSingleanalysisSub = (data) => {
+    return request({
+        url: `/singleanalysis/singleanalysisSub`,
+        method: "post",
+        data:data
+    });
+};
+const  singleanalysisSingleanalysisChart = (data) => {
+    return request({
+        url: `/singleanalysis/singleanalysisChart`,
+        method: "post",
+        data:data
+    });
+};
+// 单机月度分析
 
+const  singleanalysisSingleanalysisMain = (data) => {
+    return request({
+        url: `singleanalysis/singleanalysisMain`,
+        method: "post",
+        data:data
+    });
+};
+//电量分析 未绑定界面
 
 
-
+//forecast-system.vue
+const  powercompareWindfarmAllAjax2 = (data) => {
+    return request({
+        url: `powercompare/windfarmAllAjax`,
+        method: "get",
+    });
+};
+const  weatherWeatherInfo = (data) => {
+    return request({
+        url: `weather/weatherInfo?wpId=${data.wpId}`,
+        method: "get",
+    });
+};
+const  weatherWatherChart = (data) => {
+    return request({
+        url: `weather/weatherChart`,
+        method: "post",
+        data:data
+    });
+};
 
 export default {
     benchmarking,
@@ -423,8 +536,7 @@ export default {
     goodnessWindturbinegoodness,
     powercompareWindturbineAjax,
     goodnessGoodhistorylist,
-    powercompareWindfarmAjax,
     goodnessFindWtRealPowerChar,
     goodnessGetplotBands,
-    ajaxName
+    ajaxName,
 }

+ 393 - 122
src/views/NewPages/dj1.vue

@@ -1224,33 +1224,41 @@ export default {
     // 损失电量分析图背景颜色区域点击事件
     areaBarChartClick(item) {
       let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/plotBandAjax",
-        data: {
+
+      api.goodnessPlotBandAjax({
           wtId: item.data.wtId,
           beginDate: item.data.beginDate,
           endDate: item.data.endDate,
-        },
-        success(res) {
-          that.form = res.data || {};
-          that.dialogShow = true;
-        },
+      }).then((res) => {
+         this.form = res.data || {};
+          this.dialogShow = true;
       });
+
+
+
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/plotBandAjax",
+      //   data: {
+      //     wtId: item.data.wtId,
+      //     beginDate: item.data.beginDate,
+      //     endDate: item.data.endDate,
+      //   },
+      //   success(res) {
+      //     that.form = res.data || {};
+      //     that.dialogShow = true;
+      //   },
+      // });
     },
 
     // tab1 - 获取电量图表数据
     getPowerChartData() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/findRealPowerCharBy24",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          const keyArray = ["value1", "value2", "value3", "value4", "value5"];
+
+        api.goodnessFindRealPowerCharBy24({
+         wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+                 const keyArray = ["value1", "value2", "value3", "value4", "value5"];
 
           let powerChartData = [
             {
@@ -1295,45 +1303,114 @@ export default {
               powerChartLineData.data.push(ele.value6);
             });
           });
-          that.powerChartData = powerChartData;
-          that.powerChartLineData = powerChartLineData;
-        },
+          this.powerChartData = powerChartData;
+          this.powerChartLineData = powerChartLineData;
       });
+
+
+    //   let that = this;
+    //   that.API.requestData({
+    //     method: "POST",
+    //     subUrl: "goodness/findRealPowerCharBy24",
+    //     data: {
+    //       wtId: that.wtId,
+    //       recorddate: that.recorddate,
+    //     },
+    //     success(res) {
+    //       const keyArray = ["value1", "value2", "value3", "value4", "value5"];
+
+    //       let powerChartData = [
+    //         {
+    //           title: "scada发电量",
+    //           yAxisIndex: 0,
+    //           value: [],
+    //         },
+    //         {
+    //           title: "维护损失",
+    //           yAxisIndex: 0,
+    //           value: [],
+    //         },
+    //         {
+    //           title: "故障损失",
+    //           yAxisIndex: 0,
+    //           value: [],
+    //         },
+    //         {
+    //           title: "限电损失",
+    //           yAxisIndex: 0,
+    //           value: [],
+    //         },
+    //         {
+    //           title: "欠发损失",
+    //           yAxisIndex: 0,
+    //           value: [],
+    //         },
+    //       ];
+
+    //       let powerChartLineData = {
+    //         name: "风速",
+    //         unit: "(m/s)",
+    //         data: [],
+    //       };
+
+    //       keyArray.forEach((keyEle, keyIndex) => {
+    //         res.data.forEach((ele) => {
+    //           powerChartData[keyIndex].value.push({
+    //             text: new Date(ele.time).formatDate("MM-dd hh:mm"),
+    //             value: ele[keyEle],
+    //           });
+    //           powerChartLineData.data.push(ele.value6);
+    //         });
+    //       });
+    //       that.powerChartData = powerChartData;
+    //       that.powerChartLineData = powerChartLineData;
+    //     },
+    //   });
     },
 
     // tab1 - 获取当日报警数据
     getWarnData() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/bjjllist",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          res.data.list.forEach((ele) => {
+
+      api.goodnessBjjllist({
+           wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+           res.data.list.forEach((ele) => {
             ele.warningtime = new Date(ele.warningtime).formatDate(
               "yyyy-MM-dd hh:mm:ss"
             );
           });
-          that.warnTableData.data = res.data.list;
-        },
+          this.warnTableData.data = res.data.list;
       });
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/bjjllist",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     res.data.list.forEach((ele) => {
+      //       ele.warningtime = new Date(ele.warningtime).formatDate(
+      //         "yyyy-MM-dd hh:mm:ss"
+      //       );
+      //     });
+      //     that.warnTableData.data = res.data.list;
+      //   },
+      // });
     },
 
     // tab1 - 获取当日故障数据
     getStopData() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/gzjllist",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          res.data.list.forEach((ele) => {
+
+api.goodnessGzjllist({
+        wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+           res.data.list.forEach((ele) => {
             ele.stopTime = new Date(ele.stopTime).formatDate(
               "yyyy-MM-dd hh:mm:ss"
             );
@@ -1341,23 +1418,41 @@ export default {
               ? new Date(ele.starttime).formatDate("yyyy-MM-dd hh:mm:ss")
               : "";
           });
-          that.stopTableData.data = res.data.list;
-        },
+          this.stopTableData.data = res.data.list;
       });
+
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/gzjllist",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     res.data.list.forEach((ele) => {
+      //       ele.stopTime = new Date(ele.stopTime).formatDate(
+      //         "yyyy-MM-dd hh:mm:ss"
+      //       );
+      //       ele.starttime = ele.starttime
+      //         ? new Date(ele.starttime).formatDate("yyyy-MM-dd hh:mm:ss")
+      //         : "";
+      //     });
+      //     that.stopTableData.data = res.data.list;
+      //   },
+      // });
     },
 
     // tab1 - 获取当日限电数据
     getXdData() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/xdjllist",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          res.data.list.forEach((ele) => {
+
+      api.goodnessXdjllist({
+         wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+             res.data.list.forEach((ele) => {
             ele.stopTime = new Date(ele.stopTime).formatDate(
               "yyyy-MM-dd hh:mm:ss"
             );
@@ -1365,55 +1460,92 @@ export default {
               ? new Date(ele.starttime).formatDate("yyyy-MM-dd hh:mm:ss")
               : "";
           });
-          that.xdTableData.data = res.data.list;
-        },
+          this.xdTableData.data = res.data.list;
       });
+
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/xdjllist",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     res.data.list.forEach((ele) => {
+      //       ele.stopTime = new Date(ele.stopTime).formatDate(
+      //         "yyyy-MM-dd hh:mm:ss"
+      //       );
+      //       ele.starttime = ele.starttime
+      //         ? new Date(ele.starttime).formatDate("yyyy-MM-dd hh:mm:ss")
+      //         : "";
+      //     });
+      //     that.xdTableData.data = res.data.list;
+      //   },
+      // });
     },
 
     // tab2 - 获取日发电量信息
     getDayPowerInfo() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/wadAjax",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          that.dayPowerInfo = res.data;
-        },
+
+      api.goodnessWadAjax({
+           wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+        this.dayPowerInfo = res.data;
       });
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/wadAjax",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     that.dayPowerInfo = res.data;
+      //   },
+      // });
     },
 
     // tab2 - 获取当月报警排行
     getMonthWarnRecord() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/bjphlist",
-        data: {
+
+      api.goodnessBphlist({
           wtId: that.wtId,
           recorddate: that.recorddate,
-        },
-        success(res) {
-          that.monthWarnRecordData.data = res.data;
-        },
+      }).then((res) => {
+        that.monthWarnRecordData.data = res.data;
       });
+
+
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/bjphlist",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     that.monthWarnRecordData.data = res.data;
+      //   },
+      // });
     },
 
     // tab2 - 获取当月报警排行
     getPowerLineChartData() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/glchat",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          const keyArray = ["value2", "value3", "value4"];
+
+      api.goodnessGlchat({
+       wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+             const keyArray = ["value2", "value3", "value4"];
 
           let powerLineChartData = [
             {
@@ -1442,23 +1574,61 @@ export default {
             });
           });
 
-          that.powerLineChartData = powerLineChartData;
-        },
+          this.powerLineChartData = powerLineChartData;
       });
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/glchat",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     const keyArray = ["value2", "value3", "value4"];
+
+      //     let powerLineChartData = [
+      //       {
+      //         title: "实际拟合功率",
+      //         yAxisIndex: 0,
+      //         value: [],
+      //       },
+      //       {
+      //         title: "最优功率",
+      //         yAxisIndex: 0,
+      //         value: [],
+      //       },
+      //       {
+      //         title: "保证功率",
+      //         yAxisIndex: 0,
+      //         value: [],
+      //       },
+      //     ];
+
+      //     keyArray.forEach((keyEle, keyIndex) => {
+      //       res.data.forEach((ele, index) => {
+      //         powerLineChartData[keyIndex].value.push({
+      //           text: index + 1,
+      //           value: ele[keyEle],
+      //         });
+      //       });
+      //     });
+
+      //     that.powerLineChartData = powerLineChartData;
+      //   },
+      // });
     },
 
     // tab2 - 获取当月报警排行
     getWindResources() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "goodness/fjfzy",
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
-        },
-        success(res) {
-          that.jfplStr = res.data.jfpl || "";
+
+      api.goodnessFjfzy({
+          wtId: this.wtId,
+          recorddate: this.recorddate,
+      }).then((res) => {
+            this.jfplStr = res.data.jfpl || "";
 
           let windResourcesData = {
             indicator: [],
@@ -1477,20 +1647,51 @@ export default {
             });
           }
 
-          that.windResourcesData = windResourcesData;
-        },
+          this.windResourcesData = windResourcesData;
       });
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: "goodness/fjfzy",
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //   },
+      //   success(res) {
+      //     that.jfplStr = res.data.jfpl || "";
+
+      //     let windResourcesData = {
+      //       indicator: [],
+      //       data: [
+      //         {
+      //           name: "",
+      //           value: [],
+      //         },
+      //       ],
+      //     };
+
+      //     if (res.data.data) {
+      //       res.data.data.forEach((ele) => {
+      //         windResourcesData.indicator.push(ele.name);
+      //         windResourcesData.data[0].value.push(ele.data1);
+      //       });
+      //     }
+
+      //     that.windResourcesData = windResourcesData;
+      //   },
+      // });
     },
 
     // tab3,tab4 - 获取玫瑰图
     getMgt(subUrl, data, dataKey, logFlg) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
+
+
+api.requestData1({
         subUrl,
-        data,
-        success(res) {
-          that[dataKey.split("Data")[0] + "Str"] = res.data.jfpl || "";
+         data,
+      }).then((res) => {
+           this[dataKey.split("Data")[0] + "Str"] = res.data.jfpl || "";
 
           let mgtData = {
             indicator: [],
@@ -1527,24 +1728,70 @@ export default {
             });
           }
           mgtData.data[0].value.reverse();
-          that[dataKey] = mgtData;
-        },
+          this[dataKey] = mgtData;
       });
+
+
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl,
+      //   data,
+      //   success(res) {
+      //     that[dataKey.split("Data")[0] + "Str"] = res.data.jfpl || "";
+
+      //     let mgtData = {
+      //       indicator: [],
+      //       data: [
+      //         {
+      //           name: "",
+      //           value: [],
+      //         },
+      //       ],
+      //     };
+
+      //     if (res.data.data) {
+      //       mgtData.indicator = [
+      //         "北",
+      //         "北北西",
+      //         "北西",
+      //         "西北西",
+      //         "西",
+      //         "西南西",
+      //         "南西",
+      //         "南南西",
+      //         "南",
+      //         "南南东",
+      //         "东南",
+      //         "东南东",
+      //         "东",
+      //         "东北东",
+      //         "北东",
+      //         "北北东",
+      //       ];
+      //       res.data.data.forEach((ele) => {
+      //         // mgtData.indicator.push(ele.name);
+      //         mgtData.data[0].value.push(ele.data1);
+      //       });
+      //     }
+      //     mgtData.data[0].value.reverse();
+      //     that[dataKey] = mgtData;
+      //   },
+      // });
     },
 
     // tab5 - 获取饼图
     getPieChart(subUrl, type, dataKey) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl,
-        data: {
-          wtId: that.wtId,
-          recorddate: that.recorddate,
+
+      api.requestData1({
+          wtId: this.wtId,
+          recorddate: this.recorddate,
           type,
-        },
-        success(res) {
-          let pieChart = [];
+          subUrl
+      }).then((res) => {
+              let pieChart = [];
 
           res.data.forEach((ele) => {
             pieChart.push({
@@ -1554,9 +1801,33 @@ export default {
             });
           });
 
-          that[dataKey] = pieChart;
-        },
+          this[dataKey] = pieChart;
       });
+
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl,
+      //   data: {
+      //     wtId: that.wtId,
+      //     recorddate: that.recorddate,
+      //     type,
+      //   },
+      //   success(res) {
+      //     let pieChart = [];
+
+      //     res.data.forEach((ele) => {
+      //       pieChart.push({
+      //         name: ele.name,
+      //         value: ele.value2,
+      //         unit: "(m/s)",
+      //       });
+      //     });
+
+      //     that[dataKey] = pieChart;
+      //   },
+      // });
     },
 
     // 切换tab

+ 167 - 84
src/views/NewPages/forecast-system.vue

@@ -7,86 +7,126 @@
         <div class="item" @click="tabSelect(2)" :class="{ active: tabIndex == 2 }">青山</div>
         <div class="item" @click="tabSelect(3)" :class="{ active: tabIndex == 3 }">石板泉</div>
         <div class="item" @click="tabSelect(3)" :class="{ active: tabIndex == 4 }">香山</div> -->
-        <div class="item" v-for="(item) of wpList" :key="item" 
-          @click="tabSelect(item)" :class="{ active: wpId == item.id }">{{item.name}}</div>
-        
+        <div
+          class="item"
+          v-for="item of wpList"
+          :key="item"
+          @click="tabSelect(item)"
+          :class="{ active: wpId == item.id }"
+        >
+          {{ item.name }}
+        </div>
       </div>
     </div>
     <div class="page-body">
       <el-row class="mg-b-16">
         <el-col :span="5" class="fc-info">
           <div class="fc-item">
-            <div class="title">{{wpName}}</div>
+            <div class="title">{{ wpName }}</div>
             <div class="tags">
               <div class="tag">
                 <i class="svg-icon svg-icon-gray-l svg-icon-lg">
-                  <svg-icon :svgid="'svg-' + weatherInfo.tqtp"/>
+                  <svg-icon :svgid="'svg-' + weatherInfo.tqtp" />
                 </i>
               </div>
               <div class="tag">
                 <div class="tag-title">风速</div>
-                <div class="tag-value">{{weatherInfo.fs}}<span class="unit">m/s</span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.fs }}<span class="unit">m/s</span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">风向</div>
-                <div class="tag-value">{{weatherInfo.fx}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.fx }}<span class="unit"></span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">清晰度</div>
-                <div class="tag-value">{{weatherInfo.qxd}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.qxd }}<span class="unit"></span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">温度</div>
-                <div class="tag-value">{{weatherInfo.wd}}<span class="unit">℃</span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.wd }}<span class="unit">℃</span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">大气压强</div>
-                <div class="tag-value">{{weatherInfo.dqyl}}<span class="unit">hPa</span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.dqyl }}<span class="unit">hPa</span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">湿度</div>
-                <div class="tag-value">{{weatherInfo.sd}}<span class="unit">%</span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.sd }}<span class="unit">%</span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">经度</div>
-                <div class="tag-value">{{weatherInfo.jingdu}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.jingdu }}<span class="unit"></span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">纬度</div>
-                <div class="tag-value">{{weatherInfo.weidu}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.weidu }}<span class="unit"></span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">云量</div>
-                <div class="tag-value">{{weatherInfo.yunliang}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.yunliang }}<span class="unit"></span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">日出时间</div>
-                <div class="tag-value">{{weatherInfo.richushijian}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.richushijian }}<span class="unit"></span>
+                </div>
               </div>
               <div class="tag">
                 <div class="tag-title">日落时间</div>
-                <div class="tag-value">{{weatherInfo.riluoshijian}}<span class="unit"></span></div>
+                <div class="tag-value">
+                  {{ weatherInfo.riluoshijian }}<span class="unit"></span>
+                </div>
               </div>
             </div>
           </div>
         </el-col>
         <el-col :span="19">
           <panel :title="'损失电量分析'">
-            <multiple-bar-line-chart  :height="'100%'" 
-              :lineData="chart1Line" :barData="chart1Bar"
-              :units="['功率(万kW)','电量(万kWh)']"/>
+            <multiple-bar-line-chart
+              :height="'100%'"
+              :lineData="chart1Line"
+              :barData="chart1Bar"
+              :units="['功率(万kW)', '电量(万kWh)']"
+            />
           </panel>
         </el-col>
       </el-row>
       <el-row class="bottom-charts">
         <el-col :span="12">
           <panel :title="'超短期风功率预测'">
-            <arrow-line-chart :width="'100%'"  :height="'100%'"  :list="chart2List" :units="['功率(万kW)','风速(m/s)']"/>
+            <arrow-line-chart
+              :width="'100%'"
+              :height="'100%'"
+              :list="chart2List"
+              :units="['功率(万kW)', '风速(m/s)']"
+            />
           </panel>
         </el-col>
         <el-col :span="12">
           <panel :title="'短期风功率预测'">
-            <arrow-line-chart :height="'100%'"  :list="chart3List" :units="['功率(万kW)','风速(m/s)']"/>
+            <arrow-line-chart
+              :height="'100%'"
+              :list="chart3List"
+              :units="['功率(万kW)', '风速(m/s)']"
+            />
           </panel>
         </el-col>
       </el-row>
@@ -106,15 +146,15 @@ export default {
   setup() {},
   data() {
     return {
-      wpList:[],
-      wpId:"MHS_FDC",
-      wpName:"麻黄山风电场",
-      weatherInfo:{},
-      chart1Bar:[],
-      chart1Line:[],
-      chart2List:[],
-      chart3List:[],
-      timer:null,
+      wpList: [],
+      wpId: "MHS_FDC",
+      wpName: "麻黄山风电场",
+      weatherInfo: {},
+      chart1Bar: [],
+      chart1Line: [],
+      chart2List: [],
+      chart3List: [],
+      timer: null,
     };
   },
   methods: {
@@ -128,24 +168,32 @@ export default {
       }
     },
     async getWp() {
-      const res = await this.API.requestData({
-        method: "GET",
-        subUrl: "powercompare/windfarmAllAjax"
-      });
-      if(res) {
-        this.wpList = res.data.data.filter(ele=>{
-          return ele.id.indexOf("_FDC")>-1;
+      const res = await api.powercompareWindfarmAllAjax2({});
+
+      // this.API.requestData({
+      //   method: "GET",
+      //   subUrl: "powercompare/windfarmAllAjax"
+      // });
+      if (res) {
+        this.wpList = res.data.data.filter((ele) => {
+          return ele.id.indexOf("_FDC") > -1;
         });
       }
     },
     async getData() {
-      const res = await this.API.requestData({
-        method: "POST",
-        subUrl: "weather/weatherInfo",
-        data:{wpId:this.wpId}
+      const res = await api.weatherWeatherInfo({
+        wpId: this.wpId,
       });
-      if(res) {
-        console.log('resWeather:',res)
+
+      // this.API.requestData({
+      //   method: "POST",
+      //   subUrl: "weather/weatherInfo",
+      //   data: {
+      //      wpId: this.wpId
+      //      },
+      // });
+      if (res) {
+        console.log("resWeather:", res);
         this.weatherInfo = res.data.data;
       }
     },
@@ -153,60 +201,95 @@ export default {
       const res = await this.API.requestData({
         method: "POST",
         subUrl: "weather/powerChart",
-        data:{wpId:this.wpId}
+        data: { wpId: this.wpId },
       });
-      if(res) {
-        const fdlValue = {title:"电量",yAxisIndex:0,value:[]};
-        const glValue = {title:"功率",yAxisIndex:1,value:[]};
-        const fsValue = {name:"风速",unit:"m/s",data:[]};
-        res.data.data.forEach(e => {
-          if(fdlValue.value.length == 0){
-            fdlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: 0});
-          }else{
-            fdlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value1});
+      if (res) {
+        const fdlValue = { title: "电量", yAxisIndex: 0, value: [] };
+        const glValue = { title: "功率", yAxisIndex: 1, value: [] };
+        const fsValue = { name: "风速", unit: "m/s", data: [] };
+        res.data.data.forEach((e) => {
+          if (fdlValue.value.length == 0) {
+            fdlValue.value.push({
+              text: new Date(e.time).formatDate("hh:mm"),
+              value: 0,
+            });
+          } else {
+            fdlValue.value.push({
+              text: new Date(e.time).formatDate("hh:mm"),
+              value: e.value1,
+            });
           }
-          glValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
+          glValue.value.push({
+            text: new Date(e.time).formatDate("hh:mm"),
+            value: e.value2,
+          });
           fsValue.data.push(e.value3);
         });
-        this.chart1Bar = [fdlValue,glValue];
+        this.chart1Bar = [fdlValue, glValue];
         this.chart1Line = fsValue;
       }
     },
     async getChart3() {
-      const res = await this.API.requestData({
-        method: "POST",
-        subUrl: "weather/weatherChart",
-        data:{wpId:this.wpId}
+      const res = await api.benchmarkingLineList({
+        wpId: this.wpId,
       });
-      if(res) {
+
+      // this.API.requestData({
+      //   method: "POST",
+      //   subUrl: "weather/weatherChart",
+      //   data: {
+
+      //      wpId: this.wpId
+
+      //      },
+      // });
+      if (res) {
         // 短期预测功率
         {
-          const ycglValue = {title:"预测功率",yAxisIndex:0,value:[]};
-          const sjglValue = {title:"实际功率",yAxisIndex:0,value:[]};
-          const fsValue = {title:"风速",yAxisIndex:1,value:[]};
+          const ycglValue = { title: "预测功率", yAxisIndex: 0, value: [] };
+          const sjglValue = { title: "实际功率", yAxisIndex: 0, value: [] };
+          const fsValue = { title: "风速", yAxisIndex: 1, value: [] };
           let hour = new Date().getHours();
-          res.data.data.forEach(e => {
-            if(ycglValue.value.length<=(24+hour)) {
-              ycglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value7});
-              sjglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
-              fsValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value6});
+          res.data.data.forEach((e) => {
+            if (ycglValue.value.length <= 24 + hour) {
+              ycglValue.value.push({
+                text: new Date(e.time).formatDate("hh:mm"),
+                value: e.value7,
+              });
+              sjglValue.value.push({
+                text: new Date(e.time).formatDate("hh:mm"),
+                value: e.value2,
+              });
+              fsValue.value.push({
+                text: new Date(e.time).formatDate("hh:mm"),
+                value: e.value6,
+              });
             }
           });
-          this.chart3List = [ycglValue,sjglValue,fsValue];
+          this.chart3List = [ycglValue, sjglValue, fsValue];
         }
         // 超短期预测功率
-        const cdqGlValue = {title:"预测功率",yAxisIndex:0,value:[]};
-        const sjglValue = {title:"实际功率",yAxisIndex:0,value:[]};
-        const fsValue = {title:"风速",yAxisIndex:1,value:[]};
+        const cdqGlValue = { title: "预测功率", yAxisIndex: 0, value: [] };
+        const sjglValue = { title: "实际功率", yAxisIndex: 0, value: [] };
+        const fsValue = { title: "风速", yAxisIndex: 1, value: [] };
         let hour = new Date().getHours();
-        res.data.data.forEach(e => {
-          if(cdqGlValue.value.length<=(4+hour)) {
-            cdqGlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value4});
-            sjglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
-            fsValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value6});
+        res.data.data.forEach((e) => {
+          if (cdqGlValue.value.length <= 4 + hour) {
+            cdqGlValue.value.push({
+              text: new Date(e.time).formatDate("hh:mm"),
+              value: e.value4,
+            });
+            sjglValue.value.push({
+              text: new Date(e.time).formatDate("hh:mm"),
+              value: e.value2,
+            });
+            fsValue.value.push({
+              text: new Date(e.time).formatDate("hh:mm"),
+              value: e.value6,
+            });
           }
         });
-        this.chart2List = [cdqGlValue,sjglValue,fsValue];
+        this.chart2List = [cdqGlValue, sjglValue, fsValue];
       }
     },
   },
@@ -215,11 +298,11 @@ export default {
     let that = this;
     that.$nextTick(() => {
       that.getData();
-      that.getChart1()
+      that.getChart1();
       that.getChart3();
       that.timer = setInterval(() => {
         that.getData();
-        that.getChart1()
+        that.getChart1();
         that.getChart3();
       }, 60000);
     });
@@ -233,13 +316,13 @@ export default {
 
 <style lang="less">
 .forecast-system {
-  .com-panel{
-    .panel-body{
+  .com-panel {
+    .panel-body {
       height: 43vh;
     }
   }
-  .bottom-charts{
-    .panel-body{
+  .bottom-charts {
+    .panel-body {
       height: 35vh;
     }
   }

+ 68 - 42
src/views/NewPages/znzhfx.vue

@@ -16,34 +16,45 @@
       </el-row>
       <div class="mg-b-16 anliz-des">
         <div>
-          本月{{ wtId }}号风机风机设备利用小时数{{ tableVal.byzb && tableVal.byzb.lyxs }}小时、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.lyxs }}小时,
-          		设备可利用率{{ tableVal.byzb && tableVal.byzb.sbklyl }}%、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.sbklyl }}%;
-          		等效可用系数{{ tableVal.byzb && tableVal.byzb.dxklyxs }}%、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.dxklyxs }}%;
-          		静风频率达到{{ tableVal.byzb && tableVal.byzb.jfpl }}%、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.jfpl }}%;
-          		机组功率特性一致性系数达到{{ tableVal.byzb && tableVal.byzb.glyzxxs }}%、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.glyzxxs }}%。 <br />
-            {{ wtId }}风机{{ year }}年{{ month }}
-          		月平均风速{{ tableVal.byzb && tableVal.byzb.fs }}m/s、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.fs }}m/s;
-            小风平均切入风速{{ tableVal.byzb && tableVal.byzb.xfqr }}m/s、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.xfqr }}m/s;
-          		有效风时数{{ tableVal.byzb && tableVal.byzb.yxfss }}小时、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.yxfss }}小时;
-          		实际发电电量{{ tableVal.byzb && tableVal.byzb.fdl }}万kwh、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.fdl }}万kwh,
-          		同比增长率{{ tableVal.tbzb && (tableVal.tbzb.fdl).toFixed(2) }}%;
-          		各项损失电量累计{{ tableVal.byzb && (tableVal.byzb.llfdl - tableVal.byzb.fdl).toFixed(2) }}万kwh、
-          		同比{{ tableVal.tqzb && tableVal.tqzb.llfdl - tableVal.tqzb.fdl }}万kwh,
-          		同比增长率{{ tableVal.tbzb && (tableVal.byzb.llfdl - tableVal.tbzb.fdl).toFixed(2) }}%;
-          		理论发电量{{ tableVal.byzb && tableVal.byzb.llfdl }}万kwh,
-          		实际发电量与理论发电量相差{{ tableVal.tbzb && tableVal.tbzb.llfdl }}万kwh。 <br />
-            本月静风频率{{ tableVal.byzb && tableVal.byzb.jfpl }}%,
-			<!-- 月累计静风时长0.00小时, -->
-			月累计待机小时{{ tableVal.byzb && tableVal.byzb.tjxs }}小时,待机占比{{ tableVal.byzb && tableVal.tqzb.tjxs }}%。
+          本月{{ wtId }}号风机风机设备利用小时数{{
+            tableVal.byzb && tableVal.byzb.lyxs
+          }}小时、 同比{{ tableVal.tqzb && tableVal.tqzb.lyxs }}小时,
+          设备可利用率{{ tableVal.byzb && tableVal.byzb.sbklyl }}%、 同比{{
+            tableVal.tqzb && tableVal.tqzb.sbklyl
+          }}%; 等效可用系数{{ tableVal.byzb && tableVal.byzb.dxklyxs }}%、
+          同比{{ tableVal.tqzb && tableVal.tqzb.dxklyxs }}%; 静风频率达到{{
+            tableVal.byzb && tableVal.byzb.jfpl
+          }}%、 同比{{ tableVal.tqzb && tableVal.tqzb.jfpl }}%;
+          机组功率特性一致性系数达到{{
+            tableVal.byzb && tableVal.byzb.glyzxxs
+          }}%、 同比{{ tableVal.tqzb && tableVal.tqzb.glyzxxs }}%。 <br />
+          {{ wtId }}风机{{ year }}年{{ month }} 月平均风速{{
+            tableVal.byzb && tableVal.byzb.fs
+          }}m/s、 同比{{ tableVal.tqzb && tableVal.tqzb.fs }}m/s;
+          小风平均切入风速{{ tableVal.byzb && tableVal.byzb.xfqr }}m/s、 同比{{
+            tableVal.tqzb && tableVal.tqzb.xfqr
+          }}m/s; 有效风时数{{ tableVal.byzb && tableVal.byzb.yxfss }}小时、
+          同比{{ tableVal.tqzb && tableVal.tqzb.yxfss }}小时; 实际发电电量{{
+            tableVal.byzb && tableVal.byzb.fdl
+          }}万kwh、 同比{{ tableVal.tqzb && tableVal.tqzb.fdl }}万kwh,
+          同比增长率{{ tableVal.tbzb && tableVal.tbzb.fdl.toFixed(2) }}%;
+          各项损失电量累计{{
+            tableVal.byzb &&
+            (tableVal.byzb.llfdl - tableVal.byzb.fdl).toFixed(2)
+          }}万kwh、 同比{{
+            tableVal.tqzb && tableVal.tqzb.llfdl - tableVal.tqzb.fdl
+          }}万kwh, 同比增长率{{
+            tableVal.tbzb &&
+            (tableVal.byzb.llfdl - tableVal.tbzb.fdl).toFixed(2)
+          }}%; 理论发电量{{ tableVal.byzb && tableVal.byzb.llfdl }}万kwh,
+          实际发电量与理论发电量相差{{
+            tableVal.tbzb && tableVal.tbzb.llfdl
+          }}万kwh。 <br />
+          本月静风频率{{ tableVal.byzb && tableVal.byzb.jfpl }}%,
+          <!-- 月累计静风时长0.00小时, -->
+          月累计待机小时{{
+            tableVal.byzb && tableVal.byzb.tjxs
+          }}小时,待机占比{{ tableVal.byzb && tableVal.tqzb.tjxs }}%。
         </div>
       </div>
       <div class="mg-b-16">
@@ -75,6 +86,7 @@ import Table from "../../components/coms/table/table.vue";
 import VertivalBarLineChart from "../../components/chart/combination/vertival-bar-line-chart.vue";
 import MultipleBarLineChart from "../../components/chart/combination/multiple-bar-line-chart.vue";
 import DoubleLineChart from "../../components/chart/line/double-line-chart.vue";
+import api from "@api/economic/index.js";
 
 export default {
   setup() {},
@@ -360,15 +372,21 @@ export default {
   },
   methods: {
     async search() {
-      const { data } = await this.API.requestData({
-        subUrl: "/singleanalysis/singleanalysisSub",
-        method: "POST",
-        data: {
-          wtId: this.wtId,
-          year: this.year,
-          month: this.month,
-        },
+      const { data } = await api.singleanalysisSingleanalysisSub({
+        wtId: this.wtId,
+        year: this.year,
+        month: this.month,
       });
+
+      //  this.API.requestData({
+      //   subUrl: "/singleanalysis/singleanalysisSub",
+      //   method: "POST",
+      //   data: {
+      //     wtId: this.wtId,
+      //     year: this.year,
+      //     month: this.month,
+      //   },
+      // });
       console.log(data.data);
       const res = data.data;
       this.tableVal = data.data;
@@ -416,15 +434,23 @@ export default {
       console.warn(arr);
     },
     async searchChart() {
-      const { data } = await this.API.requestData({
-        subUrl: "/singleanalysis/singleanalysisChart",
-        method: "POST",
-        data: {
+      const { data } = await api
+        .singleanalysisSingleanalysisChart({
           wtId: this.wtId,
           year: this.year,
           month: this.month,
-        },
-      });
+        })
+       
+
+      // this.API.requestData({
+      //   subUrl: "/singleanalysis/singleanalysisChart",
+      //   method: "POST",
+      //   data: {
+      //     wtId: this.wtId,
+      //     year: this.year,
+      //     month: this.month,
+      //   },
+      // });
       console.warn(data.data);
       const res = data.data;
       let arrfffdl = [];

+ 52 - 25
src/views/singleAnalysis/index.vue

@@ -67,6 +67,7 @@
 <script>
 import ComTable from "../Decision/table.vue";
 import ZnzhFx from "./znzhfx.vue";
+import api from "@api/economic/index.js";
 export default {
   // 名称
   name: "cutAnalyse",
@@ -235,16 +236,24 @@ export default {
     },
     // 请求服务
     requestData() {
-      let that = this;
-      that.API.requestData({
-        method: "GET",
-        subUrl: "powercompare/windfarmAjax",
-        success(res) {
-          that.wpArray = res.data;
-          that.wpId = res.data[0].id;
-          that.getOutputSpeedList(that.wpId);
-        },
+
+api.powercompareWindfarmAjax({
+      }).then((res) => {
+          this.wpArray = res.data;
+          this.wpId = res.data[0].id;
+          this.getOutputSpeedList(this.wpId);
       });
+
+      // let that = this;
+      // that.API.requestData({
+      //   method: "GET",
+      //   subUrl: "powercompare/windfarmAjax",
+      //   success(res) {
+      //     that.wpArray = res.data;
+      //     that.wpId = res.data[0].id;
+      //     that.getOutputSpeedList(that.wpId);
+      //   },
+      // });
     },
 
     getOutputSpeedList(wpId) {
@@ -254,27 +263,45 @@ export default {
           msg: "场站与日期不可为空",
         });
       } else {
-        that.API.requestData({
-          method: "POST",
-          subUrl: "singleanalysis/singleanalysisMain",
-          showLoading: true,
-          data: {
-            wpId,
-            isAsc: that.isAsc,
-            year: new Date(that.recorddate).getFullYear(),
-            month: new Date(that.recorddate).getMonth() + 1,
-          },
-          success(res) {
-            res.data.forEach((ele) => {
+
+
+        api.singleanalysisSingleanalysisMain({
+           wpId,
+            isAsc: this.isAsc,
+            year: new Date(this.recorddate).getFullYear(),
+            month: new Date(this.recorddate).getMonth() + 1,
+      }).then((res) => {
+           res.data.forEach((ele) => {
               for (let key in ele) {
                 ele[key] = ele[key] || 0;
               }
             });
-            that.tableDataEnd = res.data[res.data.length - 1];
+            this.tableDataEnd = res.data[res.data.length - 1];
             res.data.pop();
-            that.tableData.data = res.data;
-          },
-        });
+            this.tableData.data = res.data;
+      });
+
+        // that.API.requestData({
+        //   method: "POST",
+        //   subUrl: "singleanalysis/singleanalysisMain",
+        //   showLoading: true,
+        //   data: {
+        //     wpId,
+        //     isAsc: that.isAsc,
+        //     year: new Date(that.recorddate).getFullYear(),
+        //     month: new Date(that.recorddate).getMonth() + 1,
+        //   },
+        //   success(res) {
+        //     res.data.forEach((ele) => {
+        //       for (let key in ele) {
+        //         ele[key] = ele[key] || 0;
+        //       }
+        //     });
+        //     that.tableDataEnd = res.data[res.data.length - 1];
+        //     res.data.pop();
+        //     that.tableData.data = res.data;
+        //   },
+        // });
       }
     },
     search() {