Commit aa701b02 authored by lihonglin's avatar lihonglin

feat: arcgis支持

parents 3f7ef70e 7b889aef
Pipeline #46477 passed with stages
in 45 seconds
...@@ -4,9 +4,9 @@ const defaultSetting = require('./defaultSetting'); ...@@ -4,9 +4,9 @@ const defaultSetting = require('./defaultSetting');
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;
// eslint-disable-next-line import/order // eslint-disable-next-line import/order
const { REACT_APP_ENV } = process.env;
const path = require('path'); const path = require('path');
const CESIUM_BASE_URL = `/${pkgName}`; const CESIUM_BASE_URL = `/${pkgName}`;
const { REACT_APP_ENV } = process.env;
module.exports = { module.exports = {
// mfsu: {}, // mfsu: {},
webpack5: {}, webpack5: {},
...@@ -87,6 +87,30 @@ module.exports = { ...@@ -87,6 +87,30 @@ module.exports = {
}, },
javascriptEnabled: true, javascriptEnabled: true,
}, },
copy: [
{
from: path.join(pkgName, cesiumBuild, './Workers'),
to: 'Workers',
},
{
from: path.join(pkgName, cesiumBuild, 'Assets'),
to: 'Assets',
},
{
from: path.join(pkgName, cesiumBuild, 'Widgets'),
to: 'Widgets',
},
{
from: path.join(pkgName, cesiumBuild, 'ThirdParty'),
to: 'ThirdParty',
},
],
define: {
CESIUM_BASE_URL: JSON.stringify(CESIUM_BASE_URL).replace(/\"/g, ''),
},
alias: {
cesium: path.resolve(__dirname, cesiumBuild),
},
workerLoader: {}, workerLoader: {},
copy: [ copy: [
{ {
......
...@@ -27,8 +27,8 @@ export default { ...@@ -27,8 +27,8 @@ 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', name: 'civ_webgis',
......
/* 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 = 'http://192.168.10.150:8686'; // 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,
......
...@@ -20,25 +20,18 @@ module.exports = opts => { ...@@ -20,25 +20,18 @@ module.exports = opts => {
const preset = { const preset = {
presets: [ presets: [
opts.env && [ opts.env && [
'@babel/preset-env', require('@umijs/deps/compiled/babel/preset-env'),
{ {
...mergeConfig(defaultEnvConfig,{}), ...mergeConfig(defaultEnvConfig,{}),
modules: false, modules: false,
...opts.env ...opts.env
}, },
], ],
// opts.react && ['@babel/preset-react'],
// opts.typescript && [
// '@babel/preset-typescript',
// {
// allowNamespaces: true,
// },
// ],
].filter(Boolean), ].filter(Boolean),
plugins: [ plugins: [
['@babel/plugin-proposal-optional-chaining', { loose: false }], ['@babel/plugin-proposal-optional-chaining', { loose: false }],
['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }], ['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }],
'@babel/plugin-syntax-top-level-await', require('@umijs/deps/compiled/babel/plugin-syntax-top-level-await').default,
['@babel/plugin-transform-destructuring', { loose: false }], ['@babel/plugin-transform-destructuring', { loose: false }],
// opts.typescript && ['babel-plugin-transform-typescript-metadata'], // opts.typescript && ['babel-plugin-transform-typescript-metadata'],
['@babel/plugin-proposal-decorators', { legacy: true }], ['@babel/plugin-proposal-decorators', { legacy: true }],
...@@ -58,7 +51,7 @@ module.exports = opts => { ...@@ -58,7 +51,7 @@ module.exports = opts => {
'@babel/plugin-syntax-dynamic-import', '@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-react-jsx', '@babel/plugin-transform-react-jsx',
opts.transformRuntime && [ opts.transformRuntime && [
'@babel/plugin-transform-runtime', require('@umijs/deps/compiled/babel/plugin-transform-runtime').default,
{ {
version: require('@babel/runtime/package.json').version, version: require('@babel/runtime/package.json').version,
absoluteRuntime: dirname( absoluteRuntime: dirname(
...@@ -98,11 +91,23 @@ module.exports = opts => { ...@@ -98,11 +91,23 @@ module.exports = opts => {
'@umijs/babel-plugin-import-to-await-require', '@umijs/babel-plugin-import-to-await-require',
opts.importToAwaitRequire, opts.importToAwaitRequire,
], ],
'react-activation/babel' 'react-activation/babel',
// opts.lockCoreJS3 && [ opts.lockCoreJS3 && [
// '@umijs/babel-plugin-lock-core-js-3', '@umijs/babel-plugin-lock-core-js-3',
// opts.lockCoreJS3, opts.lockCoreJS3,
// ], ],
opts.noAnonymousDefaultExport && [
require.resolve('@umijs/babel-plugin-no-anonymous-default-export'),
],
[
require('@umijs/deps/compiled/babel/plugin-proposal-record-and-tuple')
.default,
{
syntaxType: 'hash',
polyfillModuleName: '@umijs/deps/reexported/record-tuple-polyfill',
importPolyfill: true,
},
],
].filter(Boolean), ].filter(Boolean),
env: { env: {
production: { production: {
......
...@@ -215,7 +215,7 @@ module.exports = options => { ...@@ -215,7 +215,7 @@ module.exports = options => {
chainConfig.module chainConfig.module
.rule('js') .rule('js')
.test(/\.(js|mjs|jsx|ts|tsx)$/) .test(/\.(js|mjs|jsx|ts|tsx)$/)
.include.add([cwd, ...(process.env.APP_ROOT ? [process.cwd()] : [])]) .include.add([/node_modules\/@esri/, cwd, ...(process.env.APP_ROOT ? [process.cwd()] : [])])
.end() .end()
.exclude.add(/node_modules/) .exclude.add(/node_modules/)
.add(/\.mfsu/) .add(/\.mfsu/)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"build": "cross-env NODE_ENV=production node --max_old_space_size=4096 internals/webpack/build.js", "build": "cross-env NODE_ENV=production node --max_old_space_size=4096 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",
...@@ -93,13 +93,16 @@ ...@@ -93,13 +93,16 @@
"@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",
"@ant-design/pro-form": "^1.42.1",
"@ant-design/pro-layout": "^6.24.1", "@ant-design/pro-layout": "^6.24.1",
"@ant-design/pro-skeleton": "^1.0.0-beta.2", "@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@ant-design/pro-table": "^2.5.3", "@ant-design/pro-table": "^2.5.3",
"@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",
"@wisdom-cesium/cesium": "^1.0.64", "@esri/arcgis-html-sanitizer": "2.9.1",
"@esri/calcite-colors": "6.0.3",
"@wisdom-cesium/cesium": "^1.0.75",
"@wisdom-components/basictable": "^1.5.16", "@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1", "@wisdom-components/empty": "^1.4.1",
"@wisdom-map/Amap": "^1.0.49-3", "@wisdom-map/Amap": "^1.0.49-3",
...@@ -136,6 +139,7 @@ ...@@ -136,6 +139,7 @@
"qrcode.react": "^1.0.0", "qrcode.react": "^1.0.0",
"rc-cascader": "^2.3.2", "rc-cascader": "^2.3.2",
"react": "16.12.0", "react": "16.12.0",
"react-activation": "^0.9.9",
"react-dom": "16.12.0", "react-dom": "16.12.0",
"react-draggable": "^4.4.3", "react-draggable": "^4.4.3",
"react-helmet": "6.0.0-beta", "react-helmet": "6.0.0-beta",
...@@ -291,7 +295,7 @@ ...@@ -291,7 +295,7 @@
"traverse": "^0.6.6", "traverse": "^0.6.6",
"umi-webpack-bundle-analyzer": "3.6.0", "umi-webpack-bundle-analyzer": "3.6.0",
"url-loader": "1.1.2", "url-loader": "1.1.2",
"webpack": "^5.65.0", "webpack": "^5.70.0",
"webpack-chain": "6.5.1", "webpack-chain": "6.5.1",
"webpack-cli": "4.2.0", "webpack-cli": "4.2.0",
"webpack-dev-middleware": "5.3.0", "webpack-dev-middleware": "5.3.0",
......
// eslint-disable-next-line import/extensions
// import arcgisConfig from '@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/config';
import React from 'react';
// eslint-disable-next-line import/extensions
import { ArcGISMap as MapComponent } from '@wisdom-map/arcgismap';
// import MapComponent from './lib/index.js';
// eslint-disable-next-line react/prefer-stateless-function
export default class ArcGISMap extends React.Component {
render() {
// arcgisConfig.assetsPath = `${window.location.origin
// }/${pkg.name.toLocaleLowerCase()}/assets`;
return <MapComponent {...this.props} />;
}
}
@import '~antd/es/style/themes/default.less';
.view {
position: absolute;
top:0;
right: 0;
bottom: 0;
left: 0;
.loadingBox{
position: absolute;
left: calc(50% - 40px);
top: calc(50% - 23px);
color: @text-color;
}
.mapBox {
width: 100%;
height: 100%;
}
}
...@@ -60,7 +60,8 @@ export const initGlobalConfig = () => { ...@@ -60,7 +60,8 @@ export const initGlobalConfig = () => {
} }
}); });
// eslint-disable-next-line react-hooks/rules-of-hooks // eslint-disable-next-line react-hooks/rules-of-hooks
const client = params.getParams('client') || Cookies.get('city') let client = params.getParams('client') || Cookies.get('city')
client = client && client !== 'undefined' ? client : 'city';
appService appService
.queryConfig({ .queryConfig({
client: client || 'city', client: client || 'city',
...@@ -72,7 +73,7 @@ export const initGlobalConfig = () => { ...@@ -72,7 +73,7 @@ export const initGlobalConfig = () => {
store.dispatch(actionCreators.getConfig(Object.assign({}))); store.dispatch(actionCreators.getConfig(Object.assign({})));
const data = res; const data = res;
if (!data.client) { if (!data.client) {
data.client = params.getParams('client') || Cookies.get('city'); data.client = client;
} }
// Cookies.set('city', data.client); // Cookies.set('city', data.client);
store.dispatch( store.dispatch(
......
This diff is collapsed.
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
import 'kit_logger'; import 'kit_logger';
import _ from 'lodash'; import _ from 'lodash';
import { import {
addGlobalUncaughtErrorHandler, addGlobalUncaughtErrorHandler,
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 actions from './actions'; ...@@ -21,30 +21,30 @@ import actions from './actions';
// 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,50 +83,50 @@ export const initMicroApps = () => { ...@@ -83,50 +83,50 @@ 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 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;
actions.setGlobalState({ actions.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
...@@ -208,20 +208,20 @@ export const initMicroApps = () => { ...@@ -208,20 +208,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(/^\//, '').replace(/^civweb4\//, '')}`: `/civbase/${config.homepage.replace(/^\//, '')}`; const url = !config.home ? `/civbase/civweb4/${config.homepage.replace(/^\//, '').replace(/^civweb4\//, '')}` : `/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);
} }
...@@ -236,19 +236,19 @@ export const defaultApp = () => { ...@@ -236,19 +236,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('/');
...@@ -267,7 +267,7 @@ window.app = { ...@@ -267,7 +267,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;
} }
}; };
...@@ -487,6 +487,7 @@ window.app.define('@wisdom-utils/components', require.context('../node_modules/@ ...@@ -487,6 +487,7 @@ window.app.define('@wisdom-utils/components', require.context('../node_modules/@
window.app.define('@ant-design/pro-form', require.context('../node_modules/@ant-design/pro-form/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('classnames', require.context('classnames', true, /^.\/index\.js$/), 'index.js'); window.app.define('classnames', require.context('classnames', true, /^.\/index\.js$/), 'index.js');
window.app.define('@ant-design/icons', require.context('../node_modules/@ant-design/icons/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js'); window.app.define('@ant-design/icons', require.context('../node_modules/@ant-design/icons/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
......
...@@ -15,7 +15,6 @@ const cesiumMap = props => { ...@@ -15,7 +15,6 @@ const cesiumMap = props => {
const pdView = new PdRender({ const pdView = new PdRender({
el: ref.current, el: ref.current,
widgets, widgets,
delayWidgetRender : true,
...schemeData ...schemeData
}) })
storeRef.current = pdView storeRef.current = pdView
......
/* eslint-disable */
import React from 'react'; import React from 'react';
import { Spin } from 'antd';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store'; import { actionCreators } from '@/containers/App/store';
import _ from 'lodash'; import _ from 'lodash';
...@@ -12,13 +13,7 @@ import { ArcGISMap } from '@wisdom-map/arcgismap'; ...@@ -12,13 +13,7 @@ import { ArcGISMap } from '@wisdom-map/arcgismap';
class Map extends React.PureComponent { class Map extends React.PureComponent {
constructor(props) { constructor(props) {
super(props); super(props);
this.options = _.merge({}, props.options); this.mapManganerRef = React.createRef();
this.state = {
type: props.options.type,
loading: true,
options: this.transformMapsetting(window.globalConfig.mapsettings),
widgets: window.globalConfig.uiwidgets,
}
} }
transformMapsetting(mapsettings) { transformMapsetting(mapsettings) {
...@@ -109,6 +104,7 @@ class Map extends React.PureComponent { ...@@ -109,6 +104,7 @@ class Map extends React.PureComponent {
) )
} }
} }
const mapStateToProps = state => ({}); const mapStateToProps = state => ({});
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = dispatch => ({
...@@ -120,4 +116,4 @@ const mapDispatchToProps = dispatch => ({ ...@@ -120,4 +116,4 @@ const mapDispatchToProps = dispatch => ({
export default connect( export default connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps, mapDispatchToProps,
)(Map); )(CreateMap);
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