Просмотр исходного кода

♻️ refactor(supply-chain): 移除供应链地图中的连接线组件

- 删除静态连接线背景图片及容器
- 移除动态连接线渲染逻辑
- 清理相关注释和空 div 容器
yourname 2 месяцев назад
Родитель
Сommit
4af3ab0ed1
1 измененных файлов с 1 добавлено и 38 удалено
  1. 1 38
      src/client/home/pages/SupplyChainDashboards/components/SupplyChainMap.tsx

+ 1 - 38
src/client/home/pages/SupplyChainDashboards/components/SupplyChainMap.tsx

@@ -202,21 +202,9 @@ const SupplyChainMap: React.FC<SupplyChainMapProps> = ({
     { id: 'chain4', type: 'industryChain', position: { x: 1237.87, y: 761.84 }, name: '产业链4' }
     { id: 'chain4', type: 'industryChain', position: { x: 1237.87, y: 761.84 }, name: '产业链4' }
   ];
   ];
 
 
-  // 默认连接线数据
-  const defaultConnections: ConnectionLine[] = [
-    { id: 'conn1', from: 'base1', to: 'chain1' },
-    { id: 'conn2', from: 'base2', to: 'chain2' },
-    { id: 'conn3', from: 'base3', to: 'chain3' },
-    { id: 'conn4', from: 'base4', to: 'chain4' },
-    { id: 'conn5', from: 'chain1', to: 'chain2' },
-    { id: 'conn6', from: 'chain2', to: 'chain3' }
-  ];
 
 
-  const displayPoints = points.length > 0 ? points : defaultPoints;
-  const displayConnections = connections.length > 0 ? connections : defaultConnections;
 
 
-  // 创建点映射以便快速查找
-  const pointMap = new Map(displayPoints.map(point => [point.id, point]));
+  const displayPoints = points.length > 0 ? points : defaultPoints;
 
 
   return (
   return (
     <div className="absolute contents left-[529.88px] top-[calc(50%+64.03px)] translate-y-[-50%]">
     <div className="absolute contents left-[529.88px] top-[calc(50%+64.03px)] translate-y-[-50%]">
@@ -232,32 +220,7 @@ const SupplyChainMap: React.FC<SupplyChainMapProps> = ({
           </div>
           </div>
         </div>
         </div>
 
 
-        {/* 供应链网络连接线 */}
-        <div className="absolute inset-[19.27%_4.17%_13.01%_27.6%]">
-          {/* 静态连接线背景 */}
-          <img
-            alt="供应链网络"
-            className="block max-w-none size-full"
-            src="/supply-chain/union1.svg"
-          />
-
-          {/* 动态连接线 */}
-          {displayConnections.map(connection => {
-            const fromPoint = pointMap.get(connection.from);
-            const toPoint = pointMap.get(connection.to);
-
-            if (!fromPoint || !toPoint) return null;
 
 
-            return (
-              <ConnectionLine
-                key={connection.id}
-                line={connection}
-                fromPoint={fromPoint}
-                toPoint={toPoint}
-              />
-            );
-          })}
-        </div>
 
 
         {/* 定位点 */}
         {/* 定位点 */}
         {displayPoints.map(point => {
         {displayPoints.map(point => {