【功能优化】Bpm:设备日志的展示

This commit is contained in:
YunaiV 2025-01-28 08:32:53 +08:00
parent 3d65f1c599
commit 736b82de18
8 changed files with 32 additions and 14 deletions

View File

@ -151,7 +151,6 @@ export const DeviceApi = {
// 查询设备日志分页
getDeviceLogPage: async (params: any) => {
// TODO @super/iot/log-page 或者 /iot/log/page
return await request.get({ url: `/iot/device/data/log/page`, params })
return await request.get({ url: `/iot/device/log/page`, params })
}
}

View File

@ -1,3 +1,4 @@
<!-- TODO 芋艿 review -->
<template>
<Dialog title="查看数据" v-model="dialogVisible">
<ContentWrap>
@ -57,7 +58,7 @@ import { DeviceApi, DeviceHistoryDataVO, DeviceVO } from '@/api/iot/device/devic
import { ProductVO } from '@/api/iot/product/product'
import { beginOfDay, dateFormatter, endOfDay, formatDate } from '@/utils/formatTime'
const props = defineProps<{ product: ProductVO; device: DeviceVO }>()
defineProps<{ product: ProductVO; device: DeviceVO }>()
/** IoT 设备 数据详情 */
defineOptions({ name: 'IoTDeviceDataDetail' })

View File

@ -1,3 +1,4 @@
<!-- 设备信息头部 -->
<template>
<div>
<div class="flex items-start justify-between">

View File

@ -1,3 +1,4 @@
<!-- 设备信息 -->
<template>
<ContentWrap>
<el-collapse v-model="activeNames">

View File

@ -1,9 +1,10 @@
<!-- 设备日志 -->
<template>
<ContentWrap>
<!-- 搜索区域 -->
<el-form :model="queryParams" inline>
<el-form-item>
<el-select v-model="queryParams.type" placeholder="所有" class="!w-120px">
<el-select v-model="queryParams.type" placeholder="所有" class="!w-160px">
<el-option label="所有" value="" />
<!-- TODO @super搞成枚举 -->
<el-option label="状态" value="state" />
@ -13,13 +14,22 @@
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="queryParams.keyword" placeholder="日志识符" class="!w-200px" />
<el-input v-model="queryParams.identifier" placeholder="日志识符" class="!w-200px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-switch v-model="autoRefresh" class="ml-10px" /> 定时刷新
<el-switch
size="large"
width="80"
v-model="autoRefresh"
class="ml-20px"
inline-prompt
active-text="定时刷新"
inactive-text="定时刷新"
style="--el-switch-on-color: #13ce66"
/>
</el-form-item>
</el-form>
@ -31,7 +41,8 @@
</template>
</el-table-column>
<el-table-column label="类型" align="center" prop="type" width="120" />
<el-table-column label="名称(标识符)" align="center" prop="subType" width="120" />
<!-- TODO @super标识符需要翻译 -->
<el-table-column label="标识符" align="center" prop="identifier" width="120" />
<el-table-column label="内容" align="center" prop="content" :show-overflow-tooltip="true" />
</el-table>
@ -55,12 +66,11 @@ const props = defineProps<{
deviceKey: string
}>()
//TODO:使 type subType
//
const queryParams = reactive({
deviceKey: props.deviceKey,
// type: '',
// keyword: '',
type: '',
identifier: '',
pageNo: 1,
pageSize: 10
})
@ -68,8 +78,7 @@ const queryParams = reactive({
//
const loading = ref(false)
const total = ref(0)
// TODO @super table
const logList = ref([])
const logList = ref([]) // TODO @superlogList -> list table
const autoRefresh = ref(false)
let timer: any = null // TODO @superautoRefreshEnableautoRefreshTimer
@ -140,7 +149,7 @@ watch(autoRefresh, (newValue) => {
}
})
/** 监听设备 ID 变化 */
/** 监听设备标识变化 */
watch(
() => props.deviceKey,
(newValue) => {

View File

@ -1,3 +1,4 @@
<!-- 设备物模型运行状态属性事件管理服务调用 -->
<template>
<ContentWrap>
<el-tabs v-model="activeTab">

View File

@ -1,3 +1,4 @@
<!-- 模拟设备 -->
<template>
<ContentWrap>
<el-row :gutter="20">
@ -17,9 +18,11 @@
:stripe="true"
>
<!-- TODO @super每个 colum 搞下宽度避免 table 每一列最后有个 . -->
<!-- TODO @super可以左侧 fixed -->
<el-table-column align="center" label="功能名称" prop="name" />
<el-table-column align="center" label="标识符" prop="identifier" />
<el-table-column align="center" label="数据类型" prop="identifier">
<!-- TODO @super不用翻译可以减少宽度的占用 -->
<template #default="{ row }">
{{ dataTypeOptionsLabel(row.property?.dataType) ?? '-' }}
</template>
@ -76,6 +79,7 @@
{{ `${item.name}-${item.value}` }}
</div>
</div>
<!-- TODO @super要不要兜底下没翻译的类型直接展示 json -->
</template>
<!-- 服务 -->
<div v-if="row.type === ThingModelType.SERVICE">
@ -87,12 +91,14 @@
</div>
</template>
</el-table-column>
<!-- TODO @super可以右侧 fixed -->
<el-table-column label="值" align="center" width="80">
<template #default="scope">
<el-input v-model="scope.row.simulateValue" class="!w-60px" />
</template>
</el-table-column>
</el-table>
<!-- TODO @super发送按钮可以放在右侧哈因为我们的 simulateValue 就在最右侧 -->
<div class="mt-10px">
<el-button
type="primary"
@ -109,6 +115,7 @@
<!-- TODO @super待实现 -->
<el-tab-pane label="事件上报" name="event">
<ContentWrap>
<!-- TODO @super因为事件是每个 event 去模拟而不是类似属性的批量上传所以可以每一列后面有个模拟按钮另外使用 textarea高度 3 -->
<!-- <el-table v-loading="loading" :data="eventList" :stripe="true">
<el-table-column label="功能名称" align="center" prop="name" />
<el-table-column label="标识符" align="center" prop="identifier" />

View File

@ -17,7 +17,6 @@
<el-tab-pane label="子设备管理" v-if="product.deviceType === DeviceTypeEnum.GATEWAY" />
<el-tab-pane label="设备影子" />
<el-tab-pane label="设备日志" name="log">
<!-- TODO @super字段类型:device-keyidea 会告警应该是 string -->
<DeviceDetailsLog v-if="activeTab === 'log'" :device-key="device.deviceKey" />
</el-tab-pane>
<el-tab-pane label="模拟设备" name="simulator">