修改 交路选择起始信号机和终止信号机操作的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 = '';
}
this.judgeAllowSelected();
this.addStartSectionData(false);
},
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) {
list.splice(0, 1, data);
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
list.splice(0, 1, data);
} else {
list.unshift(data);
}
} else {
if (index < 0) {
list.splice(0, 1, data);
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);
}
list.push(data);
}
} else {
if (index < 0) {
// debugger;
// if (list.length >= 2) {
// list.splice(list.length - 1, 1, data);
// } else {
list.push(data);
// }
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,42 +1,42 @@
<template>
<div class="container">
<template v-if="list.length" >
<el-card class="el" v-for="(el,i) in list" :key="i" shadow="hover">
<div slot="header" class="clearfix">
<span>{{el.name}}</span>
</div>
<div style="padding: 30px 80px">
<slot :data="el" />
</div>
<div class="clearfix" style="text-align:right">
<el-button type="text" @click.stop="onSelect(el)">编辑</el-button>
</div>
</el-card>
</template>
<template v-else>
<span>暂无数据</span>
</template>
</div>
<div class="container">
<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>
</div>
<div style="padding: 30px 80px">
<slot :data="el" />
</div>
<div class="clearfix" style="text-align:right">
<el-button type="text" @click.stop="onSelect(el)">编辑</el-button>
</div>
</el-card>
</template>
<template v-else>
<span>暂无数据</span>
</template>
</div>
</template>
<script>
export default {
props: {
list: {
type: Array,
required: true
}
},
data() {
return {
}
},
methods: {
onSelect(el) {
this.$emit('select', el)
}
}
}
props: {
list: {
type: Array,
required: true
}
},
data() {
return {
};
},
methods: {
onSelect(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');