|
@@ -3936,6 +3936,13 @@
|
|
<el-input-number v-model="slaveForm.slaveid" :min="1" :max="255" :controls="false"></el-input-number>
|
|
<el-input-number v-model="slaveForm.slaveid" :min="1" :max="255" :controls="false"></el-input-number>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="form-item" v-if="slaveForm.type === 'modebusRtu'">
|
|
|
|
+ <div class="label">是否启用:</div>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <el-checkbox v-model="slaveForm.rtuUse"></el-checkbox>
|
|
|
|
+ <!-- <el-input-number v-model="slaveForm.slaveid" :min="1" :max="255" :controls="false"></el-input-number>-->
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div class="form-item" v-if="slaveForm.type === 'modebusTcp'">
|
|
<div class="form-item" v-if="slaveForm.type === 'modebusTcp'">
|
|
<div class="label">IP地址:</div>
|
|
<div class="label">IP地址:</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
@@ -3948,6 +3955,13 @@
|
|
<el-input v-model="slaveForm.port"></el-input>
|
|
<el-input v-model="slaveForm.port"></el-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="form-item" v-if="slaveForm.type === 'modebusTcp'">
|
|
|
|
+ <div class="label">是否启用:</div>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <el-checkbox v-model="slaveForm.tcpUse"></el-checkbox>
|
|
|
|
+ <!-- <el-input-number v-model="slaveForm.slaveid" :min="1" :max="255" :controls="false"></el-input-number>-->
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="save-btn-container">
|
|
<div class="save-btn-container">
|
|
<el-button type="danger" class="save-btn" @click="slaveFormButton">保 存</el-button>
|
|
<el-button type="danger" class="save-btn" @click="slaveFormButton">保 存</el-button>
|
|
@@ -4434,7 +4448,9 @@ export default {
|
|
slaveid: 1,
|
|
slaveid: 1,
|
|
mainComChan: 4,
|
|
mainComChan: 4,
|
|
ipAddress: "127.0.0.1",
|
|
ipAddress: "127.0.0.1",
|
|
- port: 1502
|
|
|
|
|
|
+ port: 1502,
|
|
|
|
+ tcpUse:false,
|
|
|
|
+ rtuUse:false,
|
|
},
|
|
},
|
|
slaveResult: {},
|
|
slaveResult: {},
|
|
|
|
|
|
@@ -6932,19 +6948,32 @@ export default {
|
|
this.useAirProduct = isUseAirProducts;
|
|
this.useAirProduct = isUseAirProducts;
|
|
this.useSlave = isUseSlave;
|
|
this.useSlave = isUseSlave;
|
|
|
|
|
|
- if (slave && slave.modebusRtu && slave.modebusRtu.type === "modebusRtu") {
|
|
|
|
- this.slaveForm.type = "modebusRtu";
|
|
|
|
|
|
+ // if (slave && slave.modebusRtu && slave.modebusRtu.type === "modebusRtu") {
|
|
|
|
+ // this.slaveForm.type = "modebusRtu";
|
|
|
|
+ // this.slaveForm.mainComChan = slave.modebusRtu.mainComChan;
|
|
|
|
+ // this.slaveForm.baud = slave.modebusRtu.baud;
|
|
|
|
+ // this.slaveForm.slaveid = slave.modebusRtu.slaveid;
|
|
|
|
+ // } else if (
|
|
|
|
+ // slave &&
|
|
|
|
+ // slave.modebusTcp &&
|
|
|
|
+ // slave.modebusTcp.type === "modebusTcp"
|
|
|
|
+ // ) {
|
|
|
|
+ // this.slaveForm.type = "modebusTcp";
|
|
|
|
+ // this.slaveForm.ipAddress = slave.modebusTcp.ipAddress;
|
|
|
|
+ // this.slaveForm.port = slave.modebusTcp.port;
|
|
|
|
+ // }
|
|
|
|
+ if (slave && slave.modebusRtu) {
|
|
this.slaveForm.mainComChan = slave.modebusRtu.mainComChan;
|
|
this.slaveForm.mainComChan = slave.modebusRtu.mainComChan;
|
|
this.slaveForm.baud = slave.modebusRtu.baud;
|
|
this.slaveForm.baud = slave.modebusRtu.baud;
|
|
this.slaveForm.slaveid = slave.modebusRtu.slaveid;
|
|
this.slaveForm.slaveid = slave.modebusRtu.slaveid;
|
|
- } else if (
|
|
|
|
- slave &&
|
|
|
|
- slave.modebusTcp &&
|
|
|
|
- slave.modebusTcp.type === "modebusTcp"
|
|
|
|
- ) {
|
|
|
|
- this.slaveForm.type = "modebusTcp";
|
|
|
|
|
|
+ this.slaveForm.rtuUse = slave.modebusRtu.rtuUse;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // this.slaveForm.type = "modebusTcp";
|
|
|
|
+ if (slave && slave.modebusTcp) {
|
|
this.slaveForm.ipAddress = slave.modebusTcp.ipAddress;
|
|
this.slaveForm.ipAddress = slave.modebusTcp.ipAddress;
|
|
this.slaveForm.port = slave.modebusTcp.port;
|
|
this.slaveForm.port = slave.modebusTcp.port;
|
|
|
|
+ this.slaveForm.tcpUse = slave.modebusTcp.tcpUse;
|
|
}
|
|
}
|
|
/*--------------------系统设置由上至下----------------- */
|
|
/*--------------------系统设置由上至下----------------- */
|
|
//基础设置
|
|
//基础设置
|
|
@@ -9494,7 +9523,7 @@ export default {
|
|
// console.log(maxId, maxOrder)
|
|
// console.log(maxId, maxOrder)
|
|
this.regionalStructTopList[this.activeAddOperateAreaIndex].listRooms.push(
|
|
this.regionalStructTopList[this.activeAddOperateAreaIndex].listRooms.push(
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+
|
|
id: maxId + 1,
|
|
id: maxId + 1,
|
|
uuid: this.genUuid(),
|
|
uuid: this.genUuid(),
|
|
cbOrder: maxOrder + 1,
|
|
cbOrder: maxOrder + 1,
|
|
@@ -9888,7 +9917,8 @@ export default {
|
|
baud: this.slaveForm.baud,
|
|
baud: this.slaveForm.baud,
|
|
parity: 78,
|
|
parity: 78,
|
|
dataBit: 8,
|
|
dataBit: 8,
|
|
- stopBit: 1
|
|
|
|
|
|
+ stopBit: 1,
|
|
|
|
+ rtuUse:this.slaveForm.rtuUse,
|
|
},
|
|
},
|
|
modebusTcp: {},
|
|
modebusTcp: {},
|
|
custom: {}
|
|
custom: {}
|
|
@@ -9898,11 +9928,32 @@ export default {
|
|
modebusTcp: {
|
|
modebusTcp: {
|
|
type: "modebusTcp",
|
|
type: "modebusTcp",
|
|
ipAddress: this.slaveForm.ipAddress,
|
|
ipAddress: this.slaveForm.ipAddress,
|
|
- port: parseInt(this.slaveForm.port)
|
|
|
|
|
|
+ port: parseInt(this.slaveForm.port),
|
|
|
|
+ tcpUse:this.slaveForm.tcpUse,
|
|
|
|
+ },
|
|
|
|
+ modebusRtu: {
|
|
|
|
+ type: "modebusRtu",
|
|
|
|
+ device: "/dev/ttyO",
|
|
|
|
+ slaveid: this.slaveForm.slaveid,
|
|
|
|
+ mainComChan: this.slaveForm.mainComChan,
|
|
|
|
+ baud: this.slaveForm.baud,
|
|
|
|
+ parity: 78,
|
|
|
|
+ dataBit: 8,
|
|
|
|
+ stopBit: 1,
|
|
|
|
+ rtuUse:this.slaveForm.rtuUse,
|
|
},
|
|
},
|
|
- modebusRtu: {},
|
|
|
|
custom: {}
|
|
custom: {}
|
|
};
|
|
};
|
|
|
|
+ // this.slaveResult = {
|
|
|
|
+ // modebusTcp: {
|
|
|
|
+ // type: "modebusTcp",
|
|
|
|
+ // ipAddress: this.slaveForm.ipAddress,
|
|
|
|
+ // port: parseInt(this.slaveForm.port),
|
|
|
|
+ // tcpUse:this.slaveForm.tcpUse,
|
|
|
|
+ // },
|
|
|
|
+ // modebusRtu: {},
|
|
|
|
+ // custom: {}
|
|
|
|
+ // };
|
|
}
|
|
}
|
|
|
|
|
|
const system = {
|
|
const system = {
|