|
@ -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>
|