Commit f5844669 by cwq0219

系统监控,车辆管理

1 parent 3063533b
// 菜单 侧边栏
export default [
{ path: '/index', title: '首页', icon: 'desktop' },
{ path: '/index', title: '系统监控', icon: 'desktop' },
{
title: '页面',
icon: 'folder-o',
......@@ -9,10 +9,9 @@ export default [
{ path: '/page2', title: '页面 2' },
{ path: '/page3', title: '页面 3' }
]
},
{
title: '系统监控',
}, {
title: '车辆管理',
icon: 'folder-o',
path: '/systemMonitor'
path: '/carManagement'
}
]
// 菜单 顶栏
export default [
{ path: '/index', title: '首页', icon: 'home' },
{ path: '/index', title: '系统监控', icon: 'home' },
{
title: '页面',
icon: 'folder-o',
......
......@@ -19,7 +19,7 @@ const frameIn = [
meta: {
auth: true
},
component: _import('system/index')
component: _import('systemMonitor')
},
// 演示页面
{
......@@ -49,15 +49,15 @@ const frameIn = [
},
component: _import('demo/page3')
},
// 系统监控
// 车辆管理
{
path: 'systemMonitor',
name: 'systemMonitor',
path: 'carManagement',
name: 'carManagement',
meta: {
title: '系统监控',
title: '车辆管理',
auth: true
},
component: _import('systemMonitor')
component: _import('carManagement')
},
// 系统 前端日志
{
......
<!-- 车辆管理 -->
<template>
<d2-container class="carManagement">
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<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="请选择归属车辆段" clearable filterable>
<el-option label="青岛" value="1"></el-option>
<el-option label="深圳" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="维修承包商">
<el-input v-model="searchForm.repairContractor" placeholder="请输入维修承包商" clearable></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="searchForm.status" placeholder="请选择状态" clearable filterable>
<el-option label="在网" value="1"></el-option>
<el-option label="离网" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col span="12">车辆列表</el-col>
<el-col span="12" style="text-align: right">
<el-button>添加车辆</el-button>
</el-col>
</el-row>
<el-table
:data="tableData"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
</d2-container>
</template>
<script>
export default {
name: 'carManagement',
data () {
return {
searchForm: {
carNum: '',
belongCar: '',
repairContractor: '',
status: ''
},
tableData: [{
carNum: 'CRH45661-5648',
belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司',
interface: '1'
}, {
carNum: 'CRH45661-5648',
belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司',
interface: '0'
}, {
carNum: 'CRH45661-5648',
belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司',
interface: '1'
}],
tableColumns: [{
label: '车辆编号',
prop: 'carNum'
}, {
label: '归属车辆段',
prop: 'belongCar'
}, {
label: '维修承包商',
prop: 'repairContractor'
}, {
label: '接口开放',
prop: 'interface',
formatter: (cellValue) => {
if(cellValue.interface) {
return {
0: '否',
1: '是'
}[cellValue.interface]
}
}
}],
// 页码
currentPage: 1,
pageSize: 10,
total: 30
}
},
methods: {
// 搜索
handleSearch() {
console.log(this.searchForm)
},
// 页码
handleSizeChange(value) {
console.log(value)
this.pageSize = value
// 调接口
},
handleCurrentChange(value) {
console.log(value)
this.currentPage = value
// 调接口
}
}
}
</script>
<style scoped>
</style>
......@@ -57,21 +57,32 @@
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col span="12">车辆状态列表</el-col>
<el-col span="12" style="text-align: right">
<el-button>导出</el-button>
</el-col>
</el-row>
<el-table
:data="tableData"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<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" 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>
......@@ -81,7 +92,23 @@
</template>
</template>
</el-table-column>
<el-table-column>
<!-- <template slot-scope="scope">
</template> -->
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
</div>
</d2-container>
</template>
......@@ -89,7 +116,7 @@
<script>
export default {
name: 'systemMonitor',
data() {
data () {
return {
subSystemRadio: '全部',
systemTypeArr: [{
......@@ -123,13 +150,13 @@ export default {
}
},
data: [{
name: '在网',
name: '在网',
value: 0,
itemStyle: {
color: '#18a689'
}
}, {
name: '离网',
}, {
name: '离网',
value: 0,
itemStyle: {
color: '#999999'
......@@ -147,13 +174,13 @@ export default {
}
},
data: [{
name: '正常',
name: '正常',
value: 0,
itemStyle: {
color: '#99cc66'
}
}, {
name: '故障',
name: '故障',
value: 0,
itemStyle: {
color: '#ff0000'
......@@ -201,12 +228,6 @@ export default {
text: '00x4561aa'
}],
tableColumns: [{
label: '序号',
index: index => {
++index
return index
}
}, {
label: '子系统编号',
prop: 'subSystemNum'
}, {
......@@ -215,25 +236,29 @@ export default {
}, {
label: '子系统状态',
prop: 'subSystemStatus'
} , {
}, {
label: '车辆编号',
prop: 'carNum'
} , {
}, {
label: '归属车辆段',
prop: 'belongCar'
} , {
}, {
label: '故障内容',
prop: 'text'
}]
}],
// 翻页
currentPage: 1,
pageSize: 10,
total: 20
}
},
mounted() {
mounted () {
this.drawPie()
},
methods: {
drawPie() {
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
......@@ -244,18 +269,18 @@ export default {
this.totalECharts.setOption(this.totalOptions)
},
radioChange(label) {
radioChange (label) {
console.log(label)
// 请求后端数据--参数
var value = ''
for(var i in this.systemTypeArr) {
if(this.systemTypeArr[i].label == label) {
for (var i in this.systemTypeArr) {
if (this.systemTypeArr[i].label === label) {
value = this.systemTypeArr[i].value
break
}
}
// 调接口
if(value == '1') {
if (value === '1') {
this.totalOptions.series[0].data[0].value = 400
this.totalOptions.series[0].data[1].value = 45
......@@ -271,13 +296,27 @@ export default {
this.totalECharts.setOption(this.totalOptions)
},
handleSearch() {
// 搜索
handleSearch () {
console.log(this.searchForm)
// 调接口
},
// 页码
handleSizeChange (value) {
console.log(value)
this.pageSize = value
// 调接口
},
handleCurrentChange (value) {
console.log(value)
this.currentPage = value
// 调接口
}
}
}
</script>
<style>
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!