Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
tFIMS
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dae63e84
authored
Aug 26, 2019
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
系统监控
1 parent
5b6e4973
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
264 additions
and
18 deletions
package.json
src/main.js
src/views/systemMonitor/index.vue
package.json
View file @
dae63e8
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
"better-scroll"
:
"^1.15.2"
,
"better-scroll"
:
"^1.15.2"
,
"core-js"
:
"^2.6.5"
,
"core-js"
:
"^2.6.5"
,
"dayjs"
:
"^1.8.12"
,
"dayjs"
:
"^1.8.12"
,
"echarts"
:
"^4.2.1"
,
"element-ui"
:
"^2.11.1"
,
"element-ui"
:
"^2.11.1"
,
"flex.css"
:
"^1.1.7"
,
"flex.css"
:
"^1.1.7"
,
"fuse.js"
:
"^3.4.4"
,
"fuse.js"
:
"^3.4.4"
,
...
...
src/main.js
View file @
dae63e8
...
@@ -13,6 +13,7 @@ import router from './router'
...
@@ -13,6 +13,7 @@ import router from './router'
// import menuHeader from '@/menu/header'
// import menuHeader from '@/menu/header'
import
menuAside
from
'@/menu/aside'
import
menuAside
from
'@/menu/aside'
import
{
frameInRoutes
}
from
'@/router/routes'
import
{
frameInRoutes
}
from
'@/router/routes'
import
echarts
from
'echarts'
import
VRM
from
'vue-role-manager'
import
VRM
from
'vue-role-manager'
Vue
.
use
(
VRM
,
{
Vue
.
use
(
VRM
,
{
...
@@ -23,6 +24,7 @@ Vue.use(VRM, {
...
@@ -23,6 +24,7 @@ Vue.use(VRM, {
// 核心插件
// 核心插件
Vue
.
use
(
d2Admin
)
Vue
.
use
(
d2Admin
)
Vue
.
use
(
D2Crud
)
Vue
.
use
(
D2Crud
)
Vue
.
prototype
.
$echarts
=
echarts
new
Vue
({
new
Vue
({
router
,
router
,
store
,
store
,
...
...
src/views/systemMonitor/index.vue
View file @
dae63e8
<!-- 系统监控 -->
<!-- 系统监控 -->
<
template
>
<
template
>
<d2-container
class=
"systemMonitor"
>
<d2-container
class=
"systemMonitor"
>
<el-row>
<div
class=
"echarts"
>
<el-col
:span=
"24"
>
<el-row>
<span
style=
"margin-right: 20px;"
>
子系统类型
</span>
<el-col
:span=
"24"
>
<el-radio-group
v-model=
"subSystemRadio"
>
<span
style=
"margin-right: 20px;"
>
子系统类型
</span>
<el-radio-button
label=
"全部"
></el-radio-button>
<el-radio-group
v-model=
"subSystemRadio"
@
change=
"radioChange"
>
<el-radio-button
label=
"座椅"
></el-radio-button>
<el-radio-button
</el-radio-group>
v-for=
"(item, index) in systemTypeArr"
<!--
<el-radio
v-model=
"subSystemRadio"
label=
"全部"
border
></el-radio>
:key=
"index"
<el-radio
v-model=
"subSystemRadio"
label=
"座椅"
border
></el-radio>
-->
:label=
"item.label"
</el-col>
>
</el-row>
</el-radio-button>
<el-row>
</el-radio-group>
</el-row>
</el-col>
<el-col
:span=
"24"
>
<div
id=
"totalEcharts"
style=
"width: 100%; height: 400px;"
></div>
</el-col>
</el-row>
</div>
<div>
<el-form
:inline=
"true"
:model=
"searchForm"
label-width=
"100px"
>
<el-form-item
label=
"车辆编号"
>
<el-input
v-model=
"searchForm.carNum"
placeholder=
"请输入车辆编号"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"归属车辆段"
>
<el-select
v-model=
"searchForm.belongCar"
placeholder=
"请选择归属车辆段"
filterable
clearable
>
<el-option
v-for=
"(item,index) in belongCarArr"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"车辆状态"
>
<el-select
v-model=
"searchForm.status"
placeholder=
"请选择车辆状态"
filterable
clearable
>
<el-option
value=
"1"
label=
"在网"
></el-option>
<el-option
value=
"2"
label=
"离网"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"子系统编号"
>
<el-input
v-model=
"searchForm.subSystemNum"
placeholder=
"请输入子系统编号"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"子系统状态"
>
<el-select
v-model=
"searchForm.subSystemStatus"
placeholder=
"请选择子系统状态"
filterable
clearable
>
<el-option
value=
"1"
label=
"在网"
></el-option>
<el-option
value=
"2"
label=
"离网"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
</el-form-item>
</el-form>
<el-table
:data=
"tableData"
border
>
<el-table-column
v-for=
"(item, index) in tableColumns"
:key=
"index"
:label=
"item.label"
:prop=
"item.prop"
:width=
"item.width"
:type=
"item.index ? 'index' : ''"
:index=
"item.index"
align=
"center"
>
<template
slot-scope=
"scope"
>
<template
v-if=
"item.prop == 'subSystemStatus'"
>
<el-tag
v-if=
"tableData[scope.$index][item.prop] == '在网'"
type=
"success"
size=
"medium"
>
{{
tableData
[
scope
.
$index
][
item
.
prop
]
}}
</el-tag>
<el-tag
v-else
type=
"info"
size=
"medium"
>
{{
tableData
[
scope
.
$index
][
item
.
prop
]
}}
</el-tag>
</
template
>
<
template
v-else
>
{{
tableData
[
scope
.
$index
][
item
.
prop
]
}}
</
template
>
</template>
</el-table-column>
</el-table>
</div>
</d2-container>
</d2-container>
</template>
</template>
...
@@ -22,17 +91,191 @@ export default {
...
@@ -22,17 +91,191 @@ export default {
name
:
'systemMonitor'
,
name
:
'systemMonitor'
,
data
()
{
data
()
{
return
{
return
{
subSystemRadio
:
'全部'
subSystemRadio
:
'全部'
,
systemTypeArr
:
[{
label
:
'全部'
,
value
:
'1'
},
{
label
:
'座椅'
,
value
:
'2'
}],
// 绘图
totalECharts
:
''
,
totalOptions
:
{
title
:
[{
text
:
'在网情况'
,
x
:
'25%'
,
textAlign
:
'center'
},
{
text
:
'故障情况'
,
x
:
'75%'
,
textAlign
:
'center'
}],
tooltip
:
{},
series
:
[{
name
:
'在网情况'
,
type
:
'pie'
,
radius
:
'55%'
,
center
:
[
'25%'
,
'50%'
],
label
:
{
normal
:
{
fontSize
:
16
}
},
data
:
[{
name
:
'在网'
,
value
:
0
,
itemStyle
:
{
color
:
'#18a689'
}
},
{
name
:
'离网'
,
value
:
0
,
itemStyle
:
{
color
:
'#999999'
},
selected
:
true
}]
},
{
name
:
'故障情况'
,
type
:
'pie'
,
radius
:
[
'20%'
,
'55%'
],
center
:
[
'75%'
,
'50%'
],
label
:
{
normal
:
{
fontSize
:
16
}
},
data
:
[{
name
:
'正常'
,
value
:
0
,
itemStyle
:
{
color
:
'#99cc66'
}
},
{
name
:
'故障'
,
value
:
0
,
itemStyle
:
{
color
:
'#ff0000'
},
selected
:
true
}]
}]
},
// 搜索
searchForm
:
{
carNum
:
''
,
belongCar
:
''
,
status
:
''
,
subSystemNum
:
''
,
subSystemStatus
:
''
},
belongCarArr
:
[{
label
:
'归属1'
,
value
:
'1'
},
{
label
:
'归属2'
,
value
:
'2'
}],
// 表格
tableData
:
[{
subSystemNum
:
'3#1F'
,
subSystemType
:
'座椅'
,
subSystemStatus
:
'在网'
,
carNum
:
'CRH45661-5648'
,
belongCar
:
'青岛'
,
text
:
'00x4561aa'
},
{
subSystemNum
:
'3#2F'
,
subSystemType
:
'座椅'
,
subSystemStatus
:
'离网'
,
carNum
:
'CRH45661-5648'
,
belongCar
:
'青岛'
,
text
:
'00x4561aa'
},
{
subSystemNum
:
'3#3F'
,
subSystemType
:
'座椅'
,
subSystemStatus
:
'在网'
,
carNum
:
'CRH45661-5648'
,
belongCar
:
'青岛'
,
text
:
'00x4561aa'
}],
tableColumns
:
[{
label
:
'序号'
,
index
:
index
=>
{
++
index
return
index
}
},
{
label
:
'子系统编号'
,
prop
:
'subSystemNum'
},
{
label
:
'子系统类型'
,
prop
:
'subSystemType'
},
{
label
:
'子系统状态'
,
prop
:
'subSystemStatus'
}
,
{
label
:
'车辆编号'
,
prop
:
'carNum'
}
,
{
label
:
'归属车辆段'
,
prop
:
'belongCar'
}
,
{
label
:
'故障内容'
,
prop
:
'text'
}]
}
}
},
},
components
:
{},
mounted
()
{
this
.
drawPie
()
},
methods
:
{
drawPie
()
{
this
.
totalECharts
=
this
.
$echarts
.
init
(
document
.
getElementById
(
'totalEcharts'
))
this
.
totalOptions
.
series
[
0
].
data
[
0
].
value
=
400
this
.
totalOptions
.
series
[
0
].
data
[
1
].
value
=
45
this
.
totalOptions
.
series
[
1
].
data
[
0
].
value
=
400
this
.
totalOptions
.
series
[
1
].
data
[
1
].
value
=
45
this
.
totalECharts
.
setOption
(
this
.
totalOptions
)
},
computed
:
{},
radioChange
(
label
)
{
console
.
log
(
label
)
// 请求后端数据--参数
var
value
=
''
for
(
var
i
in
this
.
systemTypeArr
)
{
if
(
this
.
systemTypeArr
[
i
].
label
==
label
)
{
value
=
this
.
systemTypeArr
[
i
].
value
break
}
}
// 调接口
if
(
value
==
'1'
)
{
this
.
totalOptions
.
series
[
0
].
data
[
0
].
value
=
400
this
.
totalOptions
.
series
[
0
].
data
[
1
].
value
=
45
mounted
:
{},
this
.
totalOptions
.
series
[
1
].
data
[
0
].
value
=
400
this
.
totalOptions
.
series
[
1
].
data
[
1
].
value
=
45
}
else
{
this
.
totalOptions
.
series
[
0
].
data
[
0
].
value
=
200
this
.
totalOptions
.
series
[
0
].
data
[
1
].
value
=
45
methods
:
{}
this
.
totalOptions
.
series
[
1
].
data
[
0
].
value
=
200
this
.
totalOptions
.
series
[
1
].
data
[
1
].
value
=
45
}
this
.
totalECharts
.
setOption
(
this
.
totalOptions
)
},
handleSearch
()
{
console
.
log
(
this
.
searchForm
)
// 调接口
}
}
}
}
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment