fix: Dashboard骨架屏模板修复
- 重写Dashboard模板结构(v-if/v-else格式正确) - 添加加载骨架屏 - 添加robots.txt
This commit is contained in:
@@ -6,80 +6,80 @@
|
||||
<el-skeleton style="margin-top:24px" :rows="6" animated />
|
||||
</div>
|
||||
<template v-else>
|
||||
<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>
|
||||
<span class="label">网址总数</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="6">
|
||||
<el-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num">{{ stats.catCount }}</span>
|
||||
<span class="label">分类数</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="6">
|
||||
<el-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num">{{ stats.totalViews }}</span>
|
||||
<span class="label">总访问</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="6">
|
||||
<el-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num" style="font-size:20px">{{ settings.site_name || '言逍导航' }}</span>
|
||||
<span class="label">站点名称</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-card style="margin-top:24px">
|
||||
<template #header><span>快捷操作</span></template>
|
||||
<el-row :gutter="[16, 16]">
|
||||
<el-row :gutter="[16, 16]" class="stat-cards">
|
||||
<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-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num">{{ stats.linkCount }}</span>
|
||||
<span class="label">网址总数</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<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-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num">{{ stats.catCount }}</span>
|
||||
<span class="label">分类数</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<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-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num">{{ stats.totalViews }}</span>
|
||||
<span class="label">总访问</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="6">
|
||||
<el-button class="action-btn" @click="() => window.open('/', '_blank')">
|
||||
<el-icon><View /></el-icon> 预览前台
|
||||
</el-button>
|
||||
<el-card shadow="hover">
|
||||
<div class="stat-item">
|
||||
<span class="num" style="font-size:20px">{{ settings.site_name || '言逍导航' }}</span>
|
||||
<span class="label">站点名称</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top:24px">
|
||||
<template #header><span>分类概览</span></template>
|
||||
<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>
|
||||
</div>
|
||||
<el-card style="margin-top:24px">
|
||||
<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 :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 :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 :xs="12" :sm="6">
|
||||
<el-button class="action-btn" @click="() => window.open('/', '_blank')">
|
||||
<el-icon><View /></el-icon> 预览前台
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top:24px">
|
||||
<template #header><span>分类概览</span></template>
|
||||
<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>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
@@ -112,10 +112,9 @@ 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; }
|
||||
.action-btn {
|
||||
width: 100%;
|
||||
}
|
||||
.action-btn { width: 100%; }
|
||||
.table-wrap { overflow-x: auto; }
|
||||
.dashboard-loading { padding: 20px; }
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.stat-item .num { font-size: 28px; }
|
||||
|
||||
Reference in New Issue
Block a user