dedsudiyu 11 月之前
父節點
當前提交
7694d2f918

+ 31 - 4
src/views/integratedManagement/laboratoryManagement/subject/indexRightPage/hardwarePage.vue

@@ -3,20 +3,47 @@
   <div class="indexRightPage-hardwarePage scrollbar-box">
     <img class="null-img" src="@/assets/ZDimages/basicsModules/null-data-1.png" v-if="!hardwareList[0]">
     <div class="for-hardware-max-big-box scrollbar-box">
-      <div class="for-hardware-big-box" :class="!item.online?'offLineColor':'onLineColor'"
+      <!--<div class="for-hardware-big-box" :class="!item.online?'offLineColor':'onLineColor'"-->
+           <!--v-for="(item,index) in hardwareList" :key="index">-->
+        <!--<div class="for-hardware-box">-->
+          <!--<div class="for-hardware-text-box" >-->
+            <!--<el-tooltip class="item" effect="dark" :content="item.hardwareName" placement="bottom">-->
+              <!--<p>{{item.hardwareName}}</p>-->
+            <!--</el-tooltip>-->
+            <!--<p v-if="!item.online">离线</p>-->
+          <!--</div>-->
+          <!--<div class="for-hardware-switch-box">-->
+            <!--<div class="for-hardware-switch-title">-->
+              <!--<p v-if="item.online && item.operatingState && item.reservedThree">{{item.reservedThree}}</p>-->
+            <!--</div>-->
+            <!--<div class="for-hardware-switch" v-if="item.online">-->
+              <!--<el-switch-->
+                <!--class="switch"-->
+                <!--@click.native="changeIsNeedCaptcha(item)"-->
+                <!--v-model="item.operatingState"-->
+                <!--:active-value="true"-->
+                <!--:inactive-value="false"-->
+                <!--active-text="开启"-->
+                <!--inactive-text="关闭"-->
+                <!--disabled>-->
+              <!--</el-switch>-->
+            <!--</div>-->
+          <!--</div>-->
+        <!--</div>-->
+      <!--</div>-->
+      <div class="for-hardware-big-box onLineColor"
            v-for="(item,index) in hardwareList" :key="index">
         <div class="for-hardware-box">
           <div class="for-hardware-text-box" >
             <el-tooltip class="item" effect="dark" :content="item.hardwareName" placement="bottom">
               <p>{{item.hardwareName}}</p>
             </el-tooltip>
-            <p v-if="!item.online">离线</p>
           </div>
           <div class="for-hardware-switch-box">
             <div class="for-hardware-switch-title">
-              <p v-if="item.online && item.operatingState && item.reservedThree">{{item.reservedThree}}</p>
+              <p v-if="item.operatingState && item.reservedThree">{{item.reservedThree}}</p>
             </div>
-            <div class="for-hardware-switch" v-if="item.online">
+            <div class="for-hardware-switch">
               <el-switch
                 class="switch"
                 @click.native="changeIsNeedCaptcha(item)"

+ 5 - 5
src/views/integratedManagement/laboratoryManagement/subject/infoPage.vue

@@ -106,7 +106,6 @@
           <div class="things-for-box">
             <p class="left-title">{{item.hardwareName}}</p>
             <el-switch
-              v-if="item.online"
               class="switch"
               @click.native="changeIsNeedCaptcha(item)"
               v-model="item.operatingState"
@@ -116,7 +115,6 @@
               inactive-text="关闭"
               disabled>
             </el-switch>
-            <p class="switch-null-p" v-else>离线</p>
           </div>
         </div>
         <img class="null-data-img" src="@/assets/ZDimages/basicsModules/null-data-1.png" v-if="!hardwareList[0]">
@@ -513,6 +511,7 @@
           this.hardwareClient.on("message", (topic, message) => {
             if (message){
               let data = JSON.parse(message)
+              // console.log('硬件-mqtt',message)
               let list = JSON.parse(JSON.stringify(this.hardwareList))
               list.forEach((item)=>{
                 if(item.hardwareNo == data.hardwareNo){
@@ -727,14 +726,15 @@
         }
       }
       .things-box{
-        width:210px;
+        width:200px;
         height:30px;
         display: inline-block;
         margin-bottom:10px;
+        margin-right:40px;
         .things-for-box{
           display: flex;
           .left-title{
-            width: 110px;
+            flex:1;
             font-size:14px;
             color:#333;
             line-height:30px;
@@ -760,7 +760,7 @@
             color:#0045af;
             font-size:14px;
             text-align: center;
-            width:100px;
+            width:80px;
           }
         }
       }