fix: [org-chart] 대표이사 미배치 제외 및 숨긴 부서 연결선 제거
- 대표이사/사장/회장 등 임원직 미배치 목록에서 제외 - ceoName과 일치하는 직원도 미배치에서 제외 - 숨긴 부서의 상위 연결선(vertical connector) 제거 - rootDepts getter에서도 숨긴 부서 필터링
This commit is contained in:
@@ -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 += '</div>';
|
||||
h += `<div style="padding:3px 8px;background:#F9FAFB;border-top:1px solid #F3F4F6;font-size:11px;color:#9CA3AF;">${total}명</div>`;
|
||||
h += '</div>';
|
||||
if (children.length > 0) {
|
||||
if (visibleChildren.length > 0) {
|
||||
h += `<div style="width:1px;height:24px;background:#D1D5DB;"></div>`;
|
||||
}
|
||||
h += this.buildChildrenHtml(dept.id, level + 1);
|
||||
|
||||
Reference in New Issue
Block a user