心灵空间
This commit is contained in:
281
src/views/modules/courseSettings/soulCourseDescription.vue
Normal file
281
src/views/modules/courseSettings/soulCourseDescription.vue
Normal file
@@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<div class="mod-config" style="height: calc(100vh - 180px)">
|
||||
<el-tabs tab-position="left" style="height: 100%;" v-model="currentTab"@tab-click="handleClick">
|
||||
<el-tab-pane
|
||||
|
||||
:label="v.label"
|
||||
v-for="(v, i) in setList"
|
||||
:key="i"
|
||||
style="height: 100%;"
|
||||
>
|
||||
<add-or-update
|
||||
v-if="currentTab==i"
|
||||
:dataInfo="v"
|
||||
:type="type"
|
||||
:currentTab="currentTab"
|
||||
style="height: calc(100vh - 180px)"
|
||||
:ref="`addOrUpdate${v.id}`"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./chapter-add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentTab: 0,
|
||||
type: 2,
|
||||
setList: [
|
||||
{ label: "购买须知", id: 0 },
|
||||
{ label: "使用须知", id: 1 },
|
||||
{ label: "学习次序", id: 2 },
|
||||
{ label: "超V用户", id: 3 }
|
||||
],
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
query: {
|
||||
type: "",
|
||||
categoryId: "",
|
||||
sociologyId: "",
|
||||
keywords: ""
|
||||
},
|
||||
dataList: [],
|
||||
delFlag: false,
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated() {
|
||||
this.courseid = this.$route.query.courseid;
|
||||
this.catalogue_id = this.$route.query.id;
|
||||
console.log("111", this.courseid);
|
||||
console.log("222", this.catalogue_id);
|
||||
if (this.$route.query.upPageInde != null) {
|
||||
this.pageIndex = this.$route.query.upPageIndex;
|
||||
console.log(this.pageIndex);
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
this.getDataList()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`/master/course/getCourseRecord`),
|
||||
method: "POST",
|
||||
data: {
|
||||
type: this.type
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then(({ data }) => {
|
||||
var that=this
|
||||
console.log("data at line 86:", data);
|
||||
if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
|
||||
var content=''
|
||||
switch (that.currentTab) {
|
||||
|
||||
case "0":
|
||||
content=data.result.buyRecord
|
||||
break;
|
||||
case "1":
|
||||
content=data.result.useRecord
|
||||
break;
|
||||
case "2":
|
||||
content=data.result.studyRecord
|
||||
|
||||
break;
|
||||
case "3":
|
||||
content=data.result.vipRecord
|
||||
|
||||
break;
|
||||
}
|
||||
that.$nextTick(()=>{
|
||||
that.$refs[`addOrUpdate${that.currentTab}`][0].init(content);
|
||||
})
|
||||
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(row) {
|
||||
console.log("row1", row);
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row, this.catalogue_id, this.courseid);
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
// var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
// return item.id
|
||||
// })
|
||||
this.$confirm(
|
||||
`确定对[id=${id}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/course/delCourseCatalogueChapter"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: id
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开关变化
|
||||
SwitchChange(event) {
|
||||
/*点击时他会自动把你绑定的值变更,直接去请求数据就可以了*/
|
||||
var parms = {
|
||||
delFlag: event.delFlag,
|
||||
id: event.id
|
||||
};
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/book/update"),
|
||||
method: "post",
|
||||
data: parms
|
||||
})
|
||||
.then(res => {
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
})
|
||||
.catch(error => {
|
||||
this.loading = false;
|
||||
console.log(error);
|
||||
});
|
||||
console.log(event);
|
||||
},
|
||||
chapterHandle(id, row) {
|
||||
if (row.novel == "") {
|
||||
this.$alert("请上传电子书文件后在进行此操作", "提示", {
|
||||
confirmButtonText: "好的"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/book/getChapter"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
id: id
|
||||
})
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
contentHandle(id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/bookchaptercontent/getBookVoices"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
id: id
|
||||
})
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
voicesHandle(id) {
|
||||
//allVoices
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/book/bookchaptercontent/allVoices'),
|
||||
url: this.$http.adornUrl("/book/bookchaptercontent/AllVOices"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
id: id
|
||||
})
|
||||
}).then(res => {
|
||||
console.log("book/bookchaptercontent/AllVOices");
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.hidden1 {
|
||||
text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
|
||||
-webkit-line-clamp: 1;
|
||||
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
::v-deep .mod-config .el-tabs .el-tabs__content {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
@@ -7,7 +7,7 @@
|
||||
:visible.sync="drawer"
|
||||
destroy-on-close
|
||||
direction="rtl"
|
||||
size="80%"
|
||||
size="90%"
|
||||
>
|
||||
<div
|
||||
class="shop_drawer_box demo-drawer__content"
|
||||
@@ -193,6 +193,21 @@ export default {
|
||||
deleteBookShopMarket:
|
||||
"/master/shopProduct/unbindProductAndSociologyMarket"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "心灵空间",
|
||||
key: 4,
|
||||
collapseLabelKey: 7,
|
||||
collapseMarketKey: 8,
|
||||
urlList: {
|
||||
saveBookShop: "/master/shopProduct/bindProductAndPsycheLabel",
|
||||
deleteBookShop:
|
||||
"/master/shopProduct/unbindProductAndPsycheLabel",
|
||||
saveBookShopMarket:
|
||||
"/master/shopProduct/bindProductAndPsycheMarket",
|
||||
deleteBookShopMarket:
|
||||
"/master/shopProduct/unbindProductAndPsycheMarket"
|
||||
}
|
||||
}
|
||||
],
|
||||
productId: null,
|
||||
@@ -212,6 +227,8 @@ export default {
|
||||
treeDataMarketList2: [],
|
||||
treeDataList3: [],
|
||||
treeDataMarketList3: [],
|
||||
treeDataList4: [],
|
||||
treeDataMarketList4: [],
|
||||
publishStatus: false,
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
@@ -262,6 +279,9 @@ export default {
|
||||
case 3:
|
||||
list = this.treeDataList3;
|
||||
break;
|
||||
case 4:
|
||||
list = this.treeDataList4;
|
||||
break;
|
||||
}
|
||||
} else if (type == "treeDataMarketList") {
|
||||
switch (key) {
|
||||
@@ -274,6 +294,9 @@ export default {
|
||||
case 3:
|
||||
list = this.treeDataMarketList3;
|
||||
break;
|
||||
case 4:
|
||||
list = this.treeDataMarketList4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log("list at line 258:", list, key);
|
||||
@@ -390,11 +413,13 @@ export default {
|
||||
|
||||
this.treeDataList2 = allData.medicineLabel;
|
||||
this.treeDataList3 = allData.sociologyLabel;
|
||||
this.treeDataList4 = allData.psycheLabel;
|
||||
// this.treeDataList1.push({});
|
||||
|
||||
this.treeDataMarketList1 = allData.bookMarket;
|
||||
this.treeDataMarketList2 = allData.medicineMarket;
|
||||
this.treeDataMarketList3 = allData.sociologyMarket;
|
||||
this.treeDataMarketList4 = allData.psycheMarket;
|
||||
|
||||
// this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
@@ -646,7 +671,7 @@ export default {
|
||||
|
||||
// overflow: hidden;
|
||||
.form_item {
|
||||
width: 33%;
|
||||
width: 23%;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
@@ -700,7 +725,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.title {
|
||||
width: 300px;
|
||||
width: 260px;
|
||||
min-width: 200px;
|
||||
padding: 20px;
|
||||
padding-bottom: 0;
|
||||
|
||||
Reference in New Issue
Block a user