From c1514cfc69b679d05398bb1def6b24c772426aa0 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 14 二月 2023 09:11:46 +0800 Subject: [PATCH] 综合展示图层管理图标切换 --- src/views/Synthesis/LeftMenu.vue | 307 ++++++++++---------------------------------------- 1 files changed, 64 insertions(+), 243 deletions(-) diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue index 301b1d0..7bf1a0a 100644 --- a/src/views/Synthesis/LeftMenu.vue +++ b/src/views/Synthesis/LeftMenu.vue @@ -28,7 +28,14 @@ import { transform } from 'ol/proj'; import mapinfo from '../Tools/mapinfo.vue'; import maplayer from '../Tools/maplayer.vue'; -import queryinfo from '../Tools/queryinfo.vue' +import queryinfo from '../Tools/queryinfo.vue'; +import { + OverviewMap, + defaults as defaultControls, + FullScreen, + ScaleLine, + Rotate, +} from "ol/control.js" export default { components: { mapinfo, maplayer, queryinfo }, data() { @@ -36,7 +43,7 @@ showTwoMenuFlag: false, setListTwoMenu: [], setListTwoMenuAll: [ - [ + [ { id: 'a1', label: 'synthesis.layer', @@ -195,7 +202,7 @@ name: '鍦板舰寮�鎸�', css: 'twoMenu_imge411', }, - { + { id: "d12", label: "synthesis.visibilityAnalysis", name: "閫氳鍒嗘瀽", @@ -331,12 +338,12 @@ name: '瀵煎嚭', css: 'twoMenu_imge86', }, - { - id: 'h8', - label: 'synthesis.addlabel', - name: '鏂囧瓧', - css: 'twoMenu_imge88', - }, + { + id: 'h8', + label: 'synthesis.addlabel', + name: '鏂囧瓧', + css: 'twoMenu_imge88', + }, { id: 'h7', label: 'synthesis.removepaint', @@ -368,26 +375,28 @@ isolineFlag: false, isslopeFlag: false, isContrastFlag: false, - UndergroundMode: false + UndergroundMode: false, + scaleLine: null, + Excavation:false, }; }, methods: { //浜岀礆鑿滃崟鐐瑰嚮鍒囨崲 setChangeTwoMenu(res) { - //娓呴櫎缁樺埗鍥惧舰瀵硅薄 - sgworld.Creator.SimpleGraphic.clear(); - if (window.Viewer.scene.primitives.length != null) { - window.Viewer.scene.primitives.removeAll(); - } - if (this.$store.state.primitLayer != null) { - sgworld.Creator.DeleteObject(this.$store.state.primitLayer); - this.$store.state.primitLayer = null; - } - - //鍏抽棴鎵撳紑鐨勪俊鎭獥浣� - - - + //娓呴櫎缁樺埗鍥惧舰瀵硅薄 + sgworld.Creator.SimpleGraphic.clear(); + if (window.Viewer.scene.primitives.length != null) { + window.Viewer.scene.primitives.removeAll(); + } + if (this.$store.state.primitLayer != null) { + sgworld.Creator.DeleteObject(this.$store.state.primitLayer); + this.$store.state.primitLayer = null; + } + + //鍏抽棴鎵撳紑鐨勪俊鎭獥浣� + + + this.showTwoMenuFlag = res.id; this.$store.state.mapMenuBoolean = false; this.$store.state.mapMenuBoxFlag = null; @@ -398,10 +407,10 @@ window.model.deleteObject(); window.model = null; } - - - + + + switch (val) { case 'a': //鍥惧眰绠$悊 this.setCoverage(res.id); @@ -470,11 +479,11 @@ case 'h7': sgworld.Creator.SimpleGraphic.clear(); break; - case 'h8': - sgworld.Creator.createSimpleGraphic('label', {}, function (entity) { - - }); - break; + case 'h8': + sgworld.Creator.createSimpleGraphic('label', {}, function (entity) { + + }); + break; } }, handleSaveClick() { @@ -515,7 +524,7 @@ alert('褰撳墠鍦烘櫙娌℃湁entities瀹炰綋'); } }, - + handleOpenClick() { sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }); let fileInput = document.querySelector('.file'); @@ -687,7 +696,7 @@ } ); break; - case "j7": + case "j7": var measure = window.sgworld.Command.execute( 1, 11, @@ -768,7 +777,7 @@ } }, setAnalsy(res) { - //this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); + //this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); var that = this; switch (res) { case 'd1': @@ -842,9 +851,9 @@ ); break; case 'd9': - this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); this.$store.state.mapPopBoxFlag = '3'; - + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("绠¢亾绌洪棿鍒嗘瀽", null, { close: () => { if (this.$store.state.pipelineEntity.length != 0) { @@ -903,7 +912,7 @@ } break; - case "d12": + case "d12": if (window.Excavation) { window.Excavation.deleteObject() window.Excavation = null @@ -914,11 +923,11 @@ } break case "d13": - if (window.Excavation) { - window.Excavation.destroy() - window.Excavation = null + if (this.Excavation ) { + this.Excavation.destroy() + this.Excavation = null } else { - window.Excavation = sgworld.Analysis.create3DViewshedPoss({ + this.Excavation = sgworld.Analysis.create3DViewshedPoss({ height: 1.8, }) } @@ -1115,10 +1124,21 @@ case 'b7': //姣斾緥灏� this.isRuler = !this.isRuler; window.sgworld.navControl('scale', this.isRuler); + if (this.isRuler == true) { + this.scaleLine = new ScaleLine({ + units: "metric" + }); + window.map.addControl(this.scaleLine); + } else { + + window.map.removeControl(this.scaleLine); + this.scaleLine = false; + } break; case 'b8': //鎸囧寳閽� this.isNaviget = !this.isNaviget; window.sgworld.navControl('nav', this.isNaviget); + this.$store.state.isNaviget = this.isNaviget break; case 'b9': //鍦颁笅妯″紡 this.UndergroundMode = !this.UndergroundMode; @@ -1171,8 +1191,6 @@ .menu_Box { width: 100%; height: 100%; - background: #303030; - color: white; margin: 0; padding: 0; overflow-y: auto; @@ -1202,206 +1220,9 @@ border: 1px solid #409eff; } .menuTwoImage { - width: 32px; - height: 32px; + width: 40px; + height: 40px; display: inline-block; } - - .twoMenu_imge11 { - background: url("../../assets/img/synthesis/鍥惧眰 32.png") no-repeat center; - } - .twoMenu_imge12 { - background: url("../../assets/img/synthesis/鍥惧眰 35.png") no-repeat center; - } - .twoMenu_imge13 { - background: url("../../assets/img/synthesis/鍙戝竷.png") no-repeat center; - } - //瑙嗗浘 - .twoMenu_imge21 { - background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 12 鎷疯礉 3.png") - no-repeat center; - } - .twoMenu_imge22 { - background: url("../../assets/img/synthesis/鍥惧眰 10 鎷疯礉.png") no-repeat - center; - } - .twoMenu_imge23 { - background: url("../../assets/img/synthesis/鍥惧眰 11 鎷疯礉.png") no-repeat - center; - } - .twoMenu_imge24 { - background: url("../../assets/img/synthesis/鍥惧眰 12 鎷疯礉 2.png") no-repeat - center; - } - .twoMenu_imge25 { - background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 5 鎷疯礉 2.png") - no-repeat center; - } - .twoMenu_imge26 { - background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 5 鎷疯礉 3.png") - no-repeat center; - } - .twoMenu_imge27 { - background: url("../../assets/img/synthesis/鐭╁舰 9.png") no-repeat center; - } - .twoMenu_imge28 { - background: url("../../assets/img/synthesis/妞渾 4.png") no-repeat center; - } - .twoMenu_imge29 { - background: url("../../assets/img/synthesis/z_03.png") no-repeat center; - } - //婕父 - .twoMenu_imge31 { - background: url("../../assets/img/synthesis/妞渾 6.png") no-repeat center; - } - .twoMenu_imge32 { - background: url("../../assets/img/synthesis/妞渾 7 鎷疯礉 2.png") no-repeat - center; - } - .twoMenu_imge33 { - background: url("../../assets/img/synthesis/鍥惧眰 14 鍓湰 鎷疯礉.png") - no-repeat center; - } - .twoMenu_imge34 { - background: url("../../assets/img/synthesis/鍥惧眰 74 鎷疯礉 2.png") no-repeat - center; - } - .twoMenu_imge35 { - background: url("../../assets/img/synthesis/妞渾 7 鎷疯礉 4.png") no-repeat - center; - } - //鍒嗘瀽 - .twoMenu_imge41 { - background: url("../../assets/img/synthesis/妞渾 8 鎷疯礉 8.png") no-repeat - center; - } - .twoMenu_imge42 { - background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 12 鎷疯礉 5.png") - no-repeat center; - } - .twoMenu_imge43 { - background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 10 鍓湰 3.png") - no-repeat center; - } - .twoMenu_imge44 { - background: url("../../assets/img/synthesis/鍥惧眰 74 鎷疯礉 3.png") no-repeat - center; - } - .twoMenu_imge45 { - background: url("../../assets/img/synthesis/鍥惧眰 20.png") no-repeat center; - } - .twoMenu_imge46 { - background: url("../../assets/img/synthesis/鍥惧眰 14 鎷疯礉 3.png") no-repeat - center; - } - .twoMenu_imge47 { - background: url("../../assets/img/synthesis/鍥惧眰 18.png") no-repeat center; - } - .twoMenu_imge48 { - background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 12 鎷疯礉 6.png") - no-repeat center; - } - .twoMenu_imge49 { - background: url("../../assets/img/synthesis/绠¢亾.png") no-repeat center; - } - .twoMenu_imge410 { - background: url("../../assets/img/synthesis/dxkw.png") no-repeat center; - } - .twoMenu_imge411 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } - // 閫氳鍒嗘瀽銆佽鍩熷垎鏋� 棰勭暀 - .twoMenu_imge412 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } - .twoMenu_imge413 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } - .twoMenu_imge414 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } - - - - - //鏌ヨ - .twoMenu_imge51 { - background: url("../../assets/img/synthesis/鍥惧眰 23.png") no-repeat center; - } - .twoMenu_imge52 { - background: url("../../assets/img/synthesis/绌洪棿鏌ヨ.png") no-repeat center; - } - //瀹氫綅 - .twoMenu_imge61 { - background: url("../../assets/img/synthesis/鍥惧眰 27.png") no-repeat center; - } - .twoMenu_imge62 { - background: url("../../assets/img/synthesis/鍥惧眰 28.png") no-repeat center; - } - //娴嬮噺 - .twoMenu_imge71 { - background: url("../../assets/img/synthesis/鍥惧眰 31.png") no-repeat center; - } - .twoMenu_imge72 { - background: url("../../assets/img/synthesis/鍥惧眰 31 鎷疯礉.png") no-repeat - center; - } - .twoMenu_imge73 { - background: url("../../assets/img/synthesis/鐭╁舰 13 鎷疯礉.png") no-repeat - center; - } - .twoMenu_imge74 { - background: url("../../assets/img/synthesis/鍥惧眰 18 鎷疯礉.png") no-repeat - center; - } - .twoMenu_imge75 { - background: url("../../assets/img/synthesis/M 鎷疯礉.png") no-repeat center; - } - .twoMenu_imge76 { - background: url("../../assets/img/synthesis/绌洪棿娴嬭窛.png") no-repeat center; - } - - // 楂樺眰閲忔祴鍥炬爣 - .twoMenu_imge77 { - background: url("../../assets/img/synthesis/鍥惧眰 31 鎷疯礉.png") no-repeat - center; - } - - - - //鏍囩粯 - .twoMenu_imge81 { - background: url("../../assets/img/synthesis/妞渾 5 鎷疯礉 3.png") no-repeat - center; - } - .twoMenu_imge82 { - background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 16.png") no-repeat - center; - } - .twoMenu_imge83 { - background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 20.png") no-repeat - center; - } - .twoMenu_imge84 { - background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 23.png") no-repeat - center; - } - .twoMenu_imge85 { - background: url("../../assets/img/synthesis/瀵煎叆.png") no-repeat center; - } - .twoMenu_imge86 { - background: url("../../assets/img/synthesis/瀵煎嚭.png") no-repeat center; - } - .twoMenu_imge87 { - background: url("../../assets/img/synthesis/娓呴櫎.png") no-repeat center; - } - .twoMenu_imge88 { - background: url("../../assets/img/synthesis/鍥惧眰 32.png") no-repeat center; - } - } </style> -- Gitblit v1.9.3