Pārlūkot izejas kodu

新风时间接口放开

Your Name 1 gadu atpakaļ
vecāks
revīzija
336ceafc8e

+ 83 - 28
src/components/SD-school/Spring-frame/roomXinfeng.vue

@@ -30,7 +30,7 @@
                     <span class="type">室内温度:</span>
                     <span class="data">{{SNWD  ? Number(SNWD).toFixed(1) + "℃" : "--"}}</span>
                 </el-col>
-                <el-col class="title">
+                <el-col class="title" >
                     <span class="type">室内湿度:</span>
                     <span class="data">{{SNSD  ? Number(SNSD).toFixed(1) + "%" : "--"}}</span>
                 </el-col>
@@ -42,7 +42,11 @@
                     <span class="type">PM2.5:</span>
                     <span class="data">{{PM2  ? Number(PM2).toFixed(1) + "μg/m³" : "--"}}</span>
                 </el-col>
-                <el-col class="title">
+                 <el-col class="title" v-if="deviceSpecial">
+                    <span class="type">VOC:</span>
+                    <span class="data">{{ VOC == 1 ? "优" : VOC == 2 ? "良" : VOC == 3 ? "差" : "--"}}</span>
+                </el-col>
+                <el-col class="title" v-if="deviceSpecial">
                     <span class="type">运行状态:</span>
                     <el-switch 
                         @change="control('YXZT',YXZT)"
@@ -51,7 +55,16 @@
                         inactive-color="#ccc">
                     </el-switch>
                 </el-col>
-                <el-col class="title">
+                <el-col class="title" v-if="qtSpecialStatus">
+                    <span class="type">运行状态:</span>
+                    <el-switch 
+                        @change="control('22_AHU_B1_01_SBYCQD',YXZTSpecial)"
+                        v-model="YXZTSpecial"
+                        active-color="#1C52D8"
+                        inactive-color="#ccc">
+                    </el-switch>
+                </el-col>
+                <el-col class="title" v-if="deviceSpecial">
                     <span class="type">运行模式:</span>
                     <el-select
                         v-model="YXMS"
@@ -68,7 +81,7 @@
                         />
                         </el-select>
                 </el-col>
-                 <el-col class="title">
+                 <el-col class="title" v-if="deviceSpecial">
                     <span class="type">风量挡位:</span>
                     <el-select
                         v-model="FLDW"
@@ -96,12 +109,16 @@ export default {
     props:['resInfo'],
     data() {
         return {
+            deviceSpecial:true,//特殊设备(泰山厅)
+            qtSpecialStatus:false,//特殊设备(泰山厅启停状态)
+            YXZTSpecial:0,
             state:false,
             dev:null,//设备id
             attributePrefix:null,//属性前缀
             YXZT:null,//运行状态
             YXMS:null,//运行模式
             CO2:null,//
+            VOC:null,//
             FLDW:null,//风量挡位
             PM2:null,//pm2.5
             SNSD:null,//室内湿度
@@ -163,36 +180,57 @@ export default {
         ba(id){
             ba({"deviceId":id}).then(res =>{ 
                 this.state = true
+                 if(id == "ahub101"){
+                    this.deviceSpecial = false
+                    this.qtSpecialStatus = true
+                 }
                 if(res.data){
                     this.Message.sn = res.data.remark
                     let data = JSON.parse(res.data.alarmContent)
+                    console.log(data)
                     this.attributePrefix = `${data[0].m.split("_")[0]}_${data[0].m.split("_")[1]}_`
                     for(let i =0; i<data.length; i++){
-                        let attribute = data[i].m.split("_")[2]
-                        if(attribute == "YXZT"){
-                            this.YXZT = data[i].v == 0 ? false : true
-                        }
-                        if(attribute == "YXMS"){
-                            this.YXMS = data[i].v
-                        }
-                        if(attribute == "FLDW"){
-                            this.FLDW = data[i].v
-                        }
-                        if(attribute == "SNWD"){
-                            this.SNWD = data[i].v
-                        }
-                        if(attribute == "SNSD"){
-                            this.SNSD = data[i].v
-                        }
-                        if(attribute == "PM2"){
-                            this.PM2 = data[i].v
-                        }
-                        if(attribute == "CO2"){
-                            this.CO2 = data[i].v
-                        }
-                        if(attribute == "VOC"){
-                            this.VOC = data[i].v
+                        if(id == "ahub101"){
+                            if(data[i].m.indexOf("SNWD")>-1){
+                                this.SNWD = data[i].v
+                            }
+                            if(data[i].m.indexOf("SNPM2_5")>-1){
+                                this.PM2 = data[i].v
+                            }
+                            if(data[i].m.indexOf("SNCO2")>-1){
+                                this.CO2 = data[i].v
+                            }
+                            if(data[i].m.indexOf("SNSB")>-1){
+                                this.SNSD = data[i].v
+                            }
+                        }else{
+                           let attribute = data[i].m.split("_")[2]
+                            if(attribute == "YXZT"){
+                                this.YXZT = data[i].v == 0 ? false : true
+                            }
+                            if(attribute == "YXMS"){
+                                this.YXMS = data[i].v
+                            }
+                            if(attribute == "FLDW"){
+                                this.FLDW = data[i].v
+                            }
+                            if(attribute == "SNWD"){
+                                this.SNWD = data[i].v
+                            }
+                            if(attribute == "SNSD"){
+                                this.SNSD = data[i].v
+                            }
+                            if(attribute == "PM2"){
+                                this.PM2 = data[i].v
+                            }
+                            if(attribute == "CO2"){
+                                this.CO2 = data[i].v
+                            }
+                            if(attribute == "VOC"){
+                                this.VOC = data[i].v
+                            } 
                         }
+                        
                        
                     }
                 }
@@ -215,6 +253,23 @@ export default {
                 });
             })
         },
+        control2(m,v){//控制
+            let arr = {
+                "type":"cmd/set",
+                "data":{
+                    "dev":this.dev,
+                    "m":m,
+                    "v":v == true ? 1 : v == false ? 0 : v
+                },
+                
+            }
+            revise({"message":JSON.stringify(arr),"sn":this.Message.sn}).then(res =>{ 
+                Message({
+                    message:"信息已提交,请在2分钟后查看信息变更情况",
+                    type: 'success'
+                });
+            })
+        },
         noPermitInput(e){      
             var evt = window.event || e ;    
             if(isIE()){    

+ 15 - 12
src/components/SD-school/xinfen/index.vue

@@ -20,7 +20,7 @@
         <div class="title">室外</div>
         <el-row v-for="(item,index) in shiwai" :key="index" >
             <el-col :span=8>{{item.name}}</el-col>
-            <el-col :span=8>{{item.value}}</el-col>
+            <el-col :span=8>{{item.value == "优质" ? "优" : item.value }}</el-col>
             <el-col :span=8>{{item.unit}}</el-col>
           </el-row>
       </el-col>
@@ -41,17 +41,19 @@ export default {
       totleNumber:0,
       annormalNumber:0,
       shinei:[
-        {name:"co2:",value:0,unit:"PPM"},
+        {name:"voc:",value:"优",unit:""},
         {name:"PM2.5:",value:0,unit:"ug/m³"},
         {name:"温度:",value:0,unit:"℃"},
         {name:"湿度:",value:0,unit:"RH%"},
-        {name:"voc:",value:"优",unit:""},
+        {name:"co2:",value:0,unit:"PPM"},
+        
       ],
       shiwai:[
+        {name:"空气质量:",value:"优",unit:""},
         {name:"PM2.5:",value:0,unit:"ug/m³"},
         {name:"温度:",value:0,unit:"℃"},
         {name:"湿度:",value:0,unit:"RH%"},
-        {name:"空气质量:",value:"优",unit:""},
+        
       ],
       status:true,
     };
@@ -80,15 +82,16 @@ export default {
               productCode: "511_XFFJ",
               startTime: (dayjs().format('YYYY-MM-DD HH:mm:ss')).split(" ")[0] + " 00:00:00"
             },
-            timeout: 3000,
+            timeout: 30000,
         }).then(res=>{
           if(res.data.data.length>0){
             let data1 = res.data.data[0]
-            this.shinei[0].value = data1.co2
+            this.shinei[0].value = data1.voc
             this.shinei[1].value = data1.pm2_5
             this.shinei[2].value = data1.wd
             this.shinei[3].value = data1.sd
-            this.shinei[4].value = data1.voc
+            this.shinei[4].value = data1.co2
+            
           }
         })
         axios({
@@ -107,14 +110,14 @@ export default {
               productCode: "511_XFFJ",
               startTime: (dayjs().format('YYYY-MM-DD HH:mm:ss')).split(" ")[0] + " 00:00:00"
             },
-            timeout: 3000,
+            timeout: 30000,
         }).then(res=>{
           if(res.data.data.length>0){
             let data2 = res.data.data[0]
-            this.shiwai[0].value = data2.pm2_5
-            this.shiwai[1].value = data2.wd
-            this.shiwai[2].value = data2.sd
-            this.shiwai[3].value = data2.quality
+            this.shiwai[0].value = data2.quality
+            this.shiwai[1].value = data2.pm2_5
+            this.shiwai[2].value = data2.wd
+            this.shiwai[3].value = data2.sd
           }
         })
     },

+ 1 - 1
src/plugins/request.js

@@ -8,7 +8,7 @@ const service = axios.create({
     //baseURL: "http://172.16.120.104:8089/", //本地
     baseURL: "http://10.108.34.2:80/sdpart/", //山东
     // 超时
-    timeout: 10000
+    timeout: 100000
 })
 
 // request拦截器