This commit is contained in:
fan 2020-05-08 17:20:52 +08:00
commit d7da333e07
47 changed files with 1170 additions and 1572 deletions

File diff suppressed because one or more lines are too long

View File

@ -17,8 +17,12 @@ export default class airConditioner extends Group {
position: [this.model.point.x, this.model.point.y] position: [this.model.point.x, this.model.point.y]
}); });
this.path = createPathSvg(this.model); this.path = createPathSvg(this.model);
this.add(this.grouper);
this.grouper.add(this.path); this.grouper.add(this.path);
if (!this.model.isRight) {
this.grouper.origin = [this.model.width / 2, this.model.width * 0.571 / 2];
this.grouper.scale = [-1, -1];
}
this.add(this.grouper);
} }
setModel(dx, dy) { setModel(dx, dy) {
this.model.point.x += dx; this.model.point.x += dx;

View File

@ -114,7 +114,12 @@ export default class ventilator extends Group {
this.grouper.add(this.rhombus2); this.grouper.add(this.rhombus2);
this.grouper.add(this.triangle); this.grouper.add(this.triangle);
this.grouper.add(this.line); this.grouper.add(this.line);
if (!this.model.isRight) {
this.grouper.origin = [this.model.width / 2, this.model.width * 1.368 / 2];
this.grouper.scale = [-1, 1];
}
this.add(this.grouper); this.add(this.grouper);
} }
setModel(dx, dy) { setModel(dx, dy) {
this.model.point.x += dx; this.model.point.x += dx;

View File

@ -17,8 +17,10 @@ export default class volumeControlDamper extends Group {
position: [this.model.point.x, this.model.point.y] position: [this.model.point.x, this.model.point.y]
}); });
this.path = createPathSvg(this.model); this.path = createPathSvg(this.model);
this.add(this.grouper);
this.grouper.add(this.path); this.grouper.add(this.path);
this.add(this.grouper);
this.grouper.origin = [this.model.width / 2, this.model.width * 1.368 / 2];
this.grouper.rotation = Math.PI / 180 * (this.model.rotateAngle || 0);
} }
setModel(dx, dy) { setModel(dx, dy) {
this.model.point.x += dx; this.model.point.x += dx;

View File

@ -157,15 +157,30 @@ class Jlmap {
} }
setUpdateScreen(opts) { setUpdateScreen(opts) {
const scale = 0.3; const num = opts.num;
this.$painter.updateTransform1( const offsetY = (opts.height - 100) / num; // 高度差
[ const arr = [];
{ scaleRate: scale, offsetY: -100 }, let rect = '';
{ scaleRate: scale, offsetY: -300 }, for (const i in this.mapDevice) {
{ scaleRate: scale, offsetY: -500 }, const element = this.mapDevice[i];
{ scaleRate: scale, offsetY: -700 } if (element.instance) {
], if (!rect) {
{width: opts.width, height: opts.height}); rect = element.instance.getBoundingRect().clone();
} else {
rect.union(element.instance.getBoundingRect().clone());
}
}
}
const scaleWidth = Math.floor((((opts.width - 100) * num) / rect.width) * 100) / 100;
const scaleHeight = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
const scale = Math.min(scaleWidth, scaleHeight);
const spliceWidth = (rect.width + 100) / num * scale;
const dx = (opts.width - spliceWidth) / 2;
for (let index = 0; index < num; index++) {
const param = { scaleRate: scale, offsetX: ((spliceWidth) * index) - dx, offsetY: -100 - (offsetY * index) };
arr.push(param);
}
this.$painter.updateTransform1(arr, {x: dx, y: 0, width: spliceWidth, height: opts.height});
} }
setLevelVisible(list) { setLevelVisible(list) {

View File

@ -42,14 +42,12 @@ class ESigName extends Group {
this.name.setStyle('textFill', color); this.name.setStyle('textFill', color);
} }
getNameText() { getNameText() {
return this.name; return this.name;
} }
// 隐藏
hide() { hide() {
this.name.hide(); this.name.hide();
} }
// 显示
show() { show() {
this.name.show(); this.name.show();
} }

View File

@ -263,6 +263,7 @@ class Signal extends Group {
this.add(this.sigPost); this.add(this.sigPost);
this.add(this.sigName); this.add(this.sigName);
this.style.Signal.text.show && model.nameShow ? this.sigName.show() : this.sigName.hide(); this.style.Signal.text.show && model.nameShow ? this.sigName.show() : this.sigName.hide();
this.add(this.sigAuto); this.add(this.sigAuto);
this.add(this.sigRoute); this.add(this.sigRoute);

View File

@ -106,15 +106,6 @@ export default {
] ]
}; };
}, },
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: { computed: {
...mapGetters('training', [ ...mapGetters('training', [
'mode', 'mode',
@ -124,6 +115,15 @@ export default {
'buttonOperation' 'buttonOperation'
]) ])
}, },
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: { methods: {
clickEvent() { clickEvent() {
const self = this; const self = this;

View File

@ -28,7 +28,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="限速值" label-width="80px"> <el-form-item v-if="!isCancelSpeed" label="限速值" label-width="80px">
<el-select <el-select
:id="domIdChoose" :id="domIdChoose"
v-model="speed" v-model="speed"

View File

@ -147,7 +147,7 @@ export default {
}); });
}, },
methods: { methods: {
loadInitData(selected, opts) { loadInitData(selected) {
this.tempData = []; this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode); const index = this.stationList.findIndex(n => n.code == selected.stationCode);
@ -185,7 +185,7 @@ export default {
// //
// this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' }); // this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' });
}, },
doShow(operate, selected, opts) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
if (!this.dialogShow) { if (!this.dialogShow) {
this.treeData[0].children[0].value = ''; this.treeData[0].children[0].value = '';
@ -196,7 +196,7 @@ export default {
this.treeData[0].children[0].value = station.name; this.treeData[0].children[0].value = station.name;
} }
} }
this.loadInitData(selected, opts); this.loadInitData(selected);
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {

View File

@ -162,7 +162,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -182,15 +182,15 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate, [error.message]);
}); });
}, },
// //
@ -202,15 +202,15 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate, [error.message]);
}); });
}, },
// //
@ -222,7 +222,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -242,7 +242,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -262,7 +262,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -283,7 +283,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -304,7 +304,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -325,7 +325,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -341,7 +341,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -74,7 +74,7 @@ export default {
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
return '取消进路'; return '取消进路';
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
return this.$t('menu.menuSignal.signalOff'); return '信号关灯';
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) { } else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
return this.$t('menu.menuSignal.reopenTrainSignal'); return this.$t('menu.menuSignal.reopenTrainSignal');
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) { } else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
@ -159,40 +159,34 @@ export default {
}, },
// //
signalClose() { signalClose() {
const operate = {
operation: OperationEvent.Signal.signalClose.menu.operation,
messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName]
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.signalClose, {}, 1).then(({valid, operate})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['messages'] = `信号关灯: ${this.selected.name}`;
this.$refs.confirmControl.doShow(operate); this.$refs.confirmControl.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose();
}); });
}, },
// //
reopenSignal() { reopenSignal() {
const operate = {
operation: OperationEvent.Signal.reopenSignal.menu.operation,
messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName]
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.reopenSignal, {}, 1).then(({valid, operate})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['messages'] = `信号重开: ${this.selected.name}`;
this.$refs.confirmControl.doShow(operate); this.$refs.confirmControl.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose();
}); });
}, },
// //

View File

@ -12,8 +12,8 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row class="header"> <el-row class="header">
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col> <el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col> <el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
@ -24,7 +24,7 @@
</el-col> </el-col>
</el-row> </el-row>
<div class="table"> <div class="table">
<span>{{ $t('menu.routeList') }}</span> <span>进路列表</span>
<el-table <el-table
ref="tempTable" ref="tempTable"
:data="tempData" :data="tempData"
@ -34,25 +34,24 @@
highlight-current-row highlight-current-row
:height="140" :height="140"
> >
<el-table-column :label="this.$t('menu.route')"> <el-table-column label="进路">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.name }}</span> <span>{{ scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" :label="this.$t('menu.controlState')" width="180"> <el-table-column prop="status" label="控制状态" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.controlType == '01'">{{ $t('menu.automatic') }}</span> {{ scope.row.atsControl == '0' ? '人工' : '自动' }}
<span v-else>{{ $t('menu.artificial') }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col> </el-col>
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
@ -63,8 +62,8 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
@ -75,6 +74,7 @@ export default {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null,
tempData: [], tempData: [],
stationName: '', stationName: '',
signalName: '' signalName: ''
@ -94,7 +94,7 @@ export default {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
}, },
title() { title() {
return this.$t('menu.queryAccessControlMode'); return '查询进路状态';
} }
}, },
mounted() { mounted() {
@ -104,6 +104,7 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected, tempData) { doShow(operate, selected, tempData) {
this.selected = selected;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.signalName = ''; this.signalName = '';
@ -127,16 +128,16 @@ export default {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
}, },
commit() { commit() {
const operate = { const operate = {
over: true, send: true,
operation: OperationEvent.Signal.detail.menu.operation, operation: OperationEvent.Signal.detail.menu.operation
cmdType: CMD.Signal.CMD_STAND_VIEW_STATUS
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -149,11 +150,10 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -5,26 +5,25 @@
class="xian-01__systerm route-hand-control" class="xian-01__systerm route-hand-control"
:title="title" :title="title"
:visible.sync="show" :visible.sync="show"
width="360px" width="300px"
:before-close="doClose" :before-close="doClose"
:z-index="2000" :z-index="2000"
:modal="false" :modal="false"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row class="header"> <el-row class="header">
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col> <el-col :span="11"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col> <el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="10"> <el-col :span="11">
<el-input v-model="stationName" size="small" disabled /> <el-input v-model="stationName" size="small" disabled />
</el-col> </el-col>
<el-col :span="10" :offset="2"> <el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled /> <el-input v-model="signalName" size="small" disabled />
</el-col> </el-col>
</el-row> </el-row>
<div class="table"> <div class="table">
<span>{{ $t('menu.routeList') }}</span>
<el-table <el-table
ref="tempTable" ref="tempTable"
:data="tempData" :data="tempData"
@ -34,29 +33,28 @@
highlight-current-row highlight-current-row
:height="140" :height="140"
> >
<el-table-column :id="domIdChoose" prop="name" :label="this.$t('menu.route')" style="margin-left:30px"> <el-table-column label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="changeList[scope.$index]"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
@change="changeCheck(changeList[scope.$index],scope.row.code)"
/>
</template>
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox v-model="scope.row.check" :disabled="scope.row.disabled" />
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="controlType" :label="this.$t('menu.controlState')" :width="80">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">
<span v-if="scope.row.controlType == '01'">{{ $t('menu.automatic2') }}</span>
<span v-else>{{ $t('menu.artificial') }}</span>
</span>
</template>
</el-table-column>
<el-table-column prop="conflictCheck" :label="this.$t('menu.conflictCheck')" :width="80">
<template slot-scope="scope">
<span
:style="{color: scope.row.disabled ? '#CBCBCB':'unset'}"
>{{ scope.row.conflictCheck }}</span>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
<el-row>
<el-col :span="22" :offset="1">
<el-checkbox v-model="allSelect" size="small" @change="allSelectChange">全选</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button <el-button
@ -65,13 +63,12 @@
:disabled="commitDisabled" :disabled="commitDisabled"
:loading="loading" :loading="loading"
@click="commit" @click="commit"
>{{ $t('global.confirm') }}</el-button> >确定</el-button>
</el-col> </el-col>
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</div> </div>
@ -81,25 +78,28 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
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 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';
export default { export default {
name: 'RouteHandControl', name: 'RouteHandControl',
components: { components: {
ConfirmControl,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null,
tempData: [], tempData: [],
operation: null, operation: null,
selection: [], selection: [],
stationName: '', stationName: '',
signalName: '' signalName: '',
allSelect: false,
changeList:[],
commitDisabled: true,
disabledLength: 0
}; };
}, },
computed: { computed: {
@ -118,38 +118,27 @@ export default {
return OperationEvent.Signal.humanControl.choose.domId; return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId; return OperationEvent.Signal.atsAutoControl.choose.domId;
} else {
return '';
} }
} else {
return '';
} }
return '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
}, },
title() { title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return this.$t('menu.menuSignal.humanControl'); return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return this.$t('menu.menuSignal.atsAutoControl'); return '进路交自动控';
} else {
return '';
} }
return '';
},
commitDisabled() {
let disabled = true;
if (this.selection && this.selection.length) {
disabled = false;
}
return disabled;
} }
}, },
watch: { watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
@ -158,6 +147,12 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected, tempData) { doShow(operate, selected, tempData) {
this.selected = selected;
this.allSelect = false;
this.changeList = [];
this.commitDisabled = true;
this.selection = [];
this.disabledLength = 0;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.signalName = ''; this.signalName = '';
@ -172,15 +167,17 @@ export default {
if (tempData && tempData.length > 0) { if (tempData && tempData.length > 0) {
tempData.forEach(elem => { tempData.forEach(elem => {
elem.check = false; this.changeList.push(false);
elem.disabled = false; elem.disabled = false;
// //
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && if (operate.operation == OperationEvent.Signal.humanControl.menu.operation &&
elem.controlType != '01') { (elem.atsControl == 0)) {
elem.disabled = true; elem.disabled = true;
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && this.disabledLength++;
elem.controlType == '01') { } if (operate.operation == OperationEvent.Signal.atsAutoControl.menu.operation &&
(elem.atsControl != 0)) {
elem.disabled = true; elem.disabled = true;
this.disabledLength++;
} }
}); });
} }
@ -199,36 +196,78 @@ export default {
this.$refs.tempTable.setCurrentRow(); this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
checkTableDataSelction(data) { changeCheck(check, code) {
const selection = []; if (check) {
if (data && data.length > 0) { this.selection.push(code);
data.forEach(row => { } else {
if (row.check && !row.disabled) { this.selection.splice(this.selection.indexOf(code), 1);
selection.push(row); }
} if (this.selection.length >= (this.tempData.length - this.disabledLength) ) {
}); this.allSelect = true;
} else {
this.allSelect = false;
}
if (this.selection.length > 0) {
this.commitDisabled = false;
} else {
this.commitDisabled = true;
} }
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { const operate = {val:code};
this.handleChooseChange(selection); if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
this.selection = selection; /** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
allSelectChange() {
this.changeList = [];
if (this.allSelect) {
this.tempData.forEach((item, index)=> {
if (!item.disabled) {
this.changeList.push(true);
this.selection.push(item.code);
} else {
this.changeList.push('');
}
});
this.allSelect = true;
if (this.selection.length > 0) {
this.commitDisabled = false;
}
} else {
this.tempData.forEach((item, index) => {
if (!item.disabled) {
this.changeList.push(false);
this.selection.splice(this.selection.indexOf(item.code), 1);
}
});
this.allSelect = false;
this.commitDisabled = true;
} }
}, },
handleChooseChange(selection) { handleChooseChange(selection) {
this.selection = selection; this.selection = selection;
const codeList = selection.map(elem => { return elem.code; }); if (selection && selection.length) {
if (codeList && codeList.length) {
const operate = { const operate = {
repeat: true, repeat: true,
operation: '', operation: '',
val: codeList.join('::') selection: selection
}; };
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 自排关*/ /** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation; operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 自排开*/ /** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
} }
@ -238,64 +277,44 @@ export default {
} }
}); });
} else if (!selection) { } else if (!selection) {
this.$messageBox(this.$t('tip.selectAPieceOfData')); this.$messageBox(`请选择一条数据`);
} }
}, },
commit() { commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 自排关*/ /** 进路交人工控*/
this.humanControl(); this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 自排开*/ /** 进路交自动控*/
this.atsAutoControl(); this.atsAutoControl();
} }
}, },
// //
humanControl() { humanControl() {
const codeList = this.selection.map(elem => { return elem.code; });
const operate = {
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param: {
Route_Code_List: codeList
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
// //
atsAutoControl() { atsAutoControl() {
const codeList = this.selection.map(elem => { return elem.code; });
const operate = {
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param: {
Route_Code_List: codeList
}
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {
@ -303,7 +322,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -274,7 +274,7 @@ export default {
this.setMessage(this.$t('tip.firstConfirmTip')); this.setMessage(this.$t('tip.firstConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 }); this.setButtonEnable({ step: 1 });
@ -287,8 +287,7 @@ export default {
}); });
}, },
confirm1() { confirm1() {
const operate = { const operate = {};
};
if (this.operation == OperationEvent.Section.unlock.menu.operation) { if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/ /** 区段解封*/
@ -303,7 +302,7 @@ export default {
this.setMessage(this.$t('tip.secondConfirmTip')); this.setMessage(this.$t('tip.secondConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1; this.timeCountCommand = -1;
@ -336,7 +335,7 @@ export default {
this.setMessage(''); this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 }); this.setButtonEnable({ step: -1 });
@ -368,7 +367,7 @@ export default {
} }
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 }); this.setButtonEnable({ step: 0 });
@ -385,7 +384,7 @@ export default {
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.close.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -1,8 +1,8 @@
<template> <template>
<el-dialog v-dialogDrag class="xian-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="xian-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-row class="header">
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col> <el-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</span></el-col> <el-col :span="11" :offset="2"><span>区段</span></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
@ -28,7 +28,7 @@
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 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',
@ -56,11 +56,11 @@ export default {
}, },
title() { title() {
if (this.operation == OperationEvent.Section.lock.menu.operation) { if (this.operation == OperationEvent.Section.lock.menu.operation) {
return this.$t('menu.menuSection.sectionBlockade'); return '区段封锁';
} else if (this.operation == OperationEvent.Section.split.menu.operation) { } else if (this.operation == OperationEvent.Section.split.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionResection'); return '区段切除';
} else if (this.operation == OperationEvent.Section.active.menu.operation) { } else if (this.operation == OperationEvent.Section.active.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionActive'); return '区段激活';
} }
return ''; return '';
} }
@ -112,41 +112,27 @@ export default {
}, },
// //
lock() { lock() {
const operate = { this.sendCommand(menuOperate.Section.lock);
over: true,
operation: OperationEvent.Section.lock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
};
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);
}, },
sendCommand(operate) { sendCommand(operate) { //
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {
@ -154,7 +140,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -1,19 +1,24 @@
<template> <template>
<div> <div>
<el-dialog v-dialogDrag class="xian-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 :z-index="2000" class="xian-01__systerm section-cmd-speed" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<div style="padding: 10px 20px; border: 1px solid lightgray;"> <div style="padding: 10px 20px; border: 1px solid lightgray;">
<span class="base-label">{{ $t('menu.commandInformation') }}</span> <span class="base-label">命令信息</span>
<el-form label-position="center" size="mini"> <el-form label-position="center" size="mini">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="this.$t('menu.type')" label-width="40px"> <el-form-item label="类型" label-width="40px">
<el-select v-model="operation" size="small" disabled> <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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="this.$t('menu.stationName')" label-width="80px"> <el-form-item label="车站名称" label-width="80px">
<el-input v-model="stationName" size="small" disabled /> <el-input v-model="stationName" size="small" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -23,41 +28,49 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label="this.$t('menu.speedLimitValue')" label-width="80px"> <el-form-item v-if="!isCancelSpeed" label="限速值" label-width="80px">
<el-select :id="domIdChoose" v-model="formData.SpeedLimit_Value" size="small" :disabled="spdDisabled" @change="speedSelectChange"> <el-select
<el-option v-for="item in speedList" :key="item" :label="item" :value="item" /> :id="domIdChoose"
v-model="speed"
size="small"
:disabled="spdDisabled"
@change="speedSelectChange"
>
<el-option
v-for="item in speedList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<el-table :data="tableData" border style="width: 100%" size="mini" highlight-current-row height="200"> <el-table ref="table" class="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="order" :width="50" label="序号" />
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" /> <el-table-column prop="date" :width="160" label="时间" />
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" /> <el-table-column prop="context" :width="180" label="执行过程" />
<el-table-column prop="result" :label="this.$t('menu.executionResult')" /> <el-table-column prop="result" label="执行结果" />
</el-table> </el-table>
<span class="notice">{{ message }}</span> <span class="notice">{{ message }}</span>
<el-row class="button-group"> <el-row class="button-group">
<el-col :span="2" :offset="3"> <el-col :span="2" :offset="2">
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command"> <el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span v-show="timeCountCommand>0">({{ timeCountCommand }})</span></el-button>
{{ $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-col> </el-col>
<el-col :span="2" :offset="2"> <el-col :span="2" :offset="2">
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2"> <el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
{{ $t('menu.secondConfirm') }} </el-button>
<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
</el-col> </el-col>
<el-col :span="2" :offset="2"> <el-col :span="2" :offset="2">
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button> <el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
</el-col> </el-col>
<el-col :span="2" :offset="1"> <el-col :span="2" :offset="2">
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button> <el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdClose" @click="close">关闭</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-dialog> </el-dialog>
@ -65,9 +78,9 @@
</div> </div>
</template> </template>
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControlSpeed from './childDialog/confirmControlSpeed'; import ConfirmControlSpeed from './childDialog/confirmControlSpeed';
import { now } from '@/utils/date'; import { now } from '@/utils/date';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
@ -83,6 +96,7 @@ export default {
order: 0, order: 0,
row: null, row: null,
timer: null, timer: null,
type: '',
operation: '', operation: '',
cmdDisabled: [true, true, true], cmdDisabled: [true, true, true],
spdDisabled: false, spdDisabled: false,
@ -95,152 +109,134 @@ export default {
speedSpace: 5, speedSpace: 5,
stationName: '', stationName: '',
name: '', name: '',
formData: { speed: ''
SpeedLimit_Value: ''
}
}; };
}, },
computed: { computed: {
nameLabel() { nameLabel() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation || if (this.operation == OperationEvent.Section.setSpeed.menu.operation ||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
return this.$t('menu.sectionName'); return '区段名称';
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation || } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation ||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
return this.$t('menu.switchName'); return '道岔名称';
} }
return null; return '';
}, },
speedList() { speedList() {
const list = []; const list = [{ name: '不限速', value: '0' }];
for (var i = 0; i * this.speedSpace <= this.maxSpeed; i++) { for (var i = 1; i * this.speedSpace <= this.maxSpeed; i++) {
list.push(i * this.speedSpace); const speed = String(i * this.speedSpace);
list.push({ name: speed, value: speed });
} }
return list; return list;
}, },
typeList() { typeList() {
return [ return [
{ code: OperationEvent.Section.setSpeed.menu.operation, name: this.$t('menu.menuSection.sectionSetSpeedLimit') }, { code: OperationEvent.Section.setSpeed.menu.operation, name: '区段设置限速' },
{ code: OperationEvent.Section.cancelSpeed.menu.operation, name: this.$t('menu.menuSection.sectionCancelSpeedLimit') }, { code: OperationEvent.Section.cancelSpeed.menu.operation, name: '区段取消限速' },
{ code: OperationEvent.Switch.setSpeed.menu.operation, name: this.$t('menu.turnoutSettingSpeedLimit') }, { code: OperationEvent.Switch.setSpeed.menu.operation, name: '区段设置限速' },
{ code: OperationEvent.Switch.cancelSpeed.menu.operation, name: this.$t('menu.turnoutCancelsSpeedLimit') } { code: OperationEvent.Switch.cancelSpeed.menu.operation, name: '区段取消限速' }
]; ];
}, },
title() { title() {
if (this.dialogShow) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation ||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
return this.$t('menu.menuSection.sectionSetSpeedLimit'); return '区段设置限速';
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
return this.$t('menu.menuSection.sectionCancelSpeedLimit'); this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { return '区段取消限速';
return this.$t('menu.turnoutSettingSpeedLimit');
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
return this.$t('menu.turnoutCancelsSpeedLimit');
}
} }
return null; return '';
}, },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdChoose() { domIdChoose() {
if (this.dialogShow) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { /** 区段设置限速*/
/** 区段设置限速*/ return OperationEvent.Section.setSpeed.choose.domId;
return OperationEvent.Section.setSpeed.choose.domId; } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { /** 道岔设置限速*/
/** 道岔设置限速*/ return OperationEvent.Switch.setSpeed.choose.domId;
return OperationEvent.Switch.setSpeed.choose.domId;
}
} }
return null; return '';
}, },
domIdCommand() { domIdCommand() {
if (this.dialogShow) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { /** 区段设置限速*/
/** 区段设置限速*/ return OperationEvent.Section.setSpeed.order.domId;
return OperationEvent.Section.setSpeed.order.domId; } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { /** 区段取消限速*/
/** 区段取消限速*/ return OperationEvent.Section.cancelSpeed.order.domId;
return OperationEvent.Section.cancelSpeed.order.domId; } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { /** 道岔设置限速*/
/** 道岔设置限速*/ return OperationEvent.Switch.setSpeed.order.domId;
return OperationEvent.Switch.setSpeed.order.domId; } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { /** 道岔取消限速*/
/** 道岔取消限速*/ return OperationEvent.Switch.cancelSpeed.order.domId;
return OperationEvent.Switch.cancelSpeed.order.domId;
}
} }
return null; return '';
}, },
domIdConfirm1() { domIdConfirm1() {
if (this.dialogShow) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { /** 区段设置限速*/
/** 区段设置限速*/ return OperationEvent.Section.setSpeed.confirm1.domId;
return OperationEvent.Section.setSpeed.confirm1.domId; } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { /** 区段取消限速*/
/** 区段取消限速*/ return OperationEvent.Section.cancelSpeed.confirm1.domId;
return OperationEvent.Section.cancelSpeed.confirm1.domId; } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { /** 道岔设置限速*/
/** 道岔设置限速*/ return OperationEvent.Switch.setSpeed.confirm1.domId;
return OperationEvent.Switch.setSpeed.confirm1.domId; } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { /** 道岔取消限速*/
/** 道岔取消限速*/ return OperationEvent.Switch.cancelSpeed.confirm1.domId;
return OperationEvent.Switch.cancelSpeed.confirm1.domId;
}
} }
return null; return '';
}, },
domIdConfirm2() { domIdConfirm2() {
if (this.dialogShow) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { /** 区段设置限速*/
/** 区段设置限速*/ return OperationEvent.Section.setSpeed.confirm2.domId;
return OperationEvent.Section.setSpeed.confirm2.domId; } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { /** 区段取消限速*/
/** 区段取消限速*/ return OperationEvent.Section.cancelSpeed.confirm2.domId;
return OperationEvent.Section.cancelSpeed.confirm2.domId; } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { /** 道岔设置限速*/
/** 道岔设置限速*/ return OperationEvent.Switch.setSpeed.confirm2.domId;
return OperationEvent.Switch.setSpeed.confirm2.domId; } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { /** 道岔设置限速*/
/** 道岔设置限速*/ return OperationEvent.Switch.cancelSpeed.confirm2.domId;
return OperationEvent.Switch.cancelSpeed.confirm2.domId;
}
} }
return null; return '';
}, },
domIdStop() { domIdStop() {
if (this.dialogShow) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { /** 区段设置限速*/
/** 区段设置限速*/ return OperationEvent.Section.setSpeed.stop.domId;
return OperationEvent.Section.setSpeed.stop.domId; } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { /** 区段取消限速*/
/** 区段取消限速*/ return OperationEvent.Section.cancelSpeed.stop.domId;
return OperationEvent.Section.cancelSpeed.stop.domId; } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { /** 道岔设置限速*/
/** 道岔设置限速*/ return OperationEvent.Switch.setSpeed.stop.domId;
return OperationEvent.Switch.setSpeed.stop.domId; } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { /** 道岔取消限速*/
/** 道岔取消限速*/ return OperationEvent.Switch.cancelSpeed.stop.domId;
return OperationEvent.Switch.cancelSpeed.stop.domId;
}
} }
return null; return '';
}, },
domIdClose() { domIdClose() {
if (this.dialogShow) { return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
return OperationEvent.Command.close.menu.domId;
}
return null;
}, },
isCancelSpeed() { isCancelSpeed() {
return this.operation == OperationEvent.Section.cancelSpeed.menu.operation || return this.operation == OperationEvent.Section.cancelSpeed.menu.operation || this.operation == OperationEvent.Switch.cancelSpeed.menu.operation;
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation;
} }
}, },
watch: { watch: {
cmdDisabled: { cmdDisabled: {
handler(val, oldVal) { handler(val, oldVal) {
this.stpDisabled = true;
this.spdDisabled = false; this.spdDisabled = false;
val.forEach((elem, index) => { val.forEach((elem, index) => {
// //
@ -256,7 +252,7 @@ export default {
}, },
deep: true deep: true
}, },
'formData.SpeedLimit_Value': function (val) { 'speed': function (val) {
if (val) this.cmdDisabled[0] = false; if (val) this.cmdDisabled[0] = false;
} }
}, },
@ -292,7 +288,7 @@ export default {
this.stationName = ''; this.stationName = '';
if (selected) { if (selected) {
if (operate.operation == OperationEvent.Section.setSpeed.menu.operation || if (operate.operation == OperationEvent.Section.setSpeed.menu.operation ||
operate.operation == OperationEvent.Section.cancelSpeed.menu.operation) { operate.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') { if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode); const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
@ -303,7 +299,7 @@ export default {
this.name += selected.name; this.name += selected.name;
} }
} else if (operate.operation == OperationEvent.Switch.setSpeed.menu.operation || } else if (operate.operation == OperationEvent.Switch.setSpeed.menu.operation ||
operate.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { operate.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) { if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.name = selected.name; this.name = selected.name;
} }
@ -314,7 +310,7 @@ export default {
this.stationName = station.name; this.stationName = station.name;
} }
this.formData.SpeedLimit_Value = ''; this.speed = '';
this.tableData = []; this.tableData = [];
this.selected = selected; this.selected = selected;
this.timeCountCommand = -1; this.timeCountCommand = -1;
@ -322,10 +318,11 @@ export default {
this.cmdDisabled = [true, true, true]; this.cmdDisabled = [true, true, true];
this.stpDisabled = true; this.stpDisabled = true;
this.order = 0; this.order = 0;
this.type = operate.type;
this.operation = operate.operation; this.operation = operate.operation;
this.setMessage(this.$t('tip.selectSpeedLimitValueTip')); this.setMessage('请选择限速值后,点击“下达”按钮,下达命令!');
if (this.isCancelSpeed) { if (this.isCancelSpeed) {
this.formData.SpeedLimit_Value = `${tempData}`; this.speed = `${tempData}`;
this.spdDisabled = true; this.spdDisabled = true;
this.cmdDisabled = [false, true, true]; this.cmdDisabled = [false, true, true];
} }
@ -343,6 +340,7 @@ export default {
}, },
speedSelectChange(val) { speedSelectChange(val) {
const operate = { const operate = {
operation: '',
val: val val: val
}; };
@ -354,8 +352,8 @@ export default {
operate.operation = OperationEvent.Switch.setSpeed.choose.operation; operate.operation = OperationEvent.Switch.setSpeed.choose.operation;
} }
this.setMessage(this.$t('tip.releaseTip')); this.setMessage('请点击“下达”按钮,下达命令!');
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 }); this.setButtonEnable({ step: 0 });
@ -363,42 +361,52 @@ export default {
}); });
}, },
command() { command() {
const operate = {}; const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/ /** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.order.operation; operate.operation = OperationEvent.Section.setSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.sectionSetLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix'); operate.message = `在【${this.name}】区段,区段设置限速${this.speed}km/h确认下达吗`;
if (this.speed == 0) {
operate.message = `在【${this.name}】区段,区段取消限速,确认下达吗?`;
}
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/ /** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.order.operation; operate.operation = OperationEvent.Section.cancelSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.sectionCancelLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix'); operate.message = `${this.name}区段,区段取消限速,确认下达吗?`;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/ /** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.order.operation; operate.operation = OperationEvent.Switch.setSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.switchSetLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix'); operate.message = `在【${this.name}】区段,道岔设置限速${this.speed}km/h确认下达吗`;
if (this.speed == 0) {
operate.message = `在【${this.name}】区段,道岔区段取消限速,确认下达吗?`;
}
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/ /** 区段取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.order.operation; operate.operation = OperationEvent.Switch.cancelSpeed.order.operation;
operate.message = this.$t('menu.in') + `${this.name}` + this.$t('menu.switchCancelLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix'); operate.message = `${this.name}区段,道岔区段取消限速,确认下达吗?`;
} }
this.setMessage(this.$t('tip.firstConfirmTip')); this.setMessage('请点击“确认1”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
this.$refs.confirmControlSpeed.doShow(operate, this.selected); this.$refs.confirmControlSpeed.doShow(operate, this.selected);
} else { } else {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
} }
}).catch(() => { }).catch(() => {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
}); });
}, },
confirm1() { confirm1() {
const operate = {}; const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/ /** 区段设置限速*/
@ -414,27 +422,32 @@ export default {
operate.operation = OperationEvent.Switch.cancelSpeed.confirm1.operation; operate.operation = OperationEvent.Switch.cancelSpeed.confirm1.operation;
} }
this.setMessage(this.$t('tip.secondConfirmTip')); this.setMessage('请点击“确认2”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = 10; this.timeCountConfirm = 10;
this.setButtonEnable({ step: 2 }); this.setButtonEnable({ step: 2 });
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
} else { } else {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
} }
}).catch(() => { }).catch(() => {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
}); });
}, },
confirm2() { confirm2() {
const operate = { const operate = {
val: this.formData.SpeedLimit_Value, over: true,
param: this.formData operation: '',
cmdType: '',
param: {
speedLimitValue: this.speed
}
}; };
//
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/ /** 区段设置限速*/
@ -443,7 +456,7 @@ export default {
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/ /** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation; operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED; operate.cmdType = CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/ /** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation; operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation;
@ -451,30 +464,32 @@ export default {
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/ /** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation; operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED; operate.cmdType = CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED;
} }
this.setMessage(''); this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 }); this.setButtonEnable({ step: -1 });
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
} else { } else {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
} }
}).catch(() => { }).catch(() => {
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 }); this.setButtonEnable({ step: -1 });
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
}); });
}, },
stop() { stop() {
const operate = {}; const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/ /** 区段设置限速*/
@ -490,25 +505,25 @@ export default {
operate.operation = OperationEvent.Switch.cancelSpeed.stop.operation; operate.operation = OperationEvent.Switch.cancelSpeed.stop.operation;
} }
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 }); this.setButtonEnable({ step: 0 });
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
} else { } else {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
} }
}).catch(() => { }).catch(() => {
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
}); });
}, },
close() { close() {
const operate = { const operate = {
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.close.menu.operation
}; };
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickToClose'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击关闭', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -11,8 +11,8 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row class="header"> <el-row class="header">
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col> <el-col :span="10"><span>车站名称</span></el-col>
<el-col :span="10" :offset="2"><span>{{ $t('menu.stationStandStatus') }}</span></el-col> <el-col :span="10" :offset="2"><span>站台方向</span></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
@ -20,29 +20,17 @@
</el-col> </el-col>
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<div style="height: 32px;"> <div style="height: 32px;">
<el-radio <el-radio v-model="standStatus" :label="true" style="line-height: 32px;" disabled>上行方向</el-radio>
v-model="standStatus" <el-radio v-model="standStatus" :label="false" style="line-height: 32px;" disabled>下行方向</el-radio>
label="02"
style="line-height: 32px;"
:style="{color: standStatus == '02' ? '' : 'red'}"
disabled
>{{ $t('menu.upDirection') }}</el-radio>
<el-radio
v-model="standStatus"
label="01"
style="line-height: 32px;"
:style="{color: standStatus == '01' ? '' : 'red'}"
disabled
>{{ $t('menu.downDirection') }}</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div class="table"> <div class="table">
<span>{{ $t('menu.stationStandStatus') }}</span> <span>站台状态</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini"> <el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
<el-table-column prop="name" :width="170" :label="this.$t('menu.switchbackStation')" /> <el-table-column prop="name" :width="170" label="折返站" />
<el-table-column prop="station" :label="this.$t('menu.switchbackPlatform')" /> <el-table-column prop="station" label="折返站台" />
<el-table-column prop="strategy" :label="this.$t('menu.switchbackStrategy')"> <el-table-column prop="strategy" label="折返策略">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select
:id="domIdChoose" :id="domIdChoose"
@ -67,11 +55,10 @@
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit"> <el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">确认</el-button>
{{ $t('global.confirm') }}</el-button>
</el-col> </el-col>
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button> <el-button :id="domIdCancel" @click="cancel">取消</el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl" /> <confirm-control ref="confirmControl" />
@ -149,23 +136,23 @@ export default {
}); });
}, },
methods: { methods: {
loadInitData(selected, opts) { loadInitData(selected) {
this.tempData = []; this.tempData = [];
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: selected.reentryStrategy || '04' });
}, },
doShow(operate, selected, opts) { doShow(operate, selected) {
if (!this.dialogShow) { if (!this.dialogShow) {
this.standStatus = ''; this.standStatus = '';
this.stationName = ''; this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standStatus = selected.direction; this.standStatus = selected.right;
const 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;
} }
} }
this.loadInitData(selected, opts); this.loadInitData(selected);
} }
this.dialogShow = true; this.dialogShow = true;
@ -197,7 +184,7 @@ export default {
this.strategy = strategy; this.strategy = strategy;
this.isSelect = false; this.isSelect = false;
this.isConfirm = true; this.isConfirm = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -213,14 +200,13 @@ export default {
const operate = { const operate = {
over: true, over: true,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation, operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
val: `${this.strategy}`,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY, cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
param:{ param:{
Stand_ReentryStrategy:this.strategy standReentryStrategy: this.strategy
} }
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -236,11 +222,10 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
over: true,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -29,7 +29,7 @@
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 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',
@ -57,17 +57,17 @@ export default {
}, },
title() { title() {
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
return this.$t('menu.menuStationStand.detainTrain'); return '设置扣车';
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
return this.$t('menu.menuStationStand.cancelDetainTrain'); return '取消扣车';
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
return this.$t('menu.menuStationStand.cancelDetainTrainForce'); return '强制取消扣车';
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
return this.$t('menu.menuStationStand.earlyDeparture'); return '设置提前发车';
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
return this.$t('menu.menuStationStand.setJumpStop'); return '设置跳停';
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
return this.$t('menu.menuStationStand.cancelJumpStop'); return '取消跳停';
} }
return ''; return '';
}, },
@ -124,136 +124,47 @@ export default {
}, },
// //
setDetainTrain() { setDetainTrain() {
const step = { 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/next', step).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(step);
});
}, },
// //
cancelDetainTrain() { cancelDetainTrain() {
const step = { 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/next', step).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(step);
});
}, },
// //
cancelDetainTrainForce() { cancelDetainTrainForce() {
const step = { this.sendCommand(menuOperate.StationStand.cancelDetainTrainForce);
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', step).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(step);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(step);
});
}, },
// //
earlyDeparture() { earlyDeparture() {
const step = { this.sendCommand(menuOperate.StationStand.earlyDeparture);
over: true,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
};
this.loading = true;
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(step);
});
}, },
// //
setJumpStop() { setJumpStop() {
const step = { this.sendCommand(menuOperate.StationStand.setJumpStop, this.selected.direction);
over: true,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
val: this.selected.direction, // , 01: /02:
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
};
this.loading = true;
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(step);
});
}, },
// //
cancelJumpStop() { cancelJumpStop() {
const step = { this.sendCommand(menuOperate.StationStand.cancelJumpStop, this.selected.direction); // , 01: /02:
over: true, },
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, sendCommand(operate, val) { //
val: this.selected.direction, // , 01: /02:
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', step).then(({ valid }) => { commitOperate(operate, {}, 2, val).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {
const step = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.loading = false; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -10,31 +10,31 @@
:modal="false" :modal="false"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row class="header"> <el-tree
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col> :data="treeData"
<el-col :span="10" :offset="2"><span>{{ $t('menu.platform') }}</span></el-col> :lazy="false"
</el-row> class="tree-height-max"
<el-row> :default-expand-all="true"
<el-col :span="10"> style="background: #f0f0f0;"
<el-input v-model="stationName" size="small" disabled /> >
</el-col> <div slot-scope="{ node, data }" style="height: 24px; width: 100%;">
<el-col :span="10" :offset="2"> <div v-if="data.level == 1" style="line-height: 26px;">{{ data.name }}</div>
<el-input v-model="standName" size="small" disabled /> <div v-if="data.level == 2" style="background: lightgray; overflow: hidden; height: 100%;">
</el-col> <div
</el-row> style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;"
<div class="table"> >
<span>{{ $t('menu.stationStandStatus') }}</span> {{ data.name }}</div>
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" highlight-current-row> <div style="width: 54%;float: left; height: 24px; line-height: 24px; padding-left: 5px;">
<el-table-column prop="item" :width="140" :label="this.$t('menu.item')" /> {{ data.value }}</div>
<el-table-column prop="status" :label="this.$t('global.status')" /> </div>
</el-table> </div>
</div> </el-tree>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col> </el-col>
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
@ -42,9 +42,8 @@
</template> </template>
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
@ -57,14 +56,67 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
tempData: [], tempData: [],
stationName: '',
standName: '',
strategyMap: { strategyMap: {
'01': this.$t('menu.noSwitchback'), '01': '无折返',
'02': this.$t('menu.noOneSwitchback'), '02': '无人折返',
'03': this.$t('menu.automaticChange'), '03': '自动换端',
'04': this.$t('menu.default') '04': '默认'
} },
treeData: [
{
children: [
{
name: '车站',
value: '',
level: 2
},
{
name: '站台',
value: '',
level: 2
},
{
name: '停站时间',
value: '',
level: 2
},
{
name: '跳停',
value: '',
level: 2
}
],
name: '站台基本信息',
level: 1
},
{
children: [
{
name: '中心扣车',
value: '',
level: 2
},
{
name: '车站扣车',
value: '',
level: 2
}
],
name: '扣车',
level: 1
},
{
children: [
{
name: '站台',
value: '',
level: 2
}
],
name: '运行等级',
level: 1
}
]
}; };
}, },
computed: { computed: {
@ -81,7 +133,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
}, },
title() { title() {
return this.$t('menu.menuStationStand.getStationStandStatus'); return '站台详细信息';
} }
}, },
mounted() { mounted() {
@ -90,7 +142,7 @@ export default {
}); });
}, },
methods: { methods: {
loadInitData(selected, opts) { loadInitData(selected) {
this.tempData = []; this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode); const index = this.stationList.findIndex(n => n.code == selected.stationCode);
@ -109,30 +161,37 @@ export default {
} }
} }
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/ //
this.tempData.push({ item: this.$t('menu.stationDetainTrain'), status: opts.holdStatus == '02' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') }); this.treeData[1].children[0].value = selected.centerHoldTrain ? '已设置' : '未设置';
this.tempData.push({ item: this.$t('menu.centerDetainTrain'), status: opts.holdStatus == '03' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') }); //
this.tempData.push({ item: this.$t('menu.stopTime'), status: opts.parkingTime != -1 ? opts.parkingTime : this.$t('menu.automatic2') }); this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
//
this.treeData[0].children[2].value = selected.parkingTime == 0 ? '自动' : `${selected.parkingTime}`;
//
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
// if (selected.direction == '01') {
//
// }
if (!stationStand || !station) { if (!stationStand || !station) {
this.tempData.push({ item: this.$t('menu.runLevel'), status: this.$t('menu.automatic2') }); this.treeData[2].children[0].value = `自动`;
} else { } else {
this.tempData.push({ item: this.$t('menu.runLevel'), status: opts.intervalRunTime > 0 ? this.$t('menu.to') + station.name + stationStand.name + this.$t('global.colon') + this.$t('menu.artificial') : this.$t('menu.to') + station.name + stationStand.name + this.$t('menu.automatic2') }); this.treeData[2].children[0].value = selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动`;
} }
this.tempData.push({ item: this.$t('menu.jumpStop'), status: opts.jumpStopStatus != '01' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') }); //
this.tempData.push({ item: this.$t('menu.downSwitchbackStrategy'), status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : this.$t('menu.default') }); // this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' });
}, },
doShow(operate, selected, opts) { doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) { if (!this.dialogShow) {
this.standName = ''; this.treeData[0].children[0].value = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name; this.treeData[0].children[1].value = selected.name;
const 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.treeData[0].children[0].value = station.name;
} }
} }
this.loadInitData(selected, opts); this.loadInitData(selected);
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
@ -143,16 +202,15 @@ export default {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
}, },
commit() { commit() {
const operate = { const operate = {
over: true, operation: OperationEvent.Command.close.confirm.operation
operation: OperationEvent.Command.close.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -167,7 +225,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -15,17 +15,17 @@
<el-row> <el-row>
<el-radio-group v-model="upDown" style="width:100%;" @change="choose"> <el-radio-group v-model="upDown" style="width:100%;" @change="choose">
<el-col :span="11"> <el-col :span="11">
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">{{ $t('menu.uplinkBroadly') }}</el-radio> <el-radio :id="upDown ? domIdChoose : ''" :label="true">{{ $t('menu.uplinkBroadly') }}</el-radio>
</el-col> </el-col>
<el-col :span="11" :offset="1"> <el-col :span="11" :offset="1">
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">{{ $t('menu.downlinkBroadly') }}</el-radio> <el-radio :id="!upDown ? domIdChoose : ''" :label="false">{{ $t('menu.downlinkBroadly') }}</el-radio>
</el-col> </el-col>
</el-radio-group> </el-radio-group>
</el-row> </el-row>
</el-radio-group> </el-radio-group>
<div class="table"> <div class="table">
<span>{{ $t('menu.detainTrainStationList') }}</span> <span>扣车站台列表</span>
<el-table <el-table
ref="tempData" ref="tempData"
:data="tempData" :data="tempData"
@ -36,8 +36,8 @@
height="160" height="160"
highlight-current-row highlight-current-row
> >
<el-table-column prop="stationName" :label="this.$t('menu.stationName')" /> <el-table-column prop="stationName" label="车站名称" />
<el-table-column prop="standName" :width="140" :label="this.$t('menu.detainTrainStation')" /> <el-table-column prop="standName" :width="140" label="扣车站台" />
</el-table> </el-table>
</div> </div>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -68,7 +68,7 @@ export default {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
upDown: '01', upDown: false,
tempData: [], tempData: [],
disabled: true, disabled: true,
operation: '' operation: ''
@ -108,9 +108,9 @@ export default {
this.tempData = []; this.tempData = [];
this.stationStandList.forEach(elem => { this.stationStandList.forEach(elem => {
/** status 01: 未扣车*/ /** status 01: 未扣车*/
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).status; const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {});
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}); const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {});
if (station && station.visible && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) { if (station && station.visible && stand && stand.centerHoldTrain && elem.right == this.upDown) {
this.tempData.push({ stationName: station.name, standName: elem.name }); this.tempData.push({ stationName: station.name, standName: elem.name });
} }
}); });
@ -124,7 +124,7 @@ export default {
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.loading = false; this.loading = false;
this.upDown = selected.direction; this.upDown = selected.right;
this.loadTableData(); this.loadTableData();
this.operation = operate.operation; this.operation = operate.operation;
} }
@ -142,10 +142,10 @@ export default {
this.loadTableData(); this.loadTableData();
const operate = { const operate = {
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation, operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
val: `${upDown}` val: this.upDown
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -156,14 +156,13 @@ export default {
over: true, over: true,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN, cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN,
val: this.upDown,
param: { param: {
Stand_AllLine: this.upDown standAllLine: this.upDown ? '01' : '02'
} }
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -179,7 +178,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -38,7 +38,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="check" :label="this.$t('menu.alwaysEffective')"> <el-table-column prop="check" label="一直有效">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" /> <el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
</template> </template>
@ -66,7 +66,6 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'StandRunLevel', name: 'StandRunLevel',
@ -112,8 +111,8 @@ export default {
}, },
timeList() { timeList() {
const list = [ const list = [
{ value: 0, label: this.$t('menu.automatic2') }, { value: 0, label: this.$t('menu.automatic2') }
{ value: 1, label: '1' } // { value: 1, label: '1' }
]; ];
for (var i = 60; i <= this.maxRunLevel; i++) { for (var i = 60; i <= this.maxRunLevel; i++) {
list.push({ value: i, label: `${i}` }); list.push({ value: i, label: `${i}` });
@ -137,7 +136,7 @@ export default {
}); });
}, },
methods: { methods: {
loadInitData(selected, opts) { loadInitData(selected) {
this.tempData = []; this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode); const index = this.stationList.findIndex(n => n.code == selected.stationCode);
if (selected.direction == '01') { // if (selected.direction == '01') { //
@ -145,18 +144,18 @@ export default {
if (index != 0) { if (index != 0) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code); const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode); const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus }); this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: selected.runLevelTime ? selected.runLevelTime : 0, check: selected.runLevelTimeValidStatus });
} }
} else { } else {
// //
if (index != this.stationList.length) { if (index != this.stationList.length) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code); const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode); const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus }); this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: selected.runLevelTime ? selected.runLevelTime : 0, check: selected.runLevelTimeValidStatus });
} }
} }
}, },
doShow(operate, selected, opts) { doShow(operate, selected) {
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.standName = ''; this.standName = '';
@ -168,7 +167,7 @@ export default {
this.stationName = station.name; this.stationName = station.name;
} }
} }
this.loadInitData(selected, opts); this.loadInitData(selected);
} }
this.dialogShow = true; this.dialogShow = true;
@ -195,15 +194,13 @@ export default {
const operate = { const operate = {
operation: OperationEvent.StationStand.setRunLevel.choose.operation, operation: OperationEvent.StationStand.setRunLevel.choose.operation,
val: time.toString(), val: time.toString(),
param: { param: {}
Stand_RunLevel: time
}
}; };
this.time = time; this.time = time;
this.isSelect = false; this.isSelect = false;
this.isConfirm = true; this.isConfirm = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -213,12 +210,10 @@ export default {
const operate = { const operate = {
operation: OperationEvent.StationStand.setRunLevel.check.operation, operation: OperationEvent.StationStand.setRunLevel.check.operation,
val: check.toString(), val: check.toString(),
param: { param: {}
Stand_AlwaysValid: !!this.tempData[0].check
}
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -231,19 +226,20 @@ export default {
}, },
commit() { commit() {
if (this.isConfirm) { if (this.isConfirm) {
const forver = !!this.tempData[0].check;
const operate = { const operate = {
operation: OperationEvent.StationStand.setRunLevel.menu.operation, operation: OperationEvent.StationStand.setRunLevel.menu.operation,
val: [this.time, forver].join('::'),
param:{ param:{
Stand_AlwaysValid:forver, runLevelTimeForever: !!this.tempData[0].check,
Stand_RunLevel:this.time runLevelTime: 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')}`] messages: [
`设置运行等级: ${this.tempData[0].name}-${this.standName},
${this.tempData[0].time == 0 ? '运行时间自动' : `运行时间为${this.tempData[0].time}s`},
有效次数: ${this.tempData[0].check ? '一直有效' : '一次有效'}`]
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -263,7 +259,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -44,8 +44,8 @@
<div style="padding: 0px 15px; height: 30px;"> <div style="padding: 0px 15px; height: 30px;">
<div style=" position: relative; top:-5px;"> <div style=" position: relative; top:-5px;">
<el-radio-group v-model="direction"> <el-radio-group v-model="direction">
<el-radio label="02" :disabled="disabledUp">{{ $t('menu.upDirection') }}</el-radio> <el-radio :label="true" disabled>上行方向</el-radio>
<el-radio label="01" :disabled="disabledDown">{{ $t('menu.downDirection') }}</el-radio> <el-radio :label="false" disabled>下行方向</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@ -53,8 +53,8 @@
<span class="base-label">{{ $t('menu.effectiveNumber') }}</span> <span class="base-label">{{ $t('menu.effectiveNumber') }}</span>
<div style=" position: relative; top:-10px;"> <div style=" position: relative; top:-10px;">
<el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective"> <el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective">
<el-radio :id="effective === false? '': domIdChoose2" :label="false">{{ $t('menu.onceEffective') }}</el-radio> <el-radio :id="!effective? '': domIdChoose2" :label="false">一次有效</el-radio>
<el-radio :id="effective === true? '': domIdChoose2" :label="true">{{ $t('menu.alwaysEffective') }}</el-radio> <el-radio :id="effective? '': domIdChoose2" :label="true">一直有效</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@ -75,7 +75,6 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
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';
export default { export default {
name: 'StandStopTime', name: 'StandStopTime',
@ -89,8 +88,8 @@ export default {
loading: false, loading: false,
time: 0, time: 0,
control: '01', control: '01',
direction: '01', direction: false,
effective: false, effective: true,
selected: null, selected: null,
standName: '', standName: '',
stationName: '' stationName: ''
@ -115,18 +114,6 @@ export default {
domIdInput() { domIdInput() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : ''; return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
}, },
disabledUp() {
if (this.selected) {
return this.selected.direction !== '02';
}
return true;
},
disabledDown() {
if (this.selected) {
return this.selected.direction !== '01';
}
return true;
},
disabledInput() { disabledInput() {
return this.control === '01'; // return this.control === '01'; //
}, },
@ -143,7 +130,7 @@ export default {
}); });
}, },
methods: { methods: {
doShow(operate, selected, tempDate) { doShow(operate, selected) {
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.standName = ''; this.standName = '';
@ -156,10 +143,9 @@ export default {
} }
} }
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02'; this.control = selected.parkingTime ? '02' : '01';
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime); this.time = selected.parkingTime ? selected.parkingTime : 30;
this.effective = !!tempDate.parkingValidStatus; this.direction = selected.right;
this.direction = selected.direction;
this.selected = selected || {}; this.selected = selected || {};
} }
this.dialogShow = true; this.dialogShow = true;
@ -175,19 +161,16 @@ export default {
chooseControl(control) { chooseControl(control) {
/** 自动时的默认时间*/ /** 自动时的默认时间*/
if (control == '01') { if (control == '01') {
this.inputTime = 15; this.time = 30;
this.effective = true; this.effective = true;
} }
const operate = { const operate = {
operation: OperationEvent.StationStand.setStopTime.choose1.operation, operation: OperationEvent.StationStand.setStopTime.choose1.operation,
val: `${control}`, param: {}
param: {
Stand_StopControl: `${control}`
}
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -197,12 +180,10 @@ export default {
const operate = { const operate = {
operation: OperationEvent.StationStand.setStopTime.choose2.operation, operation: OperationEvent.StationStand.setStopTime.choose2.operation,
val: `${effective}`, val: `${effective}`,
param: { param: {}
Stand_AlwaysValid: `${effective}`
}
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -210,15 +191,12 @@ export default {
}, },
inputTime(time) { inputTime(time) {
const operate = { const operate = {
repeat: true,
operation: OperationEvent.StationStand.setStopTime.input.operation, operation: OperationEvent.StationStand.setStopTime.input.operation,
val: `${time}`, val: `${time}`,
param: { param: {}
Stand_StopTime: `${time}`
}
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -227,22 +205,20 @@ export default {
commit() { commit() {
const operate = { const operate = {
operation: OperationEvent.StationStand.setStopTime.menu.operation, operation: OperationEvent.StationStand.setStopTime.menu.operation,
val: [`${this.control}`, this.time, this.effective].join('::'), param: {
param:{ parkingTime: this.time == 30 ? 0 : this.time,
Stand_StopControl:this.control, parkingAlwaysValid: this.effective
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')}`] 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 ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate); this.$refs.confirmControl.doShow(operate); //
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
@ -251,14 +227,16 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { this.doClose(); }); }).catch(() => {
this.doClose();
});
} }
} }
}; };

View File

@ -252,8 +252,7 @@ export default {
commandHasPopUp() { commandHasPopUp() {
}, },
commandNoPopUp() { commandNoPopUp() {
const operate = { const operate = {};
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) { if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/ /** 上电解锁*/
@ -265,7 +264,7 @@ export default {
this.setMessage(this.$t('tip.firstConfirmTip')); this.setMessage(this.$t('tip.firstConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 }); this.setButtonEnable({ step: 1 });
@ -278,8 +277,7 @@ export default {
}); });
}, },
confirm1() { confirm1() {
const operate = { const operate = {};
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) { if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/ /** 上电解锁*/
@ -291,7 +289,7 @@ export default {
this.setMessage(this.$t('tip.secondConfirmTip')); this.setMessage(this.$t('tip.secondConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1; this.timeCountCommand = -1;
@ -322,7 +320,7 @@ export default {
this.setMessage(''); this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 }); this.setButtonEnable({ step: -1 });
@ -340,8 +338,7 @@ export default {
}); });
}, },
stop() { stop() {
const operate = { const operate = {};
};
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) { if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/ /** 上电解锁*/
@ -352,7 +349,7 @@ export default {
} }
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 }); this.setButtonEnable({ step: 0 });
@ -369,7 +366,7 @@ export default {
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.close.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -87,7 +87,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -103,7 +103,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -109,7 +109,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -125,7 +125,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -302,7 +302,7 @@ export default {
}, },
commandNoPopUp() { commandNoPopUp() {
const operate = { const operate = {
operation: ''
}; };
if (this.operation == OperationEvent.Switch.unlock.menu.operation) { if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -321,7 +321,7 @@ export default {
this.setMessage(this.$t('tip.firstConfirmTip')); this.setMessage(this.$t('tip.firstConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 }); this.setButtonEnable({ step: 1 });
@ -335,7 +335,7 @@ export default {
}, },
confirm1() { confirm1() {
const operate = { const operate = {
operation: ''
}; };
if (this.operation == OperationEvent.Switch.unlock.menu.operation) { if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -354,7 +354,7 @@ export default {
this.setMessage(this.$t('tip.secondConfirmTip')); this.setMessage(this.$t('tip.secondConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1; this.timeCountCommand = -1;
@ -392,7 +392,7 @@ export default {
} }
this.setMessage(''); this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 }); this.setButtonEnable({ step: -1 });
@ -428,7 +428,7 @@ export default {
} }
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 }); this.setButtonEnable({ step: 0 });
@ -445,7 +445,7 @@ export default {
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.close.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -1,18 +1,8 @@
<template> <template>
<el-dialog <el-dialog v-dialogDrag class="xian-01__systerm switch-control" :title="title" :visible.sync="show" width="300px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
v-dialogDrag
class="xian-01__systerm switch-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-row class="header">
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col> <el-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.switch') }}</span></el-col> <el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
@ -22,22 +12,12 @@
<el-input v-model="switchName" size="small" disabled /> <el-input v-model="switchName" size="small" disabled />
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="activeShow" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
{{ $t('menu.activation') }}</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
{{ $t('menu.resection') }}</el-radio>
</el-col>
</el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col> </el-col>
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button> <el-button :id="domIdCancel" @click="cancel">取消</el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
@ -48,7 +28,7 @@
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 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: 'SwitchControl', name: 'SwitchControl',
@ -62,7 +42,6 @@ export default {
operation: '', operation: '',
stationName: '', stationName: '',
switchName: '', switchName: '',
radio: 1,
activeShow: false activeShow: false
}; };
}, },
@ -78,17 +57,15 @@ export default {
}, },
title() { title() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) { if (this.operation == OperationEvent.Switch.lock.menu.operation) {
return this.$t('menu.menuSwitch.switchLock'); return '道岔单锁';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) { } else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return this.$t('menu.menuSwitch.switchBlockade'); return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) { } else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
return this.$t('menu.menuSwitch.switchTurnout'); return '道岔转动';
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
return this.$t('menu.menuSwitch.switchForcedPull');
} else if (this.operation == OperationEvent.Switch.split.menu.operation) { } else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return this.$t('menu.menuSwitch.sectionResection'); return '区段切除';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) { } else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return this.$t('menu.menuSwitch.sectionActive'); return '区段激活';
} }
return ''; return '';
} }
@ -110,15 +87,7 @@ export default {
this.stationName = station.name; this.stationName = station.name;
} }
} }
this.operation = operate.operation; this.operation = operate.operation;
if (this.operation == OperationEvent.Switch.split.menu.operation) {
this.activeShow = true;
this.radio = '2';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
this.activeShow = true;
this.radio = '1';
}
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
@ -140,9 +109,6 @@ export default {
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) { } else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
/** 道岔转动*/ /** 道岔转动*/
this.turnout(this.operation); this.turnout(this.operation);
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
/** 道岔强扳*/
this.turnoutForce();
} else if (this.operation == OperationEvent.Switch.split.menu.operation) { } else if (this.operation == OperationEvent.Switch.split.menu.operation) {
/** 区段激活*/ /** 区段激活*/
this.split(); this.split();
@ -153,127 +119,44 @@ export default {
}, },
// //
lock() { lock() {
const operate = { this.sendCommand(menuOperate.Switch.lock);
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
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);
});
}, },
// //
block() { block() {
const operate = { this.sendCommand(menuOperate.Switch.block);
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_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);
});
}, },
// //
turnout(operation) { turnout() {
const operate = { this.sendCommand(menuOperate.Switch.switchTurnout);
over: true,
operation: OperationEvent.Switch.turnout.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
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);
});
},
//
turnoutForce() {
const operate = {
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 }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
split() { split() {
const operate = { this.sendCommand(menuOperate.Switch.split);
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 }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
active() { active() {
const operate = { this.sendCommand(menuOperate.Switch.active);
over: true, },
operation: OperationEvent.Switch.active.menu.operation, sendCommand(operate) { //
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch((error) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow({}, error.message);
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -2,7 +2,7 @@
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
class="xian-01__systerm two-confirmation" class="xian-01__systerm two-confirmation"
:title="$t('menu.menuChildDialog.secondaryConfirmation')" title="二次确认"
:visible.sync="show" :visible.sync="show"
width="360px" width="360px"
:before-close="doClose" :before-close="doClose"
@ -13,16 +13,16 @@
append-to-body append-to-body
> >
<div class="context"> <div class="context">
<template v-for="(message,index) in messages"> <template v-for="(message, index) in messages">
<span :key="index">{{ message }}</span> <div :key="index">{{ message }}</div>
</template> </template>
</div> </div>
<el-row class="button-group"> <el-row class="button-group">
<el-col :span="10" :offset="3"> <el-col :span="10" :offset="3">
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.confirm') }}</el-button> <el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">确认</el-button>
</el-col> </el-col>
<el-col :span="6" :offset="4"> <el-col :span="6" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.close') }}</el-button> <el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
@ -31,7 +31,6 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -44,15 +43,26 @@ export default {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
operation: '',
operate: '', operate: '',
timer: null, timer: null
domIdConfirm: ''
}; };
}, },
computed: { computed: {
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdConfirm() {
if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
return OperationEvent.StationControl.emergencyStationControl.confirm.domId;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
} else {
return '';
}
},
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
}, },
@ -70,16 +80,8 @@ export default {
}, },
methods: { methods: {
doShow(operate) { doShow(operate) {
this.domIdConfirm = '';
if (OperationHandler.checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.forcedStationControl)) {
this.domIdConfirm = OperationEvent.StationControl.forcedStationControl.confirm.domId;
} else if (OperationHandler.checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.requestStationControl)) {
this.domIdConfirm = OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
this.domIdConfirm = OperationEvent.StationControl.requestCentralControl.confirm.domId;
}
this.operate = operate || {}; this.operate = operate || {};
this.operation = this.operate.operation;
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -91,11 +93,11 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation operation: OperationEvent.Command.close.confirm.operation
}; };
this.$emit('setOperate', { selection: this.operate.selection, cancel: true }); this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose(); this.doClose();
@ -103,39 +105,25 @@ export default {
}); });
}, },
commit() { commit() {
if (this.operate) { const operate = {
this.loading = true; over: true,
(this.operate.selection || []).forEach(elem => { operation: this.operation
const operate = { };
val: elem.code, if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
param: { operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
ControlMode_Code: elem.code } else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
} operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
}; } else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL;
if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.forcedStationControl)) {
operate.operation = OperationEvent.StationControl.forcedStationControl.confirm.operation;
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;
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();
this.$emit('setOperate', { selection: this.operate.selection, commit: true });
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
});
this.loading = false;
} }
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
} }
} }
}; };

View File

@ -50,11 +50,9 @@
</el-table> </el-table>
<el-row class="button-group"> <el-row class="button-group">
<el-col :span="10" :offset="3" class="control_button"> <el-col :span="10" :offset="3" class="control_button">
<el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">{{ $t('menu.menuDialog.forcedStationControl') }}</el-button> <el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">强制站控</el-button>
<el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">{{ $t('menu.menuDialog.requestStationControl') }} <el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">请求站控</el-button>
</el-button> <el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">请求中控</el-button>
<el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">{{ $t('menu.menuDialog.requestInTheControl') }}
</el-button>
</el-col> </el-col>
<el-col :span="6" :offset="4"> <el-col :span="6" :offset="4">
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{ $t('menu.menuDialog.close') }} <el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{ $t('menu.menuDialog.close') }}
@ -85,8 +83,8 @@ export default {
disabledClose: false, disabledClose: false,
operation: '', operation: '',
controlProps: { controlProps: {
'01': this.$t('menu.menuDialog.inTheControl'), 'Center': '中控',
'02': this.$t('menu.menuDialog.stationControl') 'Local': '站控'
}, },
selection: [], selection: [],
tableData: [], tableData: [],
@ -100,8 +98,7 @@ export default {
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationList', 'stationList'
'stationControlList'
]), ]),
...mapGetters('training', [ ...mapGetters('training', [
'mode', 'mode',
@ -209,9 +206,9 @@ export default {
} }
if (success) { if (success) {
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.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: row.control = this.controlProps['Local']; // Center: Local:
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) { } else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
row.control = this.controlProps['01']; // 01: 02: row.control = this.controlProps['Center']; // Center: Local:
} }
row.disabled = true; row.disabled = true;
row.check = false; row.check = false;
@ -238,11 +235,11 @@ export default {
checkBoxDisabled(row) { checkBoxDisabled(row) {
const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {}); const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) { if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
if (control && control.status == '02') { // 01: 02: if (control && control.controlMode == 'Local') { // Center: Local:
return true; return true;
} }
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) { } else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
if (control && control.status == '01') { // 01: 02: if (control && control.controlMode == 'Center') { // Center: Local:
return true; return true;
} }
} }
@ -250,18 +247,19 @@ export default {
}, },
loadTableData() { loadTableData() {
this.tableData = []; this.tableData = [];
if (this.stationControlList) { if (this.stationList) {
this.stationControlList.forEach(control => { this.stationList.forEach(station => {
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode); if (station.createControlMode) {
this.tableData.push({ this.tableData.push({
code: control.code, code: station.code,
operate: station.name || '', operate: station.name || '',
control: '', control: '',
check: false, check: false,
disabled: false, disabled: false,
status: this.$t('menu.menuDialog.normal'), status: '正常',
result: '' result: ''
}); });
}
}); });
} }
}, },
@ -272,7 +270,7 @@ export default {
row.result = ''; row.result = '';
const control = this.$store.getters['map/getDeviceByCode'](row.code); const control = this.$store.getters['map/getDeviceByCode'](row.code);
if (control) { if (control) {
row.control = this.controlProps[control.status]; row.control = this.controlProps[control.controlMode];
} }
}); });
}, },
@ -299,7 +297,7 @@ export default {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
@ -354,7 +352,7 @@ export default {
} }
this.disabledSure = true; this.disabledSure = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.disabledSure = false; this.disabledSure = false;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -370,7 +368,10 @@ export default {
messages: [this.$t('menu.menuDialog.confirmStationControlTip')], messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
operation: OperationEvent.StationControl.requestStationControl.menu.operation, operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: stationCodeList.join('::'), val: stationCodeList.join('::'),
selection: this.selection selection: this.selection,
param: {
stationCodes: stationCodeList
}
}; };
this.selection.forEach((elem, index) => { this.selection.forEach((elem, index) => {
@ -378,7 +379,7 @@ export default {
}); });
this.disabledSure = true; this.disabledSure = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate); this.$refs.twoConfirmation.doShow(operate);
@ -395,7 +396,10 @@ export default {
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')], messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation, operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: stationCodeList.join('::'), val: stationCodeList.join('::'),
selection: this.selection selection: this.selection,
param: {
stationCodes: stationCodeList
}
}; };
this.selection.forEach((elem, index) => { this.selection.forEach((elem, index) => {
@ -403,7 +407,7 @@ export default {
}); });
this.disabledSure = true; this.disabledSure = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate); this.$refs.twoConfirmation.doShow(operate);
@ -420,7 +424,10 @@ export default {
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')], messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation, operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: stationCodeList.join('::'), val: stationCodeList.join('::'),
selection: this.selection selection: this.selection,
param: {
stationCodes: stationCodeList
}
}; };
this.selection.forEach((elem, index) => { this.selection.forEach((elem, index) => {
@ -428,7 +435,7 @@ export default {
}); });
this.disabledSure = true; this.disabledSure = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate); this.$refs.twoConfirmation.doShow(operate);

View File

@ -15,11 +15,11 @@ import SectionCmdControl from './dialog/sectionCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl'; import SpeedCmdControl from './dialog/speedCmdControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Handler from '@/scripts/cmdPlugin/Handler';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from './utils/menuOperate';
export default { export default {
name: 'SectionMenu', name: 'SectionMenu',
@ -44,80 +44,65 @@ export default {
menuNormal: { menuNormal: {
Local: [ Local: [
{ {
label: this.$t('menu.menuSection.sectionFaultUnlock'), label: '区段封锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
{
label: this.$t('menu.menuSection.sectionResection'),
handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
{
label: this.$t('menu.menuSection.sectionActive'),
handler: this.active,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
},
{
label: this.$t('menu.menuSection.sectionAxisPreReset'),
handler: this.axlePreReset,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
},
{
label: this.$t('menu.menuSection.sectionBlockade'),
handler: this.lock, handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK cmdType: CMD.Section.CMD_SECTION_BLOCK
}, },
{ {
label: this.$t('menu.menuSection.sectionUnblock'), label: '区段解封',
handler: this.unlock, handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK cmdType: CMD.Section.CMD_SECTION_UNBLOCK
}, },
{ {
label: this.$t('menu.menuSection.sectionSetSpeedLimit'), label: '故障解锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
{
label: '设置限速',
handler: this.setSpeed, handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
}, },
{ {
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'), label: '取消限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
} }
], ],
Center: [ Center: [
{ {
label: this.$t('menu.menuSection.sectionFaultUnlock'), label: '故障解锁',
handler: this.fault, handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}, },
{ {
label: this.$t('menu.menuSection.sectionResection'), label: '区段切除',
handler: this.split, handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF cmdType: CMD.Section.CMD_SECTION_CUT_OFF
}, },
{ {
label: this.$t('menu.menuSection.sectionActive'), label: '区段激活',
handler: this.active, handler: this.active,
cmdType: CMD.Section.CMD_SECTION_ACTIVE cmdType: CMD.Section.CMD_SECTION_ACTIVE
}, },
{ {
label: this.$t('menu.menuSection.sectionBlockade'), label: '区段封锁',
handler: this.lock, handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK cmdType: CMD.Section.CMD_SECTION_BLOCK
}, },
{ {
label: this.$t('menu.menuSection.sectionUnblock'), label: '区段解封',
handler: this.unlock, handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK cmdType: CMD.Section.CMD_SECTION_UNBLOCK
}, },
{ {
label: this.$t('menu.menuSection.sectionSetSpeedLimit'), label: '设置限速',
handler: this.setSpeed, handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
}, },
{ {
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'), label: '取消限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
} }
@ -191,11 +176,11 @@ export default {
operation: OperationEvent.Section.stoppage.menu.operation, operation: OperationEvent.Section.stoppage.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ADD_FAULT, cmdType: CMD.Section.CMD_SECTION_ADD_FAULT,
param: { param: {
Section_Code: `${this.selected.code}` sectionCode: `${this.selected.code}`
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
@ -213,10 +198,10 @@ export default {
operation: OperationEvent.Section.cancelStoppage.menu.operation, operation: OperationEvent.Section.cancelStoppage.menu.operation,
cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT, cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT,
param: { param: {
Section_Code: `${this.selected.code}` sectionCode: `${this.selected.code}`
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
@ -228,140 +213,57 @@ export default {
}, },
// //
fault() { fault() {
const step = { commitOperate(menuOperate.Section.fault, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.fault.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { split() {
const step = { commitOperate(menuOperate.Section.split, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.split.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { active() {
const step = { commitOperate(menuOperate.Section.active, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.active.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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 step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.axlePreReset.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(step, this.selected);
}
});
},
//
lock() { lock() {
const step = { commitOperate(menuOperate.Section.lock, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.lock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { unlock() {
const step = { commitOperate(menuOperate.Section.unlock, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.unlock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { setSpeed() {
const step = { commitOperate(menuOperate.Section.setSpeed, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.setSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { cancelSpeed() {
const step = { commitOperate(menuOperate.Section.cancelSpeed, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.cancelSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.speedCmdControl.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

@ -15,10 +15,11 @@ import StationHumanControlAll from './dialog/stationHumanControlAll';
import StationSetRouteControlAll from './dialog/stationSetRouteControlAll'; import StationSetRouteControlAll from './dialog/stationSetRouteControlAll';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'StationMenu', name: 'StationMenu',
@ -43,56 +44,58 @@ export default {
menuNormal: { menuNormal: {
Local: [ Local: [
{ {
label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'), label: '全站设置联锁自动触发',
handler: this.setAutoTrigger, handler: this.setAutoTrigger,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER
}, },
{ {
label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'), label: '全站取消联锁自动触发',
handler: this.cancelAutoTrigger, handler: this.cancelAutoTrigger,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
} }
// { // {
// label: this.$t('menu.menuStation.powerUnLock'), // label: '',
// handler: this.powerUnLock, // handler: this.powerUnLock,
// auth: { station: true, center: false } // cmdType: CMD.Station.active,
// // cmdType: CMD.Station.
// }, // },
// { // {
// label: this.$t('menu.menuStation.execKeyOperationTest'), // label: '',
// handler: this.execKeyOperationTest, // handler: this.execKeyOperationTest,
// auth: { station: true, center: false } // cmdType: CMD.Station.active,
// // cmdType: CMD.Station.
// } // }
], ],
Center: [ Center: [
{ {
label: this.$t('menu.menuStation.allHumanControl'), label: '所有进路自排关',
handler: this.humanControlALL, handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
}, },
{ {
label: this.$t('menu.menuStation.allATSAutoControl'), label: '所有进路自排开',
handler: this.atsAutoControlALL, handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
},
{
label: '上电解锁',
handler: this.powerUnLock,
cmdType: CMD.Station.active
} }
// { // {
// label: this.$t('menu.menuStation.execKeyOperationTest'), // label: '',
// handler: this.execKeyOperationTest, // handler: this.execKeyOperationTest,
// auth: { station: false, center: true }, // cmdType: CMD.Station.active,
// cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING // auth: { station: false, center: true }
// // cmdType: CMD.Section.
// } // }
] ]
}, },
menuForce: [ menuForce: [
{ {
label: this.$t('menu.menuStation.setStoppage'), label: '设置ZC故障',
handler: this.setStoppage, handler: this.setStoppage,
cmdType: CMD.Station.CMD_STATION_ADD_FAULT cmdType: CMD.Station.CMD_STATION_ADD_FAULT
}, },
{ {
label: this.$t('menu.menuStation.cancelStoppage'), label: '取消ZC故障',
handler: this.cancelStoppage, handler: this.cancelStoppage,
cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT
} }
@ -125,24 +128,16 @@ export default {
}; };
}, },
initMenu() { initMenu() {
this.menu = []; //
if (this.selected.concentrateStationCode == this.selected.code) { this.menu = MenuContextHandler.covert(this.menuNormal);
// if (this.operatemode === OperateMode.ADMIN) {
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal); this.menu = [...this.menu, ...this.menuForce];
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
} }
if (this.selected.centralized) { //
// if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT) { this.menu = [...this.menuForce];
this.menu = [...this.menuForce];
}
} }
// this.menu = MenuContextHandler.covert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -158,149 +153,127 @@ export default {
}, },
// //
setStoppage() { setStoppage() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, send: true,
operation: OperationEvent.Station.stoppage.menu.operation, code: this.selected.code,
cmdType: CMD.Station.CMD_STOPPAGE, operation: OperationEvent.Station.stoppage.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
cancelStoppage() { cancelStoppage() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, send: true,
operation: OperationEvent.Station.cancelStoppage.menu.operation, code: this.selected.code,
cmdType: CMD.Station.CMD_CANCEL_STOPPAGE, operation: OperationEvent.Station.cancelStoppage.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
setAutoTrigger() { setAutoTrigger() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, send: true,
operation: OperationEvent.Station.setAutoTrigger.menu.operation, code: this.selected.code,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, operation: OperationEvent.Station.setAutoTrigger.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
cancelAutoTrigger() { cancelAutoTrigger() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, send: true,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation, code: this.selected.code,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
powerUnLock() { powerUnLock() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, code: this.selected.code,
operation: OperationEvent.Station.powerUnLock.menu.operation, operation: OperationEvent.Station.powerUnLock.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(step, this.selected); this.$refs.stationCmdControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
execKeyOperationTest() { execKeyOperationTest() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, code: this.selected.code,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation, operation: OperationEvent.Station.execKeyOperationTest.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(step, this.selected); this.$refs.stationCmdControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
humanControlALL() { humanControlALL() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, code: this.selected.code,
operation: OperationEvent.Station.humanControlALL.menu.operation, operation: OperationEvent.Station.humanControlALL.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationHumanControlAll.doShow(step); this.$refs.stationHumanControlAll.doShow(operate, this.selected);
} }
}); });
}, },
// //
atsAutoControlALL() { atsAutoControlALL() {
const step = { const operate = {
start: true, start: true,
code: `${this.selected.code}`, code: this.selected.code,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation, operation: OperationEvent.Station.atsAutoControlALL.menu.operation
param: {
Station_Code: `${this.selected.code}`
}
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationSetRouteControlAll.doShow(step, this.selected); this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
} }
}); });
} }

View File

@ -20,12 +20,12 @@ import StandRunLevel from './dialog/standRunLevel';
import StandStopTime from './dialog/standStopTime'; import StandStopTime from './dialog/standStopTime';
import StandDetainTrainAll from './dialog/standDetainTrainAll'; import StandDetainTrainAll from './dialog/standDetainTrainAll';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import Handler from '@/scripts/cmdPlugin/Handler';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from './utils/menuOperate';
export default { export default {
name: 'StationStandMenu', name: 'StationStandMenu',
@ -53,101 +53,76 @@ export default {
menuNormal: { menuNormal: {
Local: [ Local: [
{ {
label: this.$t('menu.menuStationStand.detainTrain'), label: '设置扣车',
handler: this.setDetainTrain, handler: this.setDetainTrain,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
}, },
{ {
label: this.$t('menu.menuStationStand.cancelDetainTrain'), label: '取消扣车',
handler: this.cancelDetainTrain, handler: this.cancelDetainTrain,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
}, },
{ {
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'), label: '强制取消扣车',
handler: this.cancelDetainTrainForce, handler: this.cancelDetainTrainForce,
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
}, },
{ {
label: this.$t('menu.menuStationStand.jumpStop'), label: '查询站台状态',
handler: this.setJumpStop,
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
},
{
label: this.$t('menu.menuStationStand.cancelJumpStop'),
handler: this.cancelJumpStop,
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
},
{
label: this.$t('menu.menuStationStand.setRunLevel'),
handler: this.setRunLevel,
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
},
{
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
handler: this.earlyDeparture,
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
},
{
label: this.$t('menu.menuStationStand.setBackStrategy'),
handler: this.setBackStrategy,
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
},
{
label: this.$t('menu.menuStationStand.getStationStandStatus'),
handler: this.detail, handler: this.detail,
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
} }
], ],
Center: [ Center: [
{ {
label: this.$t('menu.menuStationStand.detainTrain'), label: '设置扣车',
handler: this.setDetainTrain, handler: this.setDetainTrain,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
}, },
{ {
label: this.$t('menu.menuStationStand.cancelDetainTrain'), label: '取消扣车',
handler: this.cancelDetainTrain, handler: this.cancelDetainTrain,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
}, },
{ {
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'), label: '全线取消扣车',
handler: this.cancelDetainTrainAll, handler: this.cancelDetainTrainAll,
cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN
}, },
{ {
label: this.$t('menu.menuStationStand.jumpStop'), label: '设置跳停',
handler: this.setJumpStop, handler: this.setJumpStop,
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
}, },
{ {
label: this.$t('menu.menuStationStand.cancelJumpStop'), label: '取消跳停',
handler: this.cancelJumpStop, handler: this.cancelJumpStop,
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
}, },
{ {
label: this.$t('menu.menuStationStand.setStopTime'), label: '设置停站时间',
handler: this.setStopTime, handler: this.setStopTime,
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
}, },
{ {
label: this.$t('menu.menuStationStand.setRunLevel'), label: '设置运行等级',
handler: this.setRunLevel, handler: this.setRunLevel,
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
}, },
{ {
label: this.$t('menu.menuStationStand.setEarlyDeparture'), label: '设置提前发车',
handler: this.earlyDeparture, handler: this.earlyDeparture,
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
}, },
{ {
label: this.$t('menu.menuStationStand.setBackStrategy'), label: '设置折返策略',
handler: this.setBackStrategy, handler: this.setBackStrategy,
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
}, },
{ {
label: this.$t('menu.menuStationStand.getStationStandStatus'), label: '查询站台状态',
handler: this.detail, handler: this.detail,
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
} }
] ]
}, },
@ -193,17 +168,14 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]; this.menu = [...this.menu, ...this.menuForce];
} }
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce; this.menu = this.menuForce;
} }
// this.menu = MenuContextHandler.covert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -225,10 +197,10 @@ export default {
operation: OperationEvent.StationStand.stoppage.menu.operation, operation: OperationEvent.StationStand.stoppage.menu.operation,
cmdType: CMD.Stand.CMD_STAND_ADD_FAULT, cmdType: CMD.Stand.CMD_STAND_ADD_FAULT,
param: { param: {
StationStand_Code: `${this.selected.code}` standCode: `${this.selected.code}`
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
@ -246,10 +218,10 @@ export default {
operation: OperationEvent.StationStand.cancelStoppage.menu.operation, operation: OperationEvent.StationStand.cancelStoppage.menu.operation,
cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT, cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT,
param: { param: {
StationStand_Code: `${this.selected.code}` standCode: `${this.selected.code}`
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
@ -261,211 +233,90 @@ export default {
}, },
// //
setDetainTrain() { setDetainTrain() {
const step = { commitOperate(menuOperate.StationStand.setDetainTrain, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { cancelDetainTrain() {
const step = { commitOperate(menuOperate.StationStand.cancelDetainTrain, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { cancelDetainTrainForce() {
const step = { commitOperate(menuOperate.StationStand.cancelDetainTrainForce, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { cancelDetainTrainAll() {
const step = { commitOperate(menuOperate.StationStand.cancelDetainTrainAll, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { setJumpStop() {
const step = { commitOperate(menuOperate.StationStand.setJumpStop, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { cancelJumpStop() {
const step = { commitOperate(menuOperate.StationStand.cancelJumpStop, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { setStopTime() {
const step = { commitOperate(menuOperate.StationStand.setStopTime, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.standStopTime.doShow(operate, this.selected);
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(step);
}); });
}, },
// //
setRunLevel() { setRunLevel() {
const step = { commitOperate(menuOperate.StationStand.setRunLevel, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.standRunLevel.doShow(operate, this.selected);
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(step);
}); });
}, },
// //
earlyDeparture() { earlyDeparture() {
const step = { commitOperate(menuOperate.StationStand.earlyDeparture, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { setBackStrategy() {
const step = { commitOperate(menuOperate.StationStand.setBackStrategy, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.standBackStrategy.doShow(operate, this.selected);
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(step);
}); });
}, },
// //
detail() { detail() {
const step = { commitOperate(menuOperate.StationStand.detail, { standCode: this.selected.code }, 0).then(({valid, operate})=>{
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.detail.menu.operation,
param: {
StationStand_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.standDetail.doShow(operate, this.selected);
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(step);
}); });
} }
} }

View File

@ -19,6 +19,7 @@ import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from './utils/menuOperate';
export default { export default {
name: 'SwitchMenu', name: 'SwitchMenu',
@ -43,128 +44,109 @@ export default {
menuNormal: { menuNormal: {
Local: [ Local: [
{ {
label: this.$t('menu.menuSwitch.switchLock'), label: '道岔单锁',
handler: this.lock, handler: this.lock,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchUnlock'), label: '道岔单解',
handler: this.unlock, handler: this.unlock,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionBlockade'), label: '道岔封锁',
handler: this.block, handler: this.block,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_BLOCK cmdType:CMD.Switch.CMD_SWITCH_BLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionUnblock'), label: '道岔解封',
handler: this.unblock, handler: this.unblock,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchTurnout'), label: '道岔转动',
handler: this.switchTurnout, handler: this.switchTurnout,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_TURN cmdType:CMD.Switch.CMD_SWITCH_TURN
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'), label: '故障解锁',
handler: this.fault, handler: this.fault,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionAxisPreReset'), label: '计轴预复位',
handler: this.axlePreReset, handler: this.axlePreReset,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET
}, },
{ {
label: this.$t('menu.menuSwitch.sectionResection'), label: '区段切除',
handler: this.split, handler: this.split,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
}, },
{ {
label: this.$t('menu.menuSwitch.sectionActive'), label: '区段激活',
handler: this.active, handler: this.active,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'), label: '设置限速',
handler: this.setSpeed, handler: this.setSpeed,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'), label: '取消限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
auth: { station: true, center: false },
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
} }
], ],
Center: [ Center: [
{ {
label: this.$t('menu.menuSwitch.switchLock'), label: '道岔单锁',
handler: this.lock, handler: this.lock,
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchUnlock'), label: '道岔单解',
handler: this.unlock, handler: this.unlock,
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionBlockade'), label: '道岔封锁',
handler: this.block, handler: this.block,
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_BLOCK cmdType:CMD.Switch.CMD_SWITCH_BLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionUnblock'), label: '道岔解封',
handler: this.unblock, handler: this.unblock,
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchTurnout'), label: '道岔转动',
handler: this.switchTurnout, handler: this.switchTurnout,
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_TURN cmdType:CMD.Switch.CMD_SWITCH_TURN
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'), label: '故障解锁',
handler: this.fault, handler: this.fault,
auth: { station: false, center: true },
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.sectionResection'), label: '区段切除',
handler: this.split, handler: this.split,
auth: { station: true, center: true },
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
}, },
{ {
label: this.$t('menu.menuSwitch.sectionActive'), label: '区段激活',
handler: this.active, handler: this.active,
auth: { station: true, center: true },
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'), label: '设置限速',
handler: this.setSpeed, handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'), label: '取消限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
} }
@ -218,17 +200,13 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]; this.menu = [...this.menu, ...this.menuForce];
} }
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce; this.menu = this.menuForce;
} }
// this.menu = MenuContextHandler.covert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -249,7 +227,7 @@ export default {
operation: OperationEvent.Switch.stoppage.menu.operation, operation: OperationEvent.Switch.stoppage.menu.operation,
cmdType: CMD.Switch.CMD_STOPPAGE, cmdType: CMD.Switch.CMD_STOPPAGE,
param: { param: {
Switch_Code: this.selected.code switchCode: this.selected.code
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/next', step).then(({ valid }) => {
@ -269,7 +247,7 @@ export default {
operation: OperationEvent.Switch.cancelStoppage.menu.operation, operation: OperationEvent.Switch.cancelStoppage.menu.operation,
cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE,
param: { param: {
Switch_Code: this.selected.code switchCode: this.selected.code
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/next', step).then(({ valid }) => {
@ -284,198 +262,89 @@ export default {
}, },
// //
lock() { lock() {
const step = { commitOperate(menuOperate.Switch.lock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.lock.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { unlock() {
const step = { commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.unlock.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { block() {
const step = { commitOperate(menuOperate.Switch.block, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.block.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { unblock() {
const step = { commitOperate(menuOperate.Switch.unblock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.unblock.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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 step = {
start: true,
operation: OperationEvent.Switch.turnoutForce.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(step, this.selected);
} }
}); });
}, },
// //
switchTurnout() { switchTurnout() {
const step = { commitOperate(menuOperate.Switch.switchTurnout, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true, if (valid) {
operation: OperationEvent.Switch.turnout.menu.operation, this.$refs.switchControl.doShow(operate, this.selected);
param: {
Switch_Code: this.selected.code
} }
}; });
if (step.operation) {
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(step, this.selected);
}
});
}
}, },
// //
fault() { fault() {
const step = { commitOperate(menuOperate.Switch.fault, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.fault.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { axlePreReset() {
const step = { commitOperate(menuOperate.Switch.axlePreReset, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.axlePreReset.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { split() {
const step = { commitOperate(menuOperate.Switch.split, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.split.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { active() {
const step = { commitOperate(menuOperate.Switch.active, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.active.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { setSpeed() {
const step = { commitOperate(menuOperate.Switch.setSpeed, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.setSpeed.menu.operation,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (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() { cancelSpeed() {
const step = { commitOperate(menuOperate.Switch.cancelSpeed, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
start: true,
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
cmdType: CMD.Switch.CMD_CANCEL_SPEED,
param: {
Switch_Code: this.selected.code
}
};
this.$store.dispatch('training/next', step).then(({ valid, response }) => {
if (valid) { if (valid) {
const tempData = response.data; this.$refs.speedCmdControl.doShow(operate, this.selected);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
} }
}); });
} }

View File

@ -5,26 +5,41 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// 操作 // 操作
export const menuOperate = { export const menuOperate = {
Section:{ Section:{
split:{
// 区段切除
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
active:{ active:{
// 区段激活 // 区段激活
operation: OperationEvent.Section.active.menu.operation, operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE cmdType: CMD.Section.CMD_SECTION_ACTIVE
}, },
lock: {
// 区段封锁
operation: OperationEvent.Section.lock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
},
unlock: {
// 区段解封
operation: OperationEvent.Section.unlock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
},
alxeEffective:{ alxeEffective:{
// 确认计轴有效 // 确认计轴有效
operation: OperationEvent.Section.alxeEffective.menu.operation, operation: OperationEvent.Section.alxeEffective.menu.operation,
cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
}, },
split:{
// 区段切除
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
setSpeed:{ setSpeed:{
// 设置速度 // 设置速度
operation: OperationEvent.Section.setSpeed.menu.operation, operation: OperationEvent.Section.setSpeed.menu.operation,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
}, },
cancelSpeed: {
// 取消限速
operation: OperationEvent.Section.cancelSpeed.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
},
axlePreReset:{ axlePreReset:{
// 区段计轴预复位 // 区段计轴预复位
operation: OperationEvent.Section.axlePreReset.menu.operation, operation: OperationEvent.Section.axlePreReset.menu.operation,
@ -123,19 +138,25 @@ export const menuOperate = {
operation: OperationEvent.Switch.unlock.menu.operation, operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
}, },
turnoutForce:{ block: {
// 道岔强扳 // 道岔封锁
operation: OperationEvent.Switch.turnoutForce.menu.operation operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
}, },
locate:{ unblock: {
// 单操到定位 // 道岔解封
operation: OperationEvent.Switch.locate.menu.operation, operation: OperationEvent.Switch.unblock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
}, },
reverse:{ switchTurnout: {
// 单操到反位 // 道岔转动
operation: OperationEvent.Switch.reverse.menu.operation, operation: OperationEvent.Switch.turnout.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION cmdType: CMD.Switch.CMD_SWITCH_TURN
},
fault: {
// 故障解锁
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}, },
split:{ split:{
// 区段切除 // 区段切除
@ -152,10 +173,20 @@ export const menuOperate = {
operation: OperationEvent.Switch.setSpeed.menu.operation, operation: OperationEvent.Switch.setSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
}, },
cancelSpeed: {
// 取消临时限速
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
cmdType:CMD.Switch.CMD_CANCEL_SPEED
},
alxeEffective:{ alxeEffective:{
// 确认计轴有效 // 确认计轴有效
operation: OperationEvent.Switch.alxeEffective.menu.operation, operation: OperationEvent.Switch.alxeEffective.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
},
axlePreReset:{
// 计轴预复位
operation: OperationEvent.Switch.axlePreReset.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET
} }
}, },
@ -170,6 +201,16 @@ export const menuOperate = {
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
}, },
cancelDetainTrainForce: {
// 强制取消扣车
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
cmdType: CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
},
cancelDetainTrainAll: {
// 全线取消扣车
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN
},
setJumpStop:{ setJumpStop:{
// 设置跳停 // 设置跳停
operation: OperationEvent.StationStand.setJumpStop.menu.operation, operation: OperationEvent.StationStand.setJumpStop.menu.operation,
@ -203,6 +244,7 @@ export const menuOperate = {
detail:{ detail:{
// 查询站台状态 // 查询站台状态
operation: OperationEvent.StationStand.detail.menu.operation operation: OperationEvent.StationStand.detail.menu.operation
// cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
} }
}, },
StationControl:{ StationControl:{
@ -225,13 +267,16 @@ export const menuOperate = {
} }
}; };
export function commitOperate(operate, paramList, over) { export function commitOperate(operate, paramList, over, val) {
const step = { const step = {
start: true, start: true,
operation: operate.operation, operation: operate.operation,
param:{} param:{}
}; };
step.param = paramList; step.param = paramList;
if (val) {
step['val'] = val;
}
// over 0为首次操作1为中间操作2为最后操作3为直接一次性操作 // over 0为首次操作1为中间操作2为最后操作3为直接一次性操作
if (over == 0 || over == 3) { if (over == 0 || over == 3) {
const codeList = Object.values(paramList); const codeList = Object.values(paramList);

View File

@ -6,7 +6,6 @@ import store from '@/store/index_APP_TARGET';
class TransformHandle { class TransformHandle {
constructor(painter) { constructor(painter) {
this.$painter = painter; this.$painter = painter;
this.width = 1600;
this.parentLevel = painter.getParentLevel(); this.parentLevel = painter.getParentLevel();
@ -47,12 +46,9 @@ class TransformHandle {
// 更新偏移量 // 更新偏移量
updateTransform(list, opts) { updateTransform(list, opts) {
const rightWidth = 80; // 右边空余宽度 this.rect = { x: opts.x, y: opts.y, width: opts.width, height: opts.height };
this.rect = { x: 0, y: 0, width: opts.width - rightWidth, height: opts.height };
this.width = opts.width - rightWidth;
this.transform = []; this.transform = [];
list.forEach((item, index) => { list.forEach(item => {
item['offsetX'] = index * (this.width - 50) - 50;
this.transform.push(createTransform(item)); this.transform.push(createTransform(item));
}); });
this.transformAll(); this.transformAll();

View File

@ -107,7 +107,8 @@ export default {
handleUpdateScreen() { handleUpdateScreen() {
const size = { const size = {
width: this.$store.state.app.width - (this.widthLeft || 450) - 2, width: this.$store.state.app.width - (this.widthLeft || 450) - 2,
height: this.height height: this.height,
num: 3
}; };
this.$jlmap.setUpdateScreen(size); this.$jlmap.setUpdateScreen(size);
} }

View File

@ -42,30 +42,38 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="文字" name="IscsText"> <el-tab-pane label="按钮" name="IscsButton">
<iscs-text <iscs-button
ref="iscsText" ref="iscsButton"
style="width: 90%;" style="width: 90%;"
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"> @deleteDataModel="deleteDataModel"
</iscs-text> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="线段" name="IscsLine"> <el-tab-pane label="文字" name="IscsText">
<iscs-line <iscs-text
ref="iscsLine" ref="iscsText"
style="width: 90%;" style="width: 90%;"
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"> @deleteDataModel="deleteDataModel"
</iscs-line> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="矩形" name="IscsRect"> <el-tab-pane label="线段" name="IscsLine">
<iscs-rect <iscs-line
ref="iscsRect" ref="iscsLine"
style="width: 90%;" style="width: 90%;"
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"> @deleteDataModel="deleteDataModel"
</iscs-rect> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="矩形" name="IscsRect">
<iscs-rect
ref="iscsRect"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
</div> </div>
@ -77,6 +85,7 @@ import EntranceGuard from './entranceGuard';
import FasBrakeMachine from '../iscsOperate/brakeMachine'; import FasBrakeMachine from '../iscsOperate/brakeMachine';
import Staircase from '../iscsOperate/staircase'; import Staircase from '../iscsOperate/staircase';
import Escalator from '../iscsOperate/escalator'; import Escalator from '../iscsOperate/escalator';
import IscsButton from '../iscsCommonElem/button';
import IscsLine from '../iscsCommonElem/line'; import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text'; import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect'; import IscsRect from '../iscsCommonElem/rect';
@ -87,6 +96,7 @@ export default {
FasBrakeMachine, FasBrakeMachine,
Staircase, Staircase,
Escalator, Escalator,
IscsButton,
IscsLine, IscsLine,
IscsText, IscsText,
IscsRect IscsRect

View File

@ -42,6 +42,14 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="按钮" name="IscsButton">
<iscs-button
ref="iscsButton"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="文字" name="IscsText"> <el-tab-pane label="文字" name="IscsText">
<iscs-text <iscs-text
ref="iscsText" ref="iscsText"
@ -77,6 +85,7 @@ import BrakeMachine from './brakeMachine';
import TicketMachine from './ticketMachine'; import TicketMachine from './ticketMachine';
import Staircase from '../iscsOperate/staircase'; import Staircase from '../iscsOperate/staircase';
import SemiAutomaticTicketMachine from './semiAutomaticTicketMachine'; import SemiAutomaticTicketMachine from './semiAutomaticTicketMachine';
import IscsButton from '../iscsCommonElem/button';
import IscsLine from '../iscsCommonElem/line'; import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text'; import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect'; import IscsRect from '../iscsCommonElem/rect';
@ -88,6 +97,7 @@ export default {
TicketMachine, TicketMachine,
SemiAutomaticTicketMachine, SemiAutomaticTicketMachine,
Staircase, Staircase,
IscsButton,
IscsLine, IscsLine,
IscsRect, IscsRect,
IscsText IscsText

View File

@ -7,6 +7,9 @@
<el-form-item label="图形宽度" prop="width"> <el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="40" /> <el-input-number v-model="form.width" :min="40" />
</el-form-item> </el-form-item>
<el-form-item label="空调机朝右" prop="isRight">
<el-checkbox v-model="form.isRight" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x"> <el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" /> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
@ -33,6 +36,7 @@ export default {
buttonText: '立即创建', buttonText: '立即创建',
form:{ form:{
code:'', code:'',
isRight:true,
width: 40, width: 40,
x: 10, x: 10,
y: 10 y: 10
@ -69,6 +73,7 @@ export default {
this.form.width = model.width; this.form.width = model.width;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.isRight = model.isRight;
} }
} }
}, },
@ -87,6 +92,7 @@ export default {
_type: 'AirConditioner', _type: 'AirConditioner',
code: this.isUpdate ? this.form.code : getUID('AirConditioner', this.iscs.airConditionerList), code: this.isUpdate ? this.form.code : getUID('AirConditioner', this.iscs.airConditionerList),
width: this.form.width, width: this.form.width,
isRight:this.form.isRight,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('createAirConditioner', airConditionerModel); this.$emit('createAirConditioner', airConditionerModel);
@ -103,6 +109,7 @@ export default {
this.showDeleteButton = false; this.showDeleteButton = false;
this.form = { this.form = {
code:'', code:'',
isRight:true,
width: 40, width: 40,
x: 10, x: 10,
y: 10 y: 10
@ -118,6 +125,7 @@ export default {
_type: 'AirConditioner', _type: 'AirConditioner',
code: this.form.code, code: this.form.code,
width: this.form.width, width: this.form.width,
isRight:this.form.isRight,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('deleteDataModel', airConditionerModel ); this.$emit('deleteDataModel', airConditionerModel );

View File

@ -107,6 +107,14 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="按钮" name="IscsButton">
<iscs-button
ref="iscsButton"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="文字" name="IscsText"> <el-tab-pane label="文字" name="IscsText">
<iscs-text <iscs-text
ref="iscsText" ref="iscsText"
@ -149,6 +157,7 @@ import TunnelFan from './tunnelFan';
import FireDamper from './fireDamper'; import FireDamper from './fireDamper';
import SmookProofFd from './smookProofFd'; import SmookProofFd from './smookProofFd';
import VolumeControlDamper from './volumeControlDamper'; import VolumeControlDamper from './volumeControlDamper';
import IscsButton from '../iscsCommonElem/button';
import IscsLine from '../iscsCommonElem/line'; import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text'; import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect'; import IscsRect from '../iscsCommonElem/rect';
@ -169,6 +178,7 @@ export default {
SmookExhaustFd, SmookExhaustFd,
SmookProofFd, SmookProofFd,
VolumeControlDamper, VolumeControlDamper,
IscsButton,
IscsText, IscsText,
IscsRect, IscsRect,
IscsLine IscsLine
@ -180,6 +190,12 @@ export default {
enabledTab: 'FrozenPump' enabledTab: 'FrozenPump'
}; };
}, },
watch: {
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
this.enabledTab = model._type;
}
},
mounted() { mounted() {
this.$emit('iscsChange', this.$route.params.id); this.$emit('iscsChange', this.$route.params.id);
}, },

View File

@ -7,6 +7,9 @@
<el-form-item label="图形宽度" prop="width"> <el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="40" /> <el-input-number v-model="form.width" :min="40" />
</el-form-item> </el-form-item>
<el-form-item label="排风机朝右" prop="isRight">
<el-checkbox v-model="form.isRight" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x"> <el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" /> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
@ -33,6 +36,7 @@ export default {
buttonText: '立即创建', buttonText: '立即创建',
form:{ form:{
code:'', code:'',
isRight:true,
width: 40, width: 40,
x: 10, x: 10,
y: 10 y: 10
@ -69,6 +73,7 @@ export default {
this.form.width = model.width; this.form.width = model.width;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.isRight = model.isRight;
} }
} }
}, },
@ -87,6 +92,7 @@ export default {
_type: 'Ventilator', _type: 'Ventilator',
code: this.isUpdate ? this.form.code : getUID('Ventilator', this.iscs.ventilatorList), code: this.isUpdate ? this.form.code : getUID('Ventilator', this.iscs.ventilatorList),
width: this.form.width, width: this.form.width,
isRight:this.form.isRight,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('createVentilator', chillerModel); this.$emit('createVentilator', chillerModel);
@ -103,6 +109,7 @@ export default {
this.showDeleteButton = false; this.showDeleteButton = false;
this.form = { this.form = {
code:'', code:'',
isRight:true,
width: 40, width: 40,
x: 10, x: 10,
y: 10 y: 10
@ -118,6 +125,7 @@ export default {
_type: 'Ventilator', _type: 'Ventilator',
code: this.form.code, code: this.form.code,
width: this.form.width, width: this.form.width,
isRight:this.form.isRight,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('deleteDataModel', chillerModel ); this.$emit('deleteDataModel', chillerModel );

View File

@ -7,6 +7,12 @@
<el-form-item label="图形宽度" prop="width"> <el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="20" /> <el-input-number v-model="form.width" :min="20" />
</el-form-item> </el-form-item>
<el-form-item label="旋转角度" prop="rotateAngle">
<el-select v-model="form.rotateAngle" placeholder="请选择类型">
<el-option label="0度" value="0" />
<el-option label="90度" value="90" />
</el-select>
</el-form-item>
<el-form-item label="X轴坐标" prop="x"> <el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" /> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
@ -33,6 +39,7 @@ export default {
buttonText: '立即创建', buttonText: '立即创建',
form:{ form:{
code:'', code:'',
rotateAngle:'0',
width: 20, width: 20,
x: 10, x: 10,
y: 10 y: 10
@ -69,6 +76,7 @@ export default {
this.form.width = model.width; this.form.width = model.width;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.rotateAngle = model.rotateAngle;
} }
} }
}, },
@ -87,6 +95,7 @@ export default {
_type: 'VolumeControlDamper', _type: 'VolumeControlDamper',
code: this.isUpdate ? this.form.code : getUID('VolumeControlDamper', this.iscs.volumeControlDamperList), code: this.isUpdate ? this.form.code : getUID('VolumeControlDamper', this.iscs.volumeControlDamperList),
width: this.form.width, width: this.form.width,
rotateAngle:this.form.rotateAngle,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('createDataModel', newModel); this.$emit('createDataModel', newModel);
@ -103,6 +112,7 @@ export default {
this.showDeleteButton = false; this.showDeleteButton = false;
this.form = { this.form = {
code:'', code:'',
rotateAngle:'0',
width: 20, width: 20,
x: 10, x: 10,
y: 10 y: 10
@ -118,6 +128,7 @@ export default {
_type: 'VolumeControlDamper', _type: 'VolumeControlDamper',
code: this.form.code, code: this.form.code,
width: this.form.width, width: this.form.width,
rotateAngle:this.form.rotateAngle,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('deleteDataModel', newModel ); this.$emit('deleteDataModel', newModel );

View File

@ -10,9 +10,9 @@
<el-form-item label="扶梯朝右" prop="isRight"> <el-form-item label="扶梯朝右" prop="isRight">
<el-checkbox v-model="addModel.isRight" /> <el-checkbox v-model="addModel.isRight" />
</el-form-item> </el-form-item>
<el-form-item label="旋转角度"> <el-form-item label="旋转角度">
<el-input-number v-model="addModel.rotationAngle"></el-input-number> <el-input-number v-model="addModel.rotationAngle" />
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标" prop="x"> <el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="addModel.x" /> <el-input-number v-model="addModel.x" />
</el-form-item> </el-form-item>

View File

@ -1,11 +1,28 @@
<template> <template>
<div class="bigSystemBox"> <div class="bigSystemBox">
<div class="title-name">{{ $route.query.stationName }}机电大系统</div> <div class="title-name">{{ $route.query.stationName }}机电大系统</div>
<div class="">
<iscsSystem ref="iscsPlate" :width-canvas="1150" :canvas-height="650" />
</div>
</div> </div>
</template> </template>
<script> <script>
import iscsSystem from '../canvas/iscsCanvas';
export default { export default {
components: {
iscsSystem
},
data() {
return {
mes: '1111'
};
},
mounted() {
this.$refs.iscsPlate.show('21');
},
methods: {
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -0,0 +1,36 @@
<template>
<div class="bigSystemBox">
<div class="title-name">{{ $route.query.stationName }}机电小系统</div>
<div class="">
<iscsSystem ref="iscsPlate" :width-canvas="1300" :canvas-height="650" />
</div>
</div>
</template>
<script>
import iscsSystem from '../canvas/iscsCanvas';
export default {
components: {
iscsSystem
},
data() {
return {
mes: '1111'
};
},
mounted() {
this.$refs.iscsPlate.show('22');
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.title-name{
width: 100%;
text-align: center;
font-size: 26px;
margin-top: 30px;
color: #56E5DE;
}
</style>

View File

@ -26,6 +26,7 @@
<doorFG v-else-if="mode === 'doorFG'" /> <doorFG v-else-if="mode === 'doorFG'" />
<sensor v-else-if="mode==='sensor'" /> <sensor v-else-if="mode==='sensor'" />
<big-system v-else-if="mode==='bigSystem'" /> <big-system v-else-if="mode==='bigSystem'" />
<small-system v-else-if="mode==='smallSystem'" />
<graphic-ele ref="graphicEle" /> <graphic-ele ref="graphicEle" />
<device-control ref="deviceControl" /> <device-control ref="deviceControl" />
</div> </div>
@ -57,6 +58,7 @@ import standACS from './acs/standACS';
import doorFG from './fg/doorFG'; import doorFG from './fg/doorFG';
import Sensor from './bas/sensor'; import Sensor from './bas/sensor';
import BigSystem from './bas/bigSystem'; import BigSystem from './bas/bigSystem';
import SmallSystem from './bas/smallSystem';
import GraphicEle from './graphicEle'; import GraphicEle from './graphicEle';
import DeviceControl from './deviceControl'; import DeviceControl from './deviceControl';
@ -89,6 +91,7 @@ export default {
Sensor, Sensor,
GraphicEle, GraphicEle,
DeviceControl, DeviceControl,
SmallSystem,
BigSystem BigSystem
}, },
data() { data() {