宁波一号线 现地 设置进路报错提示调整

This commit is contained in:
joylink_cuiweidong 2021-02-18 17:03:08 +08:00
parent c0c5356f8a
commit 0e9454f890
2 changed files with 100 additions and 90 deletions

View File

@ -1,35 +1,42 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="margin-bottom: 10px;">执行命令描述</div>
<div class="message-box" v-html="$escapeHTML(message)" />
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button :id="confirmId" type="primary" @click="confirm"> </el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm confirm-control-speed"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="margin-bottom: 10px;">执行命令描述</div>
<div class="message-box" v-html="$escapeHTML(message)" />
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button :id="confirmId" type="primary" @click="confirm"> </el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmTip',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
@ -72,6 +79,9 @@ export default {
this.$emit('close');
this.doClose();
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
});
}
},

View File

@ -47,7 +47,7 @@ import { menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menu
import { deepAssign } from '@/utils/index';
import { mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import { mapGetters } from 'vuex';
import { dbReadData } from '@/utils/indexedDb';
// import { dbReadData } from '@/utils/indexedDb';
import ConfirmTip from './childDialog/confirmTip';
import MapVisual from './mapVisual';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
@ -56,14 +56,14 @@ export default {
name: 'RouteSelection',
components: {
NoticeInfo,
ConfirmTip,
MapVisual
ConfirmTip,
MapVisual
},
data() {
return {
tempData: [],
beforeSectionList: [],
beforeSwitchList: [],
beforeSectionList: [],
beforeSwitchList: [],
showExpand: true,
dialogShow: false,
loading: false,
@ -72,11 +72,11 @@ export default {
operation: '',
display: true,
stationName: '',
signalName: '',
mapData: null,
signalName: '',
mapData: null,
tableStyle: {
'border-bottom': 'none'
}
}
};
},
computed: {
@ -94,7 +94,7 @@ export default {
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
},
title() {
return '进路设置';
},
@ -112,10 +112,10 @@ export default {
this.commit();
}
}
},
mounted() {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
},
},
mounted() {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
},
methods: {
expandPath() {
this.showExpand = !this.showExpand;
@ -142,21 +142,21 @@ export default {
}
});
this.operation = operate.operation;
}
}
this.dialogShow = true;
this.dialogShow = true;
this.$nextTick(function () {
this.loadData();
this.loadData();
this.$store.dispatch('training/emitTipFresh');
});
},
loadData() {
this.beforeSwitchList = [];
this.beforeSectionList = [];
if (this.mapData) {
this.$refs.map.loadData(this.mapData);
}
},
},
loadData() {
this.beforeSwitchList = [];
this.beforeSectionList = [];
if (this.mapData) {
this.$refs.map.loadData(this.mapData);
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
@ -170,79 +170,79 @@ export default {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(el => {
el.routeLock = false;
el.preBlue = false;
el.preGreen = false;
el.routeLock = false;
el.preBlue = false;
el.preGreen = false;
});
}
if (this.beforeSwitchList && this.beforeSwitchList.length) {
this.beforeSwitchList.forEach(el => {
el.normalPosition = false;
el.reversePosition = false;
el.routeLock = false;
el.normalPosition = false;
el.reversePosition = false;
el.routeLock = false;
});
}
}
this.$refs.map.updateMapDevice([...this.beforeSectionList, ...this.beforeSwitchList]);
this.$refs.map.updateMapDevice([...this.beforeSectionList, ...this.beforeSwitchList]);
this.beforeSectionList = [];
this.beforeSwitchList = [];
this.beforeSectionList = [];
this.beforeSwitchList = [];
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
this.row.canSetting = true;
this.restoreBeforeDevices();
this.restoreBeforeDevices();
const containSectionList = [];
const containSwitchList = [];
const containSectionList = [];
const containSwitchList = [];
if (!row.setting) {
const signalBegin = this.$refs.map.getDeviceByCode(row.startSignalCode);
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
const diff = signalBegin.position.x - signalEnd.position.x;
const code = diff > 0? row.endSignalCode : row.startSignalCode;
const switchCodeList = [];
const signalBegin = this.$refs.map.getDeviceByCode(row.startSignalCode);
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
const diff = signalBegin.position.x - signalEnd.position.x;
const code = diff > 0 ? row.endSignalCode : row.startSignalCode;
const switchCodeList = [];
this.$refs.map.setCenterWithOffset(code, 0);
this.$refs.map.setCenterWithOffset(code, 0);
if (row.routeSectionList && row.routeSectionList.length) {
row.routeSectionList.forEach(code => {
const section = deepAssign({}, this.$refs.map.getDeviceByCode(code));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(sectionCode => {
containSectionList.push({code: sectionCode,preGreen: true,preBlue: false});
containSectionList.push({code: sectionCode, preGreen: true, preBlue: false});
});
} else {
containSectionList.push({code, preGreen: true,preBlue: false});
containSectionList.push({code, preGreen: true, preBlue: false});
}
if (section.switchSection && section.switch) {
switchCodeList.push(section.switch.code);
}
if (section.switchSection && section.switch) {
switchCodeList.push(section.switch.code);
}
});
}
}
if (row.routeSwitchList && row.routeSwitchList.length) {
if (row.routeSwitchList && row.routeSwitchList.length) {
row.routeSwitchList.filter(el => switchCodeList.includes(el.switchCode)).forEach(el => {
const swch = deepAssign({}, this.$refs.map.getDeviceByCode(el.switchCode));
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal,reversePosition: !el.normal});
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });
} else {
containSectionList.push({code: sectionC.code, routeLock:true });
containSectionList.push({code: sectionB.code, preBlue: true });
}
const swch = deepAssign({}, this.$refs.map.getDeviceByCode(el.switchCode));
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal, reversePosition: !el.normal});
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });
} else {
containSectionList.push({code: sectionC.code, routeLock:true });
containSectionList.push({code: sectionB.code, preBlue: true });
}
});
}
}
this.$refs.map.updateMapDevice([...containSectionList, ...containSwitchList]);
this.beforeSectionList = containSectionList
this.beforeSwitchList = containSwitchList;
this.$refs.map.updateMapDevice([...containSectionList, ...containSwitchList]);
this.beforeSectionList = containSectionList;
this.beforeSwitchList = containSwitchList;
//
const operate = {
@ -267,7 +267,7 @@ export default {
this.loading = false;
if (valid) {
const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode);
operate.message = `<div>命令:进路设置</div><div>始端信号机:${signal.name}</div><div>进路:${this.row.name} </div>`;
operate.message = `命令:进路设置<br/>始端信号机:${signal.name}<br/>进路:${this.row.name}`;
this.doClose();
this.$refs.confirmTip.doShow(operate);
}