This commit is contained in:
fan 2020-04-23 10:05:15 +08:00
commit 1e03ee1a3b

View File

@ -31,7 +31,7 @@ export default {
if (dataList && dataList.length) { if (dataList && dataList.length) {
for (let colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) { for (let colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) {
let isContinue = true; let isContinue = true;
let tripObj = { code: '', arrivalList: [] }; let tripObj = { code: '', directionCode: '', arrivalList: [] };
for (let rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) { for (let rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
isContinue = false; isContinue = false;
@ -56,10 +56,13 @@ export default {
} }
if (valueStr != tripObj.code) { if (valueStr != tripObj.code) {
JsonData.push(tripObj); JsonData.push(tripObj);
tripObj = { code: valueStr, arrivalList: [] }; const strVal = `${value}`.trim();
tripObj = { code: valueStr, directionCode: strVal[0], arrivalList: [] };
} }
} else { } else {
const strVal = `${value}`.trim();
tripObj.code = valueStr; tripObj.code = valueStr;
tripObj.directionCode = strVal[0];
} }
} }
@ -117,7 +120,8 @@ export default {
/** 如果车次号为空,不显示名称*/ /** 如果车次号为空,不显示名称*/
if (train.tripNumber) { if (train.tripNumber) {
/** 创建标记点名称和坐标*/ /** 创建标记点名称和坐标*/
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; // pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color; pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode; 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, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];