This commit is contained in:
freedakgmail
2025-11-29 22:29:48 +08:00
parent d22f1fb889
commit b436ae0680
153 changed files with 302 additions and 270 deletions
+10 -2
View File
@@ -101,6 +101,13 @@ export default function TreePage() {
setIsDragging(false)
}
// 鼠标滚轮缩放
const handleWheel = (e: React.WheelEvent) => {
e.preventDefault()
const delta = e.deltaY > 0 ? -0.1 : 0.1
setScale((s) => Math.min(Math.max(s + delta, 0.1), 2))
}
// 处理成员选择(关系查询模式)
const handleMemberClick = (memberId: string) => {
if (selectedMembers.length === 0) {
@@ -433,7 +440,7 @@ export default function TreePage() {
</div>
{viewMode === 'traditional' ? (
<div className="flex-1 relative">
<div className="flex-1 relative min-h-0">
{/* Toolbar */}
<div className="absolute top-4 left-4 z-20 flex flex-col gap-2 bg-background/80 backdrop-blur p-2 rounded-lg border shadow-sm">
<Button variant="outline" size="icon" onClick={() => setScale((s) => Math.min(s + 0.1, 2))}>
@@ -459,6 +466,7 @@ export default function TreePage() {
onMouseMove={handleMouseMove}
onMouseUp={handleMouseUp}
onMouseLeave={handleMouseUp}
onWheel={handleWheel}
>
<div
style={{
@@ -478,7 +486,7 @@ export default function TreePage() {
</div>
</div>
) : (
<div className="flex-1 relative">
<div className="flex-1 relative min-h-0">
{/* 统一的控制按钮 */}
<div className="absolute top-4 left-4 z-20 flex flex-col gap-2 bg-background/80 backdrop-blur p-2 rounded-lg border shadow-sm">
<Button variant="outline" size="icon" onClick={() => d3ChartRef.current?.expandAll()} title="展开全部">