Commit 098df0bf authored by 邹绪超's avatar 邹绪超

feat: 完成运维配置

parent ad7871d4
Pipeline #33904 passed with stages
in 39 minutes 55 seconds
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
"@babel/polyfill": "7.4.3", "@babel/polyfill": "7.4.3",
"@babel/preset-typescript": "^7.12.1", "@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"@wisdom-cesium/cesium": "^1.0.27", "@wisdom-cesium/cesium": "^1.0.29",
"ace-builds": "^1.4.12", "ace-builds": "^1.4.12",
"antd-img-crop": "^3.13.2", "antd-img-crop": "^3.13.2",
"bizcharts": "^4.0.15", "bizcharts": "^4.0.15",
......
...@@ -2,34 +2,53 @@ import React, { useEffect, useState, useRef } from 'react' ...@@ -2,34 +2,53 @@ import React, { useEffect, useState, useRef } from 'react'
import { Input, Button, Modal, message } from 'antd' import { Input, Button, Modal, message } from 'antd'
import { gcj_decrypt, exetent2AmapPoint, lngLat2WebMercator } from '@/utils/transformUtil' import { gcj_decrypt, exetent2AmapPoint, lngLat2WebMercator } from '@/utils/transformUtil'
import { GetAllConfig, GetMetaData } from '@/services/platform/gis' import { GetAllConfig, GetMetaData } from '@/services/platform/gis'
import {
const pdCesium = require('@wisdom-cesium/cesium') PdRender,
const Cesium = require('cesium/Cesium') Cesium,
} from '@wisdom-cesium/cesium'
const { Search } = Input; const { Search } = Input;
let pdViewer, viewer, extent, orientation, position; let pdViewer, viewer, extent, orientation, position;
const MapScope = props => { const MapScope = props => {
const { visible, confirmModal,item } = props; const { visible, confirmModal,item , baseMapData, baseMap, handleType} = props;
const [options, setOptions] = useState([]) const [options, setOptions] = useState([])
let el = useRef(null); let el = useRef(null);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
let buttonEl = useRef(null); let buttonEl = useRef(null);
const getBaseMap = () => {
if(handleType == 'update') {
return item.baseMap.map(item => ({
type : item.baseMap.type,
status : item.status
}))
} else if(handleType == 'add') {
if(!baseMapData) return []
let data = baseMapData.map(item => {
let map = baseMap.find(({type}) => type === item.type)
return {
type : map.type,
status : item.status || 'notActive'
}
})
return data
}
}
const getCamera = () => {
if (handleType == 'update') {
let {mapSettings} = item
return mapSettings.camera || {}
} else if (handleType == 'add') {
return {}
}
}
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
let lon = 114.31,lat=30.52 pdViewer = new PdRender({
pdViewer = new pdCesium.PdRender({
el: el.current, el: el.current,
baseMaps : getBaseMap() || [] ,
cameraSetting : getCamera () || {}
}); });
if(item){
lon =item.mapSettings.camera.position.lon
lat =item.mapSettings.camera.position.lat
}
viewer = pdViewer.viewer; viewer = pdViewer.viewer;
pdViewer.viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(lon, lat, 15000.0), //武汉
});
var cesiumBottom = document.getElementsByClassName('cesium-viewer-bottom')[0]
cesiumBottom.style.display = 'none'
} }
}, [visible]); }, [visible]);
...@@ -136,19 +155,31 @@ const MapScope = props => { ...@@ -136,19 +155,31 @@ const MapScope = props => {
return [extent.xmin, extent.ymin, extent.xmax, extent.ymax]; return [extent.xmin, extent.ymin, extent.xmax, extent.ymax];
} }
const onSubmit = () => { const onSubmit = () => {
let propertyData = document.getElementsByClassName("cesium-geocoder-input cesium-geocoder-input-wide")[0] let propertyData = viewer.container.getElementsByClassName("cesium-geocoder-input cesium-geocoder-input-wide")[0]
if (propertyData && propertyData.value) { extent = getCurrentExtent();
position = getCenterPosition(); orientation = getOrientation();
extent = getCurrentExtent(); position = getCenterPosition();
orientation = getOrientation(); if (handleType == 'add') {
var areaName = propertyData.value; if (propertyData && propertyData.value) {
var areaName = propertyData.value;
let mapSettings = { camera: { mode: '3d', position, orientation }, areaName, extent }
confirmModal && confirmModal(mapSettings)
}
else {
message.info("未选择视角,请先选择区域")
}
} else if (handleType == 'update') {
let areaName
if (propertyData && propertyData.value) {
areaName = propertyData.value
} else if(item.mapSettings && item.mapSettings.areaName) {
areaName = item.mapSettings.areaName
} else {
return message.info("未选择视角,请先选择区域")
}
let mapSettings = { camera: { mode: '3d', position, orientation }, areaName, extent } let mapSettings = { camera: { mode: '3d', position, orientation }, areaName, extent }
confirmModal && confirmModal(mapSettings) confirmModal && confirmModal(mapSettings)
} }
else {
message.info("未选择视角,请先选择区域")
}
} }
const filter = (inputValue, path) => { const filter = (inputValue, path) => {
return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
......
...@@ -158,9 +158,13 @@ const AddModal = props => { ...@@ -158,9 +158,13 @@ const AddModal = props => {
case "天地图影像": case "天地图影像":
return 'tianditu-i'; return 'tianditu-i';
case "百度街道": case "百度街道":
return 'bmap-v'; return 'baiduMapStreet';
case "百度影像": case "百度影像":
return 'bmap-i'; return 'baiduMapImage';
case "mapBox地图" :
return 'mapBoxImage';
case "arcgis地图" :
return "arcgisImage"
default: default:
return 'amap-v'; return 'amap-v';
} }
......
...@@ -143,7 +143,7 @@ const TileData = props => { ...@@ -143,7 +143,7 @@ const TileData = props => {
// 获取瓦片数据配置数据 // 获取瓦片数据配置数据
const renderTile = () => { const renderTile = () => {
setTreeLoading(true); setTreeLoading(true);
const baseMapData = ['高德街道', '高德影像', '天地图街道', '天地图影像','百度街道','百度影像'] const baseMapData = ['高德街道', '高德影像', '天地图街道', '天地图影像','百度街道','百度影像', 'mapBox地图', 'arcgis地图']
GetBaseMapList().then( GetBaseMapList().then(
res => { res => {
if (res.msg === "Ok") { if (res.msg === "Ok") {
......
...@@ -25,8 +25,10 @@ const AddModal = props => { ...@@ -25,8 +25,10 @@ const AddModal = props => {
'amap-i': "高德影像", 'amap-i': "高德影像",
'tianditu-v': "天地图街道", 'tianditu-v': "天地图街道",
'tianditu-i': "天地图影像", 'tianditu-i': "天地图影像",
'bmap-v': "百度街道", 'baiduMapStreet': "百度街道",
'bmap-i': "百度影像" 'baiduMapImage': "百度影像",
"mapBoxImage" : "mapBox地图",
"arcgisImage" : "arcgis地图"
} }
const onSubmit = () => { const onSubmit = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
...@@ -240,6 +242,9 @@ const AddModal = props => { ...@@ -240,6 +242,9 @@ const AddModal = props => {
<MapScope <MapScope
visible={mapScopeVisible} visible={mapScopeVisible}
onCancel={() => setMapScopeVisible(false)} onCancel={() => setMapScopeVisible(false)}
baseMapData = {baseMapData}
baseMap = {baseMap}
handleType = 'add'
confirmModal={submitExtent} /></> confirmModal={submitExtent} /></>
); );
}; };
......
...@@ -218,6 +218,7 @@ const CardData = props => { ...@@ -218,6 +218,7 @@ const CardData = props => {
onCancel={() => setMapScopeVisible(false)} onCancel={() => setMapScopeVisible(false)}
confirmModal={submitExtent} confirmModal={submitExtent}
item={props.item} item={props.item}
handleType = 'update'
/> />
</> </>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment