From f6ee224404c02b43ac92a86cc0fe7d966302c3bd Mon Sep 17 00:00:00 2001 From: fan Date: Fri, 14 Oct 2022 14:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jlmap3d/load3ddata.js | 132 ++++++------ src/api/jmap/map.js | 7 + src/api/trainingManage.js | 1 - src/store/modules/map.js | 25 ++- src/utils/baseUrl.js | 4 +- .../mapoperate/simulationMember/index.vue | 203 +++++++++++------- .../publish/publishMap/editSubsystem.vue | 183 ++++++++++------ src/views/publish/publishMap/subsystem.vue | 2 +- 8 files changed, 334 insertions(+), 223 deletions(-) diff --git a/src/api/jlmap3d/load3ddata.js b/src/api/jlmap3d/load3ddata.js index 2c753adb1..ff67d4df9 100644 --- a/src/api/jlmap3d/load3ddata.js +++ b/src/api/jlmap3d/load3ddata.js @@ -2,85 +2,85 @@ import request from '@/utils/request'; /** 根据皮肤获取地图版本信息*/ export function getPublishMapVersion(id) { - return request({ - url: `/api/map/${id}/version`, - method: 'get' - }); + return request({ + url: `/api/map/${id}/version`, + method: 'get' + }); } /** 根据皮肤获取发布地图详细内容*/ export function getPublishMapDetail(id) { - const datad = request({ - url: `/api/map/${id}/graphData`, - method: 'get' - }); - return datad.then(); + const datad = request({ + url: `/api/map/${id}/graphData`, + method: 'get' + }); + return datad.then(); } /** 根据地图id获取地图信息*/ export function getPublishMapInfo(mapId) { - return request({ - url: `/api/map/${mapId}`, - method: 'get' - }); + return request({ + url: `/api/map/${mapId}`, + method: 'get' + }); } /** 获取草稿地图详细内容*/ export function getMapDetail(id) { - return request({ - url: `/api/mapBuild/${id}/mapDataDetail`, - method: 'get' - }); + return request({ + url: `/api/mapBuild/${id}/mapDataDetail`, + method: 'get' + }); } /** 创建地图3d数据*/ export function set3dMapData(data) { - return request({ - url: `/api/mapBuild/3dMapData`, - method: 'post', - data: data - }); + return request({ + url: `/api/mapBuild/3dMapData`, + method: 'post', + data: data + }); } /** 通过地图id获取地图3d数据*/ export function get3dMapData(mapId) { - return request({ - url: `/api/mapBuild/3dMapData/${mapId}`, - method: 'get' - }); + return request({ + url: `/api/mapBuild/3dMapData/${mapId}`, + method: 'get' + }); } /** 更新地图3d数据*/ export function update3dMapData(data) { - return request({ - url: `/api/mapBuild/3dMapData/${data.id}`, - method: 'put', - data: data - }); + return request({ + url: `/api/mapBuild/3dMapData/${data.id}`, + method: 'put', + data: data + }); } /** 获取模型资源列表*/ export function loadmap3dModel() { - return request({ - url: `/api/map3dModel/all`, - method: 'get' - }); + return request({ + url: `/api/map3dModel/all`, + method: 'get' + }); } export function getPublish3dMapDetail(id) { - const datad = request({ - url: `/api/map/${id}/3dMapData`, - method: 'get' - }); - return datad.then(); + const datad = request({ + url: `/api/map/${id}/3dMapData`, + method: 'get' + }); + return datad.then(); } /** 录制托管*/ -export function tuoguan3ddrive(group,data) { - return request({ - url: `/api/scriptSimulation/${group}/trust`, - method: 'put', - data: data - }); +export function tuoguan3ddrive(group, data) { + return request({ + url: `/api/scriptSimulation/${group}/trust`, + method: 'put', + data: data + }); } /** 三维设备故障钩锁操作*/ @@ -101,33 +101,33 @@ export function saveStationManagerData(data) { }); } // 更新数据 -export function updateStationManagerData(id,data) { - return request({ - url: `/api/pfp/${id}`, - method: 'put', - data: data - }); +export function updateStationManagerData(id, data) { + return request({ + url: `/api/pfp/${id}`, + method: 'put', + data: data + }); } // 查询数据列表 export function getStationManagerDataList() { - const datad = request({ - url: `/api/pfp/list`, - method: 'get' - }); - return datad.then(); + const datad = request({ + url: `/api/pfp/list`, + method: 'get' + }); + return datad.then(); } // 查询数据 export function getStationManagerData(id) { - const datad = request({ - url: `/api/pfp/${id}`, - method: 'get' - }); - return datad.then(); + const datad = request({ + url: `/api/pfp/${id}`, + method: 'get' + }); + return datad.then(); } // 删除数据 export function deleteStationManagerData(id) { - return request({ - url: `/api/pfp/${id}`, - method: 'delete', - }); + return request({ + url: `/api/pfp/${id}`, + method: 'delete' + }); } diff --git a/src/api/jmap/map.js b/src/api/jmap/map.js index 43b77599c..2c3883e7f 100644 --- a/src/api/jmap/map.js +++ b/src/api/jmap/map.js @@ -285,3 +285,10 @@ export function allSimulationCheck() { method: 'get' }); } +/** 根据地图查询仿真成员 */ +export function querySimulationMemberByMapId(id) { + return request({ + url: `/api/map/${id}/memberMap`, + method: 'get' + }); +} diff --git a/src/api/trainingManage.js b/src/api/trainingManage.js index 4d087f9ef..ab8e5b347 100644 --- a/src/api/trainingManage.js +++ b/src/api/trainingManage.js @@ -41,7 +41,6 @@ export function getTrainingStepList(trainingId) { } /** 修改实训所有步骤 */ export function updateTrainingStep(group, trainingId, data) { - console.log(group, trainingId, '*******'); return request({ url: `/api/v2/draft/training/${group}/${trainingId}/step/update`, method: 'put', diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 07e32bbac..08dafecc3 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -305,7 +305,7 @@ const map = { }, memberMetroList: state => { if (!state.map.memberMap) { - // this.$set() + // this.$set() state.map.memberMap = {METRO: [], RAILWAY: [], EMERGENCY: []}; } return state.map.memberMap.METRO; @@ -797,6 +797,19 @@ const map = { // 设置地图数据 setMapData: (state, map) => { if (map && map.skinVO) { + if (!map.memberMap) { + map.memberMap = { METRO: [], RAILWAY: [], EMERGENCY: [] }; + } else { + if (!map.memberMap.METRO) { + map.memberMap.METRO = []; + } + if (!map.memberMap.RAILWAY) { + map.memberMap.RAILWAY = []; + } + if (!map.memberMap.EMERGENCY) { + map.memberMap.EMERGENCY = []; + } + } state.map = map; let showConfig = {}; if (Vue.prototype.$jlmap && typeof Vue.prototype.$jlmap.getShowConfig === 'function') { @@ -1136,13 +1149,6 @@ const map = { }, setPictureDeviceMap: (state, pictureDeviceMap) => { state.pictureDeviceMap = pictureDeviceMap; - }, - deleteMember: (state, data) => { - console.log(state.map.memberMap[data.type], data.index, '1'); - state.map.memberMap[data.type].splice(data.index, 1); - console.log(state.map.memberMap[data.type], data.index, '2'); - state.map.memberMap[data.type] = [... state.map.memberMap[data.type]]; - console.log(state.map.memberMap[data.type], data.index, '3'); } }, @@ -1422,9 +1428,6 @@ const map = { }, setPictureDeviceMap: ({ commit }, pictureDeviceMap) => { commit('setPictureDeviceMap', pictureDeviceMap); - }, - deleteMember: ({ commit }, data) => { - commit('deleteMember', data); } } }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 5317762c9..0929e8877 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -23,13 +23,13 @@ export function handlerUrl() { let OSS_URL; if (process.env.NODE_ENV === 'development') { // 开发分支 - BASE_API = 'http://192.168.3.233/rtss-server'; + // BASE_API = 'http://192.168.3.233/rtss-server'; // BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://114.116.51.125/jlcloud'; // BASE_API = 'http://192.168.3.90:9100'; // 周寅 // BASE_API = 'http://192.168.3.94:9000'; // 旭强 - // BASE_API = 'http://192.168.3.15:9000'; // 张赛 + BASE_API = 'http://192.168.3.15:9000'; // 张赛 // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬 // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/newMap/newMapdraft/mapoperate/simulationMember/index.vue b/src/views/newMap/newMapdraft/mapoperate/simulationMember/index.vue index 680b40a8b..9ab22c6be 100644 --- a/src/views/newMap/newMapdraft/mapoperate/simulationMember/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/simulationMember/index.vue @@ -12,16 +12,19 @@ - + - + - - + + + + + @@ -31,34 +34,66 @@ - - 名称 - 成员类型 - 设备 - 操作 - - + - - 名称 - 成员类型 - 设备 - 操作 - - + @@ -93,6 +128,20 @@
+ + + + + + + + + @@ -117,9 +166,9 @@ - + - + @@ -129,7 +178,7 @@ - + @@ -141,7 +190,7 @@ - + @@ -153,7 +202,7 @@ - + @@ -165,19 +214,19 @@ - + - - + + - + @@ -189,29 +238,15 @@ - + - - - - - - - - - - - + + @@ -311,12 +346,22 @@ export default { }, computed: { ...mapGetters('map', [ - 'memberMetroList', - 'memberRailwayList', 'memberEmergencyList', 'stationList', 'trainList' - ]) + ]), + memberMetroList() { + return this.$store.state.map.map.memberMap.METRO; + }, + memberRailwayList() { + return this.$store.state.map.map.memberMap.RAILWAY; + }, + memberEmergencyList() { + return this.$store.state.map.map.memberMap.EMERGENCY; + } + }, + watch: { + }, methods: { getMemberId(systemType) { @@ -327,17 +372,9 @@ export default { } return id; }, - changeMemberName(val, data) { - console.log(val, data, '-------------'); - }, - changeMemberType(val, data) { - this.$set(data, 'type', val); - }, deleteMember(index, type) { - // const memberMap = { METRO: this.memberMetroList, RAILWAY: this.memberRailwayList, EMERGENCY: this.memberEmergencyList }; - // memberMap[type].splice(index, 1); - this.$store.dispatch('map/deleteMember', {index, type}); - console.log(index, this.memberMetroList, this.$store.state.map.memberMap); + const memberMap = { METRO: this.memberMetroList, RAILWAY: this.memberRailwayList, EMERGENCY: this.memberEmergencyList }; + memberMap[type].splice(index, 1); }, batchCreate() { const memberMap = { METRO: this.memberMetroList, RAILWAY: this.memberRailwayList, EMERGENCY: this.memberEmergencyList }; @@ -363,7 +400,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_ASSISTANT) { + if (this.batchForm.STATION_ASSISTANT && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -372,7 +409,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_MASTER) { + if (this.batchForm.STATION_MASTER && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -381,7 +418,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_SIGNALER) { + if (this.batchForm.STATION_SIGNALER && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -390,7 +427,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_PASSENGER) { + if (this.batchForm.STATION_PASSENGER && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -399,7 +436,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_SWITCH_MAN) { + if (this.batchForm.STATION_SWITCH_MAN && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -408,7 +445,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_FACILITATOR) { + if (this.batchForm.STATION_FACILITATOR && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -417,7 +454,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.STATION_WORKER) { + if (this.batchForm.STATION_WORKER && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -426,7 +463,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.DEVICE_MANAGER) { + if (this.batchForm.DEVICE_MANAGER && this.batchForm.systemType === 'RAILWAY') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -436,7 +473,7 @@ export default { memberMap[this.batchForm.systemType].push(member); } } else { - if (this.batchForm.DEPOT_DISPATCHER) { + if (this.batchForm.DEPOT_DISPATCHER && this.batchForm.systemType === 'METRO') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -445,7 +482,7 @@ export default { }; memberMap[this.batchForm.systemType].push(member); } - if (this.batchForm.SIGNAL_BUILDING) { + if (this.batchForm.SIGNAL_BUILDING && this.batchForm.systemType === 'METRO') { const member = { id: this.getMemberId(this.batchForm.systemType), name: '', @@ -463,7 +500,7 @@ export default { id: this.getMemberId(this.batchForm.systemType), name: '', type: 'DRIVER', - deviceCode: train.code + deviceCode: train.groupNumber }; memberMap[this.batchForm.systemType].push(member); }); @@ -479,7 +516,7 @@ export default { memberMap[this.batchForm.systemType].push(member); } } - if (this.batchForm.TRAIN_MASTER) { + if (this.batchForm.TRAIN_MASTER && this.batchForm.systemType === 'METRO') { for (let i = 0; i < this.batchForm.TRAIN_MASTER; i++) { const member = { id: this.getMemberId(this.batchForm.systemType), @@ -490,7 +527,7 @@ export default { memberMap[this.batchForm.systemType].push(member); } } - if (this.batchForm.ELECTRIC_DISPATCHER) { + if (this.batchForm.ELECTRIC_DISPATCHER && this.batchForm.systemType === 'METRO') { for (let i = 0; i < this.batchForm.ELECTRIC_DISPATCHER; i++) { const member = { id: this.getMemberId(this.batchForm.systemType), @@ -501,7 +538,7 @@ export default { memberMap[this.batchForm.systemType].push(member); } } - if (this.batchForm.PARENT_DEPARTMENT) { + if (this.batchForm.PARENT_DEPARTMENT && this.batchForm.systemType === 'METRO') { for (let i = 0; i < this.batchForm.PARENT_DEPARTMENT; i++) { const member = { id: this.getMemberId(this.batchForm.systemType), @@ -512,7 +549,7 @@ export default { memberMap[this.batchForm.systemType].push(member); } } - if (this.batchForm.SCHEDULING) { + if (this.batchForm.SCHEDULING && this.batchForm.systemType === 'METRO') { for (let i = 0; i < this.batchForm.SCHEDULING; i++) { const member = { id: this.getMemberId(this.batchForm.systemType), @@ -523,6 +560,7 @@ export default { memberMap[this.batchForm.systemType].push(member); } } + this.$message.success('批量添加成功!'); this.resetForm(); }, createMember() { @@ -534,6 +572,7 @@ export default { deviceCode: this.createForm.deviceCode }; memberMap[this.createForm.systemType].push(member); + this.$message.success('添加成功!'); this.resetForm(); }, resetForm() { @@ -571,6 +610,7 @@ export default { }, keyGeneration() { const memberMap = { METRO: this.memberMetroList, RAILWAY: this.memberRailwayList, EMERGENCY: this.memberEmergencyList }; + memberMap[this.generationForm.systemType].splice(0, memberMap[this.generationForm.systemType].length); const memberDispatcher = { id: this.getMemberId(this.generationForm.systemType), name: '', @@ -594,7 +634,7 @@ export default { id: this.getMemberId(this.generationForm.systemType), name: '', type: 'DRIVER', - deviceCode: train.code + deviceCode: train.groupNumber }; memberMap[this.generationForm.systemType].push(member); }); @@ -714,6 +754,7 @@ export default { }; memberMap[this.batchForm.systemType].push(memberScheduling); } + this.$message.success('一键生成成功!'); this.resetForm(); } } diff --git a/src/views/publish/publishMap/editSubsystem.vue b/src/views/publish/publishMap/editSubsystem.vue index 29ad19e95..ab6069e43 100644 --- a/src/views/publish/publishMap/editSubsystem.vue +++ b/src/views/publish/publishMap/editSubsystem.vue @@ -23,19 +23,19 @@ - - - + + + - - - + + + - - - + + + @@ -79,7 +79,8 @@