Browse Source

fix: 修正动物身体部位ID与后端对应问题 in src/components/CatBody.tsx, src/components/DogBody.tsx

dengdx 2 tuần trước cách đây
mục cha
commit
1e5a5df155
3 tập tin đã thay đổi với 19 bổ sung19 xóa
  1. 8 8
      src/components/CatBody.tsx
  2. 8 8
      src/components/DogBody.tsx
  3. 3 3
      src/components/HumanBody.tsx

+ 8 - 8
src/components/CatBody.tsx

@@ -28,13 +28,13 @@ const DogBody = ({
         onClick={() => onPathClick('Cat_Spine')}
       />
       <path
-        id="Cat_Forelimb"
+        id="Cat_FrontExtremities"
         d="M106.2,224.7L212.9,249 241.69999,359.40001 250.5,434.59992 237.06505,466.89291 191.59432,463.33113 209.82927,422.23826 212.9,397.80002 204.1,377.00002 172.89999,352.20002 151.3,386.60003 126.5,421.80004 103.3,461.00004 68.899997,461.00004 68.099994,440.20003 91.299997,419.40003 102.5,409.80003 110.81422,393.04704 118.5,370.60003 119.67324,337.50197 123.67324,310.30196 119.3,288.20001 97.699997,270.60001 93.699997,262.6z"
-        fill={selectedId === 'Cat_Forelimb' ? '#f5222d' : '#ccc'}
-        stroke={selectedId === 'Cat_Forelimb' ? '#ff4d4f' : '#ccc'}
+        fill={selectedId === 'Cat_FrontExtremities' ? '#f5222d' : '#ccc'}
+        stroke={selectedId === 'Cat_FrontExtremities' ? '#ff4d4f' : '#ccc'}
         strokeWidth={2}
         style={{ cursor: 'pointer' }}
-        onClick={() => onPathClick('Cat_Forelimb')}
+        onClick={() => onPathClick('Cat_FrontExtremities')}
       />
       <path
         id="Cat_Thorax"
@@ -64,13 +64,13 @@ const DogBody = ({
         onClick={() => onPathClick('Cat_Hip')}
       />
       <path
-        id="Cat_Hindlimb"
+        id="Cat_RearExtremities"
         d="M389.4,350.3L504.09999,312.19999 508.10001,327.39998 524.10001,348.19999 528.10004,384.99999 529.70004,409.00001 536.9,444.19999 513.82413,460.9568 494.62414,405.75681 479.3,376.99998 442.5,367.39998 449.7,398.59999 419.3,442.59999 400.89999,460.19999 372.09999,459.39998 366.50001,440.19998 396.1,419.39998 407.3,383.39998z"
-        fill={selectedId === 'Cat_Hindlimb' ? '#f5222d' : '#ccc'}
-        stroke={selectedId === 'Cat_Hindlimb' ? '#ff4d4f' : '#ccc'}
+        fill={selectedId === 'Cat_RearExtremities' ? '#f5222d' : '#ccc'}
+        stroke={selectedId === 'Cat_RearExtremities' ? '#ff4d4f' : '#ccc'}
         strokeWidth={2}
         style={{ cursor: 'pointer' }}
-        onClick={() => onPathClick('Cat_Hindlimb')}
+        onClick={() => onPathClick('Cat_RearExtremities')}
       />
     </svg>
   );

+ 8 - 8
src/components/DogBody.tsx

@@ -28,13 +28,13 @@ const DogBody = ({
         onClick={() => onPathClick('Dog_Spine')}
       />
       <path
-        id="Dog_Forelimb"
+        id="Dog_FrontExtremities"
         d="M86.2,157.5L122.5,209 139.3,252.2 153.7,277.8 170.50002,288.99999 182.50002,360.2 184.10002,400.20001 181.70002,417.00001 155.30001,428.2 155.30001,441.80001 185.70002,445.00002 200.90003,425.80003 212.10004,421.00003 224.10004,388.20002 225.70004,293.80001 199.30003,178.6 115.30001,125 88.099998,152.2"
-        fill={selectedId === 'Dog_Forelimb' ? '#f5222d' : '#ccc'}
-        stroke={selectedId === 'Dog_Forelimb' ? '#ff4d4f' : '#ccc'}
+        fill={selectedId === 'Dog_FrontExtremities' ? '#f5222d' : '#ccc'}
+        stroke={selectedId === 'Dog_FrontExtremities' ? '#ff4d4f' : '#ccc'}
         strokeWidth={2}
         style={{ cursor: 'pointer' }}
-        onClick={() => onPathClick('Dog_Forelimb')}
+        onClick={() => onPathClick('Dog_FrontExtremities')}
       />
       <path
         id="Dog_Thorax"
@@ -64,13 +64,13 @@ const DogBody = ({
         onClick={() => onPathClick('Dog_Hip')}
       />
       <path
-        id="Dog_Hindlimb"
+        id="Dog_RearExtremities"
         d="M401.4,257.5L498.49999,228.2 499.3,309.00001 525.37726,349.00985 521.80024,440.19984 488.60743,438.70827 490.60017,415.39986 467.38135,428.48481 448.28146,415.68482 470.49999,401.79997 475.40014,378.59998 466.49999,344.99998 436.89999,313.79999z"
-        fill={selectedId === 'Dog_Hindlimb' ? '#f5222d' : '#ccc'}
-        stroke={selectedId === 'Dog_Hindlimb' ? '#ff4d4f' : '#ccc'}
+        fill={selectedId === 'Dog_RearExtremities' ? '#f5222d' : '#ccc'}
+        stroke={selectedId === 'Dog_RearExtremities' ? '#ff4d4f' : '#ccc'}
         strokeWidth={2}
         style={{ cursor: 'pointer' }}
-        onClick={() => onPathClick('Dog_Hindlimb')}
+        onClick={() => onPathClick('Dog_RearExtremities')}
       />
     </svg>
   );

+ 3 - 3
src/components/HumanBody.tsx

@@ -103,7 +103,7 @@ const bodyParts = {
       height: '280px',
       zIndex: 1,
     },
-    serverName: 'Human_UPPER LIMB', //服务端认识的名字
+    serverName: 'Human_UPPER_LIMB', //服务端认识的名字
   },
   UpperLimb_Right: {
     normal: UpperLimb_Right,
@@ -127,7 +127,7 @@ const bodyParts = {
       height: '337px',
       zIndex: 1,
     },
-    serverName: 'Human_LOWER LIMB', //服务端认识的名字
+    serverName: 'Human_LOWER_LIMB', //服务端认识的名字
   },
   LowerLimb_Right: {
     normal: LowerLimb_Right,
@@ -139,7 +139,7 @@ const bodyParts = {
       height: '337px',
       zIndex: 1,
     },
-    serverName: 'Human_LOWER LIMB', //服务端认识的名字
+    serverName: 'Human_LOWER_LIMB', //服务端认识的名字
   },
 };