From 4e4f120eb3eea2ebb4ccd70b3fecc57c8bb46bb7 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 30 Jul 2024 09:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E9=99=A2=E5=AF=BC=E5=87=BA=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E4=BD=99=E6=89=93=E5=8D=B0=EF=BC=8C=E8=81=94?= =?UTF-8?q?=E8=B0=83=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/student/OnlineClassModelStudent.vue | 6 ++---- src/utils/zipdownload.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/student/OnlineClassModelStudent.vue b/src/components/student/OnlineClassModelStudent.vue index 9880e784..dd48bd66 100644 --- a/src/components/student/OnlineClassModelStudent.vue +++ b/src/components/student/OnlineClassModelStudent.vue @@ -126,7 +126,7 @@ import dialog from "@/utils/dialog"; import {ONLINE_COURSE_DEL} from "@/api/ThirdApi"; import {useStore} from "vuex"; import {useAsyncStu, useResetRef} from "@/utils/useCommon"; -import {downLoadZipOne} from "@/utils/zipdownload"; +import {downLoadXlsx} from "@/utils/zipdownload"; const props = defineProps({ permissions: { type: String, @@ -329,9 +329,7 @@ function exportStu() { window.open(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudent?type=3&&thirdType=8&pid=${searchParams.value.pid}`); } function exportStudy() { - console.log(formData.value,searchParams.value.pid,'formData.value') - window.open(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=3&&thirdType=8&pid=${searchParams.value.pid}`) - downLoadZipOne(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=3&&thirdType=8&pid=${searchParams.value.pid}`,formData.value.name) + downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=3&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员') } defineExpose({ searchStu, diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index 14025f5d..55d06244 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -5,14 +5,14 @@ const mimeMap = { xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', zip: 'application/zip' } -export function downLoadZipOne(str, filename) { +export function downLoadXlsx(str, filename) { axios({ method: 'get', url: str, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getCookieForName("token") } }).then(res => { - resolveBlob(res, mimeMap.zip,filename) + resolveBlob(res, mimeMap.xlsx,filename) }) } const baseUrl = process.env.VUE_APP_ACT_API