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

过渡页显示首菜单

parent b7406548
Pipeline #88073 passed with stages
......@@ -117,9 +117,9 @@
"@wisdom-map/arcgismap": "1.4.0-302",
"@wisdom-map/basemap": "1.1.0-41",
"@wisdom-map/util": "1.2.9",
"@wisdom-utils/components": "0.1.359",
"@wisdom-utils/components": "0.1.360",
"@wisdom-utils/runtime": "0.0.48",
"@wisdom-utils/utils": "0.1.399",
"@wisdom-utils/utils": "0.1.400",
"animate.css": "^4.1.1",
"antd": "4.21.2",
"bcryptjs": "2.4.3",
......
......@@ -97,7 +97,7 @@ const appReducer = (state = initialState, action) => {
const config = window.globalConfig;
// config.access_token = "";
// eslint-disable-next-line no-case-declarations
const { homepage } = window.globalConfig;
const { homepage, isOpenTransitionPage } = window.globalConfig;
const modulePkg = {};
window.globalConfig && window.globalConfig.products && Array.isArray(window.globalConfig.products) && window.globalConfig.products.map(item => {
modulePkg[item.PackageName] = item;
......@@ -118,9 +118,8 @@ const appReducer = (state = initialState, action) => {
} else {
flatMenu = flat.flatMenu
}
const index = flatMenu.findIndex(item => item.name === '首页');
if (index === -1) {
if (!isOpenTransitionPage && index === -1) {
flatMenu.push({
path: `/${homepage}`,
href: `/${homepage}`,
......
......@@ -14,7 +14,7 @@ import iconImage from './images/图层 12@2x.png';
import leftTiltle from './images/组 11@2x.png';
import rightTiltle from './images/组 11@2x(1).png';
import SecurityLayout from '../SecurityLayout';
import { defaultApp } from '../../micro';
import { defaultApp, findMenuPath } from '../../micro';
const HomePage = props => {
const { clear } = useAliveController();
......@@ -57,12 +57,13 @@ const HomePage = props => {
};
}, []);
const handlePage = (target, index) => {
const { allWidgets, client } = props.global;
const url = findMenuPath([allWidgets[index]]);
target.updateCurrentIndex && target.updateCurrentIndex(index);
target.updateSystemIndex && target.updateSystemIndex(index);
target.history.push(`/?client=${props.global.client}`);
target.history.push(`/?client=${client}`);
window.share.event.emit('triggerMicro', target.global);
defaultApp();
defaultApp(url);
};
return (
<SecurityLayout loading {...props}>
......@@ -171,9 +172,6 @@ const mapDispatchToProps = dispatch => ({
updateCurrentIndex(index) {
dispatch(actionCreators.updateCurrentIndex(index));
},
updateCurrentSystem(index) {
dispatch(actionCreators.updateCurrentSystem(index));
},
logout() {
dispatch(actionCreators.logout());
},
......
......@@ -301,6 +301,18 @@ export const initMicroApps = (url) => {
}
};
export const findMenuPath = widgets => {
if (widgets && widgets.length > 0) {
return widgets.map(item => {
if (item.url && item.product) {
return `${item.product}/${item.url}`;
}
return findMenuPath(item.widgets);
})[0];
}
return '';
};
export const defaultApp = (setUrl) => {
// eslint-disable-next-line no-undef
const config = window.globalConfig;
......
......@@ -744,14 +744,17 @@ class Login {
}
});
});
self.globalConfig.transitionPage = transitionPage;
if (transitionPage.content.length > 0) {
self.globalConfig.transitionPage = transitionPage;
self.updateConfig && self.updateConfig(self.globalConfig);
self.events.emit('loginHomePage');
window.share.event = self.events;
return self.callback && self.callback();
}
self.globalConfig.isOpenTransitionPage = false;
self.updateConfig && self.updateConfig(self.globalConfig);
self.events.emit('loginHomePage');
window.share.event = self.events;
self.callback && self.callback();
} else {
self.finish(self, getIndustry);
}
self.finish(self, getIndustry);
})
.catch(error => {
self.finish(self, getIndustry);
......
......@@ -16,7 +16,7 @@ import { appService } from './api';
import Container from './components/Container';
import App from './containers/App';
import { actionCreators } from './containers/App/store';
import { defaultApp, initMicroApps } from './micro';
import { defaultApp, findMenuPath } from './micro';
import Login from './pages/user/login/login';
import store from './stores';
import { getToken } from './utils/utils';
......@@ -206,7 +206,9 @@ export const AppInitState = () => {
});
action.events.on('loginHomePage', event => {
window.history.pushState('', '', `/?client=${client}`);
defaultApp();
const { allWidgets } = window.globalConfig;
const url = `civbase/${findMenuPath([allWidgets[0]])}`;
defaultApp(url);
});
}
return window.globalConfig.variableTheme;
......
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