Format CSS and add border-left indicators for review items

This commit is contained in:
2026-05-09 12:28:39 +08:00
parent 4ec7b67ed0
commit 27a170ec0c
2 changed files with 463 additions and 324 deletions
+396 -310
View File
@@ -1,555 +1,641 @@
:root { :root {
--primary: #4f46e5; --primary: #4f46e5;
--primary-light: #818cf8; --primary-light: #818cf8;
--primary-bg: #eef2ff; --primary-bg: #eef2ff;
--success: #10b981; --success: #10b981;
--warning: #f59e0b; --warning: #f59e0b;
--danger: #ef4444; --danger: #ef4444;
--bg: #f8fafc; --bg: #f8fafc;
--card-bg: #ffffff; --card-bg: #ffffff;
--text: #1e293b; --text: #1e293b;
--text-secondary: #64748b; --text-secondary: #64748b;
--border: #e2e8f0; --border: #e2e8f0;
--sidebar-width: 220px; --sidebar-width: 220px;
} }
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box; box-sizing: border-box;
} }
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; font-family:
background: var(--bg); -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
color: var(--text); "Microsoft YaHei", sans-serif;
background: var(--bg);
color: var(--text);
} }
.app { .app {
display: flex; display: flex;
min-height: 100vh; min-height: 100vh;
} }
/* Sidebar */ /* Sidebar */
.sidebar { .sidebar {
width: var(--sidebar-width); width: var(--sidebar-width);
background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
color: white; color: white;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
z-index: 100; z-index: 100;
} }
.sidebar-header { .sidebar-header {
padding: 24px 20px; padding: 24px 20px;
border-bottom: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.1);
} }
.logo { .logo {
font-size: 22px; font-size: 22px;
font-weight: 700; font-weight: 700;
} }
.logo-sub { .logo-sub {
font-size: 11px; font-size: 11px;
color: rgba(255,255,255,0.5); color: rgba(255, 255, 255, 0.5);
display: block; display: block;
margin-top: 4px; margin-top: 4px;
} }
.nav-links { .nav-links {
flex: 1; flex: 1;
padding: 12px 0; padding: 12px 0;
} }
.nav-link { .nav-link {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
padding: 10px 20px; padding: 10px 20px;
color: rgba(255,255,255,0.65); color: rgba(255, 255, 255, 0.65);
text-decoration: none; text-decoration: none;
font-size: 14px; font-size: 14px;
transition: all 0.2s; transition: all 0.2s;
position: relative; position: relative;
} }
.nav-link:hover { .nav-link:hover {
color: white; color: white;
background: rgba(255,255,255,0.08); background: rgba(255, 255, 255, 0.08);
} }
.nav-link.active { .nav-link.active {
color: white; color: white;
background: rgba(255,255,255,0.12); background: rgba(255, 255, 255, 0.12);
border-right: 3px solid var(--primary-light); border-right: 3px solid var(--primary-light);
} }
.nav-link .badge { .nav-link .badge {
margin-left: auto; margin-left: auto;
background: var(--danger); background: var(--danger);
color: white; color: white;
font-size: 11px; font-size: 11px;
padding: 2px 7px; padding: 2px 7px;
border-radius: 10px; border-radius: 10px;
} }
.sidebar-footer { .sidebar-footer {
padding: 16px 20px; padding: 16px 20px;
border-top: 1px solid rgba(255,255,255,0.1); border-top: 1px solid rgba(255, 255, 255, 0.1);
} }
.version { .version {
font-size: 11px; font-size: 11px;
color: rgba(255,255,255,0.3); color: rgba(255, 255, 255, 0.3);
} }
/* Main Content */ /* Main Content */
.main-content { .main-content {
margin-left: var(--sidebar-width); margin-left: var(--sidebar-width);
flex: 1; flex: 1;
padding: 24px 32px; padding: 24px 32px;
min-height: 100vh; min-height: 100vh;
} }
/* Page Header */ /* Page Header */
.page-header { .page-header {
margin-bottom: 24px; margin-bottom: 24px;
} }
.page-header h2 { .page-header h2 {
font-size: 24px; font-size: 24px;
font-weight: 600; font-weight: 600;
} }
.page-header p { .page-header p {
color: var(--text-secondary); color: var(--text-secondary);
margin-top: 4px; margin-top: 4px;
font-size: 14px; font-size: 14px;
} }
/* Cards */ /* Cards */
.card { .card {
background: var(--card-bg); background: var(--card-bg);
border-radius: 12px; border-radius: 12px;
border: 1px solid var(--border); border: 1px solid var(--border);
padding: 20px; padding: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.card-header { .card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 16px; margin-bottom: 16px;
} }
.card-header h3 { .card-header h3 {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
} }
/* Stats Grid */ /* Stats Grid */
.stats-grid { .stats-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px; gap: 16px;
margin-bottom: 24px; margin-bottom: 24px;
} }
.stat-card { .stat-card {
background: var(--card-bg); background: var(--card-bg);
border-radius: 12px; border-radius: 12px;
border: 1px solid var(--border); border: 1px solid var(--border);
padding: 20px; padding: 20px;
} }
.stat-card .stat-label { .stat-card .stat-label {
font-size: 13px; font-size: 13px;
color: var(--text-secondary); color: var(--text-secondary);
margin-bottom: 8px; margin-bottom: 8px;
} }
.stat-card .stat-value { .stat-card .stat-value {
font-size: 28px; font-size: 28px;
font-weight: 700; font-weight: 700;
} }
.stat-card .stat-sub { .stat-card .stat-sub {
font-size: 12px; font-size: 12px;
color: var(--text-secondary); color: var(--text-secondary);
margin-top: 4px; margin-top: 4px;
} }
.stat-value.income { color: var(--success); } .stat-value.income {
.stat-value.expense { color: var(--danger); } color: var(--success);
.stat-value.warning { color: var(--warning); } }
.stat-value.primary { color: var(--primary); } .stat-value.expense {
color: var(--danger);
}
.stat-value.warning {
color: var(--warning);
}
.stat-value.primary {
color: var(--primary);
}
/* Buttons */ /* Buttons */
.btn { .btn {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
padding: 8px 16px; padding: 8px 16px;
border-radius: 8px; border-radius: 8px;
border: none; border: none;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
cursor: pointer; cursor: pointer;
transition: all 0.2s; transition: all 0.2s;
} }
.btn-primary { .btn-primary {
background: var(--primary); background: var(--primary);
color: white; color: white;
} }
.btn-primary:hover { background: #4338ca; } .btn-primary:hover {
background: #4338ca;
}
.btn-secondary { .btn-secondary {
background: var(--bg); background: var(--bg);
color: var(--text); color: var(--text);
border: 1px solid var(--border); border: 1px solid var(--border);
} }
.btn-secondary:hover { background: var(--border); } .btn-secondary:hover {
background: var(--border);
}
.btn-success { .btn-success {
background: var(--success); background: var(--success);
color: white; color: white;
} }
.btn-danger { .btn-danger {
background: var(--danger); background: var(--danger);
color: white; color: white;
} }
.btn-sm { .btn-sm {
padding: 4px 10px; padding: 4px 10px;
font-size: 12px; font-size: 12px;
} }
/* Form elements */ /* Form elements */
.form-group { .form-group {
margin-bottom: 16px; margin-bottom: 16px;
} }
.form-group label { .form-group label {
display: block; display: block;
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 500;
margin-bottom: 6px; margin-bottom: 6px;
color: var(--text); color: var(--text);
} }
.form-input, .form-select { .form-input,
width: 100%; .form-select {
padding: 9px 12px; width: 100%;
border: 1px solid var(--border); padding: 9px 12px;
border-radius: 8px; border: 1px solid var(--border);
font-size: 14px; border-radius: 8px;
transition: border-color 0.2s; font-size: 14px;
background: white; transition: border-color 0.2s;
background: white;
} }
.form-input:focus, .form-select:focus { .form-input:focus,
outline: none; .form-select:focus {
border-color: var(--primary-light); outline: none;
box-shadow: 0 0 0 3px var(--primary-bg); border-color: var(--primary-light);
box-shadow: 0 0 0 3px var(--primary-bg);
} }
/* Table */ /* Table */
.table-container { .table-container {
overflow-x: auto; overflow-x: auto;
} }
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: 13px; font-size: 13px;
} }
th { th {
text-align: left; text-align: left;
padding: 12px 12px; padding: 12px 12px;
background: var(--bg); background: var(--bg);
font-weight: 600; font-weight: 600;
color: var(--text-secondary); color: var(--text-secondary);
border-bottom: 2px solid var(--border); border-bottom: 2px solid var(--border);
white-space: nowrap; white-space: nowrap;
} }
td { td {
padding: 10px 12px; padding: 10px 12px;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
} }
tr:hover { background: var(--bg); } tr:hover {
background: var(--bg);
}
/* Tags */ /* Tags */
.tag { .tag {
display: inline-block; display: inline-block;
padding: 2px 8px; padding: 2px 8px;
border-radius: 4px; border-radius: 4px;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 500;
} }
.tag-income { background: #d1fae5; color: #065f46; } .tag-income {
.tag-expense { background: #fee2e2; color: #991b1b; } background: #d1fae5;
.tag-transfer { background: #dbeafe; color: #1e40af; } color: #065f46;
.tag-matched { background: #e0e7ff; color: #3730a3; } }
.tag-unreviewed { background: #fef3c7; color: #92400e; } .tag-expense {
background: #fee2e2;
color: #991b1b;
}
.tag-transfer {
background: #dbeafe;
color: #1e40af;
}
.tag-matched {
background: #e0e7ff;
color: #3730a3;
}
.tag-unreviewed {
background: #fef3c7;
color: #92400e;
}
/* Review items */ /* Review items */
.review-item { .review-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 14px 16px; padding: 14px 16px;
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: 10px; border-radius: 10px;
margin-bottom: 10px; margin-bottom: 10px;
gap: 14px; gap: 14px;
transition: all 0.2s; transition: all 0.2s;
} }
.review-item:hover { .review-item:hover {
border-color: var(--primary-light); border-color: var(--primary-light);
box-shadow: 0 2px 8px rgba(0,0,0,0.04); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
} }
.review-item.reviewed { .review-item.reviewed {
opacity: 0.7; background: var(--bg);
background: var(--bg); }
.review-item.income-border {
border-left: 3px solid var(--success);
}
.review-item.expense-border {
border-left: 3px solid var(--danger);
} }
.review-item .amount-col { .review-item .amount-col {
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
min-width: 110px; min-width: 110px;
} }
.review-item .info-col { .review-item .info-col {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
} }
.review-item .info-col .title { .review-item .info-col .title {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
} }
.review-item .info-col .meta { .review-item .info-col .meta {
color: var(--text-secondary); color: var(--text-secondary);
font-size: 12px; font-size: 12px;
margin-top: 2px; margin-top: 2px;
} }
.review-item .action-col { .review-item .action-col {
display: flex; display: flex;
gap: 8px; gap: 8px;
align-items: center; align-items: center;
} }
/* Upload zone */ /* Upload zone */
.upload-zone { .upload-zone {
border: 2px dashed var(--border); border: 2px dashed var(--border);
border-radius: 12px; border-radius: 12px;
padding: 40px; padding: 40px;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
transition: all 0.2s; transition: all 0.2s;
} }
.upload-zone:hover, .upload-zone.drag-over { .upload-zone:hover,
border-color: var(--primary-light); .upload-zone.drag-over {
background: var(--primary-bg); border-color: var(--primary-light);
background: var(--primary-bg);
} }
.upload-zone .upload-icon { .upload-zone .upload-icon {
font-size: 48px; font-size: 48px;
margin-bottom: 12px; margin-bottom: 12px;
} }
/* Modal */ /* Modal */
.modal-overlay { .modal-overlay {
position: fixed; position: fixed;
inset: 0; inset: 0;
background: rgba(0,0,0,0.4); background: rgba(0, 0, 0, 0.4);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 1000; z-index: 1000;
} }
.modal { .modal {
background: white; background: white;
border-radius: 16px; border-radius: 16px;
padding: 24px; padding: 24px;
max-width: 500px; max-width: 500px;
width: 90%; width: 90%;
max-height: 80vh; max-height: 80vh;
overflow-y: auto; overflow-y: auto;
} }
.modal h3 { .modal h3 {
font-size: 18px; font-size: 18px;
margin-bottom: 16px; margin-bottom: 16px;
} }
/* Filter bar */ /* Filter bar */
.filter-bar { .filter-bar {
display: flex; display: flex;
gap: 12px; gap: 12px;
flex-wrap: wrap; flex-wrap: wrap;
align-items: flex-end; align-items: flex-end;
margin-bottom: 20px; margin-bottom: 20px;
} }
.filter-bar .form-group { .filter-bar .form-group {
margin-bottom: 0; margin-bottom: 0;
min-width: 150px; min-width: 150px;
} }
/* Pagination */ /* Pagination */
.pagination { .pagination {
display: flex; display: flex;
gap: 8px; gap: 8px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 20px; margin-top: 20px;
} }
.pagination button { .pagination button {
padding: 6px 12px; padding: 6px 12px;
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: 6px; border-radius: 6px;
background: white; background: white;
cursor: pointer; cursor: pointer;
font-size: 13px; font-size: 13px;
} }
.pagination button.active { .pagination button.active {
background: var(--primary); background: var(--primary);
color: white; color: white;
border-color: var(--primary); border-color: var(--primary);
} }
.pagination button:disabled { .pagination button:disabled {
opacity: 0.4; opacity: 0.4;
cursor: not-allowed; cursor: not-allowed;
} }
/* Empty state */ /* Empty state */
.empty-state { .empty-state {
text-align: center; text-align: center;
padding: 60px 0; padding: 60px 0;
color: var(--text-secondary); color: var(--text-secondary);
} }
.empty-state .icon { .empty-state .icon {
font-size: 48px; font-size: 48px;
margin-bottom: 16px; margin-bottom: 16px;
} }
/* Tabs */ /* Tabs */
.tabs { .tabs {
display: flex; display: flex;
gap: 0; gap: 0;
border-bottom: 2px solid var(--border); border-bottom: 2px solid var(--border);
margin-bottom: 20px; margin-bottom: 20px;
} }
.tab { .tab {
padding: 10px 20px; padding: 10px 20px;
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: var(--text-secondary); color: var(--text-secondary);
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
margin-bottom: -2px; margin-bottom: -2px;
transition: all 0.2s; transition: all 0.2s;
} }
.tab:hover { color: var(--text); } .tab:hover {
color: var(--text);
}
.tab.active { .tab.active {
color: var(--primary); color: var(--primary);
border-bottom-color: var(--primary); border-bottom-color: var(--primary);
} }
/* Source type labels */ /* Source type labels */
.source-type-label { .source-type-label {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
padding: 2px 8px; padding: 2px 8px;
border-radius: 4px; border-radius: 4px;
font-size: 11px; font-size: 11px;
font-weight: 600; font-weight: 600;
} }
.source-alipay { background: #dbeafe; color: #1e40af; } .source-alipay {
.source-wechat { background: #d1fae5; color: #065f46; } background: #dbeafe;
.source-bank_debit { background: #fef3c7; color: #92400e; } color: #1e40af;
.source-bank_credit { background: #fef3c7; color: #92400e; } }
.source-abc { background: #e0e7ff; color: #3730a3; } .source-wechat {
.source-credit_card { background: #fee2e2; color: #991b1b; } background: #d1fae5;
color: #065f46;
}
.source-bank_debit {
background: #fef3c7;
color: #92400e;
}
.source-bank_credit {
background: #fef3c7;
color: #92400e;
}
.source-abc {
background: #e0e7ff;
color: #3730a3;
}
.source-credit_card {
background: #fee2e2;
color: #991b1b;
}
/* Loading */ /* Loading */
.loading { .loading {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 40px; padding: 40px;
color: var(--text-secondary); color: var(--text-secondary);
} }
.spinner { .spinner {
width: 24px; width: 24px;
height: 24px; height: 24px;
border: 3px solid var(--border); border: 3px solid var(--border);
border-top-color: var(--primary); border-top-color: var(--primary);
border-radius: 50%; border-radius: 50%;
animation: spin 0.8s linear infinite; animation: spin 0.8s linear infinite;
margin-right: 10px; margin-right: 10px;
} }
@keyframes spin { @keyframes spin {
to { transform: rotate(360deg); } to {
transform: rotate(360deg);
}
} }
/* Toast */ /* Toast */
.toast { .toast {
position: fixed; position: fixed;
top: 20px; top: 20px;
right: 20px; right: 20px;
padding: 12px 20px; padding: 12px 20px;
border-radius: 10px; border-radius: 10px;
color: white; color: white;
font-size: 14px; font-size: 14px;
z-index: 2000; z-index: 2000;
animation: slideIn 0.3s ease; animation: slideIn 0.3s ease;
} }
.toast-success { background: var(--success); } .toast-success {
.toast-error { background: var(--danger); } background: var(--success);
}
.toast-error {
background: var(--danger);
}
@keyframes slideIn { @keyframes slideIn {
from { transform: translateX(100%); opacity: 0; } from {
to { transform: translateX(0); opacity: 1; } transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
} }
/* Responsive */ /* Responsive */
@media (max-width: 768px) { @media (max-width: 768px) {
.sidebar { width: 60px; } .sidebar {
.sidebar .nav-link span:not(.badge) { display: none; } width: 60px;
.sidebar .logo-sub { display: none; } }
.main-content { margin-left: 60px; padding: 16px; } .sidebar .nav-link span:not(.badge) {
.stats-grid { grid-template-columns: repeat(2, 1fr); } display: none;
.filter-bar { flex-direction: column; } }
.sidebar .logo-sub {
display: none;
}
.main-content {
margin-left: 60px;
padding: 16px;
}
.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
.filter-bar {
flex-direction: column;
}
} }
+67 -14
View File
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useRef, useCallback } from "react"; import React, { useState, useEffect, useRef, useCallback } from "react";
import { Edit3, Loader2 } from "lucide-react"; import { Edit3, Loader2, Check, X } from "lucide-react";
import { import {
getDeals, getDeals,
updateDeal, updateDeal,
@@ -22,15 +22,25 @@ export default function Review() {
const [editingDeal, setEditingDeal] = useState(null); const [editingDeal, setEditingDeal] = useState(null);
const [showReviewed, setShowReviewed] = useState(true); const [showReviewed, setShowReviewed] = useState(true);
const [keyword, setKeyword] = useState(""); const [keyword, setKeyword] = useState("");
const [debouncedKeyword, setDebouncedKeyword] = useState("");
const [confirmingId, setConfirmingId] = useState(null);
const sentinelRef = useRef(null); const sentinelRef = useRef(null);
const debounceRef = useRef(null);
useEffect(() => { useEffect(() => {
loadCategories(); loadCategories();
}, []); }, []);
// 搜索防抖 300ms
useEffect(() => {
if (debounceRef.current) clearTimeout(debounceRef.current);
debounceRef.current = setTimeout(() => setDebouncedKeyword(keyword), 300);
return () => clearTimeout(debounceRef.current);
}, [keyword]);
useEffect(() => { useEffect(() => {
loadReviewDeals(1, false); loadReviewDeals(1, false);
}, [showReviewed, keyword]); }, [showReviewed, debouncedKeyword]);
async function loadCategories() { async function loadCategories() {
try { try {
@@ -57,7 +67,7 @@ export default function Review() {
sort_order: "DESC", sort_order: "DESC",
}; };
if (!showReviewed) params.reviewed = 0; if (!showReviewed) params.reviewed = 0;
if (keyword) params.keyword = keyword; if (debouncedKeyword) params.keyword = debouncedKeyword;
const result = await getDeals(params); const result = await getDeals(params);
if (append) { if (append) {
@@ -94,7 +104,7 @@ export default function Review() {
const handleLoadMore = useCallback(() => { const handleLoadMore = useCallback(() => {
if (loadingMore || page >= totalPages) return; if (loadingMore || page >= totalPages) return;
loadReviewDeals(page + 1, true); loadReviewDeals(page + 1, true);
}, [loadingMore, page, totalPages, showReviewed, keyword]); }, [loadingMore, page, totalPages, showReviewed, debouncedKeyword]);
// 自动滚动加载:哨兵元素进入视口时触发 // 自动滚动加载:哨兵元素进入视口时触发
useEffect(() => { useEffect(() => {
@@ -118,6 +128,16 @@ export default function Review() {
} catch (err) {} } catch (err) {}
} }
// 行内快速确认:信任当前AI分类,一键标记已确认
async function handleQuickConfirm(deal) {
setConfirmingId(deal.id);
try {
await updateDeal(deal.id, { reviewed: 1 });
loadReviewDeals(1, false);
} catch (err) {}
setConfirmingId(null);
}
const hasMore = page < totalPages; const hasMore = page < totalPages;
return ( return (
@@ -184,7 +204,7 @@ export default function Review() {
{deals.map((deal) => ( {deals.map((deal) => (
<div <div
key={deal.id} key={deal.id}
className={`review-item ${deal.reviewed ? "reviewed" : ""}`} className={`review-item${deal.reviewed ? " reviewed" : ""}${deal.direction === "income" ? " income-border" : " expense-border"}`}
> >
<div <div
className={`amount-col ${deal.direction === "income" ? "stat-value income" : "stat-value expense"}`} className={`amount-col ${deal.direction === "income" ? "stat-value income" : "stat-value expense"}`}
@@ -199,17 +219,22 @@ export default function Review() {
{formatDate(deal.deal_date)} · {formatDate(deal.deal_date)} ·
{deal.counterparty && <span> {deal.counterparty} ·</span>} {deal.counterparty && <span> {deal.counterparty} ·</span>}
{deal.category && ( {deal.category && (
<span <span className="tag tag-matched">{deal.category}</span>
className="tag tag-matched"
style={{ marginLeft: 4 }}
>
{deal.category}
</span>
)} )}
{deal.reviewed === 1 && ( {deal.reviewed === 1 ? (
<span style={{ marginLeft: 6, color: "var(--success)" }}> <span
className="tag tag-income"
style={{ marginLeft: 6 }}
>
✓ 已确认 ✓ 已确认
</span> </span>
) : (
<span
className="tag tag-unreviewed"
style={{ marginLeft: 6 }}
>
待确认
</span>
)} )}
{deal.match_count > 1 && ( {deal.match_count > 1 && (
<span <span
@@ -230,6 +255,23 @@ export default function Review() {
{deal.transactions.length}笔 {deal.transactions.length}笔
</span> </span>
)} )}
{deal.reviewed !== 1 && (
<button
className="btn btn-success btn-sm"
onClick={() => handleQuickConfirm(deal)}
disabled={confirmingId === deal.id}
>
{confirmingId === deal.id ? (
<Loader2
size={12}
style={{ animation: "spin 0.8s linear infinite" }}
/>
) : (
<Check size={12} />
)}
确认
</button>
)}
<button <button
className="btn btn-secondary btn-sm" className="btn btn-secondary btn-sm"
onClick={() => setEditingDeal({ ...deal })} onClick={() => setEditingDeal({ ...deal })}
@@ -452,6 +494,17 @@ export default function Review() {
> >
取消 取消
</button> </button>
<button
className="btn btn-secondary"
onClick={() =>
handleUpdateDeal(editingDeal.id, {
category: editingDeal.category,
ai_description: editingDeal.ai_description,
})
}
>
仅保存
</button>
<button <button
className="btn btn-primary" className="btn btn-primary"
onClick={() => onClick={() =>
@@ -462,7 +515,7 @@ export default function Review() {
}) })
} }
> >
保存并确认 <Check size={14} /> 保存并确认
</button> </button>
</div> </div>
</div> </div>