|
@@ -236,13 +236,13 @@
|
|
|
></textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="width: 95%; margin: 15px auto">
|
|
|
+ <!-- <div style="width: 95%; margin: 15px auto">
|
|
|
<el-switch
|
|
|
v-model="isTeacherSee"
|
|
|
active-text="允许给其他老师查看"
|
|
|
style="padding-bottom: 30px"
|
|
|
></el-switch>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="rightBox" v-if="this.steps == 2">
|
|
@@ -2199,7 +2199,11 @@ export default {
|
|
|
this.$message.error("请将信息填写完整");
|
|
|
return;
|
|
|
} else {
|
|
|
- this.updateWork();
|
|
|
+ if(this.userid != this.courseUserid){
|
|
|
+ this.updateWork2();
|
|
|
+ }else{
|
|
|
+ this.updateWork();
|
|
|
+ }
|
|
|
this.steps++;
|
|
|
}
|
|
|
}
|
|
@@ -2232,7 +2236,11 @@ export default {
|
|
|
this.$message.error("请将信息填写完整");
|
|
|
return;
|
|
|
} else {
|
|
|
- this.updateWork();
|
|
|
+ if(this.userid != this.courseUserid){
|
|
|
+ this.updateWork2();
|
|
|
+ }else{
|
|
|
+ this.updateWork();
|
|
|
+ }
|
|
|
this.steps++;
|
|
|
}
|
|
|
}
|
|
@@ -2838,6 +2846,43 @@ export default {
|
|
|
goCourse() {
|
|
|
window.parent.postMessage({ cid: this.courseId, type: "1" }, "*");
|
|
|
},
|
|
|
+ updateWork2() {
|
|
|
+ let _unitIndex = this.unitIndex
|
|
|
+ for (
|
|
|
+ var j = 0;
|
|
|
+ j < this.unitJson[_unitIndex].chapterInfo[0].taskJson.length;
|
|
|
+ j++
|
|
|
+ ) {
|
|
|
+ if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList = this.unitJson[
|
|
|
+ _unitIndex
|
|
|
+ ].chapterInfo[0].taskJson[j].eList.filter((ele) => {
|
|
|
+ return ele.value != "";
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ cid: this.cid,
|
|
|
+ chapters: JSON.stringify(this.unitJson).replaceAll(/%/g, "%25"),
|
|
|
+ uid: this.userid,
|
|
|
+ unitIndex: _unitIndex,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "updateWorkNew4", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.courseId = this.cid;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("修改失败");
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
updateWork() {
|
|
|
for (var i = 0; i < this.unitJson.length; i++) {
|
|
|
for (
|
|
@@ -3468,14 +3513,18 @@ export default {
|
|
|
.get(this.$store.state.api + "select_course_detail", params)
|
|
|
.then((res) => {
|
|
|
let unitJson = JSON.parse(res.data[0][0].chapters);
|
|
|
+ let _unitJson = JSON.parse(JSON.stringify(this.unitJson));
|
|
|
let _unitIndex = this.unitIndex;
|
|
|
for (let i = 0; i < unitJson.length; i++) {
|
|
|
if (i == _unitIndex) {
|
|
|
continue;
|
|
|
+ }else if(i > this.unitJson.length - 1){
|
|
|
+ _unitJson.push(unitJson[i]);
|
|
|
} else {
|
|
|
- this.unitJson[i] = unitJson[i];
|
|
|
+ _unitJson[i] = unitJson[i];
|
|
|
}
|
|
|
}
|
|
|
+ this.unitJson = _unitJson
|
|
|
this.$forceUpdate();
|
|
|
this.timer = setTimeout(() => {
|
|
|
this.seleteCourseUpdate();
|