|
|
|
@ -1,11 +1,4 @@
|
|
|
|
|
var time = '1d';
|
|
|
|
|
if (window.WXInlinePlayer && WXInlinePlayer.isSupport()) {
|
|
|
|
|
WXInlinePlayer.init({
|
|
|
|
|
asmUrl: '/lib/WXInlinePlayer/prod.all.asm.combine.js',
|
|
|
|
|
wasmUrl: '/lib/WXInlinePlayer/prod.all.wasm.combine.js'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function getDeviceDataValue(device, name) {
|
|
|
|
|
function getDeviceDataValue(device, name) {
|
|
|
|
|
var data = Enumerable.from(device.data).where(o => o.name === name).firstOrDefault();
|
|
|
|
|
if (data) {
|
|
|
|
|
return data['value'];
|
|
|
|
@ -37,73 +30,41 @@ function getData(device, name) {
|
|
|
|
|
return Enumerable.from(device.data).where(o => o.name === name).firstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
//devices
|
|
|
|
|
Vue.component('iot-gateway', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/gateway.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-light', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/light.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-humiture', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/humiture.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-smoke', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/smoke.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-person', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/person.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-curtain', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/curtain.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-switch', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/switch.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-switch3', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/switch3.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-socket', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/socket.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-ir', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/ir.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-color-light', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/color-light.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-door', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/door.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-camera', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/camera.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Vue.component('iot-serial-port', function (resolve, reject) {
|
|
|
|
|
axios.get("/components/device/serial-port.html").then(function (response) {
|
|
|
|
|
resolve(parseModel(response));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
var iotComponents = [
|
|
|
|
|
'gateway',
|
|
|
|
|
'light',
|
|
|
|
|
'humiture',
|
|
|
|
|
'smoke',
|
|
|
|
|
'person',
|
|
|
|
|
'curtain',
|
|
|
|
|
'switch',
|
|
|
|
|
'switch3',
|
|
|
|
|
'socket',
|
|
|
|
|
'ir',
|
|
|
|
|
'color-light',
|
|
|
|
|
'door',
|
|
|
|
|
'camera',
|
|
|
|
|
'serial-port',
|
|
|
|
|
];
|
|
|
|
|
for (var i = 0; i < iotComponents.length; i++) {
|
|
|
|
|
var name = 'iot-'+iotComponents[i];
|
|
|
|
|
var url = "/components/iot/" + iotComponents[i] + ".html";
|
|
|
|
|
vueComponent(name, url);
|
|
|
|
|
}
|
|
|
|
|
var deviceInfo = [];
|
|
|
|
|
deviceInfo['网关'] = 'iot-gateway';
|
|
|
|
|
deviceInfo['光强检测器'] = 'iot-light';
|
|
|
|
|
deviceInfo['温湿度传感器'] = 'iot-humiture';
|
|
|
|
|
deviceInfo['烟雾报警器'] = 'iot-smoke';
|
|
|
|
|
deviceInfo['人体感应器'] = 'iot-person';
|
|
|
|
|
deviceInfo['窗帘电机'] = 'iot-curtain';
|
|
|
|
|
deviceInfo['一路开关'] = 'iot-switch';
|
|
|
|
|
deviceInfo['三路开关'] = 'iot-switch3';
|
|
|
|
|
deviceInfo['插座'] = 'iot-socket';
|
|
|
|
|
deviceInfo['智能插座'] = 'iot-socket';
|
|
|
|
|
deviceInfo['红外转发器'] = 'iot-ir';
|
|
|
|
|
deviceInfo['调色灯'] = 'iot-color-light';
|
|
|
|
|
deviceInfo['门锁'] = 'iot-door';
|
|
|
|
|
deviceInfo['摄像头'] = 'iot-camera';
|
|
|
|
|
deviceInfo['摄像头'] = 'gateway';
|
|
|
|
|
deviceInfo['串口控制器'] = 'iot-serial-port';
|