北京一号线指令操作调整

This commit is contained in:
joylink_cuiweidong 2020-03-20 14:48:22 +08:00
parent d50f096b0a
commit 2c4848f4db
11 changed files with 210 additions and 388 deletions

View File

@ -36,13 +36,13 @@
</template> </template>
<script> <script>
// import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'RouteControl', name: 'RouteControl',
@ -127,64 +127,35 @@ export default {
}, },
// //
cancelTrainRoute() { cancelTrainRoute() {
this.cancelTrainRouteFunc();
},
cancelTrainRouteFunc() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.cancelTrainRoute, {}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) { }).catch((error) => {
this.doClose();
}
}).catch(error => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
// //
signalClose() { signalClose() {
const operate = {
operation: OperationEvent.Signal.signalClose.menu.operation,
messages: [`信号关灯: ${this.signalName}`]
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.signalClose, {}, 1).then((data)=>{
this.doClose();
this.$refs.confirmControl.doShow(data.operate);
}).catch(() => {
this.loading = false; this.loading = false;
if (valid) { this.doClose();
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.$refs.noticeInfo.doShow(operate, error.message);
}); });
}, },
// //
reopenSignal() { reopenSignal() {
const operate = {
over: true,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.reopenSignal, {}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) { }).catch((error) => {
this.doClose();
}
}).catch(error => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
// //

View File

@ -1,53 +1,69 @@
<template> <template>
<div> <div>
<el-dialog class="beijing-01__systerm route-detail" :title="title" :visible.sync="show" width="340px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row class="header"> class="beijing-01__systerm route-detail"
<el-col :span="10"><span>车站</span></el-col> :title="title"
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col> :visible.sync="show"
</el-row> width="340px"
<el-row> :before-close="doClose"
<el-col :span="10"> :z-index="2000"
<el-input v-model="stationName" size="small" disabled></el-input> :modal="false"
</el-col> :close-on-click-modal="false"
<el-col :span="10" :offset="2"> >
<el-input v-model="signalName" size="small" disabled></el-input> <el-row class="header">
</el-col> <el-col :span="10"><span>车站</span></el-col>
</el-row> <el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
<div class="table"> </el-row>
<span>进路列表</span> <el-row>
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row <el-col :span="10">
:height="140"> <el-input v-model="stationName" size="small" disabled />
<el-table-column label="进路"> </el-col>
<template slot-scope="scope"> <el-col :span="10" :offset="2">
<span>{{scope.row.name}}</span> <el-input v-model="signalName" size="small" disabled />
</template> </el-col>
</el-table-column> </el-row>
<el-table-column prop="status" label="控制状态" width="180"> <div class="table">
<template slot-scope="scope"> <span>进路列表</span>
{{ scope.row.atsControl == '0' ? '人工' : '自动' }} <el-table
</template> ref="tempTable"
</el-table-column> :data="tempData"
</el-table> border
</div> style="width: 100%"
<el-row justify="center" class="button-group"> size="mini"
<el-col :span="10" :offset="2"> highlight-current-row
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :height="140"
</el-col> >
<el-col :span="8" :offset="4"> <el-table-column label="进路">
<el-button :id="domIdCancel" @click="cancel"> </el-button> <template slot-scope="scope">
</el-col> <span>{{ scope.row.name }}</span>
</el-row> </template>
<notice-info ref="noticeInfo"></notice-info> </el-table-column>
</el-dialog> <el-table-column prop="status" label="控制状态" width="180">
</div> <template slot-scope="scope">
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
</template>
</el-table-column>
</el-table>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
@ -61,8 +77,8 @@ export default {
selected: null, selected: null,
tempData: [], tempData: [],
stationName: '', stationName: '',
signalName: '', signalName: ''
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
@ -78,24 +94,24 @@ export default {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
}, },
title() { title() {
return '查询进路状态' return '查询进路状态';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
doShow(operate, selected, tempData) { doShow(operate, selected, tempData) {
this.selected = selected; this.selected = selected;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.signalName = ''; this.signalName = '';
this.stationName = ''; this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name this.signalName = selected.name;
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) { if (station) {
this.stationName = station.name; this.stationName = station.name;
} }
@ -115,11 +131,10 @@ export default {
mouseCancelState(this.selected); mouseCancelState(this.selected);
}, },
commit() { commit() {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.detail.menu.operation operation: OperationEvent.Signal.detail.menu.operation
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -134,10 +149,9 @@ export default {
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Signal.type, operation: OperationEvent.Command.cancel.menu.operation
operation: OperationEvent.Command.cancel.menu.operation, };
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
@ -148,5 +162,5 @@ export default {
}); });
} }
} }
} };
</script> </script>

View File

@ -80,7 +80,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
export default { export default {
name: 'RouteHandControl', name: 'RouteHandControl',
@ -278,47 +278,24 @@ export default {
}, },
// //
humanControl() { humanControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param:{
routeCodeList:this.selection
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
// //
atsAutoControl() { atsAutoControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param:{
routeCodeList:this.selection
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {

View File

@ -61,11 +61,11 @@
</template> </template>
<script> <script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
export default { export default {
name: 'RouteSelection', name: 'RouteSelection',
@ -210,7 +210,6 @@ export default {
// //
const operate = { const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.choose.operation, operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: row.code val: row.code
}; };
@ -225,34 +224,20 @@ export default {
}, },
commit() { commit() {
if (this.row && this.row.canSetting) { if (this.row && this.row.canSetting) {
const operate = {
over: true,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
param: {
routeCode: this.row.code
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow({}, error.message);
}); });
} }
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -45,10 +45,11 @@
</template> </template>
<script> <script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
export default { export default {
name: 'SectionControl', name: 'SectionControl',
@ -75,7 +76,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
}, },
title() { title() {
if (this.operation == OperationEvent.Section.split.menu.operation) { if (this.operation == OperationEvent.Section.split.menu.operation) {
@ -159,48 +160,24 @@ export default {
}, },
// //
faultUnlock() { faultUnlock() {
const operate = { this.sendCommand(menuOperate.Section.fault);
over: true,
operation: OperationEvent.Section.fault.menu.operation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
};
this.sendCommand(operate);
}, },
// //
axlePreReset() { axlePreReset() {
const operate = { this.sendCommand(menuOperate.Section.axlePreReset);
over: true,
operation: OperationEvent.Section.axlePreReset.menu.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
};
this.sendCommand(operate);
}, },
// //
split() { split() {
const operate = { this.sendCommand(menuOperate.Section.split);
over: true,
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
}, },
// //
active() { active() {
const operate = { this.sendCommand(menuOperate.Section.active);
over: true,
operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
this.sendCommand(operate);
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -209,18 +186,14 @@ export default {
this.doClose(); this.doClose();
}); });
}, },
sendCommand(operate) { // sendCommand(operate) { //
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(operate, {}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow({}, error.message);
}); });
} }
} }

View File

@ -1,41 +1,58 @@
<template> <template>
<el-dialog class="beijing-01__systerm stand-run-level" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="font-size: 16px; margin-bottom: 5px;">变通节点</div> class="beijing-01__systerm stand-run-level"
<div style="margin-bottom: 5px;"> :title="title"
<el-input v-model="stationName" size="mini" disabled></el-input> :visible.sync="show"
</div> width="320px"
<div style="font-size: 16px; margin-bottom: 5px;">当前变通策略</div> :before-close="doClose"
<div style="margin-bottom: 5px;"> :z-index="2000"
<el-input v-model="stationStrategy" size="mini" disabled></el-input> :modal="false"
</div> :close-on-click-modal="false"
<div style="font-size: 16px; margin-bottom: 5px;">变通策略选项</div> >
<el-table ref="table" :data="strategyList" border :cell-style="tableStyle" style="width: 100%; margin-top:10px" <div style="font-size: 16px; margin-bottom: 5px;">变通节点</div>
size="mini" @row-click="clickEvent" height="120" highlight-current-row :show-header="false"> <div style="margin-bottom: 5px;">
<el-table-column prop="label" :id="domIdChoose" style="margin-left:30px"> <el-input v-model="stationName" size="mini" disabled />
</el-table-column> </div>
</el-table> <div style="font-size: 16px; margin-bottom: 5px;">当前变通策略</div>
<el-row justify="center" class="button-group"> <div style="margin-bottom: 5px;">
<el-col :span="10" :offset="2"> <el-input v-model="stationStrategy" size="mini" disabled />
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit"> </div>
确定</el-button> <div style="font-size: 16px; margin-bottom: 5px;">变通策略选项</div>
</el-col> <el-table
<el-col :span="8" :offset="4"> ref="table"
<el-button :id="domIdCancel" @click="cancel"> </el-button> :data="strategyList"
</el-col> border
</el-row> :cell-style="tableStyle"
<confirm-control ref="confirmControl"></confirm-control> style="width: 100%; margin-top:10px"
<notice-info ref="noticeInfo"></notice-info> size="mini"
</el-dialog> height="120"
highlight-current-row
:show-header="false"
@row-click="clickEvent"
>
<el-table-column :id="domIdChoose" prop="label" style="margin-left:30px" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template> </template>
<script> <script>
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
@ -65,7 +82,7 @@ export default {
{ {
value: '04', value: '04',
label: '关闭' label: '关闭'
}, }
], ],
stationName: '', stationName: '',
stationStrategy: '', stationStrategy: '',
@ -73,13 +90,13 @@ export default {
isConfirm: false, isConfirm: false,
strategy: '', strategy: '',
tableStyle: { tableStyle: {
'border-bottom': 'none', 'border-bottom': 'none'
} }
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationList', 'stationList'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
@ -100,17 +117,17 @@ export default {
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(selected, opts) { loadInitData(selected, opts) {
this.tempData = []; this.tempData = [];
let stationList = [...this.stationList]; const stationList = [...this.stationList];
const station = this.stationList.find(n => n.code == selected.stationCode) const station = this.stationList.find(n => n.code == selected.stationCode);
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy }); this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.table.setCurrentRow(null); this.$refs.table.setCurrentRow(null);
}) });
}, },
doShow(operate, selected, opts) { doShow(operate, selected, opts) {
this.selected = selected; this.selected = selected;
@ -125,7 +142,7 @@ export default {
if (item.value == opts.reentryStrategy) { if (item.value == opts.reentryStrategy) {
this.stationStrategy = item.label; this.stationStrategy = item.label;
} }
}) });
} }
} }
this.loadInitData(selected, opts); this.loadInitData(selected, opts);
@ -138,7 +155,7 @@ export default {
}, },
clickEvent(row, column, event) { clickEvent(row, column, event) {
const operate = { const operate = {
operation: OperationEvent.StationStand.setBackStrategy.choose.operation, operation: OperationEvent.StationStand.setBackStrategy.choose.operation
}; };
this.strategy = row.value; this.strategy = row.value;
this.isConfirm = true; this.isConfirm = true;
@ -146,7 +163,7 @@ export default {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
checkTableDataSelction(data) { checkTableDataSelction(data) {
const selection = []; const selection = [];
@ -155,10 +172,10 @@ export default {
if (row.check && !row.disabled) { if (row.check && !row.disabled) {
selection.push(row); selection.push(row);
} }
}) });
} }
this.disabledSend = selection.length ? false : true; this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection; this.selection = selection;
} }
@ -171,25 +188,13 @@ export default {
}, },
commit() { commit() {
if (this.isConfirm) { if (this.isConfirm) {
const operate = {
over:true,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
param:{
standReentryStrategy: this.strategy
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.StationStand.setBackStrategy, {standReentryStrategy: this.strategy}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]); this.$refs.noticeInfo.doShow({}, error.message);
}); });
} else { } else {
this.doClose(); this.doClose();
@ -197,7 +202,7 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -209,5 +214,5 @@ export default {
}); });
} }
} }
} };
</script> </script>

View File

@ -110,10 +110,11 @@
</template> </template>
<script> <script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
export default { export default {
name: 'StandDetainTrain', name: 'StandDetainTrain',
@ -142,7 +143,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
}, },
upRadioId() { upRadioId() {
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : ''; return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : '';
@ -252,65 +253,25 @@ export default {
}, },
// //
setDetainTrain() { setDetainTrain() {
const operate = { this.sendCommand(menuOperate.StationStand.setDetainTrain);
over: true,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
}, },
// //
cancelDetainTrain() { cancelDetainTrain() {
const operate = { this.sendCommand(menuOperate.StationStand.cancelDetainTrain);
over: true,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
}, },
// //
earlyDeparture() { earlyDeparture() {
const operate = { this.sendCommand(menuOperate.StationStand.earlyDeparture);
over: true, },
operation: OperationEvent.StationStand.earlyDeparture.menu.operation, sendCommand(operate) { //
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(operate, {}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {

View File

@ -103,9 +103,10 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
@ -163,7 +164,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
}, },
title() { title() {
return '跳停'; return '跳停';
@ -243,65 +244,29 @@ export default {
}, },
// //
setJumpStop() { setJumpStop() {
// let val = this.model.val1;
// if (this.model.val2) {
// val = this.model.val2 + '::' + this.model.tripNumber;
// }
const operate = {
over: true,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
param:{
trainGroupNumber:this.model.tripNumber
}
// val: this.selected.direction //, 01: /02:
// val: val
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
// //
cancelJumpStop() { cancelJumpStop() {
// let val = this.model.val1;
// if (this.model.val2) {
// val = this.model.val2 + '::' + this.model.tripNumber;
// }
const operate = {
over: true,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
param:{
trainGroupNumber:this.model.tripNumber
}
// val: val // , 01: /02:
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };

View File

@ -89,7 +89,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
@ -311,27 +311,13 @@ export default {
}, },
commit() { commit() {
if (this.isConfirm) { if (this.isConfirm) {
const operate = {
over: true,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
param: {
runLevelTime: this.time,
runLevelTimeForever: !!this.tempData[0].check
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: this.time, runLevelTimeForever: !!this.tempData[0].check}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]); this.$refs.noticeInfo.doShow({}, error.message);
}); });
} else { } else {
this.doClose(); this.doClose();

View File

@ -69,7 +69,7 @@
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '../utils/menuOperate';
export default { export default {
name: 'StandStopTime', name: 'StandStopTime',
@ -210,28 +210,13 @@ export default {
// }); // });
// }, // },
commit() { commit() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
param: {
parkingTime: this.control == '01' ? -1 : 1,
parkingAlwaysValid: this.effective == '1'
}
// messages: [`: ${this.stationName} - ${this.standName}, ${this.control == '01' ? '' : this.time + ''}, ${this.effective == false ? '' : ''}`]
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : 1, parkingAlwaysValid: this.effective == '1'}, 2).then((data)=>{
this.loading = false; this.doClose();
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {

View File

@ -173,7 +173,7 @@ export default {
// }, // },
// //
faultUnlock(selectType) { faultUnlock(selectType) {
commitOperate(menuOperate.Section.fault, selectType, [selectType.code]).then((data)=>{ commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 0).then((data)=>{
this.$refs.sectionControl.doShow(data.operate, data.selected); this.$refs.sectionControl.doShow(data.operate, data.selected);
}); });
}, },