From ef5db2eff33485e30168e3c2d40731452c0839fd Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Wed, 8 Nov 2023 18:40:55 +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 --- src/views/goverment/largeScreen/index.vue | 48 ++++++++--- .../components/operateDialog.vue | 81 +++++++++++++++++++ 2 files changed, 116 insertions(+), 13 deletions(-) diff --git a/src/views/goverment/largeScreen/index.vue b/src/views/goverment/largeScreen/index.vue index 1b89c42..b27da13 100644 --- a/src/views/goverment/largeScreen/index.vue +++ b/src/views/goverment/largeScreen/index.vue @@ -245,7 +245,14 @@ import MapPrint from "./components/mapPrint.vue"; import FlyRoam from "./components/flyRoam.vue"; import MapMark from "./components/mapMark.vue"; import RouteNavigation from "./components/routeNavigation.vue"; -import { getSystemConfig, baseMapList, albugineaMapList, diffuseWallList, polylineCombineList } from "@/api/modules/mapCommon"; +import { + getSystemConfig, + baseMapList, + albugineaMapList, + diffuseWallList, + polylineCombineList, + gltfModelList +} from "@/api/modules/mapCommon"; const configJson = ref({}); const screenComparisonShow = ref(false); // 分屏对比弹框 const leftRollerList = ref([]); @@ -394,6 +401,31 @@ onMounted(async () => { configJson.value.layers = initAlbugineamaps; }); } + // 查询配置的gltf模型 + const resModel: any = await gltfModelList({}); + console.log(resModel, "gltf模型666666"); + if (resModel.result && resModel.result.length > 0) { + let initModel: any = [{ id: 2020, name: "gltf模型", type: "group" }]; + resModel.result.map((item: any) => { + initModel.push({ + pid: 2020, + type: "graphic", + name: item.name, + data: [ + { + type: "modelP", + position: [+item.lng, +item.lat, +item.alt], + style: { + url: item.url + } + } + ], + popup: item.name, + show: item.show ? item.show : false + }); + }); + configJson.value.layers = configJson.value.layers.concat(initModel); + } await initMars3d(configJson.value); await initTree(); }); @@ -760,16 +792,6 @@ const closeSearch = () => { }; const initMars3d = (option: any) => { map = new mars3d.Map("mars3dContainer", option); - // 加载石化工厂模型 - // const tiles3dLayer = new mars3d.layer.TilesetLayer({ - // name: "石油化工厂", - // url: "http://data.mars3d.cn/3dtiles/max-shihua/tileset.json", - // position: { lng: 117.077158, lat: 31.659116, alt: -2.0 }, - // maximumScreenSpaceError: 1, - // popup: "all" - // }); - // map.addLayer(tiles3dLayer); - // tiles3dLayer.flyTo(); // 创建查询api queryPoi = new mars3d.query.GaodePOI({ key: ["ad31e514e7e740179d6d8f182720bcf5"] @@ -889,7 +911,7 @@ const getLineEffect = async () => { } else { mars3d.Util.fetchJson({ url: JSON.parse(item.jsonFile).url }).then(function (data) { const busLines: any = []; - data.forEach(function (busLine: any, idx: any) { + data.map((busLine: any, idx: any) => { let prevPt: any; const points = []; for (let i = 0; i < busLine.length; i += 2) { @@ -912,7 +934,7 @@ const getLineEffect = async () => { bgColor: item.bgColor }); }); - busLines.forEach(function (item2: any, index2: any) { + busLines.map((item2: any, index2: any) => { arrData.push({ positions: item2.positions, style: { diff --git a/src/views/jxjview/lineManagement/components/operateDialog.vue b/src/views/jxjview/lineManagement/components/operateDialog.vue index bee55ac..17759e7 100644 --- a/src/views/jxjview/lineManagement/components/operateDialog.vue +++ b/src/views/jxjview/lineManagement/components/operateDialog.vue @@ -20,6 +20,36 @@ +
+ +
+
+
经度{{ index + 1 }}
+
纬度{{ index + 1 }}
+
高度{{ index + 1 }}
+
+
+
+ +
+
+ +
+
+ +
+
+ 删除 +
+
+
+
+
+ 追加 +
+
+
+
@@ -86,6 +116,7 @@ const props = defineProps({ title: String }); const emits = defineEmits(["update:operateVisible", "confirm"]); +const addPositions = ref([]); const baseUrl = import.meta.env.VITE_API_URL; const fileList = ref([]); const store = GlobalStore(); @@ -127,6 +158,18 @@ const rules = ref({ const formRef = ref(); const formData = ref({}); const visible1 = ref(false); +// 追加行数据 +const appendRow = () => { + addPositions.value.push({ lng: "", lat: "", alt: "" }); +}; +// 删除行数据 +const deleteRow = (index: number) => { + if (addPositions.value.length == minLength.value) { + ElMessage.error("不能少于最少点位数据"); + return; + } + addPositions.value.splice(index, 1); +}; // 类型切换 const typeChange = (e: any) => { if (e == "ODLine") { @@ -179,6 +222,16 @@ const confirmSubmit = () => { let requestData = { ...formData.value }; + let positionPass = true; + addPositions.value.map((item: any) => { + if (!item.lng || !item.lat || !item.alt) { + positionPass = false; + } + }); + if (!positionPass) { + ElMessage.error("请输入坐标"); + return; + } if (requestData.type == "ODLine") { requestData.jsonFile = JSON.stringify(requestData.jsonFile); } @@ -278,6 +331,34 @@ onMounted(() => {}); margin: 0 auto; margin-top: 25px; .row { + .table-content { + display: flex; + flex-direction: column; + .table-head { + @include flex; + .head-value { + width: 200px; + color: #333; + font-weight: 700; + margin-right: 10px; + } + } + .table-body { + @include flex; + .body-value { + margin-right: 10px; + width: 200px; + } + .body-operate { + margin-left: 5px; + } + } + } + .table-operate { + width: 100%; + display: block; + margin-top: 5px; + } } } }