diff --git a/.changeset/fast-kings-love.md b/.changeset/fast-kings-love.md new file mode 100644 index 0000000000..e9e4125c22 --- /dev/null +++ b/.changeset/fast-kings-love.md @@ -0,0 +1,7 @@ +--- +"@scow/portal-web": patch +"@scow/mis-web": patch +"@scow/lib-web": patch +--- + +右上角nav在生成portal及mis的 a 标签时不添加base path diff --git a/apps/mis-web/src/layouts/BaseLayout.tsx b/apps/mis-web/src/layouts/BaseLayout.tsx index 89fcc7562f..618354de0e 100644 --- a/apps/mis-web/src/layouts/BaseLayout.tsx +++ b/apps/mis-web/src/layouts/BaseLayout.tsx @@ -54,6 +54,7 @@ export const BaseLayout = icon: , href: toCallbackPage(publicConfig.PORTAL_URL), text: t("layouts.route.navLinkTextPortal"), + crossSystem: true, }); } @@ -62,6 +63,7 @@ export const BaseLayout = icon: , href: publicConfig.AI_URL, text: t("layouts.route.navLinkTextAI"), + crossSystem: true, }); } diff --git a/apps/portal-web/src/layouts/BaseLayout.tsx b/apps/portal-web/src/layouts/BaseLayout.tsx index ddeffa8b14..d205059acb 100644 --- a/apps/portal-web/src/layouts/BaseLayout.tsx +++ b/apps/portal-web/src/layouts/BaseLayout.tsx @@ -72,6 +72,7 @@ export const BaseLayout = ({ footerText, versionTag, initialLanguage, children } icon: , href: toCallbackPage(publicConfig.MIS_URL), text: t("baseLayout.linkTextMis"), + crossSystem: true, }); } @@ -80,6 +81,7 @@ export const BaseLayout = ({ footerText, versionTag, initialLanguage, children } icon: , href: publicConfig.AI_URL, text: t("baseLayout.linkTextAI"), + crossSystem: true, }); } diff --git a/libs/web/src/layouts/base/header/components.tsx b/libs/web/src/layouts/base/header/components.tsx index 2e419d8abd..21aa5736a1 100644 --- a/libs/web/src/layouts/base/header/components.tsx +++ b/libs/web/src/layouts/base/header/components.tsx @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -import { Tooltip } from "antd"; +import { Tooltip, Typography } from "antd"; import NextLink from "next/link"; import { useEffect, useRef, useState } from "react"; import { antdBreakpoints } from "src/layouts/base/constants"; @@ -36,6 +36,14 @@ const Link = styled(NextLink)` align-items: center; `; +const TypographyLink = styled(Typography.Link)` + font-size: 18px !important; + display: flex; + flex-wrap: wrap; + overflow: hidden; + align-items: center; +`; + export const TextSpan = styled.span` `; @@ -49,9 +57,10 @@ interface JumpToAnotherLinkProps { href: string; text: string; hideText?: boolean; + crossSystem?: boolean; } -export const JumpToAnotherLink: React.FC = ({ href, icon, text, hideText }) => { +export const JumpToAnotherLink: React.FC = ({ href, icon, text, hideText, crossSystem }) => { const [isSmallScreen, setIsSmallScreen] = useState(false); @@ -70,10 +79,9 @@ export const JumpToAnotherLink: React.FC = ({ href, icon }; }, []); - return ( - - - + const content = () => { + return ( + <> {(hideText || isSmallScreen) ? ( @@ -89,8 +97,23 @@ export const JumpToAnotherLink: React.FC = ({ href, icon {text} - )} - + )} + ); + }; + + return ( + + + { + crossSystem ? ( + + {content()} + + ) : ( + + {content()} + + ) } ); diff --git a/libs/web/src/layouts/base/header/index.tsx b/libs/web/src/layouts/base/header/index.tsx index 30e57b74f7..9a0e09964c 100644 --- a/libs/web/src/layouts/base/header/index.tsx +++ b/libs/web/src/layouts/base/header/index.tsx @@ -70,6 +70,7 @@ export interface HeaderNavbarLink { icon: React.ReactNode; href: string; text: string; + crossSystem?: boolean; }; interface Props { @@ -107,6 +108,7 @@ export const Header: React.FC = ({ icon={x.icon} href={x.href} text={x.text} + crossSystem={x.crossSystem} hideText={hideLinkText} /> );