From 106da732f09c3457da957fc1676749a765840072 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Thu, 30 Nov 2023 21:17:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.html | 2 +- .../frontLargeScreen/bridgeFace.json | 83 +++++ .../goverment/frontLargeScreen/index.vue | 148 +++++++- .../goverment/largeScreen/bridgeFace.json | 83 +++++ .../largeScreen/components/modelLineMark.vue | 340 ++++++++++++++++++ src/views/goverment/largeScreen/index.vue | 70 +++- 6 files changed, 716 insertions(+), 10 deletions(-) create mode 100644 src/views/goverment/frontLargeScreen/bridgeFace.json create mode 100644 src/views/goverment/largeScreen/bridgeFace.json create mode 100644 src/views/goverment/largeScreen/components/modelLineMark.vue diff --git a/dist/index.html b/dist/index.html index b43f7ed..fa13513 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,4 +1,4 @@ -
+ + diff --git a/src/views/goverment/largeScreen/index.vue b/src/views/goverment/largeScreen/index.vue index 65cd4da..7706997 100644 --- a/src/views/goverment/largeScreen/index.vue +++ b/src/views/goverment/largeScreen/index.vue @@ -174,6 +174,8 @@ + + @@ -307,6 +309,7 @@ import RegionalNavigation from "./components/regionalNavigation.vue"; import MyTags from "./components/myTags.vue"; import ViewBookmark from "./components/viewBookmark.vue"; import FlyViewBookmark from "./components/flyViewBookmark.vue"; +import modelLineMark from "./components/modelLineMark.vue"; import MapPrint from "./components/mapPrint.vue"; import FlyRoam from "./components/flyRoam.vue"; import MapMark from "./components/mapMark.vue"; @@ -322,6 +325,7 @@ import { equipmentList } from "@/api/modules/mapCommon"; import { getDicList } from "@/api/modules/jxjview"; +const modelLineList = ref([]); const equipTypeDictLabel = ref(); const equipTypeList = ref([]); const equipListShow = ref(false); @@ -343,6 +347,7 @@ const flyRoamShow = ref(false); // 飞行漫游弹框 const mapPrintShow = ref(false); // 地图打印弹框 const viewBookmarkShow = ref(false); // 视角书签弹框 const flyViewBookmarkShow = ref(false); // 视点飞行书签弹框 +const modelLineMarkShow = ref(false); // 模型标绘弹框 const myTagsShow = ref(false); // 我的标记弹框 const regionalNavigationShow = ref(false); // 地区导航弹框 const pickingShow = ref(false); // 坐标定位弹框 @@ -748,6 +753,7 @@ const data = [ { name: "我的标记", icon: new URL("@/assets/images/Mars3DIcon/wdbj.png", import.meta.url).href }, { name: "视角书签", icon: new URL("@/assets/images/Mars3DIcon/sjsq.png", import.meta.url).href }, { name: "视点飞行", icon: new URL("@/assets/images/Mars3DIcon/sjsq.png", import.meta.url).href }, + { name: "模型标绘", icon: new URL("@/assets/images/Mars3DIcon/sjsq.png", import.meta.url).href }, { name: "地图打印", icon: new URL("@/assets/images/Mars3DIcon/dtdy.png", import.meta.url).href }, { name: "飞行漫游", icon: new URL("@/assets/images/Mars3DIcon/fxmy.png", import.meta.url).href }, { name: "图上标绘", icon: new URL("@/assets/images/Mars3DIcon/tsbh.png", import.meta.url).href }, @@ -907,9 +913,10 @@ const clickMenu = (name: any) => { myTagsShow.value = true; } else if (name == "视角书签") { viewBookmarkShow.value = true; - flyViewBookmarkShow; } else if (name == "视点飞行") { flyViewBookmarkShow.value = true; + } else if (name == "模型标绘") { + modelLineMarkShow.value = true; } else if (name == "地图打印") { mapPrintShow.value = true; } else if (name == "飞行漫游") { @@ -1132,12 +1139,69 @@ const initMars3d = (option: any) => { // return dom; // }); map.addLayer(graphicLayer); + // 监听比例尺的变化 + const distanceLegend = new mars3d.control.DistanceLegend({ left: "100px", bottom: "2px" }); + map.addControl(distanceLegend); + distanceLegend.on(mars3d.EventType.change, function (event) { + console.log("比例尺发生变化", event); + if (event.distance > 1000) { + showModelLine(); + } else { + closeModelLine(); + } + }); // 获取配置文件底图数据 getBasicMaps(); // 查询配置点坐标效果 getPointPosition(); // 查询配置线效果 getLineEffect(); + // 查询配置模型线效果 + getModelLine(); +}; +// 隐藏模型线效果并显示模型 +const closeModelLine = () => { + modelLineList.value.map(item => { + let graphic = graphicLayer.getGraphicById(item.id); + graphic.show = false; + }); +}; +// 显示模型线效果并隐藏模型 +const showModelLine = () => { + modelLineList.value.map(item => { + let graphic = graphicLayer.getGraphicById(item.id); + graphic.show = true; + }); +}; +// 获取模型线效果 +const getModelLine = async () => { + let requestData = { + configKey: "modelLineConfig" + }; + const { result } = await getSystemConfig(requestData); + console.log(result, "6666666"); + if (result) { + let arr = JSON.parse(result.configValue); + if (arr && arr.length > 0) { + console.log("历史数据", arr); + modelLineList.value = arr; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const graphicImg = new mars3d.graphic.CurveEntity({ + id: item.id, + positions: item.points, + style: { + color: item.color, + width: 3, + clampToGround: true + }, + show: false + }); + console.log(graphicImg); + graphicLayer.addGraphic(graphicImg); + } + } + } }; // 取区域内的随机点 const randomPoint = (position: any) => { @@ -1751,6 +1815,10 @@ onUnmounted(() => { background: rgba(51, 89, 181, 0.6); } } + .tool-menu-operate { + top: 56px; + right: 10px; + } .basic-map { position: absolute; top: 60px;