- W26: NestJS API + Next.js Web + Prisma + SQLite scaffold - W26: Lead 模型 + Crawler + 询价发布助手 (线索池 + 一键发布) - W29.x: MCP 集成 (Integration 模型 + connectMcp + publish_rfq 5 工具端到端跑通) - W30: 3 字段补充 (notes / quotationType / quotationDemand) - W31 P1: 自动填 enterpriseId / userId (Prisma companyUserId 字段 + get_app_identity tool + lead.service.ts publishArgs) - W31: detail 详情页 + admin UI 集成管理 (OpenAppListView + AuditLogListView) 关联: ~/Documents/02-平台开发/产品开发/F002-W31-交接文档.md GIT-AUDIT-REPORT-2026-06-24.md
58 lines
2.4 KiB
TypeScript
58 lines
2.4 KiB
TypeScript
'use client'
|
|
|
|
import { useState } from 'react'
|
|
import { useAuth } from '@/components/AuthProvider'
|
|
import Sidebar from '@/components/Sidebar'
|
|
import LoginPage from '@/components/LoginPage'
|
|
import OverviewPage from '@/components/OverviewPage'
|
|
import InquiryPage from '@/components/InquiryPage'
|
|
import ImagePage from '@/components/ImagePage'
|
|
import ProductPage from '@/components/ProductPage'
|
|
import ComparisonPage from '@/components/ComparisonPage'
|
|
import LeadDetailPage from '@/components/LeadDetailPage'
|
|
import ReportCenterPage from '@/components/ReportCenterPage'
|
|
import RuleCenterPage from '@/components/RuleCenterPage'
|
|
import SystemMonitorPage from '@/components/SystemMonitorPage'
|
|
import AdminPage from '@/components/AdminPage'
|
|
|
|
type Page = 'overview' | 'inquiry' | 'image' | 'product' | 'comparison' | 'lead-detail' | 'report-center' | 'rule-center' | 'system-monitor' | 'admin-tenants' | 'admin-users' | 'admin-stats' | 'admin-configs' | 'admin-plans'
|
|
|
|
export default function Home() {
|
|
const { user, loading, logout } = useAuth()
|
|
const [page, setPage] = useState<Page>('overview')
|
|
const [leadDetailId, setLeadDetailId] = useState<string | null>(null)
|
|
|
|
const handleLeadDetail = (id: string) => {
|
|
setLeadDetailId(id)
|
|
setPage('lead-detail')
|
|
}
|
|
|
|
if (loading) {
|
|
return (
|
|
<div className="min-h-screen bg-[#f7f9fb] flex items-center justify-center">
|
|
<div className="text-on-surface-variant">加载中...</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (!user) return <LoginPage />
|
|
|
|
return (
|
|
<div className="flex min-h-screen">
|
|
<Sidebar current={page} onNavigate={setPage} user={user} onLogout={logout} />
|
|
<main className="flex-1 ml-64 p-8">
|
|
{page === 'overview' && <OverviewPage onNavigate={(p) => setPage(p as Page)} />}
|
|
{page === 'inquiry' && <InquiryPage onLeadDetail={handleLeadDetail} />}
|
|
{page === 'image' && <ImagePage />}
|
|
{page === 'product' && <ProductPage />}
|
|
{page === 'comparison' && <ComparisonPage />}
|
|
{page === 'lead-detail' && <LeadDetailPage leadId={leadDetailId!} onNavigate={(p) => setPage(p as Page)} />}
|
|
{page === 'report-center' && <ReportCenterPage />}
|
|
{page === 'rule-center' && <RuleCenterPage />}
|
|
{page === 'system-monitor' && <SystemMonitorPage />}
|
|
{page.startsWith('admin-') && <AdminPage section={page.replace('admin-', '') as any} />}
|
|
</main>
|
|
</div>
|
|
)
|
|
}
|