信号机操作代码整理

This commit is contained in:
joylink_cuiweidong 2020-06-18 09:46:29 +08:00
parent 426aed9ef1
commit b0e5d7a6b6
6 changed files with 23 additions and 348 deletions

View File

@ -2,9 +2,9 @@
<div> <div>
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<route-selection ref="routeSelection" /> <route-selection ref="routeSelection" />
<route-control ref="routeControl" :pop-class="'beijing-01__systerm'" /> <route-control ref="routeControl" :pop-class="systemName" />
<route-hand-control ref="routeHandControl" /> <route-hand-control ref="routeHandControl" />
<route-detail ref="routeDetail" /> <route-detail ref="routeDetail" :system-name="systemName" />
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
<password-box ref="password" @checkOver="passWordCommit" /> <password-box ref="password" @checkOver="passWordCommit" />
</div> </div>
@ -15,7 +15,7 @@ import PopMenu from '@/components/PopMenu';
import RouteControl from '@/jmapNew/theme/components/menus/dialog/routeControl'; import RouteControl from '@/jmapNew/theme/components/menus/dialog/routeControl';
import RouteSelection from './dialog/routeSelection'; import RouteSelection from './dialog/routeSelection';
import RouteHandControl from './dialog/routeHandControl'; import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail'; import RouteDetail from '@/jmapNew/theme/components/menus/dialog/routeDetail';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
@ -49,6 +49,7 @@ export default {
return { return {
menu: [], menu: [],
clickNum:0, clickNum:0,
systemName:'beijing-01__systerm',
oldSelected:null, oldSelected:null,
menuNormal: { menuNormal: {
Local: [ Local: [

View File

@ -2,7 +2,7 @@
<div> <div>
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
class="beijing-01__systerm route-detail" :class="systemName+' route-detail'"
:title="title" :title="title"
:visible.sync="show" :visible.sync="show"
width="340px" width="340px"
@ -62,14 +62,20 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus'; // import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from '../childDialog/noticeInfo';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
components: { components: {
NoticeInfo NoticeInfo
}, },
props:{
systemName:{
type:String,
required:true
}
},
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
@ -128,7 +134,7 @@ export default {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected); // mouseCancelState(this.selected);
}, },
commit() { commit() {
const operate = { const operate = {

View File

@ -1,168 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="foshan-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>进路列表</span>
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="进路">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="控制状态" width="180">
<template slot-scope="scope">
<!-- <span v-if="scope.row.controlType == '01'">自动不进行冲突检测</span>
<span v-else>人工</span> -->
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
</template>
</el-table-column>
</el-table>
</div>
<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>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteDetail',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
stationName: '',
signalName: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
},
title() {
return '查询进路状态';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
}
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() {
const operate = {
over: true,
operation: OperationEvent.Signal.detail.menu.operation,
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -4,9 +4,9 @@
<route-selection ref="routeSelection" /> <route-selection ref="routeSelection" />
<route-lock ref="routeLock" /> <route-lock ref="routeLock" />
<route-un-lock ref="routeUnLock" /> <route-un-lock ref="routeUnLock" />
<route-control ref="routeControl" :pop-class="'foshan-01__systerm'" /> <route-control ref="routeControl" :pop-class="systemName" />
<route-hand-control ref="routeHandControl" /> <route-hand-control ref="routeHandControl" />
<route-detail ref="routeDetail" /> <route-detail ref="routeDetail" :system-name="systemName" />
<router-command ref="routerCommand" /> <router-command ref="routerCommand" />
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
</div> </div>
@ -20,7 +20,7 @@ import RouteLock from './dialog/routeLock';
import RouteUnLock from './dialog/routeUnLock'; import RouteUnLock from './dialog/routeUnLock';
import RouteHandControl from './dialog/routeHandControl'; import RouteHandControl from './dialog/routeHandControl';
import RouterCommand from './dialog/routerCommand'; import RouterCommand from './dialog/routerCommand';
import RouteDetail from './dialog/routeDetail'; import RouteDetail from '@/jmapNew/theme/components/menus/dialog/routeDetail';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -54,6 +54,7 @@ export default {
data() { data() {
return { return {
menu: [], menu: [],
systemName:'foshan-01__systerm',
menuNormal: { menuNormal: {
Local: [ Local: [
{ {

View File

@ -1,166 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>进路列表</span>
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="进路">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="控制状态" width="180">
<template slot-scope="scope">
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
</template>
</el-table-column>
</el-table>
</div>
<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>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteDetail',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
stationName: '',
signalName: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
},
title() {
return '查询进路状态';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
}
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() {
const operate = {
over: true,
operation: OperationEvent.Signal.detail.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -3,11 +3,11 @@
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<route-selection ref="routeSelection" /> <route-selection ref="routeSelection" />
<route-un-lock ref="routeUnLock" /> <route-un-lock ref="routeUnLock" />
<route-control ref="routeControl" :pop-class="'ningbo-01__systerm'" /> <route-control ref="routeControl" :pop-class="systemName" />
<route-hand-control ref="routeHandControl" /> <route-hand-control ref="routeHandControl" />
<route-detail ref="routeDetail" /> <route-detail ref="routeDetail" :system-name="systemName" />
<router-command ref="routerCommand" /> <router-command ref="routerCommand" />
<notice-info ref="noticeInfo" />\ <notice-info ref="noticeInfo" />
</div> </div>
</template> </template>
@ -18,7 +18,7 @@ import RouteSelection from './dialog/routeSelection';
import RouteUnLock from './dialog/routeUnLock'; import RouteUnLock from './dialog/routeUnLock';
import RouteHandControl from './dialog/routeHandControl'; import RouteHandControl from './dialog/routeHandControl';
import RouterCommand from './dialog/routerCommand'; import RouterCommand from './dialog/routerCommand';
import RouteDetail from './dialog/routeDetail'; import RouteDetail from '@/jmapNew/theme/components/menus/dialog/routeDetail';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import {menuOperate, commitOperate} from './utils/menuOperate'; import {menuOperate, commitOperate} from './utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -49,6 +49,7 @@ export default {
data() { data() {
return { return {
menu: [], menu: [],
systemName:'ningbo-01__systerm',
menuNormal: { menuNormal: {
Local: [ Local: [
{ {