This commit is contained in:
fan 2021-02-19 09:12:39 +08:00
commit baa0ba70a3
8 changed files with 179 additions and 125 deletions

View File

@ -446,6 +446,7 @@ export default {
setSwitchbackStrategyTipPrefix: 'Tip: Check the station',
setSwitchbackStrategyTipSuffix: 'setting to run the switchback strategy',
setSwitchbackStrategy: 'Set switchback strategy',
setSectionFaultUnlock:'set section fault unlock',
noSwitchback: 'No switchback',
noOneSwitchback: 'No one switchback',
automaticChange: 'Automatic change',

View File

@ -441,6 +441,7 @@ export default {
setSwitchbackStrategyTipPrefix: '提示: 选中站台',
setSwitchbackStrategyTipSuffix: '设置运行折返策略',
setSwitchbackStrategy: '设置折返策略',
setSectionFaultUnlock:'设置区故解',
noSwitchback: '无折返',
noOneSwitchback: '无人折返',
automaticChange: '自动换端',

View File

@ -1,36 +1,41 @@
<template>
<el-dialog
v-dialogDrag
class="confirm-control"
:class="popClass"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{ message }}</span>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" :pop-class="popClass" />
</el-dialog>
<div>
<el-dialog
v-dialogDrag
class="confirm-control"
:class="popClass"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{ message }}</span>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" :pop-class="popClass" />
</el-dialog>
<section-un-lock ref="sectionUnLock" pop-class="ningbo-01__systerm" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import SectionUnLock from '../dialog/sectionUnLock';
import NoticeInfo from './noticeInfo';
import { commitOperate } from '../../utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -38,7 +43,8 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmControl',
components: {
NoticeInfo
NoticeInfo,
SectionUnLock
},
props: {
popClass: {
@ -49,6 +55,7 @@ export default {
data() {
return {
dialogShow: false,
selected:'',
loading: false,
operate: {},
messages: '',
@ -78,6 +85,8 @@ export default {
return this.$t('menu.stopTime');
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
return this.$t('menu.setSwitchbackStrategy'); //
} else if (this.operation === OperationEvent.Section.fault.menu.operation) {
return this.$t('menu.setSectionFaultUnlock'); //
}
return '';
},
@ -103,13 +112,16 @@ export default {
return OperationEvent.StationStand.setStopTime.confirm.domId; //
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
return OperationEvent.StationStand.setBackStrategy.confirm.domId; //
} else if (this.operation === OperationEvent.Section.fault.menu.operation) {
return OperationEvent.Section.fault.menu.domId; //
}
return '';
}
},
methods: {
doShow(operate) {
doShow(operate, selected) {
if (!this.dialogShow) {
this.selected = selected;
this.loading = false;
this.operate = operate || {};
this.messages = operate.messages;
@ -145,6 +157,8 @@ export default {
this.setStopTime(); //
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
this.setBackStrategy(); //
} else if (this.operation === OperationEvent.Section.fault.menu.operation) {
this.setSectionFaultUnlock(); //
}
},
//
@ -167,6 +181,27 @@ export default {
this.sendCommand(operate);
},
//
setSectionFaultUnlock() {
this.loading = true;
const operate = {
operation: this.operation
// cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
// val: this.operate.val
};
commitOperate(operate, {}, 1).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
//
routeSetting() {
const operate = {

View File

@ -1,35 +1,42 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="margin-bottom: 10px;">执行命令描述</div>
<div class="message-box" v-html="$escapeHTML(message)" />
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button :id="confirmId" type="primary" @click="confirm"> </el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="margin-bottom: 10px;">执行命令描述</div>
<div class="message-box" v-html="$escapeHTML(message)" />
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button :id="confirmId" type="primary" @click="confirm"> </el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmTip',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
@ -72,6 +79,9 @@ export default {
this.$emit('close');
this.doClose();
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
});
}
},

View File

@ -47,7 +47,7 @@ import { menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menu
import { deepAssign } from '@/utils/index';
import { mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import { mapGetters } from 'vuex';
import { dbReadData } from '@/utils/indexedDb';
// import { dbReadData } from '@/utils/indexedDb';
import ConfirmTip from './childDialog/confirmTip';
import MapVisual from './mapVisual';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -56,14 +56,14 @@ export default {
name: 'RouteSelection',
components: {
NoticeInfo,
ConfirmTip,
MapVisual
ConfirmTip,
MapVisual
},
data() {
return {
tempData: [],
beforeSectionList: [],
beforeSwitchList: [],
beforeSectionList: [],
beforeSwitchList: [],
showExpand: true,
dialogShow: false,
loading: false,
@ -72,11 +72,11 @@ export default {
operation: '',
display: true,
stationName: '',
signalName: '',
mapData: null,
signalName: '',
mapData: null,
tableStyle: {
'border-bottom': 'none'
}
}
};
},
computed: {
@ -94,7 +94,7 @@ export default {
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
},
title() {
return '进路设置';
},
@ -112,10 +112,10 @@ export default {
this.commit();
}
}
},
mounted() {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
},
},
mounted() {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
},
methods: {
expandPath() {
this.showExpand = !this.showExpand;
@ -142,21 +142,21 @@ export default {
}
});
this.operation = operate.operation;
}
}
this.dialogShow = true;
this.dialogShow = true;
this.$nextTick(function () {
this.loadData();
this.loadData();
this.$store.dispatch('training/emitTipFresh');
});
},
loadData() {
this.beforeSwitchList = [];
this.beforeSectionList = [];
if (this.mapData) {
this.$refs.map.loadData(this.mapData);
}
},
},
loadData() {
this.beforeSwitchList = [];
this.beforeSectionList = [];
if (this.mapData) {
this.$refs.map.loadData(this.mapData);
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
@ -170,79 +170,79 @@ export default {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(el => {
el.routeLock = false;
el.preBlue = false;
el.preGreen = false;
el.routeLock = false;
el.preBlue = false;
el.preGreen = false;
});
}
if (this.beforeSwitchList && this.beforeSwitchList.length) {
this.beforeSwitchList.forEach(el => {
el.normalPosition = false;
el.reversePosition = false;
el.routeLock = false;
el.normalPosition = false;
el.reversePosition = false;
el.routeLock = false;
});
}
}
this.$refs.map.updateMapDevice([...this.beforeSectionList, ...this.beforeSwitchList]);
this.$refs.map.updateMapDevice([...this.beforeSectionList, ...this.beforeSwitchList]);
this.beforeSectionList = [];
this.beforeSwitchList = [];
this.beforeSectionList = [];
this.beforeSwitchList = [];
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
this.row.canSetting = true;
this.restoreBeforeDevices();
this.restoreBeforeDevices();
const containSectionList = [];
const containSwitchList = [];
const containSectionList = [];
const containSwitchList = [];
if (!row.setting) {
const signalBegin = this.$refs.map.getDeviceByCode(row.startSignalCode);
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
const diff = signalBegin.position.x - signalEnd.position.x;
const code = diff > 0? row.endSignalCode : row.startSignalCode;
const switchCodeList = [];
const signalBegin = this.$refs.map.getDeviceByCode(row.startSignalCode);
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
const diff = signalBegin.position.x - signalEnd.position.x;
const code = diff > 0 ? row.endSignalCode : row.startSignalCode;
const switchCodeList = [];
this.$refs.map.setCenterWithOffset(code, 0);
this.$refs.map.setCenterWithOffset(code, 0);
if (row.routeSectionList && row.routeSectionList.length) {
row.routeSectionList.forEach(code => {
const section = deepAssign({}, this.$refs.map.getDeviceByCode(code));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(sectionCode => {
containSectionList.push({code: sectionCode,preGreen: true,preBlue: false});
containSectionList.push({code: sectionCode, preGreen: true, preBlue: false});
});
} else {
containSectionList.push({code, preGreen: true,preBlue: false});
containSectionList.push({code, preGreen: true, preBlue: false});
}
if (section.switchSection && section.switch) {
switchCodeList.push(section.switch.code);
}
if (section.switchSection && section.switch) {
switchCodeList.push(section.switch.code);
}
});
}
}
if (row.routeSwitchList && row.routeSwitchList.length) {
if (row.routeSwitchList && row.routeSwitchList.length) {
row.routeSwitchList.filter(el => switchCodeList.includes(el.switchCode)).forEach(el => {
const swch = deepAssign({}, this.$refs.map.getDeviceByCode(el.switchCode));
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal,reversePosition: !el.normal});
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });
} else {
containSectionList.push({code: sectionC.code, routeLock:true });
containSectionList.push({code: sectionB.code, preBlue: true });
}
const swch = deepAssign({}, this.$refs.map.getDeviceByCode(el.switchCode));
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal, reversePosition: !el.normal});
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });
} else {
containSectionList.push({code: sectionC.code, routeLock:true });
containSectionList.push({code: sectionB.code, preBlue: true });
}
});
}
}
this.$refs.map.updateMapDevice([...containSectionList, ...containSwitchList]);
this.beforeSectionList = containSectionList
this.beforeSwitchList = containSwitchList;
this.$refs.map.updateMapDevice([...containSectionList, ...containSwitchList]);
this.beforeSectionList = containSectionList;
this.beforeSwitchList = containSwitchList;
//
const operate = {
@ -267,7 +267,7 @@ export default {
this.loading = false;
if (valid) {
const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode);
operate.message = `<div>命令:进路设置</div><div>始端信号机:${signal.name}</div><div>进路:${this.row.name} </div>`;
operate.message = `命令:进路设置<br/>始端信号机:${signal.name}<br/>进路:${this.row.name}`;
this.doClose();
this.$refs.confirmTip.doShow(operate);
}

View File

@ -20,7 +20,7 @@
size="mini"
@change="sectionSelectChange"
>
<el-option v-for="(option,index) in switchAndPhySicalSectionList" :key="index" :label="option.name" :value="option.name" />
<el-option v-for="(option,index) in switchAndPhySicalSectionList" :key="index" :label="option.name" :value="option.code" />
</el-select>
</el-col>
</el-row>

View File

@ -32,6 +32,7 @@ export default {
data() {
return {
menu: [],
menuForce:[],
menuNormal: {
Local: [
{

View File

@ -2,7 +2,8 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" pop-class="ningbo-01__systerm" />
<section-un-lock ref="sectionUnLock" pop-class="ningbo-01__systerm" />
<!-- <section-un-lock ref="sectionUnLock" pop-class="ningbo-01__systerm" /> -->
<confirm-control ref="confirmControl" pop-class="ningbo-01__systerm" />
<speed-limit-control ref="speedLimitControl" pop-class="ningbo-01__systerm" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
@ -18,10 +19,12 @@ import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionContr
import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan';
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import SectionUnLock from '@/jmapNew/theme/components/menus/dialog/sectionUnLock';
// import SectionUnLock from '@/jmapNew/theme/components/menus/dialog/sectionUnLock';
import SpeedLimitControl from '@/jmapNew/theme/components/menus/dialog/speedCmdControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import ConfirmControl from '@/jmapNew/theme/components/menus/childDialog/confirmControl';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
@ -33,12 +36,13 @@ export default {
components: {
PopMenu,
SectionControl,
SectionUnLock,
// SectionUnLock,
SpeedLimitControl,
AlxeEffective,
NoticeInfo,
TrainAddPlan,
SetFault,
ConfirmControl,
LoadSpareTrain
},
props: {
@ -214,7 +218,9 @@ export default {
fault() {
commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.sectionUnLock.doShow(operate, this.selected);
// this.$refs.sectionUnLock.doShow(operate, this.selected);
operate.messages = '是否执行区故解命令?';
this.$refs.confirmControl.doShow(operate, this.selected);
}
});
},