141 lines
3.0 KiB
Vue
141 lines
3.0 KiB
Vue
|
|
<template>
|
|||
|
|
<div class="home-page">
|
|||
|
|
<el-card class="home-hero">
|
|||
|
|
<div class="home-hero-inner">
|
|||
|
|
<div class="home-hero-icon">
|
|||
|
|
<el-icon :size="28"><House /></el-icon>
|
|||
|
|
</div>
|
|||
|
|
<div>
|
|||
|
|
<h1 class="home-title">欢迎回来{{ username ? `,${username}` : '' }}</h1>
|
|||
|
|
<p class="home-subtitle">Luxsin CMS · 从左侧菜单或下方快捷入口开始操作</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</el-card>
|
|||
|
|
|
|||
|
|
<div class="home-links">
|
|||
|
|
<el-card
|
|||
|
|
v-for="item in quickLinks"
|
|||
|
|
:key="item.path"
|
|||
|
|
class="home-link-card"
|
|||
|
|
shadow="hover"
|
|||
|
|
@click="go(item.path)"
|
|||
|
|
>
|
|||
|
|
<div class="home-link-inner">
|
|||
|
|
<el-icon class="home-link-icon"><component :is="item.icon" /></el-icon>
|
|||
|
|
<div>
|
|||
|
|
<div class="home-link-title">{{ item.title }}</div>
|
|||
|
|
<div class="home-link-desc">{{ item.desc }}</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</el-card>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script setup>
|
|||
|
|
import { computed } from 'vue'
|
|||
|
|
import { useRouter } from 'vue-router'
|
|||
|
|
import { House, Collection, List, Document, Share } from '@element-plus/icons-vue'
|
|||
|
|
import { getUser } from '@/utils/auth'
|
|||
|
|
|
|||
|
|
defineOptions({ name: 'Home' })
|
|||
|
|
|
|||
|
|
const router = useRouter()
|
|||
|
|
const username = computed(() => getUser()?.username || '')
|
|||
|
|
|
|||
|
|
const quickLinks = [
|
|||
|
|
{ path: '/brand', title: '耳机品牌管理', desc: '维护耳机品牌信息', icon: Collection },
|
|||
|
|
{ path: '/model', title: '耳机型号管理', desc: '维护耳机型号与配置', icon: List },
|
|||
|
|
{ path: '/ota', title: 'OTA 管理', desc: '固件升级包管理', icon: Document },
|
|||
|
|
{ path: '/share-code/log', title: '分享日志', desc: '查看分享码使用记录', icon: Share }
|
|||
|
|
]
|
|||
|
|
|
|||
|
|
function go(path) {
|
|||
|
|
router.push(path)
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<style scoped>
|
|||
|
|
.home-page {
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
gap: 16px;
|
|||
|
|
min-height: 100%;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-hero :deep(.el-card__body) {
|
|||
|
|
padding: 28px 32px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-hero-inner {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 20px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-hero-icon {
|
|||
|
|
width: 56px;
|
|||
|
|
height: 56px;
|
|||
|
|
border-radius: 16px;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
color: #38bdf8;
|
|||
|
|
background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
|
|||
|
|
box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2) inset;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-title {
|
|||
|
|
margin: 0;
|
|||
|
|
font-size: 24px;
|
|||
|
|
font-weight: 700;
|
|||
|
|
color: #e2e8f0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-subtitle {
|
|||
|
|
margin: 8px 0 0;
|
|||
|
|
font-size: 14px;
|
|||
|
|
color: #94a3b8;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-links {
|
|||
|
|
display: grid;
|
|||
|
|
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
|||
|
|
gap: 16px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-link-card {
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-link-card:hover {
|
|||
|
|
transform: translateY(-2px);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-link-inner {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: flex-start;
|
|||
|
|
gap: 14px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-link-icon {
|
|||
|
|
font-size: 22px;
|
|||
|
|
color: #7dd3fc;
|
|||
|
|
margin-top: 2px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-link-title {
|
|||
|
|
font-size: 15px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: #e2e8f0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.home-link-desc {
|
|||
|
|
margin-top: 6px;
|
|||
|
|
font-size: 13px;
|
|||
|
|
color: #94a3b8;
|
|||
|
|
line-height: 1.5;
|
|||
|
|
}
|
|||
|
|
</style>
|