Преглед на файлове

✨ feat(statistics): 启用性别、年龄、户籍、在职状态和薪资分布图表

- 移除所有图表组件的条件渲染包装(`{false && ...}`),使性别分布、年龄分布、户籍省份分布、在职状态统计和薪资分布图表在页面上正常显示
- 调整性别分布柱状图的高度从200增加到300,以改善视觉展示效果
- 简化性别分布柱状图的配置,移除自定义的字体大小、数据标签、坐标轴以及工具提示格式化器,使用组件默认样式
yourname преди 2 седмици
родител
ревизия
745beb3ae8
променени са 1 файла, в които са добавени 11 реда и са изтрити 19 реда
  1. 11 19
      mini-ui-packages/yongren-statistics-ui/src/pages/Statistics/Statistics.tsx

+ 11 - 19
mini-ui-packages/yongren-statistics-ui/src/pages/Statistics/Statistics.tsx

@@ -278,7 +278,7 @@ const Statistics: React.FC<StatisticsProps> = () => {
         </View>
 
         {/* 性别分布 */}
-        {false && (<View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
+        <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
           <Text className="font-semibold text-gray-700">性别分布</Text>
           {isLoadingGender ? (
             <Text className="text-gray-500 text-center py-4">加载中...</Text>
@@ -289,7 +289,7 @@ const Statistics: React.FC<StatisticsProps> = () => {
                   <ColumnChart
                     canvasId="gender-chart"
                     width={650}
-                    height={200}
+                    height={300}
                     categories={genderStats.map(s => s.key)}
                     series={[{
                       name: '人数',
@@ -297,14 +297,6 @@ const Statistics: React.FC<StatisticsProps> = () => {
                     }]}
                     config={{
                       color: ['#3b82f6', '#ec4899'],
-                      fontSize: 11,
-                      dataLabel: true,
-                      xAxis: { disableGrid: true },
-                      yAxis: {}
-                    }}
-                    tooltipFormatter={(item: any, category: string) => {
-                      const statItem = genderStats.find(s => s.key === category)
-                      return `${category} ${item.data}人 (${statItem?.percentage || 0}%)`
                     }}
                   />
                 </View>
@@ -312,10 +304,10 @@ const Statistics: React.FC<StatisticsProps> = () => {
                 <Text className="text-gray-500 text-center py-4">暂无数据</Text>
               )
             })()}
-        </View>)}
+        </View>
 
         {/* 年龄分布 */}
-        {false && (<View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
+        <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
           <Text className="font-semibold text-gray-700">年龄分布</Text>
           {isLoadingAge ? (
             <Text className="text-gray-500 text-center py-4">加载中...</Text>
@@ -345,10 +337,10 @@ const Statistics: React.FC<StatisticsProps> = () => {
                 <Text className="text-gray-500 text-center py-4">暂无数据</Text>
               )
             })()}
-        </View>)}
+        </View>
 
         {/* 户籍省份分布 */}
-        {false && <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
+        <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
           <Text className="font-semibold text-gray-700">户籍省份分布</Text>
           {isLoadingHousehold ? (
             <Text className="text-gray-500 text-center py-4">加载中...</Text>
@@ -382,10 +374,10 @@ const Statistics: React.FC<StatisticsProps> = () => {
                 return <Text className="text-gray-500 text-center py-4 mt-3">暂无数据</Text>
               }
             })()}
-        </View>}
+        </View>
 
         {/* 在职状态统计 */}
-        {false && <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
+        <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
           <Text className="font-semibold text-gray-700">在职状态统计</Text>
           {isLoadingJobStatus ? (
             <Text className="text-gray-500 text-center py-4">加载中...</Text>
@@ -417,10 +409,10 @@ const Statistics: React.FC<StatisticsProps> = () => {
                 return <Text className="text-gray-500 text-center py-4 mt-3">暂无数据</Text>
               }
             })()}
-        </View>}
+        </View>
 
         {/* 薪资分布 */}
-       {false && <View className="card bg-white p-4 rounded-lg shadow-sm flex flex-col">
+        <View className="card bg-white p-4 rounded-lg shadow-sm flex flex-col">
           <Text className="font-semibold text-gray-700">薪资分布</Text>
           {isLoadingSalary ? (
             <Text className="text-gray-500 text-center py-4">加载中...</Text>
@@ -454,7 +446,7 @@ const Statistics: React.FC<StatisticsProps> = () => {
                 return <Text className="text-gray-500 text-center py-4 mt-3">暂无数据</Text>
               }
             })()}
-        </View>}
+        </View>
 
       </ScrollView>
     </YongrenTabBarLayout>