ソースを参照

修复与对接

Ming 4 年 前
コミット
f095a03689

BIN
dist.zip


+ 3 - 2
src/App.vue

@@ -49,8 +49,9 @@ export default {
       if ("WebSocket" in window) {
         // console.log("您的浏览器支持 WebSocket!");
         // location.host
-        // that.global.ws = new WebSocket("ws://172.16.120.210:6001");
-        that.global.ws = new WebSocket("ws://121.199.52.195:6001");
+        that.global.ws = new WebSocket("ws://172.16.120.210:6001"); //后台本机ip
+        // that.global.ws = new WebSocket("ws://121.199.52.195:6001");  //线上测试ip
+        // that.global.ws = new WebSocket("ws://172.16.120.79:6001");  //虚拟机ip
         that.global.setWs(that.global.ws);
         that.global.ws.onopen = function () {
           console.log("websocket连接成功");

+ 6 - 2
src/assets/styles/index.css

@@ -459,8 +459,12 @@ header .showTime {
 }
 
 .gas-container .timeList {
-    max-width: 24rem;
-    text-align: left
+    /* max-width: 24rem;
+    text-align: left; */
+    min-width: 24rem;
+    text-align: left;
+    max-width: 86%;
+    margin: 0 auto;
 }
 
 .gas-container .timeItem {

+ 0 - 1
src/components/topHeader.vue

@@ -13,7 +13,6 @@
         >
           {{ item.StationName }}
         </option>
-        <option value="ss">ss</option>
       </select>
     </div>
 

+ 21 - 8
src/pages/eleFireCard/eleFireCard.vue

@@ -16,7 +16,18 @@
             <div>
               <table>
                 <tr>
-                  <th>供电过压告警:<span class="normal">正常</span></th>
+                  <th>供电过压告警:
+                    <span class="normal" >
+
+                     <!-- {{getData[0].List.length}}  -->
+                      <!-- {{getData[0].List}} -->
+                      <!-- {{getData[0].List[0].Value}}  v-if="getData[0].List.length>0" -->  
+                      正常
+                      </span>
+                      <!-- <span class="normal" v-else>  "
+                     111
+                      </span> -->
+                    </th>
                   <th>供电低压告警:<span class="normal">正常</span></th>
                   <th>供电过流告警:<span class="normal">正常</span></th>
                   <th>漏电告警:<span class="normal">正常</span></th>
@@ -65,6 +76,7 @@ export default {
     return {
       StationID: "",
       DeviceID: "",
+      getData:[]
     };
   },
   watch: {
@@ -96,17 +108,18 @@ export default {
 
           this.global.sendWs(json);
 
-          setInterval(() => {
-            console.log("每隔30秒请求一次getDeviceDetail");
-            this.global.sendWs(json);
-          }, 30000);
+          // setInterval(() => {
+          //   console.log("每隔30秒请求一次getDeviceDetail");
+          //   this.global.sendWs(json);
+          // }, 30000);
 
         }
 
         if (redata.CMD == "getDeviceDetail") {
-          console.log("redata.RESULT");
-          console.log(redata.RESULT.Device);
-          this.getData = redata.RESULT.Device;
+         console.log("redata.RESULT");
+         
+          this.getData =redata.RESULT.Device[0].Points;
+           console.log(this.getData[0].List.length);
         }
       }
     },

+ 9 - 5
src/pages/eleFireData/eleFireData.vue

@@ -15,7 +15,6 @@
 
         <div class="tabBox eleFire-data">
          <div class="column2">
-
            <div class="panel sec1">
              <div class="inner-box">
                <div>
@@ -23,12 +22,17 @@
                  <p>供电低压告警:<span class="normal">正常</span></p>
                </div>
                <div>
-                 <p>供电过告警:<span class="normal">正常</span></p>
-                 <p>供电低压告警:<span class="normal">正常</span></p>
+                 <p>供电过告警:<span class="normal">正常</span></p>
+                 <p>漏电告警:<span class="normal">正常</span></p>
                </div>
-               <div><p style="width:100%">供电低压告警:<span class="normal">正常</span></p></div>
+               <div>
+                 <p style="width:100%">
+                   A相线缆温度超高:<span class="normal" style="margin-right:.3rem">正常</span>
+                   B相线缆温度超高:<span class="normal" style="margin-right:.3rem">正常</span>  
+                   C相线缆温度超高:<span class="normal" style="margin-right:.3rem">正常</span>
+                 </p>
+                 </div>
              </div>
-
            </div>
            <div class="panel eleCurrentChart" >
 

+ 9 - 8
src/pages/gasCard/gasCard.vue

@@ -31,7 +31,7 @@
                   <td>{{ getData.DeviceType }}</td>
                   <td>位置BBBBBB</td>
                   <td>0.00%LEL</td>
-                  <td>正常</td>
+                  <td class="normal">正常</td>
                 </tr>
               </table>
             </div>
@@ -89,17 +89,18 @@ export default {
 
           this.global.sendWs(json);
 
-          setInterval(() => {
-            console.log("每隔30秒请求一次getDeviceDetail");
-            this.global.sendWs(json);
-          }, 30000);
+          // setInterval(() => {
+          //   console.log("每隔30秒请求一次getDeviceDetail");
+          //   this.global.sendWs(json);
+          // }, 30000);
 
         }
 
         if (redata.CMD == "getDeviceDetail") {
-          console.log("redata.RESULT");
-          console.log(redata.RESULT.Device);
-          this.getData = redata.RESULT.Device;
+  
+          // console.log("redata.RESULT");
+          // console.log(redata.RESULT.Device[0].point);
+          // this.getData = redata.RESULT.Device;
         }
       }
     },

+ 41 - 15
src/pages/index/index.vue

@@ -7,33 +7,54 @@
     <div class="mainbox">
       <div style="margin: 0rem auto; width: 15rem">
         <div class="column" v-for="item in homeData" :key="item.StationID">
+
           <div
             class="panel"
             @click="goInnerCard(item)"
             :class="{
-              alarm: Number(item.status) === 1,
-              fault: Number(item.status) === 2,
+              alarm: Number(item.DeviceStatus) === 1,
+              fault: Number(item.DeviceStatus) === 2,
             }"
           >
             <div>
-              <!-- <img src="@/assets/images/panel-icon.png" alt="" /> -->
               <p>
-                状态:<span>{{ item.DeviceStatusNote }}</span>
+                状态:
+                <span v-if="item.DeviceStatus==0">正常</span>
+                <span v-if="item.DeviceStatus==1">告警</span>
+                <span v-if="item.DeviceStatus==2">故障</span>
               </p>
               <p class="light-color">{{ item.DeviceType }}</p>
+
+
+              <!-- 电气火灾渲染start -->
               <p
                 v-if="item.DeviceType == '电气火灾监测装置'"
                 class="light-color"
               >
                 {{ item.KeyPoints[0].PointName }}:
-                {{
-                  item.KeyPoints[0].ValueList[0].Value == 0 ? "正常" : "告警"
-                }}
+                <span v-if="item.KeyPoints[0].ValueList.length>0">
+                   {{item.KeyPoints[0].ValueList[0].Value == 0 ? "正常" : "告警"}}
+                </span>
+                <span v-else>
+                 aa
+                </span>
               </p>
+               <!-- 电气火灾渲染end -->
+
+
+               <!-- 可燃气体渲染start -->
               <p v-else class="light-color">
                 {{ item.KeyPoints[0].PointName }}:
-                {{ item.KeyPoints[0].ValueList[0].Value }}
+
+                <span v-if="item.KeyPoints[0].ValueList.length>0">
+                  {{ item.KeyPoints[0].ValueList[0].Value }}
+                </span>
+                <span v-else>aa</span>
               </p>
+               <!-- 可燃气体渲染end -->
+
+
+
             </div>
           </div>
         </div>
@@ -75,13 +96,14 @@ export default {
   created() {
     // 如果有站点选项,发送请求获取站点信息页数据
     this.StationID = this.$store.state.StationID;
-    console.log(1212121212);
-    console.log(this.StationID);
+    // console.log(1212121212);
+    // console.log(this.StationID);
   },
   methods: {
     messageHandle(e) {
       if (e.data.search("{") != -1) {
         const redata = JSON.parse(e.data);
+        
         if (redata.CMD == "getStationInfo" && redata.RESULT[0].StationID) {
           var json = {};
           json.CMD = "getStationDetail";
@@ -89,15 +111,19 @@ export default {
 
           this.global.sendWs(json);
 
-          setInterval(() => {
-            console.log("每隔30秒请求一次getStationDetail");
-            this.global.sendWs(json);
-          }, 30000);
+          // setInterval(() => {
+          //   console.log("每隔30秒请求一次getStationDetail");
+          //   this.global.sendWs(json);
+          // }, 30000);
         }
 
         if (redata.CMD == "getStationDetail") {
+
+         
           this.homeData = redata.RESULT.LIST;
-          console.log(this.homeData);
+        //    console.log('首页数据') 
+        // console.log(redata)
+        //   console.log(this.homeData);
         }
       }
     },

+ 2 - 2
src/pages/recordTime/recordTime.vue

@@ -65,7 +65,7 @@ export default {
       // 总条数,根据接口获取数据长度(注意:这里不能为空)
       TotalCount: 1,
       // 默认每页显示的条数(可修改)
-      Count: 5,
+      Count: 10,
     };
   },
   watch: {
@@ -142,7 +142,7 @@ export default {
           json.StationID = this.StationID;
           (json.Start = 0), (json.Limit = 2), (json.Order = "DESC");
 
-          this.global.sendWs(json);
+          // this.global.sendWs(json);
 
           setInterval(() => {
             console.log("每隔30秒请求一次getPatrolRecord");