Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
super-hive-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
front-end
super-hive-web
Commits
22b3f912
Commit
22b3f912
authored
Aug 14, 2020
by
wends
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 设备监控
parent
6abc3a90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
index.vue
src/views/device-management/device-monitoring/index.vue
+13
-5
No files found.
src/views/device-management/device-monitoring/index.vue
View file @
22b3f912
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"queryData"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"queryData"
>
查询
</el-button>
<el-button
v-if=
"false"
@
click=
"clearIntervalT"
>
clear
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</el-card>
</el-card>
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
v-for=
"(property, index) in dataModelDetail"
v-for=
"(property, index) in dataModelDetail"
:key=
"index"
:key=
"index"
:label=
"property.propertyName"
:label=
"property.propertyName"
:value=
"
`$
{property.propertyValue} ${property.propertyUnit}`
"
:value=
"
formatProperty(property)
"
/>
/>
</el-card>
</el-card>
<el-card
class=
"margin-top-20"
>
<el-card
class=
"margin-top-20"
>
...
@@ -195,6 +196,9 @@ export default {
...
@@ -195,6 +196,9 @@ export default {
this
.
timer
&&
clearInterval
(
this
.
timer
)
this
.
timer
&&
clearInterval
(
this
.
timer
)
},
},
methods
:
{
methods
:
{
clearIntervalT
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
)
},
async
init
(
deviceTypeId
,
deviceInstanceId
)
{
async
init
(
deviceTypeId
,
deviceInstanceId
)
{
// 获取所有设备类型
// 获取所有设备类型
const
deviceTypeList
=
await
getAllDeviceModel
()
const
deviceTypeList
=
await
getAllDeviceModel
()
...
@@ -243,15 +247,19 @@ export default {
...
@@ -243,15 +247,19 @@ export default {
}]
}]
})
})
.
then
(
params
=>
{
.
then
(
params
=>
{
const
{
dataMode
,
deviceInstance
}
=
this
.
form
this
.
timer
&&
clearInterval
(
this
.
timer
)
this
.
timer
&&
clearInterval
(
this
.
timer
)
this
.
timer
=
setInterval
(
async
()
=>
{
this
.
timer
=
setInterval
(
async
()
=>
{
await
this
.
getPropertyDetail
(
this
.
form
.
dataMode
,
this
.
form
.
deviceInstance
)
await
this
.
getPropertyDetail
(
dataMode
,
deviceInstance
)
const
chartData
=
await
getModelInstanceChart
(
params
)
const
chartData
=
await
getModelInstanceChart
(
params
)
this
.
tableData
=
chartData
.
data
[
0
].
dataList
this
.
tableData
=
chartData
.
data
[
0
].
dataList
this
.
property
.
data
=
[...
this
.
getChartData
(
this
.
activeProperty
)]
this
.
property
.
data
=
[...
this
.
getChartData
(
this
.
activeProperty
)]
},
this
.
form
.
refresh
*
1000
)
},
this
.
form
.
refresh
*
1000
)
})
})
.
catch
(
_
=>
{})
.
catch
(
e
=>
console
.
error
(
e
))
},
formatProperty
(
property
)
{
return
property
.
propertyValue
?
`
${
property
.
propertyValue
}
${
property
.
propertyUnit
}
`
:
''
},
},
getDeviceInstanceDetail
(
id
)
{
getDeviceInstanceDetail
(
id
)
{
getDeviceInstanceDetail
({
id
})
getDeviceInstanceDetail
({
id
})
...
@@ -270,8 +278,8 @@ export default {
...
@@ -270,8 +278,8 @@ export default {
getPropertyDetail
(
dataModelId
,
deviceId
)
{
getPropertyDetail
(
dataModelId
,
deviceId
)
{
getPropertyDetail
({
dataModelId
,
deviceId
})
getPropertyDetail
({
dataModelId
,
deviceId
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
dataModelDetail
=
res
.
data
.
propertyList
this
.
dataModelDetail
=
res
.
data
.
propertyList
.
length
?
res
.
data
.
propertyList
:
[]
this
.
dataModelReportTime
=
res
.
data
.
reportTime
this
.
dataModelReportTime
=
res
.
data
.
reportTime
?
res
.
data
.
reportTime
:
null
})
})
.
catch
(
_
=>
{})
.
catch
(
_
=>
{})
},
},
...
...
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