导出详细学习记录 - loading 更改 4

This commit is contained in:
gengxin
2025-03-03 19:25:21 +08:00
parent e2958b6f2a
commit bd09fd3c57
2 changed files with 3 additions and 10 deletions

View File

@@ -92,7 +92,7 @@
</a-button> </a-button>
</a-col> </a-col>
<a-col> <a-col>
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff; width: 150px" :disabled="exportDisabled" <a-button class="cus-btn" style="background: #4ea6ff; color: #fff; width: 150px"
@click="exportStudy"> @click="exportStudy">
导出详细学习记录 导出详细学习记录
</a-button> </a-button>
@@ -330,19 +330,13 @@ function reset() {
function exportStu() { function exportStu() {
window.open(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudent?type=3&&thirdType=8&pid=${searchParams.value.pid}`); window.open(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudent?type=3&&thirdType=8&pid=${searchParams.value.pid}`);
} }
const exportDisabled = ref(false);
const exportStudy = async () => { const exportStudy = async () => {
if(studentList.value.length == 0){ if(studentList.value.length == 0){
return message.warning('暂无可导出的学习记录') return message.warning('暂无可导出的学习记录')
} }
exportDisabled.value = true;
console.log("开始执行 gx 刷新"); console.log("开始执行 gx 刷新");
try { downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=4&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员学习记录');
await downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=4&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员学习记录');
} finally {
exportDisabled.value = false;
}
} }
defineExpose({ defineExpose({
searchStu, searchStu,

View File

@@ -1,12 +1,11 @@
import axios from 'axios' import axios from 'axios'
import {ref} from 'vue'
import {getCookieForName} from "@/api/method"; import {getCookieForName} from "@/api/method";
const mimeMap = { const mimeMap = {
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
zip: 'application/zip' zip: 'application/zip'
} }
export async function downLoadXlsx(str, filename) { export function downLoadXlsx(str, filename) {
await axios({ await axios({
method: 'get', method: 'get',
url: str, url: str,