From 28bd61701bb409257ea0dd3c78f32bd0b45ebbd5 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期一, 06 三月 2023 09:16:35 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.20.39:8989/r/LFWEB_NEW --- src/components/Screen/bottom.vue | 147 ++++++++++++++++++++++++++++++++++++------------ 1 files changed, 109 insertions(+), 38 deletions(-) diff --git a/src/components/Screen/bottom.vue b/src/components/Screen/bottom.vue index 1aacfc6..216c9db 100644 --- a/src/components/Screen/bottom.vue +++ b/src/components/Screen/bottom.vue @@ -46,9 +46,18 @@ </div> </el-popover> </div> + + <div + class="bottombtn" + :class="showTree ? 'active' : ''" + @click="handleTree" + > + 鍥惧眰绠$悊 + </div> </div> <div class="bottom13"> - <img :src="yxImg" @click="ChangeBaseLayer" /> + <img :src="yxImg" @click="ChangeBaseLayer('yx')" title="褰卞儚鍥�" /> + <img :src="xrImg" @click="ChangeBaseLayer('xr')" title="鏅曟覆鍥�" /> </div> </div> <div class="bottom2"> @@ -57,11 +66,13 @@ </div> </template> <script> +let yunxuanLayer = null import PipeLine from "@/assets/json/pipeline.json" import { countProjectTour, countProjectDisplay, countProjectLocation, + selectProjectFileList, } from "@/api/screen.js" import { wktToGeoJSON } from "@terraformer/wkt" @@ -69,22 +80,25 @@ data() { return { YXState: true, + XRState: true, + yunxuanLayer: null, //鍏ㄧ悆鐪╂檿鍥� yxImg: require("../../assets/img/Screen/yximg.png"), - currMenu: "椤圭洰灞曠ず", + xrImg: require("../../assets/img/Screen/bdimg.png"), + currMenu: "涓撻灞曠ず", currProject: "", searchName: "", menuList: [ { - menuName: "椤圭洰灞曠ず", + menuName: "涓撻灞曠ず", children: [ - // { - // name: "鍏ㄥ浗绠$綉鍥�", - // id: "qggwt", - // }, - // { - // name: "鍏ㄧ悆绠$綉鍥�", - // id: "qqgwt", - // }, + { + name: "鍏ㄥ浗绠$綉鍥�", + id: "qggwt", + }, + { + name: "鍏ㄧ悆绠$綉鍥�", + id: "qqgwt", + }, { name: "鍏ㄥ浗椤圭洰", id: "qgxm", @@ -96,7 +110,7 @@ ], }, { - menuName: "宸ョ▼灞曠ず", + menuName: "椤圭洰灞曠ず", children: [ { name: "涓縿涓滅嚎绠¢亾宸ョ▼", @@ -154,6 +168,7 @@ ], }, ], + showTree: false, } }, computed: { @@ -174,20 +189,47 @@ this.getCountProjectTour() }, methods: { - ChangeBaseLayer() { - if (this.YXState) { - this.yxImg = require("../../assets/img/Screen/bdimg.png") - //鍔犺浇鐧惧害褰卞儚 - Viewer.imageryLayers._layers[1].show = true - Viewer.imageryLayers._layers[2].show = false - Viewer.imageryLayers._layers[3].show = false - } else { - this.yxImg = require("../../assets/img/Screen/yximg.png") - Viewer.imageryLayers._layers[1].show = false - Viewer.imageryLayers._layers[2].show = true - Viewer.imageryLayers._layers[3].show = true + ChangeBaseLayer(parm) { + if (parm == "yx") { + if (this.YXState) { + //this.yxImg = require("../../assets/img/Screen/bdimg.png") + //鍔犺浇鐧惧害褰卞儚 + Viewer.imageryLayers._layers[1].show = true + Viewer.imageryLayers._layers[2].show = false + Viewer.imageryLayers._layers[3].show = false + } else { + //this.yxImg = require("../../assets/img/Screen/yximg.png") + Viewer.imageryLayers._layers[1].show = false + Viewer.imageryLayers._layers[2].show = true + Viewer.imageryLayers._layers[3].show = true + } + this.YXState = !this.YXState } - this.YXState = !this.YXState + + if (parm == "xr") { + if (yunxuanLayer == null) { + var urls = "https://tiles3.geovisearth.com/base/v1/ter" + // 鏄熷浘鍦扮悆鍦板舰鏅曟覆 + yunxuanLayer = sgworld.Creator.createUrlTemplateImageryProvider( + "鏄熷浘鍦扮悆鍦板舰鏅曟覆", + { + url: + urls + + "/{z}/{x}/{y}?format=webp&token=486dac3bec56d7d7c2a581c150be2bd937462f1e8f3bc9c78b5658b396122405", + }, + "0", + undefined, + true, + "" + ) + } + if (this.XRState) { + yunxuanLayer.item.show = true + } else { + yunxuanLayer.item.show = false + } + this.XRState = !this.XRState + } }, handleMenuClick(menu) { this.currMenu = menu.menuName @@ -199,16 +241,22 @@ case "宸ョ▼宸¤": this.showPathLine(child) break - case "宸ョ▼灞曠ず": - this.DisplayCurrentProject(child) - break case "椤圭洰灞曠ず": + this.DisplayCurrentProject(child) + this.changeProject(child) + this.$bus.$emit("changeProjectCode", child.id) + + break + case "涓撻灞曠ず": this.changeProject(child) break + default: break } }, + + //宸ョ▼宸¤ async showPathLine(params) { const line = wktToGeoJSON(params.wkt) const position = line.coordinates[0] @@ -247,8 +295,6 @@ //椤圭洰灞曠ず DisplayCurrentProject(params) { - console.log(params) - //鎵撳紑鎴栬�呭姞杞藉浘灞� //椋炲埌鎸囧畾浣嶇疆 @@ -278,18 +324,29 @@ }, handleSearchChange(currMenu) {}, async getCountProjectDisplay() { - const res = await countProjectLocation() + // const res = await countProjectLocation() + // if (res.code === 200) { + // const menu = this.menuList.find(item => item.menuName == "椤圭洰灞曠ず") + // menu.children = res.result.map(item => { + // return { + // name: item.projname, + // id: item.projname, + // wkt: item.wkt, + // } + // }) + // } + const res = await selectProjectFileList() if (res.code === 200) { - const menu = this.menuList.find(item => item.menuName == "宸ョ▼灞曠ず") + const menu = this.menuList.find(item => item.menuName == "椤圭洰灞曠ず") menu.children = res.result.map(item => { return { - name: item.projname, - id: item.projname, + name: item.name, + id: item.code, wkt: item.wkt, } }) - } + selectProjectFileList }, async getCountProjectTour() { const res = await countProjectTour() @@ -302,12 +359,16 @@ wkt: item.wkt, } }) - } }, + //涓撻灞曠ず changeProject(params) { - this.$bus.$emit('changeProject', params.name) - } + this.$bus.$emit("changeProject", params.name) + }, + handleTree(params) { + this.showTree = !this.showTree + this.$bus.$emit("changeTree", this.showTree) + }, }, } </script> @@ -366,6 +427,7 @@ color: #fff; font-weight: 600; cursor: pointer; + &.active { background: url(~@/assets/img/Screen/centerbtnc.png); background-size: 100% 100%; @@ -386,6 +448,7 @@ } } } + .popover { display: flex; justify-content: center; @@ -394,9 +457,11 @@ background: url(~@/assets/img/Screen/centerTooltipBg.png); background-size: 100% 100%; border: none; + .popper__arrow { display: none; } + .popover-content { &__header { display: flex; @@ -407,6 +472,7 @@ height: 30px; font-size: 18px; color: #fff; + &::before, &::after { margin: 0 5px; @@ -418,15 +484,18 @@ height: 8px; } } + &__search { margin-top: 8px; width: 145px; text-align: center; + .el-input { width: 125px; height: 21px; background: rgba(0, 48, 111, 0.2); border: 0.25px solid #2a80a9; + &__inner { background: rgba(0, 48, 111, 0.2); border-radius: inherit; @@ -434,6 +503,7 @@ padding: 0 5px; color: #fff; } + .el-input-group__append { width: 32px; border: none; @@ -476,6 +546,7 @@ } } } + ::-webkit-scrollbar { width: 2px; height: 2px; -- Gitblit v1.9.3