道岔公共组件提取

This commit is contained in:
zyy 2020-06-17 17:48:19 +08:00
parent a047c9996e
commit c35ceb948c
20 changed files with 160 additions and 1814 deletions

View File

@ -1,202 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-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-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isActive" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="activeRadio" label="1" :disabled="activeRadio == 2" style="display: block; text-align: center;">
激活</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="activeRadio" label="2" :disabled="activeRadio == 1" style="display: block; text-align: center;">
切除</el-radio>
</el-col>
</el-row>
<el-row v-if="isLock" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="lockRadio" label="1" disabled style="display: block; text-align: center;">
道岔单锁</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="lockRadio" label="2" style="display: block; text-align: center;">
道岔解锁</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
// import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
isActive: false,
isLock: false,
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: '',
lockRadio: '1',
activeRadio: '1'
};
},
computed: {
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.Switch.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔解锁';
} else {
return '';
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
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.isActive = false;
this.isLock = false;
if (this.operation == OperationEvent.Switch.split.menu.operation) {
this.isActive = true;
this.activeRadio = '2';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
this.isActive = true;
this.activeRadio = '1';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
this.isLock = true;
this.lockRadio = '2';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Switch.split.menu.operation) {
/** 区段激活*/
this.split();
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
/** 区段激活*/
this.active();
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
/** 道岔单解*/
this.unlock();
}
},
//
unlock() {
this.sendCommand(menuOperate.Switch.unlock);
},
//
split() {
this.sendCommand(menuOperate.Switch.split);
},
//
active() {
this.sendCommand(menuOperate.Switch.active);
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
}
}
};
</script>

View File

@ -2,7 +2,7 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" pop-class="beijing-01__systerm" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
@ -12,7 +12,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';

View File

@ -1,218 +0,0 @@
<template>
<el-dialog v-dialogDrag class="chengdou-01__system 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-col :span="11"><span style="color:#000;">车站名称</span></el-col>
<el-col :span="11" :offset="2"><span style="color:#000;">道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
mixins: [
CancelMouseState
],
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: ''
};
},
computed: {
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.Switch.locate.menu.operation) {
return '单操到定位';
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
return '单操到反位';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
return '道岔单锁';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔解锁';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
return '道岔解封';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
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.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.Switch.locate.menu.operation) {
this.locate(); //
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
this.reverse(); //
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
this.unlock(); //
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
this.block(); //
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
this.unblock(); //
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
this.fault();
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.sendCommand(operate);
},
//
unlock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
};
this.sendCommand(operate);
},
//
block() {
const operate = {
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.sendCommand(operate);
},
//
unblock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unblock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
};
this.sendCommand(operate);
},
//
locate() {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
this.sendCommand(operate);
},
//
reverse() {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
this.sendCommand(operate);
},
//
fault() {
const operate = {
over: true,
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
};
this.sendCommand(operate);
},
sendCommand(operate) { //
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -2,7 +2,7 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<notice-info ref="noticeInfo" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" pop-class="chengdou-01__system" />
<create-device-label ref="createDeviceLabel" />
</div>
</template>
@ -11,7 +11,7 @@
import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CreateDeviceLabel from './dialog/createDeviceLabel';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import CancelMouseState from '@/mixin/CancelMouseState';
import { mapGetters } from 'vuex';

View File

@ -1,249 +0,0 @@
<template>
<el-dialog v-dialogDrag class="chengdou-03__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-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
<password-box ref="passwordBox" @checkOver="passWordCommit" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import PasswordBox from './childDialog/passwordInputBox';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchControl',
components: {
NoticeInfo,
PasswordBox
},
mixins: [
CancelMouseState
],
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: ''
};
},
computed: {
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.Switch.locate.menu.operation) {
return '单操到定位';
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
return '单操到反位';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
return '道岔单锁';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔解锁';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
return '道岔解封';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
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.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.Switch.locate.menu.operation) {
this.locate(); //
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
this.reverse(); //
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
this.unlock(); //
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
this.openPasswordBox(this.operation, OperationEvent.Switch.block.confirm.operation); //
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
this.openPasswordBox(this.operation, OperationEvent.Switch.unblock.confirm.operation); //
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
this.openPasswordBox(this.operation, OperationEvent.Switch.fault.confirm.operation); //
}
},
passWordCommit(data) { //
if (data.operation === OperationEvent.Switch.fault.menu.operation) {
this.fault();
} else if (data.operation === OperationEvent.Switch.block.menu.operation) {
this.block();
} else if (data.operation === OperationEvent.Switch.unblock.menu.operation) {
this.unblock();
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.sendCommand(operate);
},
//
unlock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
};
this.sendCommand(operate);
},
//
block() {
const operate = {
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.sendCommand(operate);
},
//
unblock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unblock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
};
this.sendCommand(operate);
},
//
locate() {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
this.sendCommand(operate);
},
//
reverse() {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
this.sendCommand(operate);
},
//
fault() {
const operate = {
over: true,
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
};
this.sendCommand(operate);
},
//
openPasswordBox(operation, operateNext) {
const operate = {
operation: operation,
operateNext: operateNext
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
sendCommand(operate) { //
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -2,7 +2,7 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" pop-class="chengdou-03__systerm" />
<notice-info ref="noticeInfo" />
</div>
</template>
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import CancelMouseState from '@/mixin/CancelMouseState';

View File

@ -1,7 +1,7 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm"
:class="popClass"
:visible.sync="show"
width="360px"
:before-close="doClose"
@ -81,6 +81,12 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'PasswordBox',
props: {
popClass: {
type: String,
default: ''
}
},
data() {
return {
correctPassword: '123', //

View File

@ -1,7 +1,8 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm switch-control"
class="switch-control"
:class="popClass"
:title="title"
:visible.sync="show"
width="300px"
@ -22,7 +23,7 @@
<el-input v-model="switchName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isActive" style="margin-top: 10px;">
<el-row v-if="isActive && (popClass == 'ningbo-01__systerm' || popClass == 'fuzhou-01__systerm' || popClass == 'beijing-01__systerm')" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="activeRadio" label="1" :disabled="activeRadio == 2" style="display: block; text-align: center;">
激活</el-radio>
@ -32,7 +33,7 @@
切除</el-radio>
</el-col>
</el-row>
<el-row v-if="isLock" style="margin-top: 10px;">
<el-row v-if="isLock && (popClass == 'ningbo-01__systerm' || popClass == 'foshan-01__systerm' || popClass == 'beijing-01__systerm')" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;">
道岔单锁</el-radio>
@ -42,7 +43,7 @@
道岔解单锁</el-radio>
</el-col>
</el-row>
<el-row v-if="isTurnBlock" style="margin-top: 10px;">
<el-row v-if="isTurnBlock && (popClass == 'ningbo-01__systerm' || popClass == 'foshan-01__systerm' || popClass == 'beijing-01__systerm')" 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>
@ -60,21 +61,30 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
<notice-info ref="noticeInfo" :pop-class="popClass" />
<password-box ref="passwordBox" :pop-class="popClass" @checkOver="passWordCommit" />
</el-dialog>
</template>
<script>
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import NoticeInfo from '../childDialog/noticeInfo';
import PasswordBox from '../childDialog/passwordInputBox';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
NoticeInfo,
PasswordBox
},
props: {
popClass: {
type: String,
default: ''
}
},
data() {
return {
@ -104,7 +114,13 @@ export default {
},
title() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
return '道岔控制';
return '道岔单锁';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔解锁';
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
return '道岔解封';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.locate.menu.operation || this.operation == OperationEvent.Switch.reverse.menu.operation) {
@ -112,9 +128,11 @@ export default {
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
return '道岔强扳';
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return '区段控制';
return '区段切除';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段控制';
return '区段激活';
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
return '道岔转动';
}
return '';
}
@ -170,23 +188,27 @@ export default {
},
commit() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
/** 道岔单锁*/
this.lock();
this.lock(); //
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
/** 道岔封锁*/
this.block();
this.block(); //
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
/** 道岔定位*/
this.locate();
this.locate(); //
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
/** 道岔反位*/
this.reverse();
this.reverse(); //
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
/** 区段切除*/
this.split();
this.split(); //
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
/** 区段激活*/
this.active();
this.active(); //
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
this.turnout(this.operation); //
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
this.unlock(); //
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
this.unblock(); //
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
this.fault(); //
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
this.turnoutForce(); //
}
},
//
@ -195,12 +217,22 @@ export default {
},
//
block() {
this.sendCommand(menuOperate.Switch.block);
switch (this.popClass) {
case 'chengdou-03__systerm':
this.openPasswordBox(this.operation);
break;
default: this.sendCommand(menuOperate.Switch.block);
}
},
//
locate() {
this.sendCommand(menuOperate.Switch.locate);
},
//
turnout() {
this.sendCommand(menuOperate.Switch.turnout);
},
//
reverse() {
this.sendCommand(menuOperate.Switch.reverse);
@ -213,19 +245,62 @@ export default {
active() {
this.sendCommand(menuOperate.Switch.active);
},
cancel() {
//
unlock() {
this.sendCommand(menuOperate.Switch.unlock);
},
//
unblock() {
switch (this.popClass) {
case 'chengdou-03__systerm':
this.openPasswordBox(this.operation);
break;
default: this.sendCommand(menuOperate.Switch.unblock);
}
},
//
fault() {
switch (this.popClass) {
case 'chengdou-03__systerm':
this.openPasswordBox(this.operation);
break;
default: this.sendCommand(menuOperate.Switch.fault);
}
},
//
turnoutForce() {
this.sendCommand(menuOperate.Switch.turnoutForce);
},
//
openPasswordBox(operation) {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
operation: operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
passWordCommit(data) { //
if (data.operation === OperationEvent.Switch.fault.menu.operation) {
this.sendCommand(menuOperate.Switch.fault);
} else if (data.operation === OperationEvent.Switch.block.menu.operation) {
this.sendCommand(menuOperate.Switch.block);
} else if (data.operation === OperationEvent.Switch.unblock.menu.operation) {
this.sendCommand(menuOperate.Switch.unblock);
}
},
sendCommand(operate) {
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
@ -238,6 +313,19 @@ export default {
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};

View File

@ -105,6 +105,16 @@ export const menuOperate = {
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
block: {
// 道岔封锁
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
},
unblock:{
// 道岔解封
operation: OperationEvent.Switch.unblock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
},
turnoutForce:{
// 道岔强扳
operation: OperationEvent.Switch.turnoutForce.menu.operation
@ -138,8 +148,17 @@ export const menuOperate = {
// 确认计轴有效
operation: OperationEvent.Switch.alxeEffective.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
},
turnout: {
// 道岔转动
operation: OperationEvent.Switch.turnout.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
},
fault:{
// 区段故障解锁
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}
},
StationStand:{
setDetainTrain:{

View File

@ -1,237 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="foshan-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-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</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-col>
<el-col :span="11" :offset="2">
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
道岔解单锁</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>
</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>
</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: '',
isLock: false,
isTurnBlock: false,
turnRadio: '1',
lockRadio: '1',
activeRadio: '1'
};
},
computed: {
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.Switch.lock.menu.operation) {
return '道岔控制';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.locate.menu.operation || this.operation == OperationEvent.Switch.reverse.menu.operation) {
return '道岔控制';
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
return '道岔强扳';
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
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;
if (this.operation == OperationEvent.Switch.locate.menu.operation) {
this.isTurnBlock = true;
this.turnRadio = '1';
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
this.isTurnBlock = true;
this.turnRadio = '2';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.isLock = true;
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
/** 道岔单锁*/
this.lock();
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
/** 道岔封锁*/
this.block();
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
/** 道岔定位*/
this.locate();
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
/** 道岔反位*/
this.reverse();
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.sendCommand(operate);
},
//
block() {
const operate = {
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.sendCommand(operate);
},
//
locate() {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
};
this.sendCommand(operate);
},
//
reverse() {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
};
this.sendCommand(operate);
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" pop-class="foshan-01__systerm" />
<switch-un-lock ref="switchUnLock" />
<speed-limit-control ref="speedLimitControl" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SwitchUnLock from './dialog/switchUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';

View File

@ -1,206 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-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-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.switch') }}</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</el-col>
</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-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { menuOperate, commitOperate } from '../utils/menuOperate';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
switchName: '',
radio: 1,
activeShow: false
};
},
computed: {
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.Switch.lock.menu.operation) {
return this.$t('menu.menuSwitch.switchLock');
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return this.$t('menu.menuSwitch.switchBlockade');
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
return this.$t('menu.menuSwitch.switchTurnout');
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
return this.$t('menu.menuSwitch.switchForcedPull');
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return this.$t('menu.menuSwitch.sectionResection');
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return this.$t('menu.menuSwitch.sectionActive');
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
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;
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.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
/** 道岔单锁*/
this.lock();
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
/** 道岔封锁*/
this.block();
} else if (this.operation == OperationEvent.Switch.turnout.menu.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) {
/** 区段激活*/
this.split();
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
/** 区段激活*/
this.active();
}
},
//
lock() {
this.sendCommand(menuOperate.Switch.lock);
},
//
block() {
this.sendCommand(menuOperate.Switch.block);
},
//
turnout() {
this.sendCommand(menuOperate.Switch.turnout);
},
//
turnoutForce() {
this.sendCommand(menuOperate.Switch.turnoutForce);
},
//
split() {
this.sendCommand(menuOperate.Switch.split);
},
//
active() {
this.sendCommand(menuOperate.Switch.active);
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(error.message);
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" pop-class="fuzhou-01__systerm" />
<switch-cmd-control ref="switchCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
@ -10,13 +10,13 @@
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';

View File

@ -1,219 +0,0 @@
<template>
<el-dialog v-dialogDrag class="haerbin-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-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
mixins: [
CancelMouseState
],
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: ''
};
},
computed: {
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.Switch.locate.menu.operation) {
return '单操到定位';
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
return '单操到反位';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
return '道岔单锁';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔解锁';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
return '道岔解封';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
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.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.Switch.locate.menu.operation) {
this.locate(); //
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
this.reverse(); //
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
this.unlock(); //
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
this.block(); //
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
this.unblock(); //
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
this.fault();
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.sendCommand(operate);
},
//
unlock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
};
this.sendCommand(operate);
},
//
block() {
const operate = {
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.sendCommand(operate);
},
//
unblock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unblock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
};
this.sendCommand(operate);
},
//
locate() {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
};
this.sendCommand(operate);
},
//
reverse() {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
};
this.sendCommand(operate);
},
//
fault() {
const operate = {
over: true,
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
};
this.sendCommand(operate);
},
sendCommand(operate) { //
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" :pop-class="'haerbin-01__systerm'" />
<switch-cmd-control ref="switchCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" :pop-class="'ningbo-01__systerm'" />
<switch-un-lock ref="switchUnLock" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
@ -11,7 +11,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SwitchUnLock from './dialog/switchUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';

View File

@ -1,169 +0,0 @@
<template>
<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">
<el-row class="header">
<el-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">取消</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { menuOperate, commitOperate } from '../utils/menuOperate';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
switchName: '',
activeShow: false
};
},
computed: {
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.Switch.lock.menu.operation) {
return '道岔单锁';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
return '道岔转动';
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return '区段切除';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段激活';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
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.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.Switch.lock.menu.operation) {
/** 道岔单锁*/
this.lock();
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
/** 道岔封锁*/
this.block();
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
/** 道岔转动*/
this.turnout(this.operation);
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
/** 区段激活*/
this.split();
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
/** 区段激活*/
this.active();
}
},
//
lock() {
this.sendCommand(menuOperate.Switch.lock);
},
//
block() {
this.sendCommand(menuOperate.Switch.block);
},
//
turnout() {
this.sendCommand(menuOperate.Switch.turnout);
},
//
split() {
this.sendCommand(menuOperate.Switch.split);
},
//
active() {
this.sendCommand(menuOperate.Switch.active);
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="xian-01__systerm" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" :pop-class="'xian-01__systerm'" />
<switch-cmd-control ref="switchCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';

View File

@ -1,244 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="xian-02__system 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-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isActive" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="activeRadio" label="1" :disabled="activeRadio == 2" style="display: block; text-align: center;">
激活</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="activeRadio" label="2" :disabled="activeRadio == 1" style="display: block; text-align: center;">
切除</el-radio>
</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-col>
<el-col :span="11" :offset="2">
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
道岔解单锁</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>
</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>
</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-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: '',
isLock: false,
isTurnBlock: false,
isActive: false,
turnRadio: '1',
lockRadio: '1',
activeRadio: '1'
};
},
computed: {
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.Switch.lock.menu.operation) {
return '道岔控制';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.locate.menu.operation || this.operation == OperationEvent.Switch.reverse.menu.operation) {
return '道岔控制';
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
return '道岔强扳';
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
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) {
this.isTurnBlock = true;
this.turnRadio = '1';
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
this.isTurnBlock = true;
this.turnRadio = '2';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.isLock = true;
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
this.isActive = true;
this.activeRadio = '2';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
this.isActive = true;
this.activeRadio = '1';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
/** 道岔单锁*/
this.lock();
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
/** 道岔封锁*/
this.block();
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
/** 道岔定位*/
this.locate();
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
/** 道岔反位*/
this.reverse();
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
/** 区段切除*/
this.split();
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
/** 区段激活*/
this.active();
}
},
//
lock() {
this.sendCommand(menuOperate.Switch.lock);
},
//
block() {
this.sendCommand(menuOperate.Switch.block);
},
//
locate() {
this.sendCommand(menuOperate.Switch.npChain);
},
//
reverse() {
this.sendCommand(menuOperate.Switch.rpChain);
},
//
split() {
this.sendCommand(menuOperate.Switch.split);
},
//
active() {
this.sendCommand(menuOperate.Switch.active);
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
sendCommand(operate) {
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-class="xian-02__pop_tip_station" :tip-msg="topTip" :tip-subhead="tipSubhead" />
<switch-control ref="switchControl" />
<switch-control ref="switchControl" pop-class="xian-02__systerm" />
<switch-un-lock ref="switchUnLock" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
@ -11,7 +11,7 @@
<script>
import PopMenu from '@/components/PopMenu/index';
import SwitchControl from './dialog/switchControl';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SwitchUnLock from './dialog/switchUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
@ -19,7 +19,6 @@ import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from './utils/menuOperate';
@ -217,28 +216,6 @@ export default {
}
},
//
setStoppage() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.stoppage.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.mouseCancelState(this.selected);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {