diff --git a/projects/WebApp/wwwroot/js/message.js b/projects/WebApp/wwwroot/js/message.js index e0f75bf0..8b06a88b 100644 --- a/projects/WebApp/wwwroot/js/message.js +++ b/projects/WebApp/wwwroot/js/message.js @@ -21,29 +21,4 @@ connection.on("ServerToClient", function (method, message, to, from) { var event = method.substr(0, 1).toLowerCase() + method.substr(1); var model = JSON.parse(message); store.dispatch('update', {event,model,to,from}); - //store.commit('update', method,message,to,from); - //store.commit('update',method,message,to,from) - //if (method === 'NodeEntityUpdated') { - // store.commit('updateNode', model); - //} - ////else if (method === 'NodeEntityInserted') {} - ////else if (method === 'NodeEntityDeleted') {} - //else if (method === 'DeviceEntityInserted') { - // store.commit('insertDevice', model); - //} - //else if (method === 'DeviceEntityUpdated') { - // store.commit('updateDevice', model); - //} - //else if (method === 'DeviceEntityDeleted') { - // store.commit('deleteDevice', model); - //} - //else if (method === 'DataEntityInserted') { - // store.commit('insertData', model); - //} - //else if (method === 'DataEntityUpdated') { - // store.commit('updateData', model); - //} - //else if (method === 'DataEntityDeleted') { - // store.commit('deleteData', model); - //} }); \ No newline at end of file diff --git a/projects/WebApp/wwwroot/js/store.js b/projects/WebApp/wwwroot/js/store.js index 780c8676..55ec112d 100644 --- a/projects/WebApp/wwwroot/js/store.js +++ b/projects/WebApp/wwwroot/js/store.js @@ -75,7 +75,7 @@ const store = new Vuex.Store({ } } if (state.device) { - let device = state.device.number === model.number; + let device = state.device.id === model.deviceId ? state.device : null; if (device) { updateByKey(device.data, model); } diff --git a/projects/WebApp/wwwroot/pages/home.js b/projects/WebApp/wwwroot/pages/home.js index 88280c77..ef033834 100644 --- a/projects/WebApp/wwwroot/pages/home.js +++ b/projects/WebApp/wwwroot/pages/home.js @@ -16,7 +16,7 @@ store.commit('setUser', response.data); }) .catch(function (error) { - }) + }); }, methods: { logout: function () { diff --git a/projects/WebApp/wwwroot/pages/iot/device/ir.html b/projects/WebApp/wwwroot/pages/iot/device/ir.html index 149326d8..e7063a6a 100644 --- a/projects/WebApp/wwwroot/pages/iot/device/ir.html +++ b/projects/WebApp/wwwroot/pages/iot/device/ir.html @@ -6,16 +6,34 @@
-
-
- +
+ -
-
- {{getDeviceDataValue(device,'状态')}} - - - +
+
+ {{getCode.pattern}} + +
+
+ 2 +
+
+ 3 +
+
+ 4
@@ -24,6 +42,72 @@ \ No newline at end of file