|
|
@ -37,8 +37,8 @@ export default { |
|
|
|
{ code: '25', active: false, name: '专用电梯(四楼)' }, |
|
|
|
{ code: '26', active: false, name: 'CCU导管室' }, |
|
|
|
], |
|
|
|
num: 0, //当前正在展示的div |
|
|
|
t: null, |
|
|
|
num: null, //当前正在展示的div |
|
|
|
timer: null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -51,11 +51,18 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
rfidMessage: { |
|
|
|
handler(value) { |
|
|
|
rfidMessage(value) { |
|
|
|
if (value && value.step) { |
|
|
|
if (this.timer) { |
|
|
|
clearInterval(this.timer); |
|
|
|
this.timer = null; |
|
|
|
} |
|
|
|
this.setLight(value.step); |
|
|
|
}, |
|
|
|
deep: true, |
|
|
|
} else { |
|
|
|
if (!this.timer && this.num === null) { |
|
|
|
this.setTime(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
@ -63,8 +70,9 @@ export default { |
|
|
|
if (this.rfidMessage && this.rfidMessage.step) { |
|
|
|
this.setLight(this.rfidMessage.step); |
|
|
|
} else { |
|
|
|
this.setLight(); |
|
|
|
this.setTime(); |
|
|
|
} |
|
|
|
// this.setTime(); |
|
|
|
// this.changePage(); |
|
|
|
}, |
|
|
|
|
|
|
@ -82,9 +90,10 @@ export default { |
|
|
|
// 定时高亮 |
|
|
|
setTime() { |
|
|
|
let i = 0; |
|
|
|
this.t = setInterval(() => { |
|
|
|
this.timer = setInterval(() => { |
|
|
|
this.lists.forEach((element, j) => { |
|
|
|
if (j === i) { |
|
|
|
// debugger; |
|
|
|
element.active = true; |
|
|
|
// 翻页 |
|
|
|
for (let a = 0; a < this.newArr.length; a++) { |
|
|
@ -118,26 +127,25 @@ export default { |
|
|
|
|
|
|
|
// 收到消息高亮 |
|
|
|
setLight(step) { |
|
|
|
if (step) { |
|
|
|
clearInterval(this.t); |
|
|
|
this.lists.forEach((element, j) => { |
|
|
|
if (element.code === step) { |
|
|
|
element.active = true; |
|
|
|
// 翻页 |
|
|
|
for (let a = 0; a < this.newArr.length; a++) { |
|
|
|
const arr = this.newArr[a]; |
|
|
|
const item = arr.find(item => item.name === element.name); |
|
|
|
if (item) { |
|
|
|
this.num = a; |
|
|
|
} |
|
|
|
if (this.timer) { |
|
|
|
clearInterval(this.timer); |
|
|
|
this.timer = null; |
|
|
|
} |
|
|
|
this.lists.forEach((element, j) => { |
|
|
|
if (element.code === step) { |
|
|
|
element.active = true; |
|
|
|
// 翻页 |
|
|
|
for (let a = 0; a < this.newArr.length; a++) { |
|
|
|
const arr = this.newArr[a]; |
|
|
|
const item = arr.find(item => item.name === element.name); |
|
|
|
if (item) { |
|
|
|
this.num = a; |
|
|
|
} |
|
|
|
} else { |
|
|
|
element.active = false; |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.setTime(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
element.active = false; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|