0.6.0.1
This commit is contained in:
+9
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { ZoomIn, ZoomOut, Move, Download, LayoutGrid, ChevronDown, Users, Network, User, Loader2 } from "lucide-react"
|
||||
import { ZoomIn, ZoomOut, Move, Download, LayoutGrid, ChevronDown, Users, Network, Loader2 } from "lucide-react"
|
||||
import { useState, useRef, useEffect, useCallback } from "react"
|
||||
import { useRouter, useSearchParams } from "next/navigation"
|
||||
import { MemberNameWithStatus } from "@/components/member-name-with-status"
|
||||
@@ -44,7 +44,7 @@ import type { D3OrgChartRef } from "@/components/tree/d3-org-chart-flow"
|
||||
type ViewMode = "traditional" | "d3-org-chart"
|
||||
|
||||
export default function TreePage() {
|
||||
const { treeData } = useFamily()
|
||||
const { treeData, currentTree, refreshData } = useFamily()
|
||||
const { calculateRelationship } = useRelationship()
|
||||
const { data: session, status } = useSession()
|
||||
const router = useRouter()
|
||||
@@ -73,6 +73,13 @@ export default function TreePage() {
|
||||
}
|
||||
}, [status, router])
|
||||
|
||||
// 页面加载时刷新数据
|
||||
useEffect(() => {
|
||||
if (currentTree?.id) {
|
||||
refreshData()
|
||||
}
|
||||
}, [currentTree?.id, refreshData])
|
||||
|
||||
// 从 URL 参数读取视图模式
|
||||
useEffect(() => {
|
||||
const view = searchParams.get('view')
|
||||
|
||||
Reference in New Issue
Block a user