diff --git a/src/jmapNew/theme/fuzhou_01/planConvert.js b/src/jmapNew/theme/fuzhou_01/planConvert.js index 001dc5030..3e233bad3 100644 --- a/src/jmapNew/theme/fuzhou_01/planConvert.js +++ b/src/jmapNew/theme/fuzhou_01/planConvert.js @@ -12,6 +12,11 @@ export default { /** excel解析配置*/ ExcelConfig: { + // beginRow: 1, + // beginCol: 0, + // fieldNum: 10, + // trainId: '车次号', + // columns: ['备注', '车次号'] beginRow: 1, beginCol: 0, // fieldNum: 10, @@ -156,6 +161,114 @@ export default { return JsonData; }, + // /** 解析exal数据转换为Json后台数据*/ + // importData(Sheet, JsonData) { + // const dataList = convertSheetToList(Sheet, true); + // if (dataList && dataList.length && dataList[1] && dataList[0]) { + // const tIndex = 8; // 设置不用过滤行数 + // /** 解析二维数组为json对象*/ + // const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00 + // const reg4 = /[▼|▲|¡|ø|¨|‹]+/; // ▲ + // dataList.forEach((elem, i) => { + // var begin = -1; + // /** 跳过名称所在的行*/ + // if (i != tIndex && elem && elem.length > 0) { + // let flag = false; + // let param = { begTime: '', endTime: '' }; + // if (i > tIndex) { elem.reverse(); } + // let interval = 1; + // for (let j = 0; j < elem.length;) { + // const item = elem[j]; + // let title = ''; + // var value = `${item}`.trim(); + // if (i > tIndex) { // 上行线 + // title = `${dataList[tIndex][dataList[tIndex].length - j - 1]}`.replace(/\s*/g, ''); + // if (title == 'undefined') { + // title = `${dataList[tIndex][dataList[tIndex].length - j - 2]}`.replace(/\s*/g, ''); + // } + // } else { // 下行线 + // title = `${dataList[tIndex][j]}`.replace(/\s*/g, ''); + // if (title == 'undefined') { + // title = `${dataList[tIndex][j - 1]}`.replace(/\s*/g, ''); + // } + // } + + // /** 匹配到开始位置或者结束位置*/ + // if (title == this.ExcelConfig.trainId && value != 'undefined') { + // if (begin == -1) { + // interval = 2; + // flag = true; + // begin = value; // 设置初始索引 + // JsonData.push({ + // code: value, + // destinationCode: '', + // arrivalList: [] + // }); + // } else if (flag) { + // interval = 1; + // begin = -1; // 清空初始索引 + // JsonData[JsonData.length - 1].destinationCode = value; + // flag = false; + // } + // } else if (title == this.ExcelConfig.columns[0]) { + // interval = 1; + // } else if (begin !== -1) { + // const item1 = `${elem[j]}`.trim(); + // const item2 = `${elem[j + 1]}`.trim(); + // if (item1 != 'undefined' || item2 != 'undefined') { + // /** 匹配到中间位置*/ + // var stationName = title.replace(/\s/, ''); + // const flag = reg3.test(item1) || reg3.test(item2); + // if (this.ExcelConfig.columns.indexOf(stationName) == -1 && flag) { + // let need = false; + // if (value.split(':')[0] == '24') { // 24:XX:XX 类似这种数据 变24为00 + // const arr = value.split(':'); + // arr[0] = '00'; + // value = arr.join(':'); + // } + // const item1 = elem[j] ? `${elem[j]}`.trim() : ''; + // const item2 = elem[j + 1] ? `${elem[j + 1]}`.trim() : ''; + // if (item1 && item2) { + // param.begTime = item1; + // param.endTime = item2; + // } else if (item1 && !item2) { + // param.begTime = item1; + // param.endTime = item1; + // } else if (!item1 && item2) { + // param.begTime = item2; + // param.endTime = item2; + // } + + // if (param.begTime && param.endTime) { + // need = true; + // } + + // /** 添加json数据*/ + // if (need) { // 储存非空 数据 + // var stationObj = { + // stationName: stationName + // }; + // if (reg4.test(param.begTime)) { + // param.begTime = ''; + // } + // if (reg4.test(param.endTime)) { + // param.endTime = ''; + // } + // stationObj['arriveTime'] = prefixTime(param.begTime); + // stationObj['departureTime'] = prefixTime(param.endTime); + // JsonData[JsonData.length - 1].arrivalList.push(stationObj); + // param = { begTime: '', endTime: '' }; + // } + // } + // } + // } + // j = j + interval; + // } + // } + // }); + // } + // return JsonData; + // }, /** 将后台数据解析成图表*/ convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) { diff --git a/src/jmapNew/theme/race_01/planConvert.js b/src/jmapNew/theme/race_01/planConvert.js index e6761ee67..48b2e1f55 100644 --- a/src/jmapNew/theme/race_01/planConvert.js +++ b/src/jmapNew/theme/race_01/planConvert.js @@ -222,13 +222,13 @@ export default { /** 计算折返点*/ elem.right = elem.tripNumber[0] == '2'; - var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.right]; + var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.tripNumber, elem.right]; 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]]); + serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[3], num), lastPoint[3]]); + serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[3], num), lastPoint[3]]); } } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index eda05cc52..408bf264a 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ 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.8.144:9000'; // 旭强 // BASE_API = 'http://192.168.3.175:9000'; // 张赛 - BASE_API = 'http://192.168.8.110:9000'; // 杜康 + // BASE_API = 'http://192.168.8.110:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 diff --git a/src/views/newMap/newMapdraft/index.vue b/src/views/newMap/newMapdraft/index.vue index cfdba59e4..d5f6b6f0e 100644 --- a/src/views/newMap/newMapdraft/index.vue +++ b/src/views/newMap/newMapdraft/index.vue @@ -418,7 +418,7 @@ export default { map.stationStandList.forEach(stationStand => { const section = this.$store.getters['map/getDeviceByCode'](stationStand.standTrackCode); const list = []; - section.points.forEach(point => { + section && section.points.forEach(point => { list.push(point.x); }); if (stationStand.position.x > Math.max(...list) || stationStand.position.x < Math.min(...list)) {