feat(顶栏): LOGO 徽标旁显示平台文字(yh-logo-text 键接入);theme.ts 同步通道新版本戳(LOGO文字与主题JSON化)
build / build (push) Successful in 3m5s
build / build (push) Successful in 3m5s
This commit is contained in:
@@ -37,14 +37,30 @@ const readLogoUrl = () => {
|
|||||||
}
|
}
|
||||||
logoUrl.value = v || defaultLogo;
|
logoUrl.value = v || defaultLogo;
|
||||||
};
|
};
|
||||||
|
// LOGO 文字(平台/学校名称,2026-10-09 LOGO 文字轮):localStorage["yh-logo-text"](同一异步补齐段写入),空=不展示。
|
||||||
|
const logoText = ref("");
|
||||||
|
const readLogoText = () => {
|
||||||
|
let v: string | null = null;
|
||||||
|
try {
|
||||||
|
v = localStorage.getItem("yh-logo-text");
|
||||||
|
} catch {
|
||||||
|
v = null;
|
||||||
|
}
|
||||||
|
logoText.value = v || "";
|
||||||
|
};
|
||||||
const onLogoError = () => {
|
const onLogoError = () => {
|
||||||
if (logoUrl.value !== defaultLogo) logoUrl.value = defaultLogo;
|
if (logoUrl.value !== defaultLogo) logoUrl.value = defaultLogo;
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
readLogoUrl();
|
readLogoUrl();
|
||||||
|
readLogoText();
|
||||||
document.addEventListener("yh-appearance-updated", readLogoUrl);
|
document.addEventListener("yh-appearance-updated", readLogoUrl);
|
||||||
|
document.addEventListener("yh-appearance-updated", readLogoText);
|
||||||
|
});
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
document.removeEventListener("yh-appearance-updated", readLogoUrl);
|
||||||
|
document.removeEventListener("yh-appearance-updated", readLogoText);
|
||||||
});
|
});
|
||||||
onBeforeUnmount(() => document.removeEventListener("yh-appearance-updated", readLogoUrl));
|
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
routeChange(route);
|
routeChange(route);
|
||||||
@@ -182,6 +198,7 @@ function linkHomePage() {
|
|||||||
<header class="header-container fix">
|
<header class="header-container fix">
|
||||||
<!-- 云海 logo 徽标(结构与 Cms SchoolLayout 对齐,皮肤见通道 base.layout.css .logo-badge) -->
|
<!-- 云海 logo 徽标(结构与 Cms SchoolLayout 对齐,皮肤见通道 base.layout.css .logo-badge) -->
|
||||||
<span class="logo-badge fl"><img :src="logoUrl" alt="云海" @error="onLogoError" /></span>
|
<span class="logo-badge fl"><img :src="logoUrl" alt="云海" @error="onLogoError" /></span>
|
||||||
|
<span v-if="logoText" class="logo-text">{{ logoText }}</span>
|
||||||
<div class="delimiter fl align-middle"></div>
|
<div class="delimiter fl align-middle"></div>
|
||||||
<h4 class="fl align-middle">{{ appName }}</h4>
|
<h4 class="fl align-middle">{{ appName }}</h4>
|
||||||
<div class="school-bg"></div>
|
<div class="school-bg"></div>
|
||||||
@@ -290,6 +307,13 @@ function linkHomePage() {
|
|||||||
.header-container .logo-badge {
|
.header-container .logo-badge {
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
}
|
}
|
||||||
|
/* LOGO 文字(平台/学校名称):贴徽标右侧,顶栏品牌色深底上白字,禁止换行挤压布局 */
|
||||||
|
.header-container .logo-text {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
/* 面包屑「首页」垂直居中:骨架遗留的 .path-nav .icon-category{position:relative;top:1px}
|
/* 面包屑「首页」垂直居中:骨架遗留的 .path-nav .icon-category{position:relative;top:1px}
|
||||||
是给老 iconfont 字体字形做的基线补偿,换成 ysch mask 的 1em 方块后反而把图标顶偏;
|
是给老 iconfont 字体字形做的基线补偿,换成 ysch mask 的 1em 方块后反而把图标顶偏;
|
||||||
这里用 inline-flex 真居中并关掉该补偿(不动通道产物,覆盖收在本组件内) */
|
这里用 inline-flex 真居中并关掉该补偿(不动通道产物,覆盖收在本组件内) */
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* 本文件由 YschTheme scripts/gen-theme.mjs 从 assets-src/pc/theme-core.js 生成(版本 20261008-2326-f7fb534),勿手改。
|
* 本文件由 YschTheme scripts/gen-theme.mjs 从 assets-src/pc/theme-core.js 生成(版本 20261009-1038-1688389),勿手改。
|
||||||
* 分发方式:YschTheme `npm run sync` 拷进各端 src/utils/theme.ts(与 ThemeSwitcher.vue 配套,MD5 对齐报告)。
|
* 分发方式:YschTheme `npm run sync` 拷进各端 src/utils/theme.ts(与 ThemeSwitcher.vue 配套,MD5 对齐报告)。
|
||||||
* 运行时档位类名由 /static/js/yh-theme-init.js 在 <head> 内先行挂好,本模块只负责读写与切换。
|
* 运行时档位类名由 /static/js/yh-theme-init.js 在 <head> 内先行挂好,本模块只负责读写与切换。
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user