From 5c9cd85d52d67a17a688c8d3f68f8818c33ba11c Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 24 Sep 2021 16:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=85=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/graph/Section/index.js | 2 + src/store/modules/map.js | 22 ++++- src/utils/baseUrl.js | 1 + .../mapoperate/displayConfig/centerConfig.vue | 96 ++++++++++++++++++- .../mapoperate/displayConfig/depotConfig.vue | 82 +++++++++++++++- .../mapoperate/displayConfig/localConfig.vue | 82 +++++++++++++++- 6 files changed, 279 insertions(+), 6 deletions(-) diff --git a/src/jmapNew/shape/graph/Section/index.js b/src/jmapNew/shape/graph/Section/index.js index 98e70f929..16c7f5c56 100644 --- a/src/jmapNew/shape/graph/Section/index.js +++ b/src/jmapNew/shape/graph/Section/index.js @@ -57,6 +57,8 @@ 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'); this.z = 5 + parseInt(model.layer || 0); this.model = model; this.style = style; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 99080b7b7..e56d97487 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -194,7 +194,9 @@ function filtrationModel(models) { }); return models; } - +function findElement(list, code) { + return list.find(element => element.code === code); +} /** * 实训状态数据 */ @@ -664,6 +666,24 @@ const map = { return device; }, + amendPoints: state => (code, points) => { + 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; + } + }); + return returnPoints; + } else { + return points; + } + }, checkDeviceShow: state => deviceCode => { if (state.map && state.map.displayList && state.map.displayList.length && store.state.training.prdType) { let flag = false; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 1818df808..4255e3a83 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -5,6 +5,7 @@ export function getBaseUrl() { 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.172:9200'; // 旭强 // BASE_API = 'http://192.168.2.183:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue index b079feeca..ca60e03a9 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig.vue @@ -1,7 +1,7 @@ - +
{{ cardTitle }} 清空 @@ -52,6 +52,52 @@
+
+
+
+ 修正区段列表 + +
+ +
+
生成 @@ -86,6 +132,7 @@ export default { stationCodeList: [], elementList: [] }, + amendPointsList: [], list: [], field: '', cardMode: 'generate', @@ -172,6 +219,7 @@ export default { }, editModel(list, index) { this.addModel = list[index]; + this.amendPointsList = this.addModel.amendPointsList ? this.addModel.amendPointsList : []; this.index = index; this.cardMode = 'edit'; }, @@ -181,12 +229,18 @@ export default { }, updateOverlab() { if (this.index || this.index == 0) { - this.clearData(); if (!this.addModel.stationCodeList.length) { this.$messageBox('请选择车站!'); return; } + if (this.amendPointsList.find(elem => !elem.code)) { + this.$messageBox('修正区段未选择!'); + return; + } + this.addModel.amendPointsList = [...this.amendPointsList]; + this.amendPointsList = []; this.tableData.splice(this.index, 1, this.addModel); + this.clearData(); } }, // 删除当前选中 @@ -226,17 +280,37 @@ export default { this.$messageBox('请选择车站!'); return; } + if (this.amendPointsList.find(elem => !elem.code)) { + this.$messageBox('修正区段未选择!'); + return; + } + this.addModel.amendPointsList = [...this.amendPointsList]; + this.amendPointsList = []; this.tableData.push(this.addModel); this.clearData(); }, clear() { this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [] }; + this.amendPointsList = []; }, clearData() { this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [] }; + this.amendPointsList = []; this.index = ''; this.cardMode = 'generate'; }, + addAmendPoints() { + this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }] }); + }, + delAmendPoints(index) { + this.amendPointsList.splice(index, 1); + }, + addPoint(index, points) { + points.splice(index, 0, {x:0, y:0}); + }, + delPoint(index, points) { + points.splice(index, 1); + }, generateData() { this.loading = true; this.tableData = []; @@ -285,6 +359,10 @@ export default { border-left: 4px solid red; margin-bottom: 10px; } + .box-card { + width: 100%; + padding: 5px; + } .list-box{ overflow: hidden; .list-content{ diff --git a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue index 82ba13c64..d0fa0b542 100644 --- a/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue +++ b/src/views/newMap/newMapdraft/mapoperate/displayConfig/localConfig.vue @@ -20,7 +20,7 @@ - +
{{ cardTitle }} 清空 @@ -63,6 +63,52 @@
+
+
+
+ 修正区段列表 + +
+ +
+
按集中站生成 @@ -99,6 +145,7 @@ export default { switchStationCodeList:[], elementList: [] }, + amendPointsList: [], list: [], field: '', cardMode: 'generate', @@ -193,6 +240,7 @@ export default { }, editModel(list, index) { this.addModel = list[index]; + this.amendPointsList = this.addModel.amendPointsList ? this.addModel.amendPointsList : []; this.index = index; this.cardMode = 'edit'; }, @@ -202,7 +250,6 @@ export default { }, updateOverlab() { if (this.index || this.index == 0) { - this.clearData(); if (!this.addModel.stationCodeList.length) { this.$messageBox('请选择车站!'); return; @@ -211,7 +258,14 @@ export default { this.$messageBox('请选择可切换显示的车站!'); return; } + if (this.amendPointsList.find(elem => !elem.code)) { + this.$messageBox('修正区段未选择!'); + return; + } + this.addModel.amendPointsList = [...this.amendPointsList]; + this.amendPointsList = []; this.tableData.splice(this.index, 1, this.addModel); + this.clearData(); } }, // 删除当前选中 @@ -255,14 +309,22 @@ export default { this.$messageBox('请选择可切换显示的车站!'); return; } + if (this.amendPointsList.find(elem => !elem.code)) { + this.$messageBox('修正区段未选择!'); + return; + } + this.addModel.amendPointsList = [...this.amendPointsList]; + this.amendPointsList = []; this.tableData.push(this.addModel); this.clearData(); }, clear() { this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; + this.amendPointsList = []; }, clearData() { this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] }; + this.amendPointsList = []; this.index = ''; this.cardMode = 'generate'; }, @@ -309,6 +371,18 @@ export default { this.$messageBox('保存现地配置失败'); }); }, + addAmendPoints() { + this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }] }); + }, + delAmendPoints(index) { + this.amendPointsList.splice(index, 1); + }, + addPoint(index, points) { + points.splice(index, 0, {x:0, y:0}); + }, + delPoint(index, points) { + points.splice(index, 1); + }, generateData() { this.loading = true; this.tableData = []; @@ -358,6 +432,10 @@ export default { border-left: 4px solid red; margin-bottom: 10px; } + .box-card { + width: 100%; + padding: 5px; + } .list-box{ overflow: hidden; .list-content{