Browse Source

增加property目录。

feature/yujt_analysis_pc
zhangyuan 6 years ago
parent
commit
afbfb2de44
  1. 102
      src/views/modules/property/gridpartymembergroup.vue
  2. 120
      src/views/modules/property/group-approve.vue
  3. 108
      src/views/modules/property/group-detail.vue
  4. 355
      src/views/modules/property/group.vue
  5. 167
      src/views/modules/property/leaderboard.vue
  6. 67
      src/views/modules/property/topic-close.vue
  7. 272
      src/views/modules/property/topic-detail.vue
  8. 205
      src/views/modules/property/topic-list.vue
  9. 30
      src/views/modules/property/topic.vue

102
src/views/modules/property/gridpartymembergroup.vue

@ -0,0 +1,102 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__group}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="网格">
<el-input v-model="dataForm.grid" placeholder="请输入网格名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
<el-button @click="createPartys()" type="primary">批量生成党员群</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="district" label="市区" header-align="center" align="center"></el-table-column>
<el-table-column prop="street" label="街道" header-align="center" align="center"></el-table-column>
<el-table-column prop="community" label="社区" header-align="center" align="center"></el-table-column>
<el-table-column prop="grid" label="网格" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="createParty(scope.row)">生成党员群</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/dept/queryCompleteDept',
getDataListIsPage: true
},
dataForm: {
district: '',
districtId: '',
street: '',
streetId: '',
community: '',
communityId: '',
grid: '',
gridId: ''
}
}
},
methods: {
createParty (row) {
var postForm = [{
district: row.district,
districtId: row.districtId,
street: row.street,
streetId: row.streetId,
community: row.community,
communityId: row.communityId,
grid: row.grid,
gridId: row.gridId
}]
this.$http['post']('/group/epdc-app/group/createPartys', postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.processingOpinionsVisible = false
this.getDataList()
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500
})
}).catch(() => { })
},
createPartys () {
var postForm = this.dataList
this.$http['post']('/group/epdc-app/group/createPartys', postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.processingOpinionsVisible = false
this.getDataList()
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500
})
}).catch(() => { })
}
}
}
</script>

120
src/views/modules/property/group-approve.vue

@ -0,0 +1,120 @@
<template>
<el-dialog :visible.sync="visible" :title="$t('verify')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'">
<el-form-item label="群名称:">
<div>{{dataForm.groupName}}</div>
</el-form-item>
<el-form-item label="群主:">
<div>{{dataForm.nickname}}</div>
</el-form-item>
<el-form-item label="创建时间:">
<div>{{dataForm.createdTime}}</div>
</el-form-item>
<el-form-item label="群介绍:">
<div>{{dataForm.groupIntroduction}}</div>
</el-form-item>
<el-form-item label="处理:" prop="state">
<el-select v-model="dataForm.state" placeholder="请选择">
<el-option
v-for="option in options"
:key="option.value"
:label="option.label"
:value="option.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="处理意见:" prop="processingOpinions" v-if="adviceVisible">
<el-input v-model="dataForm.processingOpinions" type="textarea" placeholder="不超过500字"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
adviceVisible: false,
dataForm: {
id: '',
groupName: '',
createdTime: '',
groupIntroduction: '',
nickname: '',
state: '10',
processingOpinions: ''
},
options: [{
value: '10',
label: '通过'
}, {
value: '5',
label: '拒绝'
}]
}
},
watch: {
'dataForm.state': function (val) {
if (val === '10') {
this.adviceVisible = false
} else {
this.adviceVisible = true
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
if (this.dataForm.id) {
this.getInfo()
this.dataForm.state = '10'
this.dataForm.processingOpinions = ''
}
})
},
getInfo () {
this.$http.get(`/group/group/detail/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
dataFormSubmitHandle: debounce(function () {
if (this.adviceVisible) {
if (this.dataForm.processingOpinions === '') {
return this.$message.error('处理意见不能为空')
}
if (this.dataForm.processingOpinions > 500) {
return this.$message.error('处理意见不能超过500字')
}
}
this.$http['post'](
'/group/group/operate', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

108
src/views/modules/property/group-detail.vue

@ -0,0 +1,108 @@
<template>
<el-dialog :visible.sync="visible" :title="$t('look')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'">
<el-form-item label="群介绍:">
<div>{{responseForm.groupIntroduction}}</div>
</el-form-item>
<el-form-item label="状态:">
<div v-if="responseForm.state === 0">待审核</div>
<div v-if="responseForm.state === 5">审核不通过</div>
<div v-if="responseForm.state === 10">审核通过</div>
<div v-if="responseForm.state === 15">禁言</div>
<div v-if="responseForm.state === 20">已解散</div>
</el-form-item>
<el-form-item label="备注:" v-if="responseForm.state === 5 || responseForm.state === 20">
<div>{{responseForm.processingOpinions}}</div>
</el-form-item>
</el-form>
<el-form :inline="true" :model="dataForm" ref="dataForm">
<el-form-item>
<el-input v-model="dataForm.nickname" placeholder="姓名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="dataForm.mobile" placeholder="电话" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="nickname" label="成员名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="lordFlag" label="群主标识" header-align="center" align="center" :formatter="formatterLoadFlag"></el-table-column>
<el-table-column prop="mobile" label="联系电话" header-align="center" align="center"></el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/group/usergroup/page',
getDataListIsPage: true
},
visible: false,
dataForm: {
groupId: '',
nickname: '',
mobile: ''
},
responseForm: {
id: '',
groupIntroduction: '',
state: '',
processingOpinions: ''
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.groupId) {
this.getInfo()
this.getDataList()
}
})
},
//
getInfo () {
this.$http.get(`/group/group/${this.dataForm.groupId}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.responseForm = {
...this.responseForm,
...res.data
}
}).catch(() => {})
},
// 01
formatterLoadFlag: function (row, column) {
let lordFlag = row.lordFlag
if (lordFlag === '0') {
return '否'
} else if (lordFlag === '1') {
return '是'
}
}
}
}
</script>

355
src/views/modules/property/group.vue

@ -0,0 +1,355 @@
<template>
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-news__group}">
<el-form :inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()">
<el-form-item label="所属机构">
<el-cascader v-model="ids"
:options="options"
:props="{ checkStrictly: true }"
clearable>
</el-cascader>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="dataForm.state"
clearable
placeholder="请选择">
<el-option v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
style="width: 100%;">
<el-table-column type="index"
width="50"
label="序号"></el-table-column>
<el-table-column prop="groupName"
label="社群名称"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="groupCategory"
label="性质"
header-align="center"
:formatter="formatGroupCategory"
align="center"></el-table-column>
<el-table-column prop="createdTime"
label="创建时间"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="nickname"
label="群主"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="state"
label="状态"
header-align="center"
align="center"
:formatter="formatState"></el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150">
<template slot-scope="scope">
<el-button v-if="scope.row.state === 0"
type="text"
size="small"
@click="verify(scope.row.id)">{{ $t('verify') }}</el-button>
<el-button v-if="scope.row.state != 0"
type="text"
size="small"
@click="look(scope.row.id)">{{ $t('look') }}</el-button>
<el-button v-if="scope.row.state === 10"
type="text"
size="small"
@click="ban(scope.row.id)">{{ $t('ban') }}</el-button>
<el-button v-if="scope.row.state === 15"
type="text"
size="small"
@click="liftTheBan(scope.row.id)">{{ $t('liftTheBan') }}</el-button>
<el-button v-if="(scope.row.state === 10 || scope.row.state === 15) && scope.row.groupCategory !=='0'"
type="text"
size="small"
@click="handDisband(scope.row.id)">{{ $t('disband') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination :current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<group-detail v-if="groupDetailVisible"
ref="groupDetail"
@refreshDataList="getDataList"></group-detail>
<group-approve v-if="groupApproveVisible"
ref="groupApprove"
@refreshDataList="getDataList"></group-approve>
<!-- 解散原因弹框 -->
<el-dialog :visible.sync="processingOpinionsVisible"
v-if="processingOpinionsVisible"
title="解散社群">
<el-form :model="postForm" :rules="dataRule" ref="postForm" :label-width="$i18n.locale === 'en-US' ? '150px' : '100px'">
<el-form-item label="社群ID:" v-if="false">
<el-input v-model="postForm.id" type="textarea" placeholder="不超过500字">
</el-input>
</el-form-item>
<el-form-item label="社群状态:" v-if="false">
<el-input v-model="postForm.state" type="textarea" placeholder="不超过500字">
</el-input>
</el-form-item>
<el-form-item label="解散原因:" prop="processingOpinions">
<el-input v-model="postForm.processingOpinions" type="textarea" placeholder="不超过500字">
</el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="cancelDisBand">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="confirmDisBand">确定</el-button>
</template>
</el-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import GroupDetail from './group-detail'
import GroupApprove from './group-approve'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/group/group/page',
getDataListIsPage: true
},
groupDetailVisible: false,
groupApproveVisible: false,
processingOpinionsVisible: false, //
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
state: '0'
},
postForm: {
id: '',
state: 0,
processingOpinions: ''//
},
ids: [],
options: [],
stateOptions: [{
id: '0',
name: '待审核'
}, {
id: '5',
name: '审核不通过'
}, {
id: '10',
name: '正常'
}, {
id: '15',
name: '禁言'
}, {
id: '20',
name: '已解散'
}]
}
},
computed: {
dataRule () {
return {
processingOpinions: [
{ required: true, message: '解散原因不能为空', trigger: 'blur' }
]
}
}
},
components: {
GroupDetail,
GroupApprove
},
created: function () {
this.getOptions()
},
watch: {
'ids': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
}
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
}
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
}
}
},
methods: {
formatState: function (row, column) {
if (row.state === 0) {
return '待审核'
}
if (row.state === 5) {
return '审核不通过'
}
if (row.state === 10) {
return '正常'
}
if (row.state === 15) {
return '禁言'
}
if (row.state === 20) {
return '已解散'
}
},
formatGroupCategory: function (row, column) {
return row.groupCategory === '0' ? '党员群' : row.groupCategory === '1' ? '自建群' : '未知'
},
ban (id) {
this.$confirm('确定禁言社群?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.postForm.state = 15
this.postForm.id = id
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.getDataList()
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500
})
}).catch(() => { })
}).catch(() => { })
},
liftTheBan (id) {
this.$confirm('确定解禁社群?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.postForm.state = 10
this.postForm.id = id
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.getDataList()
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500
})
}).catch(() => { })
}).catch(() => { })
},
disband (id) {
this.$confirm('确定解散社群?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.postForm.state = 20
this.postForm.id = id
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.getDataList()
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500
})
}).catch(() => { })
}).catch(() => { })
},
look (id) {
this.groupDetailVisible = true
this.$nextTick(() => {
this.$refs.groupDetail.dataForm.groupId = id
this.$refs.groupDetail.init()
})
},
verify (id) {
this.groupApproveVisible = true
this.$nextTick(() => {
this.$refs.groupApprove.dataForm.id = id
this.$refs.groupApprove.init()
})
},
getOptions () {
this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => { })
},
handDisband (id) {
this.postForm.state = 20
this.postForm.id = id
this.postForm.processingOpinions = ''
this.processingOpinionsVisible = true
},
confirmDisBand () {
if (this.postForm.processingOpinions == null || this.postForm.processingOpinions === '') {
return this.$message.error('请填写解散原因')
}
if (this.postForm.processingOpinions.length > 500) {
return this.$message.error('解散原因不能超过500字')
}
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.processingOpinionsVisible = false
this.getDataList()
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500
})
}).catch(() => { })
},
cancelDisBand () {
console.log(this.$refs['postForm'])
this.$refs['postForm'].resetFields()
this.processingOpinionsVisible = false
}
}
}
</script>

167
src/views/modules/property/leaderboard.vue

@ -0,0 +1,167 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__topic}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="所属机构">
<el-cascader v-model="ids" :options="options" :props="{ checkStrictly: true }" clearable>
</el-cascader>
</el-form-item>
<el-form-item label="时间"
prop="startTime">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="至"
label-width="25px"
prop="endTime">
<el-date-picker v-model="dataForm.endTime"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="排名">
<el-select v-model="orderType" clearable
placeholder="请选择">
<el-option v-for="item in orderTypeOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table v-if="this.orderType === '0'" v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="排名" type="index" show-overflow-tooltip align="center" width="50"></el-table-column>
<el-table-column prop="groupName" label="群名" header-align="center" align="center"></el-table-column>
<el-table-column prop="allDeptNames" label="所属网格" header-align="center" align="center"></el-table-column>
</el-table>
<el-table v-if="this.orderType === '1'" v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="排名" type="index" show-overflow-tooltip align="center" width="50"></el-table-column>
<el-table-column prop="groupName" label="群名" header-align="center" align="center"></el-table-column>
<el-table-column prop="memberNum" label="群成员数量" header-align="center" align="center"></el-table-column>
<el-table-column prop="allDeptNames" label="所属网格" header-align="center" align="center"></el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<close v-if="closeVisible" ref="close" @refreshDataList="getDataList"></close>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import Close from './topic-close'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/group/group/activity',
getDataListIsPage: true
},
closeVisible: false,
detailVisible: false,
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
startTime: '',
endTime: ''
},
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.startTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.endTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
},
orderType: '0',
ids: [],
options: [],
orderTypeOptions: [{
id: '0',
name: '按活跃度排名'
}, {
id: '1',
name: '按群成员排名'
}]
}
},
watch: {
'orderType': function (val) {
if (val === '0') {
this.mixinViewModuleOptions.getDataListURL = '/group/group/activity'
} else {
this.mixinViewModuleOptions.getDataListURL = '/group/group/member'
}
this.getDataList()
},
'ids': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
}
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
}
}
},
components: {
Close
},
created: function () {
this.getOptions()
},
methods: {
getOptions () {
this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
}
}
}
</script>

67
src/views/modules/property/topic-close.vue

@ -0,0 +1,67 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="关闭原因" prop="processingOpinions">
<el-input v-model="dataForm.processingOpinions" type="textarea" placeholder="50字以内"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
processingOpinions: ''
}
}
},
computed: {
dataRule () {
return {
processingOpinions: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http['post']('/group/topic/close', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

272
src/views/modules/property/topic-detail.vue

@ -0,0 +1,272 @@
<template>
<div class="project-handle">
<el-form :model="dataForm" ref="dataForm" style="width: 100%; height: 100%;">
<div class="project-detail">
<div class="project-detail-tip">话题详情</div>
<el-form label-position="right" label-width="120px">
<el-form-item label="话题内容:" prop="eventContent">
<div>{{dataForm.topicContent}}</div>
<el-image v-for="url in dataForm.images"
style="width: 100px; height: 100px; margin-right: 10px"
:key="url"
:src="url"
:preview-src-list="previewImgList"
@click="clickImg(url)">
</el-image>
</el-form-item>
<el-form-item label="所属网格:" prop="allDeptNames">
<div>{{dataForm.allDeptNames}}</div>
</el-form-item>
<el-form-item label="话题来源:" prop="groupName">
<div>{{dataForm.groupName}}</div>
</el-form-item>
<el-form-item label="发言人:" prop="nickName">
<div>{{dataForm.nickname}}</div>
</el-form-item>
<el-form-item label="评论:">
<el-button type="primary" @click="innerVisible = true">点击查看评论</el-button>
</el-form-item>
</el-form>
<div class="container">
<div class="location"><span style="font-weight: bold;color: #606266">上报位置:</span> {{dataForm.topicAddress}}</div>
<div id="map"></div>
</div>
</div>
<div style="width: 100%; text-align:center; float:left;">
<el-button size="medium" style="width: 95px" type="primary" @click="back">返回</el-button>
</div>
</el-form>
<el-dialog width="90%" title="评论" :visible.sync="innerVisible" append-to-body>
<el-table :data="commentsDTOs" border style="width: 100%;">
<el-table-column prop="user.userName" label="发言人" header-align="center" align="center"></el-table-column>
<el-table-column prop="commentTime" label="发言时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="content" label="发言内容" header-align="center" align="center"></el-table-column>
<el-table-column prop="replyComment.userName" label="被回复人" header-align="center" align="center"></el-table-column>
<el-table-column prop="replyComment.content" label="被回复内容" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="scope.row.shieldFlag === '0'" type="button" size="small" @click="deleteComment(scope.row.commentId)">屏蔽</el-button>
<el-button v-if="scope.row.shieldFlag === '1'" type="text" size="small">已屏蔽</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="limitVal"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandleNew"
@current-change="pageCurrentChangeHandleNew">
</el-pagination>
</el-dialog>
</div>
</template>
<script>
import BMap from 'BMap'
import 'element-ui/lib/theme-chalk/timeline.css'
import 'element-ui/lib/theme-chalk/timeline-item.css'
import 'element-ui/lib/theme-chalk/image.css'
export default {
data () {
return {
innerVisible: false,
dataForm: {
id: ''
},
previewImgList: [],
order: '',
orderField: '',
pageIndex: 1,
limitVal: 10,
total: 0,
commentsDTOs: []
}
},
mounted () {
this.dataForm.id = this.$route.query.id
this.init()
},
methods: {
back () {
this.$parent.selectComponent = 'TopicList'
},
initBmap (latitude, longitude) {
this.map = new BMap.Map('map')
const point = new BMap.Point(longitude, latitude)
var marker = new BMap.Marker(point)
this.map.addOverlay(marker)
this.map.centerAndZoom(point, 13)
this.map.enableScrollWheelZoom(true)
},
clickImg (url) {
this.previewImgList = []
this.previewImgList.push(url)
},
init () {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
this.getCommentList()
}
})
},
//
getInfo () {
this.$http.get(`/group/topic/detail/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.initBmap(this.dataForm.topicLatitude, this.dataForm.topicLongitude)
}).catch(() => {})
},
pageSizeChangeHandleNew (val) {
this.pageIndex = 1
this.limitVal = val
this.getCommentList()
},
pageCurrentChangeHandleNew (val) {
this.pageIndex = val
this.getCommentList()
},
getCommentList () {
this.$http.get('/group/topiccomment/comments', { params: { id: this.dataForm.id, order: this.order, orderField: this.orderField, page: this.pageIndex, limit: this.limitVal }
}).then(({ data: res }) => {
if (res.code !== 0) {
this.commentsDTOs = []
this.total = 0
return this.$message.error(res.msg)
}
this.commentsDTOs = res.data.list
this.total = res.data.total
}).catch(() => {})
},
deleteComment (val) {
this.$http['post'](
'/group/topiccomment/deleteComment', { commentIds: [val] }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getCommentList()
}
})
}).catch(() => {})
}
}
}
</script>
<style lang="scss">
.project-handle {
.el-timeline {
padding-left: 9px;
font-size: 13px;
}
}
.el-form-item__label {
font-weight: bold;
}
</style>
<style lang="scss" scoped>
.project-handle {
width: 100%;
height: calc(100vh - 120px);
background: #ffffff;
box-sizing: border-box;
padding: 10px;
.project-detail {
width: 100%;
height: 80%;
border: 2px solid #ccc;
box-sizing: border-box;
padding: 10px;
padding-top: 20px;
float:left;
margin-bottom: 1%;
position:relative;
.project-detail-tip {
position: absolute;
top: 0;
left:0;
width: 80px;
height: 30px;
line-height: 30px;
color: #ffffff;
background: #4ac38b;
text-align:center;
}
.el-form {
width: 58%;
height: 100%;
float:left;
overflow-y:auto;
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #fff;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #fff;
}
}
.container {
width: 40%;
height: 100%;
float: right;
.location {
height: 30px;
line-height: 30px;
}
#map {
width: 100%;
height: calc(100% - 30px);
}
}
}
.project-progress {
width: 20%;
height: 100%;
float: right;
border: 2px solid #ccc;
box-sizing: border-box;
margin-left: 1%;
padding-top: 20px;
overflow-y:auto;
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #aaa;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #ccc;
}
}
.handle-operation {
width: 79%;
height: 49%;
box-sizing: border-box;
border: 2px solid #ccc;
float:left;
}
}
</style>

205
src/views/modules/property/topic-list.vue

@ -0,0 +1,205 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__topic}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="所属机构">
<el-cascader v-model="ids" :options="options" :props="{ checkStrictly: true }" clearable>
</el-cascader>
</el-form-item>
<el-form-item label="时间"
prop="startTime">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="至"
label-width="25px"
prop="endTime">
<el-date-picker v-model="dataForm.endTime"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="群名">
<el-select v-model="dataForm.groupId" clearable
placeholder="请选择">
<el-option v-for="item in groupOptions"
:key="item.groupId"
:label="item.groupName"
:value="item.groupId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关键词" prop="keyword">
<el-input v-model="dataForm.keyword" placeholder="" clearable ></el-input>
</el-form-item>
<el-form-item label="排序方式">
<el-select v-model="dataForm.orderType" clearable
placeholder="请选择">
<el-option v-for="item in orderTypeOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('epdc:topic:export')" type="primary" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" type="index" show-overflow-tooltip align="center" width="50"></el-table-column>
<el-table-column prop="nickname" label="发言人" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="topicContent" label="话题内容" header-align="center" align="center"></el-table-column>
<el-table-column prop="commentNum" label="评论数" header-align="center" align="center"></el-table-column>
<el-table-column prop="browseNum" label="浏览数" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="look(scope.row.id)">{{ $t('look') }}</el-button>
<el-button v-if="scope.row.state !== 20" type="text" size="small" @click="close(scope.row.id)">{{ $t('close') }}</el-button>
<el-button type="text" size="small" v-if="scope.row.state ===20" :disabled="true">已关闭</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<close v-if="closeVisible" ref="close" @refreshDataList="getDataList"></close>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import Close from './topic-close'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/group/topic/page',
getDataListIsPage: true,
exportURL: '/group/topic/export'
},
closeVisible: false,
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
startTime: '',
endTime: '',
groupId: '',
keyword: '',
orderType: ''
},
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.startTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.endTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
},
ids: [],
options: [],
groupOptions: [],
orderTypeOptions: [{
id: '0',
name: '按发布时间排序'
}, {
id: '1',
name: '按浏览数排序'
}, {
id: '2',
name: '按评论数排序'
}]
}
},
components: {
Close
},
created: function () {
this.getOptions()
this.getGroupList()
},
watch: {
'ids': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
}
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
}
}
},
methods: {
close (id) {
this.closeVisible = true
this.$nextTick(() => {
this.$refs.close.dataForm.id = id
this.$refs.close.init()
})
},
look (id) {
this.$parent.selectComponent = 'TopicDetail'
this.$router.push({ path: '/group-topic', query: { id: id } })
},
getGroupList () {
this.$http.get('/group/group/groupList').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.groupOptions = res.data
}).catch(() => { })
},
getOptions () {
this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
}
}
}
</script>

30
src/views/modules/property/topic.vue

@ -0,0 +1,30 @@
<template>
<keep-alive include="TopicList">
<component :is="selectComponent"></component>
</keep-alive>
</template>
<script>
import TopicList from './topic-list'
import TopicDetail from './topic-detail'
export default {
data () {
return {
selectComponent: TopicList
}
},
components: {
TopicList,
TopicDetail
},
methods: {
init () {
this.selectComponent = TopicList
}
}
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save