mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 19:06:45 +08:00
导出详细学习记录 - loading 更改 5
This commit is contained in:
@@ -93,7 +93,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col>
|
<a-col>
|
||||||
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff; width: 150px"
|
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff; width: 150px"
|
||||||
:loading="exportLoading"
|
:disabled="exportDisabled"
|
||||||
@click="exportStudy">
|
@click="exportStudy">
|
||||||
导出详细学习记录
|
导出详细学习记录
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -332,14 +332,15 @@ 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 exportLoading = ref(false)
|
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('暂无可导出的学习记录')
|
||||||
}
|
}
|
||||||
exportLoading.value = true;
|
exportDisabled.value = true;
|
||||||
downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=4&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员学习记录',exportLoading);
|
await downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=4&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员学习记录',exportLoading);
|
||||||
|
exportDisabled.value = false;
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
searchStu,
|
searchStu,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import {getCookieForName} from "@/api/method";
|
import {getCookieForName} from "@/api/method";
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
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 const downLoadXlsx = async (str, filename,exportLoading) => {
|
export const downLoadXlsx = async (str, filename) => {
|
||||||
const res = await axios({
|
const res = await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: str,
|
url: str,
|
||||||
@@ -14,8 +14,6 @@ export const downLoadXlsx = async (str, filename,exportLoading) => {
|
|||||||
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
|
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
|
||||||
});
|
});
|
||||||
resolveBlob(res, mimeMap.xlsx,filename)
|
resolveBlob(res, mimeMap.xlsx,filename)
|
||||||
exportLoading.value = false;
|
|
||||||
return { exportLoading };
|
|
||||||
}
|
}
|
||||||
const baseUrl = process.env.VUE_APP_ACT_API
|
const baseUrl = process.env.VUE_APP_ACT_API
|
||||||
export function downLoadZip(str, filename) {
|
export function downLoadZip(str, filename) {
|
||||||
|
|||||||
Reference in New Issue
Block a user