This commit is contained in:
zyy 2020-05-09 18:48:30 +08:00
commit 1d2e835b85
4 changed files with 20 additions and 14 deletions

View File

@ -388,7 +388,7 @@ export default {
changeEndSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.startStationCode = section.belongStation;
this.addModel.endStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addEndSectionData(false);
@ -403,13 +403,17 @@ export default {
addStartSectionData(isStation) {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '') {
this.isStartSelected = true;
this.pushSection({stationCode: this.addModel.startStationCode, sectionCode: this.addModel.startSectionCode}, 'top', isStation);
const result = this.pushSection({stationCode: this.addModel.startStationCode, sectionCode: this.addModel.startSectionCode}, 'top', isStation);
return result;
}
return false;
},
addEndSectionData(isStation) {
if (this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
this.pushSection({stationCode: this.addModel.endStationCode, sectionCode: this.addModel.endSectionCode}, 'bottom', isStation);
const result = this.pushSection({stationCode: this.addModel.endStationCode, sectionCode: this.addModel.endSectionCode}, 'bottom', isStation);
return result;
}
return false;
},
hover(field) {
this.field = field === this.field ? '' : field;
@ -483,8 +487,9 @@ export default {
list.splice(0, 1, data);
} else {
if (index == list.length - 1 && list.length >= 2) {
this.$messageBox('起始区段和终到区段不能相同');
this.addModel.startSectionCode = list[0].sectionCode;
this.addModel.startStationCode = list[0].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
@ -510,8 +515,9 @@ export default {
}
} else {
if (index == 0 && list.length >= 2) {
this.$messageBox('起始区段和终到区段不能相同');
this.addModel.endSectionCode = list[list.length - 1].sectionCode;
this.addModel.endStationCode = list[list.length - 1].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
@ -583,7 +589,7 @@ export default {
this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
},
changeSectionSelected(selectedList, flag) {
if (this.addModel.parkSectionCodeList.length > 0) {
if (this.addModel.parkSectionCodeList && this.addModel.parkSectionCodeList.length > 0) {
if (flag) {
if (this.oldsection.length > 0) {
this.oldsection.forEach((section)=>{

View File

@ -73,10 +73,10 @@ export default {
},
{
title: '是否是引导信号机',
prop: 'callOn',
prop: 'releaseTime',
type: 'tag',
width: '80',
columnValue: (row) => { return row.callOn ? '是' : '否'; },
columnValue: (row) => { return row.releaseTime; },
tagType: (row) => { return ''; }
},
{

View File

@ -45,8 +45,8 @@
{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item label="是否引导信号机:" prop="callOn">
<el-checkbox v-model="addModel.callOn" />
<el-form-item label="进路解锁时间:" prop="releaseTime">
<el-input-number v-model="addModel.releaseTime" />
</el-form-item>
<el-form-item>
<el-button-group>
@ -105,7 +105,7 @@ export default {
signalCode: '',
routeSectionList: [],
blockSectionList: [],
callOn: true
releaseTime: 0
},
rules: {
signalCode: [
@ -217,7 +217,6 @@ export default {
if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'signalCode'.toUpperCase()) {
this.addModel.signalCode = selected.code;
this.addModel.callOn = !selected.virtual;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) {
if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && this.addModel.routeSectionList.indexOf(selected.code) === -1) {
this.addModel.routeSectionList.push(selected.code);

View File

@ -479,11 +479,12 @@ export default {
}
}
},
verifyMapEvent() {
async verifyMapEvent() {
if (this.$refs.jlmapVisual) {
const map = this.$store.state.map.map;
if (map && this.$route.params.mapId) {
if (this.verifySectionRelation(map) && this.verifySignalPosition(map) && this.verifyInterlockDevice(map) && this.verifyStationPosition(map)) {
const checkInterlockDevice = await this.verifyInterlockDevice(map);
if (this.verifySectionRelation(map) && this.verifySignalPosition(map) && checkInterlockDevice && this.verifyStationPosition(map)) {
verifyMap(this.$route.params.mapId).then(res => {
if (res.data.length) {
this.tableToExcel(res.data);