|
|
|
@ -262,6 +262,7 @@ export default { |
|
|
|
|
headers: { |
|
|
|
|
token: sessionStorage.getItem("token") |
|
|
|
|
}, |
|
|
|
|
isDetail: Boolean(this.$route.query.isDetail), |
|
|
|
|
form: { |
|
|
|
|
cid: this.$route.query.cid, |
|
|
|
|
curriculumName: "", |
|
|
|
@ -362,7 +363,15 @@ export default { |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
goback() { |
|
|
|
|
this.$router.back(); |
|
|
|
|
if (this.isDetail) { |
|
|
|
|
this.$router.back(); |
|
|
|
|
} else { |
|
|
|
|
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$router.back(); |
|
|
|
|
}).catch(() => {}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getInfoData() { |
|
|
|
|
this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(res => { |
|
|
|
@ -620,13 +629,20 @@ export default { |
|
|
|
|
if (this.form.cid) { |
|
|
|
|
this.$post(this.api.modifyCourse, this.form).then((res) => { |
|
|
|
|
this.$message.success("编辑成功"); |
|
|
|
|
this.goback(); |
|
|
|
|
this.$router.back(); |
|
|
|
|
}).catch((res) => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.createCurriculum, this.form).then((res) => { |
|
|
|
|
this.$message.success("添加成功"); |
|
|
|
|
this.goback(); |
|
|
|
|
this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", { |
|
|
|
|
type: "success", |
|
|
|
|
confirmButtonText: "马上设置", |
|
|
|
|
cancelButtonText: "稍后操作" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$router.push(`/contentSettings?cid=${res.cid}`); |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$router.back(); |
|
|
|
|
}); |
|
|
|
|
}).catch((res) => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|