This commit is contained in:
Megghy
2023-10-19 11:48:52 +08:00
parent eb8df943e3
commit 20a086cfb5
4 changed files with 210 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
<script setup lang="ts">
import { useWindowSize } from '@vueuse/core'
import { NGrid, NList, NListItem, NSpace, NCard, NEmpty, NGridItem } from 'naive-ui'
import { ref } from 'vue'
import { ScheduleWeekInfo } from '@/api/api-models'
import { QueryGetAPI } from '@/api/query'
import { SCHEDULE_API_URL } from '@/data/constants'
const { width } = useWindowSize()
defineProps<{
schedules: ScheduleWeekInfo[]
}>()
</script>
<template>
<NEmpty v-if="(schedules?.length ?? 0) == 0" />
<NList>
<NListItem v-for="item in schedules" v-bind:key="item.year + ' ' + item.week">
<NGrid x-gap="12" :cols="7">
<NGridItem v-for="(day, index) in item.days" v-bind:key="index">
<NCard size="small" style="height: 100px; width: 100%">
<template #header-extra>
{{ day ? day.tag : '休息' }}
</template>
</NCard>
</NGridItem>
</NGrid>
</NListItem>
</NList>
<NGrid v-if="width > 1000"> </NGrid>
</template>