From d0a986e8bf4da51ec5895b6d8f5c97b8704479d3 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 2 Dec 2019 14:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=9C=B0=E5=9B=BE=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/mapdraft.js | 9 + src/store/modules/map.js | 27 +-- src/utils/baseUrl.js | 4 +- .../newMap/newDesignUser/mapmanage/create.vue | 1 + src/views/newMap/newMapdraft/index.vue | 4 +- .../newMap/newMapdraft/mapoperate/switch.vue | 207 ++++++++++-------- 6 files changed, 132 insertions(+), 120 deletions(-) diff --git a/src/api/jmap/mapdraft.js b/src/api/jmap/mapdraft.js index 32cb95332..e44c6f8e8 100644 --- a/src/api/jmap/mapdraft.js +++ b/src/api/jmap/mapdraft.js @@ -59,6 +59,15 @@ export function saveMap(data) { }); } +/** 保存新草稿地图*/ +export function saveNewMap(data) { + return request({ + url: `/api/mapBuild/${data.mapId}/saveNewElements`, + method: 'post', + data: data + }); +} + /** 草稿地图另存为*/ export function saveAsMap(data) { return request({ diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 9c5aff7e5..b2b3ee9fb 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -20,27 +20,7 @@ function queryDeleteModels(map, device, dict) { setDisPose(device, dict); switch (device._type) { - // 查询ink关联项 - case deviceType.Link: - // 查询Link关联的区段 - if (map.sectionList && map.sectionList.length) { - map.sectionList.forEach(elem => { - if (elem.linkCode === device.code) { - queryDeleteModels(map, elem, dict); - } - }); - } - - // 查询Link关联的信号机 - if (map.signalList && map.signalList.length) { - map.signalList.forEach(elem => { - if (elem.linkCode === device.code) { - setDisPose(elem, dict); - } - }); - } - break; - // 移除区段关联项 + // 移除区段关联项 case deviceType.Section: // 删除所属逻辑区段 if (map.sectionList && map.sectionList.length && device.type == '01') { @@ -63,13 +43,14 @@ function queryDeleteModels(map, device, dict) { break; case deviceType.Switch: map.sectionList.forEach(elem => { - if (elem.type == '03' && elem.relSwitchCode == device.code) { + if (elem.type == '04' && elem.relSwitchCode == device.code) { setDisPose(elem, dict); } - if (elem.relSwitchCode == device.code && elem.type != '03') { + if (elem.relSwitchCode == device.code && elem.type != '04') { if (!dict[elem.code] || !dict[elem.code]._dispose) { const copyModel = deepAssign({}, elem); copyModel.relSwitchCode = ''; + copyModel.parentCode = ''; copyModel.isSwitchSection = false; dict[elem.code] = copyModel; } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 1e9afea51..79d1c6346 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,11 +3,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.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - // BASE_API = 'http://192.168.3.82:9000'; // 杜康 + BASE_API = 'http://192.168.3.82:9000'; // 杜康 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/newMap/newDesignUser/mapmanage/create.vue b/src/views/newMap/newDesignUser/mapmanage/create.vue index 4a36b9ca4..31283e1ef 100644 --- a/src/views/newMap/newDesignUser/mapmanage/create.vue +++ b/src/views/newMap/newDesignUser/mapmanage/create.vue @@ -145,6 +145,7 @@ export default { this.$refs['newForm'].validate((valid) => { if (valid) { this.loading = true; + this.newModel['drawWay'] = '1'; newMap(this.newModel).then(response => { this.loading = false; this.$emit('refresh'); diff --git a/src/views/newMap/newMapdraft/index.vue b/src/views/newMap/newMapdraft/index.vue index 41011c131..d20645971 100644 --- a/src/views/newMap/newMapdraft/index.vue +++ b/src/views/newMap/newMapdraft/index.vue @@ -48,7 +48,7 @@