Browse Source

云中控兼容-fix

organize
zmt 3 years ago
parent
commit
af47db0998
  1. 14
      src/subpackage/device/pages/switch_manage/switch_manage.vue

14
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -358,6 +358,7 @@ export default {
// src\subpackage\device\js\ouxuanac.md
// hardware_type === 'Air'
getSwitchQuery({ switchInfo, status = '' }){
let {
hardware_connect_method,
hardware_type,
@ -365,17 +366,19 @@ export default {
node_id,
hardware_net_addr
} = switchInfo;
const _hardware_connect_method = this.changeLowerCase(hardware_connect_method)
const postData = {
name: this.getQueryName(switchInfo),
value: { id: hardware_id + '', } // value String
};
if (this.changeLowerCase(hardware_connect_method) === 'gpio') postData.value['status'] = this.getRelayStatus(status);
if (_hardware_connect_method === 'gpio') postData.value['status'] = this.getRelayStatus(status);
// tcp hardware_net_addr
if (this.changeLowerCase(hardware_connect_method) === 'tcp') postData.value['tcp'] = hardware_net_addr + '';
let _flag = this.changeLowerCase(hardware_connect_method) === 'serialport485' || this.changeLowerCase(hardware_connect_method) === 'tcp';
if (_hardware_connect_method === 'tcp') postData.value['tcp'] = hardware_net_addr + '';
// let _flag = _hardware_connect_method === 'serialport485' || _hardware_connect_method === 'tcp'||_hardware_connect_method==='yzk';
let _flag = ['serialport485','tcp','yzk'].some(e=> e===_hardware_connect_method);
if (_flag){
if(hardware_type === 'Air'){ // key op
postData.value['op'] = this.getAirRelayStatus(status);
@ -386,10 +389,11 @@ export default {
postData.value['o'] = this.getRelayStatus(status); //
}
}
return postData;
},
changeLowerCase(str){
return str.toString().toLocaleLowerCase();
return str.toString().toLocaleLowerCase();
},
//
// Low = "low", //

Loading…
Cancel
Save