15 changed files with 1892 additions and 4 deletions
@ -0,0 +1,85 @@ |
|||
<template> |
|||
<el-dialog |
|||
append-to-body |
|||
:visible.sync="visible" |
|||
title="用户列表" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
> |
|||
<el-form :inline="true" :model="dataForm" ref="dataForm" @keyup.enter.native="getDataList()"> |
|||
<div> |
|||
<el-form-item label="电话"> |
|||
<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> |
|||
</div> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border 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="mobile" label="电话" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="realName" label="真实姓名" width="160" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="setManager(scope.row.id,scope.row.nickname)">设为群主</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> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/app-user/user/getUserListPage', |
|||
getDataListIsPage: true |
|||
}, |
|||
visible: false, |
|||
dataForm: { |
|||
deptId: '', |
|||
mobile: '' |
|||
} |
|||
} |
|||
}, |
|||
created () { |
|||
|
|||
}, |
|||
methods: { |
|||
setManager (id, nickname) { |
|||
let data = { |
|||
userId: id, |
|||
nickname: nickname |
|||
} |
|||
this.$emit('setUserID', data) |
|||
this.visible = false |
|||
}, |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.deptId) { |
|||
this.getDataList() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,245 @@ |
|||
<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="partyGroupAvatar" |
|||
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.partyGroupAvatar" |
|||
:src="dataForm.partyGroupAvatar" |
|||
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="partyGroupName"> |
|||
<el-input v-model="dataForm.partyGroupName" placeholder="党群名" maxlength="10"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="介绍" prop="groupIntroduction"> |
|||
<el-input v-model="dataForm.groupIntroduction" placeholder="介绍" maxlength="500"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="所属部门"> |
|||
<el-cascader v-model="deptIdList" |
|||
:options="options" |
|||
:props="{ checkStrictly: true }" |
|||
clearable @change="getUserList" |
|||
></el-cascader> |
|||
</el-form-item> |
|||
<el-form-item label="党群群主"> |
|||
<el-input v-model="dataForm.userId" v-show="false"></el-input> |
|||
<el-button type="primary" @click="openManagerSelect">点击选择群主</el-button> |
|||
{{nickname}} |
|||
</el-form-item> |
|||
<el-form-item prop="sort" label="排序"> |
|||
<el-input-number v-model="dataForm.sort" :min="0" label="排序"></el-input-number> |
|||
</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> |
|||
<!-- 积分记录 --> |
|||
<party-group-manager-list v-if="partyGroupManagerListVisible" |
|||
ref="partyGroupManagerList" @setUserID="setUserID"></party-group-manager-list> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
import Cookies from 'js-cookie' |
|||
import partyGroupManagerList from './party-group-manager-list' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
partyGroupName: '', |
|||
partyGroupAvatar: '', |
|||
groupIntroduction: '', |
|||
dept: '', |
|||
deptId: '', |
|||
state: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
delFlag: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '', |
|||
userId: '' |
|||
}, |
|||
loading: false, |
|||
uploadUrl: '', |
|||
options: [], |
|||
userIdList: [], |
|||
deptIdList: '', |
|||
partyGroupManagerListVisible: false, |
|||
nickname: '' |
|||
} |
|||
}, |
|||
components: { |
|||
partyGroupManagerList |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
partyGroupName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
partyGroupAvatar: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
groupIntroduction: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
userId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created: function () { |
|||
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) |
|||
} |
|||
let endOption = res.data.options |
|||
for (let i = 0; i < endOption.length; i++) { |
|||
endOption[i].children = '' |
|||
} |
|||
this.options = endOption |
|||
}) |
|||
.catch(() => { }) |
|||
}, |
|||
methods: { |
|||
setUserID (data) { |
|||
this.nickname = data.nickname |
|||
this.dataForm.userId = data.userId |
|||
}, |
|||
openManagerSelect () { |
|||
this.partyGroupManagerListVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.partyGroupManagerList.dataForm.deptId = this.dataForm.deptId |
|||
this.$refs.partyGroupManagerList.init() |
|||
}) |
|||
}, |
|||
getUserList () { |
|||
if (!this.dataForm.id) { |
|||
this.dataForm.userId = '' |
|||
this.nickname = '' |
|||
} |
|||
let deptId = Array.isArray(this.deptIdList) ? this.deptIdList[0] : this.deptIdList |
|||
this.dataForm.deptId = deptId |
|||
}, |
|||
handleAvatarSuccess (res, file) { |
|||
this.loading = false |
|||
this.dataForm.partyGroupAvatar = res.data.url |
|||
}, |
|||
beforeAvatarUpload (file) { |
|||
this.loading = true |
|||
}, |
|||
handelError () { |
|||
this.loading = false |
|||
}, |
|||
init () { |
|||
this.visible = true |
|||
this.userIdList = [] |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm = {} |
|||
this.deptIdList = '' |
|||
this.nickname = '' |
|||
this.dataForm.sort = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/partyGroup/partygroup/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.deptIdList = res.data.deptId |
|||
this.nickname = res.data.nickname |
|||
this.getUserList() |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
if (this.dataForm.deptId === undefined || this.dataForm.deptId === '') { |
|||
return this.$message.error('部门不能为空') |
|||
} |
|||
if (this.dataForm.userId === undefined || this.dataForm.userId === '') { |
|||
return this.$message.error('群主不能为空') |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/partyGroup/partygroup/', 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,69 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-__partygroup}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<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="partyGroupName" 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="sort" 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 :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)">群成员</el-button> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<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 './partygroup-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/partyGroup/partygroup/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/partyGroup/partygroup', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '' |
|||
} |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
created: function () { |
|||
|
|||
}, |
|||
methods: { |
|||
look (id) { |
|||
this.$parent.selectComponent = 'PartyUserGroupList' |
|||
this.$router.push({ path: '/partygroup-partygroup', query: { id: id } }) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,30 @@ |
|||
<template> |
|||
<keep-alive include="PartyGroupList"> |
|||
<component :is="selectComponent"></component> |
|||
</keep-alive> |
|||
</template> |
|||
|
|||
<script> |
|||
import PartyGroupList from './partygroup-list' |
|||
import PartyUserGroupList from './partyusergroup-list' |
|||
export default { |
|||
data () { |
|||
return { |
|||
selectComponent: PartyGroupList |
|||
} |
|||
}, |
|||
components: { |
|||
PartyGroupList, |
|||
PartyUserGroupList |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.selectComponent = PartyGroupList |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
</style> |
@ -0,0 +1,223 @@ |
|||
<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' } |
|||
], |
|||
faceImg: [ |
|||
{ 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,115 @@ |
|||
<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 prop="partyGroupName" 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="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<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> |
@ -0,0 +1,194 @@ |
|||
<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="党群ID" prop="partyGroupId"> |
|||
<el-input v-model="dataForm.partyGroupId" placeholder="党群ID"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="用户ID" prop="userId"> |
|||
<el-input v-model="dataForm.userId" placeholder="用户ID"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="昵称" prop="nickname"> |
|||
<el-input v-model="dataForm.nickname" placeholder="昵称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="用户头像" prop="userAvatar"> |
|||
<el-input v-model="dataForm.userAvatar" placeholder="用户头像"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="电话" prop="mobile"> |
|||
<el-input v-model="dataForm.mobile" placeholder="电话"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="身份标识 0:群员 1:群主 2:副群主" prop="identityFlag"> |
|||
<el-input v-model="dataForm.identityFlag" placeholder="身份标识 0:群员 1:群主 2:副群主"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="党员标识 0:否,1:是" prop="partyMember"> |
|||
<el-input v-model="dataForm.partyMember" placeholder="党员标识 0:否,1:是"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="状态 0:正常 5:已退群 10:被踢出群" prop="state"> |
|||
<el-input v-model="dataForm.state" placeholder="状态 0:正常 5:已退群 10:被踢出群"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="备注" prop="remark"> |
|||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="禁言开始时间" prop="bannedStartTime"> |
|||
<el-input v-model="dataForm.bannedStartTime" placeholder="禁言开始时间"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="禁言结束时间" prop="bannedEndTime"> |
|||
<el-input v-model="dataForm.bannedEndTime" placeholder="禁言结束时间"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="删除标记 0:未删除,1:删除" prop="delFlag"> |
|||
<el-input v-model="dataForm.delFlag" placeholder="删除标记 0:未删除,1:删除"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="乐观锁" prop="revision"> |
|||
<el-input v-model="dataForm.revision" placeholder="乐观锁"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人" prop="createdBy"> |
|||
<el-input v-model="dataForm.createdBy" placeholder="创建人"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdTime"> |
|||
<el-input v-model="dataForm.createdTime" placeholder="创建时间"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="更新人" prop="updatedBy"> |
|||
<el-input v-model="dataForm.updatedBy" placeholder="更新人"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedTime"> |
|||
<el-input v-model="dataForm.updatedTime" placeholder="更新时间"></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: '', |
|||
partyGroupId: '', |
|||
userId: '', |
|||
nickname: '', |
|||
userAvatar: '', |
|||
mobile: '', |
|||
identityFlag: '', |
|||
partyMember: '', |
|||
state: '', |
|||
remark: '', |
|||
bannedStartTime: '', |
|||
bannedEndTime: '', |
|||
delFlag: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
partyGroupId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
userId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
nickname: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
userAvatar: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
identityFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
partyMember: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
state: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
remark: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
bannedStartTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
bannedEndTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
delFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
revision: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
createdBy: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
createdTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
updatedBy: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
updatedTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`//partyusergroup/${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']('//partyusergroup/', 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,96 @@ |
|||
<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-select v-model="dataForm.bannedFlag" clearable |
|||
placeholder="请选择"> |
|||
<el-option v-for="item in bannedFlagOptions" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</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: '', |
|||
bannedFlag: '' |
|||
}, |
|||
bannedFlagOptions: [ |
|||
{ |
|||
label: '不禁言', |
|||
value: '0' |
|||
}, |
|||
{ |
|||
label: '禁言一天', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '禁言一周', |
|||
value: '2' |
|||
}, |
|||
{ |
|||
label: '禁言一月', |
|||
value: '3' |
|||
}, |
|||
{ |
|||
label: '永久禁言', |
|||
value: '4' |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
bannedFlag: [ |
|||
{ 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/partyusergroup/banned', 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,267 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-__partyusergroup}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="backToActList">返回</el-button> |
|||
</el-form-item> |
|||
<div> |
|||
<el-form-item label="昵称"> |
|||
<el-input v-model="dataForm.nickname" |
|||
placeholder="昵称" |
|||
clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="电话"> |
|||
<el-input v-model="dataForm.mobile" |
|||
placeholder="电话" |
|||
clearable></el-input> |
|||
</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> |
|||
</div> |
|||
</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="mobile" 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="grid" label="所属网格" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="identityFlag" label="身份" header-align="center" align="center" :formatter="identityFlagFormat"></el-table-column> |
|||
<el-table-column prop="bannedState" label="禁言状态" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="banned(scope.row.id)">禁言</el-button> |
|||
<el-button type="text" v-if="scope.row.identityFlag === '2' || scope.row.identityFlag === '1'" size="small" @click="setGroupManager(scope.row.id)">设置群主</el-button> |
|||
<el-button type="text" v-if="scope.row.identityFlag === '2' || scope.row.identityFlag === '0'" size="small" @click="set2GroupManager(scope.row.id)">设置副群主</el-button> |
|||
<el-button type="text" v-if="scope.row.identityFlag === '1' || scope.row.identityFlag === '0'" size="small" @click="setGroupUser(scope.row.id)">设置群成员</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> |
|||
<el-dialog |
|||
title="禁言时长" |
|||
:visible.sync="dialogVisible" |
|||
width="30%"> |
|||
<el-select v-model="dataForm.bannedFlag" clearable |
|||
placeholder="请选择"> |
|||
<el-option v-for="item in bannedFlagOptions" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
<el-button type="primary" @click="handleBanned">确 定</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './partyusergroup-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/partyGroup/partyusergroup/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/partyGroup/partyusergroup', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
partyGroupId: '', |
|||
bannedFlag: '', |
|||
gridId: '' |
|||
}, |
|||
dialogVisible: false, |
|||
bannedFlagOptions: [ |
|||
{ |
|||
label: '不禁言', |
|||
value: '0' |
|||
}, |
|||
{ |
|||
label: '禁言一天', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '禁言一周', |
|||
value: '2' |
|||
}, |
|||
{ |
|||
label: '禁言一月', |
|||
value: '3' |
|||
}, |
|||
{ |
|||
label: '永久禁言', |
|||
value: '4' |
|||
} |
|||
], |
|||
managerFrom: { |
|||
groupUserId: '', |
|||
identityFlag: '' |
|||
}, |
|||
deptIdList: [], |
|||
options: [] |
|||
} |
|||
}, |
|||
created: function () { |
|||
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 |
|||
}, |
|||
mounted () { |
|||
this.dataForm.partyGroupId = this.$route.query.id |
|||
this.getDataList() |
|||
}, |
|||
methods: { |
|||
setGroupManager (id) { |
|||
this.managerFrom.groupUserId = id |
|||
this.managerFrom.identityFlag = '0' |
|||
this.$confirm('设置该成员为群主后会将原群主设置为副群主,确定设为群主?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http['post']('/partyGroup/partyusergroup/setGroupManager', this.managerFrom).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.getDataList() |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
setGroupUser (id) { |
|||
this.managerFrom.groupUserId = id |
|||
this.managerFrom.identityFlag = '2' |
|||
this.$confirm('确定设为群成员?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http['post']('/partyGroup/partyusergroup/setGroupManager', this.managerFrom).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.getDataList() |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
set2GroupManager (id) { |
|||
this.managerFrom.groupUserId = id |
|||
this.managerFrom.identityFlag = '1' |
|||
this.$confirm('确定设为副群主?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http['post']('/partyGroup/partyusergroup/setGroupManager', this.managerFrom).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.getDataList() |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
banned (id) { |
|||
this.dataForm.id = id |
|||
this.dataForm.bannedFlag = '' |
|||
this.dialogVisible = true |
|||
}, |
|||
handleBanned () { |
|||
this.$http['post']('/partyGroup/partyusergroup/banned', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.dialogVisible = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dialogVisible = false |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.getDataList() |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}, |
|||
backToActList () { |
|||
this.$emit('refreshDataList') |
|||
this.$parent.selectComponent = 'PartyGroupList' |
|||
this.$router.push({ path: '/partygroup-partygroup' }) |
|||
}, |
|||
identityFlagFormat (row, column) { |
|||
if (row.identityFlag === '1') { |
|||
return '副群主' |
|||
} else if (row.identityFlag === '0') { |
|||
return '群主' |
|||
} else { |
|||
return '群成员' |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
'deptIdList': function (val) { |
|||
if (val.length !== 0) { |
|||
this.dataForm.gridId = val[val.length - 1] |
|||
} else { |
|||
this.dataForm.gridId = '' |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue