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 += `