feat: 添加客户端主题切换并优化导出状态
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<template #icon><n-icon :component="FolderOutline" /></template>
|
||||
{{ t('pages.traceCode.manageGroups') }}
|
||||
</n-button>
|
||||
<n-button v-if="auth.canWrite" @click="onExport">
|
||||
<n-button v-if="auth.canWrite" :loading="exporting" :disabled="exporting" @click="onExport">
|
||||
<template #icon><n-icon :component="DownloadOutline" /></template>
|
||||
{{ exportButtonText }}
|
||||
</n-button>
|
||||
@@ -277,6 +277,7 @@ const qrModal = ref(false);
|
||||
const qrSrc = ref('');
|
||||
const qrUrl = ref('');
|
||||
let qrBlobUrl = '';
|
||||
const exporting = ref(false);
|
||||
|
||||
const groupModal = ref(false);
|
||||
const groupForm = reactive<{ name: string }>({ name: '' });
|
||||
@@ -577,6 +578,7 @@ const exportButtonText = computed(() => {
|
||||
});
|
||||
|
||||
async function onExport() {
|
||||
if (exporting.value) return;
|
||||
const params: Record<string, unknown> = {};
|
||||
if (checkedKeys.value.length) {
|
||||
params.ids = checkedKeys.value.map(String).join(',');
|
||||
@@ -589,7 +591,12 @@ async function onExport() {
|
||||
if (query.outboundStatus) params.outboundStatus = query.outboundStatus;
|
||||
if (query.keyword) params.keyword = query.keyword;
|
||||
}
|
||||
await downloadFile('/trace-codes/export', 'trace-codes.zip', params);
|
||||
exporting.value = true;
|
||||
try {
|
||||
await downloadFile('/trace-codes/export', 'trace-codes.zip', params);
|
||||
} finally {
|
||||
exporting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function batchAssignGroup(key: string) {
|
||||
|
||||
Reference in New Issue
Block a user