泰国项目调整
This commit is contained in:
parent
b1345badec
commit
b898aee79a
@ -177,7 +177,10 @@ class ETextName extends Group {
|
|||||||
this.text && this.text.stopAnimation(false);
|
this.text && this.text.stopAnimation(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
setState() {
|
setState(bool) {
|
||||||
|
if (this.text) {
|
||||||
|
bool ? this.text.show() : this.text.hide();
|
||||||
|
}
|
||||||
// 区段名称类暂时不做状态处理
|
// 区段名称类暂时不做状态处理
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -599,6 +599,7 @@ export default class Section extends Group {
|
|||||||
// 分路不良
|
// 分路不良
|
||||||
// model.shuntingTypeList.length > 0 &&
|
// model.shuntingTypeList.length > 0 &&
|
||||||
model.badShunt && this.badShuntStatus();
|
model.badShunt && this.badShuntStatus();
|
||||||
|
this.name.setState(model.nameShow);
|
||||||
// 停车倒计时
|
// 停车倒计时
|
||||||
if (this.remainTimeText) {
|
if (this.remainTimeText) {
|
||||||
if (model.stopCountDown) {
|
if (model.stopCountDown) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
v-dialogDrag
|
v-dialogDrag
|
||||||
:class="popClass+' passive-control'"
|
:class="popClass+' passive-control'"
|
||||||
title="控制模式请求"
|
title="Request Control Mode"
|
||||||
:visible.sync="show"
|
:visible.sync="show"
|
||||||
width="700px"
|
width="700px"
|
||||||
:before-close="doClose"
|
:before-close="doClose"
|
||||||
@ -11,7 +11,7 @@
|
|||||||
:modal="false"
|
:modal="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
>
|
>
|
||||||
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
|
<span class="control-label">{{ `${requestInfo} request control mode for the following areas` }}</span>
|
||||||
<el-table
|
<el-table
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
@ -23,35 +23,35 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
>
|
>
|
||||||
<el-table-column prop="operate" label="操作区域">
|
<el-table-column prop="operate" label="Operating area">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="control" label="当前控制模式" width="120">
|
<el-table-column prop="control" label="Current control mode" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="target" label="请求控制模式" width="120">
|
<el-table-column prop="target" label="Request control mode" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="agree" label="是否同意" width="140">
|
<el-table-column prop="agree" label="Agree" width="140">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<span class="control-label">距离对话还有{{ count }}秒,请应答。</span>
|
<span class="control-label">Two {{ count }} to speak. Respond.</span>
|
||||||
<el-row class="button-group">
|
<el-row class="button-group">
|
||||||
<el-col :span="10" :offset="3">
|
<el-col :span="10" :offset="3">
|
||||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
|
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">Agree
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6" :offset="4">
|
<el-col :span="6" :offset="4">
|
||||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
|
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">Refuse</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- ningbo-01__systerm -->
|
<!-- ningbo-01__systerm -->
|
||||||
@ -83,11 +83,11 @@ export default {
|
|||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
disabledAgree: false,
|
disabledAgree: false,
|
||||||
disabledRefuse: false,
|
disabledRefuse: false,
|
||||||
requestInfo: '调度员1工作站',
|
requestInfo: 'Dispatcher 1 workstation',
|
||||||
controlProps: {
|
controlProps: {
|
||||||
'Center': this.$t('menu.passiveDialog.inTheControl'),
|
'Center': 'Center',
|
||||||
'Local': this.$t('menu.passiveDialog.stationControl'),
|
'Local': 'Local',
|
||||||
'Emergency':this.$t('menu.passiveDialog.emergencyControl')
|
'Emergency':'Emergency'
|
||||||
},
|
},
|
||||||
selection: [],
|
selection: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@ -269,7 +269,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (!selection) {
|
} else if (!selection) {
|
||||||
this.$messageBox('请选择一条数据');
|
this.$messageBox('Please select a piece of data');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
agree() {
|
agree() {
|
||||||
|
@ -27,7 +27,6 @@ import MenuStation from './menuStation';
|
|||||||
import MenuBar from './dispatchWorkMenuBar';
|
import MenuBar from './dispatchWorkMenuBar';
|
||||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||||
import { timestampFormat } from '@/utils/date';
|
import { timestampFormat } from '@/utils/date';
|
||||||
// import BottomTable from './bottomTable';
|
|
||||||
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
|
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
|
||||||
import MenuButtonCtc from './menuButtonCtc';
|
import MenuButtonCtc from './menuButtonCtc';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="menus" :style="{width: width + 'px'}">
|
<div class="menus" :style="{width: width + 'px'}">
|
||||||
<menu-bar ref="menuBar" :selected="selected" />
|
<menu-bar ref="menuBar" :selected="selected" style="top: 0" />
|
||||||
<div id="tipInfoBox" style="width: 1560px;position: fixed;height: 30px;background: #808080;z-index: 9;bottom: 0;left: 0;display: flex;">
|
<div id="tipInfoBox" style="width: 1560px;position: fixed;height: 30px;background: #808080;z-index: 9;bottom: 0;left: 0;display: flex;">
|
||||||
<div style="width: 60%;height: 30px;line-height: 30px;text-align: center;">Message window</div>
|
<div style="width: 60%;height: 30px;line-height: 30px;text-align: center;">Message window</div>
|
||||||
<div style="width: 40%;height: 30px;line-height: 30px;text-align: center;border-left: 2px #ccc solid;">{{ 'Control A: Mainframe' + ' ' + dateString + ' ' + time }}</div>
|
<div style="width: 40%;height: 30px;line-height: 30px;text-align: center;border-left: 2px #ccc solid;">{{ 'Control A: Mainframe' + ' ' + dateString + ' ' + time }}</div>
|
||||||
@ -753,7 +753,7 @@ export default {
|
|||||||
background: #cb204d;
|
background: #cb204d;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
top: 0px;
|
top: 35px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
@ -774,8 +774,8 @@ export default {
|
|||||||
}
|
}
|
||||||
.simulationTellInfo{
|
.simulationTellInfo{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 328px;
|
width: 492px;
|
||||||
top: 0px;
|
top: 35px;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
padding: 0px 0px 0px 0px;
|
padding: 0px 0px 0px 0px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@ -786,9 +786,9 @@ export default {
|
|||||||
}
|
}
|
||||||
.simulationDeviceInfo{
|
.simulationDeviceInfo{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 328px;
|
width: 492px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
top: 33px;
|
top: 68px;
|
||||||
right:0px;
|
right:0px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="menuBarDatie">
|
<div id="menuBarDatie">
|
||||||
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%;top: 30px;" />
|
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%;" />
|
||||||
<train-fixed-path-pane ref="trainFixedPathPane" />
|
<train-fixed-path-pane ref="trainFixedPathPane" />
|
||||||
|
<station-control-convert ref="stationControlConvert" :work="'localWork'" />
|
||||||
|
<view-name ref="viewName" />
|
||||||
|
<train-operation ref="trainOperation" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -11,12 +14,19 @@ import {menuOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
|||||||
import TrainFixedPathPane from './menuDialog/trainFixedPathPane';
|
import TrainFixedPathPane from './menuDialog/trainFixedPathPane';
|
||||||
import { EventBus } from '@/scripts/event-bus';
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
import { destroySimulationByAdmin, exitSimulation} from '@/api/simulation';
|
import { destroySimulationByAdmin, exitSimulation} from '@/api/simulation';
|
||||||
|
import ViewName from './menuDialog/viewName';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import StationControlConvert from './menuDialog/stationControlConvert';
|
||||||
|
import TrainOperation from './menuDialog/trainOperation';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CtcWorkMenuBar',
|
name: 'CtcWorkMenuBar',
|
||||||
components: {
|
components: {
|
||||||
MenuBar,
|
MenuBar,
|
||||||
TrainFixedPathPane
|
TrainFixedPathPane,
|
||||||
|
ViewName,
|
||||||
|
StationControlConvert,
|
||||||
|
TrainOperation
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -34,7 +44,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: 'UI Control',
|
title: 'UI Control',
|
||||||
operate: '',
|
operate: '',
|
||||||
children: []
|
click: this.uiControl
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Station',
|
title: 'Station',
|
||||||
@ -44,17 +54,65 @@ export default {
|
|||||||
{
|
{
|
||||||
title: 'Station Ctrl Mode',
|
title: 'Station Ctrl Mode',
|
||||||
operate: '',
|
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',
|
title: 'Train Control',
|
||||||
operate: '',
|
operate: '',
|
||||||
children: []
|
click: this.trainControlShow
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Signal Device Control',
|
title: 'Signal Device Control',
|
||||||
operate: '',
|
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',
|
title: 'Operation Plan',
|
||||||
@ -62,7 +120,7 @@ export default {
|
|||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Plan Details:',
|
title: 'Plan Details',
|
||||||
operate: '',
|
operate: '',
|
||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
@ -74,10 +132,69 @@ export default {
|
|||||||
'stationList'
|
'stationList'
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.stationList.forEach(station => {
|
||||||
|
this.menuNormal[2].children.push({ title: station.name, click: () => {
|
||||||
|
this.$jlmap.setCenter(station.code);
|
||||||
|
} });
|
||||||
|
});
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
EventBus.$emit('bottomTableShowOrHidden', false);
|
EventBus.$emit('bottomTableShowOrHidden', false);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSignalOperate(operate) {
|
||||||
|
|
||||||
|
},
|
||||||
|
handleSwitchOperate(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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
handleExit() {
|
handleExit() {
|
||||||
this.$confirm('Whether to exit emulation?', 'Hint', {
|
this.$confirm('Whether to exit emulation?', 'Hint', {
|
||||||
confirmButtonText: 'Confirm',
|
confirmButtonText: 'Confirm',
|
||||||
@ -87,6 +204,9 @@ export default {
|
|||||||
this.back();
|
this.back();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
trainControlShow() {
|
||||||
|
this.$refs.trainOperation.doShow();
|
||||||
|
},
|
||||||
back() {
|
back() {
|
||||||
if (this.$store.state.training.simulationCreator) {
|
if (this.$store.state.training.simulationCreator) {
|
||||||
destroySimulationByAdmin(this.group);
|
destroySimulationByAdmin(this.group);
|
||||||
|
@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="chengdou-03__systerm two-confirmation"
|
||||||
|
title="Secondary confirmation"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="360px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:show-close="false"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<div class="context">
|
||||||
|
<template v-for="(message, index) in messages">
|
||||||
|
<div :key="index">{{ message }}</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<el-row class="button-group">
|
||||||
|
<el-col :span="10" :offset="3">
|
||||||
|
<el-button :id="show? domIdConfirm: ''" :loading="loading" :disabled="loading" @click="commit">Confirm</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" :offset="4">
|
||||||
|
<el-button :id="domIdCancel" @click="cancel">Close</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||||
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TwoConfirmation',
|
||||||
|
components: {
|
||||||
|
NoticeInfo
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogShow: false,
|
||||||
|
loading: false,
|
||||||
|
operation: '',
|
||||||
|
operate: '',
|
||||||
|
timer: null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
show() {
|
||||||
|
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||||
|
},
|
||||||
|
domIdConfirm() {
|
||||||
|
if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
|
||||||
|
return OperationEvent.StationControl.emergencyStationControl.confirm.domId;
|
||||||
|
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
|
||||||
|
return OperationEvent.StationControl.requestStationControl.confirm.domId;
|
||||||
|
} else if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
|
||||||
|
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
|
||||||
|
} else if (this.operate == OperationEvent.StationControl.forcedStationControl.menu.operation) {
|
||||||
|
return OperationEvent.StationControl.forcedStationControl.confirm.domId;
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
domIdCancel() {
|
||||||
|
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||||
|
},
|
||||||
|
messages() {
|
||||||
|
if (this.operate) {
|
||||||
|
return this.operate.messages;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(operate) {
|
||||||
|
this.operate = operate || {};
|
||||||
|
this.operation = this.operate.operation;
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
const operate = {
|
||||||
|
type: this.operate.type,
|
||||||
|
operation: OperationEvent.Command.close.confirm.operation
|
||||||
|
};
|
||||||
|
this.$emit('setOperate', { selection: this.operate.selection, cancel: true });
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
commit() {
|
||||||
|
this.loading = true;
|
||||||
|
const operate = {
|
||||||
|
over: true,
|
||||||
|
operation: ''
|
||||||
|
};
|
||||||
|
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
|
||||||
|
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
|
||||||
|
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
|
||||||
|
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
|
||||||
|
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
|
||||||
|
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
|
||||||
|
} else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
|
||||||
|
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL;
|
||||||
|
operate.operation = OperationEvent.StationControl.emergencyStationControl.confirm.operation;
|
||||||
|
} else if (this.operation == OperationEvent.StationControl.forcedStationControl.menu.operation) {
|
||||||
|
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL;
|
||||||
|
operate.operation = OperationEvent.StationControl.forcedStationControl.confirm.operation;
|
||||||
|
}
|
||||||
|
this.$emit('setOperate', { selection: this.operate.selection, commit: true });
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid, response }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = false;
|
||||||
|
}, 200);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = false;
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,455 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="chengdou-03__systerm station-control-convert"
|
||||||
|
title="Control Mode Conversion"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="700px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:show-close="true"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
|
:data="tableData"
|
||||||
|
border
|
||||||
|
row-key="code"
|
||||||
|
style="width: 100%"
|
||||||
|
height="250"
|
||||||
|
center
|
||||||
|
size="mini"
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
<el-table-column :id="domIdChoose" prop="check" label="Select" width="60" style="margin-left:30px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-checkbox ref="check" v-model="scope.row.check" :disabled="scope.row.disabled" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="operate" label="Operating Area" width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="control" label="Control Mode" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="status" label="Center Station Communication Status" width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.status }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="result" label="Transfer Execution Status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.result }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-row class="button-group">
|
||||||
|
<el-col :span="10" :offset="3" class="control_button">
|
||||||
|
<el-button style="width: 150px" v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">Forced Station Control</el-button>
|
||||||
|
<el-button style="width: 150px" v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">To Station Control</el-button>
|
||||||
|
<el-button style="width: 150px" v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">To Center Control</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" :offset="4">
|
||||||
|
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">Close
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<two-confirmation ref="twoConfirmation" @setOperate="getOperate" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import TwoConfirmation from './childDialog/twoConfirmation';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'StationControlConvert',
|
||||||
|
components: {
|
||||||
|
TwoConfirmation
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
work: {
|
||||||
|
type: String,
|
||||||
|
default() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
operate: null,
|
||||||
|
dialogShow: false,
|
||||||
|
disabledSend: false,
|
||||||
|
disabledSure: false,
|
||||||
|
disabledClose: false,
|
||||||
|
operation: '',
|
||||||
|
controlProps: {
|
||||||
|
'Center': 'Center',
|
||||||
|
'Local': 'Local'
|
||||||
|
},
|
||||||
|
selection: [],
|
||||||
|
tableData: [],
|
||||||
|
timer: null,
|
||||||
|
count: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'stationList'
|
||||||
|
]),
|
||||||
|
...mapGetters('training', [
|
||||||
|
'mode',
|
||||||
|
'started'
|
||||||
|
]),
|
||||||
|
disabledCommit() {
|
||||||
|
return this.disabledSend || this.disabledSure;
|
||||||
|
},
|
||||||
|
show() {
|
||||||
|
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||||
|
},
|
||||||
|
isFork() {
|
||||||
|
if (this.dialogShow) {
|
||||||
|
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
isRequest() {
|
||||||
|
if (this.dialogShow) {
|
||||||
|
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
isConter() {
|
||||||
|
if (this.dialogShow) {
|
||||||
|
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
domIdChoose() {
|
||||||
|
if (this.dialogShow) {
|
||||||
|
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||||
|
return OperationEvent.StationControl.forcedStationControl.choose.domId;
|
||||||
|
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||||
|
return OperationEvent.StationControl.requestStationControl.choose.domId;
|
||||||
|
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||||
|
return OperationEvent.StationControl.requestCentralControl.choose.domId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
domIdConter() {
|
||||||
|
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
|
||||||
|
},
|
||||||
|
domIdFork() {
|
||||||
|
return this.dialogShow ? OperationEvent.StationControl.forcedStationControl.menu.domId : '';
|
||||||
|
},
|
||||||
|
domIdRequest() {
|
||||||
|
return this.dialogShow ? OperationEvent.StationControl.requestStationControl.menu.domId : '';
|
||||||
|
},
|
||||||
|
domIdCancel() {
|
||||||
|
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.map.controlTransfer':function (controlTransferList) {
|
||||||
|
controlTransferList.forEach(controlTransfer=>{
|
||||||
|
this.updateTableValue(controlTransfer);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 深度数据状态
|
||||||
|
tableData: {
|
||||||
|
handler(val, oldVal) {
|
||||||
|
this.checkTableDataSelction(val);
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.loadTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
updateTableValue(controlTransfer) {
|
||||||
|
this.tableData.forEach((row, index) => {
|
||||||
|
if (row.code == controlTransfer.code) {
|
||||||
|
if (controlTransfer.applicantId) {
|
||||||
|
row.result = 'A transfer request has been sent and timed out after,' + controlTransfer.validDuration + 'seconds.';
|
||||||
|
row.disabled = true;
|
||||||
|
row.check = false;
|
||||||
|
} else {
|
||||||
|
if (row.control != this.controlProps[controlTransfer.controlMode]) {
|
||||||
|
row.result = 'Control mode transfer success';
|
||||||
|
row.control = this.controlProps[controlTransfer.controlMode];
|
||||||
|
this.removeSelection(controlTransfer.code);
|
||||||
|
row.disabled = true;
|
||||||
|
row.check = false;
|
||||||
|
} else {
|
||||||
|
row.result = 'Control mode transfer failed';
|
||||||
|
this.removeSelection(controlTransfer.code);
|
||||||
|
row.disabled = false;
|
||||||
|
row.check = false;
|
||||||
|
}
|
||||||
|
this.disabledClose = false;
|
||||||
|
this.disabledSure = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
checkTableDataSelction(data) {
|
||||||
|
const selection = [];
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
data.forEach(row => {
|
||||||
|
if (row.check && !row.disabled) {
|
||||||
|
selection.push(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.disabledSend = !selection.length;
|
||||||
|
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||||
|
this.handleChooseChange(selection);
|
||||||
|
this.selection = selection;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkBoxDisabled(row) {
|
||||||
|
const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
|
||||||
|
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||||
|
if (control && control.controlMode == 'Local') { // Center:中控, Local:站控
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||||
|
if (control && control.controlMode == 'Center') { // Center:中控, Local:站控
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
loadTableData() {
|
||||||
|
this.tableData = [];
|
||||||
|
if (this.stationList) {
|
||||||
|
this.stationList.forEach(station => {
|
||||||
|
if (station.createControlMode) {
|
||||||
|
this.tableData.push({
|
||||||
|
code: station.code,
|
||||||
|
operate: station.name || '',
|
||||||
|
control: '',
|
||||||
|
check: false,
|
||||||
|
disabled: false,
|
||||||
|
status: 'normal',
|
||||||
|
result: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initTableDataStatus() {
|
||||||
|
this.tableData = [];
|
||||||
|
if (this.work === 'dispatchWork') {
|
||||||
|
this.stationList && this.stationList.forEach(station => {
|
||||||
|
if (station.createControlMode) {
|
||||||
|
const control = this.$store.getters['map/getDeviceByCode'](station.code);
|
||||||
|
this.tableData.push({
|
||||||
|
code: station.code,
|
||||||
|
operate: station.name || '',
|
||||||
|
control: control ? this.controlProps[control.controlMode] : '',
|
||||||
|
check: false,
|
||||||
|
disabled: this.checkBoxDisabled(station),
|
||||||
|
status: 'normal',
|
||||||
|
result: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (this.work === 'localWork') {
|
||||||
|
const stationCodeList = this.$store.state.map.stationControlMap[this.$store.state.training.roleDeviceCode] || [];
|
||||||
|
const list = [...new Set(stationCodeList)]; // 去重
|
||||||
|
list && list.forEach(stationCode => {
|
||||||
|
const station = this.$store.getters['map/getDeviceByCode'](stationCode);
|
||||||
|
this.tableData.push({
|
||||||
|
code: station.code,
|
||||||
|
operate: station.name || '',
|
||||||
|
control: station ? this.controlProps[station.controlMode] : '',
|
||||||
|
check: false,
|
||||||
|
disabled: this.checkBoxDisabled(station),
|
||||||
|
status: 'normal',
|
||||||
|
result: ''
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doShow(operate) {
|
||||||
|
if (!this.dialogShow) {
|
||||||
|
this.operate = operate || {};
|
||||||
|
this.operation = operate.operation;
|
||||||
|
this.disabledSure = false;
|
||||||
|
this.initTableDataStatus();
|
||||||
|
}
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
const operate = {
|
||||||
|
operation: OperationEvent.Command.cancel.menu.operation
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
removeSelection(code) {
|
||||||
|
let selectionIndex = -1;
|
||||||
|
this.selection.forEach((item, index) => {
|
||||||
|
if (item.code === code) {
|
||||||
|
selectionIndex = index;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (selectionIndex > -1) {
|
||||||
|
this.selection.splice(selectionIndex, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleChooseChange(selection) {
|
||||||
|
this.selection = selection;
|
||||||
|
const stationCodeList = selection.map(elem => { return elem.code; });
|
||||||
|
if (selection && selection.length) {
|
||||||
|
const operate = {
|
||||||
|
operation: '',
|
||||||
|
val: stationCodeList.join('::'),
|
||||||
|
selection: selection
|
||||||
|
};
|
||||||
|
|
||||||
|
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||||
|
operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation;
|
||||||
|
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||||
|
operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation;
|
||||||
|
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||||
|
operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.disabledSure = true;
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
}
|
||||||
|
this.disabledSure = false;
|
||||||
|
});
|
||||||
|
} else if (!selection) {
|
||||||
|
this.$messageBox('Please select a piece of data');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
requestCommit() {
|
||||||
|
const stationCodeList = this.selection.map(elem => { return elem.code; });
|
||||||
|
const operate = {
|
||||||
|
messages: ['Confirm that the control mode of the following operation area is changed from central control to station control:'],
|
||||||
|
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
|
||||||
|
val: stationCodeList.join('::'),
|
||||||
|
selection: this.selection,
|
||||||
|
param: {
|
||||||
|
stationCodes: stationCodeList
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.selection.forEach((elem, index) => {
|
||||||
|
operate.messages.push(`Operating Area ${index + 1}:${elem.operate}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.disabledSure = true;
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.$refs.twoConfirmation.doShow(operate);
|
||||||
|
} else {
|
||||||
|
this.disabledSure = false;
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.disabledSure = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
forkCommit() {
|
||||||
|
const stationCodeList = this.selection.map(elem => { return elem.code; });
|
||||||
|
const operate = {
|
||||||
|
messages: ['Confirm that the control mode of the following operation area is changed from station control to central control:'],
|
||||||
|
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
|
||||||
|
val: stationCodeList.join('::'),
|
||||||
|
selection: this.selection,
|
||||||
|
param: {
|
||||||
|
stationCodes: stationCodeList
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.selection.forEach((elem, index) => {
|
||||||
|
operate.messages.push(`Operating Area ${index + 1}:${elem.operate}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.disabledSure = true;
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.$refs.twoConfirmation.doShow(operate);
|
||||||
|
} else {
|
||||||
|
this.disabledSure = false;
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.disabledSure = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
conterCommit() {
|
||||||
|
const stationCodeList = this.selection.map(elem => { return elem.code; });
|
||||||
|
const operate = {
|
||||||
|
messages: ['Confirm that the control mode of the following operation area is changed from station control to central control:'],
|
||||||
|
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
|
||||||
|
val: stationCodeList.join('::'),
|
||||||
|
selection: this.selection,
|
||||||
|
param: {
|
||||||
|
stationCodes: stationCodeList
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.selection.forEach((elem, index) => {
|
||||||
|
operate.messages.push(`Operating Area ${index + 1}:${elem.operate}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.disabledSure = true;
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.$refs.twoConfirmation.doShow(operate);
|
||||||
|
} else {
|
||||||
|
this.disabledSure = false;
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.disabledSure = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getOperate(operate) {
|
||||||
|
if (operate.cancel) {
|
||||||
|
this.disabledSure = this.disabledSend = false;
|
||||||
|
this.disabledClose = false;
|
||||||
|
}
|
||||||
|
if (operate.commit || operate.timeout) {
|
||||||
|
this.disabledSend = this.disabledSure = true;
|
||||||
|
this.disabledClose = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.xian-01__systerm .el-dialog .control_button button{
|
||||||
|
max-width:180px;
|
||||||
|
width:auto ;
|
||||||
|
padding-left: 5px ;
|
||||||
|
padding-right: 5px ;
|
||||||
|
min-width: 80px;
|
||||||
|
}
|
||||||
|
</style>
|
223
src/jmapNew/theme/datie_02/menus/menuDialog/switchControl.vue
Normal file
223
src/jmapNew/theme/datie_02/menus/menuDialog/switchControl.vue
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="switch-control"
|
||||||
|
:class="popClass"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="300px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
: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>
|
||||||
|
</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-col>
|
||||||
|
<el-col :span="11" :offset="2">
|
||||||
|
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
|
||||||
|
道岔解单锁</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>
|
||||||
|
</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>
|
||||||
|
</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-col>
|
||||||
|
<el-col :span="8" :offset="4">
|
||||||
|
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import NoticeInfo from '@/jmapNew/theme/components/menus/dialog/childDialog/noticeInfo';
|
||||||
|
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||||
|
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
|
|
||||||
|
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'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
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.Switch.lock.menu.operation) {
|
||||||
|
return 'Turnout lock';
|
||||||
|
} else if (this.operation == OperationEvent.Switch.unlock.menu.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) {
|
||||||
|
return 'Turnout reverse';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(operate, selected) {
|
||||||
|
this.$root.$emit('dialogOpen', selected);
|
||||||
|
this.selected = selected;
|
||||||
|
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) {
|
||||||
|
this.isTurnBlock = true;
|
||||||
|
this.turnRadio = '1';
|
||||||
|
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||||
|
this.isTurnBlock = true;
|
||||||
|
this.turnRadio = '2';
|
||||||
|
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||||
|
this.isLock = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
this.lock(); // 道岔单锁
|
||||||
|
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||||
|
this.block(); // 道岔封锁
|
||||||
|
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||||
|
this.locate(); // 道岔定位
|
||||||
|
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||||
|
this.reverse(); // 道岔反位
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 道岔单锁
|
||||||
|
lock() {
|
||||||
|
this.sendCommand(menuOperate.Switch.lock);
|
||||||
|
},
|
||||||
|
// 道岔封锁
|
||||||
|
block() {
|
||||||
|
this.sendCommand(menuOperate.Switch.block);
|
||||||
|
},
|
||||||
|
// 道岔定位
|
||||||
|
locate() {
|
||||||
|
this.sendCommand(menuOperate.Switch.locate);
|
||||||
|
},
|
||||||
|
// 道岔反位
|
||||||
|
reverse() {
|
||||||
|
this.sendCommand(menuOperate.Switch.reverse);
|
||||||
|
},
|
||||||
|
|
||||||
|
sendCommand(operate) {
|
||||||
|
this.loading = true;
|
||||||
|
commitOperate(operate, {}, 2).then(({valid})=>{
|
||||||
|
this.loading = false;
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.loading = false;
|
||||||
|
this.doClose();
|
||||||
|
console.error(error);
|
||||||
|
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
|
||||||
|
};
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.doClose();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
188
src/jmapNew/theme/datie_02/menus/menuDialog/trainOperation.vue
Normal file
188
src/jmapNew/theme/datie_02/menus/menuDialog/trainOperation.vue
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
title="Train operation"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="30%"
|
||||||
|
:modal="false"
|
||||||
|
:before-close="handleClose"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" :offset="1">Train:</el-col>
|
||||||
|
<el-col :span="19">
|
||||||
|
<el-select v-model="groupNumber" size="small" style="width:230px" @change="trainChange">
|
||||||
|
<el-option
|
||||||
|
v-for="option in activeTrainList"
|
||||||
|
:key="option"
|
||||||
|
:label="option"
|
||||||
|
:value="option"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row style="margin-top: 15px;">
|
||||||
|
<el-col :span="18" :offset="1">
|
||||||
|
<el-slider
|
||||||
|
v-model="speed"
|
||||||
|
:step="10"
|
||||||
|
:max="55"
|
||||||
|
:disabled="!groupNumber"
|
||||||
|
:marks="marks"
|
||||||
|
show-stops
|
||||||
|
@input="inputSpeed"
|
||||||
|
@change="changeSpeed"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="3" :offset="2">
|
||||||
|
<el-button size="mini" type="danger" :disabled="!groupNumber" style="margin-top: 15px;" @click="brakeTrain">brake</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row style="margin-top: 40px">
|
||||||
|
<el-col :span="3" :offset="7" style="text-align: right;">
|
||||||
|
<el-button :disabled="!showRight || !groupNumber" type="primary" size="mini" icon="el-icon-arrow-left" @click="adjustDirection" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="3" style="text-align: center;">
|
||||||
|
<img style="width: 50px" :src="trainPic">
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="3">
|
||||||
|
<el-button :disabled="showRight || !groupNumber" type="primary" size="mini" icon="el-icon-arrow-right" @click="adjustDirection" />
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row style="text-align: center;margin-top: 15px;">
|
||||||
|
<el-button type="primary" :disabled="!groupNumber" size="mini" @click="handleRun">Run</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import LeftTrain from '@/assets/left_train.png';
|
||||||
|
import RightTrain from '@/assets/right_train.png';
|
||||||
|
import { sandTableTrainControl } from '@/api/simulation';
|
||||||
|
import { menuOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
|
export default {
|
||||||
|
name: 'TrainOperation',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
speed: 0,
|
||||||
|
dialogVisible: false,
|
||||||
|
leftTrainPic: LeftTrain,
|
||||||
|
rightTrainPic: RightTrain,
|
||||||
|
groupNumber: '',
|
||||||
|
changeSpeedFlag: false,
|
||||||
|
right: true,
|
||||||
|
reversal: false,
|
||||||
|
train: null,
|
||||||
|
marks: {
|
||||||
|
0: '0',
|
||||||
|
10: '10km/h',
|
||||||
|
20: '20km/h',
|
||||||
|
30: '30km/h',
|
||||||
|
40: '40km/h',
|
||||||
|
50: {
|
||||||
|
style: {
|
||||||
|
whiteSpace:'nowrap'
|
||||||
|
},
|
||||||
|
label: '50km/h'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
showRight() {
|
||||||
|
return (this.right && !this.reversal) || (!this.right && this.reversal);
|
||||||
|
},
|
||||||
|
trainPic() {
|
||||||
|
if ((this.right && this.reversal) || (!this.right && !this.reversal)) {
|
||||||
|
return this.leftTrainPic;
|
||||||
|
} else {
|
||||||
|
return this.rightTrainPic;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
activeTrainList() {
|
||||||
|
return this.$store.state.map.activeTrainList;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClose() {
|
||||||
|
this.$store.dispatch('menuOperation/setSelected', {device: {}});
|
||||||
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
trainChange(val) {
|
||||||
|
const train = this.$store.getters['map/getDeviceByCode'](val);
|
||||||
|
if (train && train.trainWindowCode) {
|
||||||
|
const trainWindow = this.$store.getters['map/getDeviceByCode'](train.trainWindowCode);
|
||||||
|
this.reversal = trainWindow.reversal;
|
||||||
|
}
|
||||||
|
this.groupNumber = train.groupNumber;
|
||||||
|
this.train = train;
|
||||||
|
if (this.right != train.right) {
|
||||||
|
this.right = !!train.right;
|
||||||
|
}
|
||||||
|
if (this.speed != train.speed && !this.changeSpeedFlag) {
|
||||||
|
this.speed = train.speed;
|
||||||
|
this.$nextTick(() => { this.changeSpeedFlag = false; });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doShow() {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
inputSpeed(val) {
|
||||||
|
this.changeSpeedFlag = true;
|
||||||
|
},
|
||||||
|
changeSpeed(val) {
|
||||||
|
if (!this.groupNumber) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: this.speed }).then(resp => {
|
||||||
|
}).catch(err => { this.$message.error(err.message); this.speed = this.train.speed; }).finally(() => { this.changeSpeedFlag = false; });
|
||||||
|
},
|
||||||
|
adjustDirection() {
|
||||||
|
if (!this.groupNumber) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: !this.right, speed: this.speed }).then(resp => {
|
||||||
|
this.right = !this.right;
|
||||||
|
}).catch(err => { this.$message.error(err.message); });
|
||||||
|
},
|
||||||
|
brakeTrain() {
|
||||||
|
if (!this.groupNumber) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: 0 }).then(resp => {
|
||||||
|
this.speed = 0;
|
||||||
|
}).catch(err => { this.$message.error(err.message); });
|
||||||
|
},
|
||||||
|
handleRun() {
|
||||||
|
if (!this.groupNumber) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const step = {
|
||||||
|
over: true,
|
||||||
|
operation: menuOperate.Common.trainDrive.operation,
|
||||||
|
cmdType: menuOperate.Common.trainDrive.cmdType,
|
||||||
|
param: {
|
||||||
|
groupNumber: this.groupNumber,
|
||||||
|
param: {
|
||||||
|
speedLimit: '',
|
||||||
|
through: 0,
|
||||||
|
targetDeviceCode: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
} else {
|
||||||
|
this.$messageBox('Failed to set or cancel the fault!');
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.$messageBox(error.message || 'Failed to set or cancel the fault!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
223
src/jmapNew/theme/datie_02/menus/menuDialog/viewName.vue
Normal file
223
src/jmapNew/theme/datie_02/menus/menuDialog/viewName.vue
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="chengdou-03__systerm view-name"
|
||||||
|
title="UI Control"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="320px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-checkbox-group v-model="nameLevels">
|
||||||
|
<el-row>
|
||||||
|
<el-checkbox :label="1">信号机名称</el-checkbox>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-checkbox :label="11">轨道名称</el-checkbox>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-checkbox :label="7">道岔名称</el-checkbox>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-checkbox :label="9">道岔区段名称</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-col>
|
||||||
|
<el-col :span="4" :offset="8">
|
||||||
|
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ViewName',
|
||||||
|
components: {
|
||||||
|
NoticeInfo
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogShow: false,
|
||||||
|
loading: false,
|
||||||
|
operate: null,
|
||||||
|
nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
show() {
|
||||||
|
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||||
|
},
|
||||||
|
domIdCancel() {
|
||||||
|
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||||
|
},
|
||||||
|
domIdConfirm() {
|
||||||
|
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.setNameDisplay();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(operate) {
|
||||||
|
// 如果不是断点激活显示,而是第一次显示时,需要初始化参数
|
||||||
|
if (!this.dialogShow) {
|
||||||
|
this.operate = operate || {};
|
||||||
|
this.operation = operate.operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.loading = false;
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
const operate = {
|
||||||
|
type: this.operate.type,
|
||||||
|
operation: OperationEvent.Command.cancel.menu.operation
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
commit() {
|
||||||
|
this.setNameDisplay();
|
||||||
|
this.doClose();
|
||||||
|
// const operate = {
|
||||||
|
// over: true,
|
||||||
|
// type: this.operate.type,
|
||||||
|
// operation: OperationEvent.Command.close.confirm.operation,
|
||||||
|
// val: this.nameLevels.sort().join('::')
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// this.loading = true;
|
||||||
|
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||||
|
// this.loading = false;
|
||||||
|
// if (valid) {
|
||||||
|
// this.doClose();
|
||||||
|
// this.setNameDisplay();
|
||||||
|
// }
|
||||||
|
// }).catch((e) => {
|
||||||
|
// console.log(e, '------------');
|
||||||
|
// this.loading = false;
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
setNameDisplay() {
|
||||||
|
const deviceList = [];
|
||||||
|
|
||||||
|
// 信号机
|
||||||
|
let nameShow = this.nameLevels.includes(1);
|
||||||
|
const signalList = this.$store.getters['map/signalList'];
|
||||||
|
if (signalList && signalList.length > 0) {
|
||||||
|
signalList.forEach(elem => {
|
||||||
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按钮名称
|
||||||
|
nameShow = this.nameLevels.includes(3);
|
||||||
|
|
||||||
|
// 道岔
|
||||||
|
nameShow = this.nameLevels.includes(7); // 道岔名称
|
||||||
|
const switchSectionNameShow = this.nameLevels.includes(9); // 道岔轨名称
|
||||||
|
const switchList = this.$store.getters['map/switchList'];
|
||||||
|
if (switchList && switchList.length > 0) {
|
||||||
|
switchList.forEach(elem => {
|
||||||
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow }));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 控制模式
|
||||||
|
const indicatorShow = this.nameLevels.includes(8);
|
||||||
|
const control = this.$store.getters['map/stationControlList'];
|
||||||
|
if (control && control.length > 0) {
|
||||||
|
control.forEach(elem => {
|
||||||
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); // 标识灯名称
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 区段
|
||||||
|
nameShow = false;
|
||||||
|
let standTrackNameShow = false;
|
||||||
|
let reentryTrackNameShow = false;
|
||||||
|
let transferTrackNameShow = false;
|
||||||
|
const sectionList = this.$store.getters['map/sectionList'];
|
||||||
|
if (sectionList && sectionList.length > 0) {
|
||||||
|
sectionList.forEach(elem => {
|
||||||
|
// if (elem.switchSection && elem.parentCode) {
|
||||||
|
// // 道岔轨的区段名称默认不显示
|
||||||
|
// nameShow = false;
|
||||||
|
if (elem.type == '03') {
|
||||||
|
nameShow = false;
|
||||||
|
} else if (elem.type === '01') {
|
||||||
|
// 计轴区段名称
|
||||||
|
nameShow = this.nameLevels.includes(11);
|
||||||
|
} else if (elem.type === '02') {
|
||||||
|
// 轨道轨名称
|
||||||
|
nameShow = this.nameLevels.includes(5);
|
||||||
|
} else if (elem.type === '04') {
|
||||||
|
// 道岔区段名称
|
||||||
|
nameShow = this.nameLevels.includes(9);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 站台轨名称
|
||||||
|
if (elem.standTrack) {
|
||||||
|
standTrackNameShow = this.nameLevels.includes(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 折返轨名称
|
||||||
|
if (elem.reentryTrack) {
|
||||||
|
reentryTrackNameShow = this.nameLevels.includes(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换轨名称
|
||||||
|
if (elem.transferTrack) {
|
||||||
|
transferTrackNameShow = this.nameLevels.includes(6);
|
||||||
|
}
|
||||||
|
|
||||||
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 停车点
|
||||||
|
const destCodeShow = this.nameLevels.includes(10);
|
||||||
|
const stopPointList = this.$store.getters['map/stopPointList'];
|
||||||
|
if (stopPointList && stopPointList.length > 0) {
|
||||||
|
stopPointList.forEach(elem => {
|
||||||
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow }));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 车站
|
||||||
|
const kmPostShow = this.nameLevels.includes(12);
|
||||||
|
const stationList = this.$store.getters['map/stationList'];
|
||||||
|
if (stationList && stationList.length > 0) {
|
||||||
|
stationList.forEach(elem => {
|
||||||
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); // 公里标
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -837,6 +837,10 @@ export const OperationEvent = {
|
|||||||
secondaryConfirm: {
|
secondaryConfirm: {
|
||||||
operation: '1012',
|
operation: '1012',
|
||||||
domId: '_Tips-Switch-Locate-SecondaryConfirm'
|
domId: '_Tips-Switch-Locate-SecondaryConfirm'
|
||||||
|
},
|
||||||
|
mbar: {
|
||||||
|
operation: '1013',
|
||||||
|
domId: '_Tips-Switch-Locate-Mbar{BOTTOM}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 道岔总反/反位操作
|
// 道岔总反/反位操作
|
||||||
@ -855,7 +859,11 @@ export const OperationEvent = {
|
|||||||
},
|
},
|
||||||
secondaryConfirm: {
|
secondaryConfirm: {
|
||||||
operation: '1022',
|
operation: '1022',
|
||||||
domId: '_Tips-Switch-Locate-SecondaryConfirm'
|
domId: '_Tips-Switch-Reverse-SecondaryConfirm'
|
||||||
|
},
|
||||||
|
mbar: {
|
||||||
|
operation: '1023',
|
||||||
|
domId: '_Tips-Switch-Reverse-Mbar{BOTTOM}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 道岔单锁
|
// 道岔单锁
|
||||||
@ -883,6 +891,10 @@ export const OperationEvent = {
|
|||||||
secondaryConfirm: {
|
secondaryConfirm: {
|
||||||
operation: '1034',
|
operation: '1034',
|
||||||
domId: '_Tips-Switch-Lock-secondaryConfirm'
|
domId: '_Tips-Switch-Lock-secondaryConfirm'
|
||||||
|
},
|
||||||
|
mBar: {
|
||||||
|
operation: '1035',
|
||||||
|
domId: '_Tips-Switch-Lock-MBar{BOTTOM}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 道岔解锁
|
// 道岔解锁
|
||||||
@ -922,6 +934,10 @@ export const OperationEvent = {
|
|||||||
menuButton: {
|
menuButton: {
|
||||||
operation: '1047',
|
operation: '1047',
|
||||||
domId: '_Tips-Switch-Unlock-Menu{BOTTOM}'
|
domId: '_Tips-Switch-Unlock-Menu{BOTTOM}'
|
||||||
|
},
|
||||||
|
mbar: {
|
||||||
|
operation: '1048',
|
||||||
|
domId: '_Tips-Switch-Unlock-Mbar{BOTTOM}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 道岔封闭
|
// 道岔封闭
|
||||||
@ -1583,6 +1599,10 @@ export const OperationEvent = {
|
|||||||
secondaryConfirm: {
|
secondaryConfirm: {
|
||||||
operation: '3043',
|
operation: '3043',
|
||||||
domId: '_Tips-Signal-Reopen-SecondaryConfirm'
|
domId: '_Tips-Signal-Reopen-SecondaryConfirm'
|
||||||
|
},
|
||||||
|
mbar: {
|
||||||
|
operation: '3044',
|
||||||
|
domId: '_Tips-Signal-Reopen-Mbar{BOTTOM}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 人解列车进路 (总人解)
|
// 人解列车进路 (总人解)
|
||||||
@ -1810,6 +1830,10 @@ export const OperationEvent = {
|
|||||||
menuButton:{
|
menuButton:{
|
||||||
operation: '3132',
|
operation: '3132',
|
||||||
domId: '_Tips-Signal-SignalClose-Menu{BOTTOM}'
|
domId: '_Tips-Signal-SignalClose-Menu{BOTTOM}'
|
||||||
|
},
|
||||||
|
mbar: {
|
||||||
|
operation: '3133',
|
||||||
|
domId: '_Tips-Signal-SignalClose-mBar{BOTTOM}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 进路交人工控
|
// 进路交人工控
|
||||||
|
Loading…
Reference in New Issue
Block a user