修改 交路选择起始信号机和终止信号机操作的bug问题

This commit is contained in:
lVAL 2021-01-13 09:51:59 +08:00
parent 64df012fc3
commit ede7335ab1
5 changed files with 65 additions and 54 deletions

View File

@ -70,7 +70,7 @@ export default {
isShow = true;
}
}
return isShow;
return this.$store.state.user.companyId || isShow;
},
isLocal() { //
return process.env.VUE_APP_PRO === 'local';

View File

@ -98,7 +98,7 @@ export default {
isShow = true;
}
}
return isShow;
return this.$store.state.user.companyId || isShow;
},
isLocal() { //
return process.env.VUE_APP_PRO === 'local';

View File

@ -446,11 +446,16 @@ export default {
},
changeStartSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
if (section &&
section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addStartSectionData(false);
} else {
this.addModel.parkSectionCodeList.shift();
this.addModel.startStationCode = '';
this.addModel.startSectionCode = '';
}
},
changeEndStation() {
this.judgeAllowSelected();
@ -459,16 +464,17 @@ export default {
changeEndSection(data) {
if (data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
if (section &&
section.belongStation) {
this.addModel.endStationCode = section.belongStation;
}
this.addModel.destinationCode = section.destinationCode || '';
this.judgeAllowSelected();
this.addEndSectionData(false);
} else {
this.addModel.parkSectionCodeList.pop();
this.addModel.endStationCode = '';
this.addModel.endSectionCode = '';
this.addModel.parkSectionCodeList.pop();
}
},
judgeAllowSelected() {
@ -589,10 +595,18 @@ export default {
}
case 'top': {
if (isStation) {
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
list.splice(0, 1, data);
} else {
list.unshift(data);
}
} else {
if (index < 0) {
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
list.splice(0, 1, data);
} else {
list.unshift(data);
}
} else {
if (index == list.length - 1 && list.length >= 2) {
this.addModel.startSectionCode = list[0].sectionCode;
@ -607,21 +621,18 @@ export default {
}
case 'bottom': {
if (isStation) {
if (list.length >= 2) {
if (list.find(el => { el.sectionCode == this.addModel.endSectionCode; })) {
list.splice(list.length - 1, 1, data);
} else {
if (index < 0) {
list.push(data);
}
}
} else {
if (index < 0) {
// debugger;
// if (list.length >= 2) {
// list.splice(list.length - 1, 1, data);
// } else {
if (list.find(el => { el.sectionCode == this.addModel.endSectionCode; })) {
list.splice(list.length - 1, 1, data);
} else {
list.push(data);
// }
}
} else {
if (index == 0 && list.length >= 2) {
this.addModel.endSectionCode = list[list.length - 1].sectionCode;

View File

@ -1,9 +1,9 @@
<template>
<div class="container">
<template v-if="list.length" >
<el-card class="el" v-for="(el,i) in list" :key="i" shadow="hover">
<template v-if="list.length">
<el-card v-for="(el,i) in list" :key="i" class="el" shadow="hover">
<div slot="header" class="clearfix">
<span>{{el.name}}</span>
<span>{{ el.name }}</span>
</div>
<div style="padding: 30px 80px">
<slot :data="el" />
@ -29,14 +29,14 @@ export default {
},
data() {
return {
}
};
},
methods: {
onSelect(el) {
this.$emit('select', el)
this.$emit('select', el);
}
}
}
};
</script>
<style lang="scss" scoped>

View File

@ -91,7 +91,7 @@ export default {
isShow = true;
}
}
return isShow;
return this.$store.state.user.companyId || isShow;
},
project() {
return getSessionStorage('project');