|
@@ -6,9 +6,8 @@
|
|
|
<div>
|
|
|
<div class="home_titleHead">
|
|
|
<div class="ban">Banner管理</div>
|
|
|
- <el-button size="small" type="primary" @click="dialogVisible = true"
|
|
|
- >添加图片</el-button
|
|
|
- >
|
|
|
+ <el-button size="small" type="primary">添加图片</el-button>
|
|
|
+ <!-- @click="dialogVisible = true" -->
|
|
|
</div>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
@@ -106,12 +105,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" min-width="25">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
@click="goTo('/course?index=2&id=' + scope.row.courseId)"
|
|
|
>查看</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
style="删除"
|
|
@@ -331,9 +330,64 @@ export default {
|
|
|
linkInput: "",
|
|
|
checkList: [],
|
|
|
courseList: [],
|
|
|
- tableData: [],
|
|
|
- zoneList: [],
|
|
|
- zoneClass: {},
|
|
|
+ tableData: [
|
|
|
+ {
|
|
|
+ create_at: "2021-04-23T20:14:49.000Z",
|
|
|
+ id: "f9010b15-a40b-11eb-80ad-005056b86db5",
|
|
|
+ number: 0,
|
|
|
+ poster:
|
|
|
+ "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/组211619165665500.png",
|
|
|
+ title: "麓城外国语小学-我是种植小能手-406胡智航",
|
|
|
+ url: "5fbbdeb1-96a2-11eb-80ad-005056b86db5",
|
|
|
+ userid: "0",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ zoneList: [
|
|
|
+ {
|
|
|
+ create_at: "2021-04-06T19:37:56.000Z",
|
|
|
+ createuserid: "0",
|
|
|
+ id: "1",
|
|
|
+ name: "热门推荐",
|
|
|
+ oid: null,
|
|
|
+ order: 6,
|
|
|
+ parentid: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ create_at: "2021-04-06T19:37:56.000Z",
|
|
|
+ createuserid: "0",
|
|
|
+ id: "2",
|
|
|
+ name: "PBL热门项目",
|
|
|
+ oid: null,
|
|
|
+ order: 6,
|
|
|
+ parentid: "1",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ zoneClass: {
|
|
|
+ 1: [
|
|
|
+ {
|
|
|
+ title: "印象中秋",
|
|
|
+ brief: "印象中秋",
|
|
|
+ vcount: "123",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "深圳发展40周年",
|
|
|
+ brief: "深圳发展40周年",
|
|
|
+ vcount: "456",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 2: [
|
|
|
+ {
|
|
|
+ title: "印象中秋",
|
|
|
+ brief: "印象中秋",
|
|
|
+ vcount: "123",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "深圳发展40周年",
|
|
|
+ brief: "深圳发展40周年",
|
|
|
+ vcount: "456",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
page: {},
|
|
|
total: {},
|
|
|
pid: "",
|
|
@@ -502,77 +556,77 @@ export default {
|
|
|
},
|
|
|
//添加课程专区
|
|
|
addZone() {
|
|
|
- if (this.zoneName === "") {
|
|
|
- this.$message.error("请填写添加课程专区名称");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.time()) {
|
|
|
- let params = [{ n: this.zoneName, cuid: "0" }];
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "addZone", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "添加成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.zoneName = "";
|
|
|
- this.dialogVisible4 = false;
|
|
|
- this.init();
|
|
|
- this.getZone();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("添加失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (this.zoneName === "") {
|
|
|
+ // this.$message.error("请填写添加课程专区名称");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (this.time()) {
|
|
|
+ // let params = [{ n: this.zoneName, cuid: "0" }];
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "addZone", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "添加成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.zoneName = "";
|
|
|
+ // this.dialogVisible4 = false;
|
|
|
+ // this.init();
|
|
|
+ // this.getZone();
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("添加失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
//获取专区下的课程数量
|
|
|
getZoneNum(zid) {
|
|
|
- let params = { bid: zid };
|
|
|
- this.ajax
|
|
|
- .get(this.$store.state.api + "getZoneClassNum", params)
|
|
|
- .then((res) => {
|
|
|
- if (res.data[0][0].num > 0) {
|
|
|
- this.$message.error("请把专区底下的课程全部删除才可以删除专区");
|
|
|
- } else {
|
|
|
- this.deleteZone(zid);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+ // let params = { bid: zid };
|
|
|
+ // this.ajax
|
|
|
+ // .get(this.$store.state.api + "getZoneClassNum", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.data[0][0].num > 0) {
|
|
|
+ // this.$message.error("请把专区底下的课程全部删除才可以删除专区");
|
|
|
+ // } else {
|
|
|
+ // this.deleteZone(zid);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
},
|
|
|
//删除课程专区
|
|
|
deleteZone(zid) {
|
|
|
- let params = [{ id: zid }];
|
|
|
- this.$confirm("确定删除此专区吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "deleteZone", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getZone();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("删除失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ // let params = [{ id: zid }];
|
|
|
+ // this.$confirm("确定删除此专区吗?", "提示", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "deleteZone", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "删除成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.getZone();
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("删除失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {});
|
|
|
},
|
|
|
//打开添加弹窗
|
|
|
addPop(zid) {
|
|
|
- this.init();
|
|
|
- this.dialogVisible1 = true;
|
|
|
- this.pid = zid;
|
|
|
- this.Search();
|
|
|
+ // this.init();
|
|
|
+ // this.dialogVisible1 = true;
|
|
|
+ // this.pid = zid;
|
|
|
+ // this.Search();
|
|
|
},
|
|
|
//打开添加弹窗
|
|
|
addBannerUrlPop() {
|
|
@@ -671,60 +725,59 @@ export default {
|
|
|
},
|
|
|
//删除课程专区
|
|
|
deleteZoneCourse(id, zid) {
|
|
|
- let params = [{ id: id }];
|
|
|
- this.$confirm("确定把此课程从次专区删除吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "deleteZoneCourse", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getZoneClass(zid);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("删除失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ // let params = [{ id: id }];
|
|
|
+ // this.$confirm("确定把此课程从次专区删除吗?", "提示", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "deleteZoneCourse", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "删除成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.getZoneClass(zid);
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("删除失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {});
|
|
|
},
|
|
|
//把课程添加进专区
|
|
|
addBanner() {
|
|
|
- var list = this.fileList;
|
|
|
-
|
|
|
- if (list.length == 0) {
|
|
|
- this.$message.error("请上传需要添加的banner");
|
|
|
- return;
|
|
|
- } else if (this.bannerCourse === "") {
|
|
|
- this.$message.error("请填写选择banner的链接");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.time()) {
|
|
|
- let params = [
|
|
|
- { p: list[0].url, url: this.bannerCourse.courseId, uid: "0", n: "0" },
|
|
|
- ];
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "addBanner", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "添加成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.dialogVisible = false;
|
|
|
- this.init();
|
|
|
- this.getBanner();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("添加失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- }
|
|
|
+ // var list = this.fileList;
|
|
|
+ // if (list.length == 0) {
|
|
|
+ // this.$message.error("请上传需要添加的banner");
|
|
|
+ // return;
|
|
|
+ // } else if (this.bannerCourse === "") {
|
|
|
+ // this.$message.error("请填写选择banner的链接");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (this.time()) {
|
|
|
+ // let params = [
|
|
|
+ // { p: list[0].url, url: this.bannerCourse.courseId, uid: "0", n: "0" },
|
|
|
+ // ];
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "addBanner", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "添加成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.dialogVisible = false;
|
|
|
+ // this.init();
|
|
|
+ // this.getBanner();
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("添加失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
//获取banner
|
|
|
getBanner() {
|
|
@@ -740,72 +793,72 @@ export default {
|
|
|
},
|
|
|
//删除banner
|
|
|
deleteBanner(id) {
|
|
|
- let params = [{ id: id }];
|
|
|
- this.$confirm("确定删除此banner吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "deleteBanner", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getBanner();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("删除失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ // let params = [{ id: id }];
|
|
|
+ // this.$confirm("确定删除此banner吗?", "提示", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "deleteBanner", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "删除成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.getBanner();
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("删除失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {});
|
|
|
},
|
|
|
up(index) {
|
|
|
- if (index == 0) {
|
|
|
- this.$message.error("已经是最上面的一个,不可以再上移了");
|
|
|
- return;
|
|
|
- }
|
|
|
- let params = [
|
|
|
- { aid: this.zoneList[index].id, bid: this.zoneList[index - 1].id },
|
|
|
- ];
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "zoneRank", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "上移成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getZone();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("上移失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+ // if (index == 0) {
|
|
|
+ // this.$message.error("已经是最上面的一个,不可以再上移了");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // let params = [
|
|
|
+ // { aid: this.zoneList[index].id, bid: this.zoneList[index - 1].id },
|
|
|
+ // ];
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "zoneRank", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "上移成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.getZone();
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("上移失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
},
|
|
|
down(index) {
|
|
|
- if (index == this.zoneList.length - 1) {
|
|
|
- this.$message.error("已经是最下面的一个,不可以再下移了");
|
|
|
- return;
|
|
|
- }
|
|
|
- let params = [
|
|
|
- { aid: this.zoneList[index].id, bid: this.zoneList[index + 1].id },
|
|
|
- ];
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "zoneRank", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "下移成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getZone();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("下移失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+ // if (index == this.zoneList.length - 1) {
|
|
|
+ // this.$message.error("已经是最下面的一个,不可以再下移了");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // let params = [
|
|
|
+ // { aid: this.zoneList[index].id, bid: this.zoneList[index + 1].id },
|
|
|
+ // ];
|
|
|
+ // this.ajax
|
|
|
+ // .post(this.$store.state.api + "zoneRank", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "下移成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.getZone();
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$message.error("下移失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
},
|
|
|
//设置banner链接
|
|
|
setBannerUrl() {
|
|
@@ -818,8 +871,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- this.getBanner();
|
|
|
- this.getZone();
|
|
|
+ // this.getBanner();
|
|
|
+ // this.getZone();
|
|
|
},
|
|
|
};
|
|
|
</script>
|