diff --git a/src/app/(main)/network-partition-optimization/page.tsx b/src/app/(main)/network-partition-optimization/page.tsx index 77da850..ab64ace 100644 --- a/src/app/(main)/network-partition-optimization/page.tsx +++ b/src/app/(main)/network-partition-optimization/page.tsx @@ -7,7 +7,7 @@ export default function Home() { return (
- + {/* */}
diff --git a/src/app/OlMap/Controls/PropertyPanel.tsx b/src/app/OlMap/Controls/PropertyPanel.tsx index f96ccd3..a9c6243 100644 --- a/src/app/OlMap/Controls/PropertyPanel.tsx +++ b/src/app/OlMap/Controls/PropertyPanel.tsx @@ -18,15 +18,6 @@ const PropertyPanel: React.FC = ({ type = "未知类型", properties = [], }) => { - if (!id) { - return ( -
-

属性面板

-

请选择一个要素以查看其属性。

-
- ); - } - const formatValue = (property: BaseProperty) => { if (property.formatter) { return property.formatter(property.value); @@ -37,24 +28,137 @@ const PropertyPanel: React.FC = ({ return property.value; }; + const isImportantKeys = ["ID", "类型", "Name", "面积", "长度"]; + return ( -
-

属性面板

-
-
- ID: - {id} +
+ {/* 头部 */} +
+
+ + + +

属性面板

-
- 类型: - {type} -
- {properties.map((property, index) => ( -
- {property.label}: - {formatValue(property)} +
+ + {/* 内容区域 */} +
+ {!id ? ( +
+ + + +

暂无属性信息

+

请选择一个要素以查看其属性

- ))} + ) : ( +
+ {/* ID 属性 */} +
+
+ + ID + + + {id} + +
+
+ + {/* 类型属性 */} +
+
+ + 类型 + + + {type} + +
+
+ + {/* 其他属性 */} + {properties.map((property, index) => { + const isImportant = isImportantKeys.includes(property.label); + return ( +
+
+ + {property.label} + + + {formatValue(property)} + +
+
+ ); + })} +
+ )} +
+ + {/* 底部统计区域 */} +
+
+ + + + + 共 {id ? properties.length + 2 : 0} 个属性 + + {id && ( + + + 已选中 + + )} +
); diff --git a/src/components/olmap/ZonePropsPanel.tsx b/src/components/olmap/ZonePropsPanel.tsx index 86e0c9e..7da1cc1 100644 --- a/src/components/olmap/ZonePropsPanel.tsx +++ b/src/components/olmap/ZonePropsPanel.tsx @@ -282,7 +282,7 @@ const ZonePropsPanel: React.FC = ({ return (
{/* 头部 */} -
+