Browse Source

社群管理相关

feature/yujt_analysis_pc
曲树通 5 years ago
parent
commit
6d9a7a665a
  1. 154
      src/views/modules/property/group-detail.vue
  2. 37
      src/views/modules/property/group.vue

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

@ -1,5 +1,8 @@
<template>
<el-dialog :visible.sync="visible" :title="$t('look')" :close-on-click-modal="false" :close-on-press-escape="false">
<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>
@ -11,36 +14,81 @@
<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">
<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 :inline="true"
:model="dataForm"
ref="dataForm">
<el-form-item>
<el-input v-model="dataForm.nickname" placeholder="姓名" clearable></el-input>
<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-input v-model="dataForm.mobile"
placeholder="电话"
clearable></el-input>
</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="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 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-column :label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150">
<template slot-scope="scope">
<el-button v-if="(scope.row.state == 10||scope.row.state == 0)&&scope.row.lordFlag==0"
type="text"
size="small"
@click="toBecomeAdmin(scope.rowd)">指定群主</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-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>
@ -54,20 +102,40 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/group/usergroup/page',
getDataListURL: '/property/usergroup/page',
getDataListIsPage: true
},
visible: false,
dataForm: {
groupId: '',
nickname: '',
mobile: ''
state: '10'
},
responseForm: {
id: '',
groupIntroduction: '',
state: '',
processingOpinions: ''
},
stateOptions: [{
id: '0',
name: '待审核'
}, {
id: '5',
name: '审核不通过'
}, {
id: '10',
name: '审核通过'
}, {
id: '15',
name: '已退群'
}, {
id: '20',
name: '已移除'
}],
checkDto: {
id: '',
groupId: ''
}
}
},
@ -84,7 +152,7 @@ export default {
},
//
getInfo () {
this.$http.get(`/group/group/${this.dataForm.groupId}`).then(({ data: res }) => {
this.$http.get(`/property/group/${this.dataForm.groupId}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -92,7 +160,7 @@ export default {
...this.responseForm,
...res.data
}
}).catch(() => {})
}).catch(() => { })
},
// 01
formatterLoadFlag: function (row, column) {
@ -102,6 +170,46 @@ export default {
} else if (lordFlag === '1') {
return '是'
}
},
toBecomeAdmin (row) {
this.checkDto.id = row.id
this.checkDto.groupId = row.groupId
this.$http.post(`/property/group/checkGroupOwner`, this.checkDto).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data.resultCode == 1) {
this.$confirm(res.data.resultMessage, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http['post']('/property/group/toBecomeGroupOwner', 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(() => { })
} else {
this.$http['post']('/property/group/toBecomeGroupOwner', 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(() => { })
}
}
}

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

@ -106,23 +106,36 @@
<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 :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 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 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>
<el-button type="primary"
@click="confirmDisBand">确定</el-button>
</template>
</el-dialog>
</div>
@ -138,7 +151,7 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/group/group/page',
getDataListURL: '/property/group/page',
getDataListIsPage: true
},
groupDetailVisible: false,

Loading…
Cancel
Save