Merge branch 'thailand' of git.code.tencent.com:lian-cbtc/jl-client into thailand
This commit is contained in:
commit
51e678011c
@ -934,9 +934,7 @@ export default class Station extends Group {
|
||||
if (this.graphRoad && model.routeSetMode == 'Manual_Set_Route') {
|
||||
this.graphRoad.setColor(this.style.Station.StationControl.graphRoad.lightColor);
|
||||
}
|
||||
if (this.planControl && model.planControl) {
|
||||
this.planControl.setColor(this.style.Station.StationControl.planControl.lightColor);
|
||||
}
|
||||
|
||||
// if (this.style.Station.StationControl.disPlayNone) {
|
||||
// this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||
// if (this.model.subheadDisplay) { // 副标题
|
||||
@ -1067,6 +1065,9 @@ export default class Station extends Group {
|
||||
model.controlApplicant && this.handleControlApplicant(model);
|
||||
model.allowAutonomy && this.handleAllowAutonomy(model);
|
||||
// this.handlePowerUnlockShow(model);
|
||||
if (this.planControl && model.planControl) {
|
||||
this.planControl.setColor(this.style.Station.StationControl.planControl.lightColor);
|
||||
}
|
||||
this.handleGuideLock(model);
|
||||
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) {
|
||||
model.chargeStationCodeList.forEach(item => {
|
||||
|
@ -3,13 +3,24 @@
|
||||
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%;" />
|
||||
<SetOperationPlan ref="setOperationPlan" />
|
||||
<OperationPlanDetail ref="operationPlanDetail" />
|
||||
<station-control-convert ref="stationControlConvert" :work="'dispatchWork'" />
|
||||
<view-name ref="viewName" />
|
||||
<train-operation ref="trainOperation" />
|
||||
<switch-control ref="switchControl" />
|
||||
<signal-control ref="signalControl" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import MenuBar from '@/jmapNew/theme/components/menus/menuBarNew'
|
||||
import { destroySimulationByAdmin, exitSimulation } from '@/api/simulation'
|
||||
import SetOperationPlan from './menuDialog/setOperationPlan.vue'
|
||||
import OperationPlanDetail from './menuDialog/operationPlanDetail.vue'
|
||||
import MenuBar from '@/jmapNew/theme/components/menus/menuBarNew';
|
||||
import { destroySimulationByAdmin, exitSimulation } from '@/api/simulation';
|
||||
import SetOperationPlan from './menuDialog/setOperationPlan.vue';
|
||||
import ViewName from './menuDialog/viewName';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import StationControlConvert from './menuDialog/stationControlConvert';
|
||||
import TrainOperation from './menuDialog/trainOperation';
|
||||
import SwitchControl from './menuDialog/switchControl';
|
||||
import SignalControl from './menuDialog/signalControl';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'DispatchWorkMenuBar',
|
||||
@ -17,6 +28,11 @@ export default {
|
||||
MenuBar,
|
||||
SetOperationPlan,
|
||||
OperationPlanDetail,
|
||||
ViewName,
|
||||
StationControlConvert,
|
||||
TrainOperation,
|
||||
SwitchControl,
|
||||
SignalControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -27,89 +43,218 @@ export default {
|
||||
children: [
|
||||
{
|
||||
title: 'Exit',
|
||||
click: this.handleExit,
|
||||
},
|
||||
],
|
||||
click: this.handleExit
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'UI Control',
|
||||
operate: '',
|
||||
children: [],
|
||||
click: this.uiControl
|
||||
},
|
||||
{
|
||||
title: 'Station',
|
||||
operate: '',
|
||||
children: [],
|
||||
children: []
|
||||
},
|
||||
{
|
||||
title: 'Station Ctrl Mode',
|
||||
operate: '',
|
||||
children: [],
|
||||
children: [
|
||||
{
|
||||
title: 'To Station Control',
|
||||
click: this.turnToStationControl,
|
||||
operate: OperationEvent.StationControl.requestStationControl.mbar
|
||||
},
|
||||
{
|
||||
title: 'Forced Station Control',
|
||||
click: this.mandatoryStationControl,
|
||||
operate: OperationEvent.StationControl.forcedStationControl.password
|
||||
},
|
||||
{
|
||||
title: 'To Center Control',
|
||||
click: this.conterStationControl,
|
||||
operate: OperationEvent.StationControl.requestCentralControl.mbar,
|
||||
force: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Train Control',
|
||||
operate: '',
|
||||
children: [],
|
||||
click: this.trainControlShow
|
||||
},
|
||||
{
|
||||
title: 'Signal Device Control',
|
||||
operate: '',
|
||||
children: [],
|
||||
children: [
|
||||
{
|
||||
title: 'Signal Close',
|
||||
click: this.handleSignalOperate,
|
||||
operate: OperationEvent.Signal.signalClose.mbar
|
||||
},
|
||||
{
|
||||
title: 'Signal Reopen',
|
||||
click: this.handleSignalOperate,
|
||||
operate: OperationEvent.Signal.reopenSignal.mbar
|
||||
},
|
||||
{
|
||||
title: 'Turnout Normal',
|
||||
click: this.handleSwitchOperate,
|
||||
operate: OperationEvent.Switch.locate.mbar
|
||||
},
|
||||
{
|
||||
title: 'Turnout Reverse',
|
||||
click: this.handleSwitchOperate,
|
||||
operate: OperationEvent.Switch.reverse.mbar
|
||||
},
|
||||
{
|
||||
title: 'Turnout Lock',
|
||||
click: this.handleSwitchOperate,
|
||||
operate: OperationEvent.Switch.lock.mBar
|
||||
},
|
||||
{
|
||||
title: 'Turnout Unlock',
|
||||
click: this.handleSwitchOperate,
|
||||
operate: OperationEvent.Switch.unlock.mbar
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Operation Plan',
|
||||
operate: '',
|
||||
click: this.openOperationPlan,
|
||||
children: [],
|
||||
children: []
|
||||
},
|
||||
{
|
||||
title: 'Plan Details',
|
||||
operate: '',
|
||||
click: this.openPlanDetail,
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
children: []
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.stationList.forEach(station => {
|
||||
this.menuNormal[2].children.push({ title: station.name, click: () => {
|
||||
this.$jlmap.setCenter(station.code);
|
||||
} });
|
||||
});
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
trainControlShow() {
|
||||
this.$refs.trainOperation.doShow();
|
||||
},
|
||||
handleSignalOperate(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.signalControl.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSwitchOperate(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
turnToStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制转为站控
|
||||
mandatoryStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 请求中控
|
||||
conterStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
uiControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewName.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
blankClickClose() {
|
||||
this.$refs.menuBar.doClose()
|
||||
this.$refs.menuBar.doClose();
|
||||
},
|
||||
handleExit() {
|
||||
this.$confirm('Whether to exit emulation?', 'Hint', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.back()
|
||||
})
|
||||
this.back();
|
||||
});
|
||||
},
|
||||
back() {
|
||||
if (this.$store.state.training.simulationCreator) {
|
||||
destroySimulationByAdmin(this.group)
|
||||
destroySimulationByAdmin(this.group);
|
||||
} else {
|
||||
exitSimulation(this.group)
|
||||
exitSimulation(this.group);
|
||||
}
|
||||
if (this.projectDevice && this.$store.state.training.simulationCreator) {
|
||||
this.logout()
|
||||
this.logout();
|
||||
} else if (this.$route.query.third) {
|
||||
if (this.$route.query.project === 'cgy' || this.$route.query.project === 'drts') {
|
||||
window.parent.postMessage('back', '*')
|
||||
window.parent.postMessage('back', '*');
|
||||
} else {
|
||||
window.close()
|
||||
window.close();
|
||||
}
|
||||
} else if (this.projectDevice) {
|
||||
this.logout()
|
||||
this.logout();
|
||||
} else {
|
||||
this.$router.go(-1)
|
||||
this.$router.go(-1);
|
||||
}
|
||||
},
|
||||
// 登出
|
||||
logout() {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
location.reload();
|
||||
});
|
||||
},
|
||||
openOperationPlan() {
|
||||
this.$refs.setOperationPlan.doShow()
|
||||
|
@ -5,6 +5,8 @@
|
||||
<station-control-convert ref="stationControlConvert" :work="'localWork'" />
|
||||
<view-name ref="viewName" />
|
||||
<train-operation ref="trainOperation" />
|
||||
<switch-control ref="switchControl" />
|
||||
<signal-control ref="signalControl" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -18,6 +20,8 @@ import ViewName from './menuDialog/viewName';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import StationControlConvert from './menuDialog/stationControlConvert';
|
||||
import TrainOperation from './menuDialog/trainOperation';
|
||||
import SwitchControl from './menuDialog/switchControl';
|
||||
import SignalControl from './menuDialog/signalControl';
|
||||
|
||||
export default {
|
||||
name: 'CtcWorkMenuBar',
|
||||
@ -26,7 +30,9 @@ export default {
|
||||
TrainFixedPathPane,
|
||||
ViewName,
|
||||
StationControlConvert,
|
||||
TrainOperation
|
||||
TrainOperation,
|
||||
SwitchControl,
|
||||
SignalControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -143,11 +149,27 @@ export default {
|
||||
EventBus.$emit('bottomTableShowOrHidden', false);
|
||||
},
|
||||
methods: {
|
||||
handleSignalOperate(operate) {
|
||||
|
||||
handleSignalOperate(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.signalControl.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSwitchOperate(operate) {
|
||||
|
||||
handleSwitchOperate(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
turnToStationControl(order) {
|
||||
const operate = {
|
||||
|
@ -777,6 +777,9 @@ export default {
|
||||
// CHANGE_DIRECTION
|
||||
selectedChange() {
|
||||
// 按钮按下时
|
||||
if (!this.selected) {
|
||||
return;
|
||||
}
|
||||
const model = this.selected; // 选择设备
|
||||
if (this.selected._event !== MouseEvent.Left || (!model._type && !model._code)) {
|
||||
return;
|
||||
|
177
src/jmapNew/theme/datie_02/menus/menuDialog/signalControl.vue
Normal file
177
src/jmapNew/theme/datie_02/menus/menuDialog/signalControl.vue
Normal file
@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
style="pointer-events: none"
|
||||
z-index="2008"
|
||||
class="chengdou-03__systerm switch-control __menuButton"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="350px"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="4"><span>Signal</span></el-col>
|
||||
<el-col :span="18" :offset="2">
|
||||
<el-select v-model="selected" disabled filterable placeholder="Please select">
|
||||
<el-option
|
||||
v-for="item in signalList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="closeRadio" label="1" :disabled="closeRadio == 2" style="display: block; text-align: center;">
|
||||
Signal close</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="closeRadio" label="2" :disabled="closeRadio == 1" style="display: block; text-align: center;">
|
||||
Signal reopen</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">Confirm</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">Cancel</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="'chengdou-03__systerm'" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
closeRadio: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.signalClose.mbar.operation) {
|
||||
return 'Signal close';
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.mbar.operation) {
|
||||
return 'Signal reopen';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device && device.code && device._type === 'Signal' && this.show) {
|
||||
this.selected = device.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.selected = null;
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
if (this.operation == OperationEvent.Signal.signalClose.mbar.operation) {
|
||||
this.closeRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.mbar.operation) {
|
||||
this.closeRadio = '2';
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.signalClose.mbar.operation) {
|
||||
this.signalClose();
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.mbar.operation) {
|
||||
this.reopenSignal();
|
||||
}
|
||||
},
|
||||
signalClose() {
|
||||
this.sendCommand(menuOperate.Signal.signalClose);
|
||||
},
|
||||
reopenSignal() {
|
||||
this.sendCommand(menuOperate.Signal.reopenSignal);
|
||||
},
|
||||
|
||||
sendCommand(operate) {
|
||||
this.loading = true;
|
||||
commitOperate(operate, {signalCode: this.selected}, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
console.error(error);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.__menuButton {
|
||||
.el-dialog,
|
||||
.el-dialog__wrapper {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__body {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,89 +1,90 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="switch-control"
|
||||
:class="popClass"
|
||||
style="pointer-events: none"
|
||||
z-index="2008"
|
||||
class="chengdou-03__systerm switch-control __menuButton"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
width="350px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>道岔</span></el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
<el-col :span="4"><span>Turnout</span></el-col>
|
||||
<el-col :span="18" :offset="2">
|
||||
<el-select v-model="selected" disabled filterable placeholder="Please select">
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isLock" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;">
|
||||
道岔单锁</el-radio>
|
||||
<el-radio v-model="lockRadio" label="1" :disabled="lockRadio == 2" style="display: block; text-align: center;">
|
||||
Turnout lock</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
|
||||
道岔解单锁</el-radio>
|
||||
<el-radio v-model="lockRadio" label="2" :disabled="lockRadio == 1" style="display: block; text-align: center;">
|
||||
Turnout unlock</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isTurnBlock" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="turnRadio" label="1" :disabled="turnRadio == 2" style="display: block; text-align: center;">
|
||||
道岔定位</el-radio>
|
||||
Turnout normal</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="turnRadio" label="2" :disabled="turnRadio == 1" style="display: block; text-align: center;">
|
||||
道岔反位</el-radio>
|
||||
Turnout reverse</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<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-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">Confirm</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">Cancel</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
<notice-info ref="noticeInfo" :pop-class="'chengdou-03__systerm'" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/dialog/childDialog/noticeInfo';
|
||||
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
popClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
isLock: false,
|
||||
isTurnBlock: false,
|
||||
isActive: false,
|
||||
turnRadio: '1',
|
||||
lockRadio: '1',
|
||||
activeRadio: '1'
|
||||
lockRadio: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'switchList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
@ -94,44 +95,45 @@ export default {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.lock.mBar.operation) {
|
||||
return 'Turnout lock';
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.mbar.operation) {
|
||||
return 'Turnout unlock';
|
||||
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
return 'Turnout locate';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.locate.mbar.operation) {
|
||||
return 'Turnout normal';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.mbar.operation) {
|
||||
return 'Turnout reverse';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device && device.code && device._type === 'Switch' && this.show) {
|
||||
this.selected = device.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
doShow(operate) {
|
||||
this.selected = null;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.operation = operate.operation;
|
||||
this.isLock = false;
|
||||
this.isTurnBlock = false;
|
||||
this.isActive = false;
|
||||
if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.locate.mbar.operation) {
|
||||
this.isTurnBlock = true;
|
||||
this.turnRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.mbar.operation) {
|
||||
this.isTurnBlock = true;
|
||||
this.turnRadio = '2';
|
||||
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.lock.mBar.operation) {
|
||||
this.isLock = true;
|
||||
this.lockRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.mbar.operation) {
|
||||
this.isLock = true;
|
||||
this.lockRadio = '2';
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
@ -142,18 +144,16 @@ export default {
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.lock.mBar.operation) {
|
||||
this.lock(); // 道岔单锁
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
this.block(); // 道岔封锁
|
||||
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.mbar.operation) {
|
||||
this.unlock(); // 道岔解锁
|
||||
} else if (this.operation == OperationEvent.Switch.locate.mbar.operation) {
|
||||
this.locate(); // 道岔定位
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.mbar.operation) {
|
||||
this.reverse(); // 道岔反位
|
||||
}
|
||||
},
|
||||
@ -161,9 +161,9 @@ export default {
|
||||
lock() {
|
||||
this.sendCommand(menuOperate.Switch.lock);
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
this.sendCommand(menuOperate.Switch.block);
|
||||
// 道岔解锁
|
||||
unlock() {
|
||||
this.sendCommand(menuOperate.Switch.unlock);
|
||||
},
|
||||
// 道岔定位
|
||||
locate() {
|
||||
@ -176,7 +176,7 @@ export default {
|
||||
|
||||
sendCommand(operate) {
|
||||
this.loading = true;
|
||||
commitOperate(operate, {}, 2).then(({valid})=>{
|
||||
commitOperate(operate, {switchCode: this.selected}, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
@ -188,24 +188,6 @@ export default {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
sendCommandNext(operate) {
|
||||
const that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that.loading = true;
|
||||
commitOperate(operate, {}, 1).then(({valid})=>{
|
||||
that.loading = false;
|
||||
if (valid) {
|
||||
that.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
resolve({...operate});
|
||||
}
|
||||
}).catch((error) => {
|
||||
that.loading = false;
|
||||
that.doClose();
|
||||
console.error(error);
|
||||
that.$refs.noticeInfo.doShow();
|
||||
});
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
@ -221,3 +203,16 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.__menuButton {
|
||||
.el-dialog,
|
||||
.el-dialog__wrapper {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__body {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -12,24 +12,24 @@
|
||||
>
|
||||
<el-checkbox-group v-model="nameLevels">
|
||||
<el-row>
|
||||
<el-checkbox :label="1">信号机名称</el-checkbox>
|
||||
<el-checkbox :label="1">Signal Name</el-checkbox>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-checkbox :label="11">轨道名称</el-checkbox>
|
||||
<el-checkbox :label="11">Section Name</el-checkbox>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-checkbox :label="7">道岔名称</el-checkbox>
|
||||
<el-checkbox :label="7">Turnout Name</el-checkbox>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-checkbox :label="9">道岔区段名称</el-checkbox>
|
||||
<el-checkbox :label="9">Turnout Section Name</el-checkbox>
|
||||
</el-row>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">Confirm</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">Cancel</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
|
@ -331,7 +331,8 @@ export default {
|
||||
mapId: mapId,
|
||||
simType:paramVO.type,
|
||||
project: this.projectCode,
|
||||
projectDevice:this.$route.query.projectDevice
|
||||
projectDevice:this.$route.query.projectDevice,
|
||||
type: this.$route.query.type
|
||||
};
|
||||
if (config) {
|
||||
if (config.client) { query.client = config.client; }
|
||||
|
@ -1007,7 +1007,6 @@ export default {
|
||||
deviceCode: ''
|
||||
};
|
||||
memberMap[this.generationForm.systemType].push(memberDispatcher);
|
||||
}
|
||||
const memberNccDispatcher = {
|
||||
id: this.getMemberId(this.generationForm.systemType),
|
||||
name: '',
|
||||
@ -1022,6 +1021,7 @@ export default {
|
||||
deviceCode: ''
|
||||
};
|
||||
memberMap[this.generationForm.systemType].push(memberOccDispatcher);
|
||||
}
|
||||
this.stationList.forEach(station => {
|
||||
if (!station.depot) {
|
||||
const member = {
|
||||
|
Loading…
Reference in New Issue
Block a user