成都三号线添加站后折返操作
This commit is contained in:
parent
5b1362f94b
commit
529c122278
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm stand-run-level"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="font-size: 16px; margin-bottom: 5px;">变通节点</div>
|
||||
<div style="margin-bottom: 5px;">
|
||||
<el-input v-model="stationName" size="mini" disabled />
|
||||
</div>
|
||||
<div style="font-size: 16px; margin-bottom: 5px;">当前变通策略</div>
|
||||
<div style="margin-bottom: 5px;">
|
||||
<el-input v-model="stationStrategy" size="mini" disabled />
|
||||
</div>
|
||||
<div style="font-size: 16px; margin-bottom: 5px;">变通策略选项</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="strategyList"
|
||||
border
|
||||
:cell-style="tableStyle"
|
||||
style="width: 100%; margin-top:10px"
|
||||
size="mini"
|
||||
height="180"
|
||||
highlight-current-row
|
||||
:show-header="false"
|
||||
@row-click="clickEvent"
|
||||
>
|
||||
<el-table-column :id="domIdChoose" prop="label" style="margin-left:30px" />
|
||||
</el-table>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'StandBackStrategy',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
strategyList: [],
|
||||
stationName: '',
|
||||
stationStrategy: '',
|
||||
selection: [],
|
||||
isConfirm: false,
|
||||
strategyId: '',
|
||||
tableStyle: {
|
||||
'border-bottom': 'none'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.setBackStrategy.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Station.setBackStrategy.choose.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '策略选择';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
const name = selected.optionList.find(ele => ele.id == selected.tbStrategyId).label;
|
||||
this.stationName = selected.name || '';
|
||||
this.stationStrategy = selected.tbStrategyId ? name : '无策略折返'; // 当前默认折返策略
|
||||
this.strategyList = selected.optionList; // 策略列表
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
clickEvent(row, column, event) {
|
||||
const operate = {
|
||||
operation: OperationEvent.Station.setBackStrategy.choose.operation
|
||||
};
|
||||
this.strategyId = row.id;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
this.loading = true;
|
||||
commitOperate(menuOperate.StationControl.setBackStrategy, {id: this.strategyId}, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -8,6 +8,7 @@
|
||||
<menu-section ref="menuSection" :selected="selected" :work="'dispatchWork'" />
|
||||
<menu-station ref="menuStation" :selected="selected" :work="'dispatchWork'" />
|
||||
<menu-train ref="menuTrain" :selected="selected" :work="'dispatchWork'" />
|
||||
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" :work="'dispatchWork'" />
|
||||
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" pop-class="chengdou-03__systerm" />
|
||||
@ -24,6 +25,7 @@ import MenuSwitch from './menuSwitch';
|
||||
import MenuSection from './menuSection';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuTrain from './menuTrain';
|
||||
import MenuStationTurnBack from './menuStationTurnBack.vue';
|
||||
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
@ -40,7 +42,8 @@ export default {
|
||||
MenuTrain,
|
||||
PassiveAlarm,
|
||||
PassiveContorl,
|
||||
PassiveTimeout
|
||||
PassiveTimeout,
|
||||
MenuStationTurnBack
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
|
105
src/jmapNew/theme/chengdu_03/menus/menuStationTurnBack.vue
Normal file
105
src/jmapNew/theme/chengdu_03/menus/menuStationTurnBack.vue
Normal file
@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<station-back-strategy ref="stationBackStrategy" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import StationBackStrategy from './dialog/stationBackStrategy';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'MenuStationTurnBack',
|
||||
components: {
|
||||
PopMenu,
|
||||
StationBackStrategy
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
work: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: [
|
||||
{
|
||||
label: '设置折返策略',
|
||||
handler: this.setBackStrategy,
|
||||
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
|
||||
}
|
||||
],
|
||||
menuForce: [
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationTurnBack) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = [];
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
if (this.menu && this.menu.length > 0) {
|
||||
this.setBackStrategy();
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
commitOperate(menuOperate.StationControl.setBackStrategy, {stationCode: this.selected.stationCode}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.stationBackStrategy.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user