You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							217 lines
						
					
					
						
							6.9 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							217 lines
						
					
					
						
							6.9 KiB
						
					
					
				
								<template>
							 | 
						|
								  <el-dialog :visible.sync="visible"
							 | 
						|
								             :title="$t('look')"
							 | 
						|
								             :close-on-click-modal="false"
							 | 
						|
								             :close-on-press-escape="false">
							 | 
						|
								    <el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'">
							 | 
						|
								      <el-form-item label="群介绍:">
							 | 
						|
								        <div>{{responseForm.groupIntroduction}}</div>
							 | 
						|
								      </el-form-item>
							 | 
						|
								      <el-form-item label="状态:">
							 | 
						|
								        <div v-if="responseForm.state === 0">待审核</div>
							 | 
						|
								        <div v-if="responseForm.state === 5">审核不通过</div>
							 | 
						|
								        <div v-if="responseForm.state === 10">审核通过</div>
							 | 
						|
								        <div v-if="responseForm.state === 15">禁言</div>
							 | 
						|
								        <div v-if="responseForm.state === 20">已解散</div>
							 | 
						|
								      </el-form-item>
							 | 
						|
								      <el-form-item label="备注:"
							 | 
						|
								                    v-if="responseForm.state === 5 || responseForm.state === 20">
							 | 
						|
								        <div>{{responseForm.processingOpinions}}</div>
							 | 
						|
								      </el-form-item>
							 | 
						|
								    </el-form>
							 | 
						|
								    <el-form :inline="true"
							 | 
						|
								             :model="dataForm"
							 | 
						|
								             ref="dataForm">
							 | 
						|
								      <el-form-item>
							 | 
						|
								        <el-input v-model="dataForm.nickname"
							 | 
						|
								                  placeholder="姓名"
							 | 
						|
								                  clearable></el-input>
							 | 
						|
								      </el-form-item>
							 | 
						|
								      <el-form-item>
							 | 
						|
								        <el-input v-model="dataForm.mobile"
							 | 
						|
								                  placeholder="电话"
							 | 
						|
								                  clearable></el-input>
							 | 
						|
								      </el-form-item>
							 | 
						|
								      <el-form-item 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-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.row)">指定群主</el-button>
							 | 
						|
								        </template>
							 | 
						|
								      </el-table-column>
							 | 
						|
								    </el-table>
							 | 
						|
								    <el-pagination :current-page="page"
							 | 
						|
								                   :page-sizes="[10, 20, 50, 100]"
							 | 
						|
								                   :page-size="limit"
							 | 
						|
								                   :total="total"
							 | 
						|
								                   layout="total, sizes, prev, pager, next, jumper"
							 | 
						|
								                   @size-change="pageSizeChangeHandle"
							 | 
						|
								                   @current-change="pageCurrentChangeHandle">
							 | 
						|
								    </el-pagination>
							 | 
						|
								    <template slot="footer">
							 | 
						|
								      <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
							 | 
						|
								    </template>
							 | 
						|
								  </el-dialog>
							 | 
						|
								</template>
							 | 
						|
								
							 | 
						|
								<script>
							 | 
						|
								import mixinViewModule from '@/mixins/view-module'
							 | 
						|
								export default {
							 | 
						|
								  mixins: [mixinViewModule],
							 | 
						|
								  data () {
							 | 
						|
								    return {
							 | 
						|
								      mixinViewModuleOptions: {
							 | 
						|
								        getDataListURL: '/property/usergroup/page',
							 | 
						|
								        getDataListIsPage: true
							 | 
						|
								      },
							 | 
						|
								      visible: false,
							 | 
						|
								      dataForm: {
							 | 
						|
								        groupId: '',
							 | 
						|
								        nickname: '',
							 | 
						|
								        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: ''
							 | 
						|
								      }
							 | 
						|
								    }
							 | 
						|
								  },
							 | 
						|
								  methods: {
							 | 
						|
								    init () {
							 | 
						|
								      this.visible = true
							 | 
						|
								      this.$nextTick(() => {
							 | 
						|
								        this.$refs['dataForm'].resetFields()
							 | 
						|
								        if (this.dataForm.groupId) {
							 | 
						|
								          this.getInfo()
							 | 
						|
								          this.getDataList()
							 | 
						|
								        }
							 | 
						|
								      })
							 | 
						|
								    },
							 | 
						|
								    // 获取信息
							 | 
						|
								    getInfo () {
							 | 
						|
								      this.$http.get(`/property/group/${this.dataForm.groupId}`).then(({ data: res }) => {
							 | 
						|
								        if (res.code !== 0) {
							 | 
						|
								          return this.$message.error(res.msg)
							 | 
						|
								        }
							 | 
						|
								        this.responseForm = {
							 | 
						|
								          ...this.responseForm,
							 | 
						|
								          ...res.data
							 | 
						|
								        }
							 | 
						|
								      }).catch(() => { })
							 | 
						|
								    },
							 | 
						|
								    // 群主标识 0:否,1:是
							 | 
						|
								    formatterLoadFlag: function (row, column) {
							 | 
						|
								      let lordFlag = row.lordFlag
							 | 
						|
								      if (lordFlag === '0') {
							 | 
						|
								        return '否'
							 | 
						|
								      } else if (lordFlag === '1') {
							 | 
						|
								        return '是'
							 | 
						|
								      }
							 | 
						|
								    },
							 | 
						|
								    toBecomeAdmin (row) {
							 | 
						|
								      this.checkDto.id = row.id
							 | 
						|
								      this.checkDto.groupId = row.groupId
							 | 
						|
								      this.$http.post(`/property/usergroup/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/usergroup/toBecomeGroupOwner`, this.checkDto).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/usergroup/toBecomeGroupOwner`, this.checkDto).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(() => { })
							 | 
						|
								      this.getDataList()
							 | 
						|
								    }
							 | 
						|
								  }
							 | 
						|
								}
							 | 
						|
								</script>
							 | 
						|
								
							 |