|
@@ -358,7 +358,7 @@
|
|
|
@click="deleteUnit(unitIndex)"
|
|
|
></div>
|
|
|
</div>
|
|
|
- <div style="margin: 30px 0 20px 0px; font-size: 18px">
|
|
|
+ <div style="margin: 30px 0 10px; font-size: 18px">
|
|
|
阶段描述
|
|
|
</div>
|
|
|
<div>
|
|
@@ -926,6 +926,7 @@ export default {
|
|
|
checkedCities: [],
|
|
|
isIndeterminate: true,
|
|
|
steps: 1,
|
|
|
+ nbOrder:0,
|
|
|
courseName: "",
|
|
|
isTeacherSee: false,
|
|
|
courseText: "",
|
|
@@ -1040,8 +1041,9 @@ export default {
|
|
|
},
|
|
|
lastSteps() {
|
|
|
if (this.steps == 4) {
|
|
|
- window.location.href =
|
|
|
- "./course.vue?userid=" + this.userid + "&oid=" + this.oid;
|
|
|
+ // window.location.href =
|
|
|
+ // "./course.vue?userid=" + this.userid + "&oid=" + this.oid;
|
|
|
+ this.goTo('/course?userid=' + this.userid + '&oid=' + this.oid);
|
|
|
} else {
|
|
|
this.steps--;
|
|
|
}
|
|
@@ -1092,8 +1094,13 @@ export default {
|
|
|
this.dialogVisible2 = false;
|
|
|
this.steps++;
|
|
|
} else if (this.steps == 3) {
|
|
|
- this.addWork();
|
|
|
- this.steps++;
|
|
|
+ if (this.cid == "" || this.cid == undefined) {
|
|
|
+ this.addWork();
|
|
|
+ this.steps++;
|
|
|
+ }else{
|
|
|
+ this.updateWork();
|
|
|
+ this.steps++;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
unitSet(i) {
|
|
@@ -1463,6 +1470,36 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ updateWork(){
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ cid: this.cid,
|
|
|
+ title: this.courseName,
|
|
|
+ brief: this.courseText.replace(/%/g, "%25"),
|
|
|
+ cover: this.cover.length > 0 ? JSON.stringify(this.cover) : "",
|
|
|
+ astudent:
|
|
|
+ this.checkboxList.length > 0
|
|
|
+ ? JSON.stringify(this.checkboxList)
|
|
|
+ : "",
|
|
|
+ see: this.isTeacherSee == true ? 0 : 1,
|
|
|
+ chapters: JSON.stringify(this.unitJson),
|
|
|
+ template: this.myWord,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "updateWork", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.number = this.nbOrder;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("修改失败");
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
guid() {
|
|
|
var _num,
|
|
|
i,
|
|
@@ -1560,6 +1597,7 @@ export default {
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].toolChoose.push(i);
|
|
|
}
|
|
|
}
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
selectCourseDetail() {
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
@@ -1571,7 +1609,17 @@ export default {
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "select_course_detail", params)
|
|
|
.then((res) => {
|
|
|
- this.unitJson = res.data[0][0];
|
|
|
+ this.unitJson = JSON.parse(res.data[0][0].chapters);
|
|
|
+ // this.unitJson[0].chapterInfo = JSON.parse(res.data[0][0].chapters);
|
|
|
+ for (var j in this.unitJson) {
|
|
|
+ for (var i in this.unitJson[j].chapterInfo) {
|
|
|
+ this.unitJson[j].chapterInfo[i].toolChoose = this.unitJson[j]
|
|
|
+ .chapterInfo[i].toolChoose
|
|
|
+ ? this.unitJson[j].chapterInfo[i].toolChoose
|
|
|
+ : [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.unitJson[0].dyText = "";
|
|
|
this.courseName = res.data[0][0].title;
|
|
|
this.courseText = res.data[0][0].brief;
|
|
|
this.checkboxList = JSON.parse(res.data[0][0].course_student);
|
|
@@ -1581,6 +1629,7 @@ export default {
|
|
|
res.data[0][0].is_teacher_look == 0 ? true : false;
|
|
|
this.myWord = res.data[0][0].template;
|
|
|
this.templateC.id = "123";
|
|
|
+ this.nbOrder = res.data[0][0].ordernumber;
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
@@ -2529,9 +2578,9 @@ ol {
|
|
|
justify-content: flex-start;
|
|
|
}
|
|
|
|
|
|
-.upCss >>> .el-upload {
|
|
|
+/* .upCss >>> .el-upload {
|
|
|
margin-right: 30px;
|
|
|
-}
|
|
|
+} */
|
|
|
|
|
|
.upCss >>> .el-icon-plus {
|
|
|
position: none !important;
|