This commit is contained in:
fan 2020-05-14 11:03:33 +08:00
commit f95d5e46d7
15 changed files with 119 additions and 136 deletions

View File

@ -597,7 +597,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 20, // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
trainConntWidth: 3, // 列车竖杠的宽度 trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000'// 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -540,7 +540,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 4, // 列车竖杠的宽度 trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -717,7 +717,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 3, // 列车竖杠的宽度 trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -574,7 +574,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 18, // 列车车头矩形高度 trainHeadRectHeight: 18, // 列车车头矩形高度
trainConntWidth: 5, // 列车竖杠的宽度 trainConntWidth: 5, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
useSelfFormat: true, useSelfFormat: true,

View File

@ -567,7 +567,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度 trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 17, // 列车高度 trainHeight: 17, // 列车高度

View File

@ -618,7 +618,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 0, // 列车竖杠的宽度 trainConntWidth: 0, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
hasTravelSigns: true, // 是否有行进标志 hasTravelSigns: true, // 是否有行进标志

View File

@ -577,7 +577,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量
trainConntWidth: 2, // 列车竖杠的宽度 trainConntWidth: 2, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -81,7 +81,7 @@ class SkinCode extends defaultStyle {
textShadowColor: '#22DFDF', textShadowColor: '#22DFDF',
nameShow: false, nameShow: false,
lineDash: '', lineDash: '',
lineWidthMore: 0 lineWidthMore: 5
}, },
line: { line: {
width: 5, // 区段宽度 width: 5, // 区段宽度
@ -594,7 +594,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度 trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 17, // 列车高度 trainHeight: 17, // 列车高度

View File

@ -88,7 +88,7 @@ class SkinCode extends defaultStyle {
beyondWidth: 0, // 区段宽超出宽度 beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#FFFFFF', // 区段侵入颜色 invadeColor: '#FFFFFF', // 区段侵入颜色
spareColor: '#AAA9A9', // 区段空闲颜色 spareColor: '#AAA9A9', // 区段空闲颜色
communicationOccupiedColor: '#FF00FF', // 区段通信车占用颜色 communicationOccupiedColor: '#DE310C', // 区段通信车占用颜色
unCommunicationOccupiedColor: '#DE310C', // 区段非通讯车占用颜色 unCommunicationOccupiedColor: '#DE310C', // 区段非通讯车占用颜色
routeLockColor: '#52BD5F', // 区段进路锁定颜色 routeLockColor: '#52BD5F', // 区段进路锁定颜色
faultLockColor: '#006400', // 区段故障锁定颜色 faultLockColor: '#006400', // 区段故障锁定颜色
@ -679,16 +679,18 @@ class SkinCode extends defaultStyle {
textAContent: '警' // textA文本 textAContent: '警' // textA文本
}, },
trainNumber: { trainNumber: {
targetCodePrefix: '000', // 目的地码前缀 targetCodePrefix: '00', // 目的地码前缀
defaultTargetCode: 'DDD', // 默认目的地码 defaultTargetCode: 'DD', // 默认目的地码
trainTargetTextAlign: 'left', // 目的地码文字显示位置 trainTargetTextAlign: 'left', // 目的地码文字显示位置
trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量 trainNumberOffset: { x: 24, y: 4}, // 目的地码偏移量
fontColor: '#000000'
}, },
trainServer: { trainServer: {
serviceNumberPrefix: '000', // 服务号(表号)前缀 serviceNumberPrefix: '000', // 服务号(表号)前缀
defaultServiceNumber: 'TTT', // 默认服务号(表号) defaultServiceNumber: 'TTT', // 默认服务号(表号)
defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色 defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色
trainServerOffset: { x: 4, y: 4} // 列车服务号偏移 trainServerOffset: { x: 4, y: 4}, // 列车服务号偏移
fontColor: '#000000'
}, },
trainTarget: { trainTarget: {
tripNumberPrefix: '000', // 车次号前缀 tripNumberPrefix: '000', // 车次号前缀
@ -708,7 +710,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量 trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量
trainConntWidth: 0, // 列车竖杠的宽度 trainConntWidth: 0, // 列车竖杠的宽度
trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色 trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'special' // special 西安二号线 停车 列车方向图标不消失 normal 正常
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -93,9 +93,8 @@ class EMouse extends Group {
this.lineBorder.hide(); this.lineBorder.hide();
} else { } else {
const model = this.device.model; const model = this.device.model;
const arr = JSON.parse(JSON.stringify(model.points)); let points = [];
arr.reverse(); const pointsReverse = [];
const points = [];
model.points.forEach((ele, index) => { model.points.forEach((ele, index) => {
let flag = false; let flag = false;
if (index == model.points.length - 1) { if (index == model.points.length - 1) {
@ -103,11 +102,9 @@ class EMouse extends Group {
} else { } else {
this.triangle = new JTriangle(ele, model.points[index + 1]); this.triangle = new JTriangle(ele, model.points[index + 1]);
} }
const directx = this.triangle.drictx;
const directy = this.triangle.dricty; const directy = this.triangle.dricty;
const switchWidth = 5; // 超出宽度多少
if (index > 0) { if (index > 0) {
if (model.points[index - 1].y == ele.y) { if (model.points[index - 1].y == ele.y || index < model.points.length - 1 && model.points[index + 1].y == ele.y) {
flag = true; flag = true;
} }
} else { } else {
@ -116,40 +113,22 @@ class EMouse extends Group {
} }
} }
if (flag) { if (flag) {
const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore; // 超出宽度多少
const param = [ele.x, ele.y + switchWidth]; const param = [ele.x, ele.y + switchWidth];
points.push(param); points.push(param);
const param1 = [ele.x, ele.y - switchWidth];
pointsReverse.unshift(param1);
} else { } else {
const param = [ele.x - directx * this.triangle.getAbsSin(switchWidth), ele.y + directy * this.triangle.getAbsCos(switchWidth)]; const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore + 3;
const T = this.triangle.getAbsCos(switchWidth);
const param = [ele.x - directy * this.triangle.getAbsSin(T), ele.y + this.triangle.getAbsCos(T)];
points.push(param); points.push(param);
const param1 = [ele.x + directy * this.triangle.getAbsSin(T), ele.y - this.triangle.getAbsCos(T)];
pointsReverse.unshift(param1);
} }
}); });
model.points.forEach((ele, index) => { points = points.concat(pointsReverse);
let flag = false;
if (index == model.points.length - 1) {
this.triangle = new JTriangle(model.points[index - 1], ele);
} else {
this.triangle = new JTriangle(ele, model.points[index + 1]);
}
const directx = this.triangle.drictx;
const directy = this.triangle.dricty;
const switchWidth = 5; // 超出宽度多少
if (index > 0) {
if (model.points[index - 1].y == ele.y) {
flag = true;
}
} else {
if (model.points[index + 1].y == ele.y) {
flag = true;
}
}
if (flag) {
const param = [ele.x, ele.y - switchWidth];
points.unshift(param);
} else {
const param = [ele.x + directx * this.triangle.getAbsSin(switchWidth), ele.y - directy * this.triangle.getAbsCos(switchWidth)];
points.unshift(param);
}
});
this.lineBorder = new Polygon({ this.lineBorder = new Polygon({
zlevel: this.device.zlevel, zlevel: this.device.zlevel,
z: this.device.z + 10, z: this.device.z + 10,

View File

@ -282,7 +282,6 @@ export default class Section extends Group {
style: style style: style
}); });
this.add(this.section); this.add(this.section);
if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示) if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示)
this.sectionBlock = new EblockLines({ this.sectionBlock = new EblockLines({
zlevel: this.zlevel, zlevel: this.zlevel,
@ -381,6 +380,7 @@ export default class Section extends Group {
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
if ((model.type == '01' && (!model.logicSectionCodeList || !model.logicSectionCodeList.length)) || model.type == '02' || model.type == '03') {
this.release = new ERelease({ this.release = new ERelease({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
@ -396,6 +396,7 @@ export default class Section extends Group {
this.add(this.release); this.add(this.release);
} }
}
// 创建限速线 // 创建限速线
creatSpeedLimit() { creatSpeedLimit() {

View File

@ -135,7 +135,7 @@ export default class TrainBody extends Group {
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x), x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y), y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
text: targetCode.substring(targetCode.length - style.Train.trainNumber.targetCodePrefix.length), text: targetCode.substring(targetCode.length - style.Train.trainNumber.targetCodePrefix.length),
textFill: style.trainTextColor, textFill: model.style.Train.trainNumber.fontColor || style.trainTextColor,
textStroke: style.trainTextColor, textStroke: style.trainTextColor,
textStrokeWidth: 0, textStrokeWidth: 0,
fontSize: model.fontSize, fontSize: model.fontSize,

View File

@ -291,8 +291,13 @@ export default class Train extends Group {
if (this.style.Train.trainStatusStyle.directionStopType.length > 0) { if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
this.style.Train.trainStatusStyle.directionStopType.forEach((item) => { this.style.Train.trainStatusStyle.directionStopType.forEach((item) => {
if (right === item.type) { if (right === item.type) {
if (this.style.Train.trainHead.directionStopType == 'special') {
this.trainL && this.trainL.setArrowShow(item.lineLShow);
this.trainR && this.trainR.setArrowShow(item.lineRShow);
} else {
this.trainL && this.trainL.setLineShow(item.lineLShow); this.trainL && this.trainL.setLineShow(item.lineLShow);
this.trainR && this.trainR.setLineShow(item.lineRShow); this.trainR && this.trainR.setLineShow(item.lineRShow);
}
return true; return true;
} }
}); });

View File

@ -1026,9 +1026,7 @@ export default {
model.leftStopPointOffset = 5; model.leftStopPointOffset = 5;
model.rightStopPointOffset = model.lengthFact - 5; model.rightStopPointOffset = model.lengthFact - 5;
} }
const changeSectionList = this.handleOtherSectionChange( const changeSectionList = this.handleOtherSectionChange(model);
model
);
models = [model, ...changeSectionList]; models = [model, ...changeSectionList];
this.$emit('updateMapModel', models); this.$emit('updateMapModel', models);
@ -1044,13 +1042,9 @@ export default {
// //
const models = []; const models = [];
const pointModel = []; const pointModel = [];
const slope1 = const slope1 = (this.oldPoint[this.oldPoint.length - 1].y - this.oldPoint[0].y) / (this.oldPoint[this.oldPoint.length - 1].x - this.oldPoint[0].x);
(this.oldPoint[this.oldPoint.length - 1].y -
this.oldPoint[0].y) /
(this.oldPoint[this.oldPoint.length - 1].x -
this.oldPoint[0].x);
this.sectionList.forEach(section => { this.sectionList.forEach(section => {
if (section.parentCode === model.code) { if (section.parentCode === model.code) { //
const copySection = deepAssign({}, section); const copySection = deepAssign({}, section);
copySection.logicSectionShow = model.logicSectionShow; copySection.logicSectionShow = model.logicSectionShow;
// copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); // // copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); //
@ -1061,10 +1055,7 @@ export default {
copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1]; copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1];
} }
models.push(copySection); models.push(copySection);
} else if ( } else if (model.code !== section.code && (section.type === '01' || section.type === '03' || section.type === '02')) {
model.code !== section.code &&
(section.type === '01' || section.type === '03' || section.type === '02')
) {
const copySection = deepAssign({}, section); const copySection = deepAssign({}, section);
let updataFlag = false; let updataFlag = false;
if (model.leftSectionCode !== this.oldLeftSectionCode) { if (model.leftSectionCode !== this.oldLeftSectionCode) {
@ -1089,16 +1080,12 @@ export default {
updataFlag = true; updataFlag = true;
} }
} }
if (model.parentCode == copySection.code) { if (model.parentCode == copySection.code) { //
let lengthFact = 0; let lengthFact = 0;
copySection.logicSectionCodeList.forEach(code => { copySection.logicSectionCodeList.forEach(code => {
if (model.code != code) { if (model.code != code) {
const localSectionModel = this.$store.getters[ const localSectionModel = this.$store.getters['map/getDeviceByCode'](code);
'map/getDeviceByCode' lengthFact += Number(localSectionModel.lengthFact);
](code);
lengthFact += Number(
localSectionModel.lengthFact
);
} }
}); });
lengthFact += model.lengthFact; lengthFact += model.lengthFact;

View File

@ -145,7 +145,7 @@ export default {
models.forEach(item=> { models.forEach(item=> {
logicSectionCodeList.push(item.code); logicSectionCodeList.push(item.code);
}); });
this.editModel.logicSectionCodeList.forEach( logicCode => { this.editModel.logicSectionCodeList.forEach(logicCode => {
const section = this.$store.getters['map/getDeviceByCode'](logicCode); const section = this.$store.getters['map/getDeviceByCode'](logicCode);
models.push(deepAssign(section, {_dispose: true})); models.push(deepAssign(section, {_dispose: true}));
}); });