diff --git a/apps/cs/src/pages/menu/lib/utils.ts b/apps/cs/src/pages/menu/lib/utils.ts index 0e219047d..a5cb921a6 100644 --- a/apps/cs/src/pages/menu/lib/utils.ts +++ b/apps/cs/src/pages/menu/lib/utils.ts @@ -153,6 +153,7 @@ export const filterUserOrganizationTreeDataByKeyword = ( ): NodeModel[] => { return Array.from( treeData.reduce((matchedNodes, node) => { + if (node.data && "ognzSn" in node.data) return matchedNodes; // 조직 노드는 필터링 제외 if (!node.text.includes(keyword)) return matchedNodes; matchedNodes.add(node); diff --git a/apps/cs/src/pages/menu/ui/organization-search-dialog.tsx b/apps/cs/src/pages/menu/ui/organization-search-dialog.tsx index 19e3fcf87..eb942fe11 100644 --- a/apps/cs/src/pages/menu/ui/organization-search-dialog.tsx +++ b/apps/cs/src/pages/menu/ui/organization-search-dialog.tsx @@ -12,7 +12,9 @@ import { import { Button, Dialog, + DialogClose, DialogContent, + DialogFooter, DialogHeader, DialogTitle, DialogTrigger, @@ -52,10 +54,22 @@ function OrganizationSearchDialog({ }); const handleSelectNode = (node: NodeModel) => { + if (node.data && "ognzSn" in node.data) return; setSelectedNode(node); handleUserSelect(node.data as TreeUser); }; + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + e.stopPropagation(); + setTree(filterUserOrganizationTreeDataByKeyword(treeData ?? [], keyword)); + }; + + const handleReset = () => { + setKeyword(""); + setTree(treeData ?? []); + }; + useEffect(() => { setTree(treeData ?? []); }, [treeData]); @@ -73,21 +87,25 @@ function OrganizationSearchDialog({ 담당자 조회
-
- setKeyword(e.target.value)} - /> - +
+
+ setKeyword(e.target.value)} + /> + + +
@@ -116,6 +134,16 @@ function OrganizationSearchDialog({
+ + + + + + + + );