Commit f432d5fc authored by lihonglin's avatar lihonglin

feat: arcgis地图问题处理

parent 4702d35f
...@@ -2,10 +2,10 @@ const slash = require('slash2'); ...@@ -2,10 +2,10 @@ const slash = require('slash2');
const proxy = require('./proxy'); const proxy = require('./proxy');
const defaultSetting = require('./defaultSetting'); const defaultSetting = require('./defaultSetting');
const { REACT_APP_ENV } = process.env; const { REACT_APP_ENV } = process.env;
const cesiumBuild = "../node_modules/cesium/Build/Cesium" const cesiumBuild = '../node_modules/cesium/Build/Cesium';
const pkgName = require('../package.json').name; const pkgName = require('../package.json').name;
const path = require('path'); const path = require('path');
const CESIUM_BASE_URL = `/${pkgName}` const CESIUM_BASE_URL = `/${pkgName}`;
module.exports = { module.exports = {
// mfsu: {}, // mfsu: {},
webpack5: {}, webpack5: {},
...@@ -33,11 +33,7 @@ module.exports = { ...@@ -33,11 +33,7 @@ module.exports = {
ignoreMomentLocale: true, ignoreMomentLocale: true,
nodeModulesTransform: { nodeModulesTransform: {
type: 'none', type: 'none',
exclude: [ exclude: ['@wisdom-map/arcgismap', 'swagger-ui-react'],
'@wisdom-map/arcgismap',
'@wisdom-map/arcgismap/lib/arcgisapi',
'swagger-ui-react',
],
}, },
proxy: proxy[REACT_APP_ENV || 'dev'], proxy: proxy[REACT_APP_ENV || 'dev'],
// openAPI: { // openAPI: {
...@@ -84,25 +80,29 @@ module.exports = { ...@@ -84,25 +80,29 @@ module.exports = {
}, },
javascriptEnabled: true, javascriptEnabled: true,
}, },
copy : [{ copy: [
from : path.join(pkgName , cesiumBuild, './Workers'), {
to : 'Workers', from: path.join(pkgName, cesiumBuild, './Workers'),
},{ to: 'Workers',
from : path.join( pkgName, cesiumBuild, 'Assets'), },
to : 'Assets', {
},{ from: path.join(pkgName, cesiumBuild, 'Assets'),
from : path.join( pkgName, cesiumBuild, 'Widgets'), to: 'Assets',
to : 'Widgets', },
},{ {
from : path.join( pkgName, cesiumBuild, 'ThirdParty'), from: path.join(pkgName, cesiumBuild, 'Widgets'),
to : 'ThirdParty' to: 'Widgets',
} },
{
from: path.join(pkgName, cesiumBuild, 'ThirdParty'),
to: 'ThirdParty',
},
], ],
define : { define: {
CESIUM_BASE_URL : JSON.stringify(CESIUM_BASE_URL).replace(/\"/g , '') CESIUM_BASE_URL: JSON.stringify(CESIUM_BASE_URL).replace(/\"/g, ''),
}, },
alias: { alias: {
cesium : path.resolve(__dirname, cesiumBuild) cesium: path.resolve(__dirname, cesiumBuild),
}, },
workerLoader: {}, workerLoader: {},
// esbuild: {} // esbuild: {}
......
...@@ -27,15 +27,15 @@ export default { ...@@ -27,15 +27,15 @@ export default {
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/report', activeRule: '/civbase/report',
props: { props: {
origin: `//127.0.0.1:8345` origin: `//127.0.0.1:8345`,
} },
},
{
name: 'civ_webgis',
entry: `//${window.location.hostname}:8081/civ_webgis`,
container: '#micro-container',
activeRule: '/civbase/civ_webgis',
}, },
// {
// name: 'civ_webgis',
// entry: `//${window.location.hostname}:8080/civ_webgis`,
// container: '#micro-container',
// activeRule: '/civbase/civ_energy',
// },
{ {
name: 'civweb4', name: 'civweb4',
entry: `//${window.location.hostname}:3020/civweb4`, entry: `//${window.location.hostname}:3020/civweb4`,
......
/* eslint-disable */ /* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin; // const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'https://work.panda-water.cn'; // const proxyURL = 'https://work.panda-water.cn';
const proxyURL = 'http://192.168.12.47:8081';
module.exports = { module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './', assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: { dev: {
'/Panda_GIS': {
target: proxyURL,
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
pathRewrite: {
'/Panda_GIS': '/Panda_GIS',
},
},
'/CityInterface': { '/CityInterface': {
target: proxyURL, target: proxyURL,
// target: 'https://panda-water.cn', // target: 'https://panda-water.cn',
...@@ -70,6 +82,7 @@ module.exports = { ...@@ -70,6 +82,7 @@ module.exports = {
'/Publish': '/Publish', '/Publish': '/Publish',
}, },
}, },
'/PandaCore': { '/PandaCore': {
target: proxyURL, target: proxyURL,
changeOrigin: true, changeOrigin: true,
...@@ -84,22 +97,22 @@ module.exports = { ...@@ -84,22 +97,22 @@ module.exports = {
target: proxyURL, target: proxyURL,
changeOrigin: true, changeOrigin: true,
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
}, },
pathRewrite: { pathRewrite: {
'/PandaInformatization': '/PandaInformatization', '/PandaInformatization': '/PandaInformatization',
}, },
}, },
'/PandaWorkFlow': { '/PandaWorkFlow': {
target: proxyURL, target: proxyURL,
changeOrigin: true, changeOrigin: true,
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
}, },
pathRewrite: { pathRewrite: {
'/PandaWorkFlow': '/PandaWorkFlow', '/PandaWorkFlow': '/PandaWorkFlow',
}, },
}, },
'/CityTemp': { '/CityTemp': {
// target: 'http://192.168.10.150:8777', // target: 'http://192.168.10.150:8777',
target: proxyURL, target: proxyURL,
...@@ -133,6 +146,16 @@ module.exports = { ...@@ -133,6 +146,16 @@ module.exports = {
} }
}, },
pre: { pre: {
'/Panda_GIS': {
target: proxyURL,
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
pathRewrite: {
'/Panda_GIS': '/Panda_GIS',
},
},
'/CityInterface': { '/CityInterface': {
target: 'https://panda-water.cn', target: 'https://panda-water.cn',
changeOrigin: true, changeOrigin: true,
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"build": "cross-env NODE_ENV=production node internals/webpack/build.js", "build": "cross-env NODE_ENV=production node internals/webpack/build.js",
"build:clean": "rimraf ./build", "build:clean": "rimraf ./build",
"openapi": "cross-env NODE_ENV=development node server/openapi/run.js", "openapi": "cross-env NODE_ENV=development node server/openapi/run.js",
"start": "cross-env REACT_APP_ENV=dev NODE_ENV=development node server --port=$port", "start": "cross-env REACT_APP_ENV=dev NODE_ENV=development node --max_old_space_size=8192 server --port=$port",
"start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server", "start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server",
"start:production": "npm run test && npm run build && npm run start:prod", "start:production": "npm run test && npm run build && npm run start:prod",
"start:prod": "cross-env NODE_ENV=production node server", "start:prod": "cross-env NODE_ENV=production node server",
...@@ -90,8 +90,6 @@ ...@@ -90,8 +90,6 @@
"babel-core": "7.0.0-bridge.0" "babel-core": "7.0.0-bridge.0"
}, },
"dependencies": { "dependencies": {
"@esri/calcite-colors": "6.0.3",
"@esri/arcgis-html-sanitizer": "2.9.1",
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"@ant-design/colors": "^5.0.1", "@ant-design/colors": "^5.0.1",
"@ant-design/icons": "^4.0.0", "@ant-design/icons": "^4.0.0",
...@@ -102,9 +100,11 @@ ...@@ -102,9 +100,11 @@
"@ant-design/pro-utils": "^1.10.4", "@ant-design/pro-utils": "^1.10.4",
"@babel/polyfill": "7.4.3", "@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"@esri/arcgis-html-sanitizer": "^2.9.1",
"@esri/calcite-colors": "^6.0.3",
"@wisdom-cesium/cesium": "^1.0.64", "@wisdom-cesium/cesium": "^1.0.64",
"@wisdom-components/empty": "^1.4.1", "@wisdom-components/empty": "^1.4.1",
"@wisdom-map/arcgismap": "^1.0.60-0", "@wisdom-map/arcgismap": "^1.0.75-0",
"@wisdom-map/util": "^1.0.27-0", "@wisdom-map/util": "^1.0.27-0",
"@wisdom-utils/components": "0.0.14", "@wisdom-utils/components": "0.0.14",
"@wisdom-utils/runtime": "0.0.15", "@wisdom-utils/runtime": "0.0.15",
......
...@@ -3,7 +3,7 @@ import React, { ...@@ -3,7 +3,7 @@ import React, {
useEffect, useEffect,
useRef, useRef,
useState, useState,
useContext useContext,
} from 'react'; } from 'react';
import { import {
...@@ -18,43 +18,38 @@ import { ...@@ -18,43 +18,38 @@ import {
Dropdown, Dropdown,
Menu, Menu,
Tooltip, Tooltip,
ConfigProvider ConfigProvider,
} from 'antd'; } from 'antd';
// import { RouteWithSubRoutes, renderRoutes } from '../utils/routes'; // import { RouteWithSubRoutes, renderRoutes } from '../utils/routes';
// import { renderRoutes } from 'react-router-config'; // import { renderRoutes } from 'react-router-config';
import { renderRoutes } from '../utils/routes'
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import Icon from '@ant-design/icons'; import Icon, {
// LeftOutlined,
LoadingOutlined,
// MenuFoldOutlined,
DownOutlined,
} from '@ant-design/icons';
import { store } from 'microser-data'; import { store } from 'microser-data';
import classNames from 'classnames'; import classNames from 'classnames';
import { ReactSVG } from 'react-svg' import { ReactSVG } from 'react-svg';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Router, Switch } from '@wisdom-utils/runtime'; import { Router, Switch, useHistory } from '@wisdom-utils/runtime';
import keepAlive, { KeepAlive } from 'react-activation';
import RightContent from '@/components/GlobalHeader/ExtendRightContent'; import RightContent from '@/components/GlobalHeader/ExtendRightContent';
import Panel from '@/components/SliderPanel/MinPanel'; import Panel from '@/components/SliderPanel/MinPanel';
import { actionCreators } from '@/containers/App/store'; import { actionCreators } from '@/containers/App/store';
// import CreateBaseMap from '@/pages/map'; import CreateBaseMap from '@/pages/map';
import CesiumMap from '@/pages/cesiumMap' import CesiumMap from '@/pages/cesiumMap';
import keepAlive, { KeepAlive } from 'react-activation'
// import Authorized from '@/utils/Authorized'; // import Authorized from '@/utils/Authorized';
import { import { findPathByLeafId, getBaseName } from '@/utils/utils';
findPathByLeafId,
getBaseName,
} from '@/utils/utils';
import {
// LeftOutlined,
LoadingOutlined,
// MenuFoldOutlined,
DownOutlined
} from '@ant-design/icons';
// import { renderRoutes } from 'react-router-config'; // import { renderRoutes } from 'react-router-config';
import { useHistory } from '@wisdom-utils/runtime'; import { renderRoutes } from '../utils/routes';
import SecurityLayout from './SecurityLayout'; import SecurityLayout from './SecurityLayout';
import Site from './Site'; import Site from './Site';
import styles from './UserLayout.less'; import styles from './UserLayout.less';
import layoutStyles from './BasicLayout.less'; import layoutStyles from './BasicLayout.less';
import SettingDrawer from '../components/SettingDrawer' import SettingDrawer from '../components/SettingDrawer';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { layout: defaultSetting } = require('../../config/config'); const { layout: defaultSetting } = require('../../config/config');
// import Login from '../pages/user/login/login'; // import Login from '../pages/user/login/login';
...@@ -673,7 +668,8 @@ const BasicLayout = props => { ...@@ -673,7 +668,8 @@ const BasicLayout = props => {
} }
{ {
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : !window.location.pathname.startsWith('/civbase/civweb4') ? <CreateBaseMap options={{ type: 'ArcgisMap' }} /> : null
} }
<div id="micro-container" className="subapp-container"> <div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/} {/*<CreateBaseMap/>*/}
...@@ -692,7 +688,7 @@ const BasicLayout = props => { ...@@ -692,7 +688,7 @@ const BasicLayout = props => {
} }
{ {
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : !window.location.pathname.startsWith('/civbase/civweb4') ? <CreateBaseMap options={{ type: 'ArcgisMap' }} /> : null
} }
<div id="micro-container" className="subapp-container"> <div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/} {/*<CreateBaseMap/>*/}
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
import 'kit_logger'; import 'kit_logger';
import _ from 'lodash'; import _ from 'lodash';
import { import {
addGlobalUncaughtErrorHandler, addGlobalUncaughtErrorHandler,
initGlobalState, initGlobalState,
registerMicroApps, registerMicroApps,
runAfterFirstMounted, runAfterFirstMounted,
setDefaultMountApp, setDefaultMountApp,
start, start,
} from 'qiankun'; } from 'qiankun';
import { store as microStore } from 'microser-data'; import { store as microStore } from 'microser-data';
...@@ -21,30 +21,30 @@ import store from './stores'; ...@@ -21,30 +21,30 @@ import store from './stores';
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
const Logger = logger('micro'); const Logger = logger('micro');
const MICRO_STATUS = { const MICRO_STATUS = {
NOT_LOADED: 'NOT_LOADED', NOT_LOADED: 'NOT_LOADED',
LOADING_SOURCE_CODE: 'LOADING_SOURCE_CODE', LOADING_SOURCE_CODE: 'LOADING_SOURCE_CODE',
NOT_BOOTSTRAPPED: 'NOT_BOOTSTRAPPED', NOT_BOOTSTRAPPED: 'NOT_BOOTSTRAPPED',
BOOTSTRAPPING: 'BOOTSTRAPPING', BOOTSTRAPPING: 'BOOTSTRAPPING',
NOT_MOUNTED: 'NOT_MOUNTED', NOT_MOUNTED: 'NOT_MOUNTED',
MOUNTING: 'MOUNTING', MOUNTING: 'MOUNTING',
MOUNTED: 'MOUNTED', MOUNTED: 'MOUNTED',
UPDATING: 'UPDATING', UPDATING: 'UPDATING',
UNMOUNTING: 'UNMOUNTING', UNMOUNTING: 'UNMOUNTING',
UNLOADING: 'UNLOADING', UNLOADING: 'UNLOADING',
SKIP_BECAUSE_BROKEN: 'SKIP_BECAUSE_BROKEN', SKIP_BECAUSE_BROKEN: 'SKIP_BECAUSE_BROKEN',
LOAD_ERROR: 'LOAD_ERROR', LOAD_ERROR: 'LOAD_ERROR',
}; };
export const initMicroApps = () => { export const initMicroApps = () => {
/* eslint-disable */ /* eslint-disable */
const config = window.globalConfig || {}; const config = window.globalConfig || {};
//createStoreage.get('globalConfig'); //createStoreage.get('globalConfig');
const application = config && config.products || []; const application = config && config.products || [];
let products = []; let products = [];
application && Array.isArray(application) && application.length > 0 && application.map(item => { application && Array.isArray(application) && application.length > 0 && application.map(item => {
if(item.PackageName === 'report') { if (item.PackageName === 'report') {
products.push({ products.push({
name: item.PackageName, name: item.PackageName,
entry: item.RouteUrl, entry: item.RouteUrl,
...@@ -67,13 +67,13 @@ export const initMicroApps = () => { ...@@ -67,13 +67,13 @@ export const initMicroApps = () => {
} }
}) })
} }
}); });
const entrys = const entrys =
process.env.NODE_ENV !== 'production' ? process.env.NODE_ENV !== 'production' ?
micorConfig.dev : micorConfig.dev :
products; products;
registerMicroApps( registerMicroApps(
entrys.map(item => { entrys.map(item => {
item.loader = loader; item.loader = loader;
...@@ -83,40 +83,40 @@ export const initMicroApps = () => { ...@@ -83,40 +83,40 @@ export const initMicroApps = () => {
// eslint- // eslint-
// disable-next-line no-undef // disable-next-line no-undef
globalConfig: /civweb4/.test(item.name) ? Object.assign({}, config, { globalConfig: /civweb4/.test(item.name) ? Object.assign({}, config, {
homepage: config.homepage ? config.homepage.replace(/civweb\//, ''): config.homepage homepage: config.homepage ? config.homepage.replace(/civweb\//, '') : config.homepage
}): config, }) : config,
//createStoreage.get('globalConfig'), //createStoreage.get('globalConfig'),
XMLHttpRequest: window.XMLHttpRequest, XMLHttpRequest: window.XMLHttpRequest,
}; };
return item; return item;
}), { }), {
beforeLoad: [ beforeLoad: [
app => { app => {
store.dispatch(actionCreators.updateMicroMounted(true)); store.dispatch(actionCreators.updateMicroMounted(true));
Logger.info('[LifeCycle] before load %c%s'); Logger.info('[LifeCycle] before load %c%s');
}, },
], ],
beforeMount: [ beforeMount: [
app => { app => {
Logger.info(`[LifeCycle] before mount %c%s ${app.name}`); Logger.info(`[LifeCycle] before mount %c%s ${app.name}`);
}, },
], ],
afterMount: [ afterMount: [
app => { app => {
store.dispatch(actionCreators.updateMicroMounted(false)); store.dispatch(actionCreators.updateMicroMounted(false));
Logger.info(`[LifeCycle] after mount %c%s ${app.name}`); Logger.info(`[LifeCycle] after mount %c%s ${app.name}`);
}, },
], ],
beforeUnmount: [ beforeUnmount: [
app => { app => {
window.share.event.removeAllListeners('changeRoute'); window.share.event.removeAllListeners('changeRoute');
Logger.info(`[LifeCycle] after unmount %c%s ${app.name}`); Logger.info(`[LifeCycle] after unmount %c%s ${app.name}`);
window.globalConfig = {} window.globalConfig = {}
createStoreage.remove(`__PANDA_STORE__${location.hostname}`) createStoreage.remove(`__PANDA_STORE__${location.hostname}`)
}, },
], ],
afterUnmount: [app => {}], afterUnmount: [app => { }],
}, },
); );
const globalStore = store.getState().toJS(); const globalStore = store.getState().toJS();
const { setGlobalState } = initGlobalState({ const { setGlobalState } = initGlobalState({
...@@ -126,14 +126,14 @@ export const initMicroApps = () => { ...@@ -126,14 +126,14 @@ export const initMicroApps = () => {
global: globalStore.global global: globalStore.global
}); });
const globalConfig = window.globalConfig; const globalConfig = window.globalConfig;
globalConfig.homepage = globalConfig.homepage && /civweb4/.test(globalConfig.homepage) ? config.homepage.replace(/civweb4\//, ''): globalConfig.homepage; globalConfig.homepage = globalConfig.homepage && /civweb4/.test(globalConfig.homepage) ? config.homepage.replace(/civweb4\//, '') : globalConfig.homepage;
console.log(globalConfig); console.log(globalConfig);
setGlobalState({ setGlobalState({
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
globalConfig: globalConfig, globalConfig: globalConfig,
//createStoreage.get('globalConfig'), //createStoreage.get('globalConfig'),
}); });
microStore.set("props:globalConfig", { microStore.set("props:globalConfig", {
globalConfig: globalConfig, globalConfig: globalConfig,
global: globalStore.global global: globalStore.global
...@@ -215,20 +215,20 @@ export const initMicroApps = () => { ...@@ -215,20 +215,20 @@ export const initMicroApps = () => {
export const defaultApp = () => { export const defaultApp = () => {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
const config = window.globalConfig; const config = window.globalConfig;
if (config && config.token) { if (config && config.token) {
// const basePath =config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) ?'civweb4' :'civweb4'; // const basePath =config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) ?'civweb4' :'civweb4';
// if(config && config.home) { // if(config && config.home) {
// setDefaultMountApp(`/civbase/${config.home.path.replace(/^\//, '')}`); // setDefaultMountApp(`/civbase/${config.home.path.replace(/^\//, '')}`);
// } else { // } else {
// const homepage = _.isNull(config.homepage) ? '/index': '/' + config.homepage; // const homepage = _.isNull(config.homepage) ? '/index': '/' + config.homepage;
// setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/${basePath}${homepage}`); // setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/${basePath}${homepage}`);
// createStoreage.set('init_web4', true) // createStoreage.set('init_web4', true)
// } // }
// let homepage = config.homepage.replace('civweb4/', ''); // let homepage = config.homepage.replace('civweb4/', '');
const url = !config.home ? `/civbase/civweb4/${config.homepage.replace(/^\//, '')}`: `/civbase/${config.homepage.replace(/^\//, '')}`; const url = !config.home ? `/civbase/civweb4/${config.homepage.replace(/^\//, '')}` : `/civbase/${config.homepage.replace(/^\//, '')}`;
setDefaultMountApp(url); setDefaultMountApp(url);
// if(config.homepage.indexOf('civweb4') > -1) createStoreage.set('init_web4', true); // if(config.homepage.indexOf('civweb4') > -1) createStoreage.set('init_web4', true);
} }
...@@ -243,19 +243,19 @@ export const defaultApp = () => { ...@@ -243,19 +243,19 @@ export const defaultApp = () => {
*/ */
window.app = { window.app = {
modules: {}, modules: {},
require: function(request, method) { require: function (request, method) {
if(request !== '.' && this.modules[request]) { if (request !== '.' && this.modules[request]) {
console.log('method', method); console.log('method', method);
return _.isFunction(this.modules[request]) ? this.modules[request](): _.isFunction(this.modules[request][method]) && this.modules[request][method](); return _.isFunction(this.modules[request]) ? this.modules[request]() : _.isFunction(this.modules[request][method]) && this.modules[request][method]();
} }
if(request === '.') { if (request === '.') {
return return
} }
return _.isFunction(this.modules[request]) && this.modules[request](); return _.isFunction(this.modules[request]) && this.modules[request]();
}, },
define: function(name, context, index) { define: function (name, context, index) {
let keys = context.keys(); let keys = context.keys();
for (let key of keys) { for (let key of keys) {
let parts = name.indexOf('@') > -1 ? [name, ...(key.slice(1).split('/'))] : (name + key.slice(1)).split('/'); let parts = name.indexOf('@') > -1 ? [name, ...(key.slice(1).split('/'))] : (name + key.slice(1)).split('/');
...@@ -274,7 +274,7 @@ window.app = { ...@@ -274,7 +274,7 @@ window.app = {
this.modules[name] = this.modules[name][index]; this.modules[name] = this.modules[name][index];
} }
}, },
init: function(namespace, reducers) { init: function (namespace, reducers) {
[namespace] = reducers; [namespace] = reducers;
} }
}; };
...@@ -307,7 +307,7 @@ window.app.define('@wisdom-utils/components', require.context('../node_modules/@ ...@@ -307,7 +307,7 @@ window.app.define('@wisdom-utils/components', require.context('../node_modules/@
/** /**
* arcgismap * arcgismap
*/ */
// window.app.define('@wisdom-map/arcgismap', require.context('../node_modules/@wisdom-map/arcgismap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js'); window.app.define('@wisdom-map/arcgismap', require.context('../node_modules/@wisdom-map/arcgismap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// // window.app.define('@wisdom-map/arcgismap/lib/widgets', require.context('../node_modules/@wisdom-map/arcgismap/lib/widgets', true, /^.\/(lib\/)?[^\/]+\.js$/)); // // window.app.define('@wisdom-map/arcgismap/lib/widgets', require.context('../node_modules/@wisdom-map/arcgismap/lib/widgets', true, /^.\/(lib\/)?[^\/]+\.js$/));
// window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/)); // window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/));
// window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/chunks', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/chunks', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/)); // window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/chunks', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/chunks', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/));
......
...@@ -4,7 +4,7 @@ import { connect } from 'react-redux'; ...@@ -4,7 +4,7 @@ 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`;
...@@ -22,14 +22,14 @@ class Map extends React.PureComponent { ...@@ -22,14 +22,14 @@ 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() {
...@@ -80,7 +80,7 @@ class Map extends React.PureComponent { ...@@ -80,7 +80,7 @@ class Map extends React.PureComponent {
} }
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