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) {
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
"create": "New Template",
|
||||
"edit": "Edit Template",
|
||||
"namePlaceholder": "Enter template name",
|
||||
"fieldKeyTip": "Unique key, e.g. craft",
|
||||
"fieldKeyTip": "Unique English key",
|
||||
"sortHint": "Field order = display order on consumer page; use arrows to reorder",
|
||||
"defaultFields": {
|
||||
"craft": "Craft",
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
"create": "新建模板",
|
||||
"edit": "编辑模板",
|
||||
"namePlaceholder": "请输入模板名称",
|
||||
"fieldKeyTip": "英文唯一标识,如 craft",
|
||||
"fieldKeyTip": "英文唯一标识",
|
||||
"sortHint": "字段顺序即客户端展示顺序,可用上下箭头调整",
|
||||
"defaultFields": {
|
||||
"craft": "工艺",
|
||||
|
||||
Reference in New Issue
Block a user