From 0947155d758503ed65f52e59e0557aa0308a0149 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 8 Nov 2022 15:07:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E9=9B=86):=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=AF=BC=E5=87=BAExcel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/data/ViewTable.vue | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue index 8ee482c617..b78ea0c3d2 100644 --- a/frontend/src/views/dataset/data/ViewTable.vue +++ b/frontend/src/views/dataset/data/ViewTable.vue @@ -462,21 +462,27 @@ export default { this.showExport = false }, exportDatasetRequest() { - if (this.table.id) { - this.table.row = 100000 - this.table.filename = this.exportForm.name - this.table.expressionTree = this.exportForm.expressionTree - exportDataset(this.table).then((res) => { - const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) - const link = document.createElement('a') - link.style.display = 'none' - link.href = URL.createObjectURL(blob) - link.download = this.exportForm.name + '.xlsx' // 下载的文件名 - document.body.appendChild(link) - link.click() - document.body.removeChild(link) - }) - } + this.$refs['exportForm'].validate((valid) => { + if (valid) { + if (this.table.id) { + this.table.row = 100000 + this.table.filename = this.exportForm.name + this.table.expressionTree = this.exportForm.expressionTree + exportDataset(this.table).then((res) => { + const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.style.display = 'none' + link.href = URL.createObjectURL(blob) + link.download = this.exportForm.name + '.xlsx' // 下载的文件名 + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + }) + } + } else { + return false + } + }) } } }