bugfix ::

1. 조직도 부서원 조회 후  클릭으로  트리 이동.
2. 조직도에서 다른부서 클릭
3. 1에서 검색후 클릭한 사람 다시 검색 후 클릭
>> 조직도 이동 안됨. 수정.
This commit is contained in:
leejinho 2020-04-01 11:24:46 +09:00
parent fb85cc2977
commit 88a341ca58
11 changed files with 41 additions and 25 deletions

View File

@ -28,7 +28,6 @@
"
>
<app-layout-chat-left-sidenav-organization-tree
[gotoDeptTree]="gotoDeptTree"
class="organization-side"
></app-layout-chat-left-sidenav-organization-tree>
<!-- <app-layout-chat-left-sidenav-organization

View File

@ -59,9 +59,6 @@ import { TranslateService } from '@ngx-translate/core';
animations: ucapAnimations
})
export class LeftSideComponent implements OnInit, OnDestroy {
@Input()
gotoDeptTree: number;
@Output()
openProfile = new EventEmitter<{
userSeq: number;

View File

@ -35,12 +35,13 @@ import { OrganizationService } from '@ucap-webmessenger/ui-organization';
animations: ucapAnimations
})
export class OrganizationTreeComponent implements OnInit, OnDestroy {
@Input()
gotoDeptTree: number;
companyList$: Observable<Company[]>;
companyCode: string;
changedTreeCurrentSeqSubscription: Subscription;
departmentInfoList$: Observable<DeptInfo[]>;
myDepartmentUserInfoListSubscription: Subscription;
@ -76,6 +77,15 @@ export class OrganizationTreeComponent implements OnInit, OnDestroy {
select(AppStore.MessengerSelector.QuerySelector.departmentInfoList)
);
this.changedTreeCurrentSeqSubscription = this.store
.pipe(select(AppStore.MessengerSelector.QuerySelector.selectedTree))
.subscribe(curDeptSeq => {
if (!!curDeptSeq && curDeptSeq > -1) {
// 트리에 포커싱 되어야 할 deptseq 를 구독했다가 밀어 넣어준다.
this.gotoDeptTree = curDeptSeq;
}
});
this.loginResSubscription = this.store
.pipe(
take(1),
@ -137,6 +147,9 @@ export class OrganizationTreeComponent implements OnInit, OnDestroy {
if (!!this.loginResSubscription) {
this.loginResSubscription.unsubscribe();
}
if (!!this.changedTreeCurrentSeqSubscription) {
this.changedTreeCurrentSeqSubscription.unsubscribe();
}
if (!!this.myDepartmentUserInfoListSubscription) {
this.myDepartmentUserInfoListSubscription.unsubscribe();
}
@ -168,6 +181,8 @@ export class OrganizationTreeComponent implements OnInit, OnDestroy {
onSelectedOrganization(deptInfo: DeptInfo) {
this.onClickCancel();
this.store.dispatch(QueryStore.selectedTree({ deptSeq: deptInfo.seq }));
this.store.dispatch(
QueryStore.selectedDept({
seq: deptInfo.seq,

View File

@ -17,7 +17,6 @@
<app-layout-messenger-organization
(openProfile)="onClickOpenProfile($event)"
(createConference)="onClickConferenceCreate($event)"
(gotoDeptTree)="onClickGotoDeptTree($event)"
[style.display]="
MainMenu.Organization === (this.gnbMenuIndex$ | async) ? 'block' : 'none'
"

View File

@ -20,10 +20,9 @@ export class MainContentsComponent implements OnInit {
openProfile = new EventEmitter<{
userSeq: number;
}>();
@Output()
sendCall = new EventEmitter<string>();
@Output()
gotoDeptTree = new EventEmitter<number>();
@Output()
closeRightDrawer = new EventEmitter();
@ -54,10 +53,6 @@ export class MainContentsComponent implements OnInit {
this.sendCall.emit(calleeNumber);
}
onClickGotoDeptTree(deptSeq: number) {
this.gotoDeptTree.emit(deptSeq);
}
onCloseRightDrawer() {
this.closeRightDrawer.emit();
}

View File

@ -32,6 +32,7 @@ import * as AppStore from '@app/store';
import * as SettingsStore from '@app/store/messenger/settings';
import * as SyncStore from '@app/store/messenger/sync';
import * as ChatStore from '@app/store/messenger/chat';
import * as QueryStore from '@app/store/messenger/query';
import { Observable, Subscription, BehaviorSubject, merge, of } from 'rxjs';
import { PresenceType, StatusCode } from '@ucap-webmessenger/core';
@ -78,9 +79,6 @@ export class OrganizationComponent implements OnInit, OnDestroy {
@Output()
openProfile = new EventEmitter<number>();
@Output()
gotoDeptTree = new EventEmitter<number>();
@Output()
createConference = new EventEmitter<number[]>();
@ -492,8 +490,10 @@ export class OrganizationComponent implements OnInit, OnDestroy {
smsUtil.openSendSms(this.loginRes.tokenString, employeeNum);
}
onClickGotoDeptTree(deptSeq: number) {
this.gotoDeptTree.emit(deptSeq);
// 현재 트리에 포커싱 되어야 할 deptseq 를 지정.
this.store.dispatch(QueryStore.selectedTree({ deptSeq }));
}
/** Handling Filters */

View File

@ -7,7 +7,6 @@
<mat-drawer #leftSideDrawer mode="side" [disableClose]="true" opened>
<app-layout-messenger-left-side
#leftSideContainer
[gotoDeptTree]="gotoDeptTree"
(openProfile)="onClickOpenProfile($event)"
(sendCall)="sendClickToCall($event)"
(sendSms)="openSms($event)"
@ -29,7 +28,6 @@
<app-layout-messenger-main-contents
[selectedChat]="this.selectedChat$ | async"
(openProfile)="onClickOpenProfile($event)"
(gotoDeptTree)="onClickGotoDeptTree($event)"
(closeRightDrawer)="onCloseRightDrawer()"
(sendCall)="sendClickToCall($event)"
(createConference)="conferenceCreate($event)"

View File

@ -101,8 +101,6 @@ export class MainPageComponent implements OnInit, OnDestroy {
loginResSubscription: Subscription;
environmentsInfo: EnvironmentsInfo;
gotoDeptTree: number;
showLeftDrawer = true;
showLeftDrawerIndicator = false;
onLeftDrawerIndicator = false;
@ -529,10 +527,6 @@ export class MainPageComponent implements OnInit, OnDestroy {
}
}
onClickGotoDeptTree(deptSeq: number) {
this.gotoDeptTree = deptSeq;
}
onCloseRightDrawer() {
this.rightDrawer.close();
}

View File

@ -43,6 +43,11 @@ export const deptFailure = createAction(
props<{ error: any }>()
);
export const selectedTree = createAction(
'[Messenger::Query] selected Department on tree Seq',
props<{ deptSeq: number }>()
);
/** 트리 > 부서 선택 > 부서원 조회 */
export const selectedDept = createAction(
'[Messenger::Query] selected Department on tree',

View File

@ -16,7 +16,8 @@ import {
integrateSearchDeptUser,
integrateSearchDeptUserSuccess,
integrateSearchDeptUserFailure,
integrateClearSearchDeptUser
integrateClearSearchDeptUser,
selectedTree
} from './actions';
import * as AuthenticationStore from '@app/store/account/authentication';
@ -37,6 +38,13 @@ export const reducer = createReducer(
};
}),
on(selectedTree, (state, action) => {
return {
...state,
selectedTree: action.deptSeq
};
}),
on(selectedDept, (state, action) => {
return {
...state,

View File

@ -14,6 +14,7 @@ export interface State {
isSearch: boolean;
selectedDepartmentProcessing: boolean;
selectedDepartment: SelectedDept | null;
selectedTree: number | null;
searchDepartmentUserInfoList: UserInfoSS[] | null;
departmentUserInfoList: UserInfoSS[] | null;
@ -30,6 +31,7 @@ export const initialState: State = {
isSearch: false,
selectedDepartmentProcessing: false,
selectedDepartment: null,
selectedTree: null,
searchDepartmentUserInfoList: null,
departmentUserInfoList: null,
@ -56,6 +58,10 @@ export function selectors<S>(selector: Selector<any, State>) {
selector,
(state: State) => state.selectedDepartment
),
selectedTree: createSelector(
selector,
(state: State) => state.selectedTree
),
searchDepartmentUserInfoList: createSelector(
selector,