课程管理-马上设置点击跳转后应该是打开内容设置的页面

dev
yujialong 3 years ago
parent efa41e4756
commit 89f080c9f5
  1. 24
      src/views/course/AddCurriculum.vue
  2. 5
      src/views/course/courseconfig.vue
  3. 1
      src/views/serve/projectAdd.vue

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

@ -255,7 +255,7 @@ export default {
if (this.previewing) { if (this.previewing) {
this.closeIframe(); this.closeIframe();
} else { } else {
this.$router.back(); this.$router.push("/curriculum");
} }
}, },
iframeOnload() { iframeOnload() {
@ -336,9 +336,6 @@ export default {
this.keyword = ""; this.keyword = "";
this.getTeacher(); this.getTeacher();
}, },
goback() {
this.$router.push("course");
},
transferType(ext) { transferType(ext) {
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";

@ -742,6 +742,7 @@ export default {
} }
.main{ .main{
overflow: auto; overflow: auto;
overflow-x: hidden;
height: calc(100vh - 152px ); height: calc(100vh - 152px );
} }
</style> </style>
Loading…
Cancel
Save