app1设备详细信息添加

pull/97/head
luoyuehang 5 months ago
parent f4283f3d11
commit 290a430cf0

@ -135,24 +135,35 @@ const fetchDeviceDetail = async () => {
if (response.code === 200) {
const data = response.data
//
const deviceInfoData = data.deviceInfo || {}
//
const realtimeData = data.realtimeData || {}
//
deviceInfo.value = {
id: data.deviceId,
name: data.deviceName || `制水机#${data.deviceId}`,
location: data.installLocation || '未指定位置',
status: data.status || 'offline',
areaId: data.areaId,
installDate: data.installDate,
remark: data.remark,
lastCheckTime: data.lastCheckTime,
createTime: data.createTime,
deviceType: data.deviceType,
//
waterQuality: data.tapWaterTDS !== undefined || data.pureWaterTDS !== undefined || data.mineralWaterTDS !== undefined ? {
tapWaterTDS: data.tapWaterTDS,
pureWaterTDS: data.pureWaterTDS,
mineralWaterTDS: data.mineralWaterTDS
} : undefined
id: deviceInfoData.deviceId,
name: deviceInfoData.deviceName || `制水机#${deviceInfoData.deviceId}`,
location: deviceInfoData.installLocation || '未指定位置',
status: deviceInfoData.status || 'offline',
areaId: deviceInfoData.areaId,
installDate: deviceInfoData.installDate,
remark: deviceInfoData.remark,
lastCheckTime: deviceInfoData.lastCheckTime,
createTime: deviceInfoData.createTime,
deviceType: deviceInfoData.deviceType,
//
waterQuality: realtimeData.tdsValue1 !== undefined || realtimeData.tdsValue2 !== undefined || realtimeData.tdsValue3 !== undefined ? {
tapWaterTDS: realtimeData.tdsValue1,
pureWaterTDS: realtimeData.tdsValue2,
mineralWaterTDS: realtimeData.tdsValue3
} : undefined,
//
waterPress: realtimeData.waterPress,
filterLife: realtimeData.filterLife,
leakage: realtimeData.leakage,
waterQualityStatus: realtimeData.waterQuality,
deviceStatus: realtimeData.status
}
} else {
error.value = response.message || '获取设备详情失败'
@ -225,6 +236,7 @@ onMounted(() => {
<style scoped>
.water-maker-detail {
width: 100%;

@ -230,25 +230,35 @@ const fetchDeviceDetail = async () => {
if (response.code === 200) {
const data = response.data
//
const deviceInfoData = data.deviceInfo || {}
//
const realtimeData = data.realtimeData || {}
//
deviceInfo.value = {
id: data.deviceId,
name: data.deviceName || `供水机#${data.deviceId}`,
location: data.installLocation || '未指定位置',
status: data.status || 'offline',
areaId: data.areaId,
parentMakerId: data.parentMakerId,
installDate: data.installDate,
remark: data.remark,
waterLevel: data.waterLevel,
storageCapacity: data.storageCapacity,
highValve: data.highValve,
lowValve: data.lowValve,
leakStatus: data.leakStatus,
leakDescription: data.leakDescription,
lastCheckTime: data.lastCheckTime,
createTime: data.createTime,
deviceType: data.deviceType
id: deviceInfoData.deviceId,
name: deviceInfoData.deviceName || `供水机#${deviceInfoData.deviceId}`,
location: deviceInfoData.installLocation || '未指定位置',
status: deviceInfoData.status || 'offline',
areaId: deviceInfoData.areaId,
parentMakerId: deviceInfoData.parentMakerId,
installDate: deviceInfoData.installDate,
remark: deviceInfoData.remark,
lastCheckTime: deviceInfoData.lastCheckTime,
createTime: deviceInfoData.createTime,
deviceType: deviceInfoData.deviceType,
//
waterLevel: realtimeData.waterLevel,
storageCapacity: realtimeData.storageCapacity,
highValve: realtimeData.highValveStatus,
lowValve: realtimeData.lowValveStatus,
leakStatus: realtimeData.leakage !== undefined ?
(realtimeData.leakage ? 'leaking' : 'normal') : undefined,
leakDescription: realtimeData.leakage ? '检测到漏水' : '无漏水',
waterPress: realtimeData.waterPress,
temperature: realtimeData.temperature,
deviceStatus: realtimeData.status
}
console.log('设备详情数据:', deviceInfo.value)
@ -403,6 +413,7 @@ onMounted(() => {
<style scoped>
.water-supplier-detail {
width: 100%;

Loading…
Cancel
Save