|
@@ -3,7 +3,7 @@ import { View, Text, ScrollView } from '@tarojs/components'
|
|
|
import Taro from '@tarojs/taro'
|
|
import Taro from '@tarojs/taro'
|
|
|
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
|
import { YongrenTabBarLayout } from '@d8d/yongren-shared-ui'
|
|
import { YongrenTabBarLayout } from '@d8d/yongren-shared-ui'
|
|
|
-import { enterpriseCompanyClient } from './api'
|
|
|
|
|
|
|
+import { enterpriseCompanyClient } from '../api'
|
|
|
import { useAuth, useRequireAuth } from '@d8d/mini-enterprise-auth-ui'
|
|
import { useAuth, useRequireAuth } from '@d8d/mini-enterprise-auth-ui'
|
|
|
import './Dashboard.css'
|
|
import './Dashboard.css'
|
|
|
|
|
|
|
@@ -49,7 +49,7 @@ const Dashboard: React.FC = () => {
|
|
|
totalEmployees: data.在职人员数,
|
|
totalEmployees: data.在职人员数,
|
|
|
pendingAssignments: data.进行中订单数,
|
|
pendingAssignments: data.进行中订单数,
|
|
|
monthlyOrders: data.已完成订单数,
|
|
monthlyOrders: data.已完成订单数,
|
|
|
- companyName: data.companyName || '企业名称'
|
|
|
|
|
|
|
+ companyName: '企业名称'
|
|
|
} as OverviewData
|
|
} as OverviewData
|
|
|
},
|
|
},
|
|
|
refetchOnWindowFocus: false
|
|
refetchOnWindowFocus: false
|
|
@@ -206,7 +206,7 @@ const Dashboard: React.FC = () => {
|
|
|
</View>
|
|
</View>
|
|
|
) : allocations && allocations.length > 0 ? (
|
|
) : allocations && allocations.length > 0 ? (
|
|
|
<View className="space-y-3">
|
|
<View className="space-y-3">
|
|
|
- {allocations.slice(0, 2).map((allocation) => (
|
|
|
|
|
|
|
+ {allocations.slice(0, 2).map((allocation: AllocationData) => (
|
|
|
<View key={allocation.id} className="bg-white p-4 rounded-lg flex items-center">
|
|
<View key={allocation.id} className="bg-white p-4 rounded-lg flex items-center">
|
|
|
{/* 头像区域 */}
|
|
{/* 头像区域 */}
|
|
|
<View className={`name-avatar ${allocation.avatarColor} w-10 h-10 rounded-full flex items-center justify-center`}>
|
|
<View className={`name-avatar ${allocation.avatarColor} w-10 h-10 rounded-full flex items-center justify-center`}>
|
|
@@ -275,7 +275,7 @@ const Dashboard: React.FC = () => {
|
|
|
<Text className="text-sm text-gray-600 mb-2">平均薪资</Text>
|
|
<Text className="text-sm text-gray-600 mb-2">平均薪资</Text>
|
|
|
<Text className="text-2xl font-bold text-gray-800">
|
|
<Text className="text-2xl font-bold text-gray-800">
|
|
|
{allocations && allocations.length > 0
|
|
{allocations && allocations.length > 0
|
|
|
- ? `¥${Math.round(allocations.reduce((sum, a) => sum + a.salary, 0) / allocations.length).toLocaleString()}`
|
|
|
|
|
|
|
+ ? `¥${Math.round(allocations.reduce((sum: number, a: AllocationData) => sum + a.salary, 0) / allocations.length).toLocaleString()}`
|
|
|
: '¥0'}
|
|
: '¥0'}
|
|
|
</Text>
|
|
</Text>
|
|
|
</View>
|
|
</View>
|