From fe64262a6726630e0f484067b135c60b9733e298 Mon Sep 17 00:00:00 2001 From: lVAL Date: Wed, 28 Oct 2020 18:18:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9AUSTool=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BF=90=E8=A1=8C=E5=9B=BE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/theme/aus_00/planConvert.js | 4 ++-- src/utils/baseUrl.js | 4 ++-- src/utils/date.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) 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/utils/baseUrl.js b/src/utils/baseUrl.js index 1628a46bf..e459aa552 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,8 +2,8 @@ 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 = 'http://192.168.8.107:9000'; // 袁琪 + // 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'; // 旭强 // BASE_API = 'http://192.168.3.175: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]; From b76f963a7be0500edbc3a4fec659ba1caa343676 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 28 Oct 2020 18:34:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BD=E8=B5=9B?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/theme/race_01/planConvert.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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); } }