This commit is contained in:
sunzhenyu 2020-12-08 11:28:46 +08:00
commit 5ead363453
11 changed files with 218 additions and 114 deletions

View File

@ -31,7 +31,10 @@ class EStationText extends Group {
textBorderWidth:style.Station.stationText.textBorderWidth
}
});
model.visible && this.add(this.stationName);
this.add(this.stationName);
if (!model.visible) {
this.stationName.setStyle('fontSize', 0);
}
if (model.subheadDisplay) { // 副标题
this.subheadText = new Text({
zlevel: this.model.zlevel,

View File

@ -74,7 +74,10 @@ export default class Station extends Group {
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
model.visible && model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
if (!model.visible) {
this.mileageText.setStyle('fontSize', 0);
}
}
// if (!model.visible) { // 隐藏车站
@ -462,11 +465,13 @@ export default class Station extends Group {
}
setShowStation(flag) {
if (flag) {
this.eachChild(item => {
item.show();
});
if (this.mileageText) {
this.model.visible && this.model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
if (this.model.visible) {
this.eachChild(item => {
item.show();
});
if (this.mileageText) {
this.model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
}
this.isShowShape = true;
this.setState(this.model);

View File

@ -70,7 +70,7 @@ export const loginInfo = {
systemType: '011'
},
drts: {
title: '行车调度员实训系统国赛备战版',
title: '2020年“新誉杯”全国行车调度员大赛训练系统',
loginPath: '/login?project=drts',
loginParam: 'DRTS',
loginTitle: '空串',

View File

@ -1,5 +1,6 @@
import { getSessionStorage } from '@/utils/auth';
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
// listPublishMap
import { getMapListByProjectCode, getPublishMapListOnline } from '@/api/jmap/map';
import { ProjectCode } from '@/scripts/ProjectConfig';
export async function getMapListByProject() {
@ -8,7 +9,8 @@ export async function getMapListByProject() {
if (project.endsWith('xty') || project.endsWith('gzb') || project.endsWith('heb')) {
mapList = await getMapListByProjectCode(ProjectCode[project]);
} else {
mapList = await listPublishMap({ 'drawWay': true });
// mapList = await listPublishMap({ 'drawWay': true });
mapList = await getPublishMapListOnline();
}
return mapList;
}

View File

@ -161,15 +161,15 @@ export default {
}
},
jumpjlmap3dmodel() {
if(this.deviceif == false){
this.deviceif = true;
}else{
if (this.deviceShow == false) {
this.deviceShow = true;
if (this.deviceif == false) {
this.deviceif = true;
} else {
this.deviceShow = false;
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
}
}
},
showdriving() {

View File

@ -295,15 +295,15 @@ export default {
// });
// },
devicemodel() {
if(this.deviceif == false){
this.deviceif = true;
}else{
if (this.deviceShow == false) {
this.deviceShow = true;
if (this.deviceif == false) {
this.deviceif = true;
} else {
this.deviceShow = false;
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
}
}
},
/* 地图根据仿真group获取仿真基础信息 */

View File

@ -16,6 +16,11 @@
<el-button type="primary" style="margin: 0 auto;display: block;" @click="create">批量创建</el-button>
</div>
</el-tab-pane>
<el-tab-pane class="view-control" label="批量操作" name="three" :lazy="lazy">
<div class="view-control-content">
<el-button type="primary" style="margin: 0 auto;display: block;" @click="handleDelete">一键删除无效数据</el-button>
</div>
</el-tab-pane>
</el-tabs>
</template>
@ -166,6 +171,26 @@ export default {
this.$message('暂无新车站或车站已有对应紧急停车按钮!');
}
},
//
handleDelete() {
this.$confirm('您是否确定一键删除无用数据?', this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
const models = [];
this.espList.forEach(item => {
const model = this.$store.getters['map/getDeviceByCode'](item.standCode);
if (!model) {
models.push(deepAssign(item, { _dispose: true }));
}
});
models.length && this.$emit('updateMapModel', models);
this.$message.success('删除成功!');
}).catch(() => {
this.$message.info('删除失败');
});
},
updateMapModel(data) {
this.$emit('updateMapModel', data);
this.field = '';

View File

@ -372,62 +372,136 @@ export default {
if (flag) {
if (item.type == '03') {
const switchModel = this.$store.getters['map/getDeviceByCode'](item.relSwitchCode);
models.push(deepAssign(switchModel, { _dispose: true }));
switchModel && models.push(deepAssign(switchModel, { _dispose: true }));
}
if (item.type == '02') {
const parentModel = this.$store.getters['map/getDeviceByCode'](item.parentCode);
parentModel && models.push(deepAssign(parentModel, { _dispose: true }));
}
if (item.type == '01') {
item.logicSectionCodeList && item.logicSectionCodeList.forEach(code => {
const childModel = this.$store.getters['map/getDeviceByCode'](code);
childModel && models.push(deepAssign(childModel, { _dispose: true }));
});
}
models.push(deepAssign(item, { _dispose: true }));
}
}
});
map.lineList.forEach(item => {
map.lineList && map.lineList.forEach(item => {
const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
});
map.trainWindowList.forEach(item => {
map.trainWindowList && map.trainWindowList.forEach(item => {
const flag = this.fromModel.right ? item.point.x > pointX : item.point.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
});
map.powerLineList.forEach(item => {
map.powerLineList && map.powerLineList.forEach(item => {
const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
});
map.signalList.forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
});
map.stationList.forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
const arrList = ['signalList', 'stationList', 'psdList', 'axleCounterResetButtonList', 'tbStrategyList', 'zcList', 'cycleButtonList', 'totalGuideLockButtonVOList', 'automaticRouteButtonList', 'outerFrameList', 'directionRodList', 'textList'];
arrList.forEach(itemName => {
map[itemName] && map[itemName].forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
});
});
map.stationStandList.forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
const esp = map.espList.find(ele => ele.standCode == item.code);
models.push(deepAssign(esp, { _dispose: true }));
}
});
map.psdList.forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
}
});
map.textList.forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
if (flag) {
models.push(deepAssign(item, { _dispose: true }));
esp && models.push(deepAssign(esp, { _dispose: true }));
}
});
// map.signalList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// map.stationList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// map.psdList && map.psdList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// //
// map.axleCounterResetButtonList && map.axleCounterResetButtonList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// // GQX
// map.tbStrategyList && map.tbStrategyList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// map.zcList && map.zcList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// //
// map.cycleButtonList && map.cycleButtonList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// //
// map.totalGuideLockButtonVOList && map.totalGuideLockButtonVOList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// //
// map.automaticRouteButtonList && map.automaticRouteButtonList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// //
// map.outerFrameList && map.outerFrameList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// //
// map.directionRodList && map.directionRodList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
// map.textList && map.textList.forEach(item => {
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
// if (flag) {
// models.push(deepAssign(item, { _dispose: true }));
// }
// });
if (this.fromModel.right && section.rightSectionCode) {
section.rightSectionCode = '';
}

View File

@ -683,12 +683,13 @@ export default {
if (selected.type == '01') {
selected.logicSectionCodeList && selected.logicSectionCodeList.forEach(code => {
const selectedLocl = this.$store.getters['map/getDeviceByCode'](code);
const trainWindowModel = this.$store.getters['map/getDeviceByCode'](selectedLocl.trainWindowCode);
trainWindowModel && models.push(deepAssign(trainWindowModel, { _dispose: true }));
if (selectedLocl) {
const trainWindowModel = this.$store.getters['map/getDeviceByCode'](selectedLocl.trainWindowCode);
trainWindowModel && models.push(deepAssign(trainWindowModel, { _dispose: true }));
}
});
}
models = [...models, ...deleteObjAssociatedSection];
// console.log(models, '=====');
this.$emit('updateMapModel', models);
this.clear();
}).catch(error => {

View File

@ -25,9 +25,6 @@ export default {
const createArr = []; // model
const changeSectionList = this.changeSectionAttr();
changeSectionList.forEach(section => {
// if (section.code == 'T449' || section.code == 'T501' || section.code == 'T502') {
// debugger;
// }
if (!section.rightSectionCode) { //
const list = this.findSectionA(section.points[section.points.length - 1].x, section.points[section.points.length - 1].y);
let sectionB = {};
@ -161,53 +158,58 @@ export default {
changeSectionAttr() {
const changeSectionList = []; //
this.sectionList.forEach(section => {
const oneSection = section.points[section.points.length - 1];
const oneSectionStar = section.points[0];
let countA = 0;
let countB = 0;
this.sectionList.forEach(elem => {
const twoSection = elem.points[0];
const twoSectionEnd = elem.points[elem.points.length - 1];
if (oneSection.x == twoSection.x && oneSection.y == twoSection.y) {
countA++;
if (countA >= 2) {
if (!this.checkAddListA(oneSection, section.code)) { //
const sectionModel = deepAssign({}, section);
sectionModel.rightSectionCode = '';
sectionModel.sepTypeRight = '00'; //
sectionModel.type = '03';
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
list.forEach(elem => {
const sectionModel = deepAssign({}, elem);
sectionModel.leftSectionCode = '';
sectionModel.sepTypeLeft = '00';
sectionModel.type = '03';
changeSectionList.push(sectionModel);
});
changeSectionList.push(sectionModel);
if (section.type == '01') {
const oneSection = section.points[section.points.length - 1];
const oneSectionStar = section.points[0];
let countA = 0;
let countB = 0;
console.log(changeSectionList);
this.sectionList.forEach(elem => {
if (elem.type == '01') {
const twoSection = elem.points[0];
const twoSectionEnd = elem.points[elem.points.length - 1];
if (oneSection.x == twoSection.x && oneSection.y == twoSection.y) {
countA++;
if (countA >= 2) {
if (!this.checkAddListA(oneSection, section.code)) { //
const sectionModel = deepAssign({}, section);
sectionModel.rightSectionCode = '';
sectionModel.sepTypeRight = '00'; //
sectionModel.type = '03';
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
list.forEach(elem => {
const sectionModelElem = deepAssign({}, elem);
sectionModelElem.leftSectionCode = '';
sectionModelElem.sepTypeLeft = '00';
sectionModelElem.type = '03';
changeSectionList.push(sectionModelElem);
});
changeSectionList.push(sectionModel);
}
}
} else if (oneSectionStar.x == twoSectionEnd.x && oneSectionStar.y == twoSectionEnd.y) {
countB++;
if (countB >= 2) {
if (!this.checkAddListB(oneSectionStar, section.code)) { //
const sectionModel = deepAssign({}, section);
sectionModel.leftSectionCode = '';
sectionModel.sepTypeLeft = '00';
sectionModel.type = '03';
const list = this.findSectionB(sectionModel.points[0].x, sectionModel.points[0].y);
list.forEach(elem => {
const sectionModelElem = deepAssign({}, elem);
sectionModelElem.rightSectionCode = '';
sectionModelElem.sepTypeRight = '00'; //
sectionModelElem.type = '03';
changeSectionList.push(sectionModelElem);
});
changeSectionList.push(sectionModel);
}
}
}
}
} else if (oneSectionStar.x == twoSectionEnd.x && oneSectionStar.y == twoSectionEnd.y) {
countB++;
if (countB >= 2) {
if (!this.checkAddListB(oneSectionStar, section.code)) { //
const sectionModel = deepAssign({}, section);
sectionModel.leftSectionCode = '';
sectionModel.sepTypeLeft = '00';
sectionModel.type = '03';
const list = this.findSectionB(sectionModel.points[0].x, sectionModel.points[0].y);
list.forEach(elem => {
const sectionModel = deepAssign({}, elem);
sectionModel.rightSectionCode = '';
sectionModel.sepTypeRight = '00'; //
sectionModel.type = '03';
changeSectionList.push(sectionModel);
});
changeSectionList.push(sectionModel);
}
}
}
});
});
}
});
return changeSectionList;
},
@ -249,7 +251,6 @@ export default {
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
// const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
// if (!parentSectionModel) { //
if (switchSectionList.indexOf(elem.code) == -1) {
let uid;
@ -268,7 +269,7 @@ export default {
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
if (sectiona1 && sectionc1 && sectionb1 && sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
ele['uid'] = uid;
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
sectiona1.parentCode = uid;
@ -283,12 +284,6 @@ export default {
}
});
}
// } else {
// parentSectionModel.relevanceSectionList.push(elem.sectionACode);
// parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
// parentSectionModel.relevanceSectionList.push(elem.sectionCCode);
// models.push(parentSectionModel);
// }
sectiona.relSwitchCode = elem.code;
sectionb.relSwitchCode = elem.code;
sectionc.relSwitchCode = elem.code;
@ -298,8 +293,6 @@ export default {
sectiona.switchSection = true;
sectionb.switchSection = true;
sectionc.switchSection = true;
// sectionb.sepTypeLeft = '00';
// sectionb.sepTypeRight = '00';
models.push(sectiona);
models.push(sectionb);
models.push(sectionc);

View File

@ -1,5 +1,6 @@
<template>
<div style="position:relative">
<div>
<!-- style="position:relative" -->
<div class="scriptRecordNew" :style="{bottom:(offsetBottom-15)+'px'}">
<div v-show="isShow" class="scriptRecordNewIn">
<el-tabs type="card">