|
|
|
@ -239,17 +239,17 @@ import { FetchWaitBorrower } from '@/api/archivesManage/lendManage' |
|
|
|
import alarmApi from '@/api/home/alarm' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
import { allDeviceData, mockIpData } from '@/views/environmentalScreen/index.js' |
|
|
|
// import { allDeviceData, mockIpData } from '@/views/environmentalScreen/index.js' |
|
|
|
|
|
|
|
const mockFetchDataForIP = (params) => { |
|
|
|
return new Promise((resolve) => { |
|
|
|
setTimeout(() => { |
|
|
|
const ip = params.ip |
|
|
|
const result = mockIpData[ip] || { code: 200, message: '操作成功', data: [], timestamp: Date.now() } |
|
|
|
resolve(result.data) |
|
|
|
}, 500) |
|
|
|
}) |
|
|
|
} |
|
|
|
// const mockFetchDataForIP = (params) => { |
|
|
|
// return new Promise((resolve) => { |
|
|
|
// setTimeout(() => { |
|
|
|
// const ip = params.ip |
|
|
|
// const result = mockIpData[ip] || { code: 200, message: '操作成功', data: [], timestamp: Date.now() } |
|
|
|
// resolve(result.data) |
|
|
|
// }, 500) |
|
|
|
// }) |
|
|
|
// } |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Dashboard', |
|
|
|
@ -360,23 +360,23 @@ export default { |
|
|
|
* 加载所有设备配置数据 |
|
|
|
*/ |
|
|
|
async loadAllDeviceConfig() { |
|
|
|
this.allDisplayConfigData = allDeviceData |
|
|
|
this.handleDeviceIpList() |
|
|
|
// try { |
|
|
|
// const data = await alarmApi.FetchYpGetSite() |
|
|
|
// if (data && data.length > 0) { |
|
|
|
// this.allDisplayConfigData = data |
|
|
|
// // 处理设备IP列表(仅过滤空IP,无其他排除) |
|
|
|
// this.handleDeviceIpList() |
|
|
|
// } else { |
|
|
|
// this.allDisplayConfigData = [] |
|
|
|
// this.allDeviceIds = [] |
|
|
|
// } |
|
|
|
// } catch (error) { |
|
|
|
// console.error('加载设备配置失败:', error) |
|
|
|
// this.allDisplayConfigData = [] |
|
|
|
// this.allDeviceIds = [] |
|
|
|
// } |
|
|
|
// this.allDisplayConfigData = allDeviceData |
|
|
|
// this.handleDeviceIpList() |
|
|
|
try { |
|
|
|
const data = await alarmApi.FetchYpGetSite() |
|
|
|
if (data && data.length > 0) { |
|
|
|
this.allDisplayConfigData = data |
|
|
|
// 处理设备IP列表(仅过滤空IP,无其他排除) |
|
|
|
this.handleDeviceIpList() |
|
|
|
} else { |
|
|
|
this.allDisplayConfigData = [] |
|
|
|
this.allDeviceIds = [] |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('加载设备配置失败:', error) |
|
|
|
this.allDisplayConfigData = [] |
|
|
|
this.allDeviceIds = [] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|