调整福州使用新版指令方式发送

This commit is contained in:
zyy 2019-12-31 16:11:09 +08:00
parent 7dde1958f5
commit 3044da2ea4
60 changed files with 1414 additions and 1656 deletions

View File

@ -25,7 +25,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'NoticeInfo',

View File

@ -1,16 +1,5 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm confirm-control"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<el-dialog v-dialogDrag class="fuzhou-01__systerm confirm-control" :title="title" :visible.sync="show" width="360px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false" append-to-body>
<div class="context">
<template v-for="(message,index) in messages">
<span :key="index">{{ message }}</span>
@ -29,7 +18,8 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import NoticeInfo from './childDialog/noticeInfo';
export default {
@ -166,9 +156,9 @@ export default {
//
routeSetting() {
const operate = {
send: true,
type: this.operate.type,
operation: OperationEvent.Signal.arrangementRoute.confirm.operation
over: true,
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
};
this.loading = true;
@ -186,9 +176,9 @@ export default {
//
signalClose() {
const operate = {
send: true,
type: this.operate.type,
operation: OperationEvent.Signal.signalClose.confirm.operation
over: true,
operation: OperationEvent.Signal.signalClose.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
};
this.loading = true;
@ -206,9 +196,9 @@ export default {
//
reopenSignal() {
const operate = {
send: true,
type: this.operate.type,
operation: OperationEvent.Signal.reopenSignal.confirm.operation
over: true,
operation: OperationEvent.Signal.reopenSignal.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.loading = true;
@ -226,9 +216,9 @@ export default {
//
cancelTrainRoute() {
const operate = {
send: true,
type: this.operate.type,
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.loading = true;
@ -246,9 +236,9 @@ export default {
//
humanControl() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.humanControl.menu.operation
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
};
this.loading = true;
@ -266,9 +256,9 @@ export default {
// ATS
atsAutoControl() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.atsAutoControl.menu.operation
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
};
this.loading = true;
@ -286,9 +276,9 @@ export default {
//
setRunLevel() {
const operate = {
send: true,
type: this.operate.type,
over: true,
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
val: this.operate.val
};
@ -307,9 +297,9 @@ export default {
//
setStopTime() {
const operate = {
send: true,
type: this.operate.type,
over: true,
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
val: this.operate.val
};
@ -328,9 +318,9 @@ export default {
//
setBackStrategy() {
const operate = {
send: true,
type: this.operate.type,
over: true,
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
val: this.operate.val
};
@ -348,7 +338,6 @@ export default {
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -1,16 +1,5 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="540px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<el-dialog v-dialogDrag class="fuzhou-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="540px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false" append-to-body>
<div style="height: 60px; padding-left: 20px">
<span style="font-size: 18px">{{ message }}</span>
</div>
@ -26,7 +15,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'ConfirmControlSpeed',
@ -34,7 +23,6 @@ export default {
return {
dialogShow: false,
loading: false,
type: '',
operation: '',
message: ''
};
@ -63,17 +51,13 @@ export default {
domIdConfirm() {
if (this.dialogShow) {
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.confirm.domId;
return OperationEvent.Section.setSpeed.confirm.domId; //
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.confirm.domId;
return OperationEvent.Section.cancelSpeed.confirm.domId; //
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.confirm.domId;
return OperationEvent.Switch.setSpeed.confirm.domId; //
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
/** 道岔取消限速*/
return OperationEvent.Switch.cancelSpeed.confirm.domId;
return OperationEvent.Switch.cancelSpeed.confirm.domId; //
}
}
return '';
@ -87,7 +71,6 @@ export default {
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.type = operate.type;
this.operation = operate.operation;
this.message = operate.message;
}
@ -104,9 +87,7 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
type: this.type
};
const operate = {};
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/
@ -131,14 +112,12 @@ export default {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.$emit('setOperate', { step: 0, success: false });
this.doClose();
});
},
cancel() {
const operate = {
type: this.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -26,7 +26,7 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'RouteUnlockConfirm',
@ -82,7 +82,6 @@ export default {
},
commit() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.unlock.confirm.operation
};
@ -102,7 +101,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -29,8 +29,9 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmTrain',
@ -137,9 +138,9 @@ export default {
//
routeSetting() {
const operate = {
send: true,
type: this.operate.type,
operation: OperationEvent.Train.addTrainId.confirm.operation
over: true,
operation: OperationEvent.Train.addTrainId.confirm.operation,
cmdType: CMD.Train.CMD_ADD_TRAIN_ID
};
this.loading = true;
@ -156,7 +157,6 @@ export default {
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -83,9 +83,10 @@
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
import ConfirmSignalUnlock from './childDialog/confirmSignalUnlock';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteCmdControl',
@ -269,7 +270,6 @@ export default {
},
commandHasPopUp() {
const operate = {
type: MapDeviceType.Signal.type
};
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
@ -290,7 +290,6 @@ export default {
},
commandNoPopUp() {
const operate = {
type: MapDeviceType.Signal.type
};
if (this.operation == OperationEvent.Signal.guide.menu.operation) {
@ -314,7 +313,6 @@ export default {
},
confirm1() {
const operate = {
type: MapDeviceType.Signal.type
};
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
@ -343,16 +341,17 @@ export default {
},
confirm2() {
const operate = {
send: true,
type: MapDeviceType.Signal.type
over: true
};
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
/** 信号解封*/
operate.operation = OperationEvent.Signal.unlock.confirm2.operation;
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
/** 办理引导进路*/
operate.operation = OperationEvent.Signal.guide.confirm2.operation;
operate.cmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
}
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
@ -375,7 +374,6 @@ export default {
},
stop() {
const operate = {
type: MapDeviceType.Signal.type
};
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
@ -401,7 +399,6 @@ export default {
},
close() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.close.menu.operation
};

View File

@ -36,9 +36,11 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteControl',
@ -65,7 +67,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
@ -153,9 +155,9 @@ export default {
//
cancelTrainRouteByLocal() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.loading = true;
@ -173,8 +175,9 @@ export default {
//
cancelTrainRouteByCentral() {
const operate = {
type: MapDeviceType.Signal.type,
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
messages: [this.$t('tip.signalModeToManualModeTipPrefix') + this.signalName + this.$t('tip.signalModeToManualModeTipSuffix')]
};
@ -193,7 +196,6 @@ export default {
//
signalClose() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.signalClose.menu.operation,
messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName]
};
@ -213,7 +215,6 @@ export default {
//
reopenSignal() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName]
};
@ -233,8 +234,8 @@ export default {
//
setAutoInterlock() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
over: true,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
operation: OperationEvent.Signal.setAutoInterlock.menu.operation
};
@ -253,9 +254,9 @@ export default {
//
cancelAutoInterlock() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation
over: true,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
};
this.loading = true;
@ -273,9 +274,9 @@ export default {
//
setAutoTrigger() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.setAutoTrigger.menu.operation
over: true,
operation: OperationEvent.Signal.setAutoTrigger.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
};
this.loading = true;
@ -293,9 +294,9 @@ export default {
//
cancelAutoTrigger() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation
over: true,
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
};
this.doClose();
@ -314,7 +315,6 @@ export default {
//
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.close.menu.operation
};

View File

@ -62,8 +62,9 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteDetail',
@ -129,9 +130,9 @@ export default {
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.detail.menu.operation
over: true,
operation: OperationEvent.Signal.detail.menu.operation,
cmdType: CMD.Signal.CMD_STAND_VIEW_STATUS
};
this.loading = true;
@ -148,7 +149,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -79,9 +79,11 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteHandControl',
@ -121,7 +123,7 @@ export default {
return '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
@ -212,24 +214,14 @@ export default {
this.selection = selection;
}
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const codeList = selection.map(elem => { return elem.code; });
if (codeList && codeList.length) {
const operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
val: codeList.join('::')
};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
@ -260,10 +252,14 @@ export default {
},
//
humanControl() {
const codeList = this.selection.map(elem => { return elem.code; });
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.humanControl.menu.operation
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param: {
Route_Code_List: codeList
}
};
this.loading = true;
@ -280,10 +276,14 @@ export default {
},
//
atsAutoControl() {
const codeList = this.selection.map(elem => { return elem.code; });
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.atsAutoControl.menu.operation
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param: {
Route_Code_List: codeList
}
};
this.loading = true;
@ -300,7 +300,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -53,8 +53,9 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteLock',
@ -131,9 +132,9 @@ export default {
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.lock.menu.operation
over: true,
operation: OperationEvent.Signal.lock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
};
this.loading = true;
@ -150,7 +151,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -1,15 +1,5 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm route-setting"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-dialog v-dialogDrag class="fuzhou-01__systerm route-setting" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="8"><span>{{ $t('menu.stationName') }}</span></el-col>
<el-col :span="8" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
@ -22,16 +12,7 @@
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<el-table
ref="table"
:data="tempData"
border
style="width: 100%; margin-top:10px"
size="mini"
height="120"
highlight-current-row
@row-click="clickEvent"
>
<el-table ref="table" :data="tempData" border style="width: 100%; margin-top:10px" size="mini" height="120" highlight-current-row @row-click="clickEvent">
<el-table-column :id="domIdChoose" prop="name" :label="this.$t('menu.route')" style="margin-left:30px" />
<el-table-column prop="protectedSection" :label="this.$t('menu.protectionSection')" :width="180">
<template slot-scope="scope">
@ -45,11 +26,7 @@
</template>
</el-table-column>
</el-table>
<el-row
justify="
center"
class="button-group"
>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="4">
<el-button
:id="domIdConfirm"
@ -69,7 +46,7 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
@ -200,9 +177,11 @@ export default {
//
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: row.code
val: row.code,
param: {
Route_Code: row.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -223,7 +202,6 @@ export default {
names = names + this.row.overlapSwitchList.map(elem => { return elem.name; }).join('');
}
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
messages: [this.$t('menu.accessSetting') + this.$t('global.colon') + `${this.row.name}${names}(${this.row.stationName})`]
};
@ -245,7 +223,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -1,16 +1,6 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm section-cmd-control"
:title="title"
:visible.sync="show"
width="840px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-dialog v-dialogDrag class="fuzhou-01__systerm section-cmd-control" :title="title" :visible.sync="show" width="840px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
<el-form label-position="center" size="mini">
@ -18,12 +8,7 @@
<el-col :span="8">
<el-form-item :label="this.$t('global.status')" label-width="40px">
<el-select v-model="operation" size="small" disabled>
<el-option
v-for="option in typeList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
<el-option v-for="option in typeList" :key="option.code" :label="option.name" :value="option.code" />
</el-select>
</el-form-item>
</el-col>
@ -40,16 +25,7 @@
</el-row>
</el-form>
</div>
<el-table
ref="tempData"
class="table"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
height="200"
>
<el-table :data="tempData" border style="width: 100%" size="mini" highlight-current-row height="200">
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
@ -58,18 +34,17 @@
<span class="notice">{{ message }}</span>
<el-row class="button-group">
<el-col :span="2" :offset="3">
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
v-show="timeCountCommand>0"
>({{ timeCountCommand }})</span></el-button>
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">
{{ $t('menu.release') }}
<span v-show="timeCountCommand>0">({{ timeCountCommand }})</span></el-button>
</el-col>
<el-col :span="2" :offset="1">
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
</el-button>
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<span
v-show="timeCountConfirm>0"
>({{ timeCountConfirm }})</span></el-button>
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">
{{ $t('menu.secondConfirm') }}
<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
@ -82,8 +57,9 @@
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionCmdControl',
@ -120,14 +96,11 @@ export default {
domIdCommand() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
return OperationEvent.Section.unlock.order.domId;
return OperationEvent.Section.unlock.order.domId; //
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
return OperationEvent.Section.fault.order.domId;
return OperationEvent.Section.fault.order.domId; //
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
return OperationEvent.Section.axlePreReset.order.domId;
return OperationEvent.Section.axlePreReset.order.domId; //
}
}
return '';
@ -135,14 +108,11 @@ export default {
domIdConfirm1() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
return OperationEvent.Section.unlock.confirm1.domId;
return OperationEvent.Section.unlock.confirm1.domId; //
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
return OperationEvent.Section.fault.confirm1.domId;
return OperationEvent.Section.fault.confirm1.domId; //
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
return OperationEvent.Section.axlePreReset.confirm1.domId;
return OperationEvent.Section.axlePreReset.confirm1.domId; //
}
}
return '';
@ -289,9 +259,7 @@ export default {
commandHasPopUp() {
},
commandNoPopUp() {
const operate = {
type: MapDeviceType.Section.type
};
const operate = {};
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
@ -320,7 +288,6 @@ export default {
},
confirm1() {
const operate = {
type: MapDeviceType.Section.type
};
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
@ -351,21 +318,22 @@ export default {
});
},
confirm2() {
const operate = {
send: true,
type: MapDeviceType.Section.type
};
const operate = {};
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_UNBLOCK;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
operate.operation = OperationEvent.Section.fault.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_AXIS_PRE_RESET;
}
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -386,9 +354,7 @@ export default {
});
},
stop() {
const operate = {
type: MapDeviceType.Section.type
};
const operate = {};
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
@ -416,7 +382,6 @@ export default {
},
close() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.close.menu.operation
};
@ -428,9 +393,6 @@ export default {
this.doClose();
});
},
getOperate(operate) {
/** 弹框返回值处理*/
},
setButtonEnable(param) {
this.cmdDisabled = [true, true, true];
if (param && param.step >= 0) {

View File

@ -1,15 +1,5 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm section-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-dialog v-dialogDrag class="fuzhou-01__systerm section-control" :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>{{ $t('menu.stationName') }}</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</span></el-col>
@ -35,8 +25,10 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionControl',
@ -60,7 +52,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Section.lock.menu.operation) {
@ -111,64 +103,41 @@ export default {
},
commit() {
if (this.operation == OperationEvent.Section.lock.menu.operation) {
/** 区段封锁*/
this.lock();
this.lock(); //
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/
this.split();
this.split(); //
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
this.active(); //
}
},
//
//
lock() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.lock.menu.operation
over: true,
operation: OperationEvent.Section.lock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
this.sendCommand(operate);
},
//
split() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.split.menu.operation
over: true,
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
this.sendCommand(operate);
},
//
active() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.active.menu.operation
over: true,
operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
@ -176,14 +145,12 @@ export default {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -1,16 +1,6 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm section-cmd-speed"
:title="title"
:visible.sync="show"
width="840px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-dialog v-dialogDrag class="fuzhou-01__systerm section-cmd-speed" :title="title" :visible.sync="show" width="840px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
<el-form label-position="center" size="mini">
@ -18,12 +8,7 @@
<el-col :span="6">
<el-form-item :label="this.$t('menu.type')" label-width="40px">
<el-select v-model="operation" size="small" disabled>
<el-option
v-for="option in typeList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
<el-option v-for="option in typeList" :key="option.code" :label="option.name" :value="option.code" />
</el-select>
</el-form-item>
</el-col>
@ -39,13 +24,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="this.$t('menu.speedLimitValue')" label-width="80px">
<el-select
:id="domIdChoose"
v-model="speed"
size="small"
:disabled="spdDisabled"
@change="speedSelectChange"
>
<el-select :id="domIdChoose" v-model="formData.SpeedLimit_Value" size="small" :disabled="spdDisabled" @change="speedSelectChange">
<el-option v-for="item in speedList" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
@ -53,16 +32,7 @@
</el-row>
</el-form>
</div>
<el-table
ref="table"
class="table"
:data="tableData"
border
style="width: 100%"
size="mini"
highlight-current-row
height="200"
>
<el-table :data="tableData" border style="width: 100%" size="mini" highlight-current-row height="200">
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
@ -71,18 +41,17 @@
<span class="notice">{{ message }}</span>
<el-row class="button-group">
<el-col :span="2" :offset="3">
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
v-show="timeCountCommand>0"
>({{ timeCountCommand }})</span></el-button>
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">
{{ $t('menu.release') }}
<span v-show="timeCountCommand>0">({{ timeCountCommand }})</span></el-button>
</el-col>
<el-col :span="2" :offset="1">
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
</el-button>
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<span
v-show="timeCountConfirm>0"
>({{ timeCountConfirm }})</span></el-button>
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">
{{ $t('menu.secondConfirm') }}
<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
@ -96,9 +65,10 @@
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControlSpeed from './childDialog/confirmControlSpeed';
import { now } from '@/utils/date';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionCmdSpeed',
@ -113,7 +83,6 @@ export default {
order: 0,
row: null,
timer: null,
type: '',
operation: '',
cmdDisabled: [true, true, true],
spdDisabled: false,
@ -126,7 +95,9 @@ export default {
speedSpace: 5,
stationName: '',
name: '',
speed: ''
formData: {
SpeedLimit_Value: ''
}
};
},
computed: {
@ -143,7 +114,7 @@ export default {
speedList() {
const list = [];
for (var i = 0; i * this.speedSpace <= this.maxSpeed; i++) {
list.push(String(i * this.speedSpace));
list.push(i * this.speedSpace);
}
return list;
},
@ -270,7 +241,6 @@ export default {
watch: {
cmdDisabled: {
handler(val, oldVal) {
this.stpDisabled = true;
this.spdDisabled = false;
val.forEach((elem, index) => {
//
@ -286,7 +256,7 @@ export default {
},
deep: true
},
'speed': function (val) {
'formData.SpeedLimit_Value': function (val) {
if (val) this.cmdDisabled[0] = false;
}
},
@ -344,7 +314,7 @@ export default {
this.stationName = station.name;
}
this.speed = '';
this.formData.SpeedLimit_Value = '';
this.tableData = [];
this.selected = selected;
this.timeCountCommand = -1;
@ -352,11 +322,10 @@ export default {
this.cmdDisabled = [true, true, true];
this.stpDisabled = true;
this.order = 0;
this.type = operate.type;
this.operation = operate.operation;
this.setMessage(this.$t('tip.selectSpeedLimitValueTip'));
if (this.isCancelSpeed) {
this.speed = `${tempData}`;
this.formData.SpeedLimit_Value = `${tempData}`;
this.spdDisabled = true;
this.cmdDisabled = [false, true, true];
}
@ -374,7 +343,6 @@ export default {
},
speedSelectChange(val) {
const operate = {
type: this.type,
val: val
};
@ -395,26 +363,24 @@ export default {
});
},
command() {
const operate = {
type: this.type
};
const operate = {};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.sectionSetLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix');
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.sectionSetLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.sectionCancelLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix');
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.sectionCancelLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.switchSetLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix');
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.switchSetLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.switchCancelLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix');
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.switchCancelLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
}
this.setMessage(this.$t('tip.firstConfirmTip'));
@ -432,9 +398,7 @@ export default {
});
},
confirm1() {
const operate = {
type: this.type
};
const operate = {};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
@ -468,23 +432,26 @@ export default {
},
confirm2() {
const operate = {
send: true,
type: this.type,
val: this.speed
val: this.formData.SpeedLimit_Value,
param: this.formData
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED;
}
this.setMessage('');
@ -507,9 +474,7 @@ export default {
});
},
stop() {
const operate = {
type: this.type
};
const operate = {};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
@ -540,7 +505,6 @@ export default {
},
close() {
const operate = {
type: this.type,
operation: OperationEvent.Command.close.menu.operation
};
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickToClose'), result: '' });

View File

@ -82,7 +82,8 @@
<script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
export default {
@ -189,7 +190,6 @@ export default {
},
strategySelectChange(strategy) {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
val: `${strategy}`
};
@ -211,12 +211,14 @@ export default {
commit() {
if (this.isConfirm) {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
over: true,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
val: `${this.strategy}`
val: `${this.strategy}`,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
param:{
Stand_ReentryStrategy:this.strategy
}
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
@ -234,7 +236,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
over: true,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -26,8 +26,10 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetainTrain',
@ -51,7 +53,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
@ -79,7 +81,7 @@ export default {
});
},
methods: {
doShow(operate, selected) {
doShow(step, selected) {
if (!this.dialogShow) {
this.standName = '';
if (selected) {
@ -87,7 +89,7 @@ export default {
}
this.selected = selected;
this.operation = operate.operation;
this.operation = step.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
@ -122,77 +124,77 @@ export default {
},
//
setDetainTrain() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
const step = {
over: true,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelDetainTrain() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
const step = {
over: true,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelDetainTrainForce() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
const step = {
over: true,
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
cmdType: CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
earlyDeparture() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
const step = {
over: true,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -200,20 +202,20 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
setJumpStop() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
const step = {
over: true,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
val: this.selected.direction // , 01: /02:
val: this.selected.direction, // , 01: /02:
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -221,20 +223,20 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelJumpStop() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
const step = {
over: true,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
val: this.selected.direction // , 01: /02:
val: this.selected.direction, // , 01: /02:
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
@ -242,17 +244,16 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
const step = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = false;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -42,9 +42,10 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'StandDetail',
@ -145,8 +146,9 @@ export default {
},
commit() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.close.confirm.operation
over: true,
operation: OperationEvent.Command.close.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
};
this.loading = true;
@ -162,7 +164,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -55,8 +55,9 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetainTrainAll',
@ -109,7 +110,7 @@ export default {
/** status 01: 未扣车*/
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).status;
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {});
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) {
if (station && station.visible && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) {
this.tempData.push({ stationName: station.name, standName: elem.name });
}
});
@ -138,10 +139,8 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
choose(upDown) {
//
this.loadTableData();
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
val: `${upDown}`
};
@ -154,10 +153,13 @@ export default {
},
commit() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
over: true,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
val: this.upDown
cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN,
val: this.upDown,
param: {
Stand_AllLine: this.upDown
}
};
this.loading = true;
@ -174,7 +176,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -63,9 +63,10 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import ConfirmControl from './childDialog/confirmControl';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import ConfirmControl from './childDialog/confirmControl';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandRunLevel',
@ -86,15 +87,6 @@ export default {
time: ''
};
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
computed: {
...mapGetters('map', [
'stationList',
@ -130,6 +122,15 @@ export default {
return list;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
@ -192,12 +193,14 @@ export default {
},
timeSelectChange(time) {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
val: time.toString()
val: time.toString(),
param: {
Stand_RunLevel: time
}
};
this.time = time.toString();
this.time = time;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -208,9 +211,11 @@ export default {
},
checkChange(check) {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setRunLevel.check.operation,
val: check.toString()
val: check.toString(),
param: {
Stand_AlwaysValid: !!this.tempData[0].check
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -228,10 +233,13 @@ export default {
if (this.isConfirm) {
const forver = !!this.tempData[0].check;
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
messages: [`${this.$t('menu.menuStationStand.setRunLevel')}${this.$t('global.colon')}${this.tempData[0].name}-${this.standName},${this.tempData[0].time == 0 ? this.$t('menu.runTimeAutomatically') : `${this.$t('menu.runningTimeIs')}${this.tempData[0].time}s`},${this.$t('menu.effectiveFrequencyIs')}${this.tempData[0].check ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`],
val: [this.time, forver].join('::')
val: [this.time, forver].join('::'),
param:{
Stand_AlwaysValid:forver,
Stand_RunLevel:this.time
},
messages: [`${this.$t('menu.menuStationStand.setRunLevel')}${this.$t('global.colon')}${this.tempData[0].name}-${this.standName},${this.tempData[0].time == 0 ? this.$t('menu.runTimeAutomatically') : `${this.$t('menu.runningTimeIs')}${this.tempData[0].time}s`},${this.$t('menu.effectiveFrequencyIs')}${this.tempData[0].check ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
};
this.loading = true;
@ -252,7 +260,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -72,9 +72,10 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandStopTime',
@ -179,9 +180,11 @@ export default {
}
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
val: `${control}`
val: `${control}`,
param: {
Stand_StopControl: `${control}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -192,9 +195,11 @@ export default {
},
chooseEffective(effective) {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
val: `${effective}`
val: `${effective}`,
param: {
Stand_AlwaysValid: `${effective}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -206,9 +211,11 @@ export default {
inputTime(time) {
const operate = {
repeat: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setStopTime.input.operation,
val: `${time}`
val: `${time}`,
param: {
Stand_StopTime: `${time}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -219,9 +226,13 @@ export default {
},
commit() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
val: [`${this.control}`, this.time, this.effective].join('::'),
param:{
Stand_StopControl:this.control,
Stand_AlwaysValid:this.effective,
Stand_StopTime:this.time
},
messages: [`${this.$t('menu.stopTime') + this.$t('global.colon') + this.stationName} - ${this.standName}, ${this.$t('menu.stopTimeIs')}${this.control == '01' ? this.$t('menu.automatic2') : this.time + this.$t('global.second')}, ${this.$t('menu.effectiveFrequencyIs')}${this.effective == false ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
};
@ -240,7 +251,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.close.menu.operation
};

View File

@ -77,7 +77,7 @@
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
export default {
@ -253,7 +253,6 @@ export default {
},
commandNoPopUp() {
const operate = {
type: MapDeviceType.Station.type
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
@ -280,7 +279,6 @@ export default {
},
confirm1() {
const operate = {
type: MapDeviceType.Station.type
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
@ -309,16 +307,17 @@ export default {
},
confirm2() {
const operate = {
send: true,
type: MapDeviceType.Station.type
over: true
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
operate.operation = OperationEvent.Station.powerUnLock.confirm2.operation;
// operate.cmdType = CMD.Station.powerUnLock;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
// operate.cmdType = CMD.Station.execKeyOperationTest;
}
this.setMessage('');
@ -342,7 +341,6 @@ export default {
},
stop() {
const operate = {
type: MapDeviceType.Station.type
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
@ -368,7 +366,6 @@ export default {
},
close() {
const operate = {
type: MapDeviceType.Station.type,
operation: OperationEvent.Command.close.menu.operation
};

View File

@ -27,8 +27,9 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StationHumanControlAll',
@ -80,10 +81,9 @@ export default {
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.humanControlALL.menu.operation
over: true,
operation: OperationEvent.Station.humanControlALL.menu.operation,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
};
this.loading = true;
@ -100,7 +100,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Station.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -39,8 +39,9 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StationSetRouteControlAll',
@ -98,11 +99,13 @@ export default {
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
over: true,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
val: this.mode
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
val: this.mode,
param: {
CheckConflict: this.mode
}
};
this.loading = true;
@ -119,7 +122,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Station.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -82,8 +82,9 @@
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchCmdControl',
@ -301,7 +302,7 @@ export default {
},
commandNoPopUp() {
const operate = {
type: MapDeviceType.Switch.type
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -334,7 +335,7 @@ export default {
},
confirm1() {
const operate = {
type: MapDeviceType.Switch.type
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -369,24 +370,26 @@ export default {
},
confirm2() {
const operate = {
send: true,
type: MapDeviceType.Switch.type
over: true
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
/** 道岔单解*/
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
/** 道岔解封*/
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
/** 道岔故障解锁*/
operate.operation = OperationEvent.Switch.fault.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_FAULT_UNLOCK;
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
/** 道岔计轴复位*/
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET;
}
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -408,7 +411,6 @@ export default {
},
stop() {
const operate = {
type: MapDeviceType.Switch.type
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -440,7 +442,6 @@ export default {
},
close() {
const operate = {
type: MapDeviceType.Switch.type,
operation: OperationEvent.Command.close.menu.operation
};

View File

@ -45,8 +45,10 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchControl',
@ -72,7 +74,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
@ -152,9 +154,9 @@ export default {
//
lock() {
const operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: OperationEvent.Switch.lock.menu.operation
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.loading = true;
@ -172,9 +174,9 @@ export default {
//
block() {
const operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: OperationEvent.Switch.block.menu.operation
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.loading = true;
@ -192,9 +194,9 @@ export default {
//
turnout(operation) {
const operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: OperationEvent.Switch.turnout.menu.operation
over: true,
operation: OperationEvent.Switch.turnout.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
this.loading = true;
@ -212,9 +214,9 @@ export default {
//
turnoutForce() {
const operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: OperationEvent.Switch.turnoutForce.menu.operation
over: true,
operation: OperationEvent.Switch.turnoutForce.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FORCE_TURN
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -231,9 +233,9 @@ export default {
//
split() {
const operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: OperationEvent.Switch.split.menu.operation
over: true,
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -250,9 +252,9 @@ export default {
//
active() {
const operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: OperationEvent.Switch.active.menu.operation
over: true,
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -268,7 +270,6 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Switch.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -83,10 +83,11 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperateHandler from '@/scripts/plugin/OperateHandler';
import Handler from '@/scripts/cmdPlugin/Handler';
export default {
name: 'TrainControl',
@ -303,7 +304,7 @@ export default {
},
trainNumberChange(groupNumber) {
const operate = {
type: MapDeviceType.Train.type,
val: `${groupNumber}`,
operation: ''
};
@ -322,7 +323,7 @@ export default {
},
trainTypeChange(trainType) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainType}`,
operation: ''
};
@ -342,17 +343,19 @@ export default {
trainNoChange(tripNumber) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
val: tripNumber,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
operate.cmdType = CMD.Train.addTrainId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
operate.cmdType = CMD.Train.editTrainId;
}
OperateHandler.backStep(1);
Handler.undo(1);
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response.data) {
@ -394,8 +397,9 @@ export default {
const model = this.formModel;
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
cmdType: CMD.Train.CMD_ADD_TRAIN_ID,
messages: [this.$t('tip.addTrainIdTip')],
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
};
@ -424,8 +428,9 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
messages: [this.$t('tip.editTrainIdTip')],
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
};
@ -450,7 +455,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -38,8 +38,9 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteCreate',
@ -118,8 +119,9 @@ export default {
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
cmdType: CMD.Section.CMD_NEW_TRAIN,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
@ -136,7 +138,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -30,10 +30,11 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainDelete',
@ -111,7 +112,7 @@ export default {
},
trainNumberChange() {
const operate = {
type: MapDeviceType.Train.type,
val: `${this.formModel.groupNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
};
@ -127,8 +128,9 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
cmdType: CMD.Train.CMD_DEL_TRAIN_ID,
val: this.formModel.groupNumber
};
@ -150,7 +152,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -28,7 +28,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainMove',
@ -90,8 +91,9 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainNo.menu.operation
operation: OperationEvent.Train.editTrainNo.menu.operation,
cmdType: CMD.Train.CMD_EDIT_TRAIN_NO
};
this.loading = true;
@ -111,7 +113,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -74,7 +74,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainMove',
@ -152,8 +153,9 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainId.menu.operation
operation: OperationEvent.Train.moveTrainId.menu.operation,
cmdType: CMD.Train.CMD_MOVE_TRAIN_ID
};
this.loading = true;
@ -174,7 +176,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -75,7 +75,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainSwitch',
@ -157,8 +158,9 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainId.menu.operation
operation: OperationEvent.Train.moveTrainId.menu.operation,
cmdType: CMD.Train.CMD_MOVE_TRAIN_ID
};
this.loading = true;
@ -179,7 +181,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -12,9 +12,7 @@
<span class="nav-li-text">{{ item.title }}</span>
<ul class="nav-ul" :class="{'active' :i==classA}">
<template v-for="(child,j) in item.children">
<template
v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)"
>
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<li
:id="child.operate.domId"
:key="j"
@ -84,9 +82,10 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { TrainingMode, OperationEvent } from '@/scripts/ConstDic';
// import { OperateMode } from '@/scripts/ConstDic';
import { menuBarConvert, SystemType } from './utils/menuItemStatus';
import { TrainingMode } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config.js';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import StationControlConvert from './menuDialog/stationControlConvert';
import TrainAdd from './menuDialog/trainAdd';
import TrainTranstalet from './menuDialog/trainTranstalet';
@ -132,7 +131,7 @@ export default {
valid: true,
menu: [],
menuNormal: {
local: [
Local: [
{
title: this.$t('menu.menuBar.system'),
operate: OperationEvent.Command.mBar.system,
@ -241,7 +240,7 @@ export default {
]
}
],
central: [
Center: [
{
title: this.$t('menu.menuBar.system'),
operate: OperationEvent.Command.mBar.system,
@ -438,7 +437,7 @@ export default {
},
methods: {
initMenu(menu) {
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[State2SimulationMap[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
this.clickEvent();
this.closeMenu(true);
},
@ -487,7 +486,6 @@ export default {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.clickEvent();
const operate = {
type: 'bar',
operation: item.operate.operation
};
this.tempClassA = index;
@ -509,7 +507,6 @@ export default {
popupMenuB(item, index) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
const operate = {
type: 'bar',
operation: item.operate.operation
};
this.tempClassB = index;
@ -522,7 +519,6 @@ export default {
//
turnToStationControl(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -536,7 +532,6 @@ export default {
//
mandatoryStationControl(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -550,7 +545,6 @@ export default {
//
conterStationControl(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -564,7 +558,6 @@ export default {
//
setTrainIdDisplay(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -578,7 +571,6 @@ export default {
//
setNameDisplay(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -592,7 +584,6 @@ export default {
//
setDeviceDisplay(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -606,7 +597,6 @@ export default {
//
addPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -620,7 +610,6 @@ export default {
//
translatPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -634,7 +623,6 @@ export default {
//
delPlanTrain(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -648,7 +636,6 @@ export default {
//
userManage(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -662,7 +649,6 @@ export default {
//
about(order) {
const operate = {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -42,19 +42,9 @@ export default {
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
}
])
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
@ -100,11 +90,7 @@ export default {
}
});
if (this.isScreen) {
this.menu = [...this.menuScreen];
} else {
this.menu = [...this.menuNormal];
}
this.menu = [...this.menuNormal];
},
doShow(point) {
this.clickEvent();

View File

@ -30,8 +30,10 @@
</template>
<script>
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TwoConfirmation',
@ -69,11 +71,11 @@ export default {
methods: {
doShow(operate) {
this.domIdConfirm = '';
if (checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.forcedStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.forcedStationControl)) {
this.domIdConfirm = OperationEvent.StationControl.forcedStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.requestStationControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.requestStationControl)) {
this.domIdConfirm = OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
this.domIdConfirm = OperationEvent.StationControl.requestCentralControl.confirm.domId;
}
@ -89,7 +91,6 @@ export default {
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation
};
@ -101,27 +102,26 @@ export default {
}
});
},
forEachDoHandler(selection, handler) {
selection.forEach(elem => {
handler(elem);
});
},
commit() {
if (this.operate) {
this.loading = true;
this.forEachDoHandler(this.operate.selection || [], elem => {
(this.operate.selection || []).forEach(elem => {
const operate = {
send: true,
type: this.operate.type,
val: elem.code
val: elem.code,
param: {
ControlMode_Code: elem.code
}
};
if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.forcedStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.forcedStationControl)) {
operate.operation = OperationEvent.StationControl.forcedStationControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestStationControl)) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL;
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestStationControl)) {
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestCentralControl)) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestCentralControl)) {
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
}
this.doClose();

View File

@ -41,7 +41,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'UserAdd',

View File

@ -29,7 +29,7 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'UserDelete',

View File

@ -44,7 +44,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'UserEdit',

View File

@ -38,7 +38,7 @@
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'ManageUser',

View File

@ -70,7 +70,7 @@ import { mapGetters } from 'vuex';
import UserAdd from './childDialog/userAdd';
import UserEdit from './childDialog/userEdit';
import UserDelete from './childDialog/userDelete';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'ManageUser',

View File

@ -57,7 +57,8 @@
</template>
<script>
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default {
@ -87,7 +88,7 @@ export default {
},
domIdConfirm() {
if (this.dialogShow) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
/** 强制站控*/
return OperationEvent.StationControl.forcedStationControl.passwordConfirm.domId;
}
@ -124,7 +125,6 @@ export default {
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.password.operation
};
@ -136,10 +136,9 @@ export default {
},
commit() {
const operate = {
type: this.operate.type
};
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
/** 强制站控*/
operate.operation = OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation;
}

View File

@ -67,7 +67,8 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import TwoConfirmation from './childDialog/twoConfirmation';
export default {
@ -114,29 +115,29 @@ export default {
},
isFork() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
}
return false;
},
isRequest() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
}
return false;
},
isConter() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
}
return false;
},
domIdChoose() {
if (this.dialogShow) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
return OperationEvent.StationControl.forcedStationControl.choose.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
return OperationEvent.StationControl.requestStationControl.choose.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
return OperationEvent.StationControl.requestCentralControl.choose.domId;
}
}
@ -207,9 +208,9 @@ export default {
row[prop] = result[prop];
}
if (success) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
row.control = this.controlProps['02']; // 01: 02:
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
row.control = this.controlProps['01']; // 01: 02:
}
row.disabled = true;
@ -236,11 +237,11 @@ export default {
},
checkBoxDisabled(row) {
const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
if (control && control.status == '02') { // 01: 02:
return true;
}
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
if (control && control.status == '01') { // 01: 02:
return true;
}
@ -293,7 +294,6 @@ export default {
},
cancel() {
const operate = {
type: 'bar',
operation: OperationEvent.Command.cancel.menu.operation
};
@ -333,30 +333,21 @@ export default {
{ type: 'resp', timeout: 'true', stationControlCode: elem.code }
);
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
const stationCodeList = selection.map(elem => { return elem.code; });
if (selection && selection.length) {
const operate = {
type: MapDeviceType.StationControl.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
val: stationCodeList.join('::'),
selection: selection
};
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation;
}
@ -372,11 +363,11 @@ export default {
}
},
requestCommit() {
const stationCodeList = this.selection.map(elem => { return elem.code; });
const operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
val: stationCodeList.join('::'),
selection: this.selection
};
@ -397,11 +388,11 @@ export default {
});
},
forkCommit() {
const stationCodeList = this.selection.map(elem => { return elem.code; });
const operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
val: stationCodeList.join('::'),
selection: this.selection
};
@ -421,12 +412,12 @@ export default {
this.disabledSure = false;
});
},
conterCommit() { //
conterCommit() {
const stationCodeList = this.selection.map(elem => { return elem.code; });
const operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
val: stationCodeList.join('::'),
selection: this.selection
};

View File

@ -48,7 +48,7 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainAdd',
@ -126,7 +126,7 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.addPlanTrain.operation
};
@ -150,7 +150,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -34,7 +34,7 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainAdd',
@ -108,7 +108,7 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.delPlanTrain.operation
};
@ -132,7 +132,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -47,7 +47,7 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'TrainTranstalet',
@ -125,7 +125,7 @@ export default {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.planTrain.translatPlanTrain.operation
};
@ -149,7 +149,7 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -38,7 +38,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default {

View File

@ -73,7 +73,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';

View File

@ -76,7 +76,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';

View File

@ -4,7 +4,6 @@
<section-control ref="sectionControl" />
<section-cmd-control ref="sectionCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<train-create ref="trainCreate" />
<notice-info ref="noticeInfo" />
</div>
</template>
@ -14,12 +13,13 @@ import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import TrainCreate from './dialog/trainCreate';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Handler from '@/scripts/cmdPlugin/Handler';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'SectionMenu',
@ -28,7 +28,6 @@ export default {
SectionControl,
SectionCmdControl,
SpeedCmdControl,
TrainCreate,
NoticeInfo
},
props: {
@ -43,124 +42,97 @@ export default {
return {
menu: [],
menuNormal: {
local: [
Local: [
{
label: this.$t('menu.menuSection.sectionFaultUnlock'),
handler: this.fault,
disabledCallback: MenuDisabledState.Section.fault,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
{
label: this.$t('menu.menuSection.sectionResection'),
handler: this.split,
disabledCallback: MenuDisabledState.Section.split,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
{
label: this.$t('menu.menuSection.sectionActive'),
handler: this.active,
disabledCallback: MenuDisabledState.Section.active,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_ACTIVE
},
{
label: this.$t('menu.menuSection.sectionAxisPreReset'),
handler: this.axlePreReset,
disabledCallback: MenuDisabledState.Section.axlePreReset,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
},
{
label: this.$t('menu.menuSection.sectionBlockade'),
handler: this.lock,
disabledCallback: MenuDisabledState.Section.lock,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_BLOCK
},
{
label: this.$t('menu.menuSection.sectionUnblock'),
handler: this.unlock,
disabledCallback: MenuDisabledState.Section.unlock,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
},
{
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
handler: this.setSpeed,
disabledCallback: MenuDisabledState.Section.setSpeed,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Section.cancelSpeed,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
}
],
central: [
Center: [
{
label: this.$t('menu.menuSection.sectionFaultUnlock'),
handler: this.fault,
disabledCallback: MenuDisabledState.Section.fault,
auth: { station: false, center: true }
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
{
label: this.$t('menu.menuSection.sectionResection'),
handler: this.split,
disabledCallback: MenuDisabledState.Section.split,
auth: { station: false, center: true }
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
{
label: this.$t('menu.menuSection.sectionActive'),
handler: this.active,
disabledCallback: MenuDisabledState.Section.active,
auth: { station: false, center: true }
},
{
label: this.$t('menu.menuSection.axisPreReset'),
handler: this.axlePreReset,
disabledCallback: MenuDisabledState.Section.axlePreReset,
auth: { station: false, center: false }
cmdType: CMD.Section.CMD_SECTION_ACTIVE
},
{
label: this.$t('menu.menuSection.sectionBlockade'),
handler: this.lock,
disabledCallback: MenuDisabledState.Section.lock,
auth: { station: false, center: true }
cmdType: CMD.Section.CMD_SECTION_BLOCK
},
{
label: this.$t('menu.menuSection.sectionUnblock'),
handler: this.unlock,
disabledCallback: MenuDisabledState.Section.unlock,
auth: { station: false, center: true }
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
},
{
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
handler: this.setSpeed,
disabledCallback: MenuDisabledState.Section.setSpeed,
auth: { station: false, center: true }
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Section.cancelSpeed,
auth: { station: false, center: true }
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
}
]
},
menuTrain: [
{
label: this.$t('menu.menuSection.createTrain'),
handler: this.newTrain,
disabledCallback: MenuDisabledState.Section.newTrain
}
],
menuForce: [
{
label: this.$t('menu.menuSection.setFault'),
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Section.setStoppage
cmdType: CMD.Section.CMD_SECTION_ADD_FAULT
},
{
label: this.$t('menu.menuSection.cancelFault'),
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Section.cancelStoppage
cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT
}
]
};
@ -192,17 +164,12 @@ export default {
},
initMenu() {
//
this.menu = menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
}
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -218,187 +185,183 @@ export default {
},
//
setStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.stoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.stoppage.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ADD_FAULT,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.cancelStoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.cancelStoppage.menu.operation,
cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
fault() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.fault.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.fault.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionCmdControl.doShow(step, this.selected);
}
});
},
//
split() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.split.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.split.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(step, this.selected);
}
});
},
//
active() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.active.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.active.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(step, this.selected);
}
});
},
//
axlePreReset() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.axlePreReset.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.axlePreReset.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionCmdControl.doShow(step, this.selected);
}
});
},
//
lock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.lock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.lock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(step, this.selected);
}
});
},
//
unlock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.unlock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.unlock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionCmdControl.doShow(step, this.selected);
}
});
},
//
setSpeed() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.setSpeed.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Section.setSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(operate, this.selected);
this.$refs.speedCmdControl.doShow(step, this.selected);
}
});
},
//
cancelSpeed() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.cancelSpeed.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
const tempData = response.data;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
code: `${this.selected.code}`,
operation: OperationEvent.Section.cancelSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
});
},
//
newTrain() {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.newtrain.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainCreate.doShow(operate, this.selected);
Handler.execute(CMD.Section.CMD_QUERY, {}).then(resp => {
const tempData = resp.data;
this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
});
}
});
}

View File

@ -20,10 +20,12 @@ import RouteCmdControl from './dialog/routeCmdControl';
import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { querySignalStatus } from '@/api/simulation';
export default {
name: 'SignalMenu',
@ -49,134 +51,103 @@ export default {
return {
menu: [],
menuNormal: {
local: [
Local: [
{
label: this.$t('menu.menuSignal.routeSelect'),
handler: this.arrangementRoute,
disabledCallback: MenuDisabledState.Signal.arrangementRoute,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
},
{
label: this.$t('menu.menuSignal.routeCancel'),
handler: this.cancelTrainRoute,
disabledCallback: MenuDisabledState.Signal.cancelTrainRoute,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
},
{
label: this.$t('menu.menuSignal.signalBlock'),
handler: this.lock,
disabledCallback: MenuDisabledState.Signal.lock,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
{
label: this.$t('menu.menuSignal.signalDeblock'),
handler: this.unlock,
disabledCallback: MenuDisabledState.Signal.unlock,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
},
{
label: this.$t('menu.menuSignal.signalReopen'),
handler: this.reopenSignal,
disabledCallback: MenuDisabledState.Signal.reopenSignal,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
label: this.$t('menu.menuSignal.guideRouteHandle'),
handler: this.guide,
disabledCallback: MenuDisabledState.Signal.guide,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
{
label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
handler: this.setAutoInterlock,
disabledCallback: MenuDisabledState.Signal.setAutoInterlock,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
},
{
label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
handler: this.cancelAutoInterlock,
disabledCallback: MenuDisabledState.Signal.cancelAutoInterlock,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
},
{
label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
handler: this.setAutoTrigger,
disabledCallback: MenuDisabledState.Signal.setAutoTrigger,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
},
{
label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
handler: this.cancelAutoTrigger,
disabledCallback: MenuDisabledState.Signal.cancelAutoTrigger,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
},
{
label: this.$t('menu.menuSignal.signalOff'),
handler: this.signalClose,
disabledCallback: MenuDisabledState.Signal.signalClose,
auth: { station: true, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
}
],
central: [
Center: [
{
label: this.$t('menu.menuSignal.routeSelect'),
handler: this.arrangementRoute,
disabledCallback: MenuDisabledState.Signal.arrangementRoute,
auth: { station: false, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
},
{
label: this.$t('menu.menuSignal.routeCancel'),
handler: this.cancelTrainRoute,
disabledCallback: MenuDisabledState.Signal.cancelTrainRoute,
auth: { station: false, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
},
{
label: this.$t('menu.menuSignal.signalBlock'),
handler: this.lock,
disabledCallback: MenuDisabledState.Signal.lock,
auth: { station: false, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
{
label: this.$t('menu.menuSignal.signalDeblock'),
handler: this.unlock,
disabledCallback: MenuDisabledState.Signal.unlock,
auth: { station: false, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
},
{
label: this.$t('menu.menuSignal.signalOff'),
handler: this.signalClose,
disabledCallback: MenuDisabledState.Signal.signalClose,
auth: { station: false, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
},
{
label: this.$t('menu.menuSignal.signalReopen'),
handler: this.reopenSignal,
disabledCallback: MenuDisabledState.Signal.reopenSignal,
auth: { station: false, center: true }
},
{
label: this.$t('menu.menuSignal.routeGuide'),
handler: this.guide,
disabledCallback: MenuDisabledState.Signal.guide,
auth: { station: false, center: false }
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
label: this.$t('menu.menuSignal.humanControl'),
handler: this.humanControl,
disabledCallback: MenuDisabledState.Signal.humanControl,
auth: { station: false, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: this.$t('menu.menuSignal.atsAutoControl'),
handler: this.atsAutoControl,
disabledCallback: MenuDisabledState.Signal.atsAutoControl,
auth: { station: false, center: true }
},
{
label: this.$t('menu.menuSignal.queryRouteControlMode'),
handler: this.detail,
disabledCallback: MenuDisabledState.Signal.detail,
auth: { station: true, center: true }
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
}
]
},
@ -184,12 +155,12 @@ export default {
{
label: this.$t('menu.menuSignal.setFault'),
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Signal.setStoppage
cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT
},
{
label: this.$t('menu.menuSignal.cancelFault'),
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Signal.cancelStoppage
cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT
}
]
};
@ -201,7 +172,10 @@ export default {
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
]),
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
@ -220,19 +194,11 @@ export default {
};
},
initMenu() {
//
this.menu = menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -248,291 +214,303 @@ export default {
},
//
setStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.stoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.stoppage.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.cancelStoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.cancelStoppage.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
arrangementRoute() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.arrangementRoute.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
var tempData = null;
if (response) {
tempData = response.data;
}
this.$refs.routeSelection.doShow(operate.operation, this.selected, tempData);
querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.routeSelection.doShow(step.operation, this.selected, tempData);
});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelTrainRoute() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
//
lock() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.lock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.lock.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeLock.doShow(operate.operation, this.selected);
this.$refs.routeLock.doShow(step.operation, this.selected);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
unlock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.unlock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.unlock.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeCmdControl.doShow(operate, this.selected);
this.$refs.routeCmdControl.doShow(step, this.selected);
}
});
},
//
reopenSignal() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.reopenSignal.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
//
guide() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.guide.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.guide.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$refs.routeCmdControl.doShow(operate, this.selected);
this.$refs.routeCmdControl.doShow(step, this.selected);
}
});
},
//
setAutoInterlock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.setAutoInterlock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
//
cancelAutoInterlock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
//
setAutoTrigger() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.setAutoTrigger.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.setAutoTrigger.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
//
cancelAutoTrigger() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
//
signalClose() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.signalClose.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.signalClose.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(step, this.selected);
}
});
},
// ()
humanControl() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.humanControl.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Signal.humanControl.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
let tempData = null;
if (response) {
tempData = response.data;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeHandControl.doShow(operate, this.selected, tempData);
querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.routeHandControl.doShow(step, this.selected, tempData);
});
}
});
},
// ATS
atsAutoControl() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.atsAutoControl.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
let tempData = null;
if (response) {
tempData = response.data;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeHandControl.doShow(operate, this.selected, tempData);
Signal_Code: `${this.selected.code}`,
code: `${this.selected.code}`,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
param: {
Signal_Code: `${this.selected.code}`
}
});
},
//
detail() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.detail.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeDetail.doShow(operate, this.selected, response.data);
querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.routeHandControl.doShow(step, this.selected, tempData);
});
}
});
}
//
// detail() {
// const step = {
// start: true,
// code: `${this.selected.code}`,
// operation: OperationEvent.Signal.detail.menu.operation,
// param: {
// Signal_Code: `${this.selected.code}`
// }
// };
// this.$store.dispatch('training/next', step).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => {
// const tempData = resp.data;
// this.$refs.routeDetail.doShow(step, this.selected, tempData);
// });
// }
// });
// }
}
};
</script>

View File

@ -15,9 +15,10 @@ import StationHumanControlAll from './dialog/stationHumanControlAll';
import StationSetRouteControlAll from './dialog/stationSetRouteControlAll';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'StationMenu',
@ -40,63 +41,60 @@ export default {
return {
menu: [],
menuNormal: {
local: [
Local: [
{
label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'),
handler: this.setAutoTrigger,
disabledCallback: MenuDisabledState.Station.setAutoTrigger,
auth: { station: true, center: false }
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER
},
{
label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'),
handler: this.cancelAutoTrigger,
disabledCallback: MenuDisabledState.Station.cancelAutoTrigger,
auth: { station: true, center: false }
},
{
label: this.$t('menu.menuStation.powerUnLock'),
handler: this.powerUnLock,
disabledCallback: MenuDisabledState.Station.powerUnLock,
auth: { station: true, center: false }
},
{
label: this.$t('menu.menuStation.execKeyOperationTest'),
handler: this.execKeyOperationTest,
disabledCallback: MenuDisabledState.Station.execKeyOperationTest,
auth: { station: true, center: false }
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
}
// {
// label: this.$t('menu.menuStation.powerUnLock'),
// handler: this.powerUnLock,
// auth: { station: true, center: false }
// // cmdType: CMD.Station.
// },
// {
// label: this.$t('menu.menuStation.execKeyOperationTest'),
// handler: this.execKeyOperationTest,
// auth: { station: true, center: false }
// // cmdType: CMD.Station.
// }
],
central: [
Center: [
{
label: this.$t('menu.menuStation.allHumanControl'),
handler: this.humanControlALL,
disabledCallback: MenuDisabledState.Station.humanControlALL,
auth: { station: false, center: true }
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
},
{
label: this.$t('menu.menuStation.allATSAutoControl'),
handler: this.atsAutoControlALL,
disabledCallback: MenuDisabledState.Station.atsAutoControlALL,
auth: { station: false, center: true }
},
{
label: this.$t('menu.menuStation.execKeyOperationTest'),
handler: this.execKeyOperationTest,
disabledCallback: MenuDisabledState.Station.execKeyOperationTest,
auth: { station: false, center: true }
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
}
// {
// label: this.$t('menu.menuStation.execKeyOperationTest'),
// handler: this.execKeyOperationTest,
// auth: { station: false, center: true },
// cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
// // cmdType: CMD.Section.
// }
]
},
menuForce: [
{
label: this.$t('menu.menuStation.setStoppage'),
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Station.setStoppage
cmdType: CMD.Station.CMD_STATION_ADD_FAULT
},
{
label: this.$t('menu.menuStation.cancelStoppage'),
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Station.cancelStoppage
cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT
}
]
};
@ -130,7 +128,8 @@ export default {
this.menu = [];
if (this.selected.concentrateStationCode == this.selected.code) {
//
this.menu = menuFiltration(this.menuNormal);
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
@ -143,7 +142,7 @@ export default {
}
}
this.menu = menuConvert(this.menu);
// this.menu = MenuContextHandler.covert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -159,141 +158,149 @@ export default {
},
//
setStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.stoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.stoppage.menu.operation,
cmdType: CMD.Station.CMD_STOPPAGE,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.cancelStoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.cancelStoppage.menu.operation,
cmdType: CMD.Station.CMD_CANCEL_STOPPAGE,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
setAutoTrigger() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.setAutoTrigger.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.setAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelAutoTrigger() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
powerUnLock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.powerUnLock.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.powerUnLock.menu.operation,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
this.$refs.stationCmdControl.doShow(step, this.selected);
}
});
},
//
execKeyOperationTest() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected);
this.$refs.stationCmdControl.doShow(step, this.selected);
}
});
},
//
humanControlALL() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.humanControlALL.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.humanControlALL.menu.operation,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationHumanControlAll.doShow(operate);
this.$refs.stationHumanControlAll.doShow(step);
}
});
},
//
atsAutoControlALL() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
this.$refs.stationSetRouteControlAll.doShow(step, this.selected);
}
});
}

View File

@ -20,10 +20,12 @@ import StandRunLevel from './dialog/standRunLevel';
import StandStopTime from './dialog/standStopTime';
import StandDetainTrainAll from './dialog/standDetainTrainAll';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import Handler from '@/scripts/cmdPlugin/Handler';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'StationStandMenu',
@ -49,128 +51,103 @@ export default {
return {
menu: [],
menuNormal: {
local: [
Local: [
{
label: this.$t('menu.menuStationStand.detainTrain'),
handler: this.setDetainTrain,
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
handler: this.cancelDetainTrain,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
handler: this.cancelDetainTrainForce,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
},
{
label: this.$t('menu.menuStationStand.jumpStop'),
handler: this.setJumpStop,
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
},
{
label: this.$t('menu.menuStationStand.cancelJumpStop'),
handler: this.cancelJumpStop,
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
},
{
label: this.$t('menu.menuStationStand.setRunLevel'),
handler: this.setRunLevel,
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
auth: { station: false, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
},
{
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
handler: this.earlyDeparture,
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
auth: { station: false, center: false }
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
},
{
label: this.$t('menu.menuStationStand.setBackStrategy'),
handler: this.setBackStrategy,
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
auth: { station: false, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
},
{
label: this.$t('menu.menuStationStand.getStationStandStatus'),
handler: this.detail,
disabledCallback: MenuDisabledState.StationStand.detail,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
}
],
central: [
Center: [
{
label: this.$t('menu.menuStationStand.detainTrain'),
handler: this.setDetainTrain,
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
handler: this.cancelDetainTrain,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
auth: { station: false, center: true }
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
handler: this.cancelDetainTrainForce,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
auth: { station: false, center: false }
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'),
handler: this.cancelDetainTrainAll,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN
},
{
label: this.$t('menu.menuStationStand.jumpStop'),
handler: this.setJumpStop,
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
},
{
label: this.$t('menu.menuStationStand.cancelJumpStop'),
handler: this.cancelJumpStop,
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
},
{
label: this.$t('menu.menuStationStand.setStopTime'),
handler: this.setStopTime,
disabledCallback: MenuDisabledState.StationStand.setStopTime,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
},
{
label: this.$t('menu.menuStationStand.setRunLevel'),
handler: this.setRunLevel,
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
},
{
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
handler: this.earlyDeparture,
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
},
{
label: this.$t('menu.menuStationStand.setBackStrategy'),
handler: this.setBackStrategy,
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
auth: { station: false, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
},
{
label: this.$t('menu.menuStationStand.getStationStandStatus'),
handler: this.detail,
disabledCallback: MenuDisabledState.StationStand.detail,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
}
]
},
@ -178,12 +155,12 @@ export default {
{
label: this.$t('menu.menuStationStand.setFault'),
handler: this.setStoppage,
disabledCallback: MenuDisabledState.StationStand.setStoppage
cmdType:CMD.Stand.CMD_STAND_ADD_FAULT
},
{
label: this.$t('menu.menuStationStand.cancelFault'),
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT
}
]
};
@ -215,7 +192,8 @@ export default {
},
initMenu() {
//
this.menu = menuFiltration(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal);
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
@ -225,7 +203,7 @@ export default {
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
// this.menu = MenuContextHandler.covert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -241,246 +219,253 @@ export default {
},
//
setStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.stoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.stoppage.menu.operation,
cmdType: CMD.Stand.CMD_STAND_ADD_FAULT,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelStoppage.menu.operation,
cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
setDetainTrain() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
this.$refs.standControl.doShow(step, this.selected);
}
});
},
//
cancelDetainTrain() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
this.$refs.standControl.doShow(step, this.selected);
}
});
},
//
cancelDetainTrainForce() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
this.$refs.standControl.doShow(step, this.selected);
}
});
},
// 线
cancelDetainTrainAll() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
this.$refs.standDetainTrainAll.doShow(step, this.selected);
}
});
},
//
setJumpStop() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.setJumpStop.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
this.$refs.standControl.doShow(step, this.selected);
}
});
},
//
cancelJumpStop() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
this.$refs.standControl.doShow(step, this.selected);
}
});
},
//
setStopTime() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.setStopTime.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
let tempDate = null;
if (response) {
tempDate = response.data;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.standStopTime.doShow(step, this.selected, tempData);
});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
setRunLevel() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.setRunLevel.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
let tempDate = null;
if (response) {
tempDate = response.data;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.standRunLevel.doShow(step, this.selected, tempData);
});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
earlyDeparture() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
this.$refs.standControl.doShow(step, this.selected);
}
});
},
//
setBackStrategy() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
let tempDate = null;
if (response) {
tempDate = response.data;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.standBackStrategy.doShow(step, this.selected, tempData);
});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
detail() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.detail.menu.operation
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.detail.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
let tempDate = null;
if (response) {
tempDate = response.data;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => {
const tempData = resp.data;
this.$refs.standDetail.doShow(step, this.selected, tempData);
});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
}
}

View File

@ -14,10 +14,11 @@ import SwitchControl from './dialog/switchControl';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'SwitchMenu',
@ -40,134 +41,132 @@ export default {
return {
menu: [],
menuNormal: {
local: [
Local: [
{
label: this.$t('menu.menuSwitch.switchLock'),
handler: this.lock,
disabledCallback: MenuDisabledState.Switch.lock,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: this.$t('menu.menuSwitch.switchUnlock'),
handler: this.unlock,
disabledCallback: MenuDisabledState.Switch.unlock,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
{
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
handler: this.block,
disabledCallback: MenuDisabledState.Switch.block,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
handler: this.unblock,
disabledCallback: MenuDisabledState.Switch.unblock,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
label: this.$t('menu.menuSwitch.switchTurnout'),
handler: this.switchTurnout,
disabledCallback: MenuDisabledState.Switch.switchTurnout,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
handler: this.fault,
disabledCallback: MenuDisabledState.Switch.fault,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: this.$t('menu.menuSwitch.switchSectionAxisPreReset'),
handler: this.axlePreReset,
disabledCallback: MenuDisabledState.Switch.axlePreReset,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET
},
{
label: this.$t('menu.menuSwitch.sectionResection'),
handler: this.split,
disabledCallback: MenuDisabledState.Switch.split,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: this.$t('menu.menuSwitch.sectionActive'),
handler: this.active,
disabledCallback: MenuDisabledState.Switch.active,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'),
handler: this.setSpeed,
disabledCallback: MenuDisabledState.Switch.setSpeed,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'),
handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Switch.cancelSpeed,
auth: { station: true, center: false }
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
}
],
central: [
Center: [
{
label: this.$t('menu.menuSwitch.switchLock'),
handler: this.lock,
disabledCallback: MenuDisabledState.Switch.lock,
auth: { station: false, center: true }
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: this.$t('menu.menuSwitch.switchUnlock'),
handler: this.unlock,
disabledCallback: MenuDisabledState.Switch.unlock,
auth: { station: false, center: true }
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
{
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
handler: this.block,
disabledCallback: MenuDisabledState.Switch.block,
auth: { station: false, center: true }
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
handler: this.unblock,
disabledCallback: MenuDisabledState.Switch.unblock,
auth: { station: false, center: true }
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
label: this.$t('menu.menuSwitch.switchTurnout'),
handler: this.switchTurnout,
disabledCallback: MenuDisabledState.Switch.switchTurnout,
auth: { station: false, center: true }
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
handler: this.fault,
disabledCallback: MenuDisabledState.Switch.fault,
auth: { station: false, center: true }
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: this.$t('menu.menuSwitch.sectionResection'),
handler: this.split,
disabledCallback: MenuDisabledState.Switch.split,
auth: { station: true, center: true }
auth: { station: true, center: true },
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: this.$t('menu.menuSwitch.sectionActive'),
handler: this.active,
disabledCallback: MenuDisabledState.Switch.active,
auth: { station: true, center: true }
auth: { station: true, center: true },
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'),
handler: this.setSpeed,
disabledCallback: MenuDisabledState.Switch.setSpeed,
auth: { station: false, center: true }
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'),
handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Switch.cancelSpeed,
auth: { station: false, center: true }
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
}
]
},
@ -175,18 +174,18 @@ export default {
{
label: this.$t('menu.menuSwitch.setFault'),
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Switch.setStoppage,
auth: {
}
},
cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT
},
{
label: this.$t('menu.menuSwitch.cancelFault'),
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Switch.cancelStoppage,
auth: {
}
},
cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT
}
]
};
@ -218,7 +217,8 @@ export default {
},
initMenu() {
//
this.menu = menuFiltration(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal);
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
@ -228,7 +228,7 @@ export default {
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
// this.menu = MenuContextHandler.covert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -244,242 +244,255 @@ export default {
},
//
setStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.stoppage.menu.operation
operation: OperationEvent.Switch.stoppage.menu.operation,
cmdType: CMD.Switch.CMD_STOPPAGE,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.cancelStoppage.menu.operation
operation: OperationEvent.Switch.cancelStoppage.menu.operation,
cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
lock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.lock.menu.operation
operation: OperationEvent.Switch.lock.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
this.$refs.switchControl.doShow(step, this.selected);
}
});
},
//
unlock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.unlock.menu.operation
operation: OperationEvent.Switch.unlock.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
this.$refs.switchCmdControl.doShow(step, this.selected);
}
});
},
//
block() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.block.menu.operation
operation: OperationEvent.Switch.block.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
this.$refs.switchControl.doShow(step, this.selected);
}
});
},
//
unblock() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.unblock.menu.operation
operation: OperationEvent.Switch.unblock.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
this.$refs.switchCmdControl.doShow(step, this.selected);
}
});
},
//
switchTurnoutForce() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.turnoutForce.menu.operation
operation: OperationEvent.Switch.turnoutForce.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
this.$refs.switchControl.doShow(step, this.selected);
}
});
},
//
switchTurnout() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.turnout.menu.operation
operation: OperationEvent.Switch.turnout.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
if (operate.operation) {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (step.operation) {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
this.$refs.switchControl.doShow(step, this.selected);
}
});
}
},
//
fault() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.fault.menu.operation
operation: OperationEvent.Switch.fault.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
this.$refs.switchCmdControl.doShow(step, this.selected);
}
});
},
//
axlePreReset() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.axlePreReset.menu.operation
operation: OperationEvent.Switch.axlePreReset.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
this.$refs.switchCmdControl.doShow(step, this.selected);
}
});
},
//
split() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.split.menu.operation
operation: OperationEvent.Switch.split.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
this.$refs.switchControl.doShow(step, this.selected);
}
});
},
//
active() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.active.menu.operation
operation: OperationEvent.Switch.active.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
this.$refs.switchControl.doShow(step, this.selected);
}
});
},
//
setSpeed() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.setSpeed.menu.operation
operation: OperationEvent.Switch.setSpeed.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(operate, this.selected);
this.$refs.speedCmdControl.doShow(step, this.selected);
}
});
},
//
cancelSpeed() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.cancelSpeed.menu.operation
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
cmdType: CMD.Switch.CMD_CANCEL_SPEED,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) {
const tempData = response.data;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
}
});
}
}
};
</script>

View File

@ -14,14 +14,15 @@
import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import TrainControl from './dialog/trainControl';
import TrainDelete from './dialog/trainDelete';
import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'MenuTrain',
@ -46,63 +47,63 @@ export default {
return {
menu: [],
menuNormal: {
local: [],
central: [
{
label: this.$t('menu.menuTrain.addTrainId'),
handler: this.addTrainId,
disabledCallback: MenuDisabledState.Train.addTrainId,
auth: { station: true, center: true }
},
{
label: this.$t('menu.menuTrain.deleteTrainId'),
handler: this.delTrainId,
disabledCallback: MenuDisabledState.Train.delTrainId,
auth: { station: true, center: true }
},
{
label: this.$t('menu.menuTrain.editTrainId'),
handler: this.editTrainId,
disabledCallback: MenuDisabledState.Train.editTrainId,
auth: { station: true, center: true }
},
{
label: this.$t('menu.menuTrain.editTrainNo'),
handler: this.editTrainNo,
disabledCallback: MenuDisabledState.Train.editTrainNo,
auth: { station: true, center: true }
},
{
label: this.$t('menu.menuTrain.moveTrainId'),
handler: this.moveTrainId,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true }
},
{
label: this.$t('menu.menuTrain.switchTrainId'),
handler: this.switchTrainId,
disabledCallback: MenuDisabledState.Train.switchTrainId,
auth: { station: true, center: true }
}
Local: [],
Center: [
// {
// label: this.$t('menu.menuTrain.addTrainId'),
// handler: this.addTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.deleteTrainId'),
// handler: this.delTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.editTrainId'),
// handler: this.editTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.editTrainNo'),
// handler: this.editTrainNo,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.moveTrainId'),
// handler: this.moveTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.switchTrainId'),
// handler: this.switchTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// }
]
},
menuForce: [
{
label: this.$t('menu.menuTrain.setCommunicationFault'),
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Train.setStoppage
cmdType:CMD.Train.CMD_TRAIN_ADD_FAULT
},
{
label: this.$t('menu.menuTrain.cancelCommunicationFault'),
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Train.cancelStoppage
cmdType:CMD.Train.CMD_TRAIN_REMOVE_FAULT
}
],
menuSpeed: [
{
label: this.$t('menu.menuTrain.confirmRunToFrontStation'),
handler: this.limitSpeed,
disabledCallback: MenuDisabledState.Train.limitSpeed
cmdType:CMD.Train.CMD_TRAIN_MANUAL_LIMIT_DRIVE
}
]
};
@ -134,7 +135,8 @@ export default {
},
initMenu() {
//
this.menu = trainMenuFiltration(this.menuNormal);
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
}
@ -144,7 +146,7 @@ export default {
this.menu = [...this.menuForce, ...this.menuSpeed];
}
this.menu = menuConvert(this.menu);
// this.menu = MenuContextHandler.covert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -162,157 +164,166 @@ export default {
},
//
setStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.stoppage.menu.operation
operation: OperationEvent.Train.stoppage.menu.operation,
cmdType: CMD.Train.CMD_STOPPAGE,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
cancelStoppage() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.cancelStoppage.menu.operation
operation: OperationEvent.Train.cancelStoppage.menu.operation,
cmdType: CMD.Train.CMD_CANCEL_STOPPAGE,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
limitSpeed() {
const operate = {
const step = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.limitSpeed.menu.operation
operation: OperationEvent.Train.limitSpeed.menu.operation,
cmdType: CMD.Train.CMD_LIMIT_SPEED,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(step);
});
},
//
addTrainId() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.addTrainId.menu.operation
operation: OperationEvent.Train.addTrainId.menu.operation,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected);
this.$refs.trainControl.doShow(step, this.selected);
}
});
},
//
delTrainId() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.delTrainId.menu.operation
operation: OperationEvent.Train.delTrainId.menu.operation,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate, this.selected);
this.$refs.trainDelete.doShow(step, this.selected);
}
});
},
//
editTrainId() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainId.menu.operation
operation: OperationEvent.Train.editTrainId.menu.operation,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected);
this.$refs.trainControl.doShow(step, this.selected);
}
});
},
//
editTrainNo() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainNo.menu.operation
operation: OperationEvent.Train.editTrainNo.menu.operation,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainEditNumber.doShow(operate, this.selected);
this.$refs.trainEditNumber.doShow(step, this.selected);
}
});
},
//
moveTrainId() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.moveTrainId.menu.operation
operation: OperationEvent.Train.moveTrainId.menu.operation,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMove.doShow(operate, this.selected);
this.$refs.trainMove.doShow(step, this.selected);
}
});
},
//
switchTrainId() {
const operate = {
const step = {
start: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.switchTrainId.menu.operation
operation: OperationEvent.Train.switchTrainId.menu.operation,
param: {
code: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSwitch.doShow(operate, this.selected);
this.$refs.trainSwitch.doShow(step, this.selected);
}
});
}

View File

@ -83,7 +83,7 @@
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'AlarmDetail',
@ -176,7 +176,6 @@ export default {
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.alarm.operation
};
@ -189,7 +188,6 @@ export default {
},
commit() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.alarm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -59,8 +59,9 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RequestControl',
@ -203,7 +204,6 @@ export default {
const operate = {
start: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
@ -227,22 +227,13 @@ export default {
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const codeList = selection.map(elem => { return elem.code; });
const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.serializeCodeListWithSeparator('::')
val: codeList.join('::')
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -257,13 +248,16 @@ export default {
},
agree() {
const operate = {
send: true,
over: true,
type: MapDeviceType.StationControl.type,
start: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
code: this.selection[0].code,
code: this.tableData[0].code,
val: this.commandId,
prdType: this.$store.state.training.prdType
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
ControlMode_Code: this.tableData[0].code,
Reply_Command_Id: this.commandId,
ControlMode_Reply: true
}
};
this.clearTimer();
@ -279,17 +273,17 @@ export default {
},
refuse() {
const operate = {
send: true,
over: true,
type: MapDeviceType.StationControl.type,
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
code: this.selection.length ? this.selection[0].code : '',
code: this.tableData[0].code,
val: this.commandId,
prdType: this.$store.state.training.prdType
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
ControlMode_Code: this.tableData[0].code,
Reply_Command_Id: this.commandId,
ControlMode_Reply: false
}
};
if (!operate.code) {
operate.code = this.tableData[0].code;
}
this.clearTimer();
this.disabledAgree = true;

View File

@ -18,7 +18,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'CmdNotice',
data() {
@ -41,11 +41,9 @@ export default {
watch: {
'$store.state.socket.msgHead': function (elem) {
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
const operate = this.$store.state.training.operate;
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
const newOperate = {
type: operate.type,
name: station.name
};
@ -83,7 +81,6 @@ export default {
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.notice.operation
};
@ -96,7 +93,6 @@ export default {
},
commit() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.notice.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -7,12 +7,12 @@ export function getCurrentStateObject() {
}
/** 系统类型 */
export const SystemType = {
export const State2SimulationMap = {
'01': 'local', // 现地工作站
'02': 'central' // 中心调度工作站
};
export const StationControlType = {
export const State2ControlMap = {
'01': 'center', // 中控
'02': 'station', // 站控
'03': 'station'
@ -521,8 +521,8 @@ export function menuFiltration(menuObj) {
if (control) {
if (store.state.training.prdType != '') {
const type = SystemType[store.state.training.prdType];
const status = StationControlType[control.status];
const type = State2SimulationMap[store.state.training.prdType];
const status = State2ControlMap[control.status];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
@ -552,7 +552,7 @@ export function menuFiltration(menuObj) {
export function trainMenuFiltration(menuObj) {
var menu = [];
if (store.state.training.prdType != '') {
const type = SystemType[store.state.training.prdType];
const type = State2SimulationMap[store.state.training.prdType];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {

View File

@ -22,11 +22,17 @@ import StandRunLevel from './dialog/standRunLevel';
import StandStopTime from './dialog/standStopTime';
import StandDetainTrainAll from './dialog/standDetainTrainAll';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
// import { mapGetters } from 'vuex';
// import { OperateMode } from '@/scripts/ConstDic';
// import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
// import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
// import { mouseCancelState } from './utils/menuItemStatus';
import Handler from '@/scripts/cmdPlugin/Handler';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
import { mouseCancelState } from './utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'StationStandMenu',
@ -55,28 +61,24 @@ export default {
menuNormal: {
local: [
{
label: '设置扣车',
label: '扣车',
handler: this.setDetainTrain,
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
{
label: '取消扣车',
handler: this.cancelDetainTrain,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
},
{
label: '设置跳停',
handler: this.setJumpStop,
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
auth: { station: true, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
},
{
label: '取消跳停',
handler: this.cancelJumpStop,
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
},
{
type: 'separator'
@ -84,14 +86,12 @@ export default {
{
label: '提前发车',
handler: this.earlyDeparture,
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
},
{
label: '设置停站时间',
handler: this.setStopTime,
disabledCallback: MenuDisabledState.StationStand.setStopTime,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
},
{
type: 'separator'
@ -99,64 +99,39 @@ export default {
{
label: '站台详细信息',
handler: this.detail,
disabledCallback: MenuDisabledState.StationStand.detail,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
},
{
label: '运行时间控制',
handler: this.setRunLevel,
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
auth: { station: false, center: false }
},
{
label: '设置提前发车',
handler: this.earlyDeparture,
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
auth: { station: false, center: false }
},
// {
// label: '',
// handler: this.setBackStrategy,
// disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
// auth: { station: false, center: false }
// },
{
label: '查询站台状态',
handler: this.detail,
disabledCallback: MenuDisabledState.StationStand.detail,
auth: { station: false, center: false }
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
}
],
central: [
{
label: '扣车',
handler: this.setDetainTrain,
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
{
label: '取消扣车',
handler: this.cancelDetainTrain,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
},
{
label: '提前发车',
handler: this.earlyDeparture,
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
},
{
label: '设置跳停',
handler: this.setJumpStop,
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
},
{
label: '取消跳停',
handler: this.cancelJumpStop,
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
},
{
type: 'separator'
@ -164,44 +139,35 @@ export default {
{
label: '设置停站时间',
handler: this.setStopTime,
disabledCallback: MenuDisabledState.StationStand.setStopTime,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
},
{
label: '设置运行等级',
handler: this.setRunLevel,
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
},
{
type: 'separator'
},
// {
// label: '',
// handler: this.setBackStrategy,
// disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
// label: '',
// handler: this.setDetainTrainAll,
// disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
// auth: { station: true, center: true }
// },
{
type: 'separator'
},
{
label: '区间列车数量限制',
handler: this.setDetainTrainAll,
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
auth: { station: true, center: true }
},
{
label: '取消区间列车数量限制',
handler: this.cancelDetainTrainAll,
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
auth: { station: true, center: true }
},
{
type: 'separator'
},
// {
// label: '',
// handler: this.cancelDetainTrainAll,
// disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
// auth: { station: true, center: true }
// },
// {
// type: 'separator'
// },
{
label: '查看站台信息',
handler: this.detail,
disabledCallback: MenuDisabledState.StationStand.detail,
auth: { station: true, center: true }
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
}
]
},
@ -209,12 +175,12 @@ export default {
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.StationStand.setStoppage
cmdType:CMD.Stand.CMD_STAND_ADD_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT
}
]
};
@ -246,17 +212,16 @@ export default {
},
initMenu() {
//
this.menu = menuFiltration(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
console.log(this.menu, '----new---');
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();

View File

@ -90,7 +90,7 @@ class MenuContextHandler {
if (control) {
if ( this.getPrdType() != '') {
const type = State2SimulationMap[this.getPrdType()];
const status = State2ControlMap[control.status];
const status = State2ControlMap[control.status]; // 缺少车站控制模式字段
menu = [...menuList[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {

View File

@ -495,6 +495,22 @@ const map = {
});
}
return device;
},
// 查询所属车站关联的控制模式
getDeviceStationCodeByStationCode: (state) => (code) => {
let device = null;
if (code &&
state.map &&
state.map.stationList && state.map.stationList.length) {
state.map.stationList.forEach(elem => {
if (elem.code == code) {
device = state.mapDevice[elem.code];
}
});
}
return device;
}
},