调整西安一号线运行图导入

This commit is contained in:
zyy 2020-04-23 09:37:46 +08:00
parent 306e9f4954
commit e5206c8589

View File

@ -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)];