This commit is contained in:
yanran200730
2022-02-18 13:54:47 +08:00
parent 745a22a8e2
commit 3c424b63ff
29 changed files with 1127 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
<template>
<ai-list v-if="!isShowDetail">
<template slot="title">
<ai-title title="村民圈" isShowArea :isShowBottomBorder="false" :instance="instance" v-model="areaId" @change="changeArea"></ai-title>
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :areaId="areaId" :ref="tab.name" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" />
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
<Detail v-else-if="componentName === 'Detail'" :params="params" :instance="instance" :dict="dict" @change="onChange"></Detail>
<CommentsDetail v-else-if="componentName === 'CommentsDetail'" :areaId="areaId" :params="params" :instance="instance" :dict="dict" @change="onChange"></CommentsDetail>
</template>
<script>
import List from './components/List.vue'
import CommentsList from './components/CommentsList'
import CommentsDetail from './components/CommentsDetail'
import Detail from './components/Detail'
import { mapState } from 'vuex'
export default {
name: 'AppVillagersCircle',
label: '村民圈',
components: {
CommentsDetail,
CommentsList,
List,
Detail
},
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
...mapState(['user']),
tabs () {
const tabList = [
{label: '信息审核', name: 'List', comp: List, permission: ''},
{label: '评论审核', name: 'CommentsList', comp: CommentsList, permission: ''}
]
return tabList
}
},
data () {
return {
currIndex: '0',
componentName: '',
params: {},
areaId: '',
isShowDetail: false
}
},
created() {
this.areaId = this.user.info.areaId
},
methods: {
changeArea () {
this.$nextTick(() => {
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
})
},
onChange (data) {
if (data.type === 'List') {
this.componentName = 'List'
this.isShowDetail = false
this.params = data.params
}
if (data.type === 'CommentsList') {
this.componentName = 'CommentsList'
this.isShowDetail = false
this.params = data.params
}
if (data.type === 'Detail') {
this.componentName = 'Detail'
this.isShowDetail = true
this.params = data.params
}
if (data.type === 'CommentsDetail') {
this.componentName = 'CommentsDetail'
this.isShowDetail = true
this.params = data.params
}
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,135 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基础信息">
<ai-wrapper slot="content">
<ai-info-item label="话题" :value="dict.getLabel('villagerCircleTopic', info.villagerCircleInfo.topic)" isLine></ai-info-item>
<ai-info-item label="发布人" :value="info.replyUserName" isLine></ai-info-item>
<ai-info-item label="发布时间" :value="info.createTime" isLine></ai-info-item>
<ai-info-item label="所在位置" :value="info.villagerCircleInfo.gpsDesc" isLine></ai-info-item>
<ai-info-item label="内容" :value="info.content" isLine></ai-info-item>
</ai-wrapper>
</ai-card>
<ai-card title="处理结果" v-if="info.status > 0">
<div slot="content" style="margin-top: 16px">
<ai-wrapper
label-width="120px">
<ai-info-item label="处理结果" :value="info.status === '1' ? '通过' : '拒绝'" isLine></ai-info-item>
<ai-info-item label="原因" v-if="info.status === '2'" isLine :value="info.auditOpinion"></ai-info-item>
<ai-info-item label="审核人" :value="info.auditUserName"></ai-info-item>
<ai-info-item label="审核时间" :value="info.auditTime"></ai-info-item>
</ai-wrapper>
</div>
</ai-card>
<ai-dialog
:visible.sync="isShow"
width="800px"
@close="onClose"
title="审核"
@onConfirm="onConfirm">
<el-form class="ai-form" label-width="120px" :model="form" ref="form">
<el-form-item label="是否通过审核" prop="pass" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过审核' }]">
<el-radio-group v-model="form.pass">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核意见" v-if="form.pass === '0'" prop="opinion" style="width: 100%;" :rules="[{ required: true, message: '请输入审核意见' }]">
<el-input type="textarea" :rows="5" :maxlength="500" v-model="form.opinion" clearable placeholder="请输入审核意见" show-word-limit></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</template>
<template #footer >
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="isShow = true" v-if="info.status === '0'">审核</el-button>
</template>
</ai-detail>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'CommentsDetail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
id: '',
search: {
current: 1,
size: 10
},
form: {
opinion: '',
pass: ''
},
isShow: false,
type: ''
}
},
computed: {
...mapState(['user'])
},
created () {
this.getInfo(this.params.id)
},
methods: {
getInfo (id) {
this.instance.post(`/app/appvillagercirclecomment/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
}
})
},
onClose () {
this.form.pass = ''
this.form.opinion = ''
this.id = ''
},
onConfirm() {
this.$refs.form.validate(v => {
if (v) {
this.instance.post('/app/appvillagercirclecomment/examine', null, {
params: {
...this.form,
id: this.params.id
}
}).then(res => {
if (res.code == 0) {
this.isShow = false
this.getInfo(this.params.id)
this.$message.success('审核成功!')
}
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'CommentsList',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,140 @@
<template>
<ai-list isTabs>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<ai-select
placeholder="请选择状态"
v-model="search.status"
clearable
@change="search.current = 1, getList()"
:selectList="dict.getDict('auditStatus')">
</ai-select>
<ai-select
placeholder="请选择话题"
v-model="search.topic"
clearable
@change="search.current = 1, getList()"
:selectList="dict.getDict('villagerCircleTopic')">
</ai-select>
</template>
<template #right>
<el-input
v-model="search.title"
class="search-input"
size="small"
@keyup.enter.native="search.current = 1, search.title, getList()"
placeholder="请输入发布人姓名"
clearable
@clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'CommentsList',
props: {
instance: Function,
dict: Object,
areaId: String
},
data() {
return {
search: {
current: 1,
size: 10,
status: '',
topic: '',
title: ''
},
total: 0,
colConfigs: [
{ prop: 'replyUserName', label: '发布人', align: 'left' },
{ prop: 'createTime', label: '发布时间', align: 'center' },
{ prop: 'content', label: '发布内容', align: 'center' },
{ prop: 'villagerCircleInfo', label: '话题类型', align: 'center', formart: v => this.dict.getLabel('villagerCircleTopic', v.topic) },
{ prop: 'status', label: '状态', align: 'center', formart: v => this.dict.getLabel('auditStatus', v) },
{ prop: 'auditUserName', label: '审核人', align: 'center' },
{ prop: 'auditTime', label: '审核时间', align: 'center' },
{ slot: 'options', label: '操作', align: 'center' }
],
tableData: []
}
},
computed: {
...mapState(['user'])
},
created () {
this.search.areaId = this.user.info.areaId
this.dict.load(['villagerCircleTopic', 'auditStatus']).then(() => {
this.getList()
})
},
methods: {
getList() {
this.instance.post(`/app/appvillagercirclecomment/list`, null, {
params: {
...this.search,
areaId: this.areaId
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appvillagercirclecomment/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'CommentsDetail',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,143 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="村民圈详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基础信息">
<ai-wrapper slot="content">
<ai-info-item label="话题" :value="dict.getLabel('villagerCircleTopic', info.topic)" isLine></ai-info-item>
<ai-info-item label="发布人" :value="info.createUserName" isLine></ai-info-item>
<ai-info-item label="发布时间" :value="info.createTime" isLine></ai-info-item>
<ai-info-item label="所在位置" :value="info.gpsDesc" isLine></ai-info-item>
<ai-info-item label="内容" :value="info.content" isLine></ai-info-item>
<ai-info-item label="图片" isLine>
<ai-uploader
:instance="instance"
disabled
v-model="info.pictures"
:limit="9">
</ai-uploader>
</ai-info-item>
</ai-wrapper>
</ai-card>
<ai-card title="处理结果" v-if="info.status > 0">
<div slot="content" style="margin-top: 16px">
<ai-wrapper
label-width="120px">
<ai-info-item label="处理结果" :value="info.status === '1' ? '通过' : '拒绝'" isLine></ai-info-item>
<ai-info-item label="原因" v-if="info.status === '2'" isLine :value="info.auditOpinion"></ai-info-item>
<ai-info-item label="审核人" :value="info.auditUserName"></ai-info-item>
<ai-info-item label="审核时间" :value="info.auditTime"></ai-info-item>
</ai-wrapper>
</div>
</ai-card>
<ai-dialog
:visible.sync="isShow"
width="800px"
@close="onClose"
title="审核"
@onConfirm="onConfirm">
<el-form class="ai-form" label-width="120px" :model="form" ref="form">
<el-form-item label="是否通过审核" prop="pass" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过审核' }]">
<el-radio-group v-model="form.pass">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核意见" v-if="form.pass === '0'" prop="opinion" style="width: 100%;" :rules="[{ required: true, message: '请输入审核意见' }]">
<el-input type="textarea" :rows="5" :maxlength="500" v-model="form.opinion" clearable placeholder="请输入审核意见" show-word-limit></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</template>
<template #footer >
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="isShow = true" v-if="info.status === '0'">审核</el-button>
</template>
</ai-detail>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
id: '',
search: {
current: 1,
size: 10
},
form: {
opinion: '',
pass: ''
},
isShow: false,
type: ''
}
},
computed: {
...mapState(['user'])
},
created () {
this.getInfo(this.params.id)
},
methods: {
getInfo (id) {
this.instance.post(`/app/appvillagercircleinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
}
})
},
onClose () {
this.form.pass = ''
this.form.opinion = ''
this.id = ''
},
onConfirm() {
this.$refs.form.validate(v => {
if (v) {
this.instance.post('/app/appvillagercircleinfo/examine', null, {
params: {
...this.form,
id: this.params.id
}
}).then(res => {
if (res.code == 0) {
this.isShow = false
this.getInfo(this.params.id)
this.$message.success('审核成功!')
}
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,141 @@
<template>
<ai-list isTabs>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<ai-select
placeholder="请选择状态"
v-model="search.status"
clearable
@change="search.current = 1, getList()"
:selectList="dict.getDict('auditStatus')">
</ai-select>
<ai-select
placeholder="请选择话题"
v-model="search.topic"
clearable
@change="search.current = 1, getList()"
:selectList="dict.getDict('villagerCircleTopic')">
</ai-select>
</template>
<template #right>
<el-input
v-model="search.title"
class="search-input"
size="small"
@keyup.enter.native="search.current = 1, search.title, getList()"
placeholder="请输入发布人姓名"
clearable
@clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'List',
props: {
instance: Function,
dict: Object,
areaId: String
},
data() {
return {
search: {
current: 1,
size: 10,
status: '',
topic: '',
title: '',
areaId: ''
},
total: 0,
colConfigs: [
{ prop: 'createUserName', label: '发布人', align: 'left' },
{ prop: 'createTime', label: '发布时间', align: 'center' },
{ prop: 'content', label: '发布内容', align: 'center' },
{ prop: 'topic', label: '话题类型', align: 'center', formart: v => this.dict.getLabel('villagerCircleTopic', v) },
{ prop: 'status', label: '状态', align: 'center', formart: v => this.dict.getLabel('auditStatus', v) },
{ prop: 'auditUserName', label: '审核人', align: 'center' },
{ prop: 'auditTime', label: '审核时间', align: 'center' },
{ slot: 'options', label: '操作', align: 'center' }
],
tableData: []
}
},
computed: {
...mapState(['user'])
},
created () {
this.search.areaId = this.user.info.areaId
this.dict.load(['villagerCircleTopic', 'auditStatus']).then(() => {
this.getList()
})
},
methods: {
getList() {
this.instance.post(`/app/appvillagercircleinfo/list`, null, {
params: {
...this.search,
areaId: this.areaId
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appvillagercircleinfo/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>