Skip to content

Commit 1d97330

Browse files
committed
add icon,loding style in export btn
1 parent a3fb00a commit 1d97330

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/stores/student-store.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export const useStudentStore = defineStore('student', () => {
121121
})
122122

123123
const viewedUserId = ref('')
124+
const exportingStudentInfo = ref(false)
124125
const studentRow = ref<Record<string, any>>({})
125126
const fundPunishVo = ref<any[]>([])
126127
const fundScholarshipVo = ref<any[]>([])
@@ -333,6 +334,14 @@ export const useStudentStore = defineStore('student', () => {
333334
return
334335
}
335336

337+
exportingStudentInfo.value = true
338+
const exportingMessage = ElMessage({
339+
type: 'info',
340+
message: '正在导出中,请稍候...',
341+
duration: 0,
342+
showClose: true,
343+
})
344+
336345
try {
337346
const response = await studentFilesApi.exportStudentInfo(viewedUserId.value)
338347

@@ -350,6 +359,9 @@ export const useStudentStore = defineStore('student', () => {
350359
ElMessage.success('导出成功')
351360
} catch (error) {
352361
ElMessage.error('导出失败,请稍后重试')
362+
} finally {
363+
exportingStudentInfo.value = false
364+
exportingMessage.close()
353365
}
354366
}
355367

@@ -387,6 +399,7 @@ export const useStudentStore = defineStore('student', () => {
387399
query,
388400
total,
389401
loadings,
402+
exportingStudentInfo,
390403
hasSelectedItems,
391404
studentRow,
392405
visible,

src/views/student/index.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@
7979
</el-tab-pane>
8080
<el-button
8181
style="display: block; margin: 0px auto; padding: 10px 20px"
82+
:loading="exportingStudentInfo"
8283
@click="exportStudentInfo()"
83-
>导出信息</el-button
84+
><font-awesome-icon
85+
icon="fa-solid fa-file-arrow-down"
86+
style="color: rgb(116, 192, 252)"
87+
/>导出信息</el-button
8488
>
8589
</el-tabs>
8690
</el-dialog>
@@ -96,6 +100,7 @@ import { useStudentStore } from '@/stores/student-store'
96100
const studentStore = useStudentStore()
97101
98102
const {
103+
fieldConfigs,
99104
tableColumns,
100105
getDisplayValue,
101106
handleSelectionChange,
@@ -109,11 +114,11 @@ const {
109114
} = studentStore
110115
111116
const {
112-
fieldConfigs,
113117
tableData,
114118
query,
115119
total,
116120
loadings,
121+
exportingStudentInfo,
117122
studentRow,
118123
visible,
119124
detailPageSize,

0 commit comments

Comments
 (0)