From ec517f7174cc7c14068d7f55922d7fc1a3f67bca Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Tue, 16 Jun 2026 11:23:58 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20FE-User:=20c=C3=A2y=20t=E1=BB=95=20c?= =?UTF-8?q?h=E1=BB=A9c=20g=E1=BB=91c=20"SOLUTION=20COMPANY"=20->=20to?= =?UTF-8?q?=E1=BA=A3=20xu=E1=BB=91ng=20ph=C3=B2ng=20ban?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anh: hiển thị cha-con với gốc SOLUTION COMPANY trên cùng, phòng ban fan-out xuống (giống NamGroup "Nam Group" là gốc). Gộp nút "Tất cả phòng ban" + list phẳng thành 1 node gốc công ty trong EmployeesListPage org-tree panel: chevron mở/gập (companyOpen, mở mặc định) + bấm tên = pickDept(null) tất cả NV + CountBadge tổng; các phòng ban render TreeNode depth=1 toả xuống dưới. Build PASS fe-user (tsc -b). fe-user only (mirror fe-admin defer cùng Phase B). Co-Authored-By: Claude Opus 4.8 (1M context) --- fe-user/src/pages/hrm/EmployeesListPage.tsx | 65 ++++++++++++++------- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/fe-user/src/pages/hrm/EmployeesListPage.tsx b/fe-user/src/pages/hrm/EmployeesListPage.tsx index 3138aef..a821a7f 100644 --- a/fe-user/src/pages/hrm/EmployeesListPage.tsx +++ b/fe-user/src/pages/hrm/EmployeesListPage.tsx @@ -78,6 +78,7 @@ export function EmployeesListPage() { const [localSearch, setLocalSearch] = useState(search) const [treeOpenMobile, setTreeOpenMobile] = useState(false) + const [companyOpen, setCompanyOpen] = useState(true) // gốc công ty mở mặc định // Org tree (consume /departments/tree). Class-level [Authorize] only → any // authenticated user. Counts come pre-rolled-up from BE (TotalEmployeeCount). @@ -175,30 +176,54 @@ export function EmployeesListPage() {
- - {tree.isLoading ? (
Đang tải cây tổ chức…
- ) : !tree.data || tree.data.length === 0 ? ( -
Chưa có phòng ban.
) : (
    - {tree.data.map(n => ( - - ))} + {/* Gốc công ty — bấm = tất cả NV; các phòng ban toả xuống dưới (cha→con) */} +
  • +
    + + +
    + {companyOpen && + (!tree.data || tree.data.length === 0 ? ( +
    Chưa có phòng ban.
    + ) : ( +
      + {tree.data.map(n => ( + + ))} +
    + ))} +
)}