diff --git a/src/App.vue b/src/App.vue index 15ece4f..d8d4f83 100644 --- a/src/App.vue +++ b/src/App.vue @@ -366,11 +366,21 @@ export default { this.isWebSocketConnected = false this.isProcessingAlarm = false }, + saveLo(e) { + let localStorageData = localStorage.getItem('ERROR') + let data = {} + if (localStorageData) { + data = JSON.parse(localStorageData) + } + data.push(e) + localStorage.setItem('ERROR', JSON.stringify(data)) + }, selectOffLineDevice() { Object.keys(this.isOnline).forEach(key => { // console.log(key, new Date().getTime() - this.isOnline[key]) if (new Date().getTime() - this.isOnline[key] > (1000 * 60 * 60)) { console.log('error', key) + this.saveLo(key) this.$confirm(`设备${key}已离线`, '设备离线', { cancelButtonText: '关闭', showConfirmButton: false,