代码修改
This commit is contained in:
1 parent
91ba47bf47
commit
25153dbd84
31 files changed
+536
-62
No files matched your search
@@ -29,13 +29,13 @@ import { cn } from "@/lib/utils";
|
||||
|
||||
import { useTheme } from "../contexts/ThemeContext";
|
||||
|
||||
const iconButtonClass = (isDark: boolean, isIceBlue: boolean) =>
|
||||
const iconButtonClass = (isDark: boolean, isPaleLightTheme: boolean) =>
|
||||
cn(
|
||||
"size-8 shrink-0 rounded-sm",
|
||||
isDark
|
||||
? "text-slate-400 hover:bg-slate-800/50 hover:text-white"
|
||||
: isIceBlue
|
||||
? "text-[#18324A] hover:bg-white/55 hover:text-[#18324A] active:bg-white/75"
|
||||
: isPaleLightTheme
|
||||
? "text-[var(--foreground)] hover:bg-white/55 hover:text-[var(--foreground)] active:bg-white/75"
|
||||
: "text-white hover:bg-[var(--brand-950)] active:bg-[#8a0618]",
|
||||
);
|
||||
|
||||
@@ -50,7 +50,7 @@ type HeaderProps = {
|
||||
const Header = ({ collapsed }: HeaderProps) => {
|
||||
const { theme } = useTheme();
|
||||
const isDark = theme === "dark";
|
||||
const isIceBlue = theme === "iceblue";
|
||||
const isPaleLightTheme = theme === "iceblue" || theme === "lightyellow";
|
||||
const darkLogoPosition =
|
||||
readRuntimeEnv("VITE_DARK_LOGO_POSITION") === "left" ? "left" : "center";
|
||||
const isDarkLogoOnLeft = darkLogoPosition === "left";
|
||||
@@ -152,11 +152,11 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
// 右侧操作区(换肤/通知/用户)—— 深浅两套布局共用
|
||||
const actionCluster = (
|
||||
<>
|
||||
<CompactShortcutButtons tone={isDark ? "banner-dark" : isIceBlue ? "content" : "banner-light"} />
|
||||
<ThemeSwitcher tone={isDark ? "banner-dark" : isIceBlue ? "content" : "banner-light"} />
|
||||
<CompactShortcutButtons tone={isDark ? "banner-dark" : isPaleLightTheme ? "content" : "banner-light"} />
|
||||
<ThemeSwitcher tone={isDark ? "banner-dark" : isPaleLightTheme ? "content" : "banner-light"} />
|
||||
|
||||
<LayoutModeSwitcher
|
||||
tone={isDark ? "banner-dark" : isIceBlue ? "content" : "banner-light"}
|
||||
tone={isDark ? "banner-dark" : isPaleLightTheme ? "content" : "banner-light"}
|
||||
fallback="full"
|
||||
/>
|
||||
|
||||
@@ -165,7 +165,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
onClick={() => setNotificationOpen(true)}
|
||||
className={cn(iconButtonClass(isDark, isIceBlue), "relative")}
|
||||
className={cn(iconButtonClass(isDark, isPaleLightTheme), "relative")}
|
||||
title="通知"
|
||||
>
|
||||
<Bell className="size-4" />
|
||||
@@ -186,7 +186,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
<div
|
||||
className={cn(
|
||||
"mx-1 h-8 w-px",
|
||||
isDark ? "bg-blue-800/30" : isIceBlue ? "bg-[#3D6E96]/25" : "bg-white/30",
|
||||
isDark ? "bg-blue-800/30" : isPaleLightTheme ? "bg-[var(--brand-900)]/25" : "bg-white/30",
|
||||
)}
|
||||
aria-hidden
|
||||
/>
|
||||
@@ -198,8 +198,8 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
"h-8 gap-2 rounded-sm px-2",
|
||||
isDark
|
||||
? "text-slate-200 hover:bg-slate-800/50"
|
||||
: isIceBlue
|
||||
? "text-[#18324A] hover:bg-white/55 active:bg-white/75"
|
||||
: isPaleLightTheme
|
||||
? "text-[var(--foreground)] hover:bg-white/55 active:bg-white/75"
|
||||
: "text-white hover:bg-[var(--brand-950)] active:bg-[#8a0618]",
|
||||
)}
|
||||
>
|
||||
@@ -219,11 +219,11 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
/>
|
||||
</div>
|
||||
<div className="hidden text-left sm:block">
|
||||
<p className={cn("text-sm leading-tight font-medium", isIceBlue ? "text-[#18324A]" : "text-white")}>
|
||||
<p className={cn("text-sm leading-tight font-medium", isPaleLightTheme ? "text-[var(--foreground)]" : "text-white")}>
|
||||
{displayName}
|
||||
</p>
|
||||
{positionName && (
|
||||
<p className={cn("text-[11px] leading-tight", isIceBlue ? "text-[#315B7B]" : "text-white/70")}>
|
||||
<p className={cn("text-[11px] leading-tight", isPaleLightTheme ? "text-[var(--muted-foreground)]" : "text-white/70")}>
|
||||
{positionName}
|
||||
</p>
|
||||
)}
|
||||
@@ -231,7 +231,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
<ChevronDown
|
||||
className={cn(
|
||||
"size-4 shrink-0",
|
||||
isDark ? "text-slate-500" : isIceBlue ? "text-[#315B7B]" : "text-white/80",
|
||||
isDark ? "text-slate-500" : isPaleLightTheme ? "text-[var(--muted-foreground)]" : "text-white/80",
|
||||
)}
|
||||
/>
|
||||
</Button>
|
||||
@@ -323,7 +323,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
onError={handleBrandLogoError}
|
||||
/>
|
||||
</div>
|
||||
<span className={cn("whitespace-nowrap text-lg font-semibold", isIceBlue ? "text-[#18324A]" : "text-white")}>
|
||||
<span className={cn("whitespace-nowrap text-lg font-semibold", isPaleLightTheme ? "text-[var(--foreground)]" : "text-white")}>
|
||||
{desensitizeText("CM业务中心")}
|
||||
</span>
|
||||
</div>
|
||||
@@ -344,7 +344,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",
|
||||
isDark
|
||||
? "bg-gradient-to-br from-blue-500 to-cyan-400"
|
||||
: isIceBlue
|
||||
: isPaleLightTheme
|
||||
? "bg-white/55"
|
||||
: "bg-white/20",
|
||||
)}
|
||||
@@ -358,7 +358,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
||||
/>
|
||||
</div>
|
||||
{!collapsed && (
|
||||
<span className={cn("text-sm font-semibold", isIceBlue ? "text-[#18324A]" : "text-white")}>
|
||||
<span className={cn("text-sm font-semibold", isPaleLightTheme ? "text-[var(--foreground)]" : "text-white")}>
|
||||
{desensitizeText("CM业务中心")}
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -44,6 +44,19 @@
|
||||
--input-border: 204 50% 90%;
|
||||
}
|
||||
|
||||
/* Pale yellow follows the global #F3FBD9 primary and readable olive labels. */
|
||||
[data-theme="lightyellow"] .strategy-data {
|
||||
--color-main: #F3FBD9;
|
||||
--color-main-foreground: #303D23;
|
||||
--bg-color: #EEF6D4;
|
||||
--card-border: #DCEBAD;
|
||||
--text-color: #303D23;
|
||||
|
||||
--card-hover: 75 66% 95%;
|
||||
--border-color: 75 47% 86%;
|
||||
--input-border: 75 47% 86%;
|
||||
}
|
||||
|
||||
/* ── CSS variables (dark) ────────────────────────────────────────────── */
|
||||
.dark .strategy-data {
|
||||
--color-main: var(--color-primary);
|
||||
|
||||
@@ -42,7 +42,7 @@ export const LOGIN_SOURCE_OPTIONS: { label: string; value: string }[] = [
|
||||
* 我方主题色键。当前启用 red(浅色) / dark-blue(深色);blue 为后续将新增的主题。
|
||||
* 主题参数的映射以这些键为左侧 key(如 `dark-blue=darkBlue`)。
|
||||
*/
|
||||
export type AppThemeColor = "red" | "green" | "blue" | "iceblue" | "dark-blue";
|
||||
export type AppThemeColor = "red" | "green" | "blue" | "iceblue" | "lightyellow" | "dark-blue";
|
||||
|
||||
/** 我方全部主题色(「应用管理」主题参数逐项配置目标值时遍历;dot 为配色小圆点)。 */
|
||||
export const APP_THEME_COLORS: { key: AppThemeColor; label: string; dot: string }[] = [
|
||||
@@ -50,6 +50,7 @@ export const APP_THEME_COLORS: { key: AppThemeColor; label: string; dot: string
|
||||
{ key: "red", label: "红色", dot: "#F5222D" },
|
||||
{ key: "blue", label: "蓝色", dot: "#1677FF" },
|
||||
{ key: "iceblue", label: "冰川蓝", dot: "#9BCEF1" },
|
||||
{ key: "lightyellow", label: "浅黄色", dot: "#F3FBD9" },
|
||||
{ key: "dark-blue", label: "深蓝色", dot: "#002B5C" },
|
||||
];
|
||||
|
||||
@@ -62,6 +63,7 @@ const THEME_KEY_ALIASES: Record<AppThemeColor, string[]> = {
|
||||
green: ["green", "lightgreen"],
|
||||
blue: ["blue"],
|
||||
iceblue: ["iceblue", "ice-blue"],
|
||||
lightyellow: ["lightyellow", "light-yellow", "yellow"],
|
||||
"dark-blue": ["dark-blue", "darkblue", "dark"],
|
||||
};
|
||||
|
||||
@@ -76,6 +78,7 @@ export function getCurrentTheme(): AppThemeColor {
|
||||
if (classList.contains("lightgreen")) return "green";
|
||||
if (classList.contains("lightblue")) return "blue";
|
||||
if (classList.contains("iceblue")) return "iceblue";
|
||||
if (classList.contains("lightyellow")) return "lightyellow";
|
||||
}
|
||||
return "red";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user