From eeb56ae2066c8705dafe701d6509ddea708135ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Mar 2026 20:20:17 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[org-chart]=20=EB=8C=80=ED=91=9C?= =?UTF-8?q?=EC=9D=B4=EC=82=AC=20=EB=AF=B8=EB=B0=B0=EC=B9=98=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8=20=EB=B0=8F=20=EC=88=A8=EA=B8=B4=20=EB=B6=80=EC=84=9C?= =?UTF-8?q?=20=EC=97=B0=EA=B2=B0=EC=84=A0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 대표이사/사장/회장 등 임원직 미배치 목록에서 제외 - ceoName과 일치하는 직원도 미배치에서 제외 - 숨긴 부서의 상위 연결선(vertical connector) 제거 - rootDepts getter에서도 숨긴 부서 필터링 --- resources/views/rd/org-chart.blade.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/resources/views/rd/org-chart.blade.php b/resources/views/rd/org-chart.blade.php index 4f66f9fe..0c9d6347 100644 --- a/resources/views/rd/org-chart.blade.php +++ b/resources/views/rd/org-chart.blade.php @@ -129,11 +129,19 @@ function orgChart() { unassignedSortable: null, hiddenDepts: new Set(), dblClickDept: null, + execTitles: ['대표이사', '사장', '부사장', '회장', '부회장'], - get totalEmployees() { return this.employees.length; }, - get assignedCount() { return this.employees.filter(e => e.department_id).length; }, - get unassignedCount() { return this.employees.filter(e => !e.department_id).length; }, - get rootDepts() { return this.getChildrenSorted(null); }, + isExecutive(emp) { + const pos = (emp.position_label || '').trim(); + if (this.execTitles.includes(pos)) return true; + if (this.ceoName && emp.display_name === this.ceoName) return true; + return false; + }, + get normalEmployees() { return this.employees.filter(e => !this.isExecutive(e)); }, + get totalEmployees() { return this.normalEmployees.length; }, + get assignedCount() { return this.normalEmployees.filter(e => e.department_id).length; }, + get unassignedCount() { return this.normalEmployees.filter(e => !e.department_id).length; }, + get rootDepts() { return this.getChildrenSorted(null).filter(d => !this.isDeptHidden(d.id)); }, getChildrenSorted(parentId) { return this.departments @@ -170,7 +178,7 @@ function orgChart() { renderUnassigned() { const zone = this.$refs.unassignedZone; if (!zone) return; - let emps = this.employees.filter(e => !e.department_id); + let emps = this.employees.filter(e => !e.department_id && !this.isExecutive(e)); if (this.searchUnassigned) { const q = this.searchUnassigned.toLowerCase(); emps = emps.filter(e => (e.display_name || '').toLowerCase().includes(q)); @@ -225,6 +233,7 @@ function orgChart() { buildNodeHtml(dept, level) { const emps = this.getDeptEmployees(dept.id); const children = this.getChildrenSorted(dept.id); + const visibleChildren = children.filter(d => !this.isDeptHidden(d.id)); const total = this.getDeptTotalCount(dept.id); const styles = [ { border:'2px solid #C4B5FD', hBg:'#F5F3FF', hBdr:'#E9D5FF', icon:'ri-building-2-line', iconClr:'#7C3AED', w:'200px' }, @@ -254,7 +263,7 @@ function orgChart() { h += ''; h += `
${total}명
`; h += ''; - if (children.length > 0) { + if (visibleChildren.length > 0) { h += `
`; } h += this.buildChildrenHtml(dept.id, level + 1);