Browse Source

增加智深公共头部功能,增加报警

sunzehao 4 months ago
parent
commit
75cc8d0f0d

+ 1 - 1
public/index.html

@@ -37,7 +37,7 @@
   </title>
 </head>
 
-<body id="appBody" class="dark nsfStyle">
+<body id="appBody" class=" nsfStyle">
   <div id="ie_dialog">
     本平台仅支持非ie浏览器使用
   </div>

+ 58 - 58
src/App.vue

@@ -85,7 +85,7 @@
       >
         <router-view />
       </div>
-      <!-- <alarmBadge /> -->
+      <alarmBadge />
     </div>
     <div v-else class="login"><login-page @onLogin="login" /></div>
   </div>
@@ -180,62 +180,62 @@ export default {
     },
   },
   async created() {
-    await this.initWebSocket();
-    this.getAlarmConfig();
-    this.x = 80;
-    this.y = 80;
-    let requestResult = [];
-    this.requestAlarmHistoryParams.forEach(({ alarmType, deviceType }) => {
-      requestResult.push(this.getAlarmHistory(alarmType, deviceType));
-    });
+    // await this.initWebSocket();
+    // this.getAlarmConfig();
+    // this.x = 80;
+    // this.y = 80;
+    // let requestResult = [];
+    // this.requestAlarmHistoryParams.forEach(({ alarmType, deviceType }) => {
+    //   requestResult.push(this.getAlarmHistory(alarmType, deviceType));
+    // });
 
-    Promise.all(requestResult)
-      .then((promiseResult) => {
-        this.alarmList = [];
-        promiseResult.forEach(({ data }) => {
-          data?.ls?.forEach((ele) => {
-            this.pushALarmItem(ele);
-          });
-        });
-        this.dialogList.sort((a, b) => {
-          return b.ts - a.ts;
-        });
-        this.realList.sort((a, b) => {
-          return b.ts - a.ts;
-        });
-        this.$store.commit("changeAlarmlist", this.alarmList);
-        this.$store.commit("setWarning", this.dialogList);
-        this.$store.commit("setWarningList", this.realList);
-        // if (!this.socketLeaveFlag) {
-        //   // 没有离开——重连
-        //   // websocket重连
-        //   this.socketReconnect1();
-        // }
-      })
-      .catch(() => {
-        requestResult.forEach((ele, index) => {
-          ele
-            .then(({ data }) => {
-              data?.ls?.forEach((ele) => {
-                this.pushALarmItem(ele);
-              });
-            })
-            .catch((error) => {
-              ElNotification({
-                type: "error",
-                title: "查询历史未处理报警请求出错!",
-                dangerouslyUseHTMLString: true,
-                message: `<div class="currentRequestErrorNotification">
-                                <p><span>主要参数:</p>
-                                <p style="color:var(--el-color-primary)"><span class="errorTitle">alarmType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].alarmType}"</span></p>
-                                <p style="color:var(--el-color-primary)"><span class="errorTitle">deviceType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].deviceType}"</span></p>
-                                <p style="color:var(--el-color-danger)"><span class="errorTitle">错误正文:</span><span class="errorDesc">${error}</span></p>
-                             </div>`,
-              });
-              throw error;
-            });
-        });
-      });
+    // Promise.all(requestResult)
+    //   .then((promiseResult) => {
+    //     this.alarmList = [];
+    //     promiseResult.forEach(({ data }) => {
+    //       data?.ls?.forEach((ele) => {
+    //         this.pushALarmItem(ele);
+    //       });
+    //     });
+    //     this.dialogList.sort((a, b) => {
+    //       return b.ts - a.ts;
+    //     });
+    //     this.realList.sort((a, b) => {
+    //       return b.ts - a.ts;
+    //     });
+    //     this.$store.commit("changeAlarmlist", this.alarmList);
+    //     this.$store.commit("setWarning", this.dialogList);
+    //     this.$store.commit("setWarningList", this.realList);
+    //     // if (!this.socketLeaveFlag) {
+    //     //   // 没有离开——重连
+    //     //   // websocket重连
+    //     //   this.socketReconnect1();
+    //     // }
+    //   })
+    //   .catch(() => {
+    //     requestResult.forEach((ele, index) => {
+    //       ele
+    //         .then(({ data }) => {
+    //           data?.ls?.forEach((ele) => {
+    //             this.pushALarmItem(ele);
+    //           });
+    //         })
+    //         .catch((error) => {
+    //           ElNotification({
+    //             type: "error",
+    //             title: "查询历史未处理报警请求出错!",
+    //             dangerouslyUseHTMLString: true,
+    //             message: `<div class="currentRequestErrorNotification">
+    //                             <p><span>主要参数:</p>
+    //                             <p style="color:var(--el-color-primary)"><span class="errorTitle">alarmType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].alarmType}"</span></p>
+    //                             <p style="color:var(--el-color-primary)"><span class="errorTitle">deviceType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].deviceType}"</span></p>
+    //                             <p style="color:var(--el-color-danger)"><span class="errorTitle">错误正文:</span><span class="errorDesc">${error}</span></p>
+    //                          </div>`,
+    //           });
+    //           throw error;
+    //         });
+    //     });
+    //   });
   },
   mounted() {
     let that = this;
@@ -709,12 +709,12 @@ body {
     .header-menu-nxf{
         height: 72px;
         flex-grow: 1;
-        background-image: url("./assets/nxfImg/header1.png");
+        background-image: url("./assets/nxfImg/header2.png");
         background-repeat: no-repeat;
         background-size: cover;
     }
     .header-menu-body {
-        height: 39px;
+        height: 38px;
         flex-grow: 1;
     }
   }

BIN
src/assets/nxfImg/header2.png


+ 1 - 1
src/assets/styles/common/common.css

@@ -55,7 +55,7 @@
 }
 #appBody.dark .header-menu .header-menu-list .header-menu-item.active {
   background: linear-gradient(to top, rgba(5, 187, 76, 0.5), rgba(5, 187, 76, 0));
-  border: 0.093vh solid #05bb4c;
+  /* border: 0.093vh solid #05bb4c; */
   transition: color 0.25s ease-in-out;
 }
 #appBody.dark .coulometric-analysis .card-1 .card-icon svg use {

+ 1 - 1
src/assets/styles/theme/dark/dark-jsc.css

@@ -55,7 +55,7 @@
 }
 #appBody.dark .header-menu .header-menu-list .header-menu-item.active {
   background: linear-gradient(to top, rgba(5, 187, 76, 0.5), rgba(5, 187, 76, 0));
-  border: 1px solid #05bb4c;
+  /* border: 1px solid #05bb4c; */
   transition: color 0.25s ease-in-out;
 }
 #appBody.dark .coulometric-analysis .card-1 .card-icon svg use {

+ 1 - 1
src/assets/styles/theme/dark/dark-jsc.less

@@ -104,7 +104,7 @@
       rgba(5, 187, 76, 0.5),
       rgba(5, 187, 76, 0)
     );
-    border: 0.093vh solid @green;
+    // border: 0.093vh solid @green;
     transition: color @transition ease-in-out;
   }
 

+ 2 - 1
src/components/alarm-badge/index.vue

@@ -174,6 +174,7 @@ export default {
         this.$store.commit("changeAlarmlist", this.alarmList);
         this.$store.commit("setWarning", this.dialogList);
         this.$store.commit("setWarningList", this.realList);
+        debugger
         if (!this.socketLeaveFlag) {
           // 没有离开——重连
           // websocket重连
@@ -532,7 +533,7 @@ export default {
     // websocket启动
     createWebSocket1() {
       //   let webSocketLink = `ws://192.168.1.102:6014/websocket/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`;
-      let webSocketLink1 = `ws://10.81.3.154:6014/websocket/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`; // webSocket地址
+      let webSocketLink1 = `ws://10.220.1.11:6014/websocket/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`; // webSocket地址
       try {
         if ("WebSocket" in window) {
           this.socketObj1 = new WebSocket(webSocketLink1);

+ 5 - 3
src/nxfStyle.less

@@ -199,11 +199,13 @@
 
                 &.active {
                     color: #67b9ff;
-                    background: linear-gradient(to top, rgba(#2169c3, 0.5), rgba(#142446, 0)) !important;
-                    border-color: #2169c3 !important;
+                    // background: linear-gradient(to top, rgba(#2169c3, 0.5), rgba(#142446, 0)) !important;
+                    background: none !important;
+                    // border-color: #2169c3 !important;
+                    border-color: none !important;
 
                     &:after {
-                        border-color: #2169c3;
+                        // border-color: #2169c3;
                     }
                 }
             }

+ 1 - 0
src/utils/ws.js

@@ -10,6 +10,7 @@ let reLinkNum = 0;
 let reLinkMaxNum = 3;
 
 const initWebSocket = async () => {
+    debugger
     if ("WebSocket" in window) {
         if (reLinkNum < reLinkMaxNum) {
             const wsUrl = `${process.env.VUE_APP_GENERAT_URL}/ws/powerfitting/12345`;

+ 55 - 35
src/views/layout/nxfHeader.vue

@@ -2,60 +2,69 @@
     <div class="header-nxf">
         <p class="nxfP">智能管控一体化系统(惠安风场)</p>
         <ul class="header-nxf-list">
-            <li class="header-nxf-it" v-for="(menu, index) of menus" :key="menu" @click="click(index, menu)"
+             <!-- @click="click(menu)" -->
+            <li class="header-nxf-it" v-for="(menu, index) of menus" :key="menu"
                 :class="{ active: activeIndex == index }">
-                {{ menu.text }}
+                <a :href="menu.path" class="aclas">{{ menu.text }}</a>
+                <!-- {{ menu.text }} -->
+                <img class="imgcla" :src="menuimg" alt="" v-if="index !== menus.length-1">
             </li>
         </ul>
     </div>
 </template>
 <script>
+import img from '@/assets/nxfImg/menu.png'
     export default {
         data() {
             return {
                 themeName: false,
+                menuimg: img,
                 menus: [{
-                        id: "home",
-                        text: "首页",
-                        path: "/home",
+                        id: "1",
+                        text: "全场监控",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/9d23c8a1-444d-a21b-17a0-bb618059f8c0?instanceId=a760dcd2-413b-a488-bcd7-942cd5f8fff3",
                         isActive: true,
                     },
                     {
-                        id: "stateMonitor",
-                        text: "监视中心",
-                        path: "/stateMonitor",
+                        id: "2",
+                        text: "矩阵图",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/060b34d5-26cc-f172-632a-e80ca3b7be04?instanceId=12b577b4-ea67-c8b6-7b13-1cb066aaf814",
                         isActive: true,
                     },
                     {
-                        id: "integratedAlarm",
-                        text: "综合报警",
-                        path: "/integratedAlarm",
+                        id: "3",
+                        text: "告警中心",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/3ab0f63d-669b-a119-1eb7-b85fbb6b07bc?instanceId=465034a6-24c1-c0aa-a480-16c7ea65e216",
                         isActive: true,
                     },
                     {
-                        id: "economicsOperation",
-                        text: "经济运行",
-                        path: "/economicsOperation",
+                        id: "4",
+                        text: "智能报表",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/d267bff2-2047-53e6-d464-258184eb6da5?instanceId=9246cfa3-701a-5958-1e9c-cfd38a773813",
                         isActive: false,
                     },
                     {
-                        id: "health",
-                        text: "智慧检修",
-                        // path: '/sandtable',
-                        path: "/health",
+                        id: "5",
+                        text: "电气系统",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/31b8da0c-1c7e-599c-041b-ea51ed62b4b6?instanceId=2d6a7f5b-c49c-259a-67c4-43579e74ebd7",
                         isActive: false,
                     },
                     {
-                        id: "powerGenerating",
-                        text: "发电能力分析",
-                        // path: '/sandtable',
-                        path: "/powerGenerating",
+                        id: "6",
+                        text: "电网协同",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/4c074039-5151-45b5-f061-23b64e63c711?instanceId=1ccd5b1c-9861-b617-a3d5-387f2d596924",
                         isActive: false,
                     },
                     {
-                        id: "report",
-                        text: "智能报表",
-                        path: "/nxreport",
+                        id: "7",
+                        text: "风功率预测",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/b26fc778-e388-c9b6-9ee3-505a7b96dbfc?instanceId=8015e62d-b833-966a-220f-900ad1eb53ad",
+                        isActive: false,
+                    },
+                    {
+                        id: "8",
+                        text: "运行指标",
+                        path: "https://10.112.33.5:5300/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/862c8272-8cf8-435c-b3fc-b28936b4bfe0?instanceId=387b6bac-1dcc-fda6-b31e-c56518fc08ee",
                         isActive: false,
                     },
                 ],
@@ -64,8 +73,8 @@
             };
         },
         methods: {
-            click(index, data) {
-
+            click(data) {
+                window.location.href = data.path;
             }
         }
     };
@@ -84,10 +93,10 @@
 
         .nxfP {
             font-family: AlibabaPuHuiTi;
-            font-size: 26px;
+            font-size: 24px;
             margin-left: 20px;
-            margin-right: 80px;
-            line-height: 23px;
+            margin-right: 60px;
+            line-height: 30px;
         }
 
         .header-nxf-list {
@@ -106,13 +115,24 @@
                 padding: 0 15px;
                 //   width: 9.259vh;
                 height: 100%;
-                color: #a6b8dd;
-                font-size: 18px;
-                cursor: pointer;
+                font-size: 15px;
                 transition: color 0.2s ease-in-out;
 
-                &.hover {
-                    color: #fff;
+                .aclas{
+                    color: #a6b8dd;
+                    font-size: 15px;
+                    cursor: pointer;
+                    text-decoration: auto;
+                    &:hover {
+                        color: #fff !important;
+                    }
+                }
+
+                .imgcla{
+                    width: 10px;
+                    height: 30px;
+                    position: relative;
+                    left: 16px;
                 }
             }
         }

+ 1 - 1
src/views/layout/tabHeader.vue

@@ -287,7 +287,7 @@
                         position: absolute;
                         width: 100%;
                         height: 3px;
-                        border: 1px solid @green;
+                        border: 1px solid #2169c3;
                         border-top: 0;
                         left: 0;
                         bottom: 0;