From 7f86620bc14d806fab1292ea5159c697a58f64ba Mon Sep 17 00:00:00 2001 From: linkeyu <798648091@qq.com> Date: Fri, 24 Jul 2026 11:20:44 +0800 Subject: [PATCH] fix(admin): harden bulk review interactions --- src/app/(main)/feedbacks/page.tsx | 25 ++++++++++---- src/app/(main)/price-reports/page.tsx | 49 ++++++++++++++++++++------- src/lib/bulkAction.ts | 16 +++++++++ 3 files changed, 71 insertions(+), 19 deletions(-) diff --git a/src/app/(main)/feedbacks/page.tsx b/src/app/(main)/feedbacks/page.tsx index dd0ba6e..b37008d 100644 --- a/src/app/(main)/feedbacks/page.tsx +++ b/src/app/(main)/feedbacks/page.tsx @@ -21,11 +21,11 @@ import { Typography, } from 'antd'; import type { Dayjs } from 'dayjs'; -import { api } from '@/lib/api'; +import { api, errMsg } from '@/lib/api'; import { canDo } from '@/lib/auth'; import { formatWallTime } from '@/lib/format'; import { refreshReviewBadge } from '@/lib/reviewBadge'; -import { failedReviewIds } from '@/lib/bulkAction'; +import { BULK_REVIEW_MAX, bulkFailureReasonText, failedReviewIds } from '@/lib/bulkAction'; import type { BulkReviewResult } from '@/lib/bulkAction'; import { usePagedList } from '@/lib/usePagedList'; import type { Feedback, FeedbackSummary } from '@/lib/types'; @@ -260,6 +260,10 @@ export default function FeedbacksPage() { const openBulkModal = (action: 'approve' | 'reject') => { if (!selectedFeedbacks.length) return; + if (selectedFeedbacks.length > BULK_REVIEW_MAX) { + message.warning(`单次最多审核 ${BULK_REVIEW_MAX} 条反馈`); + return; + } bulkForm.resetFields(); setBulkAction(action); }; @@ -297,11 +301,13 @@ export default function FeedbacksPage() { const label = bulkAction === 'approve' ? '批量采纳' : '批量拒绝'; if (failedIds.length) { message.warning( - `${label}完成:成功 ${data.success} 条,失败 ${failedIds.length} 条;失败项已保留勾选`, + `${label}完成:成功 ${data.success} 条,失败 ${failedIds.length} 条;失败项已保留勾选${bulkFailureReasonText(data)}`, ); } else { message.success(`${label}完成:成功 ${data.success} 条`); } + } catch (e) { + message.error(errMsg(e)); } finally { setBulkSubmitting(false); } @@ -487,14 +493,14 @@ export default function FeedbacksPage() { 已选 {selectedFeedbacks.length} 条待审核反馈