{{ t('mall.dailyPush.export_limit') }}
-
+
{{ preset }}
-
+
{{ t('mall.dailyPush.export_all_matched') }}
{{ t('mall.dailyPush.export_matched_count', { count: matchedCount }) }}
-
+
,{{ t('mall.dailyPush.export_actual_count', { count: actualExportCount }) }}
-
- {{ t('mall.dailyPush.export_large_warning', { max: maxLimit }) }}
+
+ {{ t('mall.dailyPush.export_large_warning') }}
@@ -84,7 +84,6 @@ const visible = defineModel({ default: false })
const exporting = ref(false)
const countLoading = ref(false)
const matchedCount = ref(0)
-const maxLimit = ref(100000)
const limitPresets = [1000, 5000, 10000, 50000]
const fieldOptions = computed(() => [
@@ -101,10 +100,15 @@ const fieldOptions = computed(() => [
const form = reactive({
fields: fieldOptions.value.map((item) => item.value),
- exportLimit: 10000,
+ exportLimit: 0,
})
-const actualExportCount = computed(() => Math.min(form.exportLimit, matchedCount.value, maxLimit.value))
+const actualExportCount = computed(() => {
+ if (form.exportLimit <= 0) {
+ return matchedCount.value
+ }
+ return Math.min(form.exportLimit, matchedCount.value)
+})
const selectAllFields = () => {
form.fields = fieldOptions.value.map((item) => item.value)
@@ -115,7 +119,7 @@ const clearFields = () => {
}
const useMatchedCount = () => {
- form.exportLimit = Math.min(matchedCount.value || 1, maxLimit.value)
+ form.exportLimit = 0
}
const buildExportParams = () => {
@@ -123,7 +127,7 @@ const buildExportParams = () => {
return {
...filter,
fields: form.fields,
- export_limit: actualExportCount.value,
+ export_limit: form.exportLimit <= 0 ? 0 : form.exportLimit,
}
}
@@ -136,7 +140,6 @@ const loadMatchedCount = async () => {
params: baTable.table.filter || {},
})
matchedCount.value = res.data.count
- maxLimit.value = res.data.max_limit
} catch {
matchedCount.value = baTable.table.total || 0
} finally {
@@ -197,7 +200,7 @@ const submitExport = async () => {
const disposition = String(response.headers['content-disposition'] || '')
const filenameMatch = disposition.match(/filename="?([^";]+)"?/i)
- const filename = filenameMatch?.[1] || `daily_push_${Date.now()}.csv`
+ const filename = filenameMatch?.[1] || `daily_push_${Date.now()}.xlsx`
downloadBlob(blob, filename)
ElNotification({