feat: 全站移动端适配

- AdminLayout: 移动端侧边栏抽屉式折叠(汉堡菜单+遮罩)
- Dashboard: 统计卡片/快捷操作响应式布局(2列→1列)
- Links: 筛选条件垂直堆叠,表格横向滚动,弹窗自适应宽度
- Categories: 表格横向滚动,弹窗自适应
- Settings: 表单标签响应式(小屏换行)
- Login: 登录卡片自适应边距
- Home: 搜索框全宽,网址卡片缩窄,导航描述隐藏
This commit is contained in:
Agent
2026-07-14 20:55:45 +08:00
parent 6598ce103e
commit 10bddda9ef
7 changed files with 254 additions and 86 deletions
+32 -24
View File
@@ -1,7 +1,7 @@
<template>
<div class="dashboard">
<el-row :gutter="20" class="stat-cards">
<el-col :span="6">
<el-row :gutter="[16, 16]" class="stat-cards">
<el-col :xs="12" :sm="6">
<el-card shadow="hover">
<div class="stat-item">
<span class="num">{{ stats.linkCount }}</span>
@@ -9,7 +9,7 @@
</div>
</el-card>
</el-col>
<el-col :span="6">
<el-col :xs="12" :sm="6">
<el-card shadow="hover">
<div class="stat-item">
<span class="num">{{ stats.catCount }}</span>
@@ -17,7 +17,7 @@
</div>
</el-card>
</el-col>
<el-col :span="6">
<el-col :xs="12" :sm="6">
<el-card shadow="hover">
<div class="stat-item">
<span class="num">{{ stats.totalViews }}</span>
@@ -25,10 +25,10 @@
</div>
</el-card>
</el-col>
<el-col :span="6">
<el-col :xs="12" :sm="6">
<el-card shadow="hover">
<div class="stat-item">
<span class="num">{{ settings.site_name }}</span>
<span class="num" style="font-size:20px">{{ settings.site_name || '言逍导航' }}</span>
<span class="label">站点名称</span>
</div>
</el-card>
@@ -36,27 +36,25 @@
</el-row>
<el-card style="margin-top:24px">
<template #header>
<span>快捷操作</span>
</template>
<el-row :gutter="20">
<el-col :span="6">
<el-button type="primary" block @click="$router.push('/admin/links')">
<template #header><span>快捷操作</span></template>
<el-row :gutter="[16, 16]">
<el-col :xs="12" :sm="6">
<el-button type="primary" class="action-btn" @click="$router.push('/admin/links')">
<el-icon><Plus /></el-icon> 管理网址
</el-button>
</el-col>
<el-col :span="6">
<el-button type="success" block @click="$router.push('/admin/categories')">
<el-col :xs="12" :sm="6">
<el-button type="success" class="action-btn" @click="$router.push('/admin/categories')">
<el-icon><FolderAdd /></el-icon> 管理分类
</el-button>
</el-col>
<el-col :span="6">
<el-button type="warning" block @click="$router.push('/admin/settings')">
<el-col :xs="12" :sm="6">
<el-button type="warning" class="action-btn" @click="$router.push('/admin/settings')">
<el-icon><Setting /></el-icon> 站点配置
</el-button>
</el-col>
<el-col :span="6">
<el-button block @click="() => window.open('/', '_blank')">
<el-col :xs="12" :sm="6">
<el-button class="action-btn" @click="() => window.open('/', '_blank')">
<el-icon><View /></el-icon> 预览前台
</el-button>
</el-col>
@@ -65,11 +63,13 @@
<el-card style="margin-top:24px">
<template #header><span>分类概览</span></template>
<el-table :data="categories" style="width:100%">
<el-table-column prop="name" label="分类" />
<el-table-column prop="linkCount" label="网址数" width="100" />
<el-table-column prop="icon" label="图标" width="80" />
</el-table>
<div class="table-wrap">
<el-table :data="categories" style="width:100%">
<el-table-column prop="name" label="分类" />
<el-table-column prop="linkCount" label="网址数" width="100" />
<el-table-column prop="icon" label="图标" width="80" />
</el-table>
</div>
</el-card>
</div>
</template>
@@ -103,4 +103,12 @@ onMounted(async () => {
.stat-item { text-align: center; }
.stat-item .num { display: block; font-size: 36px; font-weight: 700; color: #6366f1; margin-bottom: 8px; }
.stat-item .label { color: #888; font-size: 14px; }
</style>
.action-btn {
width: 100%;
}
.table-wrap { overflow-x: auto; }
@media (max-width: 767px) {
.stat-item .num { font-size: 28px; }
}
</style>