diff --git a/projects/WebSPA/wwwroot/images/white-humiture.svg b/projects/WebSPA/wwwroot/images/white-humiture.svg new file mode 100644 index 00000000..519c74eb --- /dev/null +++ b/projects/WebSPA/wwwroot/images/white-humiture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/images/white-light.svg b/projects/WebSPA/wwwroot/images/white-light.svg new file mode 100644 index 00000000..58dc6669 --- /dev/null +++ b/projects/WebSPA/wwwroot/images/white-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/images/white-person.svg b/projects/WebSPA/wwwroot/images/white-person.svg new file mode 100644 index 00000000..fbf6545f --- /dev/null +++ b/projects/WebSPA/wwwroot/images/white-person.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/pages/home.js b/projects/WebSPA/wwwroot/pages/home.js index a7508d9d..6396b475 100644 --- a/projects/WebSPA/wwwroot/pages/home.js +++ b/projects/WebSPA/wwwroot/pages/home.js @@ -15,14 +15,14 @@ }, mounted: function () { weui.tab('#tab', { defaultIndex: 1 }); - + console.log('setUser>>>>>>>>'); var url = this.url; axios.get(url).then(function (response) { store.commit('setUser', response.data); }).catch(function (error) { //error }) - + console.log('载入消息2>>>>>>>>'); // 从存储载入消息 if(!isLoadedMSG) { loadMessage(function(msgs){ diff --git a/projects/WebSPA/wwwroot/pages/iot/_node.html b/projects/WebSPA/wwwroot/pages/iot/_node.html new file mode 100644 index 00000000..6ad4f77d --- /dev/null +++ b/projects/WebSPA/wwwroot/pages/iot/_node.html @@ -0,0 +1,97 @@ +
+
+ + + +

{{node.name}}

+
+
+ +
+
+
+
场景
+
+
+
+
+ +
+

{{scene.name}}

+
+
+
+
+
+
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + +
+
\ No newline at end of file diff --git a/projects/WebSPA/wwwroot/pages/iot/device.js b/projects/WebSPA/wwwroot/pages/iot/device.js index 98136de3..0de1548c 100644 --- a/projects/WebSPA/wwwroot/pages/iot/device.js +++ b/projects/WebSPA/wwwroot/pages/iot/device.js @@ -30,10 +30,12 @@ }, // 实例生命周期钩子 (销毁完毕) destroyed: function () { + console.log('destroyed:'); store.commit('setDevice', null); }, methods: { updateChart: function () { + console.log('updateChart:'); var dataList = Enumerable.from(this.device.data).where(function (o) { return o.type === 10 || o.type === 20; }).toArray(); @@ -42,6 +44,7 @@ } }, changeTime: function (key, time,title) { + console.log('changeTime:'); var vm = this; var t = (new Date()).valueOf(); var url = '/IoTCenter/api/v1/Device/GetChartData?t=' + t; @@ -54,12 +57,14 @@ .then(function (response) { var data = response.data; vm.UpdateChartInternal(key, data,title); + console.log('折线图更新成功'); }) .catch(function (error) { console.log(error); }); }, UpdateChartInternal(key, data, title) { + console.log('UpdateChartInternal:'); var canvas = document.getElementById(this.device.number + '-' + key); var chart; Chart.helpers.each(Chart.instances, function (instance) { @@ -67,6 +72,7 @@ chart = instance; } }); + console.log('chart:', chart); if (chart === '') { chart.data = data; @@ -74,7 +80,8 @@ } else { var ctx = canvas.getContext('2d'); - + // ctx.canvas.height = 150; + console.log('canvas.getContext:', ctx); var options = { responsive: true, legend: { @@ -117,8 +124,11 @@ }, computed: { // 计算属性的 getter - device: function () { + device: function () { + console.log('++++++++++++++++debug++++++++++++++++'); + console.log(store.state.device); return store.state.device; + }, hasChart: function () { // `this` 指向 app 实例 @@ -131,9 +141,18 @@ }), onMessage: function (event, model, to, from) { // event : execApiResponse | dataEntityUpdated + console.log('@@@@ device.js @@@@') + console.log(event) + console.log('@@@@ device.js @@@@') if(event === 'dataEntityUpdated'){ + console.log('%%%%%%%%') + console.log(event) + console.log(model) + console.log(to) + console.log(from) store.dispatch('update', {event, model, to, from}); - } + } + //alert(event) } } } \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/pages/iot/device/camera.html b/projects/WebSPA/wwwroot/pages/iot/device/camera.html index e3a40a1b..268e36f5 100644 --- a/projects/WebSPA/wwwroot/pages/iot/device/camera.html +++ b/projects/WebSPA/wwwroot/pages/iot/device/camera.html @@ -123,20 +123,25 @@ this.flvPlayer.muted = this.muted; var vm = this; this.timer = setInterval(function () { + console.log('.'); if (vm.flvPlayer.statisticsInfo.speed === 0) { + console.log('reload1'); clearInterval(vm.timer); vm.playByFlvJs(); } else if (vm.decodedFrames && vm.flvPlayer.statisticsInfo.decodedFrames <= decodedFrames) { + console.log('reload2'); clearInterval(vm.timer); vm.playByFlvJs(); } else if (vm.flvPlayer.buffered.length > 0 && vm.flvPlayer.buffered.end(0) - vm.flvPlayer.currentTime > 2) { + console.log('reset currentTime'); vm.flvPlayer.currentTime = vm.flvPlayer.buffered.end(0) - 0.001; } vm.decodedFrames = vm.flvPlayer.statisticsInfo.decodedFrames; }, 30 * 1000); } catch (e) { + console.log('error:'); console.log(e); } } diff --git a/projects/WebSPA/wwwroot/pages/iot/device/color-light.html b/projects/WebSPA/wwwroot/pages/iot/device/color-light.html index b8197b7f..ebc9aa89 100644 --- a/projects/WebSPA/wwwroot/pages/iot/device/color-light.html +++ b/projects/WebSPA/wwwroot/pages/iot/device/color-light.html @@ -56,6 +56,7 @@ color: function () { var h = Math.round(parseInt(this.hue || 128) * 360 / 255); var result = 'hsl(' + h + ',100%,50%)'; + console.log('color:'+result); return result; }, hsl: function () { @@ -63,6 +64,7 @@ var s = Math.round(parseInt(this.saturation || 128) * 100 / 254); var l = Math.round(parseInt(this.brightness || 128) * 100 / 254); var result = 'hsl(' + h + ',' + s + '%,' + l + '%);'; + console.log('hsl:'+result); return result; } } diff --git a/projects/WebSPA/wwwroot/pages/iot/device/socket.html b/projects/WebSPA/wwwroot/pages/iot/device/socket.html index aa839c98..d82f037d 100644 --- a/projects/WebSPA/wwwroot/pages/iot/device/socket.html +++ b/projects/WebSPA/wwwroot/pages/iot/device/socket.html @@ -27,9 +27,11 @@ props: ['device'], computed: { electricity: function () { + console.log('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-electricity'); return parseFloat(getDeviceDataValue(this.device, '电量')||0).toFixed(2); }, power: function (){ + console.log('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-power'); return parseFloat(getDeviceDataValue(this.device, '功率')||0).toFixed(2); } } diff --git a/projects/WebSPA/wwwroot/pages/iot/node.html b/projects/WebSPA/wwwroot/pages/iot/node.html index 6ad4f77d..f9514ee6 100644 --- a/projects/WebSPA/wwwroot/pages/iot/node.html +++ b/projects/WebSPA/wwwroot/pages/iot/node.html @@ -25,47 +25,164 @@ - -
+
-
- +
+ +
-
- +
+ +
-
+ -
- +
+ +
- +
+ +
-
+
-
+
-
- +
+ +
-
+
-
- +
+ +
diff --git a/projects/WebSPA/wwwroot/pages/iot/node.js b/projects/WebSPA/wwwroot/pages/iot/node.js index 3fcf6159..c85fb539 100644 --- a/projects/WebSPA/wwwroot/pages/iot/node.js +++ b/projects/WebSPA/wwwroot/pages/iot/node.js @@ -30,6 +30,8 @@ }, getShowFlag:function (name){ arr = Enumerable.from(this.node.devices).where(function (o) { return o.name === name; }).toArray(); + console.log('arrarrarrarr', arr) + console.log('arrarrarrarr', JSON.parse(arr[0].data[0].value)[0].name) return JSON.parse(arr[0].data[0].value)[0].name !== '测试' ? true : false; }, getDeviceDataAttr: function (number, name, attr) { @@ -57,9 +59,18 @@ }), onMessage: function (event, model, to, from) { // event : execApiResponse | dataEntityUpdated + console.log('@@@@ node.js @@@@') + console.log(event) + console.log('@@@@ node.js @@@@') if(event === 'dataEntityUpdated'){ + console.log('%%%%%%%%') + console.log(event) + console.log(model) + console.log(to) + console.log(from) store.dispatch('update', {event, model, to, from}); } + //alert(event) } } } \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/pages/iot/product.js b/projects/WebSPA/wwwroot/pages/iot/product.js index 4360a186..76de0bd7 100644 --- a/projects/WebSPA/wwwroot/pages/iot/product.js +++ b/projects/WebSPA/wwwroot/pages/iot/product.js @@ -36,10 +36,18 @@ }), onMessage: function (event, model, to, from) { // event : deviceEntityDeleted | productEntityInserted + console.log('@@@@') + console.log(event) + // 当当前为产品设备列表页面时,刷新产品设备列表 (由于每次进入页面都触发数据刷新,非当前页面则不做数据更新处理) var number = getUrlKey('number'); if(event === 'productEntityInserted'){ + console.log('%%%%%%%%') + console.log(event) + console.log(model) + console.log(to) + console.log(from) store.dispatch('getProducts', {event, model, to, from}); // 向产品设备列表中新增 store.dispatch('getProduct', {number:number}); diff --git a/projects/WebSPA/wwwroot/pages/iot/products.js b/projects/WebSPA/wwwroot/pages/iot/products.js index 44304adb..780ba689 100644 --- a/projects/WebSPA/wwwroot/pages/iot/products.js +++ b/projects/WebSPA/wwwroot/pages/iot/products.js @@ -33,9 +33,17 @@ function pages_iot_products() { }), onMessage: function (event, model, to, from) { // event : execApiResponse | dataEntityUpdated + console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') + console.log(event) if(event === 'productEntityInserted'){ + console.log('%%%%%%%%') + console.log(event) + console.log(model) + console.log(to) + console.log(from) store.dispatch('getProducts', {event, model, to, from}); } + //alert(event) } } } \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/pages/login.js b/projects/WebSPA/wwwroot/pages/login.js index 3e2bf79f..625c7601 100644 --- a/projects/WebSPA/wwwroot/pages/login.js +++ b/projects/WebSPA/wwwroot/pages/login.js @@ -11,9 +11,11 @@ }; }, mounted: function () { + console.log('mounted:login'); weui.form.checkIfBlur('#form', this.regexp); // 绑定enter事件 this.enterKeyup(); + console.log('mounted:enterKeyup'); }, computed: { regexp: function () {