|
|
@@ -119,7 +119,9 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
// 下拉刷新:刷新所有统计数据
|
|
|
// 使用 Promise.all 精确 invalidate 每个 queryKey,确保所有查询都被触发
|
|
|
usePullDownRefresh(async () => {
|
|
|
+ console.log('🔄 [下拉刷新] 开始刷新所有统计数据...')
|
|
|
try {
|
|
|
+ console.log('🔄 [下拉刷新] 开始执行 invalidateQueries Promise.all...')
|
|
|
await Promise.all([
|
|
|
queryClient.invalidateQueries({ queryKey: ['statistics', 'employment-count'] }),
|
|
|
queryClient.invalidateQueries({ queryKey: ['statistics', 'average-salary'] }),
|
|
|
@@ -131,7 +133,11 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
queryClient.invalidateQueries({ queryKey: ['statistics', 'job-status-distribution'] }),
|
|
|
queryClient.invalidateQueries({ queryKey: ['statistics', 'salary-distribution'] }),
|
|
|
])
|
|
|
+ console.log('🔄 [下拉刷新] invalidateQueries Promise.all 完成!')
|
|
|
+ } catch (error) {
|
|
|
+ console.error('🔄 [下拉刷新] 发生错误:', error)
|
|
|
} finally {
|
|
|
+ console.log('🔄 [下拉刷新] 调用 stopPullDownRefresh')
|
|
|
Taro.stopPullDownRefresh()
|
|
|
}
|
|
|
})
|