|
@@ -17,7 +17,7 @@
|
|
|
</el-tabs>
|
|
|
<div class="table-wrapper" style="padding-bottom: 10px;padding-left: 10px">
|
|
|
<div v-if="tid !== '0'" style="padding: 5px;">
|
|
|
- <el-button :disabled="multipleSelection.length === 0" type="success" @click="sendAll">
|
|
|
+ <el-button :disabled="multipleSelection.length === 0" type="success" @click="sendAll(0)">
|
|
|
批量发送
|
|
|
</el-button>
|
|
|
<el-button v-if="multipleSelection.length === 0" type="primary" @click="recoverList">
|
|
@@ -26,7 +26,21 @@
|
|
|
<el-button v-else type="primary" @click="saveList">
|
|
|
保存勾选
|
|
|
</el-button>
|
|
|
- <el-switch v-model="boolOpen" active-text="打印具体消息" inactive-text="不打印具体消息" style="margin-left: 10px"></el-switch>
|
|
|
+ <el-switch v-model="boolOpen" active-text="打印具体消息" inactive-text="不打印具体消息" style="margin-left: 10px;margin-right: 10px;"></el-switch>
|
|
|
+ <el-button-group>
|
|
|
+ <el-tooltip class="item" effect="dark" content="首先确保所有485通讯正常才能使用此功能,最后需要选择门口机类型" placement="top-start">
|
|
|
+ <el-button :disabled="multipleSelection.length === 0 || boolLineIniting" type="success" size="mini" @click="sendAll(1)">
|
|
|
+ 线路初始化
|
|
|
+ </el-button>
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
+ <el-button :disabled="boolLineIniting || deviceList.length === 0" type="success" size="mini" @click="sendAll(2)">
|
|
|
+ 重启所有线路
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-input v-model="searchDeviceStr" placeholder="输入搜索" clearable @change="clickSearch" style="width: 350px;margin-bottom: 5px">
|
|
@@ -43,6 +57,8 @@
|
|
|
<el-table-column prop="full_name" min-width="100" label="位置" align="center" />
|
|
|
<el-table-column prop="name" label="设备名" min-width="130" align="center" />
|
|
|
<el-table-column prop="sip_id" label="485地址" width="130" align="center" />
|
|
|
+ <el-table-column prop="power_control_address" label="电源控制版地址" width="130" align="center" />
|
|
|
+ <el-table-column prop="control_line_number" label="控制版线路" width="130" align="center" />
|
|
|
<!-- <el-table-column prop="send_time" label="发送时间" min-width="130" align="center" />-->
|
|
|
<el-table-column prop="receive_time" label="流程耗时" width="130" align="center" />
|
|
|
<el-table-column prop="state" label="状态" width="140" align="center">
|
|
@@ -191,7 +207,8 @@ export default {
|
|
|
serverIp: [{required: true, message: '请输入需要连接的服务器地址', trigger: 'blur'}],
|
|
|
serverPort: [{required: true, message: '请输入需要连接的服务器端口', trigger: 'blur'}],
|
|
|
},
|
|
|
- isDisabled: false
|
|
|
+ isDisabled: false,
|
|
|
+ boolLineIniting: false
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -217,11 +234,21 @@ export default {
|
|
|
websocketonmessage: function(e) {
|
|
|
// console.log('收到消息:', e)
|
|
|
const data = JSON.parse(e.data)
|
|
|
+ const time = (new Date()).valueOf()
|
|
|
+ if (data.rs485mac == null) {
|
|
|
+ this.activities.push({
|
|
|
+ content: data.rs485msg,
|
|
|
+ timestamp: time,
|
|
|
+ })
|
|
|
+ this.boolLineIniting = false
|
|
|
+ this.$message.success("分配完成...")
|
|
|
+ return
|
|
|
+ }
|
|
|
const index = this.deviceList.findIndex(p => p.sip_id.toLowerCase() === data.rs485mac.toLowerCase())
|
|
|
if (index === -1) {
|
|
|
return
|
|
|
}
|
|
|
- const time = (new Date()).valueOf()
|
|
|
+
|
|
|
const item = this.deviceList[index]
|
|
|
//当点击"定位"按钮之后,实现屏幕滚动到这个id的位置,并且在屏幕的中间
|
|
|
let element = document.getElementById("table_td_bg_"+ item.id);
|
|
@@ -348,18 +375,37 @@ export default {
|
|
|
selectFun(val) {
|
|
|
this.multipleSelection = val
|
|
|
},
|
|
|
- sendAll() {
|
|
|
+ sendAll(type) {
|
|
|
let list = []
|
|
|
const _this = this
|
|
|
- _this.multipleSelection.forEach(item => {
|
|
|
- const index = _this.deviceList.indexOf(item)
|
|
|
- item.state = 0
|
|
|
- item.send_time = item.receive_time = ''
|
|
|
- _this.$set(_this.deviceList, index, item)
|
|
|
- list.push(item.sip_id + '-' + _this.activeName.split('-')[0])
|
|
|
- })
|
|
|
// this.multipleSelection = []
|
|
|
- this.websock.send(list.join(','))
|
|
|
+ if (type === 0) {
|
|
|
+ _this.multipleSelection.forEach(item => {
|
|
|
+ const index = _this.deviceList.indexOf(item)
|
|
|
+ item.state = 0
|
|
|
+ item.send_time = item.receive_time = ''
|
|
|
+ _this.$set(_this.deviceList, index, item)
|
|
|
+ list.push(item.sip_id + '-' + _this.activeName.split('-')[0])
|
|
|
+ })
|
|
|
+ this.websock.send(list.join(','))
|
|
|
+ } else if (type === 1) {
|
|
|
+ if (this.frameType !== '22') {
|
|
|
+ this.$message({ type: 'info', message: '需要先选择门口机类型!' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _this.multipleSelection.forEach(item => {
|
|
|
+ const index = _this.deviceList.indexOf(item)
|
|
|
+ item.state = 0
|
|
|
+ item.send_time = item.receive_time = ''
|
|
|
+ _this.$set(_this.deviceList, index, item)
|
|
|
+ list.push(item.sip_id)
|
|
|
+ })
|
|
|
+ this.boolLineIniting = true
|
|
|
+ this.websock.send("lineInit_"+_this.activeName.split('-')[0] +"_"+list.join(','))
|
|
|
+ } else {
|
|
|
+ this.websock.send("lineInit_"+_this.deviceList[0].sip_id +"_ALL")
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//将秒转化为时分秒
|
|
|
formateSeconds(startTime, endTime){
|