Commit 3063533b by liimin

Merge branch 'master' of http://192.168.3.233:8090/glsx-web/tFIMS

2 parents 77ced0f8 dae63e84
...@@ -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",
......
...@@ -14,6 +14,7 @@ import router from './router' ...@@ -14,6 +14,7 @@ import router from './router'
// import menuAside from '@/menu/aside' // import menuAside from '@/menu/aside'
import menuAside from '@/resources' import menuAside from '@/resources'
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, {
...@@ -24,6 +25,7 @@ Vue.use(VRM, { ...@@ -24,6 +25,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,
......
...@@ -9,5 +9,10 @@ export default [ ...@@ -9,5 +9,10 @@ export default [
{ path: '/page2', title: '页面 2' }, { path: '/page2', title: '页面 2' },
{ path: '/page3', title: '页面 3' } { path: '/page3', title: '页面 3' }
] ]
},
{
title: '系统监控',
icon: 'folder-o',
path: '/systemMonitor'
} }
] ]
...@@ -49,6 +49,16 @@ const frameIn = [ ...@@ -49,6 +49,16 @@ const frameIn = [
}, },
component: _import('demo/page3') component: _import('demo/page3')
}, },
// 系统监控
{
path: 'systemMonitor',
name: 'systemMonitor',
meta: {
title: '系统监控',
auth: true
},
component: _import('systemMonitor')
},
// 系统 前端日志 // 系统 前端日志
{ {
path: 'log', path: 'log',
......
<!-- 系统监控 -->
<template>
<d2-container class="systemMonitor">
<div class="echarts">
<el-row>
<el-col :span="24">
<span style="margin-right: 20px;">子系统类型</span>
<el-radio-group v-model="subSystemRadio" @change="radioChange">
<el-radio-button
v-for="(item, index) in systemTypeArr"
:key="index"
:label="item.label"
>
</el-radio-button>
</el-radio-group>
</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>
</template>
<script>
export default {
name: 'systemMonitor',
data() {
return {
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'
}]
}
},
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)
},
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
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
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>
<style>
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!