feat:【IoT 物联网】新增告警记录管理功能,包括告警记录接口和前端展示页面
parent
4f99e3839b
commit
cbfd9660a2
|
|
@ -131,7 +131,25 @@
|
||||||
{{ getDeviceName(scope.row.deviceId) }}
|
{{ getDeviceName(scope.row.deviceId) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="触发的设备消息" align="center" prop="deviceMessage" />
|
<el-table-column label="触发的设备消息" align="center" prop="deviceMessage">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
:width="600"
|
||||||
|
trigger="hover"
|
||||||
|
v-if="scope.row.deviceMessage"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button link type="primary">
|
||||||
|
<Icon icon="ep:view" class="mr-5px" />
|
||||||
|
查看消息
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<pre>{{ scope.row.deviceMessage }}</pre>
|
||||||
|
</el-popover>
|
||||||
|
<span v-else class="text-gray-400">-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="是否处理" align="center" prop="processStatus">
|
<el-table-column label="是否处理" align="center" prop="processStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.processStatus" />
|
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.processStatus" />
|
||||||
|
|
@ -210,14 +228,19 @@ const filteredDeviceList = computed(() => {
|
||||||
|
|
||||||
/** 根据产品 ID 获取产品名称 */
|
/** 根据产品 ID 获取产品名称 */
|
||||||
const getProductName = (productId: number) => {
|
const getProductName = (productId: number) => {
|
||||||
|
if (!productId) {
|
||||||
|
return `-`
|
||||||
|
}
|
||||||
const product = productList.value.find((p) => p.id === productId)
|
const product = productList.value.find((p) => p.id === productId)
|
||||||
return product ? product.name : `加载中...`
|
return product ? product.name : `加载中...`
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 根据设备 ID 获取设备名称 */
|
/** 根据设备 ID 获取设备名称 */
|
||||||
const getDeviceName = (deviceId: number) => {
|
const getDeviceName = (deviceId: number) => {
|
||||||
|
if (!deviceId) {
|
||||||
|
return `-`
|
||||||
|
}
|
||||||
const device = deviceList.value.find((d) => d.id === deviceId)
|
const device = deviceList.value.find((d) => d.id === deviceId)
|
||||||
debugger
|
|
||||||
return device ? device.deviceName : `加载中...`
|
return device ? device.deviceName : `加载中...`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue