Browse Source

Merge branch 'dev' into all

organize
刘嘉炜 3 years ago
parent
commit
7a01df9cd1
  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 // src\subpackage\device\js\ouxuanac.md
// hardware_type === 'Air' // hardware_type === 'Air'
getSwitchQuery({ switchInfo, status = '' }){ getSwitchQuery({ switchInfo, status = '' }){
let { let {
hardware_connect_method, hardware_connect_method,
hardware_type, hardware_type,
@ -365,17 +366,19 @@ export default {
node_id, node_id,
hardware_net_addr hardware_net_addr
} = switchInfo; } = switchInfo;
const _hardware_connect_method = this.changeLowerCase(hardware_connect_method)
const postData = { const postData = {
name: this.getQueryName(switchInfo), name: this.getQueryName(switchInfo),
value: { id: hardware_id + '', } // value String 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 // 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 (_flag){
if(hardware_type === 'Air'){ // key op if(hardware_type === 'Air'){ // key op
postData.value['op'] = this.getAirRelayStatus(status); postData.value['op'] = this.getAirRelayStatus(status);
@ -386,10 +389,11 @@ export default {
postData.value['o'] = this.getRelayStatus(status); // postData.value['o'] = this.getRelayStatus(status); //
} }
} }
return postData; return postData;
}, },
changeLowerCase(str){ changeLowerCase(str){
return str.toString().toLocaleLowerCase();
return str.toString().toLocaleLowerCase();
}, },
// //
// Low = "low", // // Low = "low", //

Loading…
Cancel
Save