|
|
@@ -1433,23 +1433,80 @@ export default {
|
|
|
goTo(path) {
|
|
|
this.$router.push(path);
|
|
|
},
|
|
|
- save(){
|
|
|
+ save(type = 1){
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
|
if (this.courseName == "") {
|
|
|
this.$message.error(this.lang.ssFillCourseName);
|
|
|
return;
|
|
|
} else {
|
|
|
- this.addWork(2);
|
|
|
+ this.addWork(2, type);
|
|
|
}
|
|
|
} else {
|
|
|
if (this.courseName == "") {
|
|
|
this.$message.error(this.lang.ssFillCourseName);
|
|
|
return;
|
|
|
} else {
|
|
|
- this.updateWork(2);
|
|
|
+ this.updateWork(2, type);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ copyCourse(cid) {
|
|
|
+ let settingJson = ''
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ cid: cid,
|
|
|
+ uid: this.userid,
|
|
|
+ setting: JSON.stringify(settingJson),
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "copyCourse2", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success(this.lang.Successfullycopy)
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteCourse(cid) {
|
|
|
+ // if (this.time()) {
|
|
|
+ this.$confirm(this.lang.deletethiscourse, this.lang.tip, {
|
|
|
+ confirmButtonText: this.lang.Confirm,
|
|
|
+ cancelButtonText: this.lang.Cancel,
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.isLoading = true;
|
|
|
+ let params = {
|
|
|
+ cid: cid,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "deleteCourse", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.isLoading = false;
|
|
|
+ this.$message.success(this.lang.DeleteSuccessful);
|
|
|
+ this.goTo(
|
|
|
+ "/course?userid=" +
|
|
|
+ this.userid +
|
|
|
+ "&oid=" +
|
|
|
+ this.oid +
|
|
|
+ "&org=" +
|
|
|
+ this.org +
|
|
|
+ "&role=" +
|
|
|
+ this.role
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ loading.close();
|
|
|
+ this.isLoading = false;
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ // }
|
|
|
+ },
|
|
|
lastSteps() {
|
|
|
this.$confirm(this.lang.ssSaveEdit, this.lang.ssTip, {
|
|
|
confirmButtonText: this.lang.ssSave,
|
|
|
@@ -1616,7 +1673,7 @@ export default {
|
|
|
throw err;
|
|
|
}
|
|
|
},
|
|
|
- async addWork(type = 1) {
|
|
|
+ async addWork(type = 1, ctype = 1) {
|
|
|
if (this.$refs.pptIframeRef.contentWindow.window.pptLoading !== 2) return this.$message.info(this.lang.ssPptLoad)
|
|
|
if (this.uploadWorkLoading) return;
|
|
|
this.uploadWorkLoading = true;
|
|
|
@@ -1687,6 +1744,9 @@ export default {
|
|
|
if(type == 1){
|
|
|
this.steps = 4;
|
|
|
}
|
|
|
+ if(ctype == 2){
|
|
|
+ this.copyCourse(this.cid);
|
|
|
+ }
|
|
|
this.uploadFile2(pptJsonFile, this.courseId);
|
|
|
this.addOp3(
|
|
|
"1",
|
|
|
@@ -1707,7 +1767,7 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
- async updateWork(type = 1) {
|
|
|
+ async updateWork(type = 1, ctype = 1) {
|
|
|
if (this.$refs.pptIframeRef.contentWindow.window.pptLoading !== 2) return this.$message.info(this.lang.ssPptLoad)
|
|
|
if (this.uploadWorkLoading) return;
|
|
|
this.uploadWorkLoading = true;
|
|
|
@@ -1775,6 +1835,9 @@ export default {
|
|
|
if(type == 1){
|
|
|
this.steps = 4;
|
|
|
}
|
|
|
+ if(ctype == 2){
|
|
|
+ this.copyCourse(this.cid);
|
|
|
+ }
|
|
|
this.addOp3(
|
|
|
"1",
|
|
|
"",
|
|
|
@@ -3062,6 +3125,17 @@ export default {
|
|
|
window.toolBtn = (type,id) => this.toolBtn(type,id); // 工具按钮点击事件
|
|
|
window.previewVideo = (id) => this.previewVideo(id); // 预览视频
|
|
|
window.goBack = () => this.goTo(`/course?userid=${this.userid}&oid=${this.oid}&org=${this.org}&role=${this.role}`);
|
|
|
+ window.lastSteps = () => this.lastSteps(); // 上一步
|
|
|
+ window.setCouresTitle = (title) => {
|
|
|
+ this.courseName = title;
|
|
|
+ }
|
|
|
+ window.save = () => this.save(); // 保存
|
|
|
+ window.copyCourse = () => this.save(2)
|
|
|
+ window.deleteCourse = () => this.deleteCourse(this.cid);
|
|
|
+ window.publishCourse = () => {
|
|
|
+ this.dialogVisibleBasicInfo = true
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
</script>
|