1515 <v-col cols =" 12" md =" 6" >
1616 <v-btn-toggle v-model =" toggle" divided >
1717 <v-btn value =" unique" >
18- <span class = " hidden-sm-and-down " >独立页面</span >
18+ <span >独立页面</span >
1919
2020 <v-icon end >
2121 mdi-format-align-left
2222 </v-icon >
2323 </v-btn >
2424
2525 <v-btn value =" other" >
26- <span class = " hidden-sm-and-down " >使用已有文档</span >
26+ <span >使用已有文档</span >
2727
2828 <v-icon end >
2929 mdi-open-in-new
123123 :subtitle =" a.timestamp" >
124124 <template #append >
125125 <v-btn icon =" mdi-content-copy" variant =" text" density =" compact"
126- @click =" toClipboard (`/api/files/${a.file_id}`)" />
126+ @click =" clipboard.copy (`/api/files/${a.file_id}`)" />
127127 </template >
128128 </v-list-item >
129129 </v-list >
130130 </v-navigation-drawer >
131131
132- <v-snackbar v-model =" successSnakebar" :timeout =" 2000" color =" success" variant = " tonal " >
132+ <v-snackbar v-model =" successSnakebar" :timeout =" 2000" color =" success" >
133133 提交成功
134134 </v-snackbar >
135- <v-snackbar v-model =" errorSnakebar" :timeout =" 2000" color =" error" variant = " tonal " >
135+ <v-snackbar v-model =" errorSnakebar" :timeout =" 2000" color =" error" >
136136 {{ errorPrompt }}
137137 </v-snackbar >
138138 </div >
@@ -156,11 +156,10 @@ import type { VTabs } from 'vuetify/components';
156156import type { VRow } from ' vuetify/components/VGrid' ;
157157import axios from ' axios' ;
158158import type { AxiosResponse } from ' axios' ;
159- import useClipboard from " vue-clipboard3 " ;
159+ import clipboard from " clipboard " ;
160160import type { CourseWithDbId } from ' ~/utils/types' ;
161161
162162const route = useRoute ();
163- const { toClipboard } = await useClipboard ();
164163const majorId = route .params .major ;
165164/**
166165 * 课程编号
@@ -365,7 +364,7 @@ const submit = () => {
365364 }).then (() => {
366365 submitted .value = true ;
367366 }).catch ((err ) => {
368- errorPrompt .value = err .data .message ;
367+ errorPrompt .value = ` ${ err .statusCode }: ${ err . data .message } ` ;
369368 errorSnakebar .value = true ;
370369 });
371370}
@@ -383,7 +382,7 @@ const uploadFiles = () => {
383382 axios .post (' /api/files/upload' , formData , {
384383 onUploadProgress : (progressEvent ) => {
385384 const percentCompleted = Math .round ((progressEvent .loaded * 100 ) / progressEvent .total ! );
386- uploadProgress .value = percentCompleted ;
385+ uploadProgress .value = Math . min ( percentCompleted , 95 ) ;
387386 },
388387 }).then ((res : AxiosResponse <{ resList: AttachmentInfo [] }>) => {
389388 newAttachments .value = newAttachments .value .concat (res .data .resList );
0 commit comments