This commit is contained in:
joylink_cuiweidong 2020-06-18 11:25:01 +08:00
commit 350043c3d2
21 changed files with 89 additions and 1432 deletions

View File

@ -1,204 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-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-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="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isDisplay" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</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;">
切除</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 OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
sectionName: '',
radio: '',
isDisplay: 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.Section.split.menu.operation) {
this.radio = '2';
return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1';
return '区段控制';
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
return '计轴复位';
} else {
return '';
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
if (this.operation == OperationEvent.Section.split.menu.operation) {
this.radio = '2';
this.isDisplay = true;
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1';
this.isDisplay = true;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
this.isDisplay = false;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
this.isDisplay = false;
}
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += 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');
mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/
this.split();
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区故解*/
this.faultUnlock();
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 计轴预复位*/
this.axlePreReset();
}
},
//
faultUnlock() {
this.sendCommand(menuOperate.Section.fault);
},
//
axlePreReset() {
this.sendCommand(menuOperate.Section.axlePreReset);
},
//
split() {
this.sendCommand(menuOperate.Section.split);
},
//
active() {
this.sendCommand(menuOperate.Section.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" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="beijing-01__systerm" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';

View File

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

View File

@ -1,168 +0,0 @@
<template>
<el-dialog v-dialogDrag class="chengdou-01__system 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-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</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="sectionName" 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">{{ $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';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
sectionName: ''
};
},
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.Section.lock.menu.operation) {
return this.$t('menu.menuSection.sectionBlockade');
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionResection');
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionActive');
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += 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.Section.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
this.split(); //
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.active(); //
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Section.lock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
};
this.sendCommand(operate);
},
//
split() {
const operate = {
over: true,
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
},
//
active() {
const operate = {
over: true,
operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
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.loading = false;
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" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="chengdou-01__system" />
<section-cmd-control ref="sectionCmdControl" />
<speed-limit-control ref="speedLimitControl" />
</div>
@ -12,7 +12,7 @@
import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import SpeedLimitControl from './dialog/speedLimitControl';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';

View File

@ -1,167 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm section-control"
:title="title"
:visible.sync="show"
width="440px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="3"><span>车站</span></el-col>
<el-col :span="6">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="3" :offset="2"><span>区段</span></el-col>
<el-col :span="6">
<el-input v-model="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="11" :offset="13">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<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 NoticeInfo from './childDialog/childDialog/noticeInfo';
import PasswordBox from './childDialog/passwordInputBox';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionControl',
components: {
NoticeInfo,
PasswordBox
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
sectionName: ''
};
},
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.Section.fault.menu.operation) {
return '区故解';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += 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.Section.fault.menu.operation) {
/** 区故解*/
this.fault();
}
},
passWordCommit(data) {
const operate = {
over: true,
operation: data.operateNext,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
//
fault() {
const operate = {
operation: OperationEvent.Section.fault.menu.operation,
operateNext: OperationEvent.Section.fault.confirm.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
}).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" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="chengdou-03__systerm" />
<train-create ref="trainCreate" />
<section-detail ref="sectionDetail" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionDetail from './dialog/sectionDetail';
import TrainCreate from './dialog/trainCreate';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
@ -46,21 +46,18 @@ export default {
{
label: '区故解',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
auth: { station: true, center: false }
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}
],
Center: [
{
label: '区故解',
handler: this.fault,
auth: { station: false, center: true },
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
{
label: '属性',
handler: this.detail,
auth: { station: false, center: true },
cmdType: CMD.Section.CMD_SECTION_DETAILS
}

View File

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

View File

@ -1,7 +1,8 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm section-control"
class="section-control"
:class="popClass"
:title="title"
:visible.sync="show"
width="300px"
@ -22,7 +23,7 @@
<el-input v-model="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isShow" style="margin-top: 10px;">
<el-row v-if="isShow && (popClass == 'ningbo-01__systerm' || popClass == 'foshan-01__systerm' || popClass == 'beijing-01__systerm')" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</el-radio>
@ -40,20 +41,29 @@
<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 { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from '../childDialog/noticeInfo';
import PasswordBox from '../childDialog/passwordInputBox';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
export default {
name: 'SectionControl',
components: {
NoticeInfo
NoticeInfo,
PasswordBox
},
props: {
popClass: {
type: String,
default: ''
}
},
data() {
return {
@ -84,6 +94,10 @@ export default {
return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
return '计轴复位';
}
return '';
}
@ -136,14 +150,15 @@ export default {
},
commit() {
if (this.operation == OperationEvent.Section.lock.menu.operation) {
/** 区段封锁*/
this.lock();
this.lock(); //
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/
this.split();
this.split(); //
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
this.active(); //
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
this.fault(); //
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
this.axlePreReset(); //
}
},
//
@ -158,6 +173,33 @@ export default {
active() {
this.sendCommand(menuOperate.Section.active);
},
//
axlePreReset() {
this.sendCommand(menuOperate.Section.axlePreReset);
},
//
fault() {
const operate = {
operation: OperationEvent.Section.fault.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
passWordCommit(data) {
if (data.operation == OperationEvent.Section.fault.menu.operation) {
this.sendCommand(menuOperate.Section.fault);
}
},
sendCommand(operate) {
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
@ -165,7 +207,7 @@ export default {
if (valid) {
this.doClose();
}
}).catch(error => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();

View File

@ -5,21 +5,25 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// 操作
export const menuOperate = {
Section:{
lock: { // 区段封锁
operation: OperationEvent.Section.lock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
},
active:{
// 区段激活
operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
},
alxeEffective:{
// 确认计轴有效
operation: OperationEvent.Section.alxeEffective.menu.operation,
cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
},
split:{
// 区段切除
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
alxeEffective:{
// 确认计轴有效
operation: OperationEvent.Section.alxeEffective.menu.operation,
cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
},
setSpeed:{
// 设置速度
operation: OperationEvent.Section.setSpeed.menu.operation,

View File

@ -1,188 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="foshan-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-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="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</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;">
切除</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 { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
sectionName: '',
radio: ''
};
},
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.Section.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return '区段控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += `${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.Section.split.menu.operation) {
this.radio = '2';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
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');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/
this.split();
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
}
},
//
split() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
},
//
active() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
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" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="foshan-01__systerm" />
<section-un-lock ref="sectionUnLock" />
<speed-limit-control ref="speedLimitControl" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionUnLock from './dialog/sectionUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';

View File

@ -1,153 +0,0 @@
<template>
<el-dialog v-dialogDrag class="fuzhou-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-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</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="sectionName" 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">{{ $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: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
sectionName: ''
};
},
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.Section.lock.menu.operation) {
return this.$t('menu.menuSection.sectionBlockade');
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionResection');
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionActive');
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += 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.Section.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
this.split(); //
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.active(); //
}
},
//
lock() {
this.sendCommand(menuOperate.Section.lock);
},
//
split() {
this.sendCommand(menuOperate.Section.split);
},
//
active() {
this.sendCommand(menuOperate.Section.active);
},
sendCommand(operate) {
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
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();
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="fuzhou-01__systerm" />
<section-cmd-control ref="sectionCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
@ -10,12 +10,13 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Handler from '@/scripts/cmdPlugin/Handler';
// import Handler from '@/scripts/cmdPlugin/Handler';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';

View File

@ -1,167 +0,0 @@
<template>
<el-dialog v-dialogDrag class="haerbin-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-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</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="sectionName" 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">{{ $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';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
sectionName: ''
};
},
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.Section.lock.menu.operation) {
return this.$t('menu.menuSection.sectionBlockade');
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionResection');
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return this.$t('menu.menuSection.orbitalSectionActive');
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += 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.Section.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
this.split(); //
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.active(); //
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Section.lock.menu.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
};
this.sendCommand(operate);
},
//
split() {
const operate = {
over: true,
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
},
//
active() {
const operate = {
over: true,
operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
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

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="haerbin-01__systerm" />
<section-cmd-control ref="sectionCmdControl" />
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
@ -10,7 +10,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
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" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="ningbo-01__systerm" />
<section-un-lock ref="sectionUnLock" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
@ -11,7 +11,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionUnLock from './dialog/sectionUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';

View File

@ -1,152 +0,0 @@
<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-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="sectionName" 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">{{ $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 { menuOperate, commitOperate } from '../utils/menuOperate';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
sectionName: ''
};
},
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.Section.lock.menu.operation) {
return '区段封锁';
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
return '区段切除';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return '区段激活';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += 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.Section.lock.menu.operation) {
this.lock(); //
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
this.split(); //
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.active(); //
}
},
//
lock() {
this.sendCommand(menuOperate.Section.lock);
},
//
split() {
this.sendCommand(menuOperate.Section.split);
},
//
active() {
this.sendCommand(menuOperate.Section.active);
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
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();
});
}
}
};
</script>

View File

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

View File

@ -1,188 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="xian-02__system 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-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="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isShow" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</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;">
切除</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 { 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: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
isShow: false,
stationName: '',
sectionName: '',
radio: ''
};
},
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.Section.lock.menu.operation) {
return '区段封锁';
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return '区段控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += `${selected.name}`;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.operation = operate.operation || '';
this.isShow = false;
if (this.operation == OperationEvent.Section.split.menu.operation) {
this.radio = '2';
this.isShow = true;
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1';
this.isShow = 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.Section.lock.menu.operation) {
/** 区段封锁*/
this.lock();
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/
this.split();
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
}
},
//
lock() {
this.sendCommand(menuOperate.Section.lock);
},
//
split() {
this.sendCommand(menuOperate.Section.split);
},
//
active() {
this.sendCommand(menuOperate.Section.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-class="xian-02__pop_tip_station" :tip-msg="topTip" :tip-subhead="tipSubhead" />
<section-control ref="sectionControl" />
<section-control ref="sectionControl" pop-class="xian-02__systerm" />
<section-un-lock ref="sectionUnLock" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
@ -11,7 +11,7 @@
<script>
import PopMenu from '@/components/PopMenu/index';
import SectionControl from './dialog/sectionControl';
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
import SectionUnLock from './dialog/sectionUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';