This commit is contained in:
zyy 2020-02-14 11:22:59 +08:00
commit bf2b5180e3
8 changed files with 524 additions and 210 deletions

View File

@ -21,7 +21,7 @@ deviceState[deviceType.Switch] = {
blockade:0, // 是否封锁
routeLock:0, // 是否进路锁闭
overlapLock:0, // 是否进路延续保护锁闭
normalPosition:1, // 是否定位
normalPosition:0, // 是否定位
reversePosition:0, // 是否反位
/** 定位状态*/
// locateType: {

View File

@ -264,6 +264,10 @@ export default class Switch extends Group {
}
this.locShelter.hide(); // 定位
this.rhomboid.show();
/** 初始化颜色 */
this.rhomboid.setStyle({
fill: this.style.Section.line.spareColor
});
/** 道岔保护区段锁闭 */
if (model.overlapLock) {
this.rhomboid.setStyle({

View File

@ -468,11 +468,9 @@ export default {
},
confirm2() {
let operate = {
send: true,
over:true,
type: this.type,
val: this.speed,
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
param: {
speedLimitValue: `${this.speed}`
}
@ -481,12 +479,14 @@ export default {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation;

View File

@ -4,13 +4,29 @@
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.trainCode" />
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serverNumber">
<el-input v-model="addModel.serverNumber" />
<!-- <el-input v-model="addModel.trainCode" /> -->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-input v-model="addModel.tripNumber" />
<!-- <el-input v-model="addModel.tripNumber" /> -->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-input v-model="addModel.serviceNumber" />
</el-form-item>
</div>
</el-form>
@ -29,6 +45,7 @@
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
export default {
// name: 'TrainMove',
@ -39,21 +56,21 @@
return {
trainNoList: [],
selected: null,
tripNumberList: [],
addModel: {
trainCode: '', //
serverNumber: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serverNumber: [
{ required: true, message: '请输入服务号', trigger: 'change' }
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
{ required: true, message: '请输入车次号', trigger: 'change' }
]
},
dialogShow: false,
@ -62,7 +79,9 @@
},
computed: {
...mapGetters('map', [
'stationStandList'
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -83,12 +102,30 @@
})
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumber = resp.data;
});
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
}
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@ -99,7 +136,7 @@
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
// mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
@ -110,7 +147,7 @@
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serverNumber: this.addModel.serverNumber, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
}
@ -133,7 +170,6 @@
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}

View File

@ -0,0 +1,209 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-01__system stand-stop-time"
:title="title"
:visible.sync="show"
width="480px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
<el-form-item prop="trainCode" label="车组号:">
<!--<el-input v-model="addModel.trainCode"/>-->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<el-input v-model="serviceNumber" disabled="true"/>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
export default {
name: 'TrainCreateNumber',
mixins: [
CancelMouseState
],
data() {
return {
trainNoList: [],
selected: null,
sectionName: '',
tripNumberList: [],
serviceNumber: '',
addModel: {
trainCode:'',
tripNumber:''
},
rules: {
trainCode: [
{ required: true, message: '请输入列车编码', trigger: 'blur'}
],
serverNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur'}
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
},
title() {
return '新建计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumber = resp.data;
});
},
doShow(operate, selected) {
this.selected = selected;
//
this.serviceNumber = '';
this.addModel = {
trainCode:'',
tripNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: {
sectionCode: this.trainWindowSectionCode,
trainCode: this.addModel.trainCode, //
serviceNumber: this.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
.el-dialog-div {
height: 300px;
overflow: auto;
}
</style>

View File

@ -1,24 +1,29 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<train-init-plan ref="trainInitPlan"/>
<notice-info ref="noticeInfo" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import TrainInitPlan from './dialog/trainInitPlan';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { MenuDisabledState } from './utils/menuItemStatus';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
export default {
name: 'MenuTrain',
components: {
PopMenu,
NoticeInfo
NoticeInfo,
TrainInitPlan
},
mixins: [
CancelMouseState
@ -35,88 +40,93 @@ export default {
return {
menu: [],
menuNormal: {
local: [],
central: [
Local: [],
Center: [
// {
// label: '',
// handler: '',
// children: [
// {
// label: 'ID',
// handler: '',
// cmdType: ''
// },
// {
// label: 'ID',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// }
// ]
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '线',
// handler: '',
// cmdType: ''
// },
// {
// label: 'TWC',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// },
// {
// label: '',
// handler: '',
// cmdType: ''
// }
{
label: '追踪号',
handler: '',
children: [
{
label: '目的地ID',
handler: '',
cmdType: ''
},
{
label: '删除ID',
handler: '',
cmdType: ''
},
{
label: '更改追踪号',
handler: '',
cmdType: ''
},
{
label: '交换追踪号',
handler: '',
cmdType: ''
},
{
label: '运行等级',
handler: '',
cmdType: ''
},
{
label: '列车模式',
handler: '',
cmdType: ''
},
{
label: '惰性模式',
handler: '',
cmdType: ''
},
{
label: '旁路模式',
handler: '',
cmdType: ''
},
{
label: '开门禁止',
handler: '',
cmdType: ''
}
]
},
{
label: '列车明细',
handler: '',
cmdType: ''
},
{
label: '无线',
handler: '',
cmdType: ''
},
{
label: 'TWC',
handler: '',
cmdType: ''
},
{
label: '设备标签',
handler: '',
cmdType: ''
},
{
label: '模拟',
handler: '',
cmdType: ''
},
{
label: '帮助',
handler: '',
cmdType: ''
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
]
@ -169,14 +179,14 @@ export default {
},
initMenu() {
//
this.menu = trainMenuFiltration(this.menuNormal);
// this.menu = trainMenuFiltration(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed];
}
this.menu = menuConvert(this.menu);
// this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -380,6 +390,23 @@ export default {
}
});
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
trainWindowCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {

View File

@ -13,14 +13,30 @@
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.trainCode" />
<!-- <el-input v-model="addModel.trainCode" /> -->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<!-- <el-input v-model="addModel.tripNumber" /> -->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serverNumber">
<el-input v-model="addModel.serverNumber" />
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-input v-model="addModel.tripNumber" />
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group">
@ -37,6 +53,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -49,21 +66,22 @@ export default {
return {
trainNoList: [],
selected: null,
tripNumberList: [],
addModel: {
trainCode: '', //
serverNumber: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serverNumber: [
{ required: true, message: '请输入服务号', trigger: 'change' }
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
{ required: true, message: '请输入车次号', trigger: 'change' }
]
},
dialogShow: false,
@ -72,7 +90,9 @@ export default {
},
computed: {
...mapGetters('map', [
'stationStandList'
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -93,12 +113,30 @@ export default {
});
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumber = resp.data;
});
},
doShow(operate, selected) {
this.selected = selected;
//
// if (!this.dialogShow) {
// }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@ -109,7 +147,7 @@ export default {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
// this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {

View File

@ -8,8 +8,8 @@ export function getBaseUrl() {
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}