Commit 0b007ce7 authored by yzl's avatar yzl

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

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