dedsudiyu 2 年 前
コミット
34d56a1d38
共有1 個のファイルを変更した29 個の追加6 個の削除を含む
  1. 29 6
      src/views/comprehensive/laboratoryManagement/subject/index.vue

+ 29 - 6
src/views/comprehensive/laboratoryManagement/subject/index.vue

@@ -152,7 +152,7 @@
                       <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4" >{{item.state.name}}</p>
                     </div>
                     <div class="switch-for-min-box_b">
-                      <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
+                      <p class="switch-null-ventilate"></p>
                       <el-switch
                         v-if="item.state.code == 3||item.state.code == 4"
                         class="switch"
@@ -169,9 +169,10 @@
                   <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'AI_VENTILATION'">
                     <div class="switch-for-min-box_t">
                       <p class="switch-for-min-title">{{item.hardwareName}}</p>
-                      <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4">{{item.state.name}}</p>
+                      <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4 && item.pcType == 0">{{item.state.name}}</p>
+                      <p class="switch-pc-type-p" v-if="item.pcType == 1" @click="tableButton(item)">操作</p>
                     </div>
-                    <div class="switch-for-min-box_b">
+                    <div class="switch-for-min-box_b" v-if="item.pcType == 0">
                       <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
                       <el-switch
                         v-if="item.state.code == 3||item.state.code == 4"
@@ -187,8 +188,8 @@
                     </div>
                   </div>
                   <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'ONE_MACHINE'">
-                  <p class="switch-for-min-title">广播系统</p>
-                  <p class="switch-for-min-button" @click="handleAdd(item.subId)">播放文字</p>
+                    <p class="switch-for-min-title">广播系统</p>
+                    <p class="switch-for-min-button" @click="handleAdd(item.subId)">播放文字</p>
                   </div>
                 </div>
               </div>
@@ -314,6 +315,7 @@
 </template>
 
 <script>
+import { controlSwitch } from "@/api/laboratory/hardware";
 import mqtt from 'mqtt'
 import flvjs from 'flv.js'
 import { hardWareControl,alarmControl } from "@/api/laboratory/hardware";
@@ -452,6 +454,20 @@ export default {
     // this.queryHardByTypeList();
   },
   methods:{
+    tableButton(row){
+      let self = this;
+      this.$confirm(`是否确认操作此设备`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(async () => {
+        controlSwitch({id:row.id}).then(response => {
+          self.msgSuccess(response.msg);
+        });
+      }).catch(() => {
+
+      })
+    },
     //查询当前用户下的预案触发数据
     selectTriggerFun(data){
       let self = this;
@@ -1091,7 +1107,8 @@ export default {
                     } else if (data.data[i].hardwareOperate == 'OFFLINE') {
                       self.checkedSubject.VOlist[k].state.code = 0;
                     }
-                    if(self.checkedSubject.VOlist[k].hardwareTypeEnum.hardwareTypeCode == '2'){
+                    if(self.checkedSubject.VOlist[k].hardwareTypeEnum.hardwareTypeCode == '2'&&
+                      self.checkedSubject.VOlist[k].pcType == '0'){
                       self.subjectTriggerModes(self.checkedSubject.VOlist[k])
                     }
                   }
@@ -1448,6 +1465,12 @@ export default {
                     line-height:24px;
                     color:#999;
                   }
+                  .switch-pc-type-p{
+                    font-size:14px;
+                    line-height:24px;
+                    color:#0183fa;
+                    cursor: pointer;
+                  }
                 }
                 .switch-for-min-box_b{
                   margin-top: 10px;