【修改功能】IOT:设备历史数据展示

pull/620/head
安浩浩 2024-11-10 20:23:32 +08:00
parent 5243f5849f
commit d256d70d92
3 changed files with 13 additions and 14 deletions

View File

@ -93,11 +93,11 @@ export const DeviceApi = {
// 获取设备属性最新数据 // 获取设备属性最新数据
getDevicePropertiesLatestData: async (params: any) => { getDevicePropertiesLatestData: async (params: any) => {
return await request.get({ url: `/iot/device/data/latest-data`, params }) return await request.get({ url: `/iot/device/data/latest`, params })
}, },
// 获取设备属性历史数据 // 获取设备属性历史数据
getDevicePropertiesHistoryData: async (params: any) => { getDevicePropertiesHistoryData: async (params: any) => {
return await request.get({ url: `/iot/device/data/history-data`, params }) return await request.get({ url: `/iot/device/data/history`, params })
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<el-tabs> <el-tabs v-model="activeTab">
<el-tab-pane label="运行状态"> <el-tab-pane label="运行状态" name="status">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -68,10 +68,10 @@
<DeviceDataDetail ref="detailRef" :device="device" :product="product" /> <DeviceDataDetail ref="detailRef" :device="device" :product="product" />
</ContentWrap> </ContentWrap>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="事件管理"> <el-tab-pane label="事件管理" name="event">
<p>事件管理</p> <p>事件管理</p>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="服务调用"> <el-tab-pane label="服务调用" name="service">
<p>服务调用</p> <p>服务调用</p>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -94,6 +94,7 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const activeTab = ref('status') //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {

View File

@ -6,13 +6,13 @@
@refresh="getDeviceData(id)" @refresh="getDeviceData(id)"
/> />
<el-col> <el-col>
<el-tabs> <el-tabs v-model="activeTab">
<el-tab-pane label="设备信息"> <el-tab-pane label="设备信息" name="info">
<DeviceDetailsInfo :product="product" :device="device" /> <DeviceDetailsInfo v-if="activeTab === 'info'" :product="product" :device="device" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Topic 列表" /> <el-tab-pane label="Topic 列表" />
<el-tab-pane label="物模型数据"> <el-tab-pane label="物模型数据" name="model">
<DeviceDetailsModel :product="product" :device="device" /> <DeviceDetailsModel v-if="activeTab === 'model'" :product="product" :device="device" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="子设备管理" v-if="product.deviceType === DeviceTypeEnum.GATEWAY" /> <el-tab-pane label="子设备管理" v-if="product.deviceType === DeviceTypeEnum.GATEWAY" />
<el-tab-pane label="设备影子" /> <el-tab-pane label="设备影子" />
@ -35,6 +35,7 @@ const id = Number(route.params.id) // 编号
const loading = ref(true) // const loading = ref(true) //
const product = ref<ProductVO>({} as ProductVO) // const product = ref<ProductVO>({} as ProductVO) //
const device = ref<DeviceVO>({} as DeviceVO) // const device = ref<DeviceVO>({} as DeviceVO) //
const activeTab = ref('info') //
/** 获取设备详情 */ /** 获取设备详情 */
const getDeviceData = async (id: number) => { const getDeviceData = async (id: number) => {
@ -51,11 +52,8 @@ const getDeviceData = async (id: number) => {
/** 获取产品详情 */ /** 获取产品详情 */
const getProductData = async (id: number) => { const getProductData = async (id: number) => {
product.value = await ProductApi.getProduct(id) product.value = await ProductApi.getProduct(id)
console.log(product.value)
} }
/** 获取物模型 */
/** 初始化 */ /** 初始化 */
const { delView } = useTagsViewStore() // const { delView } = useTagsViewStore() //
const { currentRoute } = useRouter() // const { currentRoute } = useRouter() //