修改
This commit is contained in:
@@ -213,7 +213,7 @@ export default {
|
|||||||
// 展开显示设备信息
|
// 展开显示设备信息
|
||||||
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
|
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
|
||||||
if (data.data.properties.device) {
|
if (data.data.properties.device) {
|
||||||
this.moveShow(data) // 传递节点数据,用来获取id做比对
|
this.moveShow(data.data) // 传递节点数据,用来获取id做比对
|
||||||
this.dialogDeviceMsgVisible = true
|
this.dialogDeviceMsgVisible = true
|
||||||
this.device_code = data.data.properties.device
|
this.device_code = data.data.properties.device
|
||||||
this.tops = data.e.y + 'px'
|
this.tops = data.e.y + 'px'
|
||||||
@@ -252,7 +252,7 @@ export default {
|
|||||||
this.timer = setInterval(() => { // 定时刷新设备的状态信息
|
this.timer = setInterval(() => { // 定时刷新设备的状态信息
|
||||||
console.log('定时器启动')
|
console.log('定时器启动')
|
||||||
this.initStatus()
|
this.initStatus()
|
||||||
}, 5000)
|
}, 2000)
|
||||||
},
|
},
|
||||||
editDevice(id) {
|
editDevice(id) {
|
||||||
let item = ''
|
let item = ''
|
||||||
@@ -295,7 +295,7 @@ export default {
|
|||||||
moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息
|
moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息
|
||||||
let item = ''
|
let item = ''
|
||||||
for (const i in this.allDeviceMsg) { // 查找点击节点的id
|
for (const i in this.allDeviceMsg) { // 查找点击节点的id
|
||||||
if (nodeData.data.id === this.allDeviceMsg[i].id) {
|
if (nodeData.id === this.allDeviceMsg[i].id) {
|
||||||
item = this.allDeviceMsg[i]
|
item = this.allDeviceMsg[i]
|
||||||
break // 匹对完退出
|
break // 匹对完退出
|
||||||
}
|
}
|
||||||
@@ -516,6 +516,7 @@ export default {
|
|||||||
getDeviceByCodes(resion).then(res => {
|
getDeviceByCodes(resion).then(res => {
|
||||||
this.allDeviceMsg = res // 拿到所有节点的设备数据
|
this.allDeviceMsg = res // 拿到所有节点的设备数据
|
||||||
console.log('initStatus-res', res)
|
console.log('initStatus-res', res)
|
||||||
|
// 实时设置状态信息
|
||||||
for (var item of res) { // 循环并且设置属性值
|
for (var item of res) { // 循环并且设置属性值
|
||||||
if (item.data !== undefined) {
|
if (item.data !== undefined) {
|
||||||
if (item.data.isOnline !== undefined) {
|
if (item.data.isOnline !== undefined) {
|
||||||
@@ -535,11 +536,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 设置动态实时显示设备信息
|
||||||
|
const { nodes } = lf.getSelectElements() // 获取选中的节点
|
||||||
|
console.log(nodes)
|
||||||
|
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
|
||||||
|
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dialogSave() {
|
dialogSave() {
|
||||||
deviceCrud.changeDeviceStatus(this.form).then(res => {
|
deviceCrud.changeDeviceStatus(this.form).then(res => {
|
||||||
this.$notify({ title: '操作成功', message: '', type: 'success' });
|
this.$notify({ title: '操作成功', message: '', type: 'success' })
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
this.dialogFormVisible3 = false
|
this.dialogFormVisible3 = false
|
||||||
this.dialogFormVisible4 = false
|
this.dialogFormVisible4 = false
|
||||||
|
|||||||
Reference in New Issue
Block a user