补交文件

This commit is contained in:
nisen
2024-09-27 17:44:16 +08:00
parent 6a3aef05fb
commit c02b8d7a8d
2 changed files with 23 additions and 3 deletions

View File

@@ -91,6 +91,11 @@
导出 导出
</a-button> </a-button>
</a-col> </a-col>
<a-col>
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff; width: 150px" @click="exportStudy">
导出详细学习记录
</a-button>
</a-col>
</a-row> </a-row>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<a-table <a-table
@@ -121,7 +126,8 @@ import dialog from "@/utils/dialog";
import {ONLINE_COURSE_DEL} from "@/api/ThirdApi"; import {ONLINE_COURSE_DEL} from "@/api/ThirdApi";
import {useStore} from "vuex"; import {useStore} from "vuex";
import {useAsyncStu, useResetRef} from "@/utils/useCommon"; import {useAsyncStu, useResetRef} from "@/utils/useCommon";
import {downLoadXlsx} from "@/utils/zipdownload";
import {message} from "ant-design-vue";
const props = defineProps({ const props = defineProps({
permissions: { permissions: {
type: String, type: String,
@@ -323,7 +329,12 @@ 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}`);
} }
function exportStudy() {
if(studentList.value.length == 0){
return message.warning('暂无可导出的学习记录')
}
downLoadXlsx(`${process.env.VUE_APP_BASE_API}/admin/student/exportOnlineStudentDetail?type=4&&thirdType=8&pid=${searchParams.value.pid}`,'在线课学员学习记录')
}
defineExpose({ defineExpose({
searchStu, searchStu,
loading, loading,

View File

@@ -5,7 +5,16 @@ const mimeMap = {
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
zip: 'application/zip' zip: 'application/zip'
} }
export function downLoadXlsx(str, filename) {
axios({
method: 'get',
url: str,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
}).then(res => {
resolveBlob(res, mimeMap.xlsx,filename)
})
}
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) {
var url = baseUrl + str var url = baseUrl + str