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 <app-layout-chat-left-sidenav-organization-tree
[gotoDeptTree]="gotoDeptTree"
class="organization-side" class="organization-side"
></app-layout-chat-left-sidenav-organization-tree> ></app-layout-chat-left-sidenav-organization-tree>
<!-- <app-layout-chat-left-sidenav-organization <!-- <app-layout-chat-left-sidenav-organization

View File

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

View File

@ -35,12 +35,13 @@ import { OrganizationService } from '@ucap-webmessenger/ui-organization';
animations: ucapAnimations animations: ucapAnimations
}) })
export class OrganizationTreeComponent implements OnInit, OnDestroy { export class OrganizationTreeComponent implements OnInit, OnDestroy {
@Input()
gotoDeptTree: number; gotoDeptTree: number;
companyList$: Observable<Company[]>; companyList$: Observable<Company[]>;
companyCode: string; companyCode: string;
changedTreeCurrentSeqSubscription: Subscription;
departmentInfoList$: Observable<DeptInfo[]>; departmentInfoList$: Observable<DeptInfo[]>;
myDepartmentUserInfoListSubscription: Subscription; myDepartmentUserInfoListSubscription: Subscription;
@ -76,6 +77,15 @@ export class OrganizationTreeComponent implements OnInit, OnDestroy {
select(AppStore.MessengerSelector.QuerySelector.departmentInfoList) 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 this.loginResSubscription = this.store
.pipe( .pipe(
take(1), take(1),
@ -137,6 +147,9 @@ export class OrganizationTreeComponent implements OnInit, OnDestroy {
if (!!this.loginResSubscription) { if (!!this.loginResSubscription) {
this.loginResSubscription.unsubscribe(); this.loginResSubscription.unsubscribe();
} }
if (!!this.changedTreeCurrentSeqSubscription) {
this.changedTreeCurrentSeqSubscription.unsubscribe();
}
if (!!this.myDepartmentUserInfoListSubscription) { if (!!this.myDepartmentUserInfoListSubscription) {
this.myDepartmentUserInfoListSubscription.unsubscribe(); this.myDepartmentUserInfoListSubscription.unsubscribe();
} }
@ -168,6 +181,8 @@ export class OrganizationTreeComponent implements OnInit, OnDestroy {
onSelectedOrganization(deptInfo: DeptInfo) { onSelectedOrganization(deptInfo: DeptInfo) {
this.onClickCancel(); this.onClickCancel();
this.store.dispatch(QueryStore.selectedTree({ deptSeq: deptInfo.seq }));
this.store.dispatch( this.store.dispatch(
QueryStore.selectedDept({ QueryStore.selectedDept({
seq: deptInfo.seq, seq: deptInfo.seq,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,8 @@ import {
integrateSearchDeptUser, integrateSearchDeptUser,
integrateSearchDeptUserSuccess, integrateSearchDeptUserSuccess,
integrateSearchDeptUserFailure, integrateSearchDeptUserFailure,
integrateClearSearchDeptUser integrateClearSearchDeptUser,
selectedTree
} from './actions'; } from './actions';
import * as AuthenticationStore from '@app/store/account/authentication'; 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) => { on(selectedDept, (state, action) => {
return { return {
...state, ...state,

View File

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