You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.8 KiB
42 lines
1.8 KiB
<template>
|
|
<div class="card" style="box-sizing:border-box;height:150px;margin:10px;">
|
|
<div class="card-header">
|
|
{{device.displayName}}
|
|
<span class="float-right text-success" v-if="device.isOnline"><i class="ion ion-ios-wifi"></i></span>
|
|
<span class="float-right text-danger" v-else><i class="ion ion-ios-wifi"></i></span>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row" style="height:100%;width:300px;margin: 0 auto;">
|
|
<div class="col-4 align-self-center">
|
|
<img class="mh-100" :src="device.product.image" style="width:48px;" />
|
|
</div>
|
|
<div class="col-8 align-self-center">
|
|
<div class="row" style="line-height:28px;">
|
|
<!--<span class="badge badge-info" style="line-height:26px;">{{getDeviceDataValue(device,'状态')}}</span>-->
|
|
<img style="height:32px;" v-on:click="open" src="/images/on.svg" />
|
|
<!--<img style="height:32px;" v-on:click="close" src="/IoTCenter/images/off.svg" />-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
props: ['device'],
|
|
methods: {
|
|
open: function () {
|
|
var password = prompt("请输入密码开锁", '');
|
|
if (password && password !== '') {
|
|
execApi(this.device.number, '/Door/Open', 'password=' + password);
|
|
}
|
|
},
|
|
close: function () {
|
|
var password = prompt("请输入密码关锁", '');
|
|
if (password && password !== '') {
|
|
execApi(this.device.number, '/Door/Close', 'password=' + password);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script> |