dedsudiyu 1 月之前
父节点
当前提交
479be4c677
共有 2 个文件被更改,包括 9 次插入8 次删除
  1. 1 4
      src/views/components/mapComponent.vue
  2. 8 4
      src/views/components/subComponent.vue

+ 1 - 4
src/views/components/mapComponent.vue

@@ -141,12 +141,9 @@
                   list.list[o].userOrgName = list.list[o].userOrgName?list.list[o].userOrgName:''
                   list.list[o].rentUserName = !list.list[o].userName?'':(list.list[o].userName.indexOf('-') != -1?list.list[o].userName.split('-')[0]:list.list[o].userName)
                 }else{
-                  list.list[o].headOrgName = list.list[o].headOrgName?list.list[o].headOrgName:''
+                  list.list[o].userOrgName = list.list[o].headOrgName?list.list[o].headOrgName:''
                   list.list[o].rentUserName = !list.list[o].headName?'':(list.list[o].headName.indexOf('-') != -1?list.list[o].headName.split('-')[0]:list.list[o].headName)
                 }
-                //假数据
-                // list.list[o].monitorVisable = true;
-                // list.list[o].subId = '1955554621449019392';
               }
             }
           }

+ 8 - 4
src/views/components/subComponent.vue

@@ -35,7 +35,8 @@
           <p class="title-p">插座用电:</p>
           <p class="for-text-p" :class="item.sensorAlarm?'for-text-p-alarm':''"
              v-for="(item,index) in newData.electricitySensor" :key="index">
-            {{item.deviceName}}:{{item.deviceValue}}{{item.unit}}
+            <span v-if="item.online">{{item.deviceName}}:{{item.deviceValue}}{{item.unit}}</span>
+            <span v-else="item.online">{{item.deviceName}}:离线</span>
           </p>
         </div>
         <!--传感器-->
@@ -47,9 +48,11 @@
                         :icon-class="item.icon"/>
             </div>
             <p class="text-p">
-              <span class="span-1" v-if="item.code != 'yg'">{{item.deviceValue}}</span>
-              <span class="span-2" v-if="item.code != 'yg'">{{item.unit}}</span>
-              <span class="span-3" v-if="item.code == 'yg'">{{item.sensorAlarm?'异常':'正常'}}</span>
+              <span class="span-1" v-if="item.code != 'yg'&&item.online">{{item.deviceValue}}</span>
+              <span class="span-2" v-if="item.code != 'yg'&&item.online">{{item.unit}}</span>
+              <span class="span-2" v-if="item.code != 'yg'&&!item.online">离线</span>
+              <span class="span-3" v-if="item.code == 'yg'&&item.online">{{item.sensorAlarm?'异常':'正常'}}</span>
+              <span class="span-3" v-if="item.code == 'yg'&&!item.online">离线</span>
             </p>
             <p class="name-p">{{item.deviceName}}</p>
           </div>
@@ -96,6 +99,7 @@
         <p class="off-button" @click="showInfo">关闭</p>
       </div>
     </div>
+    <!--报警-->
     <div class="alarm-max-big-shade-box" v-if="alarmType">
       <div class="alarm-big-shade-box">
         <img class="alarm-title-img blink" src="@/assets/ZDimages/img_title.png">