Browse Source

健康管理

lining 3 years ago
parent
commit
93aa6e35e0

+ 29 - 0
src/api/wisdomOverhaul/health/index.js

@@ -0,0 +1,29 @@
+import request from "../../../tools/request";
+const requestRecommen = (data) => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `${data.url}`,
+        method: "get",
+    });
+};
+const recommen = (url,data) => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `${url}`,
+        method: "post",
+        data: data
+    });
+};
+const findAllChartjz = (data) => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `recommen/findAllChartjz?wpId=${data.wpId}&type=${data.type}`,
+        method: "get",
+    });
+};
+
+export default {
+    requestRecommen,
+    recommen,
+    findAllChartjz,
+}

+ 71 - 42
src/views/HealthControl/HealthTab1.vue

@@ -107,6 +107,7 @@ import VertivalBarLineChart from "../../components/chart/combination/health-bar-
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import Panel from "../../components/coms/panel/panel.vue";
 import HealthReport from "../../components/other/healthReport/index.vue";
+import api from "@api/wisdomOverhaul/health/index.js";
 
 export default {
   components: { SvgIcon, Panel, VertivalBarLineChart, HealthReport },
@@ -223,58 +224,86 @@ export default {
     },
     // 健康报告推荐
     requestRecommen(url) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: url,
-        success(res) {
-          if (res.code == 200) that.recommenList = res.data;
-        },
-      });
+      api.requestRecommen({
+        url:url
+      }).then(res =>{
+        if (res.code == 200) this.recommenList = res.data;
+      })
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: url,
+      //   success(res) {
+      //     if (res.code == 200) that.recommenList = res.data;
+      //   },
+      // });
     },
     // 操作推荐内容(提交/取消)
     requestOption(url, rid) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: url,
-        data: { rid: rid },
-        success(res) {
-          if (res.code == 200) that.onClickRecommon(that.recommenIndex);
-        },
-      });
+      let data ={
+        rid: rid
+      }
+      api.requestRecommen(url,data).then(res =>{
+         if (res.code == 200) this.onClickRecommon(that.recommenIndex);
+      })
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: url,
+      //   data: { rid: rid },
+      //   success(res) {
+      //     if (res.code == 200) that.onClickRecommon(that.recommenIndex);
+      //   },
+      // });
     },
     // 操作推荐内容全部(提交/取消)
     requestOptionAll(url) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: url,
-        data: { typeid: that.recommenIndex },
-        success(res) {
-          if (res.code == 200) that.onClickRecommon(that.recommenIndex);
-        },
-      });
+      let data = { typeid: this.recommenIndex }
+      api.requestRecommen(url,data).then(res =>{
+         if (res.code == 200) this.onClickRecommon(that.recommenIndex);
+      })
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   subUrl: url,
+      //   data: { typeid: that.recommenIndex },
+      //   success(res) {
+      //     if (res.code == 200) that.onClickRecommon(that.recommenIndex);
+      //   },
+      // });
     },
     // 损失电量分析  type:1 表示24小时健康趋势,2 表示七天健康趋势 3 表示30天健康趋势
     requestCoulometry(type) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        timeout: 8000,
-        subUrl: "recommen/findAllChartjz",
-        data: { wpId: 0, type: type },
-        success(res) {
-          if (res.code == 200) {
-            that.bardata.legend = ["优数量", "良数量", "差数量"];
-            that.lineData = res.data.lvchart;
-            that.bardata.area = res.data.datechart;
-            that.bardata.data[2] = res.data.cslchart;
-            that.bardata.data[1] = res.data.lslchart;
-            that.bardata.data[0] = res.data.yslchart;
+      api.findAllChartjz({
+        wpId: 0,
+        type: type
+      }).then(res =>{
+        if (res.code == 200) {
+            this.bardata.legend = ["优数量", "良数量", "差数量"];
+            this.lineData = res.data.lvchart;
+            this.bardata.area = res.data.datechart;
+            this.bardata.data[2] = res.data.cslchart;
+            this.bardata.data[1] = res.data.lslchart;
+            this.bardata.data[0] = res.data.yslchart;
           }
-        },
-      });
+      })
+      // let that = this;
+      // that.API.requestData({
+      //   method: "POST",
+      //   timeout: 8000,
+      //   subUrl: "recommen/findAllChartjz",
+      //   data: { wpId: 0, type: type },
+      //   success(res) {
+      //     if (res.code == 200) {
+      //       that.bardata.legend = ["优数量", "良数量", "差数量"];
+      //       that.lineData = res.data.lvchart;
+      //       that.bardata.area = res.data.datechart;
+      //       that.bardata.data[2] = res.data.cslchart;
+      //       that.bardata.data[1] = res.data.lslchart;
+      //       that.bardata.data[0] = res.data.yslchart;
+      //     }
+      //   },
+      // });
     },
   },
 };

+ 2 - 2
src/views/Home/Home.vue

@@ -1321,7 +1321,7 @@ export default {
           ];
 
           rdlKey.forEach((keyEle, keyIndex) => {
-            res.data.rdlvos.forEach((cEle) => {
+            res?.data?.rdlvos.forEach((cEle) => {
               DayPower.value[keyIndex].value.push({
                 text: cEle.timestr,
                 value: cEle[keyEle],
@@ -1330,7 +1330,7 @@ export default {
           });
 
           glKey.forEach((keyEle, keyIndex) => {
-            res.data.glvos.forEach((cEle) => {
+            res?.data?.glvos.forEach((cEle) => {
               Powertrend[keyIndex].value.push({
                 text: new Date(cEle.time).formatDate("hh:mm"),
                 value: cEle[keyEle],

+ 3 - 3
src/views/NewPages/power-benchmarking.vue

@@ -288,7 +288,7 @@
               </div>
             </div> -->
           </div>
-          <div class="header-right">
+          <!-- <div class="header-right">
             <div
               class="right-btn"
               :class="{ active: btnIndex == 0 }"
@@ -296,9 +296,9 @@
             >
               风电
             </div>
-            <!-- <div class="right-btn" :class="{ active: btnIndex == 1 }" @click="rightBtnClick(1)">光伏</div> -->
+            <div class="right-btn" :class="{ active: btnIndex == 1 }" @click="rightBtnClick(1)">光伏</div>
             <span class="right-btn">光伏</span>
-          </div>
+          </div> -->
         </div>
         <group-table
           :customClass="'table'"

+ 1 - 1
src/views/report/weather.vue

@@ -32,7 +32,7 @@
 			</div>
 		</div>
 		<div class="table-box">
-			<div class="title">升压站报警</div>
+			<div class="title">气象数据</div>
 			<ComTable
 			  ref="curRef"
 			  :data="tableData"