diff --git a/desktop/src/features/download/GridDownloadView.vue b/desktop/src/features/download/GridDownloadView.vue index a942200..48340e3 100644 --- a/desktop/src/features/download/GridDownloadView.vue +++ b/desktop/src/features/download/GridDownloadView.vue @@ -26,6 +26,7 @@ const concurrency = ref(8); const groups = ref([]); const outputDir = ref(""); const file = ref(null); +const fileInput = ref(null); const submitting = ref(false); const gridSize = ref("GRID20"); @@ -64,15 +65,20 @@ function syncGroups() { function onFile(event: Event) { const input = event.target as HTMLInputElement; const selected = input.files?.[0] ?? null; + input.value = ""; if (selected && !selected.name.toLowerCase().endsWith(".csv")) { message.warning("区域表只支持 CSV"); - input.value = ""; file.value = null; return; } file.value = selected; } +function clearFile() { + file.value = null; + if (fileInput.value) fileInput.value = ""; +} + async function downloadSample() { const content = "\uFEFF20米栅格ID\r\n541927061\r\n544536471\r\n"; if (!("__TAURI_INTERNALS__" in window)) { @@ -228,8 +234,9 @@ async function start() {
选择文件 - + + 清除 下载例程 {{ file?.name || "不选则下载整个地市" }}