- 직원 카드를 드래그하여 부서에 배치합니다. 부서 헤더를 드래그하여 순서를 변경하거나 다른 부서 아래로 이동할 수 있습니다.
+ 직원 카드를 드래그하여 부서에 배치합니다. 부서 헤더를 드래그하여 순서를 변경하거나 다른 부서 아래로 이동할 수 있습니다. 부서 헤더를 더블클릭하면 숨기기 버튼이 나타납니다.
@@ -105,6 +127,8 @@ function orgChart() {
deptSortables: [],
empSortables: [],
unassignedSortable: null,
+ hiddenDepts: new Set(),
+ dblClickDept: null,
get totalEmployees() { return this.employees.length; },
get assignedCount() { return this.employees.filter(e => e.department_id).length; },
@@ -187,7 +211,7 @@ function orgChart() {
},
buildChildrenHtml(parentId, level) {
- const children = this.getChildrenSorted(parentId);
+ const children = this.getChildrenSorted(parentId).filter(d => !this.isDeptHidden(d.id));
if (!children.length && parentId !== null) {
return `
하위 부서 드롭
`;
}
@@ -212,11 +236,14 @@ function orgChart() {
let h = `
`;
h += ``;
h += `
`;
- h += `
`;
+ h += `
`;
h += ``;
h += ``;
h += `${this.esc(dept.name)}`;
if (dept.code) h += `(${this.esc(dept.code)})`;
+ if (this.dblClickDept === dept.id) {
+ h += ``;
+ }
h += '