|
|
|
@ -12,7 +12,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-9 align-self-center">
|
|
|
|
|
<div class="row" style="line-height:28px;">
|
|
|
|
|
<span class="badge badge-info" style="line-height:26px;" v-if="getDeviceDataValue(this.device, '电量')">{{electricity}} kW‧h</span>
|
|
|
|
|
<span class="badge badge-info" style="line-height:26px; margin:0 10px 0 0" v-if="getDeviceDataValue(this.device, '电量')">{{electricity}} kW‧h</span>
|
|
|
|
|
<span class="badge badge-info" style="line-height:26px; margin:0 10px 0 0" >{{power}} W</span>
|
|
|
|
|
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')==='开'" v-on:click="execApi(device.number,'/Socket/Off')" :src="config.apigateway+'/IoTCenter/images/on.png'" />
|
|
|
|
|
<img style="height:32px;" v-else="getDeviceDataValue(device,'状态')==='关'" v-on:click="execApi(device.number,'/Socket/On')" :src="config.apigateway+'/IoTCenter/images/off.png'" />
|
|
|
|
|
</div>
|
|
|
|
@ -26,7 +27,12 @@
|
|
|
|
|
props: ['device'],
|
|
|
|
|
computed: {
|
|
|
|
|
electricity: function () {
|
|
|
|
|
console.log('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-electricity');
|
|
|
|
|
return parseFloat(getDeviceDataValue(this.device, '电量')||0).toFixed(2);
|
|
|
|
|
},
|
|
|
|
|
power: function (){
|
|
|
|
|
console.log('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-power');
|
|
|
|
|
return parseFloat(getDeviceDataValue(this.device, '功率')||0).toFixed(2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|