Commit cd83f85f by cwq0219

修改

1 parent 40a7ddf8
......@@ -8,8 +8,9 @@
import axios from '@/plugin/axios'
import sign from './sign'
import {
methods as sysMonitorMethods
} from './systemMonitor'
sysMonitorMethods,
trafficManageMethods
} from './sys.traffic.subsys.js'
const request = (params,method) => {
params.source = ''
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
......@@ -26,5 +27,6 @@ const request = (params,method) => {
}
export {
request,
sysMonitorMethods
sysMonitorMethods,
trafficManageMethods
}
const sysMonitorPath = 'fims.system.'
const trafficManagePath = 'fims.traffic.'
const sysMonitorMethods = {
Search: `${sysMonitorPath}list`,
Report: `${sysMonitorPath}report`
}
const trafficManageMethods = {
Add: `${trafficManagePath}add`,
Search: `${trafficManagePath}list`,
Edit: `${trafficManagePath}edit`,
Remove: `${trafficManagePath}remove`
}
export {
sysMonitorMethods,
trafficManageMethods
}
\ No newline at end of file
const path = 'fims.system.'
const methods = {
Search: `${path}list`,
Report: `${path}report`
}
export {
methods
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ export default [
}, {
title: '车辆管理',
icon: 'folder-o',
path: '/carManagement'
path: '/trafficManagement'
}, {
title: '子系统管理',
icon: 'folder-o',
......
......@@ -51,13 +51,13 @@ const frameIn = [
},
// 车辆管理
{
path: 'carManagement',
name: 'carManagement',
path: 'trafficManagement',
name: 'trafficManagement',
meta: {
title: '车辆管理',
auth: true
},
component: _import('carManagement')
component: _import('trafficManagement')
},
// 子系统管理
{
......
......@@ -233,7 +233,7 @@ export default {
mounted () {
// this.drawPie()
this.getList()
this.loadingGetList()
this.totalECharts = this.$echarts.init(document.getElementById('totalEcharts'))
this.getPie()
},
......@@ -246,8 +246,8 @@ export default {
/* 接口请求-start */
getParams() {
return {
pageSize: this.pageSize,
currentPage: this.currentPage,
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
......@@ -307,7 +307,6 @@ export default {
handleSearch () {
console.log(this.searchForm)
// 调接口
this.tableLoading = true
this.loadingGetList()
},
......@@ -315,14 +314,12 @@ export default {
handleSizeChange (value) {
this.pageSize = value
// 调接口
this.tableLoading = true
this.loadingGetList()
},
handleCurrentChange (value) {
this.currentPage = value
// 调接口
this.tableLoading = true
this.loadingGetList()
}
}
......
<!-- 车辆管理 -->
<template>
<d2-container class="carManagement">
<d2-container class="trafficManagement">
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.carNum" placeholder="请输入车辆编号" clearable></el-input>
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="归属车辆段">
<el-select v-model="searchForm.belongCar" placeholder="请选择归属车辆段" clearable filterable>
<el-select v-model="searchForm.stationCode" 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-input v-model="searchForm.merchantName" placeholder="请输入维修承包商" clearable></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="searchForm.status" placeholder="请选择状态" clearable filterable>
<el-select v-model="searchForm.openType" placeholder="请选择状态" clearable filterable>
<el-option label="在网" value="1"></el-option>
<el-option label="离网" value="2"></el-option>
</el-select>
......@@ -36,6 +36,7 @@
</el-row>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="margin: 20px 0;"
>
......@@ -100,8 +101,10 @@
<script>
import EditDialog from './editDialog'
import { request, trafficManageMethods } from '@api/request'
import notice from '@/common/notice'
export default {
name: 'carManagement',
name: 'trafficManagement',
components: {
EditDialog
},
......@@ -110,52 +113,55 @@ export default {
// 新增/编辑弹窗
editVisible: false,
editForm: {
carNum: '',
belongCar: '',
repairContractor: '',
interface: ''
trafficCode: '',
stationName: '',
merchantName: '',
openType: ''
},
// 搜索
searchForm: {
carNum: '',
belongCar: '',
repairContractor: '',
status: ''
trafficCode: '',
stationCode: '',
merchantName: '',
openType: ''
},
tableData: [{
carNum: 'CRH45661-0001',
belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司',
interface: '1'
}, {
carNum: 'CRH45661-0002',
belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司',
interface: '0'
}, {
carNum: 'CRH45661-0003',
belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司',
interface: '1'
}],
// 表格
tableLoading: false,
tableData: [],
// tableData: [{
// trafficCode: 'CRH45661-0001',
// stationName: '青岛',
// merchantName: '长春通富机电设备有限公司',
// openType: '1'
// }, {
// trafficCode: 'CRH45661-0002',
// stationName: '青岛',
// merchantName: '长春通富机电设备有限公司',
// openType: '0'
// }, {
// trafficCode: 'CRH45661-0003',
// stationName: '青岛',
// merchantName: '长春通富机电设备有限公司',
// openType: '1'
// }],
tableColumns: [{
label: '车辆编号',
prop: 'carNum'
prop: 'trafficCode'
}, {
label: '归属车辆段',
prop: 'belongCar'
prop: 'stationName'
}, {
label: '维修承包商',
prop: 'repairContractor'
prop: 'merchantName'
}, {
label: '接口开放',
prop: 'interface',
prop: 'openType',
formatter: (cellValue) => {
if(cellValue.interface) {
if(cellValue.openType) {
return {
0: '否',
1: '是'
}[cellValue.interface]
}[cellValue.openType]
}
}
}],
......@@ -166,23 +172,55 @@ export default {
}
},
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams() {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList() {
const params = this.getParams()
params.method = trafficManageMethods.Search
request(params).then(res => {
// console.log(res)
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
console.log(value)
// console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
console.log(value)
// console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
},
resetForm(obj) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!