1
1
<script setup lang="ts">
2
2
import type { ClassroomData } from ' @prisma/client'
3
3
import { Button } from ' @/components/ui/button'
4
+ import {
5
+ Card ,
6
+ CardContent ,
7
+ CardDescription ,
8
+ CardHeader ,
9
+ CardTitle ,
10
+ } from ' @/components/ui/card'
4
11
import Toaster from ' @/components/ui/toast/Toaster.vue'
5
12
import { useToast } from ' @/components/ui/toast/use-toast'
6
13
import { LoaderCircle } from ' lucide-vue-next'
@@ -132,21 +139,21 @@ async function handleSubmit(e: any) {
132
139
</script >
133
140
134
141
<template >
135
- <div >
136
- <div class = " inline-block align-top w-full lg:w-1/2 lg:max-w-[480px] p-5 " >
137
- <div class = " text-2xl " >
138
- 预约教室
139
- </ div >
140
- < div class = " py-5 " / >
142
+ <Card >
143
+ <CardHeader >
144
+ <CardTitle >预约教室</ CardTitle >
145
+ < CardDescription >在此处预约教室</ CardDescription >
146
+ </ CardHeader >
147
+ < CardContent >
141
148
<form class =" space-y-2" @submit =" handleSubmit" >
142
149
<FormField name =" main" >
143
150
<FormItem >
144
151
<FormLabel >预约时间</FormLabel >
145
152
<FormControl >
146
- <div class =" flex flex-col lg :flex-row lg: justify-stretch " >
153
+ <div class =" flex flex-col sm :flex-row space-y-2 sm:space-y-0 sm:space-x-1 justify-start " >
147
154
<!-- This ToggleGroup should be implemented in a better way but anyway it works -->
148
- <ToggleGroup :key =" reloadKey" type =" multiple" variant =" outline" class = " w-fit " >
149
- <div class =" text-center w-10 " >
155
+ <ToggleGroup :key =" reloadKey" type =" multiple" variant =" outline" >
156
+ <div class =" text-muted-foreground text-sm text- center w-7 " >
150
157
每周
151
158
</div >
152
159
<ToggleGroupItem value =" mon" @click =" day[1] = !day[1]" >
@@ -178,6 +185,7 @@ async function handleSubmit(e: any) {
178
185
</div >
179
186
</FormControl >
180
187
</FormItem >
188
+ <div class =" py-1" />
181
189
<FormItem >
182
190
<FormLabel >选择教室</FormLabel >
183
191
<div v-if =" !clubs || !data" >
@@ -209,7 +217,7 @@ async function handleSubmit(e: any) {
209
217
</Select >
210
218
</FormControl >
211
219
</FormItem >
212
- <div class =" py-2 " />
220
+ <div class =" py-1 " />
213
221
<FormItem >
214
222
<FormLabel >社团</FormLabel >
215
223
<FormControl >
@@ -245,11 +253,9 @@ async function handleSubmit(e: any) {
245
253
</SelectContent >
246
254
</Select >
247
255
</FormControl >
248
- <FormDescription >
249
- 选择一个社团
250
- </FormDescription >
251
256
<FormMessage />
252
257
</FormItem >
258
+ <div class =" py-1" />
253
259
<FormItem >
254
260
<FormLabel >备注</FormLabel >
255
261
<FormControl >
@@ -264,11 +270,11 @@ async function handleSubmit(e: any) {
264
270
<div class =" py-2" />
265
271
<Button type =" submit" :disabled =" pending" class =" mr-3" >
266
272
<LoaderCircle v-if =" pending" class =" animate-spin mr-2" />
267
- <span v-if =" !pending" >提交预约申请 </span >
273
+ <span v-if =" !pending" >提交预约 </span >
268
274
<span v-if =" pending" >处理中...</span >
269
275
</Button >
270
276
</form >
271
- </div >
272
- </div >
277
+ </CardContent >
278
+ </Card >
273
279
<Toaster />
274
280
</template >
0 commit comments