From d4a3ca549f8755c2f87442c27217c3be39cab5cc Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期三, 14 八月 2024 16:00:10 +0800 Subject: [PATCH] 设备维修 --- src/views/visual/mapView/index.vue | 106 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 97 insertions(+), 9 deletions(-) diff --git a/src/views/visual/mapView/index.vue b/src/views/visual/mapView/index.vue index dcc3b89..d019da3 100644 --- a/src/views/visual/mapView/index.vue +++ b/src/views/visual/mapView/index.vue @@ -13,7 +13,8 @@ </span> <div v-if="item.children"> <el-dropdown-menu v-show="item.children" slot="dropdown"> - <el-dropdown-item style="text-align: center" :command="res" v-for="(res, key) in item.children" :key="key">{{ res.name }}</el-dropdown-item> + <el-dropdown-item style="text-align: center" :command="res" + v-for="(res, key) in item.children" :key="key">{{ res.name }}</el-dropdown-item> </el-dropdown-menu> </div> </el-dropdown> @@ -28,9 +29,23 @@ <i :size="20" class="el-icon-d-arrow-left"></i> </div> </div> + <!-- 鍥惧眰绠$悊 --> <layer-manager ref="layerManager"></layer-manager> + <!-- 鍧愭爣瀹氫綅 --> <location ref="location"></location> + <!-- 鐭ヨ瘑鍥捐氨 --> <knowledge ref="knowledge"></knowledge> + <!-- 绾胯矾婕父 --> + <lineRoaming ref="lineRoaming"></lineRoaming> + <!-- 鍦颁笅妯″紡 --> + <undergroundMode ref="undergroundMode"></undergroundMode> + <!-- 鏁版嵁鍒嗘瀽 --> + <dataAnalysis ref="dataAnalysis"></dataAnalysis> + <!-- 鏁版嵁缁熻 --> + <dataStatistics ref="dataStatistics"></dataStatistics> + <!-- 灞炴�т俊鎭� --> + <attributeInfo ref="attributeInfo"></attributeInfo> + <map-info :childObj="childObj" ref="mapInfo"></map-info> </div> </div> </template> @@ -42,27 +57,86 @@ import menuManager from '@/assets/js/mapSdk/menuManager.js'; import location from './location.vue'; import knowledge from './knowledge.vue'; - +import lineRoaming from './lineRoaming.vue'; +import { layer_selectAll } from "@/api/mapView/map.js"; +import configTools from '@/assets/js/configTools'; +import store from "@/store"; +import mapServer from '@/assets/js/mapSdk/mapServe'; +import undergroundMode from './undergroundMode.vue'; +import dataAnalysis from './dataAnalysis.vue'; +import dataStatistics from './dataStatistics.vue' +import attributeInfo from './attributeInfo.vue'; +import mapInfo from './mapInfo.vue'; export default { name: 'mapView', - components: { layerManager, location, knowledge }, + components: { layerManager, location, knowledge, lineRoaming, undergroundMode, dataAnalysis, dataStatistics, attributeInfo, mapInfo }, data() { return { menuIsShow: false, menuOption: [], childMenuIsShow: true, childMenuOption: [], + childObj: [], }; }, mounted() { this.mapViewStart(); + this.$busEvent.$on('CHANGE_MAPINFO', res => { + + this.setMapInfo(res) + + }); + }, + beforeDestroy() { + this.$store.dispatch('mapLayers/changeLayerTree', []) + this.$store.dispatch('mapLayers/changeDefaultLayer', []) + }, + + methods: { + setMapInfo(res) { + // console.log(res); + if (res.length > 0) { + this.childObj = res; + setTimeout(() => { + this.$refs && this.$refs.mapInfo && this.$refs.mapInfo.open(); + }, 200); + + + } + + }, mapViewStart() { this.menuOption = mapData.menuData; this.$nextTick(() => { mapInit.Init(); + setTimeout(() => { + if(config.baseModel.url){ + mapServer.addLayer(config.baseModel); + } + this.getSelectLayers(); + }, 500); + }); + }, + getSelectLayers() { + layer_selectAll().then(response => { + if (response.data.code != 200) return + const defaultLayer = []; + const val = response.data.result.filter(item => { + item.checked = false; + if (item.type == 2 && item.isShow == 1) { + item.checked = true; + mapServer.addLayer(item) + defaultLayer.push(item.id) + } + return item; + }) + this.$store.dispatch('mapLayers/changeDefaultLayer', defaultLayer) + var obj = configTools.getTreeData(val) + this.$store.dispatch('mapLayers/changeLayerTree', obj) + }) }, setMenuClose() { this.menuIsShow = !this.menuIsShowx; @@ -75,9 +149,7 @@ this.setPopCloseAll(); const obj = menuManager.init(command); if (obj) { - this.setPopShow(obj); - } }, setPopCloseAll() { @@ -86,6 +158,7 @@ this.$refs && this.$refs.knowledge && this.$refs.knowledge.close(); }, setPopShow(response) { + console.log(response); switch (response) { case '鍥惧眰绠$悊': this.$refs && this.$refs.layerManager && this.$refs.layerManager.open(); @@ -95,6 +168,21 @@ break; case '鐭ヨ瘑鍥捐氨': this.$refs && this.$refs.knowledge && this.$refs.knowledge.open(); + break; + case '绾胯矾婕父': + this.$refs && this.$refs.lineRoaming && this.$refs.lineRoaming.open(); + break; + case '鍦颁笅妯″紡': + this.$refs && this.$refs.undergroundMode && this.$refs.undergroundMode.open(); + break; + case '鏁版嵁鍒嗘瀽': + this.$refs && this.$refs.dataAnalysis && this.$refs.dataAnalysis.open(); + break; + case '灞炴�т俊鎭�': + this.$refs && this.$refs.attributeInfo && this.$refs.attributeInfo.open(); + break; + case '鏁版嵁缁熻': + this.$refs && this.$refs.dataStatistics && this.$refs.dataStatistics.open(); break; default: break; @@ -114,7 +202,7 @@ .menuBox { position: absolute; - z-index: 99999; + z-index: 40; top: 20px; right: 2px; border-radius: 0 6px 6px 0; @@ -136,7 +224,7 @@ .rightMenu { width: 30px; height: 40px; - background: rgba(245, 245, 245, 1); + background: rgba(255, 255, 255, 1); border: 1px solid rgb(245, 245, 245); color: #4ab1fc; display: flex; @@ -148,7 +236,7 @@ .closeMenu { width: 30px; height: 100%; - background: rgba(245, 245, 245, 1); + background: rgb(255, 255, 255); color: #4ab1fc; display: flex; position: relative; @@ -158,7 +246,7 @@ .menuItemBox { color: #7a7a7a; - background: rgba(245, 245, 245, 1); + background: rgb(255, 255, 255); line-height: 40px; padding: 0px 10px; font-size: 14px; -- Gitblit v1.9.3