fix: BUG修改

This commit is contained in:
kun 2023-11-20 10:45:49 +08:00
parent f3ce81fc67
commit 0d4791f97a
3 changed files with 29 additions and 31 deletions

View File

@ -3,7 +3,7 @@ NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用) # 本地环境接口地址(/api/index.ts文件中使用)
VITE_API_URL = 'http://192.168.34.155:6677' 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_WPAPI_URL = "http://182.90.224.147:8081"
# VITE_API_URL = "http://182.90.224.147:6688" # VITE_API_URL = "http://182.90.224.147:6688"

View File

@ -403,11 +403,12 @@ const saveJson = async () => {
// return; // return;
// } // }
console.log(map); console.log(map);
let arr: any = []; console.log(terrainClip.list);
map.eachThing(item => { let arr: any = terrainClip.list;
console.log(item); // map.eachThing(item => {
arr.push(item); // console.log(item);
}); // arr.push(item);
// });
arr = arr.concat(graphicLayer.getGraphics()); arr = arr.concat(graphicLayer.getGraphics());
clearBool.value = false; clearBool.value = false;
console.log(arr); console.log(arr);
@ -686,10 +687,6 @@ const btnDraw = () => {
opacity: 0.5, opacity: 0.5,
outline: false outline: false
}, },
attr: {
key: "terrainClip",
diffHeight: allProperty.value.diffHeight
},
success: (graphic: any) => { success: (graphic: any) => {
const positions = graphic.positionsShow; const positions = graphic.positionsShow;
graphicLayer.clear(); graphicLayer.clear();
@ -708,10 +705,6 @@ const btnDrawExtent = () => {
color: "#007be6", color: "#007be6",
opacity: 0.8 opacity: 0.8
}, },
attr: {
key: "terrainClip",
diffHeight: allProperty.value.diffHeight
},
success: (graphic: any) => { success: (graphic: any) => {
const positions = graphic.getOutlinePositions(false); const positions = graphic.getOutlinePositions(false);
graphicLayer.clear(); graphicLayer.clear();

View File

@ -468,18 +468,23 @@ const showMapData = (arr: any) => {
console.log(arr); console.log(arr);
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
arr.map(item => { arr.map(item => {
if (item.attr.key == "terrainClip") { if (item.pitPrimitive && item.pitPrimitive.type == "pit") {
// //
const terrainClip = new mars3d.thing.TerrainClip({ console.log(123456789);
diffHeight: item.attr.diffHeight, // if (item.pitPrimitive.style.imageBottom) {
image: new URL("../../../assets/images/Mars3DImg/textures/poly-stone.jpg", import.meta.url).href, const terrainClip = new mars3d.thing.TerrainClip({
imageBottom: new URL("../../../assets/images/Mars3DImg/textures/poly-soil.jpg", import.meta.url).href, diffHeight: item.pitPrimitive.style.diffHeight, //
splitNum: 80, // image: new URL("../../../assets/images/Mars3DImg/textures/poly-stone.jpg", import.meta.url).href,
enabled: true imageBottom: new URL("../../../assets/images/Mars3DImg/textures/poly-soil.jpg", import.meta.url).href,
}); splitNum: 80, //
const positions = item.points || item.positions; enabled: true
// });
terrainClip.addArea(positions); map.addThing(terrainClip);
const positions = item.pitPrimitive.points || item.pitPrimitive.positions;
console.log(positions);
//
terrainClip.addArea(positions);
}
} else if (item.type == "fixedRoute") { } else if (item.type == "fixedRoute") {
const newRoutePath = new mars3d.graphic.FixedRoute({ const newRoutePath = new mars3d.graphic.FixedRoute({
id: item.id, id: item.id,
@ -545,7 +550,7 @@ const getConfig = async () => {
console.log(result, "6666666"); console.log(result, "6666666");
if (result) { if (result) {
layerId.value = result.configId; layerId.value = result.configId;
layerJsonArr.value = result.configType; layerJsonArr.value = JSON.parse(result.configValue);
console.log(layerJsonArr.value); console.log(layerJsonArr.value);
showMapData(layerJsonArr.value); showMapData(layerJsonArr.value);
} }
@ -554,8 +559,8 @@ const getConfig = async () => {
const saveAddLayer = async (subGraphicLayer: any) => { const saveAddLayer = async (subGraphicLayer: any) => {
const geojson = subGraphicLayer.getGraphics(false); const geojson = subGraphicLayer.getGraphics(false);
console.log(geojson); console.log(geojson);
// let allArr = layerJsonArr.value.concat(geojson); let allArr = layerJsonArr.value.concat(geojson);
let requestData: any = { configKey: "layerConfig", configValue: JSON.stringify(geojson) }; let requestData: any = { configKey: "layerConfig", configValue: JSON.stringify(allArr) };
if (layerJsonArr.value.length > 0) { if (layerJsonArr.value.length > 0) {
requestData.configId = layerId.value; requestData.configId = layerId.value;
} }
@ -570,9 +575,9 @@ const saveAddLayer = async (subGraphicLayer: any) => {
const saveAnalysisLayer = async (subLayerData: any) => { const saveAnalysisLayer = async (subLayerData: any) => {
const geojson = subLayerData; const geojson = subLayerData;
console.log(geojson); console.log(geojson);
// let allArr = layerJsonArr.value.concat(geojson); let allArr = layerJsonArr.value.concat(geojson);
// console.log(allArr); console.log(allArr);
let requestData: any = { configKey: "layerConfig", configType: geojson }; let requestData: any = { configKey: "layerConfig", configValue: JSON.stringify(allArr) };
if (layerJsonArr.value.length > 0) { if (layerJsonArr.value.length > 0) {
requestData.configId = layerId.value; requestData.configId = layerId.value;
} }