|
@@ -111,6 +111,7 @@ export default {
|
|
|
return [] // 使用工厂函数返回默认值
|
|
|
}
|
|
|
},
|
|
|
+ // alarmData,
|
|
|
alarmData: {
|
|
|
type: Array,
|
|
|
default: function(){
|
|
@@ -161,7 +162,7 @@ export default {
|
|
|
time2: '',
|
|
|
inform1: '',
|
|
|
inform2: '',
|
|
|
- inform: [],
|
|
|
+ inform: ['暂无数据'],
|
|
|
time: [],
|
|
|
// 测试
|
|
|
// inform: ['Data 1', 'Data 2', 'Data 3', 'Data 4', 'Data 5', 'Data 6', 'Data 7', 'Data 8', 'Data 9'],
|
|
@@ -186,12 +187,21 @@ export default {
|
|
|
var options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' };
|
|
|
// this.information = hasAlarm ? newValue.tagname : '暂无数据'
|
|
|
// this.alarmTime = hasAlarm ? new Date(newValue.logtime.time).toLocaleDateString('zh-CN', options) : ''
|
|
|
- this.inform = hasAlarm ? newValue.map(res => {
|
|
|
+ var nInform = this.inform
|
|
|
+ var nTime = this.time
|
|
|
+ // ['原数据']表示按照原来数据进行,数据并未改变;[]和其他有数据的情况进行赋值并重新获取方法
|
|
|
+ // console.log(hasAlarm.length === 1 && hasAlarm[0] === '原数据')
|
|
|
+ var isYuan = hasAlarm.length === 1 && hasAlarm[0] === '原数据'
|
|
|
+ this.inform = !isYuan ? newValue.map(res => {
|
|
|
return res.tagname
|
|
|
- }): ['暂无数据']
|
|
|
- this.time = hasAlarm ? newValue.map(res => {
|
|
|
+ }): nInform
|
|
|
+ this.time = hasAlarm.length > 0 ? newValue.map(res => {
|
|
|
return res.logtime
|
|
|
- }): []
|
|
|
+ }): nTime
|
|
|
+ // console.log(789, this.inform)
|
|
|
+ if(!isYuan){
|
|
|
+ this.showData()
|
|
|
+ }
|
|
|
},
|
|
|
immediate: true,
|
|
|
deep: true
|
|
@@ -229,6 +239,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
showData() {
|
|
|
+ // console.log(7891,this.inform)
|
|
|
// 如果还有数据未显示
|
|
|
if (this.counter < this.inform.length) {
|
|
|
// 显示当前计数器指向的数据
|