Talegorithm 15 часов назад
Родитель
Сommit
dc58bf30f1
1 измененных файлов с 25 добавлено и 15 удалено
  1. 25 15
      knowhub/frontend/src/pages/Dashboard.tsx

+ 25 - 15
knowhub/frontend/src/pages/Dashboard.tsx

@@ -86,8 +86,8 @@ function CoverageFlowBoard({ data }: { data: any }) {
 
   const DETAILED_FLOWS: Array<{ source: string, target: string, label: string, type: 'source' | 'association' }> = [
     { source: 'req', target: 'node', label: '得到需求后,关联到实质等节点 [已实现待执行]', type: 'association' },
-    { source: 'tool', target: 'cap', label: '新工具关联 [已实现待执行]', type: 'association' },
-    { source: 'tool', target: 'proc', label: '新工具关联 [已实现待执行]', type: 'association' },
+    { source: 'tool', target: 'cap', label: '新工具时,查找并关联 [已实现待执行]', type: 'association' },
+    { source: 'tool', target: 'proc', label: '新工具时,查找并关联 [已实现待执行]', type: 'association' },
     { source: 'tool', target: 'cap', label: '以工具为线索、调研归纳 [已完成]', type: 'source' },
     { source: 'cap', target: 'req', label: '参考已有能力', type: 'source' },
     { source: 'node', target: 'req', label: '制作需求归纳 [已完成]', type: 'source' },
@@ -106,7 +106,7 @@ function CoverageFlowBoard({ data }: { data: any }) {
     tool: '完成',
   };
 
-  const topOnlyFlows = DETAILED_FLOWS;
+
 
   // --- 1. 整理常驻的单步覆盖率边数据 ---
   const baseEdges = data.edges || [];
@@ -268,16 +268,14 @@ function CoverageFlowBoard({ data }: { data: any }) {
 
         <svg className="absolute inset-0 w-full h-full pointer-events-none z-30" style={{ overflow: 'visible' }}>
           <defs>
-            {topOnlyFlows.map((flow, idx) => (
-              <marker key={`arrow-top-${idx}`} id={`arrow-top-${idx}`} markerWidth="6" markerHeight="6" refX="5" refY="3" orient="auto">
-                <path d="M0,0 L6,3 L0,6 Z" fill="context-stroke" />
-              </marker>
-            ))}
+            <marker id="flow-arrow-marker" markerWidth="6" markerHeight="6" refX="5" refY="3" orient="auto">
+              <path d="M0,0 L6,3 L0,6 Z" fill="context-stroke" />
+            </marker>
           </defs>
 
           {(() => {
             // 仅对当前选中卡片的“入边”(即 target 为该节点)进行计算和渲染
-            const activeTopFlows = selectedDetailNode ? topOnlyFlows.filter((flow) =>
+            const activeTopFlows = selectedDetailNode ? DETAILED_FLOWS.filter((flow) =>
               flow.target === selectedDetailNode
             ) : [];
 
@@ -343,7 +341,7 @@ function CoverageFlowBoard({ data }: { data: any }) {
                     strokeLinecap="round"
                     strokeLinejoin="round"
                     strokeDasharray={flow.type === 'association' ? "4 4" : undefined}
-                    markerEnd={`url(#arrow-top-${idx})`}
+                    markerEnd="url(#flow-arrow-marker)"
                   />
                   <g className="transition-opacity duration-300 opacity-100" transform={`translate(${labelX}, ${labelY})`}>
                     <text
@@ -405,16 +403,28 @@ function CoverageFlowBoard({ data }: { data: any }) {
 
         {/* ================= 图例 ================= */}
         <div className="absolute right-8 top-6 flex gap-6 text-[11px] text-slate-500/80 font-bold z-50 pointer-events-none">
-          <div className="flex gap-3">
-            <div className="flex items-center gap-1.5"><div className="w-4 h-0 border-t-2 border-slate-400"></div>来源</div>
-            <div className="flex items-center gap-1.5"><div className="w-4 h-0 border-t-2 border-dashed border-slate-400"></div>关联</div>
-          </div>
           <div className="flex gap-3">
             <div className="flex items-center gap-1.5"><div className="w-3 h-2.5 bg-white border border-slate-300 rounded-sm"></div>已完成</div>
             <div className="flex items-center gap-1.5"><div className="w-3 h-2.5 bg-white border border-dashed border-slate-400 rounded-sm"></div>测试中</div>
           </div>
           <div className="flex gap-3">
-            <div className="flex items-center gap-1"><div className="w-3.5 h-3.5 bg-slate-50 border text-[8px] font-black flex items-center justify-center rounded-full leading-none">#</div><div className="w-3 h-0 border-t-[4px] border-slate-400/30 -mx-0.5"></div><div className="w-3.5 h-3.5 bg-slate-50 border text-[8px] font-black flex items-center justify-center rounded-full leading-none">#</div> <span className="ml-1">数据关联情况</span></div>
+            <div className="flex items-center gap-1.5">
+              <svg width="22" height="10" viewBox="0 0 24 10" className="overflow-visible text-slate-400 ml-0.5">
+                <path d="M0,5 L20,5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
+                <path d="M18,2 L24,5 L18,8 Z" fill="currentColor" />
+              </svg>
+              输入(新建条目)
+            </div>
+            <div className="flex items-center gap-1.5">
+              <svg width="22" height="10" viewBox="0 0 24 10" className="overflow-visible text-slate-400 ml-0.5">
+                <path d="M0,5 L20,5" stroke="currentColor" strokeWidth="1.5" strokeDasharray="4 4" strokeLinecap="round" />
+                <path d="M18,2 L24,5 L18,8 Z" fill="currentColor" />
+              </svg>
+              关联(不新建条目)
+            </div>
+          </div>
+          <div className="flex gap-3">
+            <div className="flex items-center gap-1"><div className="w-3.5 h-3.5 bg-slate-50 border text-[8px] font-black flex items-center justify-center rounded-full leading-none">#</div><div className="w-3 h-0 border-t-[4px] border-slate-400/30 -mx-0.5"></div><div className="w-3.5 h-3.5 bg-slate-50 border text-[8px] font-black flex items-center justify-center rounded-full leading-none">#</div> <span className="ml-1">数据关联现状</span></div>
           </div>
         </div>