feat: 按菜单功能拆分页面 - index.html(主入口+概览)、topics.html、logs.html、users.html
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>宇之然内容创作平台 - 用户管理</title>
|
||||
<link rel="stylesheet" href="/static/element-plus.css?v=20260427" />
|
||||
<script src="/static/element-plus.full.js?v=20260427"></script>
|
||||
<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>
|
||||
</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 src="/static/vue.global.prod.js?v=20260427"></script>
|
||||
<script>
|
||||
const UsersPage = {
|
||||
data() {
|
||||
return {
|
||||
// 用户管理页面的数据...
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算属性...
|
||||
},
|
||||
methods: {
|
||||
// 方法...
|
||||
}
|
||||
}
|
||||
|
||||
Vue.createApp(UsersPage).mount('#app')
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user