|
@@ -364,7 +364,8 @@
|
|
|
import WorkDate from "./components/workData";
|
|
|
import Report from "./components/report";
|
|
|
import studentReport from "./components/studentReport";
|
|
|
-import { T } from "caniuse-lite/data/browserVersions";
|
|
|
+import "../../common/aws-sdk-2.235.1.min.js";
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
WorkDate,
|
|
@@ -528,6 +529,8 @@ export default {
|
|
|
(this.page2 = 1), this.getStudnet();
|
|
|
},
|
|
|
getStudnet(row) {
|
|
|
+ this.downloadFile('https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/student01-%E5%AD%A6%E7%94%9F%E6%88%90%E9%95%BF%E6%8A%A5%E5%91%8A1719315423787.pdf');
|
|
|
+ return
|
|
|
//获取作业
|
|
|
this.signDialog = true;
|
|
|
this.isLoading2 = true;
|
|
@@ -552,6 +555,48 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ downloadFile(url){
|
|
|
+ var credentials = {
|
|
|
+ accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
|
+ secretAccessKey: "Q2SQw37HfolS7yeaR1Ndpy9Jl4E2YZKUuuy2muZR",
|
|
|
+ }; //秘钥形式的登录上传
|
|
|
+ window.AWS.config.update(credentials);
|
|
|
+ window.AWS.config.region = "cn-northwest-1"; //设置区域
|
|
|
+ let url2 = url;
|
|
|
+ let _url2 = "";
|
|
|
+ if (
|
|
|
+ url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
|
|
|
+ ) {
|
|
|
+ _url2 = url2.split(
|
|
|
+ "https://view.officeapps.live.com/op/view.aspx?src="
|
|
|
+ )[1];
|
|
|
+ } else {
|
|
|
+ _url2 = url2;
|
|
|
+ }
|
|
|
+ let _this = this;
|
|
|
+
|
|
|
+ _this.downLoading = true
|
|
|
+ var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
|
|
|
+ let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
|
|
|
+ var params = {
|
|
|
+ Bucket: "ccrb",
|
|
|
+ Key: name
|
|
|
+ };
|
|
|
+ s3.getObject(params, function (err, data) {
|
|
|
+ _this.downLoading = false
|
|
|
+ if (err) console.log(err, err.stack); // an error occurred
|
|
|
+ else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data.Body]));
|
|
|
+ let a = document.createElement("a");
|
|
|
+ a.name = 'student01-学生成长报告.pdf';
|
|
|
+ a.href = url;
|
|
|
+ a.download = 'student01-学生成长报告.pdf';
|
|
|
+ a.click();
|
|
|
+ console.log(data);
|
|
|
+ } // sxuccessful response
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
getCourseDetail() {
|
|
|
let params = {
|
|
|
cid: this.checkCourse,
|
|
@@ -570,6 +615,7 @@ export default {
|
|
|
this.reportVisible = true;
|
|
|
this.signDialog = false;
|
|
|
},
|
|
|
+
|
|
|
getClass() {
|
|
|
let params = {
|
|
|
oid: this.oid,
|