فهرست منبع

✨ feat(icons): 添加供应链产业图标组件

- 新增水产、鲜食、水果、畜牧、盐业、种业等产业图标组件
- 更新 IndustryIcon 组件以支持所有产业类型的图标显示
- 移除 PopupInfoBox 组件中未使用的 industry 参数

♻️ refactor(icons): 优化产业图标组件结构

- 统一图标组件接口定义
- 移除默认占位图标,为所有产业提供专属图标
- 改进图标颜色配置和样式处理
yourname 2 ماه پیش
والد
کامیت
e151aa12a5

+ 1 - 2
src/client/home/pages/SupplyChainDashboards/components/PopupInfoBox.tsx

@@ -29,8 +29,7 @@ const PopupInfoBox: React.FC<PopupInfoBoxProps> = ({
   position = { x: 717.28, y: 273.13 },
   onClose,
   pointId,
-  variant,
-  industry
+  variant
 }) => {
   const { themeColor, currentData, currentIndustry } = useSupplyChain();
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 13 - 0
src/client/home/pages/SupplyChainDashboards/components/icons/AquacultureIcon.tsx


+ 22 - 0
src/client/home/pages/SupplyChainDashboards/components/icons/FreshFoodIcon.tsx

@@ -0,0 +1,22 @@
+import React from 'react';
+
+interface FreshFoodIconProps {
+  className?: string;
+  color?: string;
+}
+
+const FreshFoodIcon: React.FC<FreshFoodIconProps> = ({
+  className = "",
+  color = "currentColor"
+}) => {
+  return (
+    <svg width="50" height="50" viewBox="0 0 50 50" fill={color} xmlns="http://www.w3.org/2000/svg"
+      className={className}>
+      <path d="M40.7526 27.9023C39.9698 26.648 38.3264 25.2244 36.0376 24.8627C35.0397 24.7025 34.1287 25.0504 33.4284 25.4853C32.5678 26.0209 32.023 26.9455 31.9269 27.9526C31.7621 29.6555 31.7255 31.8757 28.0908 32.9423C27.2028 33.2032 26.4704 36.2748 29.0613 36.8012C31.6522 37.3276 37.5437 36.9706 39.6906 36.7737C41.8375 36.5769 43.1787 35.0892 43.2886 33.7617C43.4625 31.6971 41.5354 29.1565 40.7526 27.9023ZM41.6818 33.0292C41.1463 34.5719 41.5628 33.0018 40.9082 31.6056C40.3131 30.333 40.0202 29.8523 40.0202 29.1428C40.0202 29.1428 42.2174 31.4866 41.6818 33.0292ZM31.8582 37.204C31.5332 37.1903 31.2174 37.3551 31.0663 37.6435C30.7321 38.2752 30.3156 39.1587 30.398 39.5615C30.5353 40.2299 31.0663 41.1225 33.1034 41.3743C35.1404 41.626 38.6286 41.5116 39.242 40.12C39.5944 39.3235 39.3427 38.3164 39.0634 37.6114C38.9261 37.2635 38.5874 37.0392 38.212 37.0667C36.7151 37.1674 34.5545 37.3093 31.8582 37.204ZM22.4237 30.2872C22.4649 30.0171 22.3642 29.7471 22.1536 29.5685C21.5952 29.097 20.3546 28.3234 18.2672 28.3829C15.2826 28.4653 14.8935 29.0513 13.9688 31.4499C13.0487 33.8486 12.266 36.4167 12.6001 37.2269C12.9343 38.0372 13.8819 39.0122 15.5298 39.4288C17.1778 39.8453 20.4965 40.1841 21.8332 39.7355C23.1745 39.2869 24.4013 38.3393 24.0671 36.8332C23.7329 35.3272 22.2406 32.8736 22.3642 30.864C22.378 30.6168 22.4008 30.4291 22.4237 30.2872Z" fill={color} />
+      <path d="M29.413 23.5718C28.7172 21.5622 29.2299 19.5435 28.4929 15.0894C27.8246 11.0428 26.1217 9.50929 24.1121 8.67158C21.7134 7.67365 18.1978 8.67158 15.7991 10.347C13.4005 12.0224 12.0592 15.9546 11.6152 17.4332C11.1666 18.9118 10.6127 19.8319 8.48865 22.8714C5.1424 27.4765 7.23438 29.5685 8.51612 30.5161C9.23939 31.0516 11.4 31.4453 12.8328 31.6742C13.254 31.7429 13.6476 31.4957 13.7712 31.0883C14.0459 30.2139 14.6959 28.7857 16.115 28.3463C18.4084 27.6321 21.1458 28.4332 21.9011 28.923C22.6564 29.4128 22.7755 29.9164 22.7251 30.8136C22.6793 31.5918 21.5029 33.3954 27.1791 32.608C29.4451 32.2922 30.3606 30.9921 30.7772 29.454C31.1983 27.9251 30.1088 25.5814 29.413 23.5718ZM27.9573 26.3458C27.9573 26.3458 25.5083 23.764 25.3527 21.759C24.9956 17.1951 28.1359 15.2588 27.0464 18.2434C27.0464 18.2434 26.2453 20.8939 27.1334 22.6746C28.0214 24.4553 28.6486 25.1465 28.9141 26.5701C29.1796 27.9938 27.9573 26.3458 27.9573 26.3458Z" fill={color} />
+    </svg>
+
+  );
+};
+
+export default FreshFoodIcon;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 15 - 0
src/client/home/pages/SupplyChainDashboards/components/icons/FruitIcon.tsx


+ 12 - 6
src/client/home/pages/SupplyChainDashboards/components/icons/IndustryIcon.tsx

@@ -1,6 +1,12 @@
 import React from 'react';
 import GrainIcon from './GrainIcon';
 import OilIcon from './OilIcon';
+import SeedIcon from './SeedIcon';
+import FruitIcon from './FruitIcon';
+import LivestockIcon from './LivestockIcon';
+import AquacultureIcon from './AquacultureIcon';
+import FreshFoodIcon from './FreshFoodIcon';
+import SaltIcon from './SaltIcon';
 import { useSupplyChain } from '../../context/SupplyChainContext';
 
 // 定义产业类型
@@ -32,17 +38,17 @@ const IndustryIcon: React.FC<IndustryIconProps> = ({
       case "油脂":
         return <OilIcon className={iconColor} />;
       case "种业":
+        return <SeedIcon className={iconColor} />;
       case "果蔬":
+        return <FruitIcon className={iconColor} />;
       case "畜牧":
+        return <LivestockIcon className={iconColor} />;
       case "水产":
+        return <AquacultureIcon className={iconColor} />;
       case "鲜食":
+        return <FreshFoodIcon className={iconColor} />;
       case "泛盐":
-        // 暂时使用默认图标,后续可以添加更多图标组件
-        return (
-          <div className="flex items-center justify-center w-full h-full bg-gray-400 rounded">
-            <span className="text-white text-sm">{industry}</span>
-          </div>
-        );
+        return <SaltIcon className={iconColor} />;
       default:
         return null;
     }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 14 - 0
src/client/home/pages/SupplyChainDashboards/components/icons/LivestockIcon.tsx


+ 26 - 0
src/client/home/pages/SupplyChainDashboards/components/icons/SaltIcon.tsx

@@ -0,0 +1,26 @@
+import React from 'react';
+
+interface SaltIconProps {
+  className?: string;
+  color?: string;
+}
+
+const SaltIcon: React.FC<SaltIconProps> = ({
+  className = "",
+  color = "currentColor"
+}) => {
+  return (
+    <svg width="50" height="50" viewBox="0 0 50 50" fill={color} xmlns="http://www.w3.org/2000/svg"
+      className={className}>
+      <path d="M23.7951 34.0176H22.4446V31.9399H23.7951V34.0176Z" fill={color} fill-opacity="0.92" />
+      <path d="M25.644 34.0176H24.273V31.9399H25.644V34.0176Z" fill={color} fill-opacity="0.92" />
+      <path d="M27.514 34.0176H26.1221V31.9399H27.514V34.0176Z" fill={color} fill-opacity="0.92" />
+      <path fill-rule="evenodd" clip-rule="evenodd" d="M25.0001 22.7149C29.3216 22.7149 32.8329 26.2262 32.833 30.5478C32.833 34.8693 29.3217 38.3806 25.0001 38.3806C20.6786 38.3806 17.1673 34.8693 17.1673 30.5478C17.1673 26.2262 20.6786 22.7149 25.0001 22.7149ZM21.9667 34.0176H20.9694V34.4538H28.9683V34.0176H27.9921V31.5035H21.9667V34.0176ZM25.8728 31.0879H26.3507V28.678C27.0155 29.0104 27.805 29.4883 28.7606 30.1115L29.0308 29.7167C28.0752 29.135 27.1817 28.6363 26.3507 28.2208V26.621H25.8728V31.0879ZM22.8808 28.1169H21.3642V28.6156H22.8601V30.3608C22.4654 30.4231 21.9042 30.5063 21.1771 30.5894L21.3019 31.0256C22.6732 30.8386 23.9198 30.6101 25.0417 30.3608V29.9036C24.4808 30.0283 23.9197 30.153 23.3587 30.2569V28.5947H24.8755V28.1169H23.3587V26.621H22.8808V28.1169Z" fill={color} fill-opacity="0.92" />
+      <path fill-rule="evenodd" clip-rule="evenodd" d="M29.6999 17.6515C40.113 17.6516 42.6702 38.1093 42.6702 38.1093C42.6701 40.8047 40.5045 43.5 37.8091 43.5H12.1912C9.51884 43.5 7.33013 40.8047 7.33008 38.1093C7.33008 38.1093 9.88732 17.6517 20.3003 17.6515H29.6999ZM25.0001 21.3608C19.9318 21.3608 15.808 25.4844 15.8079 30.5527C15.808 35.621 19.9318 39.7449 25.0001 39.7449C30.0684 39.7449 34.1923 35.621 34.1923 30.5527C34.1923 25.4844 30.0684 21.3608 25.0001 21.3608Z" fill={color} fill-opacity="0.92" />
+      <path d="M15.4394 9.79572C15.4394 8.02183 15.9002 6.17892 18.6877 6.54748C21.4522 6.93912 22.5811 8.68993 24.8388 8.68995C27.0274 8.68995 27.7647 6.45535 30.8286 6.54748C33.8927 6.63963 34.0771 7.99878 34.0771 9.79572C34.0744 9.80342 31.9788 15.7856 29.216 15.7856H20.3003C17.5376 15.7854 15.4421 9.80342 15.4394 9.79572Z" fill={color} fill-opacity="0.92" />
+    </svg>
+
+  );
+};
+
+export default SaltIcon;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 14 - 0
src/client/home/pages/SupplyChainDashboards/components/icons/SeedIcon.tsx


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است