6 changed files with 889 additions and 0 deletions
@ -0,0 +1,220 @@ |
|||
<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 prop="faceImg" |
|||
v-loading="loading" |
|||
label="头像"> |
|||
<el-upload class="avatar-uploader" |
|||
:action="uploadUrl" |
|||
:show-file-list="false" |
|||
:on-success="handleAvatarSuccess" |
|||
:on-error="handelError" |
|||
:before-upload="beforeAvatarUpload"> |
|||
<img v-if="dataForm.faceImg" |
|||
:src="dataForm.faceImg" |
|||
class="avatar"> |
|||
<i v-else |
|||
class="el-icon-plus avatar-uploader-icon"></i> |
|||
<div slot="tip" |
|||
class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input v-model="dataForm.name" placeholder="姓名" maxlength="10"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="联系方式" prop="mobile"> |
|||
<el-input v-model="dataForm.mobile" placeholder="联系方式" maxlength="20"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="格言" prop="motto"> |
|||
<el-input v-model="dataForm.motto" placeholder="格言" maxlength="20"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="职责" prop="duty"> |
|||
<el-input v-model="dataForm.duty" placeholder="职责" maxlength="32"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="负责区域" prop="areaResponsibility"> |
|||
<el-input v-model="dataForm.areaResponsibility" placeholder="负责区域" maxlength="200"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="党群名称"> |
|||
<el-select v-model="dataForm.partyGroupId" clearable |
|||
placeholder="请选择"> |
|||
<el-option v-for="item in groupOptions" |
|||
:key="item.groupId" |
|||
:label="item.partyGroupName" |
|||
:value="item.groupId"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="所属网格"> |
|||
<el-cascader v-model="dataForm.allDeptIdsShow" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
clearable></el-cascader> |
|||
</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' |
|||
import Cookies from 'js-cookie' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
partyGroupId: '', |
|||
name: '', |
|||
mobile: '', |
|||
motto: '', |
|||
duty: '', |
|||
faceImg: '', |
|||
areaResponsibility: '', |
|||
delFlag: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
allDeptIdsShow: [] |
|||
}, |
|||
groupOptions: [], |
|||
loading: false, |
|||
uploadUrl: '', |
|||
options: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
partyGroupId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
name: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
motto: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
duty: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
areaResponsibility: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getGroupList() |
|||
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` |
|||
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(() => { }) |
|||
}, |
|||
methods: { |
|||
getGroupList () { |
|||
this.$http.get('/partyGroup/partygroup/groupList').then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.groupOptions = res.data |
|||
}).catch(() => { }) |
|||
}, |
|||
handleAvatarSuccess (res, file) { |
|||
this.loading = false |
|||
this.dataForm.faceImg = res.data.url |
|||
}, |
|||
beforeAvatarUpload (file) { |
|||
this.loading = true |
|||
}, |
|||
handelError () { |
|||
this.loading = false |
|||
}, |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm = {} |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/partyGroup/partygroupofficials/${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 () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/partyGroup/partygroupofficials/', 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> |
|||
<style> |
|||
.avatar-uploader .el-upload { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.avatar-uploader .el-upload:hover { |
|||
border-color: #409eff; |
|||
} |
|||
.avatar-uploader-icon { |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 178px; |
|||
height: 178px; |
|||
line-height: 178px; |
|||
text-align: center; |
|||
} |
|||
.avatar { |
|||
width: 178px; |
|||
height: 178px; |
|||
display: block; |
|||
} |
|||
</style> |
@ -0,0 +1,113 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-__partygroupofficials}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item label="党群名称"> |
|||
<el-select v-model="dataForm.groupId" clearable |
|||
placeholder="请选择"> |
|||
<el-option v-for="item in groupOptions" |
|||
:key="item.groupId" |
|||
:label="item.partyGroupName" |
|||
:value="item.groupId"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="所属网格"> |
|||
<el-cascader v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
clearable></el-cascader> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</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="name" label="姓名" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="mobile" label="联系方式" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="duty" label="职责" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="areaResponsibility" 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="deleteHandle(scope.row.id)">{{ $t('delete') }}</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> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './partygroupofficials-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/partyGroup/partygroupofficials/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/partyGroup/partygroupofficials', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
gridId: '' |
|||
}, |
|||
deptIdList: [], |
|||
groupOptions: [], |
|||
options: [] |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.getGroupList() |
|||
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(() => { }) |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
methods: { |
|||
getGroupList () { |
|||
this.$http.get('/partyGroup/partygroup/groupList').then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.groupOptions = res.data |
|||
}).catch(() => { }) |
|||
} |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length !== 0) { |
|||
this.dataForm.gridId = val[val.length - 1] |
|||
} else { |
|||
this.dataForm.gridId = '' |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -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="remark"> |
|||
<el-input v-model="dataForm.remark" 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: '', |
|||
remark: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
remark: [ |
|||
{ 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']('/partyGroup/partytopic/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> |
@ -0,0 +1,266 @@ |
|||
<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="partyGroupName"> |
|||
<div>{{dataForm.partyGroupName}}</div> |
|||
</el-form-item> |
|||
<el-form-item label="所属板块:" prop="groupName"> |
|||
<div>{{dataForm.groupName === 0 ? '事好儿鼓个掌' : '话对捧个场'}}</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> |
|||
<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="username" 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="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 type="text" size="small" @click="deleteComment(scope.row.id)">{{ $t('delete') }}</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(`/partyGroup/partytopic/${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('/partyGroup/partytopiccomment/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['get']( |
|||
'/partyGroup/partytopiccomment/deleteCommonts/' + 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> |
@ -0,0 +1,193 @@ |
|||
<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="时间" |
|||
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.partyGroupName" |
|||
:value="item.groupId"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="所属板块"> |
|||
<el-select v-model="dataForm.topicModule" clearable |
|||
placeholder="请选择"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="事好儿鼓个掌" value="0"></el-option> |
|||
<el-option label="话对捧个场" value="1"></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 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 prop="supportNum" 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 './partytopic-close' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/partyGroup/partytopic/page', |
|||
getDataListIsPage: true, |
|||
exportURL: '/partyGroup/partytopic/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.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: '/partygroup-partytopic', query: { id: id } }) |
|||
}, |
|||
getGroupList () { |
|||
this.$http.get('/partyGroup/partygroup/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> |
@ -0,0 +1,30 @@ |
|||
<template> |
|||
<keep-alive include="TopicList"> |
|||
<component :is="selectComponent"></component> |
|||
</keep-alive> |
|||
</template> |
|||
|
|||
<script> |
|||
import TopicList from './partytopic-list' |
|||
import TopicDetail from './partytopic-detail' |
|||
export default { |
|||
data () { |
|||
return { |
|||
selectComponent: TopicList |
|||
} |
|||
}, |
|||
components: { |
|||
TopicList, |
|||
TopicDetail |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.selectComponent = TopicList |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue