| | |
| | | const size = ref(10); |
| | | const total = ref(0); |
| | | const rows = ref<AppointmentRow[]>([]); |
| | | const visitDateRange = ref<string[]>([]); |
| | | const DEFAULT_VISIT_DATE_LOOKBACK_DAYS = 7; |
| | | const visitDateRange = ref<string[]>(createDefaultVisitDateRange()); |
| | | |
| | | const deptOptions = ref<DeptOption[]>([]); |
| | | const passAreaOptions = ref<PassAreaOption[]>([]); |
| | |
| | | || (detail.createTime as string | undefined); |
| | | return value ? formatActionTime(value) : "-"; |
| | | }); |
| | | |
| | | function formatDateForQuery(date: Date) { |
| | | const year = date.getFullYear(); |
| | | const month = `${date.getMonth() + 1}`.padStart(2, "0"); |
| | | const day = `${date.getDate()}`.padStart(2, "0"); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | |
| | | function createDefaultVisitDateRange() { |
| | | const end = new Date(); |
| | | const start = new Date(end); |
| | | start.setDate(start.getDate() - DEFAULT_VISIT_DATE_LOOKBACK_DAYS); |
| | | return [formatDateForQuery(start), formatDateForQuery(end)]; |
| | | } |
| | | |
| | | function indexMethod(index: number) { |
| | | return (page.value - 1) * size.value + index + 1; |
| | |
| | | filters.approvalStatus = ""; |
| | | filters.visitorKeyword = ""; |
| | | filters.visitReasonCode = ""; |
| | | visitDateRange.value = []; |
| | | visitDateRange.value = createDefaultVisitDateRange(); |
| | | page.value = 1; |
| | | load(); |
| | | } |