diff --git a/projects/WebMVC/wwwroot/js/iot.js b/projects/WebMVC/wwwroot/js/iot.js index 18bf8f63..e15d809c 100644 --- a/projects/WebMVC/wwwroot/js/iot.js +++ b/projects/WebMVC/wwwroot/js/iot.js @@ -99,7 +99,7 @@ deviceInfo['串口控制器'] = 'iot-serial-port'; function updateSelect(action, id, value) { var select = $('select#' + id); if (select.length) { - select.find("option[value!=null]").remove(); + select.find("option[value!='']").remove(); if (value) { var url = config.baseUrl + '/IoTCenter/Admin/Ajax/' + action + '?parentId='+ value; $.getJSON(url, function (data) { diff --git a/projects/WebMVC/wwwroot/router/admin/command/edit.html b/projects/WebMVC/wwwroot/router/admin/command/edit.html index ca668023..aa348f0c 100644 --- a/projects/WebMVC/wwwroot/router/admin/command/edit.html +++ b/projects/WebMVC/wwwroot/router/admin/command/edit.html @@ -100,7 +100,7 @@
@@ -109,7 +109,7 @@
-
+
@@ -126,7 +126,7 @@
@@ -340,7 +340,7 @@ }, getIrType: function () { var param = Enumerable.from(this.data.model.parameters).firstOrDefault(o => o.name === 'type'); - if (param) { + if (param && param.value) { return Enumerable.from(this.getIrTypeList()).firstOrDefault(o => o.value === param.value).text; } return null; @@ -402,7 +402,7 @@ watch: { 'data.model.apiId': function (val, oldVal) { var vm = this; - if ((oldVal === null || oldVal === 'null') && val && val !== 'null' && this.data.model.nodeId && this.data.model.deviceId) { + if (oldVal === null && val && val !== 'null' && this.data.model.nodeId && this.data.model.deviceId) { Vue.set(vm.data.data, vm.data.model.apiId, $('#apiId option:selected').text()); vm.errors = []; var url = this.path + 'Api?apiId=' + val + '&deviceId=' + this.data.model.deviceId; @@ -413,7 +413,7 @@ }); } else { - if (val === 'null') { + if (val === null) { vm.data.model.parameters = []; } } diff --git a/projects/WebMVC/wwwroot/router/shared/edit/selectlist.html b/projects/WebMVC/wwwroot/router/shared/edit/selectlist.html index 79ce468f..184b6108 100644 --- a/projects/WebMVC/wwwroot/router/shared/edit/selectlist.html +++ b/projects/WebMVC/wwwroot/router/shared/edit/selectlist.html @@ -1,7 +1,7 @@