From 7774c7a95f3b8ae38b77d1d6aeabc5e4507b8444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 8 Jul 2019 16:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Httpdownloads.js | 21 ------------------- .../courses/shixunHomework/Listofworks.js | 2 -- 2 files changed, 23 deletions(-) delete mode 100644 public/react/src/modules/courses/shixunHomework/Httpdownloads.js diff --git a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js deleted file mode 100644 index 11bd91f6b..000000000 --- a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js +++ /dev/null @@ -1,21 +0,0 @@ -import {Base64} from 'js-base64'; -import axios from 'axios'; - - -// 导出实习报告批量zip 、xlsx 类型 -export function Internshipreportsy (url,struy,types,stingtype){ - axios.get((url),{responseType: 'blob'}).then((response) => { - const blob = new Blob([response.data], { type: stingtype }); - const downloadElement = document.createElement('a'); - const href = window.URL.createObjectURL(blob); - const string = Base64.decode(response.headers['content-disposition'].split('=')[1]); - downloadElement.href = href; - downloadElement.download = string+struy+types; - document.body.appendChild(downloadElement); - downloadElement.click(); - document.body.removeChild(downloadElement) ;// 下载完成移除元素 - window.URL.revokeObjectURL(href) // 释放掉blob对象 - }).catch((error) => { - console.log(error) - }); -} \ No newline at end of file diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index e8d76679e..33bb37a6e 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -5,8 +5,6 @@ import TraineetraininginformationModal from './TraineetraininginformationModal'; import ModulationModal from "../coursesPublic/ModulationModal"; import HomeworkModal from "../coursesPublic/HomeworkModal"; import DownloadMessage from '../../modals/DownloadMessage'; -import {Base64} from 'js-base64'; -import {Internshipreportsy} from './Httpdownloads' import { Form, Select,