|
|
|
@ -12,10 +12,11 @@ |
|
|
|
<el-table-column prop="TS" label="时间" align="center" width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.TS">{{ scope.row.TS | formatTs }}</span> |
|
|
|
<!-- <span v-if="scope.row.TS">{{ scope.row.TS | parseTime }}</span> --> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="name" label="设备" align="center" :show-overflow-tooltip="true" width="80" /> |
|
|
|
<el-table-column prop="value" label="警情" align="center" :show-overflow-tooltip="true" min-width="60" /> |
|
|
|
<el-table-column prop="name" label="设备" align="center" :show-overflow-tooltip="true" width="100" /> |
|
|
|
<el-table-column prop="value" label="警情" align="center" :show-overflow-tooltip="true" width="148" /> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -51,13 +52,18 @@ export default { |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
// 如果 `tableData` 发生改变,这个函数就会运行 |
|
|
|
tableData: function(newData, oldData) { |
|
|
|
this.tableRefScroll() |
|
|
|
} |
|
|
|
// tableData: function(newData, oldData) { |
|
|
|
// this.tableRefScroll() |
|
|
|
// } |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getAlarmInfo() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.scrollTimer = setInterval(() => { |
|
|
|
this.getAlarmInfo() |
|
|
|
}, 15000) |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
clearInterval(this.scrollTimer) |
|
|
|
this.scrollTimer = null |
|
|
|
@ -140,8 +146,72 @@ export default { |
|
|
|
}, |
|
|
|
getAlarmInfo() { |
|
|
|
alarmApi.info({ storeroomId: this.storeroomId }).then((data) => { |
|
|
|
// this.tableData = [ |
|
|
|
// { |
|
|
|
// 'id': 'eb6b8653', |
|
|
|
// 'lscid': 0, |
|
|
|
// 'wyid': '', |
|
|
|
// 'itemLevels': 1, |
|
|
|
// 'siteName': '.环境监控', |
|
|
|
// 'TS': 1765944141000, |
|
|
|
// 'isAd': true, |
|
|
|
// 'type': 0, |
|
|
|
// 'ip': '192.168.99.101:6003', |
|
|
|
// 'name': '开关量', |
|
|
|
// 'value': '设备断线', |
|
|
|
// 'dw': '', |
|
|
|
// 'itemClass': 1 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// 'id': 'eeeeeeee', |
|
|
|
// 'lscid': 0, |
|
|
|
// 'wyid': null, |
|
|
|
// 'itemLevels': 1, |
|
|
|
// 'siteName': '红外外线', |
|
|
|
// 'TS': 1765867832000, |
|
|
|
// 'isAd': true, |
|
|
|
// 'type': 0, |
|
|
|
// 'ip': '192.168.99.100', |
|
|
|
// 'name': '红外外线', |
|
|
|
// 'value': '红外线报警', |
|
|
|
// 'dw': null, |
|
|
|
// 'itemClass': 1 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// 'id': 'eb6b8653', |
|
|
|
// 'lscid': 0, |
|
|
|
// 'wyid': '', |
|
|
|
// 'itemLevels': 1, |
|
|
|
// 'siteName': '.环境监控', |
|
|
|
// 'TS': 1765944141000, |
|
|
|
// 'isAd': true, |
|
|
|
// 'type': 0, |
|
|
|
// 'ip': '192.168.99.101:6003', |
|
|
|
// 'name': '开关量', |
|
|
|
// 'value': '设备断线', |
|
|
|
// 'dw': '', |
|
|
|
// 'itemClass': 1 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// 'id': 'eeeeeeee', |
|
|
|
// 'lscid': 0, |
|
|
|
// 'wyid': null, |
|
|
|
// 'itemLevels': 1, |
|
|
|
// 'siteName': '红外外线', |
|
|
|
// 'TS': 1765867832000, |
|
|
|
// 'isAd': true, |
|
|
|
// 'type': 0, |
|
|
|
// 'ip': '192.168.99.100', |
|
|
|
// 'name': '红外外线', |
|
|
|
// 'value': '红外线报警', |
|
|
|
// 'dw': null, |
|
|
|
// 'itemClass': 1 |
|
|
|
// } |
|
|
|
// ] |
|
|
|
this.tableData = [] |
|
|
|
if (data && data.length > 0) { |
|
|
|
this.tableData.splice(0, data.length, ...data) |
|
|
|
// this.tableData.splice(0, data.length, ...data) |
|
|
|
this.tableData = data |
|
|
|
} else { |
|
|
|
this.tableData = [] |
|
|
|
} |
|
|
|
|