Skip to content

Commit

Permalink
fix(statuses): responsive classroom grid
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerzl committed Oct 1, 2024
1 parent 5476764 commit aeb6655
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pages/manage/statuses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const { data, refresh } = await useAsyncData<ClassroomData[]>('classroomStatuses
})
if (data.value) {
console.log('data:', data.value)
data.value = data.value.sort((a: any, b: any) => a.name < b.name ? -1 : 1)
dataLoaded = true
}
Expand Down Expand Up @@ -86,8 +85,8 @@ function status(reservationRecords: ReservationRecord[]) {
</div>
</div>
</div>
<div v-if="dataLoaded" class="flex flex-row flex-wrap gap-4">
<div v-for="classroom in data" :key="classroom.id" class="w-full lg:w-72 rounded-lg border">
<div v-if="dataLoaded" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 mt-2">
<div v-for="classroom in data" :key="classroom.id" class="w-full rounded-lg border">
<div
class="rounded-t-lg w-full px-4 py-2 text-xs" :class="{
'bg-red-800/[.2]': !!status(classroom.ReservationRecord),
Expand All @@ -96,7 +95,7 @@ function status(reservationRecords: ReservationRecord[]) {
>
{{ status(classroom.ReservationRecord) ? `${status(classroom.ReservationRecord)} 使用中` : '空闲' }}
</div>
<div class="rounded-b-lg w-full px-4 py-2 lg:h-20">
<div class="rounded-b-lg w-full px-4 py-2">
<div class="text-2xl font-bold flex flex-row flex-wrap items-center gap-2">
<span class="inline-block">
{{ classroom.name }}
Expand Down

0 comments on commit aeb6655

Please sign in to comment.