Commit f073de5c by wangql

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

2 parents 23e961f5 40a7ddf8
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
import axios from '@/plugin/axios' import axios from '@/plugin/axios'
import sign from './sign' import sign from './sign'
import {
methods as sysMonitorMethods
} from './systemMonitor'
const request = (params,method) => { const request = (params,method) => {
params.source = '' params.source = ''
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637' params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
...@@ -21,4 +24,7 @@ const request = (params,method) => { ...@@ -21,4 +24,7 @@ const request = (params,method) => {
data:sign(params) data:sign(params)
}) })
} }
export default request export {
request,
sysMonitorMethods
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @Last Modified time: 2019-08-26 18:02:55 * @Last Modified time: 2019-08-26 18:02:55
*/ */
import request from './request' import { request } from './request'
import RequestMethods from "./request.methods"; import RequestMethods from "./request.methods";
const path = '' const path = ''
// export function AccountLogin (data) { // export function AccountLogin (data) {
......
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
import Vue from 'vue'
export default new Vue({
methods: {
warningTips(message) {
this.$notify({
type: 'warning',
title: message
})
},
okTips(message) {
this.$notify({
type: 'success',
title: message || '操作成功'
})
},
errorTips(message) {
this.$notify({
type: 'error',
title: message || '操作失败'
})
}
}
})
...@@ -7,7 +7,7 @@ import d2Admin from '@/plugin/d2admin' ...@@ -7,7 +7,7 @@ import d2Admin from '@/plugin/d2admin'
// store // store
import store from '@/store/index' import store from '@/store/index'
// import D2Crud from '@d2-projects/d2-crud' import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置 // 菜单和路由设置
import router from './router' import router from './router'
// import menuHeader from '@/menu/header' // import menuHeader from '@/menu/header'
...@@ -20,7 +20,7 @@ import VRM from 'vue-role-manager' ...@@ -20,7 +20,7 @@ import VRM from 'vue-role-manager'
Vue.use(VRM, { Vue.use(VRM, {
router, router,
redirect: '403', redirect: '403',
enabled:false enabled: false
}) })
// 核心插件 // 核心插件
Vue.use(d2Admin) Vue.use(d2Admin)
......
...@@ -14,6 +14,10 @@ export default [ ...@@ -14,6 +14,10 @@ export default [
icon: 'folder-o', icon: 'folder-o',
path: '/carManagement' path: '/carManagement'
}, { }, {
title: '子系统管理',
icon: 'folder-o',
path: '/subSysManagement'
}, {
title: '上报日志', title: '上报日志',
icon: 'folder-o', icon: 'folder-o',
path: '/reportingLogs' path: '/reportingLogs'
......
...@@ -59,6 +59,16 @@ const frameIn = [ ...@@ -59,6 +59,16 @@ const frameIn = [
}, },
component: _import('carManagement') component: _import('carManagement')
}, },
// 子系统管理
{
path: 'subSysManagement',
name: 'subSysManagement',
meta: {
title: '子系统管理',
auth: true
},
component: _import('subSysManagement')
},
// 系统 前端日志 // 系统 前端日志
{ {
path: 'log', path: 'log',
......
<!-- 新增/编辑车辆弹窗 -->
import { constants } from 'fs';
<template>
<div>
<el-dialog
:title="!editForm.carNum ? '添加车辆' : '编辑车辆'"
:visible.sync="isVisible"
:before-close="handleClose"
>
<el-form
:model="editForm"
:rules="rules"
ref="editRuleForm"
label-width="100px"
>
<el-form-item
label="车辆编号"
prop="carNum">
<el-input
:disabled="disabled"
v-model="editForm.carNum"
placeholder="请输入车辆编号"
></el-input>
</el-form-item>
<el-form-item label="归属车辆段" prop="belongCar">
<el-select v-model="editForm.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="维修承包商" prop="repairContractor">
<el-input v-model="editForm.repairContractor" placeholder="请输入维修承包商" clearable></el-input>
</el-form-item>
<el-form-item label="接口开放" prop="interface">
<el-radio v-model="editForm.interface" label="1">是</el-radio>
<el-radio v-model="editForm.interface" label="0">否</el-radio>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="handleConfirm"
>保存</el-button>
<el-button
@click="handleClose"
>取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'EditDialog',
data () {
return {
disabled: false,
rules: {
carNum: [
{ required: true, message: '请输入车辆编号', trigger: 'blur' }
],
belongCar: [
{ required: true, message: '请选择归属车辆段', trigger: 'change' }
],
repairContractor: [
{ required: true, message: '请输入维修承包商', trigger: 'blur' }
],
interface: [
{ required: true, message: '请选择接口开放', trigger: 'change' }
],
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
editForm: Object
},
watch: {
isVisible(val) {
this.disabled = this.editForm.carNum ? true : false
this.editForm.interface = this.editForm.carNum ? this.editForm.interface : '1'
this.$refs.editRuleForm.resetFields()
}
},
mounted: {},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$refs.editRuleForm.validate((vaild) => {
if(vaild) {
this.$emit('confirmDialog')
}
})
}
}
}
</script>
<style scoped>
</style>
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row style="height: 40px; line-height: 40px"> <el-row style="height: 40px; line-height: 40px">
<el-col span="12">车辆列表</el-col> <el-col :span="12">车辆列表</el-col>
<el-col span="12" style="text-align: right"> <el-col :span="12" style="text-align: right">
<el-button>添加车辆</el-button> <el-button @click="handleAdd">添加车辆</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table <el-table
...@@ -62,6 +62,21 @@ ...@@ -62,6 +62,21 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleEdit(scope.$index, scope.row)"
>编辑</el-button>
<el-button
type="text"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
background background
...@@ -74,14 +89,33 @@ ...@@ -74,14 +89,33 @@
layout="sizes,total,->,prev,pager,next,jumper" layout="sizes,total,->,prev,pager,next,jumper"
> >
</el-pagination> </el-pagination>
<edit-dialog
:isVisible="editVisible"
:editForm="editForm"
@closeDialog="handleEditClose"
@confirmDialog="handleEditConfirm"
></edit-dialog>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import EditDialog from './editDialog'
export default { export default {
name: 'carManagement', name: 'carManagement',
components: {
EditDialog
},
data () { data () {
return { return {
// 新增/编辑弹窗
editVisible: false,
editForm: {
carNum: '',
belongCar: '',
repairContractor: '',
interface: ''
},
// 搜索
searchForm: { searchForm: {
carNum: '', carNum: '',
belongCar: '', belongCar: '',
...@@ -89,17 +123,17 @@ export default { ...@@ -89,17 +123,17 @@ export default {
status: '' status: ''
}, },
tableData: [{ tableData: [{
carNum: 'CRH45661-5648', carNum: 'CRH45661-0001',
belongCar: '青岛', belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司', repairContractor: '长春通富机电设备有限公司',
interface: '1' interface: '1'
}, { }, {
carNum: 'CRH45661-5648', carNum: 'CRH45661-0002',
belongCar: '青岛', belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司', repairContractor: '长春通富机电设备有限公司',
interface: '0' interface: '0'
}, { }, {
carNum: 'CRH45661-5648', carNum: 'CRH45661-0003',
belongCar: '青岛', belongCar: '青岛',
repairContractor: '长春通富机电设备有限公司', repairContractor: '长春通富机电设备有限公司',
interface: '1' interface: '1'
...@@ -134,21 +168,69 @@ export default { ...@@ -134,21 +168,69 @@ export default {
methods: { methods: {
// 搜索 // 搜索
handleSearch() { handleSearch () {
console.log(this.searchForm) console.log(this.searchForm)
}, },
// 页码 // 页码
handleSizeChange(value) { handleSizeChange (value) {
console.log(value) console.log(value)
this.pageSize = value this.pageSize = value
// 调接口 // 调接口
}, },
handleCurrentChange(value) { handleCurrentChange (value) {
console.log(value) console.log(value)
this.currentPage = value this.currentPage = value
// 调接口 // 调接口
},
resetForm(obj) {
for (var item in obj) {
if (obj[item] instanceof Array) {
obj[item] = []
} else {
obj[item] = ''
}
}
},
handleAdd () {
this.editVisible = !this.editVisible
},
handleEditClose() {
this.editVisible = !this.editVisible
this.resetForm(this.editForm)
},
handleEditConfirm() {
console.log(JSON.parse(JSON.stringify(this.editForm)))
this.editVisible = !this.editVisible
this.resetForm(this.editForm)
},
// 表格-编辑
handleEdit (index, row) {
console.log(index)
console.log(row)
this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
} }
} }
} }
......
<!-- 新增/编辑车辆弹窗 -->
import { constants } from 'fs';
<template>
<div>
<el-dialog
:title="!editForm.subSystemNum ? '添加子系统' : '编辑子系统'"
:visible.sync="isVisible"
:before-close="handleClose"
>
<el-form
:model="editForm"
:rules="rules"
ref="editRuleForm"
label-width="110px"
>
<el-form-item
label="子系统编号"
prop="subSystemNum">
<el-input
:disabled="disabled"
v-model="editForm.subSystemNum"
placeholder="请输入子系统编号"
></el-input>
</el-form-item>
<el-form-item
label="车辆编号"
prop="carNum">
<el-input
:disabled="disabled"
v-model="editForm.carNum"
placeholder="请输入车辆编号"
></el-input>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="editForm.type" 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="生产厂家" prop="manufacturer">
<el-input v-model="editForm.manufacturer" placeholder="请输入生产厂家" clearable></el-input>
</el-form-item>
<el-form-item label="发送结点序列" prop="xl">
<el-input v-model="editForm.xl" placeholder="请输入发送结点序列" clearable></el-input>
</el-form-item>
<el-form-item label="发送节点端口" prop="jk">
<el-input v-model="editForm.jk" placeholder="请输入发送节点端口" clearable></el-input>
</el-form-item>
<el-form-item label="网关地址" prop="wgdz">
<el-input v-model="editForm.wgdz" placeholder="请输入网关地址" clearable></el-input>
</el-form-item>
<el-form-item label="网关端口" prop="wgdk">
<el-input v-model="editForm.wgdk" placeholder="请输入网关端口" clearable></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="handleConfirm"
>保存</el-button>
<el-button
@click="handleClose"
>取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'EditDialog',
data () {
return {
disabled: false,
rules: {
subSystemNum: [
{ required: true, message: '请输入子系统编号', trigger: 'blur' }
],
carNum: [
{ required: true, message: '请输入车辆编号', trigger: 'blur' }
],
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
manufacturer: [
{ required: true, message: '请输入生产厂家', trigger: 'blur' }
],
xl: [
{ required: true, message: '请输入发送节点序列', trigger: 'blur' }
],
jk: [
{ required: true, message: '请输入发送节点端口', trigger: 'blur' }
],
wgdz: [
{ required: true, message: '请输入网关地址', trigger: 'blur' }
],
wgdk: [
{ required: true, message: '请输入网关端口', trigger: 'blur' }
],
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
editForm: Object
},
watch: {
isVisible(val) {
this.disabled = this.editForm.subSystemNum ? true : false
// this.editForm.interface = this.editForm.carNum ? this.editForm.interface : '1'
this.$refs.editRuleForm.resetFields()
}
},
mounted: {},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$refs.editRuleForm.validate((vaild) => {
if(vaild) {
this.$emit('confirmDialog')
}
})
}
}
}
</script>
<style scoped>
</style>
<!-- 车辆管理 -->
<template>
<d2-container class="carManagement">
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<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.type" 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.carNum" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-input v-model="searchForm.manufacturer" placeholder="请输入生产厂家" clearable></el-input>
</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 @click="handleAdd">添加子系统</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-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleEdit(scope.$index, scope.row)"
>编辑</el-button>
<el-button
type="text"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</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>
<edit-dialog
:isVisible="editVisible"
:editForm="editForm"
@closeDialog="handleEditClose"
@confirmDialog="handleEditConfirm"
></edit-dialog>
</d2-container>
</template>
<script>
import EditDialog from './editDialog'
export default {
name: 'subSysManagement',
components: {
EditDialog
},
data () {
return {
// 新增/编辑弹窗
editVisible: false,
editForm: {
subSystemNum: '',
type: '',
carNum: '',
manufacturer: '',
xl: '',
jk: '',
wgdz: '',
wgdk: ''
},
// 搜索
searchForm: {
subSystemNum: '',
type: '',
carNum: '',
manufacturer: ''
},
tableData: [{
subSystemNum: '3#1F',
type: '座椅',
carNum: 'CRH45661-5648',
manufacturer: '长春通富机电设备有限公司',
xl: '1.56',
jk: '4000',
wgdz: '192.168.1.1',
wgdk: '8000'
}, {
subSystemNum: '3#2F',
type: '桌板',
carNum: 'CRH45661-5648',
manufacturer: '长春通富机电设备有限公司',
xl: '1.56',
jk: '4000',
wgdz: '192.168.1.1',
wgdk: '8000'
}, {
subSystemNum: '3#3F',
type: '座椅',
carNum: 'CRH45661-5648',
manufacturer: '长春通富机电设备有限公司',
xl: '1.56',
jk: '4000',
wgdz: '192.168.1.1',
wgdk: '8000'
}],
tableColumns: [{
label: '子系统编号',
prop: 'subSystemNum'
}, {
label: '类型',
prop: 'type'
}, {
label: '车辆编号',
prop: 'carNum'
}, {
label: '生产厂家',
prop: 'manufacturer'
}, {
label: '发送结点序列',
prop: 'xl'
}, {
label: '发送结点接口',
prop: 'jk'
}, {
label: '网关地址',
prop: 'wgdz'
}, {
label: '网关端口',
prop: 'wgdk'
}],
// 页码
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
// 调接口
},
resetForm(obj) {
for (var item in obj) {
if (obj[item] instanceof Array) {
obj[item] = []
} else {
obj[item] = ''
}
}
},
handleAdd () {
this.editVisible = !this.editVisible
},
handleEditClose() {
this.editVisible = !this.editVisible
this.resetForm(this.editForm)
},
handleEditConfirm() {
console.log(JSON.parse(JSON.stringify(this.editForm)))
this.editVisible = !this.editVisible
this.resetForm(this.editForm)
},
// 表格-编辑
handleEdit (index, row) {
console.log(index)
console.log(row)
this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
}
}
}
</script>
<style scoped>
</style>
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
label-width="100px" label-width="100px"
> >
<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="请选择归属车辆段" filterable clearable> <el-select v-model="searchForm.stationCode" placeholder="请选择归属车辆段" filterable clearable>
<el-option <el-option
v-for="(item,index) in belongCarArr" v-for="(item,index) in stationCodeArr"
:key="index" :key="index"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -39,16 +39,16 @@ ...@@ -39,16 +39,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="车辆状态"> <el-form-item label="车辆状态">
<el-select v-model="searchForm.status" placeholder="请选择车辆状态" filterable clearable> <el-select v-model="searchForm.openType" placeholder="请选择车辆状态" filterable clearable>
<el-option value="1" label="在网"></el-option> <el-option value="1" label="是"></el-option>
<el-option value="2" label="离网"></el-option> <el-option value="2" label="否"></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.subSystemNum" placeholder="请输入子系统编号" clearable></el-input> <el-input v-model="searchForm.subsystemCode" placeholder="请输入子系统编号" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="子系统状态"> <el-form-item label="子系统状态">
<el-select v-model="searchForm.subSystemStatus" placeholder="请选择子系统状态" filterable clearable> <el-select v-model="searchForm.onlineStatus" placeholder="请选择子系统状态" filterable clearable>
<el-option value="1" label="在网"></el-option> <el-option value="1" label="在网"></el-option>
<el-option value="2" label="离网"></el-option> <el-option value="2" label="离网"></el-option>
</el-select> </el-select>
...@@ -58,13 +58,14 @@ ...@@ -58,13 +58,14 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row style="height: 40px; line-height: 40px"> <el-row style="height: 40px; line-height: 40px">
<el-col span="12">车辆状态列表</el-col> <el-col :span="12">车辆状态列表</el-col>
<el-col span="12" style="text-align: right"> <el-col :span="12" style="text-align: right">
<el-button>导出</el-button> <el-button>导出</el-button>
</el-col> </el-col>
</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;"
> >
...@@ -83,7 +84,7 @@ ...@@ -83,7 +84,7 @@
align="center" align="center"
> >
<template v-if="item.prop" slot-scope="scope"> <template v-if="item.prop" slot-scope="scope">
<template v-if="item.prop == 'subSystemStatus'"> <template v-if="item.prop == 'onlineStatus'">
<el-tag v-if="tableData[scope.$index][item.prop] == '在网'" type="success" size="medium">{{ tableData[scope.$index][item.prop] }}</el-tag> <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> <el-tag v-else type="info" size="medium">{{ tableData[scope.$index][item.prop] }}</el-tag>
</template> </template>
...@@ -109,6 +110,8 @@ ...@@ -109,6 +110,8 @@
</template> </template>
<script> <script>
import { request, sysMonitorMethods } from '@api/request'
import notice from '@/common/notice'
export default { export default {
name: 'systemMonitor', name: 'systemMonitor',
data () { data () {
...@@ -186,13 +189,13 @@ export default { ...@@ -186,13 +189,13 @@ export default {
}, },
// 搜索 // 搜索
searchForm: { searchForm: {
carNum: '', trafficCode: '',
belongCar: '', stationCode: '',
status: '', openType: '',
subSystemNum: '', subsystemCode: '',
subSystemStatus: '' onlineStatus: ''
}, },
belongCarArr: [{ stationCodeArr: [{
label: '归属1', label: '归属1',
value: '1' value: '1'
}, { }, {
...@@ -200,46 +203,26 @@ export default { ...@@ -200,46 +203,26 @@ export default {
value: '2' value: '2'
}], }],
// 表格 // 表格
tableData: [{ tableData: [],
subSystemNum: '3#1F', tableLoading: false,
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: [{ tableColumns: [{
label: '子系统编号', label: '子系统编号',
prop: 'subSystemNum' prop: 'subsystemCode'
}, { }, {
label: '子系统类型', label: '子系统类型',
prop: 'subSystemType' prop: 'subSystemType'
}, { }, {
label: '子系统状态', label: '子系统状态',
prop: 'subSystemStatus' prop: 'onlineStatus'
}, { }, {
label: '车辆编号', label: '车辆编号',
prop: 'carNum' prop: 'trafficCode'
}, { }, {
label: '归属车辆段', label: '归属车辆段',
prop: 'belongCar' prop: 'stationCode'
}, { }, {
label: '故障内容', label: '故障内容',
prop: 'text' prop: 'downDescription'
}], }],
// 翻页 // 翻页
currentPage: 1, currentPage: 1,
...@@ -249,23 +232,65 @@ export default { ...@@ -249,23 +232,65 @@ export default {
}, },
mounted () { mounted () {
this.drawPie() // this.drawPie()
this.getList()
this.totalECharts = this.$echarts.init(document.getElementById('totalEcharts'))
this.getPie()
}, },
methods: { methods: {
drawPie () { loadingGetList() {
this.totalECharts = this.$echarts.init(document.getElementById('totalEcharts')) this.tableLoading = true
this.totalOptions.series[0].data[0].value = 400 this.getList()
this.totalOptions.series[0].data[1].value = 45 },
/* 接口请求-start */
getParams() {
return {
pageSize: this.pageSize,
currentPage: this.currentPage,
...this.searchForm
}
},
getList() {
const params = this.getParams()
params.method = sysMonitorMethods.Search
request(params).then(res => {
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
getPie(systemTypeId = 1) {
const params = {
method: sysMonitorMethods.Report,
systemTypeId: systemTypeId
}
// console.log(params)
request(params).then(res => {
this.drawPie(res)
}).catch(err => {
notice.errorTips(err)
})
},
/* 接口请求-end */
/* onlineNum Int 在网数量
offlineNum int 离网数量
normalNum Int 正常数量
breakdownNum Int 故障数量 */
drawPie (params) {
this.totalOptions.series[0].data[0].value = params.onlineNum
this.totalOptions.series[0].data[1].value = params.offlineNum
this.totalOptions.series[1].data[0].value = 400 this.totalOptions.series[1].data[0].value = params.normalNum
this.totalOptions.series[1].data[1].value = 45 this.totalOptions.series[1].data[1].value = params.breakdownNum
this.totalECharts.setOption(this.totalOptions) this.totalECharts.setOption(this.totalOptions)
}, },
radioChange (label) { radioChange (label) {
console.log(label) // console.log(label)
// 请求后端数据--参数 // 请求后端数据--参数
var value = '' var value = ''
for (var i in this.systemTypeArr) { for (var i in this.systemTypeArr) {
...@@ -275,39 +300,30 @@ export default { ...@@ -275,39 +300,30 @@ export default {
} }
} }
// 调接口 // 调接口
if (value === '1') { this.getPie(value)
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 () { handleSearch () {
console.log(this.searchForm) console.log(this.searchForm)
// 调接口 // 调接口
this.tableLoading = true
this.loadingGetList()
}, },
// 页码 // 页码
handleSizeChange (value) { handleSizeChange (value) {
console.log(value)
this.pageSize = value this.pageSize = value
// 调接口 // 调接口
this.tableLoading = true
this.loadingGetList()
}, },
handleCurrentChange (value) { handleCurrentChange (value) {
console.log(value)
this.currentPage = value this.currentPage = value
// 调接口 // 调接口
this.tableLoading = true
this.loadingGetList()
} }
} }
} }
......
...@@ -94,6 +94,7 @@ module.exports = { ...@@ -94,6 +94,7 @@ module.exports = {
.end() .end()
// 重新设置 alias // 重新设置 alias
config.resolve.alias config.resolve.alias
.set('@', resolve('src'))
.set('@api', resolve('src/api')) .set('@api', resolve('src/api'))
// 判断环境加入模拟数据 // 判断环境加入模拟数据
// const entry = config.entry('app') // const entry = config.entry('app')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!