|
@@ -6,7 +6,7 @@
|
|
|
</div>
|
|
|
<div class="text-end">
|
|
|
<v-btn prepend-icon="mdi-plus" color="primary" @click="handleAdd">{{ $t('position.newPositionsAdded') }}</v-btn>
|
|
|
- <v-btn prepend-icon="mdi-export-variant" color="primary" variant="tonal" class="ml-3" @click="handleExport">职位列表下载</v-btn>
|
|
|
+ <v-btn :loading="exportLoading" prepend-icon="mdi-export-variant" color="primary" variant="tonal" class="ml-3" @click="handleExport">职位列表下载</v-btn>
|
|
|
</div>
|
|
|
|
|
|
<div class="mt-3">
|
|
@@ -55,6 +55,7 @@ const query = ref({
|
|
|
// hasExpiredData: false, // true 到期职位
|
|
|
hire: false // true 众聘岗位
|
|
|
})
|
|
|
+const exportLoading = ref(false)
|
|
|
|
|
|
const tab = ref(1)
|
|
|
|
|
@@ -80,10 +81,15 @@ const handleAdd = async () => {
|
|
|
}
|
|
|
|
|
|
const handleExport = async () => {
|
|
|
- const data = await getJobAdvertisedExport(query.value)
|
|
|
- const label = tabList.find(e => e.value === tab.value)?.label || ''
|
|
|
- const txt = `职位列表${label? '(' + label + ')' : ''}`
|
|
|
- download.excel(data, txt)
|
|
|
+ exportLoading.value = true
|
|
|
+ try {
|
|
|
+ const data = await getJobAdvertisedExport(query.value)
|
|
|
+ const label = tabList.find(e => e.value === tab.value)?.label || ''
|
|
|
+ const txt = `职位列表${label? '(' + label + ')' : ''}`
|
|
|
+ download.excel(data, txt)
|
|
|
+ } finally {
|
|
|
+ exportLoading.value = false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|