feat(msgcenter,settings): 留白对齐与左侧图标规范化——/msg、/settings 壳层 padding 15px、msg-side 216px、sys pane :deep 抹平、LeftMenu 移除硬编码入口、菜单图标 fill 化

This commit is contained in:
chenxing
2026-09-30 12:18:57 +08:00
parent c3fbfeefa8
commit e91ce14408
6 changed files with 24 additions and 36 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ async function loadUserMenuBarList() {
} else { } else {
findIndex = menuList.findIndex(x => x.url === route.path); findIndex = menuList.findIndex(x => x.url === route.path);
} }
// /msg、/settings 是前台硬编码路由(不在后台菜单表里),直达/刷新不应被弹回桌面 // /msg、/settings 由后台「边栏设置」配置后即进入菜单表;未配置时也允许直达/刷新,不被弹回桌面
if (findIndex === -1 && !["/msg", "/settings"].includes(route.path)) router.push({ name: "index" }); if (findIndex === -1 && !["/msg", "/settings"].includes(route.path)) router.push({ name: "index" });
} }
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" fill-rule="evenodd"><path d="M801.4 393.1 798.6 313.1 794.7 286.7 788.0 259.2 778.1 231.1 765.2 204.2 751.5 181.3 735.6 159.9 715.6 137.7 693.5 117.7 672.0 101.9 649.1 88.1 622.2 75.3 594.1 65.3 568.2 58.9 541.8 54.9 512.0 53.3 482.2 54.9 455.8 58.9 429.9 65.3 401.8 75.3 374.9 88.1 352.0 101.9 329.3 118.7 308.4 137.7 290.4 157.4 271.7 182.7 258.0 205.6 245.9 231.1 236.4 257.7 229.3 286.7 225.3 314.7 222.6 393.1 218.7 440.0 212.7 482.2 200.5 537.1 190.8 568.5 180.3 595.9 169.4 619.5 158.4 639.7 147.8 656.5 133.1 675.9 121.1 689.0 104.4 703.7 99.3 711.2 96.9 717.9 96.0 725.1 96.8 732.3 99.9 740.7 104.1 746.6 110.9 752.4 119.1 756.1 128.0 757.3 896.0 757.3 903.2 756.5 911.5 753.3 917.4 749.1 921.1 745.2 926.3 735.7 927.8 728.7 927.9 723.3 925.4 712.8 919.6 703.7 902.9 689.0 890.9 675.9 876.2 656.5 865.6 639.7 854.6 619.5 843.7 595.9 833.2 568.5 823.5 537.1 811.3 482.2 805.3 440.0 801.4 393.1Z M200.3 693.0 219.8 661.1 233.2 634.5 251.1 589.9 262.0 554.5 271.5 515.0 275.6 493.7 282.2 447.7 286.5 396.2 289.1 319.4 292.3 297.6 297.7 276.3 305.1 255.6 314.5 235.8 325.8 216.9 338.9 199.3 353.6 183.0 369.9 168.2 387.6 155.1 406.4 143.8 426.3 134.4 447.0 127.0 468.3 121.7 490.0 118.5 512.0 117.4 534.0 118.5 555.7 121.7 577.0 127.0 597.7 134.4 617.6 143.8 636.4 155.1 654.1 168.2 670.4 183.0 685.1 199.3 698.2 216.9 709.5 235.8 718.9 255.6 726.3 276.3 731.7 297.6 734.9 319.4 737.5 396.2 741.8 447.7 748.2 492.7 756.8 534.3 767.3 572.7 784.9 621.2 803.7 660.2 823.9 693.3 200.3 693.0Z M553.4 884.6 543.6 894.0 531.8 900.5 518.8 903.9 505.2 903.9 492.2 900.5 483.2 895.9 475.2 889.6 464.3 877.2 457.0 872.0 448.6 869.1 437.8 868.8 430.9 870.7 426.1 873.0 421.7 876.2 416.8 881.4 414.0 886.0 411.4 892.7 410.6 898.0 410.8 905.1 412.0 910.4 415.0 916.9 425.1 929.9 437.3 941.5 455.8 954.0 474.4 962.2 490.8 966.4 511.0 968.4 527.9 967.3 540.5 964.9 554.7 960.3 568.2 954.0 580.8 946.1 592.3 936.6 602.4 925.8 611.2 913.7 615.0 905.6 616.4 898.6 616.4 893.2 615.5 887.9 612.9 881.2 608.9 875.3 605.1 871.5 600.7 868.4 594.2 865.5 583.6 864.0 578.2 864.6 571.4 866.8 562.5 872.8 553.4 884.6Z" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 5.1 KiB

+4 -28
View File
@@ -5,14 +5,13 @@
<SvgIcon name="menu-operate" color="#ececec" /> <SvgIcon name="menu-operate" color="#ececec" />
</li> </li>
<template v-for="(item, index) in menuList" :key="index"> <template v-for="(item, index) in menuList" :key="index">
<!-- 硬编码补位的「设置」一级入口上方的分隔线(业务入口 vs 系统入口分层) -->
<li v-if="item.sep" class="menu-sep" aria-hidden="true"></li>
<li <li
v-wave="myWave" v-wave="myWave"
@click="linkPage(item, index)" @click="linkPage(item, index)"
:class="{ active: index == activeIndex, 'first-bottom': index == menuFirstBottomIndex }" :class="{ active: index == activeIndex, 'first-bottom': index == menuFirstBottomIndex }"
> >
<a :title="item.name"> <a :title="item.name">
<!-- 图标走后台上传的 svg(菜单 icon 字段),保留本地 sprite 兜底能力 -->
<SvgIcon v-if="item.localIcon" :name="item.localIcon" size="24" <SvgIcon v-if="item.localIcon" :name="item.localIcon" size="24"
:color="index == activeIndex ? '#fff' : '#ececec'" /> :color="index == activeIndex ? '#fff' : '#ececec'" />
<FetchSvg v-else size="24" :src="$conf.serviceHost + item.icon" <FetchSvg v-else size="24" :src="$conf.serviceHost + item.icon"
@@ -66,26 +65,11 @@ const route = useRoute(),
const store = useDefaultStore(); const store = useDefaultStore();
const { menuVisible } = storeToRefs(store); const { menuVisible } = storeToRefs(store);
/** 硬编码的「设置」一级入口:isNative 直走 router.push,图标用本地 svg sprite */
const SETTINGS_MENU_ITEM = {
id: -1,
name: "设置",
url: "/settings",
isNative: true,
isBottom: true,
orderNum: 9999,
localIcon: "menu-settings",
sep: true,
};
/** 一级入口(含「消息」「设置」)统一由后台「边栏设置」配置,图标走 icon 字段上传的 svg */
const menuList = computed<any[]>(() => { const menuList = computed<any[]>(() => {
let topArr = store.curUserMenuList.filter(x => x.isBottom !== true).sort((a, b) => a.orderNum - b.orderNum); const topArr = store.curUserMenuList.filter(x => x.isBottom !== true).sort((a, b) => a.orderNum - b.orderNum);
let bottomArr = store.curUserMenuList.filter(x => x.isBottom === true).sort((a, b) => a.orderNum - b.orderNum); const bottomArr = store.curUserMenuList.filter(x => x.isBottom === true).sort((a, b) => a.orderNum - b.orderNum);
// 「设置」一级入口走前台硬编码补位(路径 A,不动后端菜单表);
// 若后台菜单表已配置同 url 的项则不重复追加,避免双入口
if (!store.curUserMenuList.some(x => x.url === "/settings")) {
bottomArr = [...bottomArr, SETTINGS_MENU_ITEM];
}
return [...topArr, ...bottomArr]; return [...topArr, ...bottomArr];
}); });
@@ -216,14 +200,6 @@ async function linkPage(item: any, index: number) {
bottom: 8px; bottom: 8px;
left: 5px; left: 5px;
} }
li.menu-sep {
width: 36px;
height: 1px;
margin: 6px auto;
padding: 0;
background: rgba(255, 255, 255, 0.22);
pointer-events: none;
}
li:hover { li:hover {
background-color: rgba(255, 255, 255, 0.15); background-color: rgba(255, 255, 255, 0.15);
} }
+11 -2
View File
@@ -424,12 +424,15 @@ function openBackend() {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/* 壳:透明,不平铺白(B 方案),gap 加在两卡的直接父容器上 */ /* 壳:透明,不平铺白(B 方案),gap 加在两卡的直接父容器上。
padding 与 .syssetting-wrap 对齐(15px 四周),overflow:hidden 与 .app-list-wrapper/.stats-wrap 对齐,
避免内容撑出页面级滚动条把右侧留白撑大。 */
.set-shell { .set-shell {
display: flex; display: flex;
gap: 16px; gap: 16px;
height: calc(100% - var(--headerH)); height: calc(100% - var(--headerH));
padding: 0 20px 20px; padding: 15px;
overflow: hidden;
background: transparent; background: transparent;
border: none; border: none;
box-shadow: none; box-shadow: none;
@@ -540,6 +543,12 @@ function openBackend() {
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* 内嵌的 SysSetting 自带 padding:15px,与 .set-shell 的 15px 叠加成 30px,此处抹平。
仅作用于本内嵌场景,独立页 /syssetting 不受影响(该页退役后可删本段) */
:deep(.syssetting-wrap) {
padding: 0;
}
} }
} }
+6 -4
View File
@@ -240,20 +240,22 @@ function fmtTime(min: number) {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/* 壳:透明,不平铺白,壁纸透出(B 方案) */ /* 壳:透明,不平铺白,壁纸透出(B 方案)。
padding 与 .set-shell / .syssetting-wrap 对齐(15px 四周),overflow:hidden 同 .set-shell。 */
.msg-shell { .msg-shell {
display: flex; display: flex;
gap: 16px; /* ★ 两卡间隔 —— 必须加在两卡的直接父容器(本容器)上 */ gap: 16px; /* ★ 两卡间隔 —— 必须加在两卡的直接父容器(本容器)上 */
height: calc(100% - var(--headerH)); height: calc(100% - var(--headerH));
padding: 0 20px 20px; padding: 15px;
overflow: hidden;
background: transparent; background: transparent;
border: none; border: none;
box-shadow: none; box-shadow: none;
} }
/* 左卡:分类 / 应用导航 */ /* 左卡:分类 / 应用导航(宽度与 .set-nav 统一为 216px) */
.msg-side { .msg-side {
width: 224px; width: 216px;
flex-shrink: 0; flex-shrink: 0;
background: #fff; background: #fff;
border-radius: 10px; border-radius: 10px;