rui.jiang 11 mesi fa
parent
commit
2ef9c86aef

+ 27 - 15
src/views/admin/cockpitManage/Index.vue

@@ -17,19 +17,36 @@
       </selecttree>
 
       <p>
-        <span class="SpText">登录人风场总数:</span>{{ totalList.fieldSumNumber }} 个
+        <span class="SpText">登录人风场总数:</span>
+        {{
+          totalList.fieldSumNumber !== null ? totalList.fieldSumNumber : 0
+        }}
+        个
       </p>
       <p>
-        <span class="SpText">已完成分析风场:</span
-        >{{ totalList.analysisFinishNumber }} 个
+        <span class="SpText">已完成分析风场:</span>
+        {{
+          totalList.analysisFinishNumber !== null
+            ? totalList.analysisFinishNumber
+            : 0
+        }}
+        个
       </p>
       <p>
-        <span class="SpText">未完成分析风场:</span
-        >{{ totalList.analysisUnFinishedNumber }} 个
+        <span class="SpText">未完成分析风场:</span>
+        {{
+          totalList.analysisUnFinishedNumber !== null
+            ? totalList.analysisUnFinishedNumber
+            : 0
+        }}
+        个
       </p>
       <p>
-        <span class="SpText">风机数量:</span
-        >{{ totalList.engineGroupNumber }} 个
+        <span class="SpText">风机数量:</span>
+        {{
+          totalList.engineGroupNumber !== null ? totalList.engineGroupNumber : 0
+        }}
+        个
       </p>
       <p>
         <span class="SpText">风场状态:</span>
@@ -108,14 +125,12 @@ export default {
     this.GETtotal();
 
     // 页面初始化时手动触发一次赋值操作
-    this.$watch('defaultdata', (newValue) => {
+    this.$watch("defaultdata", (newValue) => {
       this.maplistArr = newValue; // 将defaultdata的值赋给maplistArr
     });
     this.maplistArr = this.defaultdata;
-  
   },
   mounted() {
-  
     //模拟地图上的点位
     const data = this.maplist;
     // data.forEach((element) => {
@@ -286,10 +301,7 @@ export default {
   }
 }
 
-.Showtree {
-  position: absolute;
-  top: 55px;
-  left: 10px;
-  width: 280px;
+::v-deep .el-switch__label.is-active {
+  color: #fff;
 }
 </style>

+ 53 - 6
src/views/admin/cockpitManage/component/rightdata.vue

@@ -9,21 +9,48 @@
       <div class="BOX">
         <div style="display: flex">
           <div class="YC01">
-            <strong>{{ equipment.errCounrt }}</strong>
+            <strong>
+              {{
+                equipment.errCount !== null && equipment.errCount !== undefined
+                  ? equipment.errCount
+                  : 0
+              }}</strong
+            >
             <span>异常总数</span>
           </div>
           <div class="YC02">
-            <strong>{{ equipment.errCountInCurrentMonth }}</strong>
+            <strong>
+              {{
+                equipment.errCountInCurrentMonth !== null &&
+                equipment.errCountInCurrentMonth !== undefined
+                  ? equipment.errCountInCurrentMonth
+                  : 0
+              }}</strong
+            >
             <span>本月异常</span>
           </div>
         </div>
         <div style="display: flex">
           <div class="YC02">
-            <strong class="textred">{{ equipment.errCountNotDeal }}</strong>
+            <strong class="textred">
+              {{
+                equipment.errCountNotDeal !== null &&
+                equipment.errCountNotDeal !== undefined
+                  ? equipment.errCountNotDeal
+                  : 0
+              }}</strong
+            >
             <span>未处理异常</span>
           </div>
           <div class="YC02">
-            <strong class="texyellow">{{ equipment.errDeviceCount }}</strong>
+            <strong class="texyellow">
+              {{
+                equipment.errDeviceCount !== null &&
+                equipment.errDeviceCount !== undefined
+                  ? equipment.errDeviceCount
+                  : 0
+              }}</strong
+            >
             <span>异常设备数</span>
           </div>
           <div class="YC03"></div>
@@ -77,14 +104,15 @@ export default {
   watch: {
     maplistArr: {
       handler(newVal) {
-        if (Object.keys(newVal).length > 0) { // 检查maplistArr是否有值
+        if (Object.keys(newVal).length > 0) {
+          // 检查maplistArr是否有值
           console.log("Map list updated:", newVal);
           this.getStatistics();
           this.getOptionRecords();
         }
       },
       immediate: true, // 立即执行一次handler
-      deep: true,      // 深度监听对象内部变化
+      deep: true, // 深度监听对象内部变化
     },
   },
   components: {
@@ -208,6 +236,7 @@ export default {
   border-radius: 5px;
   padding: 20px;
 }
+
 .BOX {
   background: #004f5f;
   display: flex;
@@ -215,6 +244,7 @@ export default {
   flex-wrap: wrap;
   padding-bottom: 15px;
 }
+
 .YC01 {
   width: 154px;
   height: 60px;
@@ -225,16 +255,19 @@ export default {
   margin-right: 15px;
   margin-top: 15px;
   text-align: center;
+
   strong {
     display: block;
     font-size: 26px;
     color: #4bffff;
   }
+
   span {
     display: block;
     font-size: 12px;
   }
 }
+
 .YC02 {
   width: 70px;
   height: 60px;
@@ -245,53 +278,67 @@ export default {
   margin-right: 15px;
   margin-top: 15px;
   text-align: center;
+
   .textred {
     color: #d9001b;
   }
+
   .texyellow {
     color: #facd91;
   }
+
   strong {
     display: block;
     font-size: 26px;
     color: #4bffff;
   }
+
   span {
     display: block;
     font-size: 12px;
   }
 }
+
 .YC03 {
   width: 70px;
   height: 60px;
 }
+
 .Tabtab {
   font-size: 12px;
 }
+
 ::v-deep.el-table__cell {
   padding: 2px 0 !important;
 }
+
 ::v-deep.el-table .el-table__cell {
   padding: 2px 0 !important;
 }
+
 ::v-deep.el-table--scrollable-y .el-table__body-wrapper {
   overflow-y: clip !important;
 }
+
 .titleYC {
   font-size: 14px;
   background: #214e5d;
   padding: 5px 0;
+
   span:nth-child(1) {
     margin: 0 70px 0 10px;
   }
 }
+
 .titleJQ {
   font-size: 14px;
   background: #214e5d;
   padding: 5px 0;
+
   span:nth-child(1) {
     margin: 0 15px 0 10px;
   }
+
   span:nth-child(2) {
     margin: 0 45px 0 30px;
   }

+ 2 - 2
vue.config.js

@@ -65,8 +65,8 @@ module.exports = {
     proxy: {
       "/api": {
         // target: "http://192.168.5.4:16200", // 石月
-        // target: "http://192.168.50.235:16200", //内网
-        target: "http://192.168.5.15:16200",
+        target: "http://192.168.50.235:16200", //内网
+        // target: "http://192.168.5.15:16200",
         // target: "http://106.120.102.238:16600", //外网
         changeOrigin: true,
         pathRewrite: {