【功能优化】Bpm:完善设备属性的历史值

This commit is contained in:
YunaiV 2025-01-28 12:05:07 +08:00
parent 815c900064
commit fec0753d9b
4 changed files with 14 additions and 20 deletions

View File

@ -1,4 +1,4 @@
<!-- TODO 芋艿 review -->
<!-- 设备物模型 -> 运行状态 -> 查看数据设备的属性值历史-->
<template>
<Dialog title="查看数据" v-model="dialogVisible">
<ContentWrap>
@ -32,6 +32,9 @@
</el-form-item>
</el-form>
</ContentWrap>
<!-- TODO @haohao可参考阿里云 IoT改成图标表格两个选项 -->
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="detailLoading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column

View File

@ -34,10 +34,10 @@
</el-form>
<!-- 日志列表 -->
<el-table v-loading="loading" :data="logList" :stripe="true" class="whitespace-nowrap">
<el-table-column label="时间" align="center" prop="time" width="180">
<el-table v-loading="loading" :data="list" :stripe="true" class="whitespace-nowrap">
<el-table-column label="时间" align="center" prop="ts" width="180">
<template #default="scope">
{{ formatDate(scope.row.time) }}
{{ formatDate(scope.row.ts) }}
</template>
</el-table-column>
<el-table-column label="类型" align="center" prop="type" width="120" />
@ -78,7 +78,7 @@ const queryParams = reactive({
//
const loading = ref(false)
const total = ref(0)
const logList = ref([]) // TODO @superlogList -> list table
const list = ref([])
const autoRefresh = ref(false)
let timer: any = null // TODO @superautoRefreshEnableautoRefreshTimer
@ -96,18 +96,9 @@ const getLogList = async () => {
if (!props.deviceKey) return
loading.value = true
try {
const res = await DeviceApi.getDeviceLogPage(queryParams)
total.value = res.total
// TODO @super
logList.value = res.list.map((item: any) => {
const log = {
time: item.reportTime,
type: item.type,
subType: item.subType,
content: item.content
}
return log
})
const data = await DeviceApi.getDeviceLogPage(queryParams)
total.value = data.total
list.value = data.list
} finally {
loading.value = false
}

View File

@ -44,6 +44,7 @@
<el-table-column label="属性标识符" align="center" prop="identifier" />
<el-table-column label="属性名称" align="center" prop="name" />
<el-table-column label="数据类型" align="center" prop="dataType" />
<el-table-column label="属性值" align="center" prop="value" />
<el-table-column
label="更新时间"
align="center"
@ -51,7 +52,6 @@
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="最新值" align="center" prop="value" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
@ -59,7 +59,7 @@
type="primary"
@click="openDetail(props.device.id, scope.row.identifier)"
>
查看数据
历史
</el-button>
</template>
</el-table-column>

View File

@ -75,6 +75,6 @@ onMounted(async () => {
return
}
await getDeviceData(id)
activeTab.value = route.query.tab as string
activeTab.value = (route.query.tab as string) || 'info'
})
</script>