|
|
<template>
|
<InterviewRecordCard :noticeLogsList="displayLogs"></InterviewRecordCard>
|
</template>
|
|
<script lang="ts">
|
import { Component, namespace, Vue, Watch } from "nuxt-property-decorator";
|
import { Appointment, NoticeLogs } from "~/shared/models/appointment.model";
|
|
const appointmentStore = namespace('appointment.store');
|
|
@Component
|
export default class RecordList extends Vue {
|
@appointmentStore.State
|
appointmentDetail!: Appointment;
|
|
displayLogs: NoticeLogs[] = [];
|
|
////////////////////////////////////////////////////////
|
|
@Watch('appointmentDetail', {immediate: true})
|
onAppointmentDetailChange() {
|
if (this.appointmentDetail?.appointmentNoticeLogs.length) {
|
this.displayLogs = this.appointmentDetail?.appointmentNoticeLogs
|
.map((i) => ({ ...i, sortDate: new Date(i.createdDate)}))
|
.sort((preItem, nextItem) => +nextItem.sortDate - +preItem.sortDate);
|
}
|
}
|
|
}
|
</script>
|