diff --git a/.env.development b/.env.development index f3becfa..54f5fa3 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ NODE_ENV = 'development' # 本地环境接口地址(/api/index.ts文件中使用) VITE_API_URL = 'http://192.168.34.155:6677' -# VITE_API_URL = 'http://139.9.66.234:60677' +# VITE_API_URL = 'http://jxjzw.zhgdyun.com:6677' VITE_WPAPI_URL = "http://182.90.224.147:8081" # VITE_API_URL = "http://182.90.224.147:6688" diff --git a/src/views/goverment/largeScreen/components/spaceAnalysis.vue b/src/views/goverment/largeScreen/components/spaceAnalysis.vue index 04c47c7..12cca40 100644 --- a/src/views/goverment/largeScreen/components/spaceAnalysis.vue +++ b/src/views/goverment/largeScreen/components/spaceAnalysis.vue @@ -403,11 +403,12 @@ const saveJson = async () => { // return; // } console.log(map); - let arr: any = []; - map.eachThing(item => { - console.log(item); - arr.push(item); - }); + console.log(terrainClip.list); + let arr: any = terrainClip.list; + // map.eachThing(item => { + // console.log(item); + // arr.push(item); + // }); arr = arr.concat(graphicLayer.getGraphics()); clearBool.value = false; console.log(arr); @@ -686,10 +687,6 @@ const btnDraw = () => { opacity: 0.5, outline: false }, - attr: { - key: "terrainClip", - diffHeight: allProperty.value.diffHeight - }, success: (graphic: any) => { const positions = graphic.positionsShow; graphicLayer.clear(); @@ -708,10 +705,6 @@ const btnDrawExtent = () => { color: "#007be6", opacity: 0.8 }, - attr: { - key: "terrainClip", - diffHeight: allProperty.value.diffHeight - }, success: (graphic: any) => { const positions = graphic.getOutlinePositions(false); graphicLayer.clear(); diff --git a/src/views/goverment/largeScreen/index.vue b/src/views/goverment/largeScreen/index.vue index c671bf7..cb8152b 100644 --- a/src/views/goverment/largeScreen/index.vue +++ b/src/views/goverment/largeScreen/index.vue @@ -468,18 +468,23 @@ const showMapData = (arr: any) => { console.log(arr); if (arr && arr.length > 0) { arr.map(item => { - if (item.attr.key == "terrainClip") { + if (item.pitPrimitive && item.pitPrimitive.type == "pit") { // 地形开挖 - const terrainClip = new mars3d.thing.TerrainClip({ - diffHeight: item.attr.diffHeight, // 井的深度 - image: new URL("../../../assets/images/Mars3DImg/textures/poly-stone.jpg", import.meta.url).href, - imageBottom: new URL("../../../assets/images/Mars3DImg/textures/poly-soil.jpg", import.meta.url).href, - splitNum: 80, // 井边界插值数 - enabled: true - }); - const positions = item.points || item.positions; - // 挖地区域 - terrainClip.addArea(positions); + console.log(123456789); + if (item.pitPrimitive.style.imageBottom) { + const terrainClip = new mars3d.thing.TerrainClip({ + diffHeight: item.pitPrimitive.style.diffHeight, // 井的深度 + image: new URL("../../../assets/images/Mars3DImg/textures/poly-stone.jpg", import.meta.url).href, + imageBottom: new URL("../../../assets/images/Mars3DImg/textures/poly-soil.jpg", import.meta.url).href, + splitNum: 80, // 井边界插值数 + enabled: true + }); + map.addThing(terrainClip); + const positions = item.pitPrimitive.points || item.pitPrimitive.positions; + console.log(positions); + // 挖地区域 + terrainClip.addArea(positions); + } } else if (item.type == "fixedRoute") { const newRoutePath = new mars3d.graphic.FixedRoute({ id: item.id, @@ -545,7 +550,7 @@ const getConfig = async () => { console.log(result, "6666666"); if (result) { layerId.value = result.configId; - layerJsonArr.value = result.configType; + layerJsonArr.value = JSON.parse(result.configValue); console.log(layerJsonArr.value); showMapData(layerJsonArr.value); } @@ -554,8 +559,8 @@ const getConfig = async () => { const saveAddLayer = async (subGraphicLayer: any) => { const geojson = subGraphicLayer.getGraphics(false); console.log(geojson); - // let allArr = layerJsonArr.value.concat(geojson); - let requestData: any = { configKey: "layerConfig", configValue: JSON.stringify(geojson) }; + let allArr = layerJsonArr.value.concat(geojson); + let requestData: any = { configKey: "layerConfig", configValue: JSON.stringify(allArr) }; if (layerJsonArr.value.length > 0) { requestData.configId = layerId.value; } @@ -570,9 +575,9 @@ const saveAddLayer = async (subGraphicLayer: any) => { const saveAnalysisLayer = async (subLayerData: any) => { const geojson = subLayerData; console.log(geojson); - // let allArr = layerJsonArr.value.concat(geojson); - // console.log(allArr); - let requestData: any = { configKey: "layerConfig", configType: geojson }; + let allArr = layerJsonArr.value.concat(geojson); + console.log(allArr); + let requestData: any = { configKey: "layerConfig", configValue: JSON.stringify(allArr) }; if (layerJsonArr.value.length > 0) { requestData.configId = layerId.value; }