modify presence class in user-list-item.component
This commit is contained in:
parent
6aa2602dd0
commit
c270e40621
@ -1,16 +1,13 @@
|
|||||||
<!--체크박스 보여줄때는 <div class="list-item checkbox" matRipple> 클래스에 checkbox만 추가-->
|
<!--체크박스 보여줄때는 <div class="list-item checkbox" matRipple> 클래스에 checkbox만 추가-->
|
||||||
<div class="list-item" matRipple>
|
<div class="list-item" matRipple>
|
||||||
<!--pcOn , pcOut pcOff , pcOther-->
|
<!--pcOn , pcOut pcOff , pcOther-->
|
||||||
<span class="presence pcOn" *ngIf="userPresence"
|
<span class="presence" [ngClass]="getPresence(PresenceType.PC)"
|
||||||
>{{ userPresence.pcStatus }}
|
*ngIf="userPresence && userPresence.pcStatus">{{ userPresence.pcStatus }}
|
||||||
</span>
|
</span>
|
||||||
<dl class="item-default">
|
<dl class="item-default">
|
||||||
<dt>
|
<dt>
|
||||||
<img
|
<img class="thumbnail" [src]="profileImageRoot + userInfo.profileImageFile"
|
||||||
class="thumbnail"
|
onerror="this.src='assets/images/img_nophoto_50.png'" />
|
||||||
[src]="profileImageRoot + userInfo.profileImageFile"
|
|
||||||
onerror="this.src='assets/images/img_nophoto_50.png'"
|
|
||||||
/>
|
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="info">
|
<dd class="info">
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
@ -22,10 +19,7 @@
|
|||||||
{{ userInfo.deptName }}
|
{{ userInfo.deptName }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="msg-status" *ngIf="!checkable && userInfo.intro.trim() && !compactable">
|
||||||
class="msg-status"
|
|
||||||
*ngIf="!checkable && userInfo.intro.trim() && !compactable"
|
|
||||||
>
|
|
||||||
{{ userInfo.intro }}
|
{{ userInfo.intro }}
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
|
@ -13,6 +13,7 @@ import { NGXLogger } from 'ngx-logger';
|
|||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||||
import { KEY_VER_INFO, VerInfo2 } from '@app/types/ver-info.type';
|
import { KEY_VER_INFO, VerInfo2 } from '@app/types/ver-info.type';
|
||||||
|
import { StatusCode } from '@ucap-webmessenger/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ucap-profile-user-list-item',
|
selector: 'ucap-profile-user-list-item',
|
||||||
@ -36,6 +37,10 @@ export class UserListItemComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
userPresence: StatusBulkInfo | StatusInfo;
|
userPresence: StatusBulkInfo | StatusInfo;
|
||||||
|
|
||||||
|
get PresenceType() {
|
||||||
|
return PresenceType;
|
||||||
|
}
|
||||||
|
|
||||||
// private profileImageRootSubscription: Subscription;
|
// private profileImageRootSubscription: Subscription;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -63,4 +68,42 @@ export class UserListItemComponent implements OnInit, OnDestroy {
|
|||||||
// this.profileImageRootSubscription.unsubscribe();
|
// this.profileImageRootSubscription.unsubscribe();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPresence(type: string): string {
|
||||||
|
let status: string;
|
||||||
|
let rtnClass = '';
|
||||||
|
switch (type) {
|
||||||
|
case 'pc':
|
||||||
|
status = this.userPresence.pcStatus;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!status) {
|
||||||
|
switch (status) {
|
||||||
|
case StatusCode.OnLine:
|
||||||
|
rtnClass = type + 'On';
|
||||||
|
break;
|
||||||
|
case StatusCode.Away:
|
||||||
|
rtnClass = type + 'Out';
|
||||||
|
break;
|
||||||
|
case StatusCode.Busy:
|
||||||
|
rtnClass = type + 'Other';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rtnClass = type + 'Off';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rtnClass;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PresenceType {
|
||||||
|
PC = 'pc',
|
||||||
|
MOBILE = 'mobile',
|
||||||
|
CONFERENCE = 'conference',
|
||||||
|
MOBILE_CONFERENCE = 'mobileConference',
|
||||||
|
PHONE = 'phone',
|
||||||
|
IMESSENER = 'imessenger'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user