Commit e383d507 authored by 杨梦雪's avatar 杨梦雪

修改】查看和提交作业(用户端)

parent adef92ff
...@@ -315,6 +315,7 @@ ...@@ -315,6 +315,7 @@
teacher_commment: "", //老师评语 teacher_commment: "", //老师评语
tea_scoreFileList: [], //老师评语的附件 tea_scoreFileList: [], //老师评语的附件
srcList: [], //在线预览图片-放大 srcList: [], //在线预览图片-放大
fileList: [],//传给后端的url
}; };
}, },
created() { created() {
...@@ -432,8 +433,14 @@ ...@@ -432,8 +433,14 @@
type: item.type, type: item.type,
}; };
}); });
//
this.fileList = gotfileList.map((item) => {
return {
url_open: item.url_open,
};
});
console.log(this.stu_fileList); console.log(this.stu_fileList);
console.log(this.fileList);
} }
this.$forceUpdate(); this.$forceUpdate();
} else if (student_status == 2) { } else if (student_status == 2) {
...@@ -468,33 +475,7 @@ ...@@ -468,33 +475,7 @@
} }
}); });
}, },
// 未完成
notReadHandle() {
this.formData.teacher_id = this.work_nums;
// if (!this.formData.stu_enclosure_url) {
// delete this.formData.stu_enclosure_url;
// } else {
this.formData.stu_enclosure_url = this.stu_enclosure_url + ',' + this.stu_fileListoss;
// console.log(this.formData.stu_enclosure_url , "this.formData.stu_enclosure_url ");
// }
// if (!this.formData.stu_answer) {
// delete this.formData.stu_answer;
// }
// console.log(this.stu_fileList, "this.stu_fileList");
// return
subStudentWork(this.formData)
.then((response) => {
// console.log(response);
if (response.data.code != 200) {
return this.$message.error(response.data.message);
}
this.$message.success(response.data.message);
this.cancelBtnTrue();
})
.catch((error) => {
console.log(error);
});
},
// 成功确认取消,关闭弹框,修改父组件的值 // 成功确认取消,关闭弹框,修改父组件的值
cancelBtnTrue() { cancelBtnTrue() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
...@@ -585,13 +566,16 @@ ...@@ -585,13 +566,16 @@
savefile: res.data.config.savefile, savefile: res.data.config.savefile,
name: res.data.config.savefile.split("/work/")[1], name: res.data.config.savefile.split("/work/")[1],
}; };
this.stu_fileList.push(obj);
console.log(this.stu_fileList, "this.stu_fileList"); console.log(this.stu_fileList, "this.stu_fileList");
this.stu_fileList.push(obj);
this.fileList.push(obj);
console.log(this.fileList, 'this.fileList')
this.stu_fileListoss = this.stu_fileList this.stu_fileListoss = this.stu_fileList
.map((item) => { .map((item) => {
return item.url_open; return item.url_open;
}) })
.join(","); .join(",");
console.log(this.stu_fileListoss, "stu_fileListoss"); console.log(this.stu_fileListoss, "stu_fileListoss");
// this.formData.stu_enclosure_url = this.stu_fileListoss; // this.formData.stu_enclosure_url = this.stu_fileListoss;
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
...@@ -650,16 +634,14 @@ ...@@ -650,16 +634,14 @@
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
console.log(this.stu_fileList); console.log(this.stu_fileList);
console.log(this.fileList);
// console.log(this.stu_fileListoss); // console.log(this.stu_fileListoss);
this.stu_fileList.forEach((item, idx) => { this.stu_fileList.forEach((item, idx) => {
// console.log(idx, "idx"); // console.log(idx, "idx");
console.log(111111);
console.log(item.url);
console.log(file.url);
// return
console.log(item.url == file.url); console.log(item.url == file.url);
if (item.url == file.url) { if (item.url == file.url) {
this.stu_fileList.splice(idx, 1); this.stu_fileList.splice(idx, 1);
this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.stu_fileListoss = this.stu_fileList this.stu_fileListoss = this.stu_fileList
.map(function (item, index) { .map(function (item, index) {
...@@ -726,6 +708,33 @@ ...@@ -726,6 +708,33 @@
.catch((_) => { .catch((_) => {
}); });
}, },
// 未完成
notReadHandle() {
this.formData.teacher_id = this.work_nums;
// console.log(this.fileList)
this.formData.stu_enclosure_url = this.fileList.map((item) => {
return item.url_open;
})
.join(",");
console.log(this.formData.stu_enclosure_url)
subStudentWork(this.formData)
.then((response) => {
// console.log(response);
//作业无修改
if (response.data.code == 4000343) {
this.cancelBtn()
return this.$message.error(response.data.message);
}
if (response.data.code != 200) {
return this.$message.error(response.data.message);
}
this.$message.success(response.data.message);
this.cancelBtnTrue();
})
.catch((error) => {
console.log(error);
});
},
// 提交按钮 // 提交按钮
confirm() { confirm() {
if (this.stu_fileList.length == 0) { if (this.stu_fileList.length == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment