Commit b869fba7 authored by 杨思琦's avatar 杨思琦

fix: 站点切换修改

parent ebee6a80
Pipeline #86067 passed with stages
......@@ -115,9 +115,9 @@
"@wisdom-map/arcgismap": "1.4.0-263",
"@wisdom-map/basemap": "1.1.0-41",
"@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.354",
"@wisdom-utils/components": "0.1.355",
"@wisdom-utils/runtime": "0.0.48",
"@wisdom-utils/utils": "0.1.394",
"@wisdom-utils/utils": "0.1.395",
"@congcongcai/jieba.js" : "0.0.3",
"animate.css": "^4.1.1",
"antd": "4.21.2",
......
......@@ -180,6 +180,14 @@ const Stations = props => {
const renderSite = ({ data, config, loading, setLoading, action, actionRef, setMenuLoading }) => {
const [visible, setVisible] = useState(false);
useEffect(() => {
window.share.event.on('changeSiteVisible', res => {
setVisible(res);
});
return () => {
window.share.event.removeAllListeners('changeSiteVisible');
};
}, []);
let loaded = !!((data && !data.stations) || (Array.isArray(data.weathers) && data.weathers.length === 0));
if (config && config.userInfo && config.userInfo.site === '') {
loaded = false;
......@@ -395,7 +403,7 @@ const Layout = props => {
GetIntegrationConfig();
}
window.share.event.on('updateSite', res => {
setCityData(res);
setCityData({...cityData, ...res});
});
const handleToggleIndustry = event => {
......
......@@ -348,18 +348,18 @@ class Site {
self.props.history && self.props.history.push(url);
self.props && self.props.updateCollapsed && self.props.updateCollapsed(false);
window.share.event.emit('triggerMicro', this.props.global);
onChangeVisible && onChangeVisible(false);
onChangeVisible ? onChangeVisible(false) : window.share.event.emit('changeSiteVisible', false);
});
login.init();
}
changeGroup(event, item, onChangeVisible, actionRef) {
// debugger
event.persist();
const site = item ? item.site : event.target.dataset.site;
const { token } = this.globalConfig.userInfo;
this.setLoading(true);
if (token) {
window.share.event.emit('updateSite', { ...item, currentStationName: item.groupName });
this.beforeChangeCheck(token, site, onChangeVisible, actionRef);
} else {
this.setLoading(false);
......
......@@ -291,6 +291,9 @@ export const initMicroApps = (url) => {
window.qiankunStarted = true;
registerMicroApps(microApps, LifeCycle);
start(Configuration);
setTimeout(() => {
url.indexOf('civbase/civ_base') > -1 && event.emit('loading', false)
})
addGlobalUncaughtErrorHandler(event => {
console.log(event);
});
......
......@@ -36,7 +36,7 @@ const PrevieView = props => {
}
})
.catch(err => {
notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
// notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
});
});
......
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