diff --git a/src/api/riskItems.ts b/src/api/riskItems.ts index 22b68b6..288bb51 100644 --- a/src/api/riskItems.ts +++ b/src/api/riskItems.ts @@ -28,6 +28,10 @@ export function updateRiskItem(itemId: number, payload: RiskItemUpdate) { return http.patch>(`/v1/risk-items/${itemId}`, payload); } +export function withdrawRiskItem(itemId: number) { + return http.post>(`/v1/risk-items/${itemId}/withdraw`); +} + export function reviewRiskItem(itemId: number, payload: ReviewAction) { return http.post>( `/v1/risk-items/${itemId}/review`, diff --git a/src/pages/ReviewPage.vue b/src/pages/ReviewPage.vue index 6c932ce..a323e0b 100644 --- a/src/pages/ReviewPage.vue +++ b/src/pages/ReviewPage.vue @@ -15,6 +15,7 @@ import { RefreshCw, Save, SlidersHorizontal, + Undo2, Upload, Users, X, @@ -40,6 +41,7 @@ const statusFilter = ref("待审核"); const expandedId = ref(null); const editingId = ref(null); const reviewingId = ref(null); +const withdrawingId = ref(null); const ocrOpen = ref(false); const attachmentError = ref(""); const modelConfig = ref(null); @@ -245,6 +247,20 @@ async function review(item: RiskItem, action: "通过" | "驳回") { reviewingId.value = null; } } +async function withdraw(item: RiskItem) { + if (withdrawingId.value !== null) return; + if (!window.confirm("确认撤回该风险项吗?撤回后将不再显示在审核队列中。")) + return; + withdrawingId.value = item.id; + try { + await store.withdraw(item.id); + if (expandedId.value === item.id) expandedId.value = null; + } catch { + // The exact API error is shown above the queue. + } finally { + withdrawingId.value = null; + } +} function formatDate(value: string | null) { if (!value) return "未记录时间"; return new Intl.DateTimeFormat("zh-CN", { @@ -374,22 +390,37 @@ onMounted(() => { class="review-item" :class="{ expanded: expandedId === item.id }" > - + + { :class="item.status === '待审核' ? 'is-pending' : 'is-pre'" >{{ item.status }} - + > + +