Merge branch 'main' of http://123.132.248.154:10000/gitY/LinYeFangHuo
commit
e55606d0c2
|
|
@ -13,6 +13,9 @@ VITE_GLOB_UPLOAD_URL= http://60.213.14.14:6070
|
|||
|
||||
VITE_GLOB_INFO_IMAGE_URL=http://120.222.154.48:6050
|
||||
|
||||
# geoserver
|
||||
VITE_GLOB_GEOSERVER_BASE_URL = http://192.168.10.163:8080
|
||||
|
||||
# Interface prefix
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_APP_TECHINICAL_SUPPORT,
|
||||
VITE_GLOB_APP_VERSIONS,
|
||||
VITE_GLOB_YINGXIANG_SERVER,
|
||||
VITE_GLOB_FILE_PREVIEW
|
||||
VITE_GLOB_FILE_PREVIEW,
|
||||
VITE_GLOB_GEOSERVER_BASE_URL,
|
||||
} = ENV;
|
||||
let { VITE_GLOB_API_URL } = ENV;
|
||||
if (localStorage.getItem(API_ADDRESS)) {
|
||||
|
|
@ -58,7 +59,8 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_APP_TECHINICAL_SUPPORT,
|
||||
VITE_GLOB_APP_VERSIONS,
|
||||
VITE_GLOB_YINGXIANG_SERVER,
|
||||
VITE_GLOB_FILE_PREVIEW
|
||||
VITE_GLOB_FILE_PREVIEW,
|
||||
VITE_GLOB_GEOSERVER_BASE_URL
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,16 +62,12 @@
|
|||
emit('select', item);
|
||||
selectItem.value = item;
|
||||
}
|
||||
function handleCheck(checkedKeys, e) {
|
||||
let checkedNode = e.node
|
||||
let checked = e.checked
|
||||
emit("checked",checkedNode, checked);
|
||||
|
||||
function handleCheck(keys){
|
||||
const item = treeFindById(treeData.value, keys[0]);
|
||||
emit("checked",item);
|
||||
}
|
||||
|
||||
function handleChange(key,e){
|
||||
console.log(key,e);
|
||||
}
|
||||
/**
|
||||
* 根据id值或某个属性的值从树结构中查询数据
|
||||
* @param {Array} treeArray 树结构数据
|
||||
|
|
|
|||
|
|
@ -74,6 +74,12 @@ const EditDrawingGeometry = (map,geometry) => {
|
|||
console.log("geojson",geojson);
|
||||
|
||||
// 加载图层
|
||||
if(drawingGraphicLayer){
|
||||
drawingGraphicLayer.clear();
|
||||
map.removeLayer(drawingGraphicLayer);
|
||||
drawingGraphicLayer = null;
|
||||
}
|
||||
|
||||
drawingGraphicLayer = new mars3d.layer.GeoJsonLayer({
|
||||
name: "编辑图层",
|
||||
data:geojson,
|
||||
|
|
@ -103,7 +109,7 @@ const EditDrawingGeometry = (map,geometry) => {
|
|||
popupOptions: {
|
||||
showNull: true
|
||||
},
|
||||
flyTo: true
|
||||
// flyTo: true
|
||||
})
|
||||
|
||||
map.addLayer(drawingGraphicLayer)
|
||||
|
|
@ -156,7 +162,7 @@ const AddDrawingGeometry = (map,type) => {
|
|||
popupOptions: {
|
||||
showNull: true
|
||||
},
|
||||
flyTo: true
|
||||
// flyTo: trues
|
||||
})
|
||||
|
||||
map.addLayer(drawingGraphicLayer);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
</a-descriptions>
|
||||
</div>
|
||||
<div class="detail-button">
|
||||
<a-button type="primary" @click="showTable = 'edit'"> 编辑 </a-button>
|
||||
<a-button type="primary" @click="detailToEdit"> 编辑 </a-button>
|
||||
<a-button type="primary" @click="showTable = ''" danger> 关闭 </a-button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -205,43 +205,75 @@
|
|||
|
||||
import { EventBus } from '@/utils/eventBus';
|
||||
|
||||
|
||||
import {
|
||||
GetGeometryCenter,
|
||||
EditDrawingGeometry,
|
||||
AddDrawingGeometry,
|
||||
PreviewDrawingGeometry,
|
||||
DrawingEnd,
|
||||
GeojsonToWkt
|
||||
} from './geometryHandler.ts';
|
||||
|
||||
|
||||
import * as mars3d from 'mars3d';
|
||||
|
||||
const { VITE_GLOB_GEOSERVER_BASE_URL } = getAppEnvConfig();
|
||||
|
||||
let globalMap: mars3d.Map;
|
||||
|
||||
const onMapLoad = (map) => {
|
||||
globalMap = map;
|
||||
};
|
||||
|
||||
EventBus.on('editLayerEnd', function (e) {
|
||||
EventBus.on("editLayerEnd",function(e){
|
||||
formState.value.geom = e;
|
||||
});
|
||||
|
||||
// 加载图层
|
||||
const handlerLoadLayer = (record, checked) => {
|
||||
|
||||
const handlerLoadLayer = (record) => {
|
||||
|
||||
let layer = globalMap.getLayerById(record.id);
|
||||
if (layer) {
|
||||
layer.show = checked;
|
||||
} else {
|
||||
const wmsLayer = new mars3d.layer.WmsLayer({
|
||||
id: record.id,
|
||||
|
||||
if(layer){
|
||||
layer.show = !layer.show
|
||||
}else{
|
||||
|
||||
let tileLayer = new mars3d.layer.WmsLayer({
|
||||
name: record.applicationName,
|
||||
url: 'http://192.168.10.163:8080/geoserver/my_workspace/wms',
|
||||
layers: 'workspace:' + record.tableName,
|
||||
id:record.id,
|
||||
url: VITE_GLOB_GEOSERVER_BASE_URL+"/geoserver/my_workspace/wms",
|
||||
layers: "my_workspace:"+record.tableName,
|
||||
parameters: {
|
||||
transparent: true,
|
||||
format: 'image/png',
|
||||
},
|
||||
});
|
||||
globalMap.addLayer(wmsLayer);
|
||||
getFeatureInfoParameters: {
|
||||
feature_count: 10
|
||||
},
|
||||
// 单击高亮及其样式
|
||||
highlight: {
|
||||
type: "wallP",
|
||||
diffHeight: 100,
|
||||
materialType: mars3d.MaterialType.LineFlow,
|
||||
materialOptions: {
|
||||
image: "https://data.mars3d.cn/img/textures/fence.png",
|
||||
color: "#ffff00",
|
||||
speed: 10, // 速度,建议取值范围1-100
|
||||
axisY: true
|
||||
}
|
||||
},
|
||||
popup: "all",
|
||||
flyTo: true,
|
||||
featureToGraphic:function(e){ // 获取点击查询到的数据
|
||||
let wkt = GeojsonToWkt(e.data.geometry);
|
||||
let editData = {...e.data.properties}
|
||||
editData.geom = wkt;
|
||||
viewData(editData)
|
||||
}
|
||||
})
|
||||
globalMap.addLayer(tileLayer);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -350,7 +382,7 @@
|
|||
|
||||
headData.value?.forEach((item, index) => {
|
||||
params.list.push({
|
||||
name: item,
|
||||
name: item.dataIndex,
|
||||
value: formState.value[item] ? formState.value[item] : null,
|
||||
});
|
||||
});
|
||||
|
|
@ -367,6 +399,8 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
//清空图层
|
||||
DrawingEnd();
|
||||
})
|
||||
.catch((error: ValidateErrorEntity<FormState>) => {
|
||||
console.log('error', error);
|
||||
|
|
@ -398,9 +432,13 @@
|
|||
isUpdate: false,
|
||||
});
|
||||
};
|
||||
const checkedLayer = (node, checked) => {
|
||||
handlerLoadLayer(node, checked);
|
||||
};
|
||||
|
||||
const checkedLayer = (e) => {
|
||||
console.log("e123",e);
|
||||
handlerLoadLayer(e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const hanlerLoadLayer = () => {};
|
||||
const handleSuccess = () => {
|
||||
|
|
@ -418,9 +456,9 @@
|
|||
|
||||
EditDrawingGeometry(globalMap, record.geom);
|
||||
};
|
||||
|
||||
const viewData = (record) => {
|
||||
console.log('record', record);
|
||||
PreviewDrawingGeometry(globalMap, record.geom);
|
||||
PreviewDrawingGeometry(globalMap,record.geom);
|
||||
selectVal.value = record;
|
||||
formState.value = record;
|
||||
showTable.value = 'detail';
|
||||
|
|
@ -436,6 +474,14 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
const detailToEdit = ()=>{
|
||||
|
||||
editData(formState.value);
|
||||
showTable.value = 'edit';
|
||||
|
||||
}
|
||||
|
||||
const delData = (record) => {
|
||||
createConfirm({
|
||||
iconType: 'info',
|
||||
|
|
|
|||
Loading…
Reference in New Issue