2026-04-28 11:33:17 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<a-layout style="min-height: 100vh">
|
|
|
|
|
|
<a-layout-sider v-model:collapsed="collapsed" collapsible breakpoint="lg" :trigger="null">
|
|
|
|
|
|
<div class="ops-brand">
|
|
|
|
|
|
<span v-if="!collapsed">省心推 · 运营</span>
|
|
|
|
|
|
<span v-else>SXT</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<a-menu
|
|
|
|
|
|
theme="light"
|
|
|
|
|
|
mode="inline"
|
|
|
|
|
|
:selected-keys="selectedKeys"
|
2026-04-29 00:02:46 +08:00
|
|
|
|
:open-keys="openKeys"
|
2026-04-28 11:33:17 +08:00
|
|
|
|
:items="menuItems"
|
2026-04-29 00:02:46 +08:00
|
|
|
|
@update:open-keys="onOpenKeysChange"
|
2026-04-28 11:33:17 +08:00
|
|
|
|
@click="onMenuClick"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</a-layout-sider>
|
|
|
|
|
|
|
|
|
|
|
|
<a-layout>
|
|
|
|
|
|
<a-layout-header class="ops-header">
|
|
|
|
|
|
<a-button type="text" class="header-trigger" @click="collapsed = !collapsed">
|
2026-05-01 20:39:09 +08:00
|
|
|
|
{{ collapsed ? '›' : '‹' }}
|
2026-04-28 11:33:17 +08:00
|
|
|
|
</a-button>
|
|
|
|
|
|
<span style="flex: 1" />
|
|
|
|
|
|
<a-dropdown placement="bottomRight">
|
2026-05-01 20:39:09 +08:00
|
|
|
|
<div class="user-dropdown-btn" style="cursor: pointer">
|
2026-04-28 11:33:17 +08:00
|
|
|
|
<div class="user-avatar">
|
2026-05-01 20:39:09 +08:00
|
|
|
|
{{ auth.operator?.display_name?.charAt(0) ?? 'U' }}
|
2026-04-28 11:33:17 +08:00
|
|
|
|
</div>
|
2026-05-01 20:39:09 +08:00
|
|
|
|
<span>{{ auth.operator?.display_name ?? '未登录' }}</span>
|
2026-04-28 11:33:17 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<template #overlay>
|
|
|
|
|
|
<a-menu @click="onUserMenuClick">
|
|
|
|
|
|
<a-menu-item key="profile">个人资料</a-menu-item>
|
|
|
|
|
|
<a-menu-item key="logout">退出登录</a-menu-item>
|
|
|
|
|
|
</a-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
|
</a-layout-header>
|
|
|
|
|
|
|
|
|
|
|
|
<a-layout-content class="ops-shell-content">
|
|
|
|
|
|
<router-view />
|
|
|
|
|
|
</a-layout-content>
|
|
|
|
|
|
</a-layout>
|
|
|
|
|
|
</a-layout>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-04-29 00:02:46 +08:00
|
|
|
|
import {
|
|
|
|
|
|
AuditOutlined,
|
2026-05-05 20:48:14 +08:00
|
|
|
|
BookOutlined,
|
2026-05-20 10:46:49 +08:00
|
|
|
|
ClockCircleOutlined,
|
2026-05-25 19:23:49 +08:00
|
|
|
|
CloudDownloadOutlined,
|
2026-05-05 20:48:14 +08:00
|
|
|
|
ControlOutlined,
|
2026-04-29 22:07:41 +08:00
|
|
|
|
CrownOutlined,
|
2026-05-26 01:19:01 +08:00
|
|
|
|
DatabaseOutlined,
|
2026-05-05 20:48:14 +08:00
|
|
|
|
FileSearchOutlined,
|
2026-04-29 17:10:17 +08:00
|
|
|
|
GlobalOutlined,
|
2026-05-05 20:48:14 +08:00
|
|
|
|
LineChartOutlined,
|
2026-05-25 19:23:49 +08:00
|
|
|
|
PartitionOutlined,
|
2026-04-29 00:02:46 +08:00
|
|
|
|
SafetyCertificateOutlined,
|
|
|
|
|
|
SettingOutlined,
|
|
|
|
|
|
TeamOutlined,
|
2026-05-05 20:48:14 +08:00
|
|
|
|
UserSwitchOutlined,
|
2026-05-01 20:39:09 +08:00
|
|
|
|
} from '@ant-design/icons-vue'
|
|
|
|
|
|
import type { ItemType } from 'ant-design-vue'
|
|
|
|
|
|
import { computed, h, onMounted, ref } from 'vue'
|
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
2026-04-28 11:33:17 +08:00
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
|
import { useAuthStore } from '@/stores/auth'
|
2026-04-28 11:33:17 +08:00
|
|
|
|
|
2026-04-29 00:02:46 +08:00
|
|
|
|
interface MenuLeaf {
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: string
|
|
|
|
|
|
label: string
|
|
|
|
|
|
path: string
|
2026-04-28 11:33:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
const auth = useAuthStore()
|
2026-04-28 11:33:17 +08:00
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
|
const collapsed = ref(false)
|
2026-04-28 11:33:17 +08:00
|
|
|
|
|
2026-04-29 00:02:46 +08:00
|
|
|
|
const menuLeaves: MenuLeaf[] = [
|
2026-05-01 20:39:09 +08:00
|
|
|
|
{ key: '/admin-users', label: '用户管理', path: '/admin-users' },
|
|
|
|
|
|
{ key: '/kol-subscriptions', label: '订阅包审批', path: '/kol-subscriptions' },
|
|
|
|
|
|
{ key: '/site-domain-mappings', label: '站点映射', path: '/site-domain-mappings' },
|
2026-05-26 01:19:01 +08:00
|
|
|
|
{ key: '/object-storage', label: '对象存储', path: '/object-storage' },
|
2026-05-25 19:23:49 +08:00
|
|
|
|
{ key: '/desktop-client/releases', label: '客户端版本', path: '/desktop-client/releases' },
|
2026-05-05 20:48:14 +08:00
|
|
|
|
{ key: '/compliance/policy', label: '全局策略', path: '/compliance/policy' },
|
|
|
|
|
|
{ key: '/compliance/dictionaries', label: '合规词库', path: '/compliance/dictionaries' },
|
|
|
|
|
|
{ key: '/compliance/manual-reviews', label: '人工审阅', path: '/compliance/manual-reviews' },
|
|
|
|
|
|
{ key: '/compliance/records', label: '检测记录', path: '/compliance/records' },
|
|
|
|
|
|
{ key: '/compliance/stats', label: '合规统计', path: '/compliance/stats' },
|
2026-05-01 20:39:09 +08:00
|
|
|
|
{ key: '/accounts', label: '操作员管理', path: '/accounts' },
|
2026-05-06 12:56:39 +08:00
|
|
|
|
{ key: '/jobs', label: '任务中心', path: '/jobs' },
|
2026-05-20 10:46:49 +08:00
|
|
|
|
{ key: '/scheduler', label: '调度中心', path: '/scheduler' },
|
2026-05-01 20:39:09 +08:00
|
|
|
|
{ key: '/audits', label: '审计日志', path: '/audits' },
|
|
|
|
|
|
]
|
2026-04-29 00:02:46 +08:00
|
|
|
|
|
|
|
|
|
|
const menuItems = computed<ItemType[]>(() => [
|
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: '/admin-users',
|
|
|
|
|
|
label: '用户管理',
|
2026-04-29 00:02:46 +08:00
|
|
|
|
icon: () => h(TeamOutlined),
|
|
|
|
|
|
},
|
2026-04-29 22:07:41 +08:00
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: '/kol-subscriptions',
|
|
|
|
|
|
label: '订阅包审批',
|
2026-04-29 22:07:41 +08:00
|
|
|
|
icon: () => h(CrownOutlined),
|
|
|
|
|
|
},
|
2026-04-29 17:10:17 +08:00
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: '/site-domain-mappings',
|
|
|
|
|
|
label: '站点映射',
|
2026-04-29 17:10:17 +08:00
|
|
|
|
icon: () => h(GlobalOutlined),
|
|
|
|
|
|
},
|
2026-05-26 01:19:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
key: '/object-storage',
|
|
|
|
|
|
label: '对象存储',
|
|
|
|
|
|
icon: () => h(DatabaseOutlined),
|
|
|
|
|
|
},
|
2026-05-25 19:23:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
key: '/desktop-client/releases',
|
|
|
|
|
|
label: '客户端版本',
|
|
|
|
|
|
icon: () => h(CloudDownloadOutlined),
|
|
|
|
|
|
},
|
2026-05-05 20:48:14 +08:00
|
|
|
|
{
|
|
|
|
|
|
key: 'compliance',
|
|
|
|
|
|
label: '内容安全',
|
|
|
|
|
|
icon: () => h(SafetyCertificateOutlined),
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
key: '/compliance/policy',
|
|
|
|
|
|
label: '全局策略',
|
|
|
|
|
|
icon: () => h(ControlOutlined),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: '/compliance/dictionaries',
|
|
|
|
|
|
label: '合规词库',
|
|
|
|
|
|
icon: () => h(BookOutlined),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: '/compliance/manual-reviews',
|
|
|
|
|
|
label: '人工审阅',
|
|
|
|
|
|
icon: () => h(UserSwitchOutlined),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: '/compliance/records',
|
|
|
|
|
|
label: '检测记录',
|
|
|
|
|
|
icon: () => h(FileSearchOutlined),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: '/compliance/stats',
|
|
|
|
|
|
label: '合规统计',
|
|
|
|
|
|
icon: () => h(LineChartOutlined),
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2026-04-29 00:02:46 +08:00
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: 'system',
|
|
|
|
|
|
label: '系统设置',
|
2026-04-29 00:02:46 +08:00
|
|
|
|
icon: () => h(SettingOutlined),
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: '/accounts',
|
|
|
|
|
|
label: '操作员管理',
|
2026-04-29 00:02:46 +08:00
|
|
|
|
icon: () => h(SafetyCertificateOutlined),
|
|
|
|
|
|
},
|
2026-05-06 12:56:39 +08:00
|
|
|
|
{
|
|
|
|
|
|
key: '/jobs',
|
|
|
|
|
|
label: '任务中心',
|
|
|
|
|
|
icon: () => h(PartitionOutlined),
|
|
|
|
|
|
},
|
2026-05-20 10:46:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
key: '/scheduler',
|
|
|
|
|
|
label: '调度中心',
|
|
|
|
|
|
icon: () => h(ClockCircleOutlined),
|
|
|
|
|
|
},
|
2026-04-29 00:02:46 +08:00
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
|
key: '/audits',
|
|
|
|
|
|
label: '审计日志',
|
2026-04-29 00:02:46 +08:00
|
|
|
|
icon: () => h(AuditOutlined),
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2026-05-01 20:39:09 +08:00
|
|
|
|
])
|
2026-04-28 11:33:17 +08:00
|
|
|
|
|
2026-05-05 20:48:14 +08:00
|
|
|
|
const openKeys = ref<string[]>(['compliance', 'system'])
|
2026-04-29 00:02:46 +08:00
|
|
|
|
|
|
|
|
|
|
function onOpenKeysChange(keys: string[]) {
|
2026-05-01 20:39:09 +08:00
|
|
|
|
openKeys.value = keys
|
2026-04-29 00:02:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
|
const selectedKeys = computed(() => [route.path])
|
2026-04-28 11:33:17 +08:00
|
|
|
|
|
|
|
|
|
|
function onMenuClick(info: { key: string | number }) {
|
2026-05-01 20:39:09 +08:00
|
|
|
|
const item = menuLeaves.find((m) => m.key === info.key)
|
|
|
|
|
|
if (item) void router.push(item.path)
|
2026-04-28 11:33:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onUserMenuClick(info: { key: string | number }) {
|
2026-05-01 20:39:09 +08:00
|
|
|
|
if (info.key === 'logout') {
|
|
|
|
|
|
auth.logout()
|
|
|
|
|
|
void router.replace({ name: 'login' })
|
|
|
|
|
|
} else if (info.key === 'profile') {
|
|
|
|
|
|
void router.push({ name: 'profile' })
|
2026-04-28 11:33:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
if (auth.isAuthenticated) {
|
2026-05-01 20:39:09 +08:00
|
|
|
|
void auth.refreshSelf()
|
2026-04-28 11:33:17 +08:00
|
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
|
})
|
2026-04-28 11:33:17 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
:deep(.ant-layout-sider) {
|
|
|
|
|
|
background: #fff !important;
|
|
|
|
|
|
border-right: 1px solid #f0f0f0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ops-brand {
|
|
|
|
|
|
height: 40px;
|
2026-04-29 15:59:23 +08:00
|
|
|
|
background: #eef2ff;
|
|
|
|
|
|
border: 1px solid #c7d2fe;
|
2026-04-28 11:33:17 +08:00
|
|
|
|
margin: 16px;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-04-29 15:59:23 +08:00
|
|
|
|
color: #4f46e5;
|
2026-04-28 11:33:17 +08:00
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
letter-spacing: 0.05em;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ops-header {
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
padding: 0 24px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
height: 64px;
|
|
|
|
|
|
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-trigger {
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
color: #8c8c8c;
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-trigger:hover {
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
color: #141414;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.user-dropdown-btn {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
color: #141414;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.user-dropdown-btn:hover {
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.user-avatar {
|
2026-04-29 15:59:23 +08:00
|
|
|
|
background-color: #4f46e5;
|
2026-04-28 11:33:17 +08:00
|
|
|
|
color: #fff;
|
|
|
|
|
|
width: 28px;
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|