diff --git a/src/jmapNew/theme/xian_01/planConvert.js b/src/jmapNew/theme/xian_01/planConvert.js index 964e84bea..fdbf73e59 100644 --- a/src/jmapNew/theme/xian_01/planConvert.js +++ b/src/jmapNew/theme/xian_01/planConvert.js @@ -31,7 +31,7 @@ export default { if (dataList && dataList.length) { for (let colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) { let isContinue = true; - let tripObj = { code: '', arrivalList: [] }; + let tripObj = { code: '', directionCode: '', arrivalList: [] }; for (let rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) { isContinue = false; @@ -56,10 +56,13 @@ export default { } if (valueStr != tripObj.code) { JsonData.push(tripObj); - tripObj = { code: valueStr, arrivalList: [] }; + const strVal = `${value}`.trim(); + tripObj = { code: valueStr, directionCode: strVal[0], arrivalList: [] }; } } else { + const strVal = `${value}`.trim(); tripObj.code = valueStr; + tripObj.directionCode = strVal[0]; } } @@ -117,7 +120,8 @@ export default { /** 如果车次号为空,不显示名称*/ 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.directionCode = train.directionCode; pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];