diff --git a/src/jmapNew/shape/graph/Section/index.js b/src/jmapNew/shape/graph/Section/index.js index 16c7f5c56..43e7fcfef 100644 --- a/src/jmapNew/shape/graph/Section/index.js +++ b/src/jmapNew/shape/graph/Section/index.js @@ -57,8 +57,10 @@ export default class Section extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; - model.points = store.getters['map/amendPoints'](this._code, model.points); - // console.log(store.getters['map/amendPoints'](this._code, model.points), '5555555'); + const amendData = store.getters['map/amendPoints'](this._code); + if (amendData) { + model.points = amendData.points; + } this.z = 5 + parseInt(model.layer || 0); this.model = model; this.style = style; diff --git a/src/jmapNew/shape/graph/Signal/index.js b/src/jmapNew/shape/graph/Signal/index.js index ab49dc8dc..e944e1039 100644 --- a/src/jmapNew/shape/graph/Signal/index.js +++ b/src/jmapNew/shape/graph/Signal/index.js @@ -189,6 +189,11 @@ class Signal extends Group { super(); this._code = model.code; this._type = model._type; + const amendData = store.getters['map/amendPoints'](this._code); + if (amendData) { + model.position = amendData.position; + model.rotate = amendData.rotate; + } this.model = model; this.mapDevice = mapDevice; this.style = style; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index e56d97487..9c14fc6dc 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -666,23 +666,21 @@ const map = { return device; }, - amendPoints: state => (code, points) => { + amendPoints: state => (code) => { + let amendData = null; if (state.map && state.map.displayList && state.map.displayList.length && store.state.training.prdType) { - let returnPoints = points; state.map.displayList.forEach(item => { - const section = findElement(item.amendPointsList || [], code); - if (store.state.training.prdType === '01' && item.type === 'LOCAL' && section) { - returnPoints = section.points; - } else if (['02', '04', '05'].includes(store.state.training.prdType) && item.type === 'CENTER' && section) { - returnPoints = section.points; - } else if (store.state.training.prdType === '09' && item.type === 'DEPOT_IL' && section) { - returnPoints = section.points; + const tepData = findElement(item.amendPointsList || [], code); + if (store.state.training.prdType === '01' && item.type === 'LOCAL' && tepData) { + amendData = tepData; + } else if (['02', '04', '05'].includes(store.state.training.prdType) && item.type === 'CENTER' && tepData) { + amendData = tepData; + } else if (store.state.training.prdType === '09' && item.type === 'DEPOT_IL' && tepData) { + amendData = tepData; } }); - return returnPoints; - } else { - return points; } + return amendData; }, checkDeviceShow: state => deviceCode => { if (state.map && state.map.displayList && state.map.displayList.length && store.state.training.prdType) { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 148e2349a..208ce6f86 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,10 +2,10 @@ 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.152:9000'; // 袁琪 - // BASE_API = 'http://192.168.8.177:9000'; // 旭强 - BASE_API = 'http://192.168.8.109:9000'; // 张赛 + // BASE_API = 'http://192.168.8.172:9200'; // 旭强 + // BASE_API = 'http://192.168.8.109:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index 5713372ec..7eda1e189 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -124,6 +124,7 @@ export default { }, beforeDestroy() { clearSimulation(this.group); + this.$store.dispatch('training/setSimulationUserList', []); this.$store.dispatch('training/reset'); // this.$store.dispatch('map/mapClear'); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue index ca60e03a9..3d3c82211 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue @@ -19,7 +19,7 @@
- 修正区段列表 + 修正设备列表
+ + + 坐标点: + + + + , + + + + + + 旋转角度: + + + + +
@@ -155,6 +173,17 @@ export default { } } }, + checkDeviceType(data, prop) { + if (data.code) { + const device = this.$store.getters['map/getDeviceByCode'](data.code); + if (device._type === 'Section' && prop === 'points') { + return true; + } else if (device._type === 'Signal' && (prop === 'position' || prop === 'rotate')) { + return true; + } + } + return false; + }, getDeviceName(code) { const device = this.$store.getters['map/getDeviceByCode'](code); return device.name || device.code; @@ -192,7 +221,7 @@ export default { }); }, addAmendPoints() { - this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }] }); + this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }], position: {x: 0, y: 0}, rotate:0 }); }, delAmendPoints(index) { this.amendPointsList.splice(index, 1); @@ -226,28 +255,33 @@ export default { type: 'CENTER', elementList: [] }; - const station = this.stationList.find(item => item.depot); + const stationCodes = []; + this.stationList.forEach(item => { + if (item.depot) { + stationCodes.push(item.code); + } + }); [...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList, ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList, ...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => { - if (item.stationCode !== station.code) { + if (!stationCodes.includes(item.stationCode)) { this.addModel.elementList.push(item.code); } }); [...this.directionRodList].forEach(item => { - if (item.deviceStationCode !== station.code) { + if (!stationCodes.includes(item.deviceStationCode)) { this.addModel.elementList.push(item.code); } }); this.stationList.forEach(item => { - if (item.code !== station.code) { + if (!stationCodes.includes(item.code)) { this.addModel.elementList.push(item.code); } }); this.psdList.forEach(item => { const stand = this.$store.getters['map/getDeviceByCode'](item.standCode); - if (stand.stationCode !== station.code) { + if (!stationCodes.includes(stand.stationCode)) { this.addModel.elementList.push(item.code); } }); diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue index 60adde042..acd563a46 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/depotConfig.vue @@ -70,16 +70,16 @@ - - + + 坐标点: @@ -94,6 +94,24 @@ + + + 坐标点: + + + + , + + + + + + 旋转角度: + + + + +
@@ -211,6 +229,17 @@ export default { const device = this.$store.getters['map/getDeviceByCode'](code); return device.name || device.code; }, + checkDeviceType(data, prop) { + if (data.code) { + const device = this.$store.getters['map/getDeviceByCode'](data.code); + if (device._type === 'Section' && prop === 'points') { + return true; + } else if (device._type === 'Signal' && (prop === 'position' || prop === 'rotate')) { + return true; + } + } + return false; + }, deleteModel(list, index) { list.splice(index, 1); this.list.pop(); @@ -300,7 +329,7 @@ export default { this.cardMode = 'generate'; }, addAmendPoints() { - this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }] }); + this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }], position: {x: 0, y: 0}, rotate:0 }); }, delAmendPoints(index) { this.amendPointsList.splice(index, 1); diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue index f940fc65e..2f8e377ac 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue @@ -81,7 +81,7 @@ - - + + 坐标点: @@ -105,6 +105,24 @@ + + + 坐标点: + + + + , + + + + + + 旋转角度: + + + + + @@ -232,6 +250,17 @@ export default { const device = this.$store.getters['map/getDeviceByCode'](code); return device.name || device.code; }, + checkDeviceType(data, prop) { + if (data.code) { + const device = this.$store.getters['map/getDeviceByCode'](data.code); + if (device._type === 'Section' && prop === 'points') { + return true; + } else if (device._type === 'Signal' && (prop === 'position' || prop === 'rotate')) { + return true; + } + } + return false; + }, deleteModel(list, index) { list.splice(index, 1); this.list.pop(); @@ -373,7 +402,7 @@ export default { }); }, addAmendPoints() { - this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }] }); + this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }], position: {x: 0, y: 0}, rotate:0 }); }, delAmendPoints(index) { this.amendPointsList.splice(index, 1); diff --git a/src/views/publish/publishMap/exportMap.vue b/src/views/publish/publishMap/exportMap.vue index 8ae12dcb7..801479c10 100644 --- a/src/views/publish/publishMap/exportMap.vue +++ b/src/views/publish/publishMap/exportMap.vue @@ -1,7 +1,7 @@