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
815c9000
authored
Jan 28, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能优化】Bpm:完善设备属性的历史值
parent
736b82de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
19 deletions
+18
-19
src/api/iot/device/device/index.ts
+10
-11
src/views/iot/device/device/detail/DeviceDataDetail.vue
+5
-5
src/views/iot/device/device/detail/DeviceDetailsModel.vue
+3
-3
No files found.
src/api/iot/device/device/index.ts
View file @
815c9000
...
...
@@ -128,16 +128,6 @@ export const DeviceApi = {
return
await
request
.
get
({
url
:
`/iot/device/simple-list?`
,
params
:
{
deviceType
}
})
},
// 获取设备属性最���数据
getDevicePropertiesLatestData
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/device/data/latest`
,
params
})
},
// 获取设备属性历史数据
getDevicePropertiesHistoryData
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/device/data/history`
,
params
})
},
// 获取导入模板
importDeviceTemplate
:
async
()
=>
{
return
await
request
.
download
({
url
:
`/iot/device/get-import-template`
})
...
...
@@ -145,10 +135,19 @@ export const DeviceApi = {
// 模拟设备上报
simulationReportDevice
:
async
(
data
:
IotDeviceSimulationReportReqVO
)
=>
{
// TODO @super:/iot/device/simulator
return
await
request
.
post
({
url
:
`/iot/device/simulation-report`
,
data
})
},
// 获取设备属性最新数据
getLatestDeviceProperties
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/device/property/latest`
,
params
})
},
// 获取设备属性历史数据
getHistoryDevicePropertyPage
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/device/property/history-page`
,
params
})
},
// 查询设备日志分页
getDeviceLogPage
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/device/log/page`
,
params
})
...
...
src/views/iot/device/device/detail/DeviceDataDetail.vue
View file @
815c9000
...
...
@@ -37,11 +37,11 @@
<el-table-column
label=
"时间"
align=
"center"
prop=
"
t
ime"
prop=
"
updateT
ime"
:formatter=
"dateFormatter"
width=
"180px"
/>
<el-table-column
label=
"
原始值"
align=
"center"
prop=
"data
"
/>
<el-table-column
label=
"
属性值"
align=
"center"
prop=
"value
"
/>
</el-table>
<!-- 分页 -->
<Pagination
...
...
@@ -72,7 +72,7 @@ const queryParams = reactive({
pageNo
:
1
,
pageSize
:
10
,
deviceId
:
-
1
,
identifier
:
undefined
as
string
|
undefined
,
identifier
:
''
,
times
:
[
// 默认显示最近一周的数据
formatDate
(
beginOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
))),
...
...
@@ -85,7 +85,7 @@ const queryFormRef = ref() // 搜索的表单
const
getList
=
async
()
=>
{
detailLoading
.
value
=
true
try
{
const
data
=
await
DeviceApi
.
get
DevicePropertiesHistoryData
(
queryParams
)
const
data
=
await
DeviceApi
.
get
HistoryDevicePropertyPage
(
queryParams
)
list
.
value
=
data
.
list
total
.
value
=
data
.
total
}
finally
{
...
...
@@ -94,7 +94,7 @@ const getList = async () => {
}
/** 打开弹窗 */
const
open
=
async
(
deviceId
:
number
,
identifier
:
S
tring
)
=>
{
const
open
=
(
deviceId
:
number
,
identifier
:
s
tring
)
=>
{
dialogVisible
.
value
=
true
queryParams
.
deviceId
=
deviceId
queryParams
.
identifier
=
identifier
...
...
src/views/iot/device/device/detail/DeviceDetailsModel.vue
View file @
815c9000
...
...
@@ -57,7 +57,7 @@
<el-button
link
type=
"primary"
@
click=
"openDetail(
scope.row.deviceI
d, scope.row.identifier)"
@
click=
"openDetail(
props.device.i
d, scope.row.identifier)"
>
查看数据
</el-button>
...
...
@@ -102,7 +102,7 @@ const getList = async () => {
loading
.
value
=
true
try
{
queryParams
.
deviceId
=
props
.
device
.
id
list
.
value
=
await
DeviceApi
.
get
DevicePropertiesLatestData
(
queryParams
)
list
.
value
=
await
DeviceApi
.
get
LatestDeviceProperties
(
queryParams
)
}
finally
{
loading
.
value
=
false
}
...
...
@@ -123,7 +123,7 @@ const resetQuery = () => {
/** 添加/修改操作 */
const
detailRef
=
ref
()
const
openDetail
=
(
deviceId
:
number
,
identifier
:
S
tring
)
=>
{
const
openDetail
=
(
deviceId
:
number
,
identifier
:
s
tring
)
=>
{
detailRef
.
value
.
open
(
deviceId
,
identifier
)
}
...
...
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