保誠-保戶業務員媒合平台
Tomas
2022-01-21 1ea7200df3ce7be88dcdc53f5043c182282f77dc
PAMapp/pages/myAppointmentList/appointmentList.vue
@@ -63,18 +63,11 @@
    @Watch('myAppointmentList')
    onMyAppointmentListChange(): void {
      const tempViewList = this.myAppointmentList
          .filter(item => item.communicateStatus === this.contactStatus.RESERVED);
          .filter(item => item.communicateStatus === this.contactStatus.RESERVED)
          .map((item) => ({ ...item, sortTime: new Date(item.lastModifiedDate)}))
          .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime);
      // TODO: 後續如需針對 unreadList 做更細緻的排序,則需請後端提供判斷依據(例如: createTime)。[Tomas, 2021/12/16];
      const unreadList = tempViewList
                    .filter((item) => !item.consultantReadTime);
      const readList = tempViewList
                    .filter((item) => item.consultantReadTime)
                    .map((item) => ({ ...item, sortTime: new Date(item.consultantReadTime)}))
                    .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime);
      this.appointmentList = [ ...unreadList, ...readList];
      this.filterList = this.appointmentList;
      this.filterList = tempViewList;
      this.getCurrentPage();
    }