feat(msgcenter,settings): 留白对齐与左侧图标规范化——/msg、/settings 壳层 padding 15px、msg-side 216px、sys pane :deep 抹平、LeftMenu 移除硬编码入口、菜单图标 fill 化
This commit is contained in:
@@ -5,14 +5,13 @@
|
||||
<SvgIcon name="menu-operate" color="#ececec" />
|
||||
</li>
|
||||
<template v-for="(item, index) in menuList" :key="index">
|
||||
<!-- 硬编码补位的「设置」一级入口上方的分隔线(业务入口 vs 系统入口分层) -->
|
||||
<li v-if="item.sep" class="menu-sep" aria-hidden="true"></li>
|
||||
<li
|
||||
v-wave="myWave"
|
||||
@click="linkPage(item, index)"
|
||||
:class="{ active: index == activeIndex, 'first-bottom': index == menuFirstBottomIndex }"
|
||||
>
|
||||
<a :title="item.name">
|
||||
<!-- 图标走后台上传的 svg(菜单 icon 字段),保留本地 sprite 兜底能力 -->
|
||||
<SvgIcon v-if="item.localIcon" :name="item.localIcon" size="24"
|
||||
:color="index == activeIndex ? '#fff' : '#ececec'" />
|
||||
<FetchSvg v-else size="24" :src="$conf.serviceHost + item.icon"
|
||||
@@ -66,26 +65,11 @@ const route = useRoute(),
|
||||
|
||||
const store = useDefaultStore();
|
||||
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[]>(() => {
|
||||
let 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);
|
||||
// 「设置」一级入口走前台硬编码补位(路径 A,不动后端菜单表);
|
||||
// 若后台菜单表已配置同 url 的项则不重复追加,避免双入口
|
||||
if (!store.curUserMenuList.some(x => x.url === "/settings")) {
|
||||
bottomArr = [...bottomArr, SETTINGS_MENU_ITEM];
|
||||
}
|
||||
const topArr = 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);
|
||||
return [...topArr, ...bottomArr];
|
||||
});
|
||||
|
||||
@@ -216,14 +200,6 @@ async function linkPage(item: any, index: number) {
|
||||
bottom: 8px;
|
||||
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 {
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user