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
430a8830
Commit
430a8830
authored
Aug 13, 2020
by
wends
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 增加跳转
parent
31ed8676
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
44 deletions
+93
-44
index.vue
src/views/device-alarm/alarm-show/index.vue
+58
-9
index.vue
src/views/device-management/device-detail/index.vue
+9
-6
index.vue
src/views/device-management/device-monitoring/index.vue
+6
-11
index.vue
src/views/device-management/history-data/index.vue
+6
-11
index.vue
src/views/equipment-management/device-instance/index.vue
+14
-7
No files found.
src/views/device-alarm/alarm-show/index.vue
View file @
430a8830
...
...
@@ -2,22 +2,42 @@
<div>
<el-card
class=
"no-bottom"
>
<el-form
ref=
"
searchF
orm"
:model=
"
searchF
orm"
ref=
"
f
orm"
:model=
"
f
orm"
label-width=
"80px"
inline
>
<el-form-item
label=
"设备类型:"
prop=
"deviceType"
>
<el-select
v-model=
"form.deviceType"
@
change=
"onDeviceTypeChange"
>
<el-option
v-for=
"(deviceType, index) in deviceTypeList"
:key=
"index"
:label=
"deviceType.name"
:value=
"deviceType.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"设备实例:"
prop=
"deviceInstance"
>
<el-select
v-model=
"form.deviceInstance"
placeholder=
"请选择"
>
<el-option
v-for=
"(deviceInstance, index) in deviceInstanceList"
:key=
"index"
:label=
"deviceInstance.name"
:value=
"deviceInstance.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"设备名称:"
prop=
"deviceName"
>
<el-input
v-model=
"
searchF
orm.deviceName"
/>
<el-input
v-model=
"
f
orm.deviceName"
/>
</el-form-item>
<el-form-item
label=
"告警等级:"
prop=
"alarmLevel"
>
<el-select
v-model=
"
searchF
orm.alarmLevel"
>
<el-select
v-model=
"
f
orm.alarmLevel"
>
<el-option
label=
"故障"
:value=
"1"
/>
<el-option
label=
"警告"
:value=
"2"
/>
</el-select>
...
...
@@ -155,6 +175,8 @@
<
script
>
import
{
getTableData
}
from
'
@/api/device-alarm/alarm-show
'
import
dictionary
from
'
@/utils/dictionary
'
import
{
getAllDeviceModel
}
from
'
@/api/equipment-management/equipment-instance
'
import
{
getAllInstanceByDeviceTypeId
}
from
'
@/api/data-visible/dashboard
'
export
default
{
name
:
'
AlarmShow
'
,
mixins
:
[
...
...
@@ -163,11 +185,15 @@ export default {
props
:
{},
data
()
{
return
{
searchForm
:
{
form
:
{
deviceType
:
null
,
deviceInstance
:
null
,
deviceName
:
null
,
alarmLevel
:
null
},
add
:
true
,
deviceTypeList
:
[],
deviceInstanceList
:
[],
dialogVisible
:
false
,
tableData
:
[],
detailItem
:
{
...
...
@@ -191,14 +217,37 @@ export default {
}
},
created
()
{
this
.
getTableData
()
const
{
deviceTypeId
,
deviceInstanceId
}
=
this
.
$route
.
query
getAllDeviceModel
()
.
then
(
res
=>
{
this
.
deviceTypeList
=
res
.
data
this
.
form
.
deviceType
=
deviceTypeId
||
this
.
deviceTypeList
.
length
?
this
.
deviceTypeList
[
0
].
id
:
null
})
.
then
(
_
=>
getAllInstanceByDeviceTypeId
({
deviceTypeId
:
this
.
form
.
deviceType
}))
.
then
(
res
=>
{
this
.
deviceInstanceList
=
res
.
data
this
.
form
.
deviceInstance
=
deviceInstanceId
||
this
.
deviceInstanceList
.
length
?
this
.
deviceInstanceList
[
0
].
id
:
null
})
.
then
(
_
=>
this
.
getTableData
(
1
))
.
catch
(
_
=>
{})
},
mounted
()
{},
methods
:
{
onDeviceTypeChange
(
val
)
{
this
.
getAllInstanceByDeviceTypeId
(
val
)
},
getAllInstanceByDeviceTypeId
(
val
,
deviceInstanceId
)
{
getAllInstanceByDeviceTypeId
({
deviceTypeId
:
val
})
.
then
(
res
=>
{
this
.
deviceInstanceList
=
res
.
data
this
.
form
.
deviceInstance
=
deviceInstanceId
||
this
.
deviceInstanceList
.
length
?
this
.
deviceInstanceList
[
0
].
id
:
null
})
.
catch
(
_
=>
{})
},
getTableData
(
pageNum
)
{
const
params
=
{
...
this
.
searchF
orm
,
pageNum
:
this
.
pageForm
.
pageNum
,
...
this
.
f
orm
,
pageNum
:
pageNum
,
pageSize
:
this
.
pageForm
.
pageSize
}
getTableData
(
params
)
...
...
@@ -210,7 +259,7 @@ export default {
.
catch
(
err
=>
console
.
error
(
err
))
},
resetForm
()
{
this
.
$refs
.
searchF
orm
.
resetFields
()
this
.
$refs
.
f
orm
.
resetFields
()
},
addRow
()
{
this
.
add
=
true
...
...
src/views/device-management/device-detail/index.vue
View file @
430a8830
...
...
@@ -125,13 +125,12 @@ export default {
}
},
created
()
{
const
{
deviceTypeId
,
deviceInstanceId
}
=
this
.
$route
.
query
getAllDeviceModel
()
.
then
(
res
=>
{
this
.
deviceTypeList
=
res
.
data
if
(
this
.
deviceTypeList
.
length
)
{
this
.
form
.
deviceType
=
this
.
deviceTypeList
[
0
].
id
}
this
.
getAllInstanceByDeviceTypeId
(
this
.
form
.
deviceType
)
this
.
form
.
deviceType
=
deviceTypeId
||
(
this
.
deviceTypeList
.
length
?
this
.
deviceTypeList
[
0
].
id
:
null
)
this
.
getAllInstanceByDeviceTypeId
(
this
.
form
.
deviceType
,
deviceInstanceId
)
this
.
getDataModelByDeviceTypeId
(
this
.
form
.
deviceType
)
})
.
catch
(
_
=>
{})
...
...
@@ -141,13 +140,17 @@ export default {
this
.
getAllInstanceByDeviceTypeId
(
val
)
this
.
getDataModelByDeviceTypeId
(
val
)
},
getAllInstanceByDeviceTypeId
(
val
)
{
getAllInstanceByDeviceTypeId
(
val
,
deviceInstanceId
)
{
getAllInstanceByDeviceTypeId
({
deviceTypeId
:
val
})
.
then
(
res
=>
{
this
.
deviceInstanceList
=
res
.
data
if
(
this
.
deviceInstanceList
.
length
)
{
if
(
deviceInstanceId
)
{
this
.
form
.
deviceInstance
=
deviceInstanceId
}
else
{
this
.
form
.
deviceInstance
=
this
.
deviceInstanceList
[
0
].
id
}
}
})
.
catch
(
_
=>
{})
},
...
...
src/views/device-management/device-monitoring/index.vue
View file @
430a8830
...
...
@@ -178,35 +178,30 @@ export default {
}
},
created
()
{
const
{
deviceTypeId
,
deviceInstanceId
}
=
this
.
$route
.
query
this
.
timer
&&
clearInterval
(
this
.
timer
)
this
.
init
()
this
.
init
(
deviceTypeId
,
deviceInstanceId
)
},
beforeDestroy
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
)
},
methods
:
{
async
init
()
{
async
init
(
deviceTypeId
,
deviceInstanceId
)
{
// 获取所有设备类型
const
deviceTypeList
=
await
getAllDeviceModel
()
this
.
deviceTypeList
=
deviceTypeList
.
data
if
(
this
.
deviceTypeList
.
length
)
{
this
.
form
.
deviceType
=
this
.
deviceTypeList
[
0
].
id
}
this
.
form
.
deviceType
=
deviceTypeId
||
(
this
.
deviceTypeList
.
length
?
this
.
deviceTypeList
[
0
].
id
:
null
)
// 获取该设备类型下的设备实例
const
deviceInstanceList
=
await
getAllInstanceByDeviceTypeId
({
deviceTypeId
:
this
.
form
.
deviceType
})
this
.
deviceInstanceList
=
deviceInstanceList
.
data
if
(
this
.
deviceInstanceList
.
length
)
{
this
.
form
.
deviceInstance
=
this
.
deviceInstanceList
[
0
].
id
}
this
.
form
.
deviceInstance
=
deviceInstanceId
||
(
this
.
deviceInstanceList
.
length
?
this
.
deviceInstanceList
[
0
].
id
:
null
)
// 根据设备类型 ID 获取关联数据模型
const
dataModelList
=
await
getDataModelByDeviceTypeId
({
id
:
this
.
form
.
deviceType
})
this
.
dataModelList
=
dataModelList
.
data
if
(
this
.
dataModelList
.
length
)
{
this
.
form
.
dataMode
=
this
.
dataModelList
[
0
].
id
this
.
propertyList
=
this
.
dataModelList
[
0
].
propertyList
if
(
this
.
propertyList
.
length
)
{
this
.
activeProperty
=
this
.
propertyList
[
0
].
propertyCode
}
this
.
activeProperty
=
this
.
propertyList
.
length
?
this
.
propertyList
[
0
].
propertyCode
:
null
}
// // 查询图表数据
await
this
.
queryData
()
...
...
src/views/device-management/history-data/index.vue
View file @
430a8830
...
...
@@ -228,35 +228,30 @@ export default {
}
},
created
()
{
const
{
deviceTypeId
,
deviceInstanceId
}
=
this
.
$route
.
query
const
now
=
new
Date
().
getTime
()
const
beginTime
=
new
Date
(
now
-
1000
*
3600
*
24
*
7
)
const
endTime
=
new
Date
(
now
)
this
.
form
.
startAndEndTime
=
[
beginTime
,
endTime
]
this
.
init
()
this
.
init
(
deviceTypeId
,
deviceInstanceId
)
},
methods
:
{
async
init
()
{
async
init
(
deviceTypeId
,
deviceInstanceId
)
{
// 获取所有设备类型
const
deviceTypeList
=
await
getAllDeviceModel
()
this
.
deviceTypeList
=
deviceTypeList
.
data
if
(
this
.
deviceTypeList
.
length
)
{
this
.
form
.
deviceType
=
this
.
deviceTypeList
[
0
].
id
}
this
.
form
.
deviceType
=
deviceTypeId
||
(
this
.
deviceTypeList
.
length
?
this
.
deviceTypeList
[
0
].
id
:
null
)
// 获取该设备类型下的设备实例
const
deviceInstanceList
=
await
getAllInstanceByDeviceTypeId
({
deviceTypeId
:
this
.
form
.
deviceType
})
this
.
deviceInstanceList
=
deviceInstanceList
.
data
if
(
this
.
deviceInstanceList
.
length
)
{
this
.
form
.
deviceInstance
=
this
.
deviceInstanceList
[
0
].
id
}
this
.
form
.
deviceInstance
=
deviceInstanceId
||
(
this
.
deviceInstanceList
.
length
?
this
.
deviceInstanceList
[
0
].
id
:
null
)
// 根据设备类型 ID 获取关联数据模型
const
dataModelList
=
await
getDataModelByDeviceTypeId
({
id
:
this
.
form
.
deviceType
})
this
.
dataModelList
=
dataModelList
.
data
if
(
this
.
dataModelList
.
length
)
{
this
.
form
.
dataMode
=
this
.
dataModelList
[
0
].
id
this
.
propertyList
=
this
.
dataModelList
[
0
].
propertyList
if
(
this
.
propertyList
.
length
)
{
this
.
activeProperty
=
this
.
propertyList
[
0
].
propertyCode
}
this
.
activeProperty
=
this
.
propertyList
.
length
?
this
.
propertyList
[
0
].
propertyCode
:
null
}
// 查询图表数据
await
this
.
queryData
()
...
...
src/views/equipment-management/device-instance/index.vue
View file @
430a8830
...
...
@@ -87,18 +87,24 @@
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"goto('/device-management/device-detail')"
@
click=
"goto('/device-management/device-detail'
, scope.row
)"
>
详情
</el-button>
<el-button
type=
"text"
@
click=
"goto('/device-management/device-monitoring')"
@
click=
"goto('/device-management/device-monitoring'
, scope.row
)"
>
监控
</el-button>
<el-button
type=
"text"
@
click=
"goto('/device-management/history-data')"
@
click=
"goto('/device-management/history-data'
, scope.row
)"
>
历史数据
</el-button>
<el-button
type=
"text"
@
click=
"goto('/device-alarm/alarm-show')"
>
告警历史
</el-button>
<el-button
type=
"text"
@
click=
"editItem(scope.row)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"goto('/device-alarm/alarm-show', scope.row)"
>
告警历史
</el-button>
<el-button
type=
"text"
@
click=
"editItem(scope.row)"
>
编辑
</el-button>
<el-popconfirm
title=
"确定要删除此条记录吗?"
style=
"margin-left: 10px"
...
...
@@ -234,8 +240,9 @@ export default {
this
.
dialogVisible
=
true
this
.
add
=
true
},
goto
(
url
)
{
this
.
$router
.
push
(
url
)
goto
(
url
,
row
)
{
const
{
id
,
deviceTypeId
}
=
row
this
.
$router
.
push
({
path
:
url
,
query
:
{
deviceTypeId
,
deviceInstanceId
:
id
}})
},
getTableData
(
pageNum
)
{
const
params
=
{
...
...
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