宁波三号线 运行线 代码调整

This commit is contained in:
joylink_cuiweidong 2021-03-10 10:25:05 +08:00
parent b434824d97
commit 2146b28b9a
3 changed files with 38 additions and 21 deletions

View File

@ -276,7 +276,7 @@ export default class ELines extends Group {
} }
this.runLine = new Polyline({ this.runLine = new Polyline({
zlevel: this.zlevel, zlevel: this.zlevel,
progressive: model.progressive, // progressive: model.progressive,
z: Z + 2, z: Z + 2,
shape: { shape: {
points: points points: points
@ -426,10 +426,12 @@ export default class ELines extends Group {
setRunLineDefault() { setRunLineDefault() {
this.runLine && this.runLine.hide(); this.runLine && this.runLine.hide();
this.runLine.dirty();
} }
runLineShow() { runLineShow() {
this.runLine && this.runLine.show(); this.runLine && this.runLine.show();
this.runLine.dirty();
} }
hide() { hide() {
@ -565,13 +567,13 @@ export default class ELines extends Group {
} }
} }
addHover(style) { addHover(style) {
this.__zr && this.__zr.addHover(this.section, style); this.__zr && this.__zr.addHover(this.section, style);
} }
removeHover() { removeHover() {
this.__zr && this.__zr.removeHover(this.section); this.__zr && this.__zr.removeHover(this.section);
} }
recover() { recover() {

View File

@ -256,19 +256,9 @@ export default class Section extends Group {
showRunLine() { showRunLine() {
this.line && this.line.runLineShow(); this.line && this.line.runLineShow();
if (this.model.code == 'T5') {
console.log(this.line, 'T5');
} else if (this.model.code == 'T10') {
console.log(this.line, 'T10');
}
} }
setRunLineDefault() { setRunLineDefault() {
this.line && this.line.setRunLineDefault(); this.line && this.line.setRunLineDefault();
if (this.model.code == 'T5') {
console.log(this.line, 'T5', 'default');
} else if (this.model.code == 'T10') {
console.log(this.line, 'T10', 'default');
}
} }
/** 保护区段锁闭 09*/ /** 保护区段锁闭 09*/

View File

@ -231,7 +231,6 @@ export default {
}, },
handleChange(row) { handleChange(row) {
if (row) { if (row) {
debugger;
const runPath = row.runPath; const runPath = row.runPath;
if (runPath && runPath.length > 0) { if (runPath && runPath.length > 0) {
const step = { const step = {
@ -241,13 +240,39 @@ export default {
}; };
this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
const oldRunPath = this.$store.state.training.runPathList; const oldRunPath = [...this.$store.state.training.runPathList];
this.setRunPath(oldRunPath, false); // this.setRunPath(oldRunPath, false);
this.setRunPath(runPath, true); // // this.$nextTick(()=>{
// // this.setRunPath(runPath, true);
// // });
// setTimeout(()=>{
// this.setRunPath(runPath, true);
// }, 500);
// this.setRunPath(runPath, true);
runPath.forEach(path=>{
if (oldRunPath.includes(path)) {
const index = oldRunPath.indexOf(path);
oldRunPath.splice(index, 1);
} else {
const section = this.$store.getters['map/getDeviceByCode'](path);
if (section && section.instance) {
section.instance.showRunLine();
}
}
});
oldRunPath.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each);
if (section && section.instance) {
section.instance.setRunLineDefault();
}
});
this.selectedRunPath = row.code; this.selectedRunPath = row.code;
this.judgeCanCommit(); this.judgeCanCommit();
this.$store.dispatch('training/setRunPathSelected', runPath); this.$store.dispatch('training/setRunPathSelected', runPath);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();