Commit 7e3f6568 authored by 崔佳豪's avatar 崔佳豪

Merge branch 'master' into dev-cloud

parents 1117cf6d de92d486
...@@ -59,8 +59,8 @@ push: ...@@ -59,8 +59,8 @@ push:
- 'git clean -fd' - 'git clean -fd'
- 'git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2021.git"' - 'git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2021.git"'
- 'git pull origin map' - 'git pull origin map'
- 'git rm -rf "${TARGET_REPO}/civbase"' #- 'git rm -rf "${TARGET_REPO}/civbase"'
- 'git commit -m "chore: clear folder"' #- 'git commit -m "chore: clear folder"'
#- 'git push origin map' #- 'git push origin map'
- 'robocopy "${CI_PROJECT_DIR}/../CivWebPublish2021/civbase" "${TARGET_REPO}/civbase" /S ; - 'robocopy "${CI_PROJECT_DIR}/../CivWebPublish2021/civbase" "${TARGET_REPO}/civbase" /S ;
IF ((${LASTEXITCODE} -le 8)) {cmd /c "exit /b 0"}' IF ((${LASTEXITCODE} -le 8)) {cmd /c "exit /b 0"}'
......
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: {},
...@@ -33,6 +38,7 @@ module.exports = { ...@@ -33,6 +38,7 @@ module.exports = {
'@wisdom-map/arcgismap', '@wisdom-map/arcgismap',
'@wisdom-map/arcgismap/lib/arcgisapi', '@wisdom-map/arcgismap/lib/arcgisapi',
'swagger-ui-react', 'swagger-ui-react',
'Cesium'
], ],
}, },
proxy: proxy[REACT_APP_ENV || 'dev'], proxy: proxy[REACT_APP_ENV || 'dev'],
...@@ -81,5 +87,30 @@ module.exports = { ...@@ -81,5 +87,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.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"analyze": "cross-env ANALYZE=1 npm run build", "analyze": "cross-env ANALYZE=1 npm run build",
"npmcheckversion": "node ./internals/scripts/npmcheckversion.js", "npmcheckversion": "node ./internals/scripts/npmcheckversion.js",
"preinstall": "npm run npmcheckversion", "preinstall": "npm run npmcheckversion",
"build": "cross-env NODE_ENV=production node 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 server --port=$port",
...@@ -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');
...@@ -180,13 +188,12 @@ export function logout(data) { ...@@ -180,13 +188,12 @@ export function logout(data) {
window.globalConfig.token = null; window.globalConfig.token = null;
window.globalConfig.access_token = null; window.globalConfig.access_token = null;
window.globalConfig.apiGatewayDomain = window.location.origin; window.globalConfig.apiGatewayDomain = window.location.origin;
window.globalConfig.baseURI = window.location.origin; window.globalConfig.baseURI = window.location.origin;
window.globalConfig.hasGateWay = false; window.globalConfig.hasGateWay = false;
window.globalConfig.userInfo = null; window.globalConfig.userInfo = null;
// 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,43 +107,50 @@ const appReducer = (state = initialState, action) => { ...@@ -103,43 +107,50 @@ 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 &&
modulePkg[item.PackageName] = item; window.globalConfig.products &&
}); Array.isArray(window.globalConfig.products) &&
config.widgets = transformWidgets(config.widgets); window.globalConfig.products.map(item => {
modulePkg[item.PackageName] = item;
});
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
if(parent) { ? home.parent.parent
currentMenuIndex = generMenu.findIndex(item => item.name === parent.label); : home.level >= 3
? home.parent.parent.parent
: home.parent;
if (parent) {
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
// eslint-disable-next-line no-case-declarations
window.globalConfig.home = home;
// eslint-disable-next-line no-case-declarations
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;
...@@ -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,7 +669,11 @@ const BasicLayout = props => { ...@@ -670,7 +669,11 @@ const BasicLayout = props => {
renderRoutes(props.route.routes) renderRoutes(props.route.routes)
} }
<div id="micro-container" className="subapp-container"> {
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/} {/*<CreateBaseMap/>*/}
{props.children} {props.children}
</div> </div>
...@@ -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 _ from 'lodash';
import { getBaseName } from '../utils/utils'; import { getBaseName } from '../utils/utils';
import _ from 'lodash';
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)
...@@ -3,7 +3,7 @@ import Iframe from 'react-iframe'; ...@@ -3,7 +3,7 @@ import Iframe from 'react-iframe';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
const ShareFrame = props => { const ShareFrame = props => {
const state = props.location.state || {}; const state = props.location.state || {};
debugger
if (!state.linkUrl) { if (!state.linkUrl) {
return null; return null;
} }
...@@ -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={`${state.linkUrl}/report/manageView/638220756398120960?token=${token}&loginName=${userInfo.loginName}`}
width="100%" width="100%"
height="100%" height="100%"
id="myId" id="myId"
......
...@@ -255,6 +255,7 @@ class Login { ...@@ -255,6 +255,7 @@ class Login {
// this.events.removeAllListeners('toggleIndustry') // this.events.removeAllListeners('toggleIndustry')
// window.share.event = this.events; // window.share.event = this.events;
if ( if (
self.globalConfig.userInfo &&
self.globalConfig.userInfo.site && self.globalConfig.userInfo.site &&
self.globalConfig.userInfo.site.length > 0 self.globalConfig.userInfo.site.length > 0
) { ) {
...@@ -333,7 +334,8 @@ class Login { ...@@ -333,7 +334,8 @@ class Login {
let MAX_BOTTOM = 0; let MAX_BOTTOM = 0;
let isScale = false; let isScale = false;
let widgetIndex = -1; let widgetIndex = -1;
this.globalConfig.uiwidgets.map((item, index) => { this.globalConfig.uiwidgets &&
this.globalConfig.uiwidgets.map((item, index) => {
// eslint-disable-next-line radix // eslint-disable-next-line radix
if (parseInt(item.bottom) > MAX_BOTTOM) { if (parseInt(item.bottom) > MAX_BOTTOM) {
// eslint-disable-next-line radix // eslint-disable-next-line radix
...@@ -348,7 +350,7 @@ class Login { ...@@ -348,7 +350,7 @@ class Login {
widgetIndex = index; widgetIndex = index;
}); });
const { layers } = this.globalConfig.mapsettings; const { layers = [] } = this.globalConfig.mapsettings || {};
if (layers.length === 0) { if (layers.length === 0) {
widgetIndex !== -1 && this.globalConfig.uiwidgets.splice(widgetIndex, 1); widgetIndex !== -1 && this.globalConfig.uiwidgets.splice(widgetIndex, 1);
return Promise.resolve({}); return Promise.resolve({});
......
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