From d076fb5325eb9cb7b30b178bbad3d8f7ccdd4bcb Mon Sep 17 00:00:00 2001
From: zhanjunhao <642307404@qq.com>
Date: Wed, 18 Nov 2026 17:39:19 +0800
Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E7=BB=9F=E4=B8=80=E4=B8=8B=E8=BD=BD?=
=?UTF-8?q?=E9=A1=B5=E4=B8=BB=E9=A2=98=E4=B8=8E=E6=99=BA=E8=83=BD=E8=B7=AF?=
=?UTF-8?q?=E7=94=B1=E9=A1=B5=E7=AD=BE=E9=97=B4=E8=B7=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/CHANGELOG.md | 16 ++
docs/standards/UI_COMPONENT_STANDARDS.md | 3 +-
docs/ui/GLOBAL_UI_BASELINE.md | 2 +-
.../layout/headerbar/LanguageSelector.jsx | 44 ++---
.../layout/headerbar/MobileNavMenu.jsx | 100 +++++-----
.../layout/headerbar/Navigation.jsx | 70 +++----
src/components/layout/headerbar/UserArea.jsx | 2 +-
src/components/smart-router/smart-router.css | 5 +
src/components/ui/UiThemeProvider.jsx | 5 +-
src/pages/SmartRouter/index.jsx | 2 +-
src/pages/WeyAiDownload/index.jsx | 172 ++++++++----------
src/pages/WeyAiDownload/weyai-download.css | 156 +++++++---------
12 files changed, 253 insertions(+), 324 deletions(-)
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 30b86467..3c3eb76f 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -10,6 +10,22 @@
## 2026-11-18
+### 调整 · 智能路由卡片首部页签间距
+
+- **范围**:`/console/smart-router` 的选项卡卡片,以及 UI 公共规范第 10 节。
+- **变更**:参照官网设置页,将页签卡片主体顶部内边距从 24px 调整为 8px,减少 16px 多余留白;规范明确卡片首部页签的顶部间距、默认高度与适用条件。
+- **影响**:仅调整该卡片顶部间距,保留页签高度、文字、切换逻辑、权限、请求和其他方向内边距;企业中心的智能路由组件不受影响。
+- **回滚**:移除 `SmartRouter/index.jsx` 的 `smart-router-tabs-card` 类及对应 CSS 规则,按差异还原规范条目。
+- **关联**:`docs/standards/UI_COMPONENT_STANDARDS.md` 第 10 节。
+
+### 修复 · WeyAi 下载页与顶部菜单统一主题
+
+- **范围**:`/weyai/download`、用户中心内嵌下载页,以及共享顶栏的账户、语言与主导航菜单。
+- **变更**:本站下载页进入系统样式作用域,修复头像浮层缺少背景与颜色变量;下载页复用公共页头与原生 antd 按钮、标签、骨架,对齐浅深主题、卡片、间距、图标和响应式布局,移除旧装饰渐变与悬浮动效。顶部菜单使用原生 antd 菜单与可聚焦触发器,账户和语言菜单支持点击,下载页锚点跟随实际顶栏高度并遵守减少动态效果偏好。
+- **影响**:仅调整展示与菜单操作方式,保留下载地址、开放范围、权限判断、请求、语言与主题持久化;其他 WeyAI 外部页仍使用原作用域。
+- **回滚**:按本条涉及的下载页、`UiThemeProvider.jsx` 与顶栏菜单组件差异还原,保留其他工作区修改。
+- **关联**:`docs/ui/GLOBAL_UI_BASELINE.md` 第 1、4 节;`docs/standards/UI_COMPONENT_STANDARDS.md`。
+
### 修复 · 平台 Skill 分类标签与搜索栏左对齐
- **范围**:`/console/skill-platform` 分类速览标签区域。
diff --git a/docs/standards/UI_COMPONENT_STANDARDS.md b/docs/standards/UI_COMPONENT_STANDARDS.md
index 52f15f4c..51784eac 100644
--- a/docs/standards/UI_COMPONENT_STANDARDS.md
+++ b/docs/standards/UI_COMPONENT_STANDARDS.md
@@ -1,6 +1,6 @@
# UI 公共组件与样式规范
-> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.4
+> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.5
所有后台页面共用的主题与组件标准。页面规范只记录与本文不同的部分;编码约定见 `DEV_STANDARDS.md`,外壳与布局见 `GLOBAL_UI_BASELINE.md`。
@@ -208,6 +208,7 @@ html.dark .km-page {
| 类型 | 用法 |
| --- | --- |
| 列表页签 | antd `Tabs`;导航与下方内容间距 20px(控制台 16px);页签间距 28px;文字 14 / 22px;选中与悬停为品牌色,2px 下划线 |
+| 卡片首部页签 | 控制台卡片主体以 `Tabs` 开始、页签上方没有标题或提示时,主体顶部内边距 8px,参考 `/console/website-setting`、`/console/smart-router`;保留页签默认上下内边距 12px、导航高 46px、与下方内容间距 16px,不叠加空白占位或顶部外边距。卡片其余内边距不变;页签前有错误提示或说明块时按对应容器规则处理。浅深主题、桌面与移动端一致。 |
| 筛选页签 | 只切换筛选条件时隐藏内容区(企业中心 `.oc-tabs-nav-only`),筛选结果由下方列表卡展示 |
| 分段控件 | 2–4 个互斥选项(如趋势维度、充值类型、头像类型)用 `Segmented`,`onChange(value)` 直接接值处理函数 |
| 预渲染 | 原先预渲染全部页签的页面保留 `forceRender`,不改变请求时机 |
diff --git a/docs/ui/GLOBAL_UI_BASELINE.md b/docs/ui/GLOBAL_UI_BASELINE.md
index 69e402c9..0e952882 100644
--- a/docs/ui/GLOBAL_UI_BASELINE.md
+++ b/docs/ui/GLOBAL_UI_BASELINE.md
@@ -24,7 +24,7 @@
- 原型定义的颜色、尺寸、样式、状态与视觉交互优先;原型只作视觉依据,不作业务、数据、状态、接口、路由依据。
- 专项规范见 `docs/README.md` 索引;专项未覆盖的部分按本文执行。
-- 不重做:WeyAI 外部页与第三方 SDK 的内部视觉;体验中心只检查宿主布局。图表、流程画布、编辑器与新手引导保留专用组件。
+- 不重做:WeyAI 外部页与第三方 SDK 的内部视觉;本站托管的 `/weyai/download` 属于系统页面,沿用统一主题、顶栏与浮层 token。体验中心只检查宿主布局。图表、流程画布、编辑器与新手引导保留专用组件。
- 改造前先列出已覆盖、未覆盖、排除的页面;配置隐藏、权限重定向和原型失效入口单独列出。
## 2. 目录职责
diff --git a/src/components/layout/headerbar/LanguageSelector.jsx b/src/components/layout/headerbar/LanguageSelector.jsx
index 9afc2bac..bbc92152 100644
--- a/src/components/layout/headerbar/LanguageSelector.jsx
+++ b/src/components/layout/headerbar/LanguageSelector.jsx
@@ -19,8 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import { Globe as ActionGlobe } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useState } from 'react';
-import { Button as AntButton } from 'antd';
-import { Dropdown } from '@/components/ui';
+import { Button as AntButton, Dropdown } from 'antd';
import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2';
import { normalizeLanguage } from '../../../i18n/language';
import { orderEnabledLanguages } from '../../../i18n/catalog';
@@ -47,41 +46,32 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
window.removeEventListener(LANG_BOOT_UPDATED_EVENT, handleBootUpdated);
}, []);
- const getItemClassName = (isSelected) =>
- `!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm ${
- isSelected
- ? '!bg-ui-color-primary-light-default !font-semibold'
- : 'hover:!bg-ui-color-fill-1'
- }`;
-
// 展示哪些语言、按什么顺序由后台「语言与地区」配置决定(经 /api/i18n/locale 缓存下发)
const languages = orderEnabledLanguages(getBootConfig()?.enabled_languages);
return (
- {languages.map(({ code, endonym, flag }) => {
- const Flag = FLAGS[flag];
- return (
- onLanguageChange(code)}
- className={getItemClassName(lang === code)}
- >
- {Flag && }
- {endonym}
-
- );
- })}
-
- }
+ trigger={['hover', 'click']}
+ placement='bottomRight'
+ menu={{
+ selectable: true,
+ selectedKeys: [lang],
+ onClick: ({ key }) => onLanguageChange(key),
+ items: languages.map(({ code, endonym, flag }) => {
+ const Flag = FLAGS[flag];
+ return {
+ key: code,
+ icon: Flag ? : null,
+ label: endonym,
+ };
+ }),
+ }}
>
}
aria-label={t('common.changeLanguage')}
+ aria-haspopup='menu'
className='ui-header-icon-action'
/>
diff --git a/src/components/layout/headerbar/MobileNavMenu.jsx b/src/components/layout/headerbar/MobileNavMenu.jsx
index a015c515..68103a88 100644
--- a/src/components/layout/headerbar/MobileNavMenu.jsx
+++ b/src/components/layout/headerbar/MobileNavMenu.jsx
@@ -20,7 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
import { Compass as ActionCompass } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
-import { Button, Dropdown } from '@/components/ui';
+import { Button, Dropdown } from 'antd';
import { ExternalLink } from 'lucide-react';
import { isNavigationPathActive } from '../../console/consoleRoutes';
@@ -92,63 +92,51 @@ const MobileNavMenu = ({ mainNavLinks, userState, t }) => {
return (
- {menuItems.map((item) => (
- {
- setVisible(false);
- if (item.externalLink) {
- window.open(
- item.externalLink,
- '_blank',
- 'noopener,noreferrer',
- );
- } else if (item.to) {
- navigate(item.to);
- }
- }}
- className={`!rounded-lg !my-0.5 !px-3 !py-2 !text-sm !transition-colors ${
- item.active
- ? '!bg-brand/10 dark:!bg-brand-deep/40 !text-brand-deep dark:!text-brand-from !font-semibold'
- : '!text-gray-700 dark:!text-neutral-200'
- }`}
+ trigger={['click']}
+ placement='bottomLeft'
+ open={visible}
+ onOpenChange={setVisible}
+ menu={{
+ selectedKeys: menuItems
+ .filter((item) => item.active)
+ .map((item) => item.key),
+ items: menuItems.map((item) => ({
+ key: item.key,
+ onClick: () => {
+ setVisible(false);
+ if (item.externalLink) {
+ window.open(item.externalLink, '_blank', 'noopener,noreferrer');
+ } else if (item.to) {
+ navigate(item.to);
+ }
+ },
+ label: (
+
-
- {item.text}
- {item.externalLink && (
-
- )}
-
-
- ))}
-
- }
+ {item.text}
+ {item.externalLink && (
+
+ )}
+
+ ),
+ })),
+ }}
>
-
- }
- className='!ml-1 !px-2 !h-8 max-w-[9rem] !rounded-xl !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-all !duration-200 active:!scale-95 [&_.ant-btn-content]:min-w-0'
- >
-
- {activeItem?.mobileText || activeItem?.text || t('导航')}
-
-
-
+ }
+ className='ml-1 px-2 max-w-[9rem] [&_.ant-btn-content]:min-w-0'
+ >
+
+ {activeItem?.mobileText || activeItem?.text || t('导航')}
+
+
);
};
diff --git a/src/components/layout/headerbar/Navigation.jsx b/src/components/layout/headerbar/Navigation.jsx
index dc46084a..2e96b3d6 100644
--- a/src/components/layout/headerbar/Navigation.jsx
+++ b/src/components/layout/headerbar/Navigation.jsx
@@ -19,7 +19,11 @@ For commercial licensing, please contact support@quantumnous.com
import React from 'react';
import { Link, useLocation } from 'react-router-dom';
-import { Dropdown } from '@/components/ui';
+import { Dropdown } from 'antd';
+import {
+ ChevronDown,
+ ExternalLink,
+} from '@/components/common/icons/ActionIcons';
import { useTranslation } from 'react-i18next';
import SkeletonWrapper from '../components/SkeletonWrapper';
import { isNavigationPathActive } from '../../console/consoleRoutes';
@@ -68,44 +72,27 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
return (
- {link.items.map((subItem) => (
-
-
- {subItem.text}
-
-
- ))}
-
- }
+ trigger={['hover', 'click']}
+ placement='bottomLeft'
+ menu={{
+ selectedKeys: link.items
+ .filter((item) => isPathActive(item.to))
+ .map((item) => item.itemKey),
+ items: link.items.map((subItem) => ({
+ key: subItem.itemKey,
+ label: {subItem.text},
+ })),
+ }}
>
-
{linkContent}
- {/* Dropdown arrow */}
-
-
+
+
);
}
@@ -120,20 +107,7 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
className={`${baseClasses} ${spacingClasses} ${defaultClasses} ${hoverClasses}`}
>
{linkContent}
- {/* External link icon */}
-
+
);
}
diff --git a/src/components/layout/headerbar/UserArea.jsx b/src/components/layout/headerbar/UserArea.jsx
index 5d7da9d9..0702d076 100644
--- a/src/components/layout/headerbar/UserArea.jsx
+++ b/src/components/layout/headerbar/UserArea.jsx
@@ -143,7 +143,7 @@ const UserArea = ({
return (
.ant-card-body {
+ padding-top: 8px;
+}
+
/* 控制台介绍区:无图标、无渐变的说明块;标题与内边距由公共页头 / 容器统一 */
.smart-router-hero {
padding: 16px 24px;
diff --git a/src/components/ui/UiThemeProvider.jsx b/src/components/ui/UiThemeProvider.jsx
index c1b8a118..03f8cab6 100644
--- a/src/components/ui/UiThemeProvider.jsx
+++ b/src/components/ui/UiThemeProvider.jsx
@@ -261,8 +261,11 @@ export default function UiThemeProvider({ children }) {
// 日期面板的星期、月份名称来自 dayjs 全局语言,需与 Ant Design locale 保持一致。
dayjs.locale(DAYJS_LOCALES[language] || 'zh-cn');
useLayoutEffect(() => {
+ // The hosted download page shares the system shell and its popup tokens.
+ const isDownloadPage = /^\/weyai\/download\/?$/.test(pathname);
document.body.dataset.uiScope =
- pathname.startsWith('/weyai/') || pathname.startsWith('/client/authorize')
+ (pathname.startsWith('/weyai/') && !isDownloadPage) ||
+ pathname.startsWith('/client/authorize')
? 'external'
: 'admin';
}, [pathname]);
diff --git a/src/pages/SmartRouter/index.jsx b/src/pages/SmartRouter/index.jsx
index 21dc612c..5d03a233 100644
--- a/src/pages/SmartRouter/index.jsx
+++ b/src/pages/SmartRouter/index.jsx
@@ -77,7 +77,7 @@ const SmartRouterPage = () => {
)}
-
+
{
);
const scrollToAll = () => {
- document
- .getElementById(ALL_PACKAGES_ID)
- ?.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ document.getElementById(ALL_PACKAGES_ID)?.scrollIntoView({
+ behavior: window.matchMedia('(prefers-reduced-motion: reduce)').matches
+ ? 'instant'
+ : 'smooth',
+ block: 'start',
+ });
};
const download = (url) => window.open(url, '_self');
@@ -275,21 +277,16 @@ const WeyAiDownload = ({ embedded = false }) => {
{archLabel(file.arch) || file.name}
- {file.kind && {file.kind}}
- {isReco && (
-
- {t('推荐')}
-
- )}
+ {file.kind && {file.kind}}
+ {isReco && {t('推荐')}}
{fileMeta(file)}
}
- theme={isReco ? 'solid' : 'light'}
- type='primary'
+ icon={}
+ type={isReco ? 'primary' : 'default'}
aria-label={`${t('下载')} ${file.name}`}
onClick={() => download(file.url)}
>
@@ -322,7 +319,7 @@ const WeyAiDownload = ({ embedded = false }) => {
{recommended.name}
- {recommended.size && (
+ {recommended.size > 0 && (
{formatSize(recommended.size)}
)}
{release?.version && v{release.version}}
@@ -342,15 +339,13 @@ const WeyAiDownload = ({ embedded = false }) => {
}
+ icon={
}
onClick={() => download(recommended.url)}
>
{t('下载 WeyAi')}
-
@@ -387,10 +382,8 @@ const WeyAiDownload = ({ embedded = false }) => {
}
+ icon={
}
onClick={() => download(androidApk.url)}
>
{t('下载 Android 版')}
@@ -431,7 +424,7 @@ const WeyAiDownload = ({ embedded = false }) => {
{client.os !== 'mobile' && (
-
+
{t('查看全部安装包')}
@@ -445,17 +438,8 @@ const WeyAiDownload = ({ embedded = false }) => {
if (!statusLoaded || loading) {
return (
);
}
@@ -477,9 +461,8 @@ const WeyAiDownload = ({ embedded = false }) => {
desc={loadError}
actions={
}
+ icon={}
onClick={load}
>
{t('重试')}
@@ -542,16 +525,14 @@ const WeyAiDownload = ({ embedded = false }) => {
{I18N_TECHNICAL_TEXT.ANDROID}
- apk
+ apk
{androidMeta}
}
- theme='light'
- type='primary'
+ icon={}
aria-label={`${t('下载')} ${androidApk.name}`}
onClick={() => download(androidApk.url)}
>
@@ -572,72 +553,71 @@ const WeyAiDownload = ({ embedded = false }) => {
};
const rootClass = `weyai-download ${
- embedded
- ? 'weyai-download--embedded'
- : 'weyai-download--standalone mt-[60px]'
+ embedded ? 'weyai-download--embedded' : 'weyai-download--standalone'
}`;
+ const heroActions = (
+
+ {isLoggedIn && webVisible && webUrl && (
+ }
+ onClick={() => window.open(webUrl, '_blank', 'noopener')}
+ >
+ {t('使用网页版')}
+
+ )}
+ }
+ onClick={() => {
+ window.location.href = OPEN_APP_URL;
+ }}
+ >
+ {t('已安装?打开 WeyAi')}
+
+
+ );
+
return (