完成菜单权限添加和软件菜单改造

This commit is contained in:
super
2026-04-12 17:15:15 +08:00
parent 7589b4e418
commit e53eaf738e
17 changed files with 814 additions and 297 deletions

View File

@@ -5,22 +5,33 @@
<a href="/home" class="btn-home">返回首页</a>
</div>
<nav class="nav-tabs">
<div class="nav-tab-group">
<div v-for="group in navGroups" :key="group.label" class="nav-dropdown"
:class="{ active: group.items.some(item => item.key === active) }">
<button type="button" class="nav-dropdown-trigger">
<span>{{ group.label }}</span>
<span class="nav-dropdown-arrow"></span>
</button>
<div class="nav-dropdown-menu">
<a v-for="item in group.items" :key="item.key" :href="item.href" class="nav-dropdown-item"
:class="{ active: active === item.key }">
<nav class="nav-sections" aria-label="顶部功能导航">
<section
v-for="group in navGroups"
:key="group.label"
class="nav-section"
>
<div class="nav-section-title">{{ group.label }}</div>
<div class="nav-section-items">
<template v-for="item in group.items" :key="item.key">
<a
v-if="item.href"
:href="item.href"
class="nav-item"
:class="{ active: active === item.key }"
>
{{ item.label }}
</a>
</div>
<span
v-else
class="nav-item disabled"
:class="{ active: active === item.key }"
>
{{ item.label }}
</span>
</template>
</div>
</div>
</section>
</nav>
<div class="top-right"></div>
@@ -28,16 +39,33 @@
</template>
<script setup lang="ts">
type ActiveNavKey =
| 'brand'
| 'dedupe'
| 'convert'
| 'split'
| 'delete-brand'
| 'product-risk'
| 'shop-match'
type NavItem = {
key: string
label: string
href?: string
}
const props = defineProps<{
active: 'brand' | 'dedupe' | 'convert' | 'split' | 'delete-brand' | 'product-risk' | 'shop-match'
active: ActiveNavKey
}>()
const active = props.active
const navGroups = [
const navGroups: ReadonlyArray<{ label: string; items: ReadonlyArray<NavItem> }> = [
{
label: '前端工具',
items: [
{ key: 'collect', label: '采集数据' },
{ key: 'variant', label: '变体分析' },
{ key: 'brand', label: '品牌检测', href: '/brand' },
{ key: 'dedupe', label: '数据去重', href: '/new_web_source/dedupe.html' },
{ key: 'split', label: '数据拆分', href: '/new_web_source/split.html' },
@@ -47,22 +75,33 @@ const navGroups = [
{
label: '运营工具',
items: [
{ key: 'delete-brand', label: '删除指定ASIN和品牌', href: '/new_web_source/delete-brand.html' },
{ key: 'delete-brand', label: '删除ASIN', href: '/new_web_source/delete-brand.html' },
{ key: 'product-risk', label: '商品风险解决', href: '/new_web_source/product-risk.html' },
{ key: 'shop-match', label: '定时跟价匹配', href: '/new_web_source/shop-match.html' },
{ key: 'shop-match', label: '定时匹配', href: '/new_web_source/shop-match.html' },
{ key: 'pricing', label: '跟价' },
{ key: 'patrol-delete', label: '巡店删除' },
{ key: 'withdraw', label: '取款' },
{ key: 'shop-status', label: '店铺状态查询' },
],
},
] as const
{
label: '后勤工具',
items: [
{ key: 'purchase', label: '采购' },
{ key: 'erp', label: 'ERP' },
],
},
]
</script>
<style scoped>
.top-bar {
height: 56px;
min-height: 88px;
display: flex;
align-items: center;
align-items: flex-start;
justify-content: space-between;
gap: 24px;
padding: 0 20px;
gap: 20px;
padding: 10px 24px 12px;
background: #111;
border-bottom: 1px solid #2a2a2a;
}
@@ -72,12 +111,14 @@ const navGroups = [
align-items: center;
gap: 16px;
min-width: 0;
padding-top: 10px;
}
.app-name {
color: #fff;
font-size: 16px;
font-weight: 700;
font-size: 18px;
font-weight: 800;
letter-spacing: 0.02em;
white-space: nowrap;
}
@@ -92,129 +133,107 @@ const navGroups = [
color: #fff;
}
.nav-tabs {
.nav-sections {
flex: 1;
display: flex;
justify-content: center;
min-width: 0;
}
.nav-tab-group {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
align-items: stretch;
justify-content: center;
gap: 0;
}
.nav-dropdown {
.nav-section {
flex: 1;
min-width: 0;
padding: 0 18px;
position: relative;
}
.nav-dropdown-trigger {
.nav-section + .nav-section::before {
content: '';
position: absolute;
left: 0;
top: 14px;
bottom: 8px;
width: 1px;
background: rgba(255, 255, 255, 0.14);
}
.nav-section-title {
margin-bottom: 10px;
text-align: center;
color: #e8dfcf;
font-size: 16px;
font-weight: 800;
letter-spacing: 0.08em;
}
.nav-section-items {
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: center;
padding: 10px 14px;
border-radius: 14px;
background: linear-gradient(180deg, rgba(83, 74, 67, 0.92) 0%, rgba(72, 65, 59, 0.96) 100%);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav-item {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-width: 112px;
height: 38px;
padding: 0 16px;
border-radius: 10px;
border: 1px solid transparent;
color: #8d8d8d;
background: transparent;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown.active .nav-dropdown-trigger {
color: #b9d6ff;
background: rgba(77, 126, 189, 0.14);
}
.nav-dropdown.active .nav-dropdown-trigger {
background: rgba(77, 126, 189, 0.24);
border-color: rgba(91, 148, 219, 0.35);
color: #6caeff;
}
.nav-dropdown-arrow {
font-size: 11px;
line-height: 1;
}
.nav-dropdown-menu {
position: absolute;
top: 100%;
left: 0;
min-width: 220px;
padding: 8px;
border: 1px solid #2a2a2a;
border-radius: 12px;
background: #171717;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
display: none;
z-index: 20;
}
.nav-dropdown:hover .nav-dropdown-menu {
display: flex;
flex-direction: column;
gap: 4px;
}
.nav-dropdown-item {
display: flex;
align-items: center;
min-height: 38px;
padding: 0 12px;
border-radius: 8px;
color: #b8b8b8;
font-size: 13px;
font-weight: 600;
min-height: 28px;
padding: 0 2px;
color: #f3eee4;
font-size: 14px;
font-weight: 700;
text-decoration: none;
transition: all 0.2s ease;
border-bottom: 2px solid transparent;
transition: color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.nav-dropdown-item:hover {
color: #e8f2ff;
background: rgba(77, 126, 189, 0.14);
.nav-item:hover {
color: #fff;
border-bottom-color: rgba(255, 255, 255, 0.68);
}
.nav-dropdown-item.active {
color: #6caeff;
background: rgba(77, 126, 189, 0.24);
.nav-item.active {
color: #fff;
border-bottom-color: #8dc4ff;
}
.nav-item.disabled {
color: rgba(255, 255, 255, 0.78);
opacity: 0.82;
cursor: default;
}
.top-right {
width: 120px;
width: 60px;
flex-shrink: 0;
}
@media (max-width: 1100px) {
@media (max-width: 1200px) {
.top-bar {
height: auto;
align-items: flex-start;
flex-direction: column;
padding: 16px 20px;
align-items: stretch;
}
.nav-tabs {
width: 100%;
justify-content: flex-start;
.logo-area {
padding-top: 0;
}
.nav-tab-group {
width: 100%;
justify-content: flex-start;
.nav-sections {
flex-direction: column;
}
.nav-dropdown-menu {
left: 0;
right: auto;
.nav-section {
padding: 0;
}
.nav-section + .nav-section::before {
display: none;
}
.top-right {