169 lines
6.8 KiB
HTML
169 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>宇之然内容创作平台 - 用户管理</title>
|
|
|
|
|
|
<style>
|
|
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
|
|
.sidebar { width: 160px; position: fixed; height: 100vh; left: 0; top: 0; background: #f5f5f5; border-right: 1px solid #e0e0e0; }
|
|
.main-content { margin-left: 160px; width: calc(100vw - 160px); min-height: 100vh; overflow-x: auto; }
|
|
.card { background: white; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); transition: all 0.3s; }
|
|
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
|
|
.status-badge { display: inline-flex; align-items: center; gap: 4px; }
|
|
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
|
|
.status-dot.pending { background: #E6A23C; }
|
|
.status-dot.review { background: #F56C6C; }
|
|
.status-dot.ready { background: #67C23A; }
|
|
.status-dot.published { background: #409EFF; }
|
|
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 9999; }
|
|
aside a { display: block; width: 100%; text-align: left; border: none; background: transparent; border-radius: 8px; margin-bottom: 4px; padding: 8px 16px; color: #4b5563; text-decoration: none; }
|
|
aside a:hover { background-color: #f3f4f6; }
|
|
@media (max-width: 768px) { .sidebar { display: none; } .main-content { margin-left: 0; width: 100vw; } }
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Tailwind CSS -->
|
|
|
|
|
|
<!-- Vue 3 -->
|
|
|
|
|
|
<!-- Element Plus CSS -->
|
|
|
|
|
|
<!-- Element Plus JS -->
|
|
|
|
|
|
|
|
<!-- Tailwind CSS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/tailwindcss@3.4.1/dist/tailwind.min.js"></script>
|
|
|
|
<!-- Vue 3 (先加载) -->
|
|
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.27/dist/vue.global.prod.js"></script>
|
|
|
|
<!-- Element Plus CSS -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-plus@2.4.3/dist/index.css">
|
|
|
|
<!-- Element Plus JS (后加载,依赖 Vue) -->
|
|
<script src="https://cdn.jsdelivr.net/npm/element-plus@2.4.3/dist/index.full.min.js"></script>
|
|
|
|
|
|
<style>
|
|
/* 基础重置 */
|
|
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
|
|
|
|
/* 卡片组件 */
|
|
.card { background: white; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 24px; margin-bottom: 24px; transition: all 0.3s; }
|
|
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
|
|
|
|
/* 侧边栏 */
|
|
.sidebar { width: 160px; position: fixed; height: 100vh; left: 0; top: 0; background: #f5f5f5; border-right: 1px solid #e0e0e0; }
|
|
|
|
/* 主内容区 */
|
|
.main-content { margin-left: 160px; width: calc(100vw - 160px); min-height: 100vh; overflow-x: auto; }
|
|
|
|
/* 统计卡片 */
|
|
.stat-card { text-align: center; padding: 20px; cursor: pointer; transition: transform 0.2s; }
|
|
.stat-card:hover { transform: translateY(-4px); }
|
|
.stat-value { font-size: 2.5rem; font-weight: bold; color: #409EFF; line-height: 1.2; }
|
|
.stat-label { color: #909399; font-size: 0.9rem; margin-top: 8px; }
|
|
|
|
/* 操作按钮组 */
|
|
.action-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
|
|
/* 快速筛选 */
|
|
.quick-filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
|
|
|
|
/* 状态徽章 */
|
|
.status-badge { display: inline-flex; align-items: center; gap: 4px; }
|
|
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
|
|
.status-dot.pending { background: #E6A23C; }
|
|
.status-dot.review { background: #F56C6C; }
|
|
.status-dot.ready { background: #67C23A; }
|
|
.status-dot.published { background: #409EFF; }
|
|
|
|
/* 加载覆盖层 */
|
|
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 9999; }
|
|
|
|
/* 响应式 */
|
|
@media (max-width: 768px) {
|
|
.sidebar { display: none; }
|
|
.main-content { margin-left: 0; width: 100vw; }
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<nav class="bg-gradient-to-r from-blue-600 to-blue-700 text-white shadow-lg">
|
|
<div class="container mx-auto px-6 py-4 flex justify-between items-center">
|
|
<h1 class="text-2xl font-bold nav-title">宇之然内容创作平台 - 用户管理</h1>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="page flex gap-6">
|
|
<aside class="w-40 flex-shrink-0 hidden md:block sidebar">
|
|
<a href="/" class="block px-4 py-2 rounded-lg bg-blue-50 text-blue-600 font-semibold">📊 系统概览</a>
|
|
<a href="/topics.html" class="block px-4 py-2 rounded-lg text-gray-600">📋 选题管理</a>
|
|
<a href="/logs.html" class="block px-4 py-2 rounded-lg text-gray-600">📄 系统日志</a>
|
|
<a href="/users.html" class="block px-4 py-2 rounded-lg text-gray-600">👥 用户管理</a>
|
|
</aside>
|
|
|
|
<main class="flex-1 main-content">
|
|
|
|
<div class="card">
|
|
<h2 class="text-2xl font-bold mb-6 text-gray-800">👥 用户管理</h2>
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h3 class="text-lg font-bold">用户列表</h3>
|
|
<el-button type="primary" @click="openCreateUserModal">+ 新建用户</el-button>
|
|
</div>
|
|
<el-table :data="users" stripe v-loading="loadingUsers">
|
|
<el-table-column prop="id" label="ID" width="70"></el-table-column>
|
|
<el-table-column prop="username" label="用户名"></el-table-column>
|
|
<el-table-column prop="role" label="角色" width="100">
|
|
<template #default="scope">
|
|
<el-tag :type="scope.row.role === 'admin' ? 'danger' : 'info'">{{ scope.row.role }}</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="created_at" label="创建时间" width="180"><template #default="scope">{{ formatDate(scope.row.created_at) }}</template></el-table-column>
|
|
<el-table-column label="操作" width="150">
|
|
<template #default="scope">
|
|
<el-button size="small" type="danger" @click="deleteUser(scope.row.id)" :disabled="scope.row.role === 'admin'">删除</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
|
|
</main>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
const UsersPage = {
|
|
data() {
|
|
return {
|
|
// 用户管理页面的数据...
|
|
}
|
|
},
|
|
computed: {
|
|
// 计算属性...
|
|
},
|
|
methods: {
|
|
// 方法...
|
|
}
|
|
}
|
|
|
|
Vue.createApp(UsersPage).mount('#app')
|
|
</script>
|
|
</body>
|
|
</html> |