Bläddra i källkod

温湿度查询

chenyue 3 år sedan
förälder
incheckning
aea4c1894c
1 ändrade filer med 15 tillägg och 29 borttagningar
  1. 15 29
      mini-pro-web/src/views/device/temperature/index.vue

+ 15 - 29
mini-pro-web/src/views/device/temperature/index.vue

@ -162,8 +162,19 @@ export default{
            })
        },
        initMain(){
            medicineAbinetApi.getHumidity({}).then(res=>{
            medicineAbinetApi.findDeviceById({deviceId: this.$route.query.id}).then(res=>{
                if(res.status==200){
                    console.log(res);
                    this.form.humidity = res.obj.device.humidity;
                    this.form.humiditycontrol = res.obj.device.humidity?true:false;
                    this.form.temperature = res.obj.device.temperature;
                    this.form.temperaturecontrol = res.obj.device.temperaturecontrol?true:false;
                    this.form.heat = res.obj.device.heat?true:false;
                    this.form.waringHumidityHeight = res.obj.device.waringHumidityHeight;
                    this.form.warningTemperatureHeight = res.obj.device.warningTemperatureHeight;
                    this.form.warningTemperatureLow = res.obj.device.warningTemperatureLow;
                    this.form.waringHumidityLow = res.obj.device.waringHumidityLow;
                }
            }).catch(err=>{
                
            })
@ -171,35 +182,10 @@ export default{
    },
    created(){
        let vm = this;
        this.$EventBus.$on('openTemperature',(e)=>{
            if(e.status){
                Object.assign(vm.form, e.detail)
                vm.checked1 = true
            }else{
                vm.checked1 = false
            }
        })
        this.$EventBus.$on('openSecurity',(e)=>{
            if(e.status){
                Object.assign(vm.form, e.detail)
                vm.checked2 = true
            }else{
                vm.checked2 = false
            }
        })
        this.$EventBus.$on('openHumidity',(e)=>{
            if(e.status){
                Object.assign(vm.form, e.detail)
                vm.checked3 = true
            }else{
                vm.checked3 = false
            }
        })
        this.initMain();
    },
    beforeDestroy(){
        this.$EventBus.$off('openTemperature');
        this.$EventBus.$off('openSecurity');
        this.$EventBus.$off('openHumidity')
        
    }
}
</script>