站间透明问题修复2

This commit is contained in:
fan 2022-07-13 17:31:10 +08:00
parent a6ce3b106a
commit 6d34c5fde6
5 changed files with 43 additions and 37 deletions

View File

@ -415,15 +415,17 @@ class Jlmap {
updatePicture(list = []) {
list.forEach(item => {
const device = this.mapDevice[item];
if (device) {
if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) {
const pictureDevice = store.getters['map/getPictureDeviceByCode'](item);
device._dispose = pictureDevice ? pictureDevice.pictureHide : false;
this.$painter.updatePicture(device);
if (device._type === deviceType.Section && device.type === '03') {
this.computedSwitch(device.switch);
this.mapDevice[device.switch.code]._dispose = pictureDevice ? pictureDevice.pictureHide : false;
this.$painter.updatePicture(this.mapDevice[device.switch.code]);
}
try {
if (device._type === deviceType.Section && device.type === '03') {
this.mapDevice[device.switch.code]._dispose = pictureDevice ? pictureDevice.pictureHide : false;
this.computedSwitch(device.switch);
this.$painter.updatePicture(this.mapDevice[device.switch.code]);
}
} catch (e) { console.error(e); }
}
});
}
@ -437,20 +439,22 @@ class Jlmap {
if (cnodeSection && lnodeSection && rnodeSection) {
let sectionCStar, sectionCEnd;
const rnodeSectionPoint = rnodeSection.instance ? rnodeSection.instance.computedPoints : rnodeSection.points;
const cnodeSectionPoint = cnodeSection.instance ? cnodeSection.instance.computedPoints : cnodeSection.points;
if (this.handleResetPoint(rnodeSection.points)) {
sectionCStar = rnodeSection.instance.computedPoints[rnodeSection.points.length - 2];
sectionCEnd = rnodeSection.instance.computedPoints[1];
sectionCStar = rnodeSectionPoint[rnodeSectionPoint.length - 2];
sectionCEnd = rnodeSectionPoint[1];
} else {
sectionCStar = rnodeSection.instance.computedPoints[1];
sectionCEnd = rnodeSection.instance.computedPoints[rnodeSection.points.length - 2];
sectionCStar = rnodeSectionPoint[1];
sectionCEnd = rnodeSectionPoint[rnodeSectionPoint.length - 2];
}
let intersectionStar, intersectionEnd;
if (this.handleResetPoint(cnodeSection.points)) {
intersectionStar = cnodeSection.instance.computedPoints[0];
intersectionEnd = cnodeSection.instance.computedPoints[cnodeSection.points.length - 1];
intersectionStar = cnodeSectionPoint[0];
intersectionEnd = cnodeSectionPoint[cnodeSectionPoint.length - 1];
} else {
intersectionStar = cnodeSection.instance.computedPoints[cnodeSection.points.length - 1];
intersectionEnd = cnodeSection.instance.computedPoints[0];
intersectionStar = cnodeSectionPoint[cnodeSectionPoint.length - 1];
intersectionEnd = cnodeSectionPoint[0];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
this.mapDevice[switchDevice.code].intersection = {

View File

@ -55,32 +55,35 @@ export default class Switch extends Group {
const directy = this.triangle.dricty;
const switchWidth1 = style.Section.line.width / 2;
let directxA = 1;
let sectionATriangle = new JTriangle(sectionAModel.instance.computedPoints[0], sectionAModel.instance.computedPoints[1]);
let sectionBTriangle = new JTriangle(sectionBModel.instance.computedPoints[0], sectionBModel.instance.computedPoints[1]);
let sectionCTriangle = new JTriangle(sectionCModel.instance.computedPoints[0], sectionCModel.instance.computedPoints[1]);
const sectionAPoints = sectionAModel.instance ? sectionAModel.instance.computedPoints : sectionAModel.points;
const sectionBPoints = sectionBModel.instance ? sectionBModel.instance.computedPoints : sectionBModel.points;
const sectionCPoints = sectionCModel.instance ? sectionCModel.instance.computedPoints : sectionCModel.points;
let sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
let sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]);
let sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]);
const sectionAPoint = { x: model.intersection.x, y: model.intersection.y };
if (sectionAModel.instance.computedPoints[0].x == model.intersection.x && sectionAModel.instance.computedPoints[0].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAModel.instance.computedPoints[0], sectionAModel.instance.computedPoints[1]);
if (sectionAPoints[0].x == model.intersection.x && sectionAPoints[0].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
directxA = 1;
}
if (sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 1].x == model.intersection.x && sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 1].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 2], sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 1]);
if (sectionAPoints[sectionAPoints.length - 1].x == model.intersection.x && sectionAPoints[sectionAPoints.length - 1].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAPoints[sectionAPoints.length - 2], sectionAPoints[sectionAPoints.length - 1]);
directxA = -1;
}
if (sectionBModel.instance.computedPoints[0].x == model.intersection.x && sectionBModel.instance.computedPoints[0].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBModel.instance.computedPoints[0], sectionBModel.instance.computedPoints[1]);
if (sectionBPoints[0].x == model.intersection.x && sectionBPoints[0].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]);
}
if (sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 1].x == model.intersection.x && sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 1].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 2], sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 1]);
if (sectionBPoints[sectionBPoints.length - 1].x == model.intersection.x && sectionBPoints[sectionBPoints.length - 1].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBPoints[sectionBPoints.length - 2], sectionBPoints[sectionBPoints.length - 1]);
}
if (sectionCModel.instance.computedPoints[0].x == model.intersection.x && sectionCModel.instance.computedPoints[0].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCModel.instance.computedPoints[0], sectionCModel.instance.computedPoints[1]);
if (sectionCPoints[0].x == model.intersection.x && sectionCPoints[0].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]);
}
if (sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 1].x == model.intersection.x && sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 1].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 2], sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 1]);
if (sectionCPoints[sectionCPoints.length - 1].x == model.intersection.x && sectionCPoints[sectionCPoints.length - 1].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCPoints[sectionCPoints.length - 2], sectionCPoints[sectionCPoints.length - 1]);
}
const swPadding = rateOpen

View File

@ -1023,7 +1023,6 @@ const map = {
state.version = version;
},
setShowCentralizedStationCode: (state, stationCode) => {
console.log(stationCode, '==========');
state.showCentralizedStationCode = stationCode;
},
setShowCentralizedStationNum: state => {

View File

@ -452,7 +452,7 @@ export default {
deviceList.push(deviceCode);
}
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(pictureModel.scaling, pictureModel.origin);
this.$jlmap.updateTransform(pictureModel.scaling || '1', pictureModel.origin);
},
deletePicture() {
if (!this.pictureName) {

View File

@ -69,14 +69,14 @@ export default {
}
},
mouseenter(model) {
if (model._type == 'Section') {
model.instance.mouseover();
}
// if (model._type == 'Section') {
// model.instance.mouseover();
// }
},
mouseleave(model) {
if (model._type == 'Section') {
model.instance.mouseout();
}
// if (model._type == 'Section') {
// model.instance.mouseout();
// }
},
//
delList(model, list) {