泰国项目调整
This commit is contained in:
parent
b898aee79a
commit
03be9f8f75
@ -5,6 +5,8 @@
|
||||
<station-control-convert ref="stationControlConvert" :work="'localWork'" />
|
||||
<view-name ref="viewName" />
|
||||
<train-operation ref="trainOperation" />
|
||||
<switch-control ref="switchControl" />
|
||||
<signal-control ref="signalControl" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -18,6 +20,8 @@ import ViewName from './menuDialog/viewName';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import StationControlConvert from './menuDialog/stationControlConvert';
|
||||
import TrainOperation from './menuDialog/trainOperation';
|
||||
import SwitchControl from './menuDialog/switchControl';
|
||||
import SignalControl from './menuDialog/signalControl';
|
||||
|
||||
export default {
|
||||
name: 'CtcWorkMenuBar',
|
||||
@ -26,7 +30,9 @@ export default {
|
||||
TrainFixedPathPane,
|
||||
ViewName,
|
||||
StationControlConvert,
|
||||
TrainOperation
|
||||
TrainOperation,
|
||||
SwitchControl,
|
||||
SignalControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -143,11 +149,27 @@ export default {
|
||||
EventBus.$emit('bottomTableShowOrHidden', false);
|
||||
},
|
||||
methods: {
|
||||
handleSignalOperate(operate) {
|
||||
|
||||
handleSignalOperate(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.signalControl.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSwitchOperate(operate) {
|
||||
|
||||
handleSwitchOperate(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
turnToStationControl(order) {
|
||||
const operate = {
|
||||
|
@ -777,6 +777,9 @@ export default {
|
||||
// CHANGE_DIRECTION
|
||||
selectedChange() {
|
||||
// 按钮按下时
|
||||
if (!this.selected) {
|
||||
return;
|
||||
}
|
||||
const model = this.selected; // 选择设备
|
||||
if (this.selected._event !== MouseEvent.Left || (!model._type && !model._code)) {
|
||||
return;
|
||||
|
177
src/jmapNew/theme/datie_02/menus/menuDialog/signalControl.vue
Normal file
177
src/jmapNew/theme/datie_02/menus/menuDialog/signalControl.vue
Normal file
@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
style="pointer-events: none"
|
||||
z-index="2008"
|
||||
class="chengdou-03__systerm switch-control __menuButton"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="350px"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="4"><span>Signal</span></el-col>
|
||||
<el-col :span="18" :offset="2">
|
||||
<el-select v-model="selected" disabled filterable placeholder="Please select">
|
||||
<el-option
|
||||
v-for="item in signalList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="closeRadio" label="1" :disabled="closeRadio == 2" style="display: block; text-align: center;">
|
||||
Signal close</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="closeRadio" label="2" :disabled="closeRadio == 1" style="display: block; text-align: center;">
|
||||
Signal reopen</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">Confirm</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">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 OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
closeRadio: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.signalClose.mbar.operation) {
|
||||
return 'Signal close';
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.mbar.operation) {
|
||||
return 'Signal reopen';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device && device.code && device._type === 'Signal' && this.show) {
|
||||
this.selected = device.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.selected = null;
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
if (this.operation == OperationEvent.Signal.signalClose.mbar.operation) {
|
||||
this.closeRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.mbar.operation) {
|
||||
this.closeRadio = '2';
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.signalClose.mbar.operation) {
|
||||
this.signalClose();
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.mbar.operation) {
|
||||
this.reopenSignal();
|
||||
}
|
||||
},
|
||||
signalClose() {
|
||||
this.sendCommand(menuOperate.Signal.signalClose);
|
||||
},
|
||||
reopenSignal() {
|
||||
this.sendCommand(menuOperate.Signal.reopenSignal);
|
||||
},
|
||||
|
||||
sendCommand(operate) {
|
||||
this.loading = true;
|
||||
commitOperate(operate, {signalCode: this.selected}, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
console.error(error);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.__menuButton {
|
||||
.el-dialog,
|
||||
.el-dialog__wrapper {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__body {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,89 +1,90 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="switch-control"
|
||||
:class="popClass"
|
||||
style="pointer-events: none"
|
||||
z-index="2008"
|
||||
class="chengdou-03__systerm switch-control __menuButton"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
width="350px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>道岔</span></el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
<el-col :span="4"><span>Turnout</span></el-col>
|
||||
<el-col :span="18" :offset="2">
|
||||
<el-select v-model="selected" disabled filterable placeholder="Please select">
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isLock" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;">
|
||||
道岔单锁</el-radio>
|
||||
<el-radio v-model="lockRadio" label="1" :disabled="lockRadio == 2" style="display: block; text-align: center;">
|
||||
Turnout lock</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
|
||||
道岔解单锁</el-radio>
|
||||
<el-radio v-model="lockRadio" label="2" :disabled="lockRadio == 1" style="display: block; text-align: center;">
|
||||
Turnout unlock</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isTurnBlock" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="turnRadio" label="1" :disabled="turnRadio == 2" style="display: block; text-align: center;">
|
||||
道岔定位</el-radio>
|
||||
Turnout normal</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="turnRadio" label="2" :disabled="turnRadio == 1" style="display: block; text-align: center;">
|
||||
道岔反位</el-radio>
|
||||
Turnout reverse</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">Confirm</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">Cancel</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
<notice-info ref="noticeInfo" :pop-class="'chengdou-03__systerm'" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/dialog/childDialog/noticeInfo';
|
||||
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
popClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
isLock: false,
|
||||
isTurnBlock: false,
|
||||
isActive: false,
|
||||
turnRadio: '1',
|
||||
lockRadio: '1',
|
||||
activeRadio: '1'
|
||||
lockRadio: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'switchList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
@ -94,44 +95,45 @@ export default {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.lock.mBar.operation) {
|
||||
return 'Turnout lock';
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.mbar.operation) {
|
||||
return 'Turnout unlock';
|
||||
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
return 'Turnout locate';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.locate.mbar.operation) {
|
||||
return 'Turnout normal';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.mbar.operation) {
|
||||
return 'Turnout reverse';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device && device.code && device._type === 'Switch' && this.show) {
|
||||
this.selected = device.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
doShow(operate) {
|
||||
this.selected = null;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.operation = operate.operation;
|
||||
this.isLock = false;
|
||||
this.isTurnBlock = false;
|
||||
this.isActive = false;
|
||||
if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.locate.mbar.operation) {
|
||||
this.isTurnBlock = true;
|
||||
this.turnRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.mbar.operation) {
|
||||
this.isTurnBlock = true;
|
||||
this.turnRadio = '2';
|
||||
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.lock.mBar.operation) {
|
||||
this.isLock = true;
|
||||
this.lockRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.mbar.operation) {
|
||||
this.isLock = true;
|
||||
this.lockRadio = '2';
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
@ -142,18 +144,16 @@ export default {
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.lock.mBar.operation) {
|
||||
this.lock(); // 道岔单锁
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
this.block(); // 道岔封锁
|
||||
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.unlock.mbar.operation) {
|
||||
this.unlock(); // 道岔解锁
|
||||
} else if (this.operation == OperationEvent.Switch.locate.mbar.operation) {
|
||||
this.locate(); // 道岔定位
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.mbar.operation) {
|
||||
this.reverse(); // 道岔反位
|
||||
}
|
||||
},
|
||||
@ -161,9 +161,9 @@ export default {
|
||||
lock() {
|
||||
this.sendCommand(menuOperate.Switch.lock);
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
this.sendCommand(menuOperate.Switch.block);
|
||||
// 道岔解锁
|
||||
unlock() {
|
||||
this.sendCommand(menuOperate.Switch.unlock);
|
||||
},
|
||||
// 道岔定位
|
||||
locate() {
|
||||
@ -176,7 +176,7 @@ export default {
|
||||
|
||||
sendCommand(operate) {
|
||||
this.loading = true;
|
||||
commitOperate(operate, {}, 2).then(({valid})=>{
|
||||
commitOperate(operate, {switchCode: this.selected}, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
@ -188,24 +188,6 @@ export default {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
sendCommandNext(operate) {
|
||||
const that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that.loading = true;
|
||||
commitOperate(operate, {}, 1).then(({valid})=>{
|
||||
that.loading = false;
|
||||
if (valid) {
|
||||
that.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
resolve({...operate});
|
||||
}
|
||||
}).catch((error) => {
|
||||
that.loading = false;
|
||||
that.doClose();
|
||||
console.error(error);
|
||||
that.$refs.noticeInfo.doShow();
|
||||
});
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
@ -221,3 +203,16 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.__menuButton {
|
||||
.el-dialog,
|
||||
.el-dialog__wrapper {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__body {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user