|
@@ -55,6 +55,11 @@
|
|
|
>
|
|
|
作业
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ @click="deleteCourse(item.courseId)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="course_empty" v-if="course.length == 0">暂无数据</div>
|
|
@@ -228,6 +233,26 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ deleteCourse(cid){
|
|
|
+ const loading = this.openLoading(
|
|
|
+ document.querySelector(".student_table")
|
|
|
+ );
|
|
|
+ this.isLoading = true;
|
|
|
+ let params = {
|
|
|
+ cid: cid,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "deleteCourse", params)
|
|
|
+ .then((res) => {
|
|
|
+ loading.close();
|
|
|
+ this.isLoading = false;
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ this.getCourse();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
search() {
|
|
|
this.page = 1;
|
|
|
this.getCourse();
|