feat(admin): add demand lead management and site config modules
- Add lead list page with keyword, date range and source filtering, plus per-row lead status updates - Extend site configuration types and admin editor to support demand page modules: hero, feature cards, contact form and product recommendations - Update admin navigation, tab handling and type definitions for the new lead list tab and demand modules
This commit is contained in:
@@ -33,6 +33,9 @@ const sidebarGroups: { id: string; label: string; items: { id: Tab; label: strin
|
||||
];
|
||||
|
||||
const tabs = sidebarGroups.flatMap((group) => group.items);
|
||||
const hiddenTabs: Partial<Record<Tab, { label: string; description: string }>> = {
|
||||
leadList: { label: "线索查询跟进", description: "表单查询和状态流转" },
|
||||
};
|
||||
|
||||
export function AdminShell({ onLogout }: { onLogout: () => void }) {
|
||||
const [activeTab, setActiveTab] = useState<Tab>("structure");
|
||||
@@ -50,7 +53,7 @@ export function AdminShell({ onLogout }: { onLogout: () => void }) {
|
||||
setHasUnsavedChanges(false);
|
||||
}, [activeTab]);
|
||||
|
||||
const activeMeta = useMemo(() => tabs.find((tab) => tab.id === activeTab), [activeTab]);
|
||||
const activeMeta = useMemo(() => tabs.find((tab) => tab.id === activeTab) ?? hiddenTabs[activeTab], [activeTab]);
|
||||
const activeLabel = activeMeta?.label ?? "";
|
||||
const activeDescription = activeMeta?.description ?? "";
|
||||
|
||||
@@ -125,6 +128,8 @@ export function AdminShell({ onLogout }: { onLogout: () => void }) {
|
||||
<StructurePage key="destination-workbench" fixedPage="destination" onJump={setActiveTab} onDirtyChange={setHasUnsavedChanges} notify={notify} />
|
||||
) : activeTab === "products" ? (
|
||||
<ProductsPage destinations={destinations} onDirtyChange={setHasUnsavedChanges} notify={notify} />
|
||||
) : activeTab === "leads" ? (
|
||||
<StructurePage key="demand-workbench" fixedPage="demand" onJump={setActiveTab} onDirtyChange={setHasUnsavedChanges} notify={notify} />
|
||||
) : (
|
||||
<LeadsPage notify={notify} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user