Commit 10e1d757 authored by 邓晓峰's avatar 邓晓峰

feat: 集成报表菜单

parent b75e03e8
Pipeline #42988 passed with stages
in 2 minutes 59 seconds
...@@ -4,11 +4,11 @@ import { connect } from 'react-redux'; ...@@ -4,11 +4,11 @@ import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store'; import { actionCreators } from '@/containers/App/store';
import _ from 'lodash'; import _ from 'lodash';
// import { AMapScene } from '@wisdom-map/Amap'; // import { AMapScene } from '@wisdom-map/Amap';
import { ArcGISMap } from '@wisdom-map/arcgismap'; // import { ArcGISMap } from '@wisdom-map/arcgismap';
import arcgisConfig from '@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/config'; // import arcgisConfig from '@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/config';
import pkg from '../../../package.json'; // import pkg from '../../../package.json';
arcgisConfig.assetsPath = `${window.location.origin}/${pkg.name.toLocaleLowerCase()}/assets`; // arcgisConfig.assetsPath = `${window.location.origin}/${pkg.name.toLocaleLowerCase()}/assets`;
window.arcgisAssetsPath = arcgisConfig.assetsPath; // window.arcgisAssetsPath = arcgisConfig.assetsPath;
class Map extends React.PureComponent { class Map extends React.PureComponent {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -22,50 +22,50 @@ class Map extends React.PureComponent { ...@@ -22,50 +22,50 @@ class Map extends React.PureComponent {
} }
transformMapsetting(mapsettings) { transformMapsetting(mapsettings) {
let layers = mapsettings.layers; // let layers = mapsettings.layers;
layers = layers.map(item => { // layers = layers.map(item => {
item.url = /^\//.test(item.url) ? `/${item.url}`: item.url; // item.url = /^\//.test(item.url) ? `/${item.url}`: item.url;
return item; // return item;
}) // })
return Object.assign({}, mapsettings, { // return Object.assign({}, mapsettings, {
layers: layers // layers: layers
}); // });
} }
destroyAMap() { destroyAMap() {
const mapKey = [ // const mapKey = [
'_AMap_AMap.MapType', // '_AMap_AMap.MapType',
'_AMap_labelcanvas', // '_AMap_labelcanvas',
'_AMap_imagelayer', // '_AMap_imagelayer',
'_AMap_anole', // '_AMap_anole',
'_AMap_AMap.Scale', // '_AMap_AMap.Scale',
'_AMap_rbush', // '_AMap_rbush',
'_AMap_AMap.IndoorMap', // '_AMap_AMap.IndoorMap',
'_AMap_AMap.CustomLayer', // '_AMap_AMap.CustomLayer',
'_AMap_AMap.MarkerClusterer', // '_AMap_AMap.MarkerClusterer',
'_AMap_vectorlayer', // '_AMap_vectorlayer',
'_AMap_AMap.OverView', // '_AMap_AMap.OverView',
'_AMap_sync', // '_AMap_sync',
'_AMap_AMap.PlaceSearch', // '_AMap_AMap.PlaceSearch',
'_AMap_AMap.DistrictSearch', // '_AMap_AMap.DistrictSearch',
'_AMap_Map3D', // '_AMap_Map3D',
'_AMap_AMap.Autocomplete', // '_AMap_AMap.Autocomplete',
'_AMap_AMap.Heatmap', // '_AMap_AMap.Heatmap',
'_AMap_wgl', // '_AMap_wgl',
'_AMap_overlay', // '_AMap_overlay',
'_AMap_cvector', // '_AMap_cvector',
'_AMap_AMap.ToolBar', // '_AMap_AMap.ToolBar',
'_AMap_mouse', // '_AMap_mouse',
'_AMap_AMap.RangingTool', // '_AMap_AMap.RangingTool',
'_AMap_data.tileKeys' // '_AMap_data.tileKeys'
]; // ];
// eslint-disable-next-line no-plusplus // // eslint-disable-next-line no-plusplus
for (let i = 0; i < mapKey.length; i++) { // for (let i = 0; i < mapKey.length; i++) {
localStorage.removeItem(mapKey[i]); // localStorage.removeItem(mapKey[i]);
} // }
delete window.AMap; // delete window.AMap;
delete window.AMapUI; // delete window.AMapUI;
delete window.AMapUI_DEBUG; // delete window.AMapUI_DEBUG;
} }
componentWillMount() { componentWillMount() {
...@@ -73,14 +73,14 @@ class Map extends React.PureComponent { ...@@ -73,14 +73,14 @@ class Map extends React.PureComponent {
} }
getAMap(AMapObj, AMap) { getAMap(AMapObj, AMap) {
this.props.updageMapView({ // this.props.updageMapView({
AMapObj, // AMapObj,
AMap // AMap
}); // });
} }
getArcGISMap(map) { getArcGISMap(map) {
this.props.updageMapView(map); // this.props.updageMapView(map);
} }
show() { show() {
...@@ -96,17 +96,17 @@ class Map extends React.PureComponent { ...@@ -96,17 +96,17 @@ class Map extends React.PureComponent {
} }
render() { render() {
return ( // return (
<> // <>
{ // {
this.state.type === 'AMap' ? ( // this.state.type === 'AMap' ? (
<div {...this.state} getMapInfo={this.getAMap.bind(this)}/> // <div {...this.state} getMapInfo={this.getAMap.bind(this)}/>
) : ( // ) : (
<ArcGISMap config={this.state.options} getMapInfo={this.getArcGISMap.bind(this)}/> // <ArcGISMap config={this.state.options} getMapInfo={this.getArcGISMap.bind(this)}/>
) // )
} // }
</> // </>
) // )
} }
} }
const mapStateToProps = state => ({}); const mapStateToProps = state => ({});
......
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