调整站间运行等级逻辑

This commit is contained in:
zyy 2020-04-20 18:29:50 +08:00
parent 85189c240f
commit dd4c575062
5 changed files with 61 additions and 18 deletions

View File

@ -142,7 +142,7 @@ export default {
this.$emit('showMap'); this.$emit('showMap');
}, },
initLoad() { initLoad() {
if (this.enabledTab === 'route') { if (this.enabledTab === 'route' || this.enabledTab == 'runLevel') {
this.$refs[this.enabledTabMenu[this.enabledTab]].initLoad(); this.$refs[this.enabledTabMenu[this.enabledTab]].initLoad();
} }
}, },
@ -164,13 +164,14 @@ export default {
drawMap() { drawMap() {
this.$refs.routeOperate.batchSectionListFocus(false); this.$refs.routeOperate.batchSectionListFocus(false);
this.$refs.signalOperate.batchSectionListFocus(false); this.$refs.signalOperate.batchSectionListFocus(false);
this.$refs.runLevelOperate.batchSectionListFocus(false);
this.$emit('selectView', 'draft'); this.$emit('selectView', 'draft');
}, },
tabBeforeLeave(activeName, oldActiveName) { tabBeforeLeave(activeName, oldActiveName) {
if (activeName === 'route' || activeName === 'signal') { if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel') {
this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true); this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true);
} }
if (oldActiveName === 'route' || oldActiveName === 'signal') { if (oldActiveName === 'route' || oldActiveName === 'signal' || activeName == 'runLevel') {
this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false); this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false);
} }
} }

View File

@ -67,7 +67,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.physicalSection') +':'" prop="routeSectionList"> <el-form-item :label="$t('map.physicalSection') +':'" prop="routeSectionList">
<el-select v-model="addModel.routeSectionList" multiple filterable> <el-select v-model="addModel.routeSectionList" multiple filterable> <!-- 111 -->
<el-option <el-option
v-for="item in sectionList" v-for="item in sectionList"
:key="item.code" :key="item.code"

View File

@ -84,9 +84,13 @@ export default {
title: '行驶方向', title: '行驶方向',
prop: 'right', prop: 'right',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.translate(row.right, 'PermissionUseList'); }, columnValue: (row) => { return this.translate(row.right); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{
title: '站间距离',
prop: 'distance'
},
{ {
title: '第一等级时间', title: '第一等级时间',
prop: 'l1' prop: 'l1'
@ -169,11 +173,12 @@ export default {
return getRunLevelList(this.mapInfo.id, params); return getRunLevelList(this.mapInfo.id, params);
} }
}, },
translate(rowData, listName) { translate(rowData) {
const obj = this[listName].filter((item) => { if (rowData) {
return item.value === rowData; return '向右';
}); } else {
return obj && obj.label; return '向左';
}
}, },
acquireMapList() { acquireMapList() {
// //

View File

@ -73,11 +73,17 @@ export default {
this.$refs.routeEdit.clear(); this.$refs.routeEdit.clear();
} }
}, },
initLoad() {
this.$refs.routeEdit.batchSectionListFocus(true);
},
setSelected(selected) { setSelected(selected) {
this.$refs.routeEdit.setSelected(selected); this.$refs.routeEdit.setSelected(selected);
}, },
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
},
batchSectionListFocus(flag) {
this.$refs.routeEdit.batchSectionListFocus(flag);
} }
} }
}; };

View File

@ -67,10 +67,6 @@
<el-form-item label="是否向右:" prop="right"> <el-form-item label="是否向右:" prop="right">
<el-checkbox v-model="addModel.right" /> <el-checkbox v-model="addModel.right" />
</el-form-item> </el-form-item>
<el-form-item label="站间距离:" prop="distance">
<el-input-number v-model="addModel.distance" :min="0" />
<span>m</span>
</el-form-item>
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button type="primary" size="small" style="margin-top: 10px" @click="generateLevel">生成等级</el-button> <el-button type="primary" size="small" style="margin-top: 10px" @click="generateLevel">生成等级</el-button>
@ -137,6 +133,10 @@
<el-form-item label="是否向右:" prop="right"> <el-form-item label="是否向右:" prop="right">
<el-checkbox v-model="addModel.right" /> <el-checkbox v-model="addModel.right" />
</el-form-item> </el-form-item>
<el-form-item label="站间距离:" prop="distance">
<el-input-number v-model="addModel.distance" :min="0" />
<span>m</span>
</el-form-item>
<el-form-item label="等级一时间:" prop="l1"> <el-form-item label="等级一时间:" prop="l1">
<el-input-number v-model="addModel.l1" :min="0" /> <el-input-number v-model="addModel.l1" :min="0" />
<span>s</span> <span>s</span>
@ -233,9 +233,6 @@ export default {
], ],
endSectionCode: [ endSectionCode: [
{ required: true, message: '请选择末端区段', trigger: 'change' } { required: true, message: '请选择末端区段', trigger: 'change' }
],
distance: [
{ required: true, message: '请输入站间距离', trigger: 'blur' }
] ]
} }
}; };
@ -286,6 +283,22 @@ export default {
if (this.addModel.startStationCode && val) { if (this.addModel.startStationCode && val) {
this.getStationDistance(); this.getStationDistance();
} }
},
'addModel.startSectionCode': function(val, old) {
if (old) {
this.changeSectionSelected(old, false, 'routePhysicalSection');
}
if (val) {
this.changeSectionSelected(val, true, 'routePhysicalSection');
}
},
'addModel.endSectionCode': function(val, old) {
if (old) {
this.changeSectionSelected(old, false, 'routePhysicalSection');
}
if (val) {
this.changeSectionSelected(val, true, 'routePhysicalSection');
}
} }
}, },
methods: { methods: {
@ -305,10 +318,28 @@ export default {
this.addModel.l3 = res.data.l3; this.addModel.l3 = res.data.l3;
this.addModel.l4 = res.data.l4; this.addModel.l4 = res.data.l4;
this.addModel.l5 = res.data.l5; this.addModel.l5 = res.data.l5;
this.addModel.distance = res.data.distance;
} }
} }
}); });
}, },
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.endSectionCode, flag, 'routePhysicalSection');
this.changeSectionSelected(this.addModel.startSectionCode, flag, 'routePhysicalSection');
},
changeSectionSelected(val, flag, type) {
if (val) {
const section = this.$store.getters['map/getDeviceByCode'](val);
if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => {
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
});
} else {
section && section.instance.drawBatchSelected(flag, flag ? type : '');
}
}
},
save() { save() {
this.loading = true; this.loading = true;
if (this.editShow) { if (this.editShow) {
@ -342,7 +373,7 @@ export default {
startSectionCode: '', startSectionCode: '',
startStationCode: '', startStationCode: '',
right: false, right: false,
distance: '', distance: 0,
l1: 0, l1: 0,
l2: 0, l2: 0,
l3: 0, l3: 0,