Commit 153bb209 authored by 邓晓峰's avatar 邓晓峰

fix: 修复菜单切换

parent 980e8e9a
Pipeline #23048 skipped with stages
...@@ -14046,7 +14046,7 @@ ...@@ -14046,7 +14046,7 @@
"micromatch": { "micromatch": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz", "resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"braces": "^3.0.1", "braces": "^3.0.1",
...@@ -16099,7 +16099,7 @@ ...@@ -16099,7 +16099,7 @@
"micromatch": { "micromatch": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz", "resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"braces": "^3.0.1", "braces": "^3.0.1",
...@@ -20380,7 +20380,7 @@ ...@@ -20380,7 +20380,7 @@
"micromatch": { "micromatch": {
"version": "3.1.10", "version": "3.1.10",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-3.1.10.tgz", "resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-3.1.10.tgz",
"integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arr-diff": "^4.0.0", "arr-diff": "^4.0.0",
...@@ -28512,7 +28512,7 @@ ...@@ -28512,7 +28512,7 @@
"micromatch": { "micromatch": {
"version": "3.1.10", "version": "3.1.10",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-3.1.10.tgz", "resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-3.1.10.tgz",
"integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arr-diff": "^4.0.0", "arr-diff": "^4.0.0",
...@@ -28737,7 +28737,7 @@ ...@@ -28737,7 +28737,7 @@
"micromatch": { "micromatch": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz", "resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"braces": "^3.0.1", "braces": "^3.0.1",
...@@ -373,15 +373,16 @@ const BasicLayout = props => { ...@@ -373,15 +373,16 @@ const BasicLayout = props => {
}, [props.location.pathname]); }, [props.location.pathname]);
useEffect(() => { useEffect(() => {
setLoading(true); props.menu.length === 0 ? setLoading(true): (setLoading(false));
clearTime = setTimeout(() => { clearTime = setTimeout(() => {
if(props.route && props.route.routes.length > 0) { if( props.menu.length > 0 && (props.route && props.route.routes.length > 0)) {
setCurrentRoutes(props.route.routes[props.currentMenuIndex]); setCurrentRoutes(props.route.routes[props.currentMenuIndex]);
setLoading(false); setLoading(false);
} }
}, 400); }, 400);
return () => clearTimeout && clearTimeout(clearTime); // return () => clearTimeout && clearTimeout(clearTime);
}, [props.currentMenuIndex, props.route]); }, [props.currentMenuIndex, props.route, props.menu]);
useEffect(() => { useEffect(() => {
siteAction.setGlobalConfig(props.global); siteAction.setGlobalConfig(props.global);
...@@ -533,7 +534,7 @@ const BasicLayout = props => { ...@@ -533,7 +534,7 @@ const BasicLayout = props => {
window.share.event.emit('trigger:route'); window.share.event.emit('trigger:route');
} }
}; };
debugger
const title = getPageTitle({ const title = getPageTitle({
title: props.global && props.global.get('title') || defaultSetting.title title: props.global && props.global.get('title') || defaultSetting.title
}); });
......
...@@ -43,7 +43,7 @@ const BootPage = props => { ...@@ -43,7 +43,7 @@ const BootPage = props => {
const [loadding, setLoadding] = useState(false); const [loadding, setLoadding] = useState(false);
const [scale, setScale] = useState(1); const [scale, setScale] = useState(1);
useDocumentTitle( useDocumentTitle(
{ title: defaultSetting.title, id: '', pageName: '行业qieh' }, { title: defaultSetting.title, id: '', pageName: '行业切换' },
props.global.title || defaultSetting.title, props.global.title || defaultSetting.title,
); );
const handlePage = useCallback((event, type) => { const handlePage = useCallback((event, type) => {
......
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