评论管理
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const baseUrl = "http://192.168.110.100:9200/pb"; //张川川后端
|
// const baseUrl = "http://192.168.110.100:9200/pb"; //张川川后端
|
||||||
// const baseUrl = 'http://59.110.212.44:9100/pb'
|
// const baseUrl = 'http://59.110.212.44:9100/pb'
|
||||||
// const baseUrl = "https://testapi.nuttyreading.com";
|
// const baseUrl = "https://testapi.nuttyreading.com";
|
||||||
// const baseUrl = 'https://api.nuttyreading.com'
|
const baseUrl = 'https://api.nuttyreading.com'
|
||||||
// function commonFun() {
|
// function commonFun() {
|
||||||
// console.log("公共方法")
|
// console.log("公共方法")
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -24,13 +24,21 @@
|
|||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="text"
|
<el-button
|
||||||
|
v-if="tableData.length > 0"
|
||||||
|
style="position: absolute;right: 0;"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="deleteHandle('all')"
|
||||||
|
>批量删除</el-button
|
||||||
|
>
|
||||||
|
<!-- <el-button type="text"
|
||||||
@click="changeDefalutExpand()"
|
@click="changeDefalutExpand()"
|
||||||
style="position: absolute;right: 0;"
|
style="position: absolute;right: 0;"
|
||||||
:style="`color:${defaultExpand?'#17B3A3':'#333'}`"
|
:style="`color:${defaultExpand?'#17B3A3':'#333'}`"
|
||||||
>{{ !defaultExpand ? "收起" : "展开" }}全部评论
|
>{{ !defaultExpand ? "收起" : "展开" }}全部评论
|
||||||
<i class="el-icon-s-comment" ></i
|
<i class="el-icon-s-comment" ></i
|
||||||
></el-button>
|
></el-button> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
@@ -40,10 +48,18 @@
|
|||||||
:default-expand-all="defaultExpand"
|
:default-expand-all="defaultExpand"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
height="calc(100% - 100px)"
|
height="calc(100% - 40px)"
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
@selection-change="handleSelectionChange"
|
||||||
|
:default-sort="{ prop: 'date', order: 'descending' }"
|
||||||
>
|
>
|
||||||
<el-table-column fixed prop="createTime" label="日期" width="200">
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
fixed
|
||||||
|
prop="createTime"
|
||||||
|
label="日期"
|
||||||
|
width="200"
|
||||||
|
sortable
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" label="姓名" width="120">
|
<el-table-column prop="name" label="姓名" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -51,9 +67,8 @@
|
|||||||
<el-tooltip placement="top" v-if="scope.row.user">
|
<el-tooltip placement="top" v-if="scope.row.user">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<div>
|
<div>
|
||||||
<p v-if="scope.row.user.nickname ">
|
<p v-if="scope.row.user.nickname">
|
||||||
昵称:{{ scope.row.user.nickname }}
|
昵称:{{ scope.row.user.nickname }}
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
<p v-if="scope.row.user.name">
|
<p v-if="scope.row.user.name">
|
||||||
姓名:{{ scope.row.user.name }}
|
姓名:{{ scope.row.user.name }}
|
||||||
@@ -91,7 +106,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span
|
<span
|
||||||
style="color: red;cursor: pointer;"
|
style="color: red;cursor: pointer;"
|
||||||
@click="deleteHandle(scope.row.id)"
|
@click="deleteHandle('one', scope.row.id)"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</span>
|
</span>
|
||||||
@@ -118,6 +133,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
selectData: [],
|
||||||
query: {
|
query: {
|
||||||
content: ""
|
content: ""
|
||||||
},
|
},
|
||||||
@@ -130,6 +146,10 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSelectionChange(data) {
|
||||||
|
console.log("data at line 141:", data);
|
||||||
|
this.selectData = data;
|
||||||
|
},
|
||||||
changeDefalutExpand() {
|
changeDefalutExpand() {
|
||||||
this.refreshTable = false;
|
this.refreshTable = false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -161,7 +181,7 @@ export default {
|
|||||||
limit: this.pageSize,
|
limit: this.pageSize,
|
||||||
page: this.pageIndex,
|
page: this.pageIndex,
|
||||||
type: 0, //类型0课程1章节
|
type: 0, //类型0课程1章节
|
||||||
courseId: this.courseId,
|
courseId: this.courseId ? this.courseId : "",
|
||||||
|
|
||||||
chapterId: "",
|
chapterId: "",
|
||||||
content: this.query.content //内容
|
content: this.query.content //内容
|
||||||
@@ -182,19 +202,27 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteHandle(id) {
|
deleteHandle(type, id) {
|
||||||
this.$confirm("请确认是否删除?", "提示", {
|
if (type == "all") {
|
||||||
|
if (this.selectData.length == 0) {
|
||||||
|
this.$message.error("请至少选择一条评论");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$confirm(`请确认是否${type == "all" ? "批量" : ""}删除?`, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
var ids = this.selectData.map(e => e.id).join(",");
|
||||||
|
console.log("ids at line 205:", ids);
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(
|
url: this.$http.adornUrl(
|
||||||
`/master/courseGuestbook/delCourseGuestbook`
|
`/master/courseGuestbook/delCourseGuestbook`
|
||||||
),
|
),
|
||||||
method: "post",
|
method: "post",
|
||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
id: id
|
ids: type == "all" ? ids : id
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
|
|||||||
49
src/views/modules/course/commontList.vue
Normal file
49
src/views/modules/course/commontList.vue
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<div
|
||||||
|
style="padding:0 20px;box-sizing: border-box;height:calc(100% - 100px);"
|
||||||
|
>
|
||||||
|
<common-commont
|
||||||
|
ref="commonCommont"
|
||||||
|
|
||||||
|
|
||||||
|
></common-commont>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import commonCommont from "@/views/components/courseList/commont.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
aaa:111,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
|
||||||
|
commonCommont
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.commonCommont.init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
created(){
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.commonCommont.init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.mod-config{
|
||||||
|
height: 80vh;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
fixed="right"
|
fixed="right"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
width="340"
|
width="280"
|
||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -195,12 +195,12 @@
|
|||||||
@click="handleQuestionBank(scope.row)"
|
@click="handleQuestionBank(scope.row)"
|
||||||
>题库管理</el-button
|
>题库管理</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click="showLinkComment(scope.row)"
|
@click="showLinkComment(scope.row)"
|
||||||
>评论管理<i class="el-icon-s-comment"></i
|
>评论管理<i class="el-icon-s-comment"></i
|
||||||
></el-button>
|
></el-button> -->
|
||||||
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
|
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
|
||||||
>查看引用</el-button
|
>查看引用</el-button
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user