Commit 125efa35 authored by 邓晓峰's avatar 邓晓峰

feat: 集成三维GIS

parent 068dbe86
This diff was suppressed by a .gitattributes entry.
const slash = require('slash2'); const slash = require('slash2');
const proxy = require('./proxy'); const proxy = require('./proxy');
const defaultSetting = require('./defaultSetting'); const defaultSetting = require('./defaultSetting');
const cesiumBuild = '../node_modules/cesium/Build/Cesium';
const pkgName = require('../package.json').name;
// eslint-disable-next-line import/order
const path = require('path');
const CESIUM_BASE_URL = `/${pkgName}`;
const { REACT_APP_ENV } = process.env; const { REACT_APP_ENV } = process.env;
module.exports = { module.exports = {
// mfsu: {}, // mfsu: {},
...@@ -81,5 +86,30 @@ module.exports = { ...@@ -81,5 +86,30 @@ module.exports = {
javascriptEnabled: true, javascriptEnabled: true,
}, },
workerLoader: {}, workerLoader: {},
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),
},
// esbuild: {} // esbuild: {}
}; };
...@@ -16,10 +16,10 @@ export default { ...@@ -16,10 +16,10 @@ export default {
// activeRule: '/civbase/civ_water', // activeRule: '/civbase/civ_water',
// }, // },
{ {
name: 'civ_pandawork', name: 'civ_configuration',
entry: `//${window.location.hostname}:8081/civ_pandawork`, entry: `//${window.location.hostname}:8080/civ_configuration`,
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/civ_pandawork', activeRule: '/civbase/civ_configuration',
}, },
{ {
name: 'report', name: 'report',
...@@ -48,6 +48,12 @@ export default { ...@@ -48,6 +48,12 @@ export default {
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/middleground', activeRule: '/civbase/middleground',
}, },
{
name: 'civ_3d',
entry: `//${window.location.hostname}:12000/civ_3d`,
container: '#micro-container',
activeRule: '/civbase/civ_3d',
},
], ],
prod: [ prod: [
{ {
......
/* 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 = 'http://192.168.12.101:8123';
module.exports = { module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './', assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
......
...@@ -98,6 +98,7 @@ module.exports = opts => { ...@@ -98,6 +98,7 @@ module.exports = opts => {
'@umijs/babel-plugin-import-to-await-require', '@umijs/babel-plugin-import-to-await-require',
opts.importToAwaitRequire, opts.importToAwaitRequire,
], ],
'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,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
"@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",
"@wisdom-components/empty": "^1.4.1", "@wisdom-components/empty": "^1.4.1",
"@wisdom-map/arcgismap": "^1.0.60-0", "@wisdom-map/arcgismap": "^1.0.60-0",
"@wisdom-map/util": "^1.0.27-0", "@wisdom-map/util": "^1.0.27-0",
...@@ -256,6 +257,7 @@ ...@@ -256,6 +257,7 @@
"prettier": "1.17.0", "prettier": "1.17.0",
"querystring-browser": "^1.0.4", "querystring-browser": "^1.0.4",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"react-activation": "^0.9.9",
"react-app-polyfill": "0.2.2", "react-app-polyfill": "0.2.2",
"react-error-overlay": "6.0.8", "react-error-overlay": "6.0.8",
"react-inlinesvg": "^2.3.0", "react-inlinesvg": "^2.3.0",
...@@ -293,7 +295,6 @@ ...@@ -293,7 +295,6 @@
"webpack-theme-color-replacer": "^1.3.15", "webpack-theme-color-replacer": "^1.3.15",
"webpackbar": "5.0.0-3", "webpackbar": "5.0.0-3",
"whatwg-fetch": "^3.0.0", "whatwg-fetch": "^3.0.0",
"yorkie": "^2.0.0", "yorkie": "^2.0.0"
"zlib": "^1.0.5"
} }
} }
...@@ -3,11 +3,11 @@ import * as constants from '../../constants'; ...@@ -3,11 +3,11 @@ import * as constants from '../../constants';
/** /**
* 兼容老接口 * 兼容老接口
*/ */
const transformGateWay = (url) => { const transformGateWay = url => {
if(!/^(cityinterface|CityInterface|CityServer)/) { if (!/^(cityinterface|CityInterface|CityServer)/) {
return url.replace(/GeteWay/, '') return url.replace(/GeteWay/, '');
} }
} };
export const API = { export const API = {
AUTHORIZATION_TOKEN: '/Identity/AuthorizationToken', AUTHORIZATION_TOKEN: '/Identity/AuthorizationToken',
...@@ -28,7 +28,8 @@ export const API = { ...@@ -28,7 +28,8 @@ export const API = {
process.env.NODE_ENV !== 'production' process.env.NODE_ENV !== 'production'
? '/cityjson?ie=utf-8' ? '/cityjson?ie=utf-8'
: 'https://pv.sohu.com', : 'https://pv.sohu.com',
GET_ALL_GROUPS_INFO_FORUSER: '/CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser', GET_ALL_GROUPS_INFO_FORUSER:
'/CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser',
GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather', GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather',
SEND_MESSAGE_CODE: SEND_MESSAGE_CODE:
'CityInterface/rest/services/portal.svc/SendMessVerificationCode', 'CityInterface/rest/services/portal.svc/SendMessVerificationCode',
...@@ -87,9 +88,10 @@ const services = { ...@@ -87,9 +88,10 @@ const services = {
}, },
getUserInfo: { getUserInfo: {
url: () => { url: () =>
return window.globalConfig && window.globalConfig.hasGateWay? API.GET_GATEWAY_USER_INFO: API.GET_USER_INFO window.globalConfig && window.globalConfig.hasGateWay
}, ? API.GET_GATEWAY_USER_INFO
: API.GET_USER_INFO,
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP, type: constants.REQUEST_HTTP,
}, },
...@@ -218,30 +220,31 @@ export const searchAutoCity = keywords => { ...@@ -218,30 +220,31 @@ export const searchAutoCity = keywords => {
return jsonp(url, params, options); return jsonp(url, params, options);
}; };
export const getUserInfo = (params) => { export const getUserInfo = params => {
const url = window.globalConfig && window.globalConfig.hasGateWay? API.GET_GATEWAY_USER_INFO: API.GET_USER_INFO const url =
window.globalConfig && window.globalConfig.hasGateWay
? API.GET_GATEWAY_USER_INFO
: API.GET_USER_INFO;
return request({ return request({
url: url, url,
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
params: params, params,
// params: param.query, // params: param.query,
}); });
} };
export const getWebSiteConfig = (params) => { export const getWebSiteConfig = params => {
const url = window.globalConfig && const url =
window.globalConfig && window.globalConfig && window.globalConfig && window.globalConfig.hasGateWay
window.globalConfig.hasGateWay
? API.GET_WEB_SITE_CONFIG_GEWAY ? API.GET_WEB_SITE_CONFIG_GEWAY
: API.GET_WEB_SITE_CONFIG; : API.GET_WEB_SITE_CONFIG;
return request({ return request({
url: url, url,
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
params: params, params,
// params: param.query, // params: param.query,
}); });
} };
// 更新常用页 // 更新常用页
export const savePagePartInfo = param => export const savePagePartInfo = param =>
...@@ -252,5 +255,4 @@ export const savePagePartInfo = param => ...@@ -252,5 +255,4 @@ export const savePagePartInfo = param =>
params: param.query, params: param.query,
}); });
export default services; export default services;
...@@ -23,6 +23,7 @@ import { ...@@ -23,6 +23,7 @@ import {
SLIDER_MENU_MODE, SLIDER_MENU_MODE,
VALIDATE_AUTH, VALIDATE_AUTH,
MAP_VIEW, MAP_VIEW,
PD_VIEW,
} from './constants'; } from './constants';
export function getConfig(data) { export function getConfig(data) {
...@@ -170,6 +171,13 @@ export function updageMapView(data) { ...@@ -170,6 +171,13 @@ export function updageMapView(data) {
}; };
} }
export function updatePdCesiumView(data) {
return {
type: PD_VIEW,
data,
};
}
export function logout(data) { export function logout(data) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
createStoreage.remove('PANDA_STORE'); createStoreage.remove('PANDA_STORE');
...@@ -186,7 +194,6 @@ export function logout(data) { ...@@ -186,7 +194,6 @@ export function logout(data) {
// window.globalConfig.hasGateWay = ; // window.globalConfig.hasGateWay = ;
} }
Cookies.set('token', '', { Cookies.set('token', '', {
path: '/', path: '/',
}); });
...@@ -211,7 +218,7 @@ export function logout(data) { ...@@ -211,7 +218,7 @@ export function logout(data) {
data: { data: {
currentMenuIndex: 0, currentMenuIndex: 0,
complexConfig: {}, complexConfig: {},
globalConfig: window.globalConfig globalConfig: window.globalConfig,
}, },
}; };
} }
...@@ -20,3 +20,4 @@ export const COMPLEX_PATHNAME = 'App/COMPLEX_PATHNAME'; ...@@ -20,3 +20,4 @@ export const COMPLEX_PATHNAME = 'App/COMPLEX_PATHNAME';
export const GET_MICRO_MOUNTED_STATUS = 'App/GET_MICRO_MOUNTED_STATUS'; export const GET_MICRO_MOUNTED_STATUS = 'App/GET_MICRO_MOUNTED_STATUS';
export const LOGINOUT = 'App/LOGINOUT'; export const LOGINOUT = 'App/LOGINOUT';
export const MAP_VIEW = 'App/MAP_VIEW'; export const MAP_VIEW = 'App/MAP_VIEW';
export const PD_VIEW = 'App/PD_VIEW';
...@@ -6,8 +6,10 @@ import { store, event } from 'microser-data'; ...@@ -6,8 +6,10 @@ import { store, event } from 'microser-data';
import { Storage } from '@wisdom-utils/utils'; import { Storage } from '@wisdom-utils/utils';
import pkg from '../../../../package.json'; import pkg from '../../../../package.json';
import defaultSetting from '../../../../config/defaultSetting'; import defaultSetting from '../../../../config/defaultSetting';
import generRoutes, { generFlatRoutes } from '../../../utils/routes'; import generRoutes, {
import { transformWidgets } from '../../../utils/routes'; generFlatRoutes,
transformWidgets,
} from '../../../utils/routes';
import { import {
CLEAR_RCENT_KEYWORD, CLEAR_RCENT_KEYWORD,
COMPLEX_CONFIG, COMPLEX_CONFIG,
...@@ -31,6 +33,7 @@ import { ...@@ -31,6 +33,7 @@ import {
SLIDER_MENU_MODE, SLIDER_MENU_MODE,
VALIDATE_AUTH, VALIDATE_AUTH,
MAP_VIEW, MAP_VIEW,
PD_VIEW,
} from './constants'; } from './constants';
const proxy = require('../../../../config/proxy'); const proxy = require('../../../../config/proxy');
...@@ -70,14 +73,13 @@ export const initialState = fromJS({ ...@@ -70,14 +73,13 @@ export const initialState = fromJS({
complexConfig: {}, complexConfig: {},
complexPathName: null, complexPathName: null,
microMounted: true, microMounted: true,
mapView: null mapView: null,
}); });
/* eslint-disable default-case, no-param-reassign */ /* eslint-disable default-case, no-param-reassign */
const appReducer = (state = initialState, action) => { const appReducer = (state = initialState, action) => {
switch (action.type) { switch (action.type) {
case GET_CONFIG: case GET_CONFIG:
// eslint-disable-next-line no-debugger // eslint-disable-next-line no-debugger
// eslint-disable-next-line no-underscore-dangle // eslint-disable-next-line no-underscore-dangle
window.__INITIAL_STATE__ = Object.assign( window.__INITIAL_STATE__ = Object.assign(
...@@ -90,7 +92,9 @@ const appReducer = (state = initialState, action) => { ...@@ -90,7 +92,9 @@ const appReducer = (state = initialState, action) => {
env: process.env.NODE_ENV === 'development' ? 'daily' : 'prod', env: process.env.NODE_ENV === 'development' ? 'daily' : 'prod',
}, },
); );
window.arcgisAssetsPath = `${window.location.origin}/${pkg.name.toLocaleLowerCase()}/assets`; window.arcgisAssetsPath = `${
window.location.origin
}/${pkg.name.toLocaleLowerCase()}/assets`;
// eslint-disable-next-line global-require,no-underscore-dangle // eslint-disable-next-line global-require,no-underscore-dangle
window.__INITIAL_STATE__.mdi = 'SDI'; window.__INITIAL_STATE__.mdi = 'SDI';
window.__INITIAL_STATE__.menu = 'banner-left'; window.__INITIAL_STATE__.menu = 'banner-left';
...@@ -103,34 +107,43 @@ const appReducer = (state = initialState, action) => { ...@@ -103,34 +107,43 @@ const appReducer = (state = initialState, action) => {
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const { homepage } = window.globalConfig; const { homepage } = window.globalConfig;
const modulePkg = {}; const modulePkg = {};
window.globalConfig && window.globalConfig.products && Array.isArray(window.globalConfig.products) && window.globalConfig.products.map(item => { window.globalConfig &&
window.globalConfig.products &&
Array.isArray(window.globalConfig.products) &&
window.globalConfig.products.map(item => {
modulePkg[item.PackageName] = item; modulePkg[item.PackageName] = item;
}); });
config.widgets = transformWidgets(config.widgets); config.widgets = transformWidgets(config.widgets);
const generMenu = generRoutes(config.widgets || [], null, 0, modulePkg); const generMenu = generRoutes(config.widgets || [], null, 0, modulePkg);
let flatMenu = []; let flatMenu = [];
if(generMenu) { if (generMenu) {
flatMenu = generFlatRoutes(generMenu || [], null, null, modulePkg); flatMenu = generFlatRoutes(generMenu || [], null, null, modulePkg);
} }
const home = flatMenu.find(item => { const home = flatMenu.find(item => {
let path = decodeURI(item.path).split("|"); const path = decodeURI(item.path).split('|');
let currentPath = path[0]; let currentPath = path[0];
if(/^\//.test(currentPath)) { if (/^\//.test(currentPath)) {
currentPath = currentPath.replace(/^\//, ''); currentPath = currentPath.replace(/^\//, '');
} }
return currentPath === decodeURI(homepage) return currentPath === decodeURI(homepage);
}); });
let currentMenuIndex = 0; let currentMenuIndex = 0;
if(home) { if (home) {
const parent = home.level >= 2 ? home.parent.parent: home.level >= 3 ? home.parent.parent.parent: home.parent; const parent =
home.level >= 2
? home.parent.parent
: home.level >= 3
? home.parent.parent.parent
: home.parent;
if(parent) { if (parent) {
currentMenuIndex = generMenu.findIndex(item => item.name === parent.label); currentMenuIndex = generMenu.findIndex(
item => item.name === parent.label,
);
currentProduct.set('currentMenuIndex', currentMenuIndex); currentProduct.set('currentMenuIndex', currentMenuIndex);
store.set('updateMenuIndex', currentMenuIndex) store.set('updateMenuIndex', currentMenuIndex);
} }
} }
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
...@@ -139,8 +152,6 @@ const appReducer = (state = initialState, action) => { ...@@ -139,8 +152,6 @@ const appReducer = (state = initialState, action) => {
window.globalConfig.home = home; window.globalConfig.home = home;
Cookies.set('city', Cookies.get('city') || window.globalConfig.client); Cookies.set('city', Cookies.get('city') || window.globalConfig.client);
window.globalConfig = config; window.globalConfig = config;
return state.merge({ return state.merge({
...@@ -237,13 +248,19 @@ const appReducer = (state = initialState, action) => { ...@@ -237,13 +248,19 @@ const appReducer = (state = initialState, action) => {
return state.merge({ return state.merge({
complexConfig: action.data.complexConfig, complexConfig: action.data.complexConfig,
currentMenuIndex: action.data.currentMenuIndex, currentMenuIndex: action.data.currentMenuIndex,
globalConfig: action.data.globalConfig globalConfig: action.data.globalConfig,
}); });
case MAP_VIEW: case MAP_VIEW:
store.set('view', action.data); store.set('view', action.data);
return state.merge({ return state.merge({
mapView: action.data, mapView: action.data,
}); });
case PD_VIEW:
store.set('pdView', action.data);
return state.merge({
pdView: action.data,
});
default: default:
return state; return state;
} }
......
...@@ -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,41 +18,40 @@ import { ...@@ -18,41 +18,40 @@ 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 RightContent from '@/components/GlobalHeader/ExtendRightContent'; import RightContent from '@/components/GlobalHeader/ExtendRightContent';
import Panel from '@/components/SliderPanel/MinPanel'; import Panel from '@/components/SliderPanel/MinPanel';
import CesiumMap from '../pages/cesiumMap';
import { actionCreators } from '@/containers/App/store'; import { actionCreators } from '@/containers/App/store';
import KeepAlive from 'react-activation'
// import CreateBaseMap from '@/pages/map'; // import CreateBaseMap from '@/pages/map';
// 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';
...@@ -670,6 +669,10 @@ const BasicLayout = props => { ...@@ -670,6 +669,10 @@ const BasicLayout = props => {
renderRoutes(props.route.routes) renderRoutes(props.route.routes)
} }
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
<div id="micro-container" className="subapp-container"> <div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/} {/*<CreateBaseMap/>*/}
{props.children} {props.children}
...@@ -685,6 +688,9 @@ const BasicLayout = props => { ...@@ -685,6 +688,9 @@ const BasicLayout = props => {
{ {
renderRoutes(props.route.routes) renderRoutes(props.route.routes)
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
} }
<div id="micro-container" className="subapp-container"> <div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/} {/*<CreateBaseMap/>*/}
......
...@@ -5,8 +5,8 @@ import { Redirect } from '@wisdom-utils/runtime'; ...@@ -5,8 +5,8 @@ import { Redirect } from '@wisdom-utils/runtime';
import { PageLoading } from '@ant-design/pro-layout'; import { PageLoading } from '@ant-design/pro-layout';
import { event } from 'microser-data'; import { event } from 'microser-data';
import { stringify } from 'querystring'; import { stringify } from 'querystring';
import { getBaseName } from '../utils/utils';
import _ from 'lodash'; import _ from 'lodash';
import { getBaseName } from '../utils/utils';
class SecurityLayout extends React.Component { class SecurityLayout extends React.Component {
state = { state = {
...@@ -27,19 +27,32 @@ class SecurityLayout extends React.Component { ...@@ -27,19 +27,32 @@ class SecurityLayout extends React.Component {
// const queryString = stringify({ // const queryString = stringify({
// redirect: window.location.href, // redirect: window.location.href,
// }); // });
if(_.isNull(global.token) || (global.hasGateWay && _.isNull(global.access_token))) { if (
_.isNull(global.token) ||
(global.hasGateWay && _.isNull(global.access_token))
) {
this.props.updateCurrentIndex && this.props.updateCurrentIndex(0); this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
let client = global.client || Cookies.get('city'); let client = global.client || Cookies.get('city');
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client: 'city'; client =
client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client)
? client
: 'city';
// event.emit(?'event:initConfig'); // event.emit(?'event:initConfig');
let generateType = global.generateType; let { generateType } = global;
generateType = !_.isNull(generateType) && !_.isUndefined(generateType) && generateType !== 'undefined' ? `&generateType=${generateType}` : ''; generateType =
!_.isNull(generateType) &&
!_.isUndefined(generateType) &&
generateType !== 'undefined'
? `&generateType=${generateType}`
: '';
return ( return (
<Redirect to={`/user/login?client=${client}${generateType}`} render={() => window.location.reload()}/> <Redirect
to={`/user/login?client=${client}${generateType}`}
render={() => window.location.reload()}
/>
); );
} }
if ((!isLogin && loading) || !isReady) { if ((!isLogin && loading) || !isReady) {
return <PageLoading />; return <PageLoading />;
} }
......
import React from 'react'; import React from 'react';
import { import { Helmet, HelmetProvider } from 'react-helmet-async';
Helmet,
HelmetProvider,
} from 'react-helmet-async';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { getMenuData, getPageTitle } from '@ant-design/pro-layout';
import { renderRoutes } from '../utils/routes'; import { renderRoutes } from '../utils/routes';
import {
getMenuData,
getPageTitle,
} from '@ant-design/pro-layout';
import styles from './UserLayout.less'; import styles from './UserLayout.less';
const UserLayout = props => { const UserLayout = props => {
......
import {PdRender, parseScheme} from '@wisdom-cesium/cesium'
import { useRef , useEffect } from 'react'
import { connect } from 'react-redux'
import { actionCreators } from '@/containers/App/store';
const cesiumMap = props => {
const ref = useRef(null)
const storeRef = useRef(null)
useEffect(() => {
const mapConfig3d = props.globalConfig?.mapConfig3d
if(!(props.globalConfig.mapsettings?.areasettings && globalConfig.mapsettings?.basemaps?.length > 0)) return
if(storeRef.current) return
const {widgets} = mapConfig3d
const schemes = parseScheme.parseSchemes(mapConfig3d)
const schemeData = parseScheme.parseDatas(schemes)
const pdView = new PdRender({
el: ref.current,
widgets,
delayWidgetRender : true,
...schemeData
})
storeRef.current = pdView
props.updatePdCesiumView(pdView)
}, [props.globalConfig?.mapConfig3d ?? {}])
return (<div style={{
inset: 0,
position : "absolute"
}} ref = {ref}></div>)
}
const mapStateToProps = state => ({
globalConfig : state.getIn(['global','globalConfig'])
})
const mapDispatchToProps = dispatch => ({
updatePdCesiumView(pdView) {
dispatch(actionCreators.updatePdCesiumView(pdView))
}
})
export default connect(mapStateToProps, mapDispatchToProps)(cesiumMap)
...@@ -11,7 +11,7 @@ const ShareFrame = props => { ...@@ -11,7 +11,7 @@ const ShareFrame = props => {
return ( return (
<Iframe <Iframe
url={`${state.linkUrl}?token=${token}&loginName=${userInfo.loginName}`} url={`http://127.0.0.1:8345/report/manageView/638220756398120960?token=${token}&loginName=${userInfo.loginName}`}
width="100%" width="100%"
height="100%" height="100%"
id="myId" id="myId"
......
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