瀏覽代碼

refactor: 移除非详情卡片的复制JSON功能

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
yangxiaohui 20 小時之前
父節點
當前提交
0e3f046866

+ 0 - 22
script/visualization/src/components/GraphView.vue

@@ -22,15 +22,6 @@
           title="恢复"
         >⊡</button>
       </template>
-      <button
-        v-if="store.selectedNodeId"
-        @click="copyGraphJson"
-        class="btn btn-ghost btn-xs opacity-60 hover:opacity-100"
-        :title="copySuccess ? '已复制' : '复制JSON'"
-      >
-        <span v-if="copySuccess">✓</span>
-        <span v-else>📋</span>
-      </button>
     </div>
 
     <!-- 人设节点筛选配置 -->
@@ -128,19 +119,6 @@ const containerRef = ref(null)
 const svgRef = ref(null)
 const showConfig = ref(false)
 
-// 复制 JSON 功能
-const copySuccess = ref(false)
-function copyGraphJson() {
-  const data = {
-    selectedNodeId: store.selectedNodeId,
-    walkedEdges: store.walkedEdges,
-    walkedNodes: store.walkedNodes
-  }
-  navigator.clipboard.writeText(JSON.stringify(data, null, 2)).then(() => {
-    copySuccess.value = true
-    setTimeout(() => { copySuccess.value = false }, 1500)
-  })
-}
 
 // 中间步骤可选的边类型(排除匹配边)
 const middleEdgeTypeOptions = computed(() => {

+ 1 - 41
script/visualization/src/components/PostTreeView.vue

@@ -23,14 +23,6 @@
               title="恢复"
             >⊡</button>
           </template>
-          <button
-            @click="copyPostTreeJson"
-            class="btn btn-ghost btn-xs opacity-60 hover:opacity-100"
-            :title="copyPostTreeSuccess ? '已复制' : '复制JSON'"
-          >
-            <span v-if="copyPostTreeSuccess">✓</span>
-            <span v-else>📋</span>
-          </button>
         </div>
       </div>
 
@@ -61,17 +53,7 @@
       <div class="flex flex-col h-1/2 border-b border-base-300">
         <div class="px-3 py-2 bg-base-300 text-base-content/60 flex items-center justify-between shrink-0">
           <span>匹配列表</span>
-          <div class="flex items-center gap-2">
-            <span class="text-base-content/40">{{ sortedMatchEdges.length }}</span>
-            <button
-              @click="copyMatchListJson"
-              class="btn btn-ghost btn-xs opacity-60 hover:opacity-100"
-              :title="copyMatchListSuccess ? '已复制' : '复制JSON'"
-            >
-              <span v-if="copyMatchListSuccess">✓</span>
-              <span v-else>📋</span>
-            </button>
-          </div>
+          <span class="text-base-content/40">{{ sortedMatchEdges.length }}</span>
         </div>
         <div class="flex-1 overflow-y-auto">
           <div
@@ -242,28 +224,6 @@ function copyJson() {
   })
 }
 
-// 复制帖子树JSON
-const copyPostTreeSuccess = ref(false)
-function copyPostTreeJson() {
-  const data = store.currentPostGraph
-  if (!data) return
-  navigator.clipboard.writeText(JSON.stringify(data, null, 2)).then(() => {
-    copyPostTreeSuccess.value = true
-    setTimeout(() => { copyPostTreeSuccess.value = false }, 1500)
-  })
-}
-
-// 复制匹配列表JSON
-const copyMatchListSuccess = ref(false)
-function copyMatchListJson() {
-  const data = sortedMatchEdges.value
-  if (!data || data.length === 0) return
-  navigator.clipboard.writeText(JSON.stringify(data, null, 2)).then(() => {
-    copyMatchListSuccess.value = true
-    setTimeout(() => { copyMatchListSuccess.value = false }, 1500)
-  })
-}
-
 // 当前选中的帖子索引
 const selectedPostIdx = ref(store.selectedPostIndex)
 

+ 3 - 23
script/visualization/src/components/TreeView.vue

@@ -3,19 +3,9 @@
     <!-- 头部 -->
     <div v-if="!hideHeader" class="flex items-center justify-between px-4 py-2 bg-base-300 text-xs text-base-content/60">
       <span>人设树</span>
-      <div class="flex items-center gap-2">
-        <span v-if="store.highlightedNodeIds.size > 0" class="text-primary">
-          已高亮 {{ store.highlightedNodeIds.size }} 个节点
-        </span>
-        <button
-          @click="copyTreeJson"
-          class="btn btn-ghost btn-xs opacity-60 hover:opacity-100"
-          :title="copySuccess ? '已复制' : '复制JSON'"
-        >
-          <span v-if="copySuccess">✓</span>
-          <span v-else>📋</span>
-        </button>
-      </div>
+      <span v-if="store.highlightedNodeIds.size > 0" class="text-primary">
+        已高亮 {{ store.highlightedNodeIds.size }} 个节点
+      </span>
     </div>
 
     <!-- 搜索框 -->
@@ -101,16 +91,6 @@ const searchQuery = ref('')
 const showSuggestions = ref(false)
 const suggestionIndex = ref(0)
 
-// 复制 JSON 功能
-const copySuccess = ref(false)
-function copyTreeJson() {
-  const data = store.treeData
-  if (!data) return
-  navigator.clipboard.writeText(JSON.stringify(data, null, 2)).then(() => {
-    copySuccess.value = true
-    setTimeout(() => { copySuccess.value = false }, 1500)
-  })
-}
 
 // 获取所有节点列表
 const allNodes = computed(() => {