多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.6 KiB

<script lang="ts" setup>
const props = defineProps<{
visible: boolean
}>()
9 months ago
const emit = defineEmits(['expand-record'])
9 months ago
const { t } = useI18n()
const { pageDate, selectedDate, selectedDateRange, activeDates, activeCalendarView } = useCalendarViewStoreOrThrow()
const options = computed(() => {
switch (activeCalendarView.value) {
case 'day' as const:
return [
9 months ago
{ label: 'in this day', value: 'day' },
{ label: 'without dates', value: 'withoutDates' },
{ label: 'in selected hours', value: 'selectedHours' },
{ label: 'all records', value: 'allRecords' },
]
case 'week' as const:
return [
9 months ago
{ label: 'in this week', value: 'week' },
{ label: 'without dates', value: 'withoutDates' },
{ label: 'in selected hours', value: 'selectedHours' },
{ label: 'all records', value: 'allRecords' },
]
case 'month' as const:
return [
9 months ago
{ label: 'in this month', value: 'month' },
{ label: 'without dates', value: 'withoutDates' },
{ label: 'all records', value: 'allRecords' },
{ label: 'in selected date', value: 'selectedDate' },
]
case 'year' as const:
return [
9 months ago
{ label: 'in this year', value: 'year' },
{ label: 'without dates', value: 'withoutDates' },
{ label: 'all records', value: 'allRecords' },
{ label: 'in selected date', value: 'selectedDate' },
]
}
})
</script>
<template>
9 months ago
<div
:class="{
'w-0': !props.visible,
'w-1/4 min-w-[22.1rem]': props.visible,
}"
class="h-full border-l-1 border-gray-200 transition-all"
>
<NcDateWeekSelector
v-if="activeCalendarView === ('day' as const)"
v-model:active-dates="activeDates"
9 months ago
v-model:page-date="pageDate"
v-model:selected-date="selectedDate"
/>
<NcDateWeekSelector
v-else-if="activeCalendarView === ('week' as const)"
v-model:active-dates="activeDatess"
9 months ago
v-model:page-date="pageDate"
v-model:selected-week="selectedDateRange"
week-picker
/>
<NcMonthYearSelector
v-else-if="activeCalendarView === ('month' as const)"
v-model:page-date="pageDate"
v-model:selected-date="selectedDate"
/>
<NcMonthYearSelector
v-else-if="activeCalendarView === ('year' as const)"
v-model:page-date="pageDate"
v-model:selected-date="selectedDate"
year-picker
/>
<div class="px-4 flex flex-col gap-y-6 pt-4">
<div class="flex justify-between items-center">
<span class="text-2xl font-bold">{{ t('objects.Records') }}</span>
9 months ago
<NcSelect :options="options" value="all records" />
</div>
9 months ago
<a-input class="!rounded-lg !border-gray-200 !px-4 !py-2" placeholder="Search your records">
<template #prefix>
9 months ago
<component :is="iconMap.search" class="h-4 w-4 mr-1 text-gray-500" />
</template>
</a-input>
9 months ago
<div
:class="{
'h-[calc(100vh-40rem)]': activeCalendarView === ('day' as const) || activeCalendarView === ('week' as const),
'h-[calc(100vh-29rem)]': activeCalendarView === ('month' as const) || activeCalendarView === ('year' as const),
9 months ago
}"
class="gap-2 flex flex-col nc-scrollbar-md overflow-y-auto nc-calendar-top-height"
>
<LazySmartsheetCalendarSideRecordCard
v-for="(x, id) in Array(50)"
:key="id"
:color="x % 2 === 0 ? 'maroon' : 'blue'"
date="27 April 2003"
name="Saturday HackNight"
@click="emit('expand-record', id)"
/>
</div>
</div>
</div>
</template>
<style lang="scss" scoped></style>