Former-commit-id: 70aff9c0ca83d94c4f9a3735a2c4699be017d3d4
TangShanKaiPing
wanggang 6 years ago
parent 5f44350bce
commit fb56ce6edd

@ -7,21 +7,284 @@
h3 img {
height: 16px;
}
</style>
<style>
.box-tools img, .box-body img {
height: 32px;
cursor: pointer;
}
.content-wrapper {
background-color: lightblue;
}
input.switch {
display: none;
}
label.switch {
display: inline-block;
width: 60px;
height: 30px;
border-radius: 30px;
}
label.switch.on {
background-color: green;
}
label.switch.off {
background-color: grey;
}
label.switch.on::before {
content: '';
display: block;
width: 30px;
height: 30px;
border-radius: 30px;
background-color: white;
position: absolute;
left: 0;
}
label.switch.off::after {
content: '';
display: block;
width: 30px;
height: 30px;
border-radius: 30px;
background-color: white;
position: absolute;
right: 0;
}
.danger {
color: red;
}
.normal {
color: green;
}
.ptz {
width: 100%;
}
.ptz td {
text-align: center;
height: 53px;
}
form .label1 {
display: inline-block;
padding-right: 5px;
line-height: 50px;
vertical-align: middle;
}
.ir label input {
display: none;
}
.ir td {
width: 11%;
text-align: center;
}
.keyboard {
table-layout: fixed;
}
label.button {
display: inline-block;
padding: 0 10px;
line-height: 30px;
background-color: cadetblue;
color: #FFF;
vertical-align: middle;
border-radius: 15px;
text-align: center;
}
input[type=range] {
padding: 0 10px;
-webkit-appearance: none;
height: 50px;
}
input[type=range]::-webkit-slider-runnable-track {
width: 300px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 20px;
width: 20px;
border-radius: 30%;
background-color: #3d9970 !important;
margin-top: -6px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
canvas {
width: 100%;
height: 215px;
}
.ir label {
margin: 5px 0;
}
</style>
<template v-if="model">
<div class="row">
<!--场景-->
<div class="col-md-12">
<div v-if="model" class="callout callout-success">
<h4>{{model.Name}}</h4>
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title"><img src="/images/batch.png" style="height:16px;margin-right:10px;" />{{model.Name}}</h3>
</div>
<div class="box-body">
<button class="btn bg-olive margin ajax Scene" v-for="scene in model.Scenes" :data-scene-id="scene.Id">{{scene.Name}}</button>
</div>
</div>
</div>
<!--环境-->
<template v-for="device in GetDevices('温湿度传感器')">
<div class="col-md-3 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/temperature.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'温度','Description')==='适中'?'normal':'danger'">
{{GetDeviceDataValue(device.Number,'温度','Description')}}
</h3>
</div>
</div>
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">温度:{{GetDeviceDataValue(device.Number,'温度','Value')}}{{ GetDeviceDataValue(device.Number,'温度','Unit')}}</span>
</div>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/humidity.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'湿度','Description')==='适中'?'normal':'danger'">
{{GetDeviceDataValue(device.Number,'湿度','Description')}}
</h3>
</div>
</div>
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">湿度:{{GetDeviceDataValue(device.Number,'湿度','Value')}}{{ GetDeviceDataValue(device.Number,'温度','Unit')}}</span>
</div>
</div>
</div>
</template>
<template v-for="device in GetDevices('光强检测器')">
<div class="col-md-3 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/pm25.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'PM2.5','Description')==='污染'?'danger':'normal'">
{{GetDeviceDataValue(device.Number,'PM2.5','Description')}}
</h3>
</div>
</div>
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">PM2.5{{GetDeviceDataValue(device.Number,'PM2.5','Value')}}{{ GetDeviceDataValue(device.Number,'PM2.5','Unit')}}</span>
</div>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/pm25.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'PM10','Description')==='污染'?'danger':'normal'">
{{GetDeviceDataValue(device.Number,'PM10','Description')}}
</h3>
</div>
</div>
<div class="row" v-if="model">
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">PM10{{GetDeviceDataValue(device.Number,'PM10','Value')}}{{ GetDeviceDataValue(device.Number,'PM10','Unit')}}</span>
</div>
</div>
</div>
</template>
<div class="col-md-3 col-xs-6" v-for="device in GetDevices('光强检测器')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/light.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'光照度','Description')==='适中'?'normal':'danger'">
{{GetDeviceDataValue(device.Number,'光照度','Description')}}
</h3>
</div>
</div>
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">光照 {{GetDeviceDataValue(device.Number,'光照度','Value')}}{{ GetDeviceDataValue(device.Number,'光照度','Unit')}}</span>
</div>
</div>
</div>
<div class="col-md-3 col-xs-6" v-for="device in GetDevices('红外感应器')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/person.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<img src="/images/warn.png" style="width:36px;height:36px;margin:32px 0 0 0;" v-if="GetDeviceDataValue(device.Number,'状态','Value')==='警报'" />
<h3 style="line-height:100px;margin:0;" class="normal" v-else>正常</h3>
</div>
</div>
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">红外 {{GetDeviceDataValue(device.Number,'状态','Value') }}</span>
</div>
</div>
</div>
<div class="col-md-3 col-xs-6" v-for="device in GetDevices('烟雾传感器')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4" style="text-align:center;">
<img src="/images/smoke.png" style="max-width:48px;margin-top:19px;" />
</div>
<div class="col-md-8 col-xs-8" style="height:100px;">
<img src="/images/warn.png" style="width:36px;height:36px;margin:32px 0 0 0;" v-if="GetDeviceDataValue(device.Number,'状态','Value')==='警报'" />
<h3 style="line-height:100px;margin:0;" class="normal" v-else>正常</h3>
</div>
</div>
<div class="row">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">烟雾 {{GetDeviceDataValue(device.Number,'状态','Value') }}</span>
</div>
</div>
</div>
</div>
<div class="row">
<!--摄像头-->
<div class="col-md-6">
<template v-if="HasDevices('摄像头')">
<div class="row">
@ -71,50 +334,9 @@
</div>
</div>
</template>
<template v-for="device in GetDevices('色暖灯')">
<div class="row">
<div class="col-md-12">
<div class="box box-solid btns">
<div class="box-header with-border">
<h3 class="box-title"><img src="/images/light2.png" style="height:16px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>
<div class="box-tools pull-right">
<img v-if="GetDataValue(device.Number,'状态')=='开'" v-on:click="CallApi(device.Number,'/WarmLight/Off')" src="/images/on.png" />
<img v-if="GetDataValue(device.Number,'状态')=='关'" v-on:click="CallApi(device.Number,'/WarmLight/On')" src="/images/off.png" />
</div>
</div>
<div class="box-body" style="height:178px;">
<form method="get" action="/App/ExecApi">
<input type="hidden" name="Number" :value="device.Number" />
<input type="hidden" name="Method" value="/WarmLight/SetBrightness" />
<div class="row">
<div class="col-md-2 col-xs-4">
<span class="label1">亮度</span>
</div>
<div class="col-md-10 col-xs-8">
<input v-on:change="AjaxSubmit($event,device.Number,'亮度')" type="range" min="0" step="1" max="255" name="Brightness" :value="GetDataValue(device.Number,'亮度')" />
</div>
</div>
</form>
<form method="get" action="/App/ExecApi">
<input type="hidden" name="Number" :value="device.Number" />
<input type="hidden" name="Method" value="/WarmLight/SetColor" />
<input type="hidden" name="Saturation" :value="GetDataValue(device.Number,'饱和度')" />
<div class="row">
<div class="col-md-2 col-xs-4">
<span class="label1">色调</span>
</div>
<div class="col-md-10 col-xs-8">
<input v-on:change="AjaxSubmit($event,device.Number,'色调')" type="range" min="0" step="1" max="255" name="Hue" :value="GetDataValue(device.Number,'色调')" />
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</template>
<template v-for="device in GetDevices('调色灯')">
<!--调色灯-->
<div class="col-md-6" v-for="device in GetDevices('调色灯')">
<div class="row">
<div class="col-md-12">
<div class="box box-solid btns">
@ -167,9 +389,9 @@
</div>
</div>
</div>
</template>
<template v-for="device in GetDevices('红外转发器')">
</div>
<!--红外转发器-->
<div class="col-md-6" v-for="device in GetDevices('红外转发器')">
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
@ -355,11 +577,11 @@
</div>
</div>
</div>
</template>
</div>
<div class="col-md-6">
</div>
<div class="row">
<div class="col-md-12">
<!--批量操作-->
<div class="col-md-12" v-if="model.Scenes&&model.Scenes.length>0">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title"><img src="/images/batch.png" style="height:16px;margin-right:10px;" />批量操作</h3>
@ -368,159 +590,14 @@
<button class="btn btn-sm bg-olive ajax NodePowerOff" :data-node-number="model.Number">一键关</button>
</div>
</div>
<div class="box-body" style="height:178px;">
<div class="box-body">
<button class="btn bg-olive margin ajax SwitchOn">开灯</button>
<button class="btn bg-olive margin ajax SwitchOff">关灯</button>
<button class="btn bg-olive margin ajax SwitchOn">开关开</button>
<button class="btn bg-olive margin ajax SwitchOff">开关关</button>
<button class="btn bg-olive margin ajax SocketOn">插座开</button>
<button class="btn bg-olive margin ajax SocketOff">插座关</button>
<br />
<button class="btn bg-olive margin ajax Scene" v-for="scene in model.Scenes" :data-scene-id="scene.Id">{{scene.Name}}</button>
<br />
<template v-for="device in model.Devices">
<button class="btn bg-olive margin ajax Command" v-for="command in device.Commands" :data-command-id="command.Id">{{command.Name}}</button>
</template>
</div>
</div>
</div>
</div>
<div class="row" v-for="device in GetDevices('粉尘检测器')" :data-device-number="device.Number">
<div class="col-md-6 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/temperature.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'温度','Description')==='适中'?'normal':'danger'">
{{GetDeviceDataValue(device.Number,'温度','Description')}}
</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">温度:{{GetDeviceDataValue(device.Number,'温度','Value')}}{{ GetDeviceDataValue(device.Number,'温度','Unit')}}</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/humidity.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'湿度','Description')==='适中'?'normal':'danger'">
{{GetDeviceDataValue(device.Number,'湿度','Description')}}
</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">湿度:{{GetDeviceDataValue(device.Number,'湿度','Value')}}{{ GetDeviceDataValue(device.Number,'温度','Unit')}}</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/pm25.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'PM2.5','Description')==='污染'?'danger':'normal'">
{{GetDeviceDataValue(device.Number,'PM2.5','Description')}}
</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">PM2.5{{GetDeviceDataValue(device.Number,'PM2.5','Value')}}{{ GetDeviceDataValue(device.Number,'PM2.5','Unit')}}</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/pm25.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'PM10','Description')==='污染'?'danger':'normal'">
{{GetDeviceDataValue(device.Number,'PM10','Description')}}
</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">PM10{{GetDeviceDataValue(device.Number,'PM10','Value')}}{{ GetDeviceDataValue(device.Number,'PM10','Unit')}}</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6" v-for="device in GetDevices('光强检测器')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/light.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<h3 style="line-height:100px;margin:0;" :class="GetDeviceDataValue(device.Number,'光照度','Description')==='适中'?'normal':'danger'">
{{GetDeviceDataValue(device.Number,'光照度','Description')}}
</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">{{device.DisplayName||device.Name}} 光照 {{GetDeviceDataValue(device.Number,'光照度','Value')}}{{ GetDeviceDataValue(device.Number,'光照度','Unit')}}</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6" v-for="device in GetDevices('红外感应器')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/person.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<img src="/images/warn.png" style="width:36px;height:36px;margin:32px 0 0 0;" v-if="GetDeviceDataValue(device.Number,'状态','Value')==='警报'" />
<h3 style="line-height:100px;margin:0;" class="normal" v-else>正常</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">{{device.DisplayName||device.Name}} {{GetDeviceDataValue(device.Number,'状态','Value') }}</span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6" v-for="device in GetDevices('烟雾传感器')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="row">
<div class="col-md-4 col-xs-4">
<img src="/images/smoke.png" style="width:48px;height:48px;margin:19px;" />
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<img src="/images/warn.png" style="width:36px;height:36px;margin:32px 0 0 0;" v-if="GetDeviceDataValue(device.Number,'状态','Value')==='警报'" />
<h3 style="line-height:100px;margin:0;" class="normal" v-else>正常</h3>
</div>
<div class="col-md-4 col-xs-4" style="height:100px;">
<span style="display:inline-block;position:absolute;right:20px;bottom:5px;white-space: nowrap;">{{device.DisplayName||device.Name}} {{GetDeviceDataValue(device.Number,'状态','Value') }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-xs-6 control" v-for="device in GetDevices('窗帘')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title"><img src="/images/curtain.png" style="height:16px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>
<div class="box-tools pull-right">
{{GetDataValue(device.Number,'状态')}}
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12">
<div class="row" style="text-align:center;padding:3px 0;">
<img style="height:32px;" v-on:click="CallApi(device.Number,'/Curtain/On')" src="/images/left.png" />
<img style="height:32px;" v-on:click="CallApi(device.Number,'/Curtain/Stop')" src="/images/stop.png" />
<img style="height:32px;" v-on:click="CallApi(device.Number,'/Curtain/Off')" src="/images/right.png" />
</div>
</div>
</div>
</div>
</div>
</div>
@ -589,6 +666,23 @@
</div>
</div>
</div>
<div class="col-md-3 col-xs-6 control" v-for="device in GetDevices('插座')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title"><img src="/images/socket.png" style="height:16px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12">
<div class="row" style="text-align:center;padding:3px 0;">
<img v-if="GetDataValue(device.Number,'状态')==='开'" v-on:click="CallApi(device.Number,'/Socket/Off')" src="/images/on.png" :data-status="GetDataValue(device.Number,'状态')" />
<img v-if="GetDataValue(device.Number,'状态')==='关'" v-on:click="CallApi(device.Number,'/Socket/On')" src="/images/off.png" :data-status="GetDataValue(device.Number,'状态')" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-xs-6 control" v-for="device in GetDevices('智能插座')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="box-header with-border">
@ -609,17 +703,21 @@
</div>
</div>
</div>
<div class="col-md-3 col-xs-6 control" v-for="device in GetDevices('插座')" :data-device-number="device.Number">
<div class="col-md-3 col-xs-6 control" v-for="device in GetDevices('窗帘')" :data-device-number="device.Number">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title"><img src="/images/socket.png" style="height:16px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>
<h3 class="box-title"><img src="/images/curtain.png" style="height:16px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>
<div class="box-tools pull-right">
{{GetDataValue(device.Number,'状态')}}
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12">
<div class="row" style="text-align:center;padding:3px 0;">
<img v-if="GetDataValue(device.Number,'状态')==='开'" v-on:click="CallApi(device.Number,'/Socket/Off')" src="/images/on.png" :data-status="GetDataValue(device.Number,'状态')" />
<img v-if="GetDataValue(device.Number,'状态')==='关'" v-on:click="CallApi(device.Number,'/Socket/On')" src="/images/off.png" :data-status="GetDataValue(device.Number,'状态')" />
<img style="height:32px;" v-on:click="CallApi(device.Number,'/Curtain/On')" src="/images/left.png" />
<img style="height:32px;" v-on:click="CallApi(device.Number,'/Curtain/Stop')" src="/images/stop.png" />
<img style="height:32px;" v-on:click="CallApi(device.Number,'/Curtain/Off')" src="/images/right.png" />
</div>
</div>
</div>
@ -627,6 +725,7 @@
</div>
</div>
</div>
</template>
</div>
@section scripts{
<script src="/js/node.js"></script>

Binary file not shown.

@ -211,6 +211,14 @@ function updateItem(list, item) {
list.push(item);
}
}
function deleteItem(list, item) {
for (var i = 0; i < list.length; i++) {
if (list[i].Id == item.Id) {
list.splice(i, 1);
break;
}
}
}
/*event*/
$(document).on('change', '#camera', function (e) {
UpdateCamera()
@ -258,13 +266,19 @@ connection.on("ServerToClient", function (method, json, from) {
onMessage(method, json, from);
});
function onMessage(method, json, from) {
if (method == 'DataEntityInserted' ||
method == 'DataEntityUpdated') {
var data = JSON.parse(json);
var device = Enumerable.from(vm.model.Devices).firstOrDefault(function (o) { return o.Id === data.DeviceId; })
var item = JSON.parse(json);
if (method == 'DataEntityInserted' || method == 'DataEntityUpdated') {
var device = Enumerable.from(vm.model.Devices).firstOrDefault(function (o) { return o.Id === item.DeviceId; })
if (device) {
updateItem(device.Data, data);
updateItem(device.Data, item);
}
}
else if (method == 'SceneEntityInserted' ||method == 'SceneEntityUpdated') {
updateItem(vm.model.Scenes, item);
}
else if (method == 'SceneEntityDeleted') {
deleteItem(vm.model.Scenes, item);
}
}
/*vue*/
@ -327,6 +341,14 @@ function init() {
}
return null;
},
GetDeviceDataValue(number, name, attr) {
var device = Enumerable.from(this.model.Devices).where(function (o) { return o.Number === number; }).firstOrDefault();
var data = Enumerable.from(device.Data).where(o => o.Name === name).firstOrDefault();
if (data != null) {
return data[attr];
}
return null;
},
CameraSelected() {
console.log('camera selected:' + new Date());
UpdateCamera();

Binary file not shown.
Loading…
Cancel
Save