删除讲书评论

This commit is contained in:
@fawn-nine
2023-12-05 10:11:21 +08:00
parent 428a69aa1d
commit 3b2fb9ff52
4 changed files with 162 additions and 1 deletions

31
package-lock.json generated
View File

@@ -20,6 +20,7 @@
"lodash": "4.17.5", "lodash": "4.17.5",
"node-sass": "^6.0.1", "node-sass": "^6.0.1",
"npm": "^6.9.0", "npm": "^6.9.0",
"quill-image-resize-module": "^3.0.0",
"sass-loader": "6.0.6", "sass-loader": "6.0.6",
"svg-sprite-loader": "3.7.3", "svg-sprite-loader": "3.7.3",
"vue": "2.5.16", "vue": "2.5.16",
@@ -19190,6 +19191,16 @@
"node": ">=0.10" "node": ">=0.10"
} }
}, },
"node_modules/quill-image-resize-module": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/quill-image-resize-module/-/quill-image-resize-module-3.0.0.tgz",
"integrity": "sha512-1TZBnUxU/WIx5dPyVjQ9yN7C6mLZSp04HyWBEMqT320DIq4MW4JgzlOPDZX5ZpBM3bU6sacU4kTLUc8VgYQZYw==",
"dependencies": {
"lodash": "^4.17.4",
"quill": "^1.2.2",
"raw-loader": "^0.5.1"
}
},
"node_modules/quill/node_modules/clone": { "node_modules/quill/node_modules/clone": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
@@ -19267,6 +19278,11 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/raw-loader": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz",
"integrity": "sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q=="
},
"node_modules/read-cache": { "node_modules/read-cache": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
@@ -39740,6 +39756,16 @@
"fast-diff": "1.1.2" "fast-diff": "1.1.2"
} }
}, },
"quill-image-resize-module": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/quill-image-resize-module/-/quill-image-resize-module-3.0.0.tgz",
"integrity": "sha512-1TZBnUxU/WIx5dPyVjQ9yN7C6mLZSp04HyWBEMqT320DIq4MW4JgzlOPDZX5ZpBM3bU6sacU4kTLUc8VgYQZYw==",
"requires": {
"lodash": "^4.17.4",
"quill": "^1.2.2",
"raw-loader": "^0.5.1"
}
},
"randomatic": { "randomatic": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
@@ -39794,6 +39820,11 @@
"unpipe": "1.0.0" "unpipe": "1.0.0"
} }
}, },
"raw-loader": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz",
"integrity": "sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q=="
},
"read-cache": { "read-cache": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",

View File

@@ -55,6 +55,7 @@ const mainRoutes = {
{ path: '/acupointList', component: _import('modules/acupoint/acupointList'), name: 'acupointList', meta: { title: '经穴文章列表', isTab: true } }, { path: '/acupointList', component: _import('modules/acupoint/acupointList'), name: 'acupointList', meta: { title: '经穴文章列表', isTab: true } },
{ path: '/acupointDetail', component: _import('modules/acupoint/acupointDetail'), name: 'acupointDetail', meta: { title: '穴位详细', isTab: true } }, { path: '/acupointDetail', component: _import('modules/acupoint/acupointDetail'), name: 'acupointDetail', meta: { title: '穴位详细', isTab: true } },
{ path: '/countyManagement', component: _import('modules/county/countyManagement'), name: 'countyManagement', meta: { title: '国家区域管理', isTab: true } }, { path: '/countyManagement', component: _import('modules/county/countyManagement'), name: 'countyManagement', meta: { title: '国家区域管理', isTab: true } },
{ path: '/commentsList', component: _import('modules/book/commentsList'), name: 'commentsList', meta: { title: '评论管理', isTab: true } },
], ],
beforeEnter (to, from, next) { beforeEnter (to, from, next) {
let token = Vue.cookie.get('token') let token = Vue.cookie.get('token')

View File

@@ -0,0 +1,126 @@
<template>
<div>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
prop="content"
align="center"
label="评论内容">
</el-table-column>
<el-table-column width="200" align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[30, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</template>
<script>
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
teachId:this.$route.query.teachId,
upPageIndex:0,
pageIndex: 1,
pageSize: 30,
totalPage: 0,
dataListLoading: false,
}
},
created(){
this.getDataList()
},
methods:{
// 删除
deleteHandle (id) {
console.log('进来了')
this.$confirm(`确定对[id=${id}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/teach/delComment'),
method: 'post',
// data: this.$http.adornData(ids, false)
// data: {'teachId': id}
params: this.$http.adornParams({
'commentId': id
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
// url: this.$http.adornUrl('/forum/articles/list'),
url: this.$http.adornUrl('/book/teach/getAllCommentList'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex,
'limit': this.pageSize,
//'key': this.dataForm.key,
// 'teachId' : this.teachId
})
}).then(({data}) => {
if (data && data.code === 0) {
console.log(data,'data')
this.dataList = data.page.records
this.totalPage = data.page.total
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
}
}
</script>
<style>
</style>

View File

@@ -69,6 +69,9 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.teachId)">修改</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.teachId)">修改</el-button>
<router-link :to="{path: 'commentsList' , query:{ teachId : scope.row.teachId} }">
<el-button type="text" size="small">评论管理</el-button>
</router-link>
<el-button type="text" size="small" @click="deleteHandle(scope.row.teachId)">删除</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.teachId)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>