设备命令

Former-commit-id: 125452ce5a6a27e148e4105f4dc2ab23ab16c9b3
Former-commit-id: 3d9f27749bd3ffcb63e28523d0a620502ab61d7f
TSXN
wanggang 5 years ago
parent b3727afed3
commit df4c922433

@ -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) {

@ -100,7 +100,7 @@
<label class="col-sm-2 col-form-label">{{param.description}}:</label>
<div class="col-sm-6 form-control" style="border-color:transparent;height:auto;min-height:calc(2.25rem + 2px);">
<select id="irType" class="form-control" v-model="param.value" @input="change2(index)">
<option value="null">请选择</option>
<option :value="null">请选择</option>
<option v-for="item in getIrTypeList()" :value="item.value">{{item.text}}</option>
</select>
<div style="height:1em;">
@ -109,7 +109,7 @@
</div>
</div>
</div>
<div class="form-group row" v-if="param.description==='键值'&&getIrType()!=='请选择'">
<div class="form-group row" v-if="param.description==='键值'&&getIrType()">
<label class="col-sm-2 col-form-label">{{param.description}}:</label>
<div class="col-sm-6 form-control" style="border-color:transparent;height:auto;min-height:calc(2.25rem + 2px);">
<iot-ir-command :type="getIrType()" :value.sync="param.value" :buttons="getIrButtons()" />
@ -126,7 +126,7 @@
<label class="col-sm-2 col-form-label">{{param.description}}:</label>
<div class="col-sm-6 form-control" style="border-color:transparent;height:auto;min-height:calc(2.25rem + 2px);">
<select class="form-control" v-model="param.value" @input="change2(index)">
<option value="'null'">请选择</option>
<option :value="null">请选择</option>
<option v-for="item in getSPCommands()" :value="item.name">{{item.name}}</option>
</select>
<div style="height:1em;">
@ -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 = [];
}
}

@ -1,7 +1,7 @@
<template>
<div>
<select class="form-control" :id="name" :name="currentName" v-model="currentValue">
<option value="null">请选择</option>
<option :value="null">请选择</option>
<option v-for="item in list" :value="item.value">{{item.text}}</option>
</select>
</div>

Loading…
Cancel
Save