运行图预览

This commit is contained in:
joylink_fanyuhong 2020-02-27 22:17:33 +08:00
parent 543b3c1259
commit b880101a46
2 changed files with 16 additions and 16 deletions

View File

@ -113,7 +113,7 @@ export default {
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
pointdata.coord = [train.stationTimeList[1].secondTime || train.stationTimeList[1].second, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
opt.markPointData.push(createMartPoint(pointdata));
@ -125,10 +125,10 @@ export default {
train.stationTimeList.forEach((elem, index) => {
idx = index;
if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode ||
index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime ||
index == train.stationTimeList.length - 2 && (train.stationTimeList[index].secondTime || train.stationTimeList[index].second) != (train.stationTimeList[index + 1].secondTime|| train.stationTimeList[index + 1].secondTime) ||
index > 0 && index < train.stationTimeList.length - 1) {
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
opt.data.push([elem.secondTime || elem.second, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -138,8 +138,8 @@ export default {
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
opt.data.push([lastPoint.secondTime || lastPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime || nextPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}
/** 如果是备用车,按车次添加线*/
@ -201,21 +201,21 @@ export default {
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
return parseInt(a.secondTime) - parseInt(b.secondTime);
return parseInt(a.secondTime || a.second) - parseInt(b.secondTime || b.second);
});
/** 如果此记录车组号的数据为第一条时,则打上标签*/
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
coord: [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
color: lineStyle.color || '#000'
}));
}
/** 计算折返点*/
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode];
var nextPoint = [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode];
if (serie.data.length > 0) {
var lastPoint = serie.data[serie.data.length - 1];
if (lastPoint[2] !== nextPoint[2]) {

View File

@ -93,7 +93,7 @@ export default {
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
pointdata.coord = [train.stationTimeList[1].secondTime || train.stationTimeList[1].second, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
opt.markPointData.push(createMartPoint(pointdata));
@ -105,10 +105,10 @@ export default {
train.stationTimeList.forEach((elem, index) => {
idx = index;
if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode ||
index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime ||
index == train.stationTimeList.length - 2 && (train.stationTimeList[index].secondTime || train.stationTimeList[index].second) != (train.stationTimeList[index + 1].secondTime || train.stationTimeList[index + 1].second) ||
index > 0 && index < train.stationTimeList.length - 1) {
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
opt.data.push([elem.secondTime || elem.second, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -118,8 +118,8 @@ export default {
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
opt.data.push([lastPoint.secondTime || lastPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime || nextPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}
/** 如果是备用车,按车次添加线*/
@ -179,21 +179,21 @@ export default {
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
return parseInt(a.secondTime) - parseInt(b.secondTime);
return parseInt(a.secondTime || a.second) - parseInt(b.secondTime || b.second);
});
/** 如果此记录车组号的数据为第一条时,则打上标签*/
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
coord: [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
color: lineStyle.color || '#000'
}));
}
/** 计算折返点*/
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode];
var nextPoint = [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode];
if (serie.data.length > 0) {
var lastPoint = serie.data[serie.data.length - 1];
if (lastPoint[2] !== nextPoint[2]) {