Commit 0b007ce7 authored by yzl's avatar yzl

- 修复选择器不更新的问题

parent 421ace83
Pipeline #57617 failed with stages
......@@ -4,6 +4,7 @@ import { Helmet } from 'react-helmet';
import { connect } from 'react-redux';
import { Router, Switch } from '@wisdom-utils/runtime';
import { helpers, event } from '@wisdom-utils/utils';
import defaultSetting from '@wisdom-utils/components/lib/AppLayout/layouts/defaultSettings';
// eslint-disable-next-line import/extensions
import { dyRoutes } from '../../routes/config';
......@@ -37,7 +38,6 @@ function App(props) {
(props.global && props.global.theme) || 'dark',
).routes,
)}
</Switch>
</Router>
</>
......@@ -47,6 +47,7 @@ function App(props) {
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
menu: state.getIn(['global', 'menu']),
flatMenu: state.getIn(['global', 'flatMenu']),
});
export default connect(
mapStateToProps,
......
......@@ -49,6 +49,7 @@ const { getParamsV1 } = params;
// const AMap = React.lazy(() => import('../pages/map/amap'));
const CesiumMap = React.lazy(() => import('../pages/map/cesiumMap'));
const waitTime = (time = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
......@@ -273,19 +274,21 @@ const Layout = (props) => {
event.on('visible', (ret) => {
setTimeout(() => {
setVisible(ret);
}, 2000)
})
}, 2000);
});
}, []);
useEffect(() => {
let flag = false;
if(props.location.pathname.indexOf('industry') !== -1) {
if (props.location.pathname.indexOf('industry') !== -1 || props.location.pathname.indexOf('Industry') !== -1) {
flag = true;
setCityData({});
}
setVisible(flag);
}, [])
}, [props]);
useEffect(() => {
siteAction.setGlobalConfig(props.global);
......@@ -357,6 +360,7 @@ const Layout = (props) => {
const Industries = props.global.get('userInfo.Industries');
if (Industries && Industries.length > 1) {
history.push('/Industry');
setCityData({});
setVisible(true);
}
};
......@@ -412,18 +416,18 @@ const Layout = (props) => {
return (
<>
<div style={{
position:'absolute',
top:'0',
right:'0',
bottom:'0',
left:'0',
zIndex:1000,
display: visible ? 'block' : 'none'
position: 'absolute',
top: '0',
right: '0',
bottom: '0',
left: '0',
zIndex: 1000,
display: visible ? 'block' : 'none',
}}>
<BootPage visible={visible} />
</div>
<div style={{display: visible ? 'none' : 'block'}}>
<div style={{ display: visible ? 'none' : 'block' }}>
<SecurityLayout {...props}>
<BasicLayout
title={props.global.title}
......@@ -454,8 +458,8 @@ const Layout = (props) => {
popupClassName: 'testpop',
popupOffset: [0, 15],
}}
headerSiteRender={() =>
renderSite({
headerSiteRender={() => {
return !visible && renderSite({
data: cityData,
config: props.global,
loading: siteLoading,
......@@ -464,7 +468,7 @@ const Layout = (props) => {
actionRef,
setMenuLoading,
})
}
}}
menuItemRender={(item, dom) => (
<a
......@@ -500,6 +504,7 @@ const Layout = (props) => {
)}
</Suspense>
{subLoading && <Loading loading={subLoading} />}
<div id='micro-container' className='subapp-container'>
{props.children}
</div>
......
......@@ -53,7 +53,7 @@ const BootPage = props => {
// 新增熊猫新产品引导页
if(type === '熊猫新产品') {
props.history.push(`/cloud/introduction/newproducts`);
window.history.pushState(null, '', `/cloud/introduction/newproducts`);
return;
}
......
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