Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d256d70d
authored
Nov 10, 2024
by
安浩浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改功能】IOT:设备历史数据展示
parent
5243f584
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
src/api/iot/device/index.ts
+2
-2
src/views/iot/device/detail/DeviceDetailsModel.vue
+5
-4
src/views/iot/device/detail/index.vue
+6
-8
No files found.
src/api/iot/device/index.ts
View file @
d256d70d
...
@@ -93,11 +93,11 @@ export const DeviceApi = {
...
@@ -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
})
}
}
}
}
src/views/iot/device/detail/DeviceDetailsModel.vue
View file @
d256d70d
<
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 @@
...
@@ -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({
...
@@ -94,6 +94,7 @@ const queryParams = reactive({
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
const
activeTab
=
ref
(
'status'
)
// 默认选中的标签
/** 查询列表 */
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
...
...
src/views/iot/device/detail/index.vue
View file @
d256d70d
...
@@ -6,13 +6,13 @@
...
@@ -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) // 编号
...
@@ -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) => {
...
@@ -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
()
// 路由
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment