diff --git a/projects/Infrastructure/wwwroot/favicon.ico b/projects/Infrastructure/wwwroot/favicon.ico index a3a79998..9ffa7168 100644 Binary files a/projects/Infrastructure/wwwroot/favicon.ico and b/projects/Infrastructure/wwwroot/favicon.ico differ diff --git a/projects/JobServer/wwwroot/favicon.ico b/projects/JobServer/wwwroot/favicon.ico index a3a79998..9ffa7168 100644 Binary files a/projects/JobServer/wwwroot/favicon.ico and b/projects/JobServer/wwwroot/favicon.ico differ diff --git a/projects/StudyCenter/wwwroot/favicon.ico b/projects/StudyCenter/wwwroot/favicon.ico index a3a79998..9ffa7168 100644 Binary files a/projects/StudyCenter/wwwroot/favicon.ico and b/projects/StudyCenter/wwwroot/favicon.ico differ diff --git a/projects/WebSPA/wwwroot/js/app.js b/projects/WebSPA/wwwroot/js/app.js index fbc97d13..da753827 100644 --- a/projects/WebSPA/wwwroot/js/app.js +++ b/projects/WebSPA/wwwroot/js/app.js @@ -172,6 +172,10 @@ var onReturnBack = function (){ } } +window.addEventListener("popstate", function(e) { + $('.weui-header a.weui-header-left')[0].click(); +}, false); + // indexedDB兼容 var indexedDB = window.indexedDB || window.webkitindexedDB || window.msIndexedDB || mozIndexedDB || null; diff --git a/projects/WebSPA/wwwroot/js/util.js b/projects/WebSPA/wwwroot/js/util.js index 677f481a..2d913927 100644 --- a/projects/WebSPA/wwwroot/js/util.js +++ b/projects/WebSPA/wwwroot/js/util.js @@ -76,6 +76,20 @@ function execScene(id) { }); } +function nodePower(number, command) { + var loading = weui.loading('提交中...'); + axios.post('/IoTCenter/api/v1/node/power'+command, '"' + number + '"', { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .finally(function () { + loading.hide(); + }); +} + /** * 格式化时间 * @param {*} value diff --git a/projects/WebSPA/wwwroot/pages/iot/node.html b/projects/WebSPA/wwwroot/pages/iot/node.html index 9f1f35b3..6ad4f77d 100644 --- a/projects/WebSPA/wwwroot/pages/iot/node.html +++ b/projects/WebSPA/wwwroot/pages/iot/node.html @@ -79,7 +79,7 @@ -
+
diff --git a/projects/WebSPA/wwwroot/pages/iot/node.js b/projects/WebSPA/wwwroot/pages/iot/node.js index fec5b235..c85fb539 100644 --- a/projects/WebSPA/wwwroot/pages/iot/node.js +++ b/projects/WebSPA/wwwroot/pages/iot/node.js @@ -28,6 +28,12 @@ getDevices: function (name) { return Enumerable.from(this.node.devices).where(function (o) { return o.name === name; }).toArray(); }, + 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) { var device = Enumerable.from(this.node.devices).where(function (o) { return o.number === number; }).firstOrDefault(); var data = Enumerable.from(device.data).where(o => o.name === name).firstOrDefault(); diff --git a/projects/WebSPA/wwwroot/pages/iot/nodes.html b/projects/WebSPA/wwwroot/pages/iot/nodes.html index ce5b28c2..e83ceaeb 100644 --- a/projects/WebSPA/wwwroot/pages/iot/nodes.html +++ b/projects/WebSPA/wwwroot/pages/iot/nodes.html @@ -1,27 +1,50 @@ -
-
- - - -

智慧教室

-
-
-
-
-
-
- - - -
- -
- +
+
+
+ + + +

智慧教室

+ +
+
+
+
+
+
+
-

{{node.name}}({{node.count}})

- + +
+ +
+

{{node.name}}({{node.count}})

+
+
+
\ No newline at end of file diff --git a/projects/WebSPA/wwwroot/pages/iot/nodes.js b/projects/WebSPA/wwwroot/pages/iot/nodes.js index 7a7e3da6..f614a15e 100644 --- a/projects/WebSPA/wwwroot/pages/iot/nodes.js +++ b/projects/WebSPA/wwwroot/pages/iot/nodes.js @@ -25,6 +25,26 @@ store.commit('setNodes', []); }, methods: { + selectAll:function(){ + $("input[type='checkbox']").each(function(idx,el){ + el.checked = true + }) + }, + resetAll:function(){ + $("input[type='checkbox']").each(function(idx,el){ + el.checked = false + }) + }, + setPower:function(method){ + var els = $('.item:checked'); + if (els.length) { + els.each(function(idx, el){ + nodePower(el.value, method); + }) + } else { + weui.topTips('没有选择任何项', { duration: 3000 }); + } + } }, computed: { nodes: function () {