|
@@ -1,17 +1,18 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="flex flex-col h-full">
|
|
<div class="flex flex-col h-full">
|
|
|
<!-- 头部 -->
|
|
<!-- 头部 -->
|
|
|
- <div class="flex items-center gap-3 px-4 py-2 bg-base-300 text-xs text-base-content/60">
|
|
|
|
|
|
|
+ <div class="flex items-center gap-3 px-4 py-2 bg-base-300 text-xs text-base-content/60 shrink-0">
|
|
|
<span>相关图</span>
|
|
<span>相关图</span>
|
|
|
- <span class="text-primary font-medium">{{ currentNodeName }}</span>
|
|
|
|
|
|
|
+ <span v-if="!collapsed" class="text-primary font-medium">{{ currentNodeName }}</span>
|
|
|
|
|
+ <span v-else class="text-base-content/40">点击人设树节点查看</span>
|
|
|
<div class="flex-1"></div>
|
|
<div class="flex-1"></div>
|
|
|
- <button @click="showConfig = !showConfig" class="btn btn-ghost btn-xs">
|
|
|
|
|
|
|
+ <button v-if="!collapsed" @click="showConfig = !showConfig" class="btn btn-ghost btn-xs">
|
|
|
{{ showConfig ? '隐藏配置' : '游走配置' }}
|
|
{{ showConfig ? '隐藏配置' : '游走配置' }}
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 游走配置面板 -->
|
|
<!-- 游走配置面板 -->
|
|
|
- <div v-show="showConfig" class="px-4 py-2 bg-base-200 border-b border-base-300 text-xs space-y-3 max-h-64 overflow-y-auto relative z-50">
|
|
|
|
|
|
|
+ <div v-show="showConfig && !collapsed" class="px-4 py-2 bg-base-200 border-b border-base-300 text-xs space-y-3 max-h-64 overflow-y-auto relative z-50">
|
|
|
<!-- 步数设置 -->
|
|
<!-- 步数设置 -->
|
|
|
<div class="flex items-center gap-2">
|
|
<div class="flex items-center gap-2">
|
|
|
<span class="text-base-content/60 w-16">游走步数:</span>
|
|
<span class="text-base-content/60 w-16">游走步数:</span>
|
|
@@ -45,7 +46,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- SVG 容器 -->
|
|
<!-- SVG 容器 -->
|
|
|
- <div ref="containerRef" class="flex-1 relative overflow-hidden">
|
|
|
|
|
|
|
+ <div v-show="!collapsed" ref="containerRef" class="flex-1 relative overflow-hidden">
|
|
|
<svg ref="svgRef" class="w-full h-full"></svg>
|
|
<svg ref="svgRef" class="w-full h-full"></svg>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -56,6 +57,14 @@ import { ref, reactive, computed, watch, onMounted } from 'vue'
|
|
|
import * as d3 from 'd3'
|
|
import * as d3 from 'd3'
|
|
|
import { useGraphStore } from '../stores/graph'
|
|
import { useGraphStore } from '../stores/graph'
|
|
|
|
|
|
|
|
|
|
+// Props
|
|
|
|
|
+const props = defineProps({
|
|
|
|
|
+ collapsed: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const store = useGraphStore()
|
|
const store = useGraphStore()
|
|
|
|
|
|
|
|
const containerRef = ref(null)
|
|
const containerRef = ref(null)
|