style: 平台管理端改为浅色主题,与企业端配色一致

This commit is contained in:
selfrelease
2026-07-29 12:16:44 +08:00
parent 0c6cb8d6cb
commit fa6cacb824
6 changed files with 157 additions and 158 deletions
+22 -22
View File
@@ -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>
)}