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.
44 lines
1.2 KiB
44 lines
1.2 KiB
isDebug = true;
|
|
useSignalR = true;
|
|
dataUrl = iotCenter + '/App/GetNodes';
|
|
data = function data() {
|
|
return {
|
|
f7params: f7params,
|
|
server: localStorage.getItem('server'),
|
|
token: localStorage.getItem('token'),
|
|
model: {
|
|
Products: [],
|
|
Scenes: []
|
|
}
|
|
};
|
|
}
|
|
methods = {
|
|
GetNodes() {
|
|
return Enumerable.from(this.model).orderBy('o=>o.DisplayOrder').toArray();
|
|
},
|
|
SelectNode: Select,
|
|
Power(method) {
|
|
var numbers = [];
|
|
$('.item:checked').each(function () {
|
|
numbers.push($(this).val());
|
|
});
|
|
if (numbers.length) {
|
|
ajax('/App/Power', { token: token, connectionId: connectionId, method: method, numbers: numbers }, 'post');
|
|
}
|
|
else {
|
|
toastr.error('没有选中任何项');
|
|
}
|
|
}
|
|
};
|
|
function onMessage(method, json, to, from) {
|
|
debug(method + ':' + json);
|
|
var item = JSON.parse(json);
|
|
console.log(method + ':' + json);
|
|
var item = JSON.parse(json);
|
|
if (method == 'DeviceEntityInserted' ||
|
|
//method == 'DeviceEntityUpdated' ||
|
|
method == 'DeviceEntityDeleted') {
|
|
loadData();
|
|
}
|
|
}
|
|
start(); |