From 60db92bf4f1e4cf4491668eb1d4281f6ac99bc02 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期一, 06 三月 2023 18:38:24 +0800 Subject: [PATCH] 前端添加柱状图显示 --- src/views/Tools/LayerTree.vue | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue index d9411be..6334b9e 100644 --- a/src/views/Tools/LayerTree.vue +++ b/src/views/Tools/LayerTree.vue @@ -86,6 +86,13 @@ > <i class="el-icon-tickets"></i> 瀹氫綅 </div> + <div + class="edit" + @click="histogram()" + v-show="shwoHistogram" + > + <i class="el-icon-tickets"></i> 杞瓟鏌辩姸鍥� + </div> <!-- <div class="edit" @click="menuMoveF( 'up')" @@ -169,12 +176,13 @@ import View from "ol/View.js"; import { Fill, Stroke, Style } from "ol/style.js"; -import { perms_selectLayers } from "../../api/api.js"; +import { perms_selectLayers, inquiry_selectDomains } from "../../api/api.js"; export default { name: "tree", components: { queryinfo }, data() { return { + shwoHistogram: false, showlocal: false, eleId: "", isShow: false, @@ -217,6 +225,28 @@ }; }, methods: { + //杞瓟鏌辩姸鍥� + async histogram() { + this.menuVisible = false + var layer = this.currentData.enName.replaceAll("_", ""); + this.$store.state.mapSpaceQueryLayer = layer; + this.$store.state.mapPopBoxFlag = "2"; + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); + this.$refs && + this.$refs.queryinfo && + this.$refs.queryinfo.open("灞炴��", null, { + close: () => { + if (this.$store.state.primitLayer != null) { + sgworld.Creator.DeleteObject(this.$store.state.primitLayer); + this.$store.state.primitLayer = null; + } + + if (window.Viewer.scene.primitives.length != 0) { + window.Viewer.scene.primitives.removeAll(); + } + }, + }); + }, NodeBlur(Node, data) { if (data.label.length === 0) { this.$message.error("鑿滃崟鍚嶄笉鍙负绌猴紒"); @@ -250,6 +280,11 @@ rightClick(event, object, Node, element) { this.currentData = object; this.currentNode = Node; + if (this.currentData.enName == "s_explorationpoint") { + this.shwoHistogram = true; + } else { + this.shwoHistogram = false; + } if (Node.level === 3) { this.firstLevel = false; } else { @@ -286,6 +321,7 @@ }, // 澧炲姞鍚岀骇鑺傜偣浜嬩欢 addSameLevelNode() { + this.menuVisible = false this.foo(); if (this.currentNode.level == 2) { this.appendNodetitle = this.currentData.label; @@ -299,6 +335,7 @@ // 澧炲姞瀛愮骇鑺傜偣浜嬩欢 addChildNode() { this.foo(); + this.menuVisible = false // if (this.currentNode.level >= 2) { // this.$message.error("鏈�澶氬彧鏀袱绾э紒"); // return false; @@ -327,6 +364,7 @@ // 鍒犻櫎鑺傜偣 deleteNode() { this.foo(); + this.menuVisible = false var label = this.currentNode.data.cnName; if (this.currentNode.data.serveType == "WMS") { for (var i in window.Viewer.imageryLayers._layers) { @@ -370,10 +408,11 @@ //灞炴�ф樉绀� showLayerAttribute(data) { this.foo(); + this.menuVisible = false this.currentData = data ? data : this.currentData; var layer = this.currentData.enName.replaceAll("_", ""); this.$store.state.mapSpaceQueryLayer = layer; - // this.$store.state.mapPopBoolean = true; + this.$store.state.mapPopBoxFlag = "2"; this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); this.$refs && @@ -393,6 +432,7 @@ }, //妯″瀷瀹氫綅 positioning() { + this.menuVisible = false for (var i in Viewer.scene.primitives._primitives) { if ( Viewer.scene.primitives._primitives[i].id == this.currentData.cnName @@ -404,6 +444,7 @@ // 缂栬緫鑺傜偣 editNode(data) { this.foo(); + this.menuVisible = false this.currentData = data ? data : this.currentData; if (!this.currentData.isEdit) { this.$set(this.currentData, "isEdit", true); -- Gitblit v1.9.3