diff --git a/projects/WebSPA/wwwroot/css/app.css b/projects/WebSPA/wwwroot/css/app.css index 3d9fc470..01c47c99 100644 --- a/projects/WebSPA/wwwroot/css/app.css +++ b/projects/WebSPA/wwwroot/css/app.css @@ -1218,4 +1218,12 @@ a.weui-btn:visited .weui-btn_primary{ } .ir button{ -} \ No newline at end of file +} +.grayscale{ + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -ms-filter: grayscale(100%); + -o-filter: grayscale(100%); + filter: grayscale(100%); + filter: gray; +} diff --git a/projects/WebSPA/wwwroot/index.html b/projects/WebSPA/wwwroot/index.html index 55f8fc0c..3aef902d 100644 --- a/projects/WebSPA/wwwroot/index.html +++ b/projects/WebSPA/wwwroot/index.html @@ -8,6 +8,8 @@ + + 物联管控 @@ -22,7 +24,7 @@ diff --git a/projects/WebSPA/wwwroot/pages/home.html b/projects/WebSPA/wwwroot/pages/home.html index 085b1ea1..1e0756d4 100644 --- a/projects/WebSPA/wwwroot/pages/home.html +++ b/projects/WebSPA/wwwroot/pages/home.html @@ -3,8 +3,7 @@
-

消息({{store.state.messages.length}})

-
+

消息({{store.state.messages.length < 99 ? store.state.messages.length : '99+' }})

diff --git a/projects/WebSPA/wwwroot/pages/iot/device.html b/projects/WebSPA/wwwroot/pages/iot/device.html index 12d63db4..4573ccd5 100644 --- a/projects/WebSPA/wwwroot/pages/iot/device.html +++ b/projects/WebSPA/wwwroot/pages/iot/device.html @@ -45,7 +45,9 @@
- +
+ +
diff --git a/projects/WebSPA/wwwroot/pages/iot/device.js b/projects/WebSPA/wwwroot/pages/iot/device.js index f6a1e69c..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,8 +44,10 @@ } }, changeTime: function (key, time,title) { + console.log('changeTime:'); var vm = this; - var url = '/IoTCenter/api/v1/Device/GetChartData'; + var t = (new Date()).valueOf(); + var url = '/IoTCenter/api/v1/Device/GetChartData?t=' + t; var data = { number:this.device.number, key: key, @@ -59,7 +63,8 @@ console.log(error); }); }, - UpdateChartInternal(key, data,title) { + 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,12 +72,16 @@ chart = instance; } }); - if (chart) { + console.log('chart:', chart); + + if (chart === '') { chart.data = data; chart.update(); } - else { + else { var ctx = canvas.getContext('2d'); + // ctx.canvas.height = 150; + console.log('canvas.getContext:', ctx); var options = { responsive: true, legend: { @@ -84,8 +93,27 @@ }, animation: { duration: 0 - } + }, + /* + scales: { + yAxes: [{ + display: true, + gridLines: { + color: "rgb(210,210,211)" + }, + ticks: { + min: 0, + stepSize: 500, + beginAtZero: true, + padding: 20, + callback: function(value, index, values) { + return value; + } + } + }] + }*/ }; + chart = new Chart(ctx, { type: 'line', data: data, diff --git a/projects/WebSPA/wwwroot/pages/iot/product.html b/projects/WebSPA/wwwroot/pages/iot/product.html index ef762f34..b84007f8 100644 --- a/projects/WebSPA/wwwroot/pages/iot/product.html +++ b/projects/WebSPA/wwwroot/pages/iot/product.html @@ -9,7 +9,8 @@
- + +

{{device.displayName}}