Former-commit-id: 79b8ee474c30db9589d59f2211fdf7a9c75258ea Former-commit-id: 9b62ffa23964c724f9a3307a76797c0a7fa44dd81.0
parent
711936bc62
commit
af33c70a53
@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<div class="card device-component">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
{{device.displayName}}
|
||||
<i v-if="device.isOnline" class="text-success ion ion-ios-wifi"></i>
|
||||
<i v-else class="text-danger ion ion-ios-wifi"></i>
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<span @click="visible = true" title="操作"><i class="ion ion-md-settings"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-4 align-self-center">
|
||||
<img class="device-image" :src="device.ioTProduct.image" />
|
||||
</div>
|
||||
<div class="col-8 align-self-center">
|
||||
<div class="row" style="line-height:28px;">
|
||||
<span>
|
||||
状态:
|
||||
<span class="status">
|
||||
{{status()}}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a-modal v-model="visible" :title="device.displayName" :footer="null">
|
||||
<img style="height:32px;" v-on:click="open()" src="/platform/images/on.svg" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
({
|
||||
props: ['device'],
|
||||
data: function () {
|
||||
return {
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
status: function () {
|
||||
return getIoTDataValue(this.device, '状态') === '1' ? '开' : '关';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open: function () {
|
||||
var password = prompt("请输入密码开锁", '');
|
||||
if (password && password !== '') {
|
||||
this.execApi(this.device.number, '/Door/Open', 'password=' + password);
|
||||
}
|
||||
},
|
||||
close: function () {
|
||||
var password = prompt("请输入密码关锁", '');
|
||||
if (password && password !== '') {
|
||||
this.execApi(this.device.number, '/Door/Close', 'password=' + password);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Reference in new issue