Browse Source

光伏矩阵

lining 3 years ago
parent
commit
0e782a1446

+ 7 - 3
src/App.vue

@@ -314,9 +314,8 @@ import Menu from "@/views/layout/Menu.vue";
 import Header from "@/views/layout/Header.vue";
 import LoginPage from "./views/layout/login-page.vue";
 import sisView from "./views/sisView/index.vue";
-
 import SvgIcon from "@com/coms/icon/svg-icon.vue";
-
+//  import MessageBridge from "@tools/MessageBridge";
 import $ from "jquery";
 export default {
   components: {
@@ -348,7 +347,9 @@ export default {
       "class",
       themeName === "dark" || themeName === "light" ? themeName : "dark"
     );
-
+    // let mb = MessageBridge.getInstance();
+    // let windturbine = [{ key: "/topic/windturbine", action: this.windturbineMessage }];
+    // mb.register(windturbine);
     // that.$nextTick(() => {
     //   that.API.requestData({
     //     isMust: false, // 请求是否携带 token ,默认为 true ,可缺省
@@ -379,6 +380,9 @@ export default {
   },
 
   methods: {
+    windturbineMessage(msg){
+      console.log(msg);
+    },
     // 切换子系统事件
     HeaderMenuClick(data) {
       this.root = data.id;

+ 45 - 2
src/api/cockpit/matrix/index.js

@@ -54,6 +54,13 @@ const matrixPush = (showLoading) => {
         method: "get",
     });
 };
+// const matrixPush = (showLoading) => {
+//     return request({
+//         showLoading,
+//         url: `/consumer/matrix/matrixDatas`,
+//         method: "get",
+//     });
+// };
 //全风场简单矩阵
 const findSimpleMatrixAll = (data) => {
     return request({
@@ -122,7 +129,7 @@ const windfarmAllAjax = () => {
     });
 };
 //风机信息列表
-const findWtInfoList = (showLoading,data) => {
+const findWtInfoList = (showLoading, data) => {
     return request({
         showLoading,
         baseURL: process.env.VUE_APP_Matrix,
@@ -167,7 +174,39 @@ const matrixMatrixByWpIdPush = (data) => {
 const monitorFindGeneralAppearance = (data) => {
     return request({
         baseURL: process.env.VUE_APP_Matrix,
-        url: `monitor/findGeneralAppearance?wpId=${data.wpId}`, 
+        url: `monitor/findGeneralAppearance?wpId=${data.wpId}`,
+        method: "get",
+    });
+};
+//光伏所有矩阵信息
+const findPVSimpleMatrixAll = () => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `matrix/findPVSimpleMatrixAll`,
+        method: "get",
+    });
+};
+//逆变器监视
+const findInverterInfo = (data) => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `monitorinverter/findInverterInfo?wtId=${data.wtId}`,
+        method: "get",
+    });
+};
+//逆变器开网频率
+const findInverterPowerLine = (data) => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `monitorinverter/findInverterPowerLine?wtId=${data.wtId}`,
+        method: "get",
+    });
+};
+//光伏矩阵
+const matrixDetialGfPush = () => {
+    return request({
+        baseURL: process.env.VUE_APP_Matrix,
+        url: `matrix/matrixDetialGfPush`,
         method: "get",
     });
 };
@@ -194,4 +233,8 @@ export default {
     genresetFindPowerInfo,
     matrixMatrixByWpIdPush,
     monitorFindGeneralAppearance,
+    findPVSimpleMatrixAll,
+    findInverterInfo,
+    findInverterPowerLine,
+    matrixDetialGfPush,
 }

+ 1 - 1
src/store/index.js

@@ -6,7 +6,7 @@ const debug = process.env.NODE_ENV !== 'production';
 
 // 默认状态
 const state = {
-  websocketTimeSec: 5000,
+  websocketTimeSec: 1000,
   loading: false, //全局 - 加载中....
   themeName: localStorage.getItem("themeName") || "dark", // 主题
   menuData: [],

+ 60 - 0
src/views/Home/Home.vue

@@ -1707,4 +1707,64 @@ export default {
     }
   }
 }
+.haha{
+  height: 100px;
+  width: 150px;
+  position: relative;
+  border-radius: 10px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-image: linear-gradient(45deg, gold, deeppink);
+  animation: hue 3s infinite linear;
+  &::before,
+  &::after {
+    content: "";
+    position: absolute;
+    top: -15px;
+    bottom: -15px;
+    left: -15px;
+    right: -15px;
+    border: 5px solid #24acf2;
+    border-image: linear-gradient(45deg, gold, deeppink) 1;
+    clip-path: inset(0px round 10px);
+    animation: clippath 3s infinite linear;
+  }
+  &::after {
+    animation: clippath 3s infinite -1.5s linear;
+  }
+  span {
+    color: white;
+    font-size: 20px;
+  }
+}
+@keyframes hue {
+  0% {
+    filter: hue-rotate(0deg);
+  }
+  100% {
+    filter: hue-rotate(360deg);
+  }
+}
+
+@keyframes clippath {
+  0% {
+    clip-path: inset(0 0 95% 0);
+    filter: hue-rotate(0deg);
+  }
+  25% {
+    clip-path: inset(0 95% 0 0);
+  }
+  50% {
+    clip-path: inset(95% 0 0 0);
+  }
+  75% {
+    clip-path: inset(0 0 0 95%);
+  }
+  100% {
+    clip-path: inset(0 0 95% 0);
+    filter: hue-rotate(360deg);
+  }
+}
+
 </style>

+ 0 - 30
src/views/LightMatrix2/LightMatrix2.vue

@@ -409,36 +409,6 @@ export default {
             this.sourceMap = {};
           }
       })
-      // let that = this;
-      // that.API.requestData({
-      //   showLoading,
-      //   method: "POST",
-      //   subUrl: "matrix/matrixQfPush",
-      //   success(res) {
-      //     if (res.data) {
-      //       let sourceMap = res.data;
-      //       for (let key in sourceMap) {
-      //         if (key !== "fczbmap" && key !== "fjmap") {
-      //           sourceMap[key] += "";
-      //         } else if (key === "fjmap") {
-      //           sourceMap[key].forEach((pItem) => {
-      //             pItem.forEach((cItem) => {
-      //               cItem.color = that.getColor(cItem.fjzt);
-      //               cItem.isShow = true;
-      //             });
-      //           });
-      //         }
-      //       }
-      //       that.sourceMap = sourceMap;
-      //            console.log('sourceMap:',that.sourceMap)
-      //       if (that.fillCategory) {
-      //         that.changeShow(that.fillCategory, that.fillFjzt, true);
-      //       }
-      //     } else {
-      //       that.sourceMap = {};
-      //     }
-      //   },
-      // });
     },
 
     // 查看风机详情

+ 106 - 73
src/views/WindSite/pages/Inverter-Info.vue

@@ -18,10 +18,10 @@
       </div>
       <div class="Inverter-Info-body">
         <div class="Inverter-Info-title">
-          <div class="title">{{info.name}}</div>
+          <div class="title">{{ info.name }}</div>
 
           <div class="title-tools-left">
-            <div class="other">逆变器型号:{{info.modelid}}</div>
+            <div class="other">逆变器型号:{{ info.modelid }}</div>
             <div class="state">
               状态:
               <div class="dot" :class="stateColor"></div>
@@ -39,40 +39,74 @@
               <div class="form">
                 <div>
                   <table class="table-form mg-b-8" height="60%">
-                    <tr v-for="(aiarr) in aiData" :key="aiarr">
-                      <td class="text gray">{{aiarr[0].name}}</td>
-                      <td class="value green">{{aiarr[0].value}}</td>
-                      <td class="unit gray">{{aiarr[0].unit}}</td>
-                      <td class="text gray" v-if="aiarr.length>1">{{aiarr[1].name}}</td>
-                      <td class="value green" v-if="aiarr.length>1">{{aiarr[1].value}}</td>
-                      <td class="unit gray" v-if="aiarr.length>1">{{aiarr[1].unit}}</td>
+                    <tr v-for="aiarr in aiData" :key="aiarr">
+                      <td class="text gray">{{ aiarr[0].name }}</td>
+                      <td class="value green">{{ aiarr[0].value }}</td>
+                      <td class="unit gray">{{ aiarr[0].unit }}</td>
+                      <td class="text gray" v-if="aiarr.length > 1">
+                        {{ aiarr[1].name }}
+                      </td>
+                      <td class="value green" v-if="aiarr.length > 1">
+                        {{ aiarr[1].value }}
+                      </td>
+                      <td class="unit gray" v-if="aiarr.length > 1">
+                        {{ aiarr[1].unit }}
+                      </td>
                     </tr>
                   </table>
                 </div>
                 <div>
                   <panel class="line-panel" :title="'开网频率'">
-                    <multiple-line-chart :list="lineValue" :units="['']" height="100%" />
+                    <multiple-line-chart
+                      :list="lineValue"
+                      :units="['']"
+                      height="100%"
+                    />
                   </panel>
                 </div>
               </div>
               <div class="states">
                 <div class="counts">
-                  <div class="all">
+                  <div class="all" @click="handleChange(0)">
                     <span class="text">全部状态</span>
-                    <span class="value">30</span>
+                    <span class="value">{{ diAll.length }}</span>
                   </div>
-                  <div class="error">
+                  <div class="error" @click="handleChange(1)">
                     <span class="text">报警状态</span>
-                    <span class="value">30</span>
+                    <span class="value">{{
+                      diAll.filter((item) => item.value === 1).length
+                    }}</span>
                   </div>
                 </div>
                 <div class="state-list">
                   <el-scrollbar>
-                    <div class="list-body">
+                    <div class="list-body" v-if="current === 0">
                       <div v-for="item of diAll" :key="item" class="list-item">
-                        <div class="text">{{item.name}}</div>
+                        <div class="text">{{ item.name }}</div>
                         <div class="state">
-                          <div :class="{ red: item.value == 1, green: item.value != 1 }"></div>
+                          <div
+                            :class="{
+                              red: item.value == 1,
+                              green: item.value != 1,
+                            }"
+                          ></div>
+                        </div>
+                      </div>
+                    </div>
+                    <div class="list-body" v-if="current === 1">
+                      <div
+                        v-for="item of errorList"
+                        :key="item"
+                        class="list-item"
+                      >
+                        <div class="text">{{ item.name }}</div>
+                        <div class="state">
+                          <div
+                            :class="{
+                              red: item.value == 1,
+                              green: item.value != 1,
+                            }"
+                          ></div>
                         </div>
                       </div>
                     </div>
@@ -93,6 +127,7 @@ import List from "@com/coms/list/list.vue";
 import Panel from "../../../components/coms/panel/panel.vue";
 import MultipleLineChart from "../../../components/chart/line/multiple-line-chart.vue";
 import collapseList from "@/components/coms/collapse/collapse-list.vue";
+import api from "@api/cockpit/matrix/index.js";
 export default {
   // 名称
   name: "Box",
@@ -102,15 +137,17 @@ export default {
     List,
     Panel,
     MultipleLineChart,
-    collapseList
+    collapseList,
   },
   // 数据
   data() {
     return {
       timmer: null,
       timmer1: null,
+      current: 0,
       WindSites: [],
       diAll: [],
+      errorList: [],
       diOn: [],
       info: {},
       stateColor: "blue",
@@ -119,9 +156,9 @@ export default {
         datas: [
           {
             text: "1#逆变室",
-            color: "blue"
-          }
-        ]
+            color: "blue",
+          },
+        ],
       },
       wtId: "PL01_01",
       aiData: [],
@@ -131,22 +168,22 @@ export default {
           value: [
             {
               text: "00:00",
-              value: 0
-            }
-          ]
-        }
-      ]
+              value: 0,
+            },
+          ],
+        },
+      ],
     };
   },
   // 函数
   methods: {
-    selectList: function(item) {
+    selectList: function (item) {
       console.log(item);
     },
-    select: function(item) {
+    select: function (item) {
       console.log(item);
     },
-    onReturn: function() {
+    onReturn: function () {
       console.log("return");
     },
     // 点击左侧菜单
@@ -154,45 +191,38 @@ export default {
       // console.log(res);
       this.wpId = res.wpId;
       this.wtId = res.wtId;
-      this.$router.replace(`/monitor/windsite/inverter-info/${res.wpId}/${res.wtId}`);
+      this.$router.replace(
+        `/monitor/windsite/inverter-info/${res.wpId}/${res.wtId}`
+      );
       this.getData();
       this.getLineChart();
     },
     async buildSelectList() {
-      let res = await this.API.requestData({
-        method: "POST",
-        // baseURL: "http://localhost:8082/",
-        subUrl: "matrix/findPVSimpleMatrixAll"
-      });
+      let res = await api.findPVSimpleMatrixAll();
       let WindSites = [];
-      res.data.data.forEach((ele, index) => {
-        ele.inverterls.forEach(function(inver) {
+      res?.data?.data?.forEach((ele, index) => {
+        ele.inverterls.forEach(function (inver) {
           // inver["text"] = inver["wtnum"];
           inver["text"] = inver["wtnum"];
           inver["color"] = "blue";
           inver["id"] = inver["wtId"];
-          
         });
         WindSites.push({
           id: String(index),
           text: ele.wpName,
-          children: ele.inverterls
+          children: ele.inverterls,
         });
       });
       this.WindSites = WindSites;
     },
     async getData() {
-      let res = await this.API.requestData({
-        method: "POST",
-        // baseURL: "http://localhost:8082/",
-        subUrl: "monitorinverter/findInverterInfo",
-        data: {
-          wtId: this.wtId
-        }
+      let res = await api.findInverterInfo({
+        wtId: this.wtId,
       });
+      console.log(111111);
       const aiData = [];
-      if (res.data.data.listAI) {
-        const arr = res.data.data.listAI;
+      if (res?.data?.listAI) {
+        const arr = res.data.listAI;
         for (let index = 0; index < arr.length; index = index + 2) {
           const elem1 = arr[index];
           const elem2 = arr[index + 1];
@@ -204,20 +234,15 @@ export default {
       }
       this.aiData = aiData;
       // di
-      if (res.data.data.listDI) {
-        this.diAll = res.data.data.listDI.allList;
-        this.diOn = res.data.data.listDI.onList;
+      if (res.data.listDI) {
+        this.diAll = res.data.listDI.allList;
+        this.diOn = res.data.listDI.onList;
       }
-      this.info = res.data.data.info;
+      this.info = res.data.info;
     },
     async getLineChart() {
-      let res = await this.API.requestData({
-        method: "POST",
-        // baseURL: "http://localhost:8082/",
-        subUrl: "monitorinverter/findInverterPowerLine",
-        data: {
-          wtId: this.wtId
-        }
+      let res = await api.findInverterPowerLine({
+        wtId: this.wtId,
       });
       let date = new Date();
       date.setHours(0);
@@ -228,35 +253,32 @@ export default {
         date.setMinutes(i * 30);
         result.push({
           text: new Date(timt + i * 1000 * 60 * 30).formatDate("hh:mm"),
-          value: res.data.data[i]
+          value: res.data.data[i],
         });
       }
       this.lineValue = [
         {
           title: "功率",
-          value: result
-        }
+          value: result,
+        },
       ];
     },
     async getTurbinesState() {
       let that = this;
-      let res = await this.API.requestData({
-        method: "POST",
-        subUrl: "matrix/matrixDetialGfPush"
-      });
+      let res = await api.matrixDetialGfPush();
       const ztmap = {};
-      if (res && res.data && res.data.data && res.data.data.fjmap) {
-        res.data.data.fjmap.forEach(function(fcList) {
-          fcList.forEach(function(fjItem) {
+      if (res?.data?.data?.fjmap) {
+        res.data.data.fjmap.forEach(function (fcList) {
+          fcList.forEach(function (fjItem) {
             ztmap[fjItem["wtId"]] = fjItem["fjzt"];
           });
         });
       }
       that.stateColor = that.getColor(ztmap[that.wtId]);
       if (this.WindSites) {
-        this.WindSites.forEach(function(ws) {
+        this.WindSites.forEach(function (ws) {
           if (ws.children) {
-            ws.children.forEach(function(fj) {
+            ws.children.forEach(function (fj) {
               fj["color"] = that.getColor(ztmap[fj.wtId]);
             });
           }
@@ -287,7 +309,18 @@ export default {
           return "write";
           break;
       }
-    }
+    },
+    handleChange(current) {
+      this.current = current;
+      if (current === 1) {
+        this.errorList = [];
+        this.diAll.forEach((item) => {
+          if (item.value === 1) {
+            this.errorList.push(item);
+          }
+        });
+      }
+    },
   },
   // 生命周期钩子
   beforeCreate() {
@@ -328,7 +361,7 @@ export default {
     this.timmer = null;
     clearInterval(this.timmer1);
     this.timmer1 = null;
-  }
+  },
 };
 </script>
 

+ 2 - 2
src/views/malfunctionDiagnose/index.vue

@@ -83,7 +83,7 @@
       <div class="query-actions">
         <button class="btn green" @click="search()">查询</button>
         <!-- <button class="btn green" @click="">导入</button> -->
-        <button class="btn green" @click="export">导出</button>
+        <button class="btn green" @click="excelExport()">导出</button>
       </div>
     </div>
     <div class="df-table">
@@ -280,7 +280,7 @@ export default {
     formatJson(filterVal, jsonData) {
       return jsonData.map((v) => filterVal.map((j) => v[j]));
     },
-    export() {
+    excelExport() {
       let that = this;
       const { export_json_to_excel } = require("@tools/excel/Export2Excel.js"); // 注意这个Export2Excel路径
       let tHeader = []; // 上面设置Excel的表格第一行的标题