From 19348e8e048ddd0c98569ab57ad20f5492c6e168 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com>
Date: Wed, 17 Jul 2024 10:56:20 +0000
Subject: [PATCH 1/4] =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=20nav=20?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=20portal=20=E5=8F=8A=20mis=20=E6=97=B6?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=20a=20=E6=A0=87=E7=AD=BE=E4=B8=8D?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=20base=20path?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.changeset/fast-kings-love.md | 7 +++++
apps/mis-web/src/layouts/BaseLayout.tsx | 2 ++
apps/portal-web/src/layouts/BaseLayout.tsx | 2 ++
.../src/layouts/base/header/components.tsx | 31 ++++++++++++++-----
libs/web/src/layouts/base/header/index.tsx | 2 ++
5 files changed, 36 insertions(+), 8 deletions(-)
create mode 100644 .changeset/fast-kings-love.md
diff --git a/.changeset/fast-kings-love.md b/.changeset/fast-kings-love.md
new file mode 100644
index 0000000000..ae566e875f
--- /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..b108fcb65e 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";
@@ -49,9 +49,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 +71,9 @@ export const JumpToAnotherLink: React.FC = ({ href, icon
};
}, []);
- return (
-
-
-
+ const content = () => {
+ return (
+ <>
{(hideText || isSmallScreen) ? (
@@ -89,8 +89,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}
/>
);
From 225163a3fe9334a5495f23ac22e4ede8abd20cef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com>
Date: Wed, 17 Jul 2024 19:04:51 +0800
Subject: [PATCH 2/4] Update fast-kings-love.md
---
.changeset/fast-kings-love.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.changeset/fast-kings-love.md b/.changeset/fast-kings-love.md
index ae566e875f..e9e4125c22 100644
--- a/.changeset/fast-kings-love.md
+++ b/.changeset/fast-kings-love.md
@@ -4,4 +4,4 @@
"@scow/lib-web": patch
---
-右上角 nav 跳转 portal 及 mis 时生成的 a 标签不添加 base path
+右上角nav在生成portal及mis的 a 标签时不添加base path
From 2de577b27729c9390e4091a2c34acad570abe994 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com>
Date: Wed, 17 Jul 2024 11:29:44 +0000
Subject: [PATCH 3/4] fix
---
libs/web/src/layouts/base/header/components.tsx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/libs/web/src/layouts/base/header/components.tsx b/libs/web/src/layouts/base/header/components.tsx
index b108fcb65e..32e8ee2cfa 100644
--- a/libs/web/src/layouts/base/header/components.tsx
+++ b/libs/web/src/layouts/base/header/components.tsx
@@ -36,6 +36,13 @@ const Link = styled(NextLink)`
align-items: center;
`;
+const TypographyLink = styled(Typography.Link)`
+ display: flex;
+ flex-wrap: wrap;
+ overflow: hidden;
+ align-items: center;
+`;
+
export const TextSpan = styled.span`
`;
@@ -98,9 +105,9 @@ export const JumpToAnotherLink: React.FC = ({ href, icon
{
crossSystem ? (
-
+
{content()}
-
+
) : (
{content()}
From 6dbb7ab62dc5b987b63b012ccf058b07f90c7d74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com>
Date: Wed, 17 Jul 2024 11:52:59 +0000
Subject: [PATCH 4/4] fix: font-size
---
libs/web/src/layouts/base/header/components.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/libs/web/src/layouts/base/header/components.tsx b/libs/web/src/layouts/base/header/components.tsx
index 32e8ee2cfa..21aa5736a1 100644
--- a/libs/web/src/layouts/base/header/components.tsx
+++ b/libs/web/src/layouts/base/header/components.tsx
@@ -37,6 +37,7 @@ const Link = styled(NextLink)`
`;
const TypographyLink = styled(Typography.Link)`
+ font-size: 18px !important;
display: flex;
flex-wrap: wrap;
overflow: hidden;