style: 平台管理端改为浅色主题,与企业端配色一致
This commit is contained in:
@@ -68,8 +68,8 @@ export default function PlatformUsers() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold text-white">用户管理</h1>
|
||||
<p className="text-sm text-slate-400 mt-1">共 {total} 个用户</p>
|
||||
<h1 className="text-2xl font-bold text-gray-900">用户管理</h1>
|
||||
<p className="text-sm text-gray-500 mt-1">共 {total} 个用户</p>
|
||||
</div>
|
||||
|
||||
{/* 搜索栏 */}
|
||||
@@ -78,30 +78,30 @@ export default function PlatformUsers() {
|
||||
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500" />
|
||||
<Input
|
||||
placeholder="搜索姓名、手机号..."
|
||||
className="bg-slate-900 border-slate-700 text-white placeholder:text-slate-500 pl-10"
|
||||
className="pl-10"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
onKeyDown={(e) => e.key === 'Enter' && fetchUsers()}
|
||||
/>
|
||||
</div>
|
||||
<Select
|
||||
className="bg-slate-900 border-slate-700 text-white w-40"
|
||||
className="w-40"
|
||||
value={orgFilter}
|
||||
onChange={(e) => setOrgFilter(e.target.value)}
|
||||
>
|
||||
<option value="">全部企业</option>
|
||||
{orgs.map((o) => <option key={o.id} value={o.id}>{o.name}</option>)}
|
||||
</Select>
|
||||
<Button variant="secondary" onClick={fetchUsers} className="bg-slate-800 text-slate-200 border border-slate-700 hover:bg-slate-700">
|
||||
<Button variant="secondary" onClick={fetchUsers}>
|
||||
搜索
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* 表格 */}
|
||||
<div className="bg-slate-900 border border-slate-800 rounded-lg overflow-hidden">
|
||||
<div className="bg-white border border-gray-200 rounded-lg overflow-hidden">
|
||||
<table className="w-full text-sm">
|
||||
<thead>
|
||||
<tr className="border-b border-slate-800 text-slate-400 text-xs">
|
||||
<tr className="border-b border-gray-200 text-gray-500 text-xs">
|
||||
<th className="text-left px-4 py-3 font-medium">姓名</th>
|
||||
<th className="text-left px-4 py-3 font-medium">手机号</th>
|
||||
<th className="text-left px-4 py-3 font-medium">角色</th>
|
||||
@@ -113,25 +113,25 @@ export default function PlatformUsers() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{loading ? (
|
||||
<tr><td colSpan={7} className="text-center py-12 text-slate-400">加载中...</td></tr>
|
||||
<tr><td colSpan={7} className="text-center py-12 text-gray-400">加载中...</td></tr>
|
||||
) : users.length === 0 ? (
|
||||
<tr><td colSpan={7} className="text-center py-12 text-slate-400">暂无数据</td></tr>
|
||||
<tr><td colSpan={7} className="text-center py-12 text-gray-400">暂无数据</td></tr>
|
||||
) : users.map((user) => (
|
||||
<tr key={user.id} className="border-b border-slate-800/50 hover:bg-slate-800/30">
|
||||
<td className="px-4 py-3 text-white font-medium">{user.name}</td>
|
||||
<td className="px-4 py-3 text-slate-300">{user.phone}</td>
|
||||
<tr key={user.id} className="border-b border-gray-100 hover:bg-gray-50">
|
||||
<td className="px-4 py-3 text-gray-900 font-medium">{user.name}</td>
|
||||
<td className="px-4 py-3 text-gray-700">{user.phone}</td>
|
||||
<td className="px-4 py-3">
|
||||
<span className={`px-2 py-0.5 rounded text-xs font-medium ${ROLE_COLORS[user.role] || 'bg-gray-100 text-gray-600'}`}>
|
||||
{ROLE_LABELS[user.role] || user.role}
|
||||
</span>
|
||||
</td>
|
||||
<td className="px-4 py-3 text-slate-300">{user.orgName || '-'}</td>
|
||||
<td className="px-4 py-3 text-gray-700">{user.orgName || '-'}</td>
|
||||
<td className="px-4 py-3">
|
||||
{user.disabled
|
||||
? <span className="text-xs text-red-400">已禁用</span>
|
||||
: <span className="text-xs text-emerald-400">正常</span>}
|
||||
? <span className="text-xs text-red-500">已禁用</span>
|
||||
: <span className="text-xs text-emerald-600">正常</span>}
|
||||
</td>
|
||||
<td className="px-4 py-3 text-slate-400 text-xs">
|
||||
<td className="px-4 py-3 text-gray-400 text-xs">
|
||||
{user.lastLoginAt ? new Date(user.lastLoginAt).toLocaleString('zh-CN') : '从未登录'}
|
||||
</td>
|
||||
<td className="px-4 py-3 text-center">
|
||||
@@ -139,8 +139,8 @@ export default function PlatformUsers() {
|
||||
onClick={() => handleToggle(user)}
|
||||
className={`inline-flex items-center gap-1 px-2 py-1 rounded text-xs transition-colors ${
|
||||
user.disabled
|
||||
? 'text-emerald-400 hover:bg-slate-800'
|
||||
: 'text-red-400 hover:bg-slate-800'
|
||||
? 'text-emerald-600 hover:bg-gray-100'
|
||||
: 'text-red-500 hover:bg-gray-100'
|
||||
}`}
|
||||
>
|
||||
{user.disabled ? <><CheckCircle className="w-3 h-3" /> 启用</> : <><Ban className="w-3 h-3" /> 禁用</>}
|
||||
@@ -152,11 +152,11 @@ export default function PlatformUsers() {
|
||||
</table>
|
||||
|
||||
{totalPages > 1 && (
|
||||
<div className="flex items-center justify-between px-4 py-3 border-t border-slate-800">
|
||||
<span className="text-xs text-slate-400">第 {page} / {totalPages} 页,共 {total} 条</span>
|
||||
<div className="flex items-center justify-between px-4 py-3 border-t border-gray-200">
|
||||
<span className="text-xs text-gray-500">第 {page} / {totalPages} 页,共 {total} 条</span>
|
||||
<div className="flex gap-2">
|
||||
<Button size="sm" variant="secondary" disabled={page <= 1} onClick={() => setPage(page - 1)} className="bg-slate-800 text-slate-200 border border-slate-700">上一页</Button>
|
||||
<Button size="sm" variant="secondary" disabled={page >= totalPages} onClick={() => setPage(page + 1)} className="bg-slate-800 text-slate-200 border border-slate-700">下一页</Button>
|
||||
<Button size="sm" variant="secondary" disabled={page <= 1} onClick={() => setPage(page - 1)}>上一页</Button>
|
||||
<Button size="sm" variant="secondary" disabled={page >= totalPages} onClick={() => setPage(page + 1)}>下一页</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user