From 0c9faaec3e37c61a93920c758b5c8c57468b044a Mon Sep 17 00:00:00 2001 From: 21819 Date: Mon, 26 Feb 2024 19:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4excel=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/work/Query.vue | 5 ++++- src/views/work/components/MailCheck.vue | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/work/Query.vue b/src/views/work/Query.vue index 4c4c7ce..2542b10 100644 --- a/src/views/work/Query.vue +++ b/src/views/work/Query.vue @@ -242,7 +242,10 @@ const refreshCheckAll = () => { const outputSelectedMail = () => { console.log("outputSelectedMail", solveCheckBox.value); - axios.post('/lan-api/api/work/export', solveCheckBox.value, { + const data = solveCheckBox.value.map((item: any) => item.id) + console.log("data", data) + + axios.post('/lan-api/api/work/export', data, { headers: { 'Content-Type': 'application/json', 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', diff --git a/src/views/work/components/MailCheck.vue b/src/views/work/components/MailCheck.vue index fdc1f75..5b0056f 100644 --- a/src/views/work/components/MailCheck.vue +++ b/src/views/work/components/MailCheck.vue @@ -140,18 +140,20 @@ const result = ref(true) const ifShow = ref(false) const upload = ref() const fileList = ref([]) +const importData = ref([]) const handleUpload: UploadProps['httpRequest'] = (file) => { const formData = new FormData(); // 创建表单数据对象 formData.append("file", file.file); // 将文件添加到表单数据中 return axios.post("/lan-api/api/work/check", formData) // 使用 axios 发送 post 请求到后端 .then((res) => { - // 处理成功的响应 - console.log('checkMsg', res.data); + // 处理成功的响应 if (res.data.data[0]) { + console.log('checkMsg', res.data.data); result.value = false ifShow.value = true form.value = res.data.data + importData.value = res.data.data } else { ifShow.value = true result.value = true @@ -169,7 +171,7 @@ const handleCheck = () => { console.log(query.value) } const handleImport = () => { - request.post({ url: '/work/import', body: form.value }).then((data: any) => { + request.post({ url: '/work/import', body: importData.value }).then((data: any) => { ElMessage.success('下载成功') resetView() }).catch((error: any) => {