diff --git a/src/jmapNew/theme/aus_00/planConvert.js b/src/jmapNew/theme/aus_00/planConvert.js index ae521da21..398cc102a 100644 --- a/src/jmapNew/theme/aus_00/planConvert.js +++ b/src/jmapNew/theme/aus_00/planConvert.js @@ -43,8 +43,8 @@ export default { planData.areaList && planData.areaList.length) { planData.areaList.forEach(model => { - model.startTime = toTimeStamp(model.startTime); - model.endTime = toTimeStamp(model.endTime); + model.startTime = typeof model.startTime == 'string'? toTimeStamp(model.startTime): model.startTime; + model.endTime = typeof model.endTime == 'string'? toTimeStamp(model.endTime): model.endTime; graphs.push(createRectArea(this.calcAreaArgsByModel(chart, model))); }) } diff --git a/src/jmapNew/theme/race_01/planConvert.js b/src/jmapNew/theme/race_01/planConvert.js index 08dadbb83..c6222b4fa 100644 --- a/src/jmapNew/theme/race_01/planConvert.js +++ b/src/jmapNew/theme/race_01/planConvert.js @@ -114,7 +114,7 @@ export default { 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)]; + pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.right, false)]; /** 给服务对象添加服务名称和标记点*/ opt.markPointData.push(createMartPoint(pointdata)); @@ -130,7 +130,7 @@ export default { index > 0 && index < train.stationTimeList.length - 1) { // ${train.directionCode} const aa = `${train.tripNumber}`; - opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); + opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.right, false), elem.stationCode, aa]); } }); @@ -141,8 +141,8 @@ export default { num = this.computedReentryNumber(train.tripNumber); // ${train.directionCode} const aa = `${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, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.right, true, num), lastPoint.stationCode, aa]); + opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.right, true, num), nextPoint.stationCode, aa]); } /** 如果是备用车,按车次添加线*/ @@ -225,9 +225,9 @@ export default { if (serie.data.length > 0) { var lastPoint = serie.data[serie.data.length - 1]; if (lastPoint[2] !== nextPoint[2]) { - var num = this.computedReentryNumber(elem.tripNumber); - serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2], num), lastPoint[2]]); - serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], num), lastPoint[2]]); + // var num = this.computedReentryNumber(elem.tripNumber); + serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2], elem.right), lastPoint[2]]); + serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], elem.right), lastPoint[2]]); } } @@ -295,10 +295,10 @@ export default { }, /** 根据方向计算y折返偏移量*/ - getYvalueByDirectionCode(defaultVlue, directionCode, num) { - if (directionCode === '1') { + getYvalueByDirectionCode(defaultVlue, right, num) { + if (!right) { defaultVlue -= this.EdgeHeight / 2 * num; - } else if (directionCode === '2') { + } else if (right) { defaultVlue += this.EdgeHeight / 2 * num; } @@ -306,13 +306,13 @@ export default { }, /** 根据elem计算y值*/ - getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial, num) { + getCoordYByElem(stations, kmRangeCoordMap, elem, right, isSpecial, num) { var defaultVlue = 0; var station = stations.find(it => { return it.code == elem.stationCode; }); if (station) { defaultVlue = kmRangeCoordMap[`${station.kmRange}`]; if (isSpecial) { - defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode, num); + defaultVlue = this.getYvalueByDirectionCode(defaultVlue, right, num); } } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index d17861cff..1628a46bf 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,7 +2,7 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.8.144:9000'; // 旭强 diff --git a/src/utils/date.js b/src/utils/date.js index ad7cbd3d6..fbdb8334d 100644 --- a/src/utils/date.js +++ b/src/utils/date.js @@ -16,7 +16,7 @@ export function now() { return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; } -export function timeFormat(usedTime) { +export function timeFormat(usedTime=0) { let hour = 0; let minute = 0; let second = 0; let sumTime = usedTime; if (sumTime) { if (sumTime >= 3600) { @@ -37,8 +37,8 @@ export function timeFormat(usedTime) { // 时分秒转为时间戳 -export function toTimeStamp(time) { - let s = 0; +export function toTimeStamp(time='') { + let s = 0; const hour = time.split(':')[0]; const min = time.split(':')[1]; const sec = time.split(':')[2];