|
@@ -1928,14 +1928,18 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
|
|
// 提交应用中心作业
|
|
// 提交应用中心作业
|
|
|
- upLoadApp(){
|
|
|
|
|
|
|
+ async upLoadApp(){
|
|
|
let _iframe = this.$refs.appStore;
|
|
let _iframe = this.$refs.appStore;
|
|
|
document.getElementById('loadLi_JieE').children[0].style.display = "block"
|
|
document.getElementById('loadLi_JieE').children[0].style.display = "block"
|
|
|
|
|
|
|
|
|
|
|
|
|
// window.exposed_outputs
|
|
// window.exposed_outputs
|
|
|
- let Cow = JSON.stringify(_iframe.contentWindow.exposed_outputs)
|
|
|
|
|
|
|
+ // let Cow = JSON.stringify(_iframe.contentWindow.exposed_outputs)
|
|
|
|
|
+ const pptJsonStr = JSON.stringify(_iframe.contentWindow.exposed_outputs);
|
|
|
|
|
+ const pptJsonFile = new File([pptJsonStr], "pptData.json", { type: "application/json" });
|
|
|
|
|
+ // 你可以根据需要将pptJsonFile上传或保存
|
|
|
|
|
|
|
|
|
|
+ let _url = await this.uploadFile(pptJsonFile);
|
|
|
// uid: this.userId,
|
|
// uid: this.userId,
|
|
|
// cid: this.id,
|
|
// cid: this.id,
|
|
|
// stage: this.courseType,
|
|
// stage: this.courseType,
|
|
@@ -1951,7 +1955,7 @@ export default {
|
|
|
stage: this.courseType,
|
|
stage: this.courseType,
|
|
|
task: this.taskCount,
|
|
task: this.taskCount,
|
|
|
tool: this.toolIndex,
|
|
tool: this.toolIndex,
|
|
|
- content: Cow,
|
|
|
|
|
|
|
+ content: _url,
|
|
|
type: 20,
|
|
type: 20,
|
|
|
atool: 72
|
|
atool: 72
|
|
|
}
|
|
}
|
|
@@ -1986,6 +1990,62 @@ export default {
|
|
|
this.addOp3('1', "", { courseid: this.id,tool: 'AI应用',data: Cow,type: "course_tool_sub" }, err)
|
|
this.addOp3('1', "", { courseid: this.id,tool: 'AI应用',data: Cow,type: "course_tool_sub" }, err)
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ //上传文件
|
|
|
|
|
+ uploadFile(file) {
|
|
|
|
|
+ return new Promise((resolve)=>{
|
|
|
|
|
+ var credentials = {
|
|
|
|
|
+ accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
|
|
|
+ secretAccessKey: "Q2SQw37HfolS7yeaR1Ndpy9Jl4E2YZKUuuy2muZR"
|
|
|
|
|
+ }; //秘钥形式的登录上传
|
|
|
|
|
+ window.AWS.config.update(credentials);
|
|
|
|
|
+ window.AWS.config.region = "cn-northwest-1"; //设置区域
|
|
|
|
|
+
|
|
|
|
|
+ var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
|
|
|
|
|
+ var _this = this;
|
|
|
|
|
+
|
|
|
|
|
+ if (file) {
|
|
|
|
|
+ var params = {
|
|
|
|
|
+ Key:
|
|
|
|
|
+ file.name.split(".")[0] +
|
|
|
|
|
+ new Date().getTime() +
|
|
|
|
|
+ "." +
|
|
|
|
|
+ file.name.split(".")[file.name.split(".").length - 1],
|
|
|
|
|
+ ContentType: file.type,
|
|
|
|
|
+ Body: file,
|
|
|
|
|
+ "Access-Control-Allow-Credentials": "*",
|
|
|
|
|
+ ACL: "public-read"
|
|
|
|
|
+ }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
|
|
|
|
|
+ var options = {
|
|
|
|
|
+ partSize: 2048 * 1024 * 1024,
|
|
|
|
|
+ queueSize: 2,
|
|
|
|
|
+ leavePartsOnError: true
|
|
|
|
|
+ };
|
|
|
|
|
+ bucket
|
|
|
|
|
+ .upload(params, options)
|
|
|
|
|
+ .on("httpUploadProgress", function(evt) {
|
|
|
|
|
+ //这里可以写进度条
|
|
|
|
|
+ // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
|
|
|
|
|
+ })
|
|
|
|
|
+ .send(function(err, data) {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ // var a = _this.$refs.upload1.uploadFiles;
|
|
|
|
|
+ // a.splice(a.length - 1, a.length);
|
|
|
|
|
+ _this.$message.error("上传失败ppt数据失败");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //上传成功处理
|
|
|
|
|
+ // _this.unitJson[_this.unitIndex].chapterInfo[0].fileList1.push({
|
|
|
|
|
+ // name: file.name,
|
|
|
|
|
+ // url: data.Location,
|
|
|
|
|
+ // uid: file.uid
|
|
|
|
|
+ // });
|
|
|
|
|
+ // _this.imgChange();
|
|
|
|
|
+ // console.log(data.Location);
|
|
|
|
|
+ resolve(data.Location)
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
// 设置分组
|
|
// 设置分组
|
|
|
updateGroupJson(){
|
|
updateGroupJson(){
|