From ca9208f68628ca0a6bd21ea85074402c8572430a Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Thu, 6 Aug 2026 16:55:38 +0700 Subject: [PATCH] [CLAUDE] FE-Admin: KHKK bo khung o nhap tren dong da co, giu khung dong them (FE-only, 0-mig) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anh khoanh 2 khoi doi nhau tren man nhap: - khoi bao 2 DONG DA CO -> "Cac cai mau bo di nhe" - mui ten toi DONG THEM -> "De mac dinh cai nay thoi" Doc thanh MOT CAP: dong da co thi doc nhu DU LIEU (bo khung o nhap), rieng dong them moi giu khung mac dinh vi no la FORM. Cach doc kia (xoa du lieu mau) khong khop — anh da co nut thung rac, va "de mac dinh" khong ap duoc cho mot dong chua co du lieu nao. Da lam — CHI doi VE, KHONG doi hanh vi: - o Hang muc + o Gia cua DONG DA CO: border-slate-200 bg-white -> border-transparent bg-transparent + hover:border-slate-200 + focus-visible:border-brand-500 focus-visible:bg-white Dung khuon o Ghi chu ngay duoi (da ghost tu S175) => 3 truong cua mot dong nay NOI CUNG mot ngon ngu. - Van la that: sua duoc, tu luu khi roi o. Mui ten dropdown cua native select van hien nen khong mat tin-hieu "o nay bam duoc". - DONG THEM: KHONG dung mot ky tu nao ("de mac dinh cai nay thoi"). Do duoc (truoc/sau + control duong): - nguon o Hang muc CO khung: @HEAD = 2 (ca dong du lieu lan dong them) -> now = 1 (chi con dong them). dist admin/user = 1/1. - CONTROL duong: lop ghost MOI cua dong du lieu = 1/1 o ca 2 dist => phep do dang chay, khong phai 0-vi-do-hong. - dem lop ghost trong nguon = 4 = select + gia + ghi chu (dong du lieu) + ghi chu (dong them, von da ghost). - 🔴 :554 va :685 co class GIONG HET NHAU => sua kem ngu canh, khong replace-all; da doi chieu sau khi sua: 2 o con khung deu nam trong dong them (:693 :718). Diff CHI 2 file FE, 0 file BE => .NET test khong the bi anh huong, bo qua vong test do (khai ro). 2 app build sach · SHA IDENTICAL (verify identical @HEAD TRUOC khi copy de). Co-Authored-By: Claude Opus 5 --- fe-admin/src/components/khkk/KhkkDetailContent.tsx | 12 ++++++++++-- fe-user/src/components/khkk/KhkkDetailContent.tsx | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/fe-admin/src/components/khkk/KhkkDetailContent.tsx b/fe-admin/src/components/khkk/KhkkDetailContent.tsx index b44f387..dcf9d04 100644 --- a/fe-admin/src/components/khkk/KhkkDetailContent.tsx +++ b/fe-admin/src/components/khkk/KhkkDetailContent.tsx @@ -551,7 +551,14 @@ export function KhkkDetailContent({ onChange={(e) => e.target.value && assignLine.mutate({ lineId: l.id, catalogEntryId: e.target.value })} disabled={assignLine.isPending} aria-label={`Chọn hạng mục cho dòng ${l.id}`} - className="h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-xs text-slate-700 focus-visible:border-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" + // [S177 — anh: "Các cái mẫu bỏ đi nhé"] DÒNG ĐÃ CÓ = đọc như DỮ + // LIỆU, không như form: viền trong suốt + nền trong suốt, khung chỉ + // hiện khi rê chuột / vào ô. Đúng khuôn ô Ghi chú ngay dưới (đã ghost + // từ S175) ⇒ 3 trường của một dòng nay CÙNG một ngôn ngữ. + // 🔴 Chỉ đổi VẺ, KHÔNG đổi hành vi: vẫn `` thật, vẫn sửa + // được, vẫn tự lưu. Mũi tên dropdown của native select vẫn hiện nên + // không mất tín-hiệu "ô này bấm được". + className="h-8 w-full rounded border border-transparent bg-transparent px-2 text-xs text-slate-700 hover:border-slate-200 focus-visible:border-brand-500 focus-visible:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" > {l.catalogEntryId && !(catalogOptions.data ?? []).some((c) => c.id === l.catalogEntryId) && ( @@ -607,7 +614,8 @@ export function KhkkDetailContent({ if (!Number.isFinite(v) || v < 0) { e.target.value = String(l.proposedAmount); return } if (v !== l.proposedAmount) saveLineField.mutate({ lineId: l.id, proposedAmount: v }) }} - className="h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-right text-xs tabular-nums text-brand-800 focus-visible:border-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" + // [S177] Cùng lý lẽ với ô hạng mục ngay trên — bỏ khung ở dòng ĐÃ CÓ. + className="h-8 w-full rounded border border-transparent bg-transparent px-2 text-right text-xs tabular-nums text-brand-800 hover:border-slate-200 focus-visible:border-brand-500 focus-visible:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" /> ) : moneyOrDash(l.proposedAmount)}