feat: add new upload page for batch processing and importing team owner data to S2A.

This commit is contained in:
2026-01-30 12:48:03 +08:00
parent cbf65ba74f
commit 2b9831539c
2 changed files with 8 additions and 2 deletions

View File

@@ -22,7 +22,11 @@ const statusLabels: Record<string, string> = {
pooled: '已入库', pooled: '已入库',
} }
export default function OwnerList() { interface OwnerListProps {
onStatsChange?: () => void
}
export default function OwnerList({ onStatsChange }: OwnerListProps) {
const [owners, setOwners] = useState<TeamOwner[]>([]) const [owners, setOwners] = useState<TeamOwner[]>([])
const [total, setTotal] = useState(0) const [total, setTotal] = useState(0)
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
@@ -63,6 +67,7 @@ export default function OwnerList() {
try { try {
await fetch(`/api/db/owners/${id}`, { method: 'DELETE' }) await fetch(`/api/db/owners/${id}`, { method: 'DELETE' })
loadOwners() loadOwners()
onStatsChange?.()
} catch (e) { } catch (e) {
console.error('Failed to delete:', e) console.error('Failed to delete:', e)
} }
@@ -73,6 +78,7 @@ export default function OwnerList() {
try { try {
await fetch('/api/db/owners/clear', { method: 'POST' }) await fetch('/api/db/owners/clear', { method: 'POST' })
loadOwners() loadOwners()
onStatsChange?.()
} catch (e) { } catch (e) {
console.error('Failed to clear:', e) console.error('Failed to clear:', e)
} }

View File

@@ -464,7 +464,7 @@ export default function Upload() {
{activeTab === 'owners' && ( {activeTab === 'owners' && (
<div className="h-full overflow-hidden rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 shadow-sm"> <div className="h-full overflow-hidden rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 shadow-sm">
<OwnerList /> <OwnerList onStatsChange={loadStats} />
</div> </div>
)} )}