Commit cd83f85f by cwq0219

修改

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