diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html
index 2d939702..3d65cdda 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html
+++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html
@@ -125,31 +125,6 @@
결제
-
0) || (updateInfo$ | async)"
diff --git a/projects/ucap-webmessenger-ui-organization/src/lib/components/tree.component.ts b/projects/ucap-webmessenger-ui-organization/src/lib/components/tree.component.ts
index 3f20b426..6ea13868 100644
--- a/projects/ucap-webmessenger-ui-organization/src/lib/components/tree.component.ts
+++ b/projects/ucap-webmessenger-ui-organization/src/lib/components/tree.component.ts
@@ -12,7 +12,7 @@ import {
import { MatTreeFlattener, MatTree } from '@angular/material';
import { NGXLogger } from 'ngx-logger';
-import { DeptInfo } from '@ucap-webmessenger/protocol-query';
+import { DeptInfo, DeptType } from '@ucap-webmessenger/protocol-query';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { FlatTreeControl } from '@angular/cdk/tree';
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
@@ -101,6 +101,26 @@ export class TreeComponent implements OnInit, OnDestroy, AfterViewInit {
}
});
this.dataSource.data = rootNodeList;
+
+ // 내부서 트리 오픈
+ if (!this.myDeptRoot) {
+ this.myDeptRoot = this.getMyRoot(
+ deptInfoList,
+ this.loginRes.departmentCode,
+ []
+ );
+ }
+
+ if (!!this.myDeptRoot) {
+ this.myDeptRoot.reverse().forEach(seq => {
+ this.treeControl.dataNodes.some(dn => {
+ if (dn.deptInfo.seq === seq) {
+ this.treeControl.expand(dn);
+ return;
+ }
+ });
+ });
+ }
}
@Input()
@@ -118,6 +138,7 @@ export class TreeComponent implements OnInit, OnDestroy, AfterViewInit {
@ViewChild(PerfectScrollbarDirective, { static: false })
psDirectiveRef?: PerfectScrollbarDirective;
+ myDeptRoot: number[];
treeControl: FlatTreeControl;
treeFlattener: MatTreeFlattener;
dataSource: VirtualScrollTreeFlatDataSource;
@@ -183,6 +204,9 @@ export class TreeComponent implements OnInit, OnDestroy, AfterViewInit {
ngAfterViewInit(): void {
this.dataSource.cdkVirtualScrollViewport = this.cvsvOrganization;
+
+ this.cvsvOrganization.scrollToOffset(100);
+ this.psDirectiveRef.update();
}
hasChild = (_: number, node: FlatNode) => node.expandable;
@@ -253,4 +277,24 @@ export class TreeComponent implements OnInit, OnDestroy, AfterViewInit {
}
return undefined;
}
+
+ private getMyRoot(
+ deptInfoList: DeptInfo[],
+ srcDeptSeq: number,
+ data: number[]
+ ): number[] {
+ const arr = deptInfoList.filter(info => info.seq === srcDeptSeq);
+
+ if (!!arr && arr.length > 0) {
+ const info = arr[0];
+ data.push(info.seq);
+ if (info.type === DeptType.Root) {
+ return data;
+ } else {
+ return this.getMyRoot(deptInfoList, info.parentSeq, data);
+ }
+ } else {
+ return data;
+ }
+ }
}