Browse Source

群成员管理

master
wanggongfeng 6 years ago
parent
commit
63d09a9782
  1. 2
      src/views/modules/master/masteruserrelation-add-or-update.vue
  2. 16
      src/views/modules/master/masteruserrelation-add.vue
  3. 72
      src/views/modules/master/masteruserrelation.vue

2
src/views/modules/master/masteruserrelation-add-or-update.vue

@ -2,7 +2,7 @@
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false" customClass="customWidth">
<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="nickname">
<el-input v-model="dataForm.nickname" placeholder="群内昵称" style="width:90%"></el-input>
<el-input v-model="dataForm.nickname" placeholder="群内昵称" style="width:90%" maxlength="60"></el-input>
</el-form-item>
<el-form-item label="用户头像" prop="userAvatar">
<el-input v-model="dataForm.userAvatar" placeholder="" disabled style="width:90%"></el-input>

16
src/views/modules/master/masteruserrelation-add.vue

@ -30,7 +30,8 @@
<el-form-item label="群内昵称:" prop="nickName">
<el-input v-model="item.nickName"
type="text"
style="width: 30rem;">
style="width: 30rem;"
maxlength="60">
</el-input>&emsp;
<el-button @click="deleteUserMethod(index)">{{"删除"}}</el-button>&emsp;&emsp;
</el-form-item>
@ -74,7 +75,10 @@ export default {
{ required: this.dataCheckAble, message: this.$t('validate.required'), trigger: 'blur' }
],
realName: [
{ required: this.dataCheckAble, message: this.$t('validate.required'), trigger: 'blur' }
{ required: false, message: this.$t('validate.required'), trigger: 'blur' }
],
deptName: [
{ required: false, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
@ -101,11 +105,15 @@ export default {
},
//
deleteUserMethod (index) {
//
this.dataCheckAble = false
if (this.formData.length === 1) {
this.formData = [{ deptName: '', username: '', nickName: '' }]
return false
} else {
this.formData.splice(index, 1)
}
this.formData.splice(index, 1)
//
this.dataCheckAble = true
},
// dialog
connectResponse (connectResponse) {

72
src/views/modules/master/masteruserrelation.vue

@ -61,8 +61,8 @@
<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="170">
<template slot-scope="scope">
<el-button v-if="scope.row.manageFlag == '1'" type="text" size="small" @click="updateManageFlagHandle(scope.row.id,'解除管理员')">解除管理员</el-button>
<el-button v-if="scope.row.manageFlag == '0'" type="text" size="small" @click="updateManageFlagHandle(scope.row.id,'设置管理员')">设置管理员</el-button>
<el-button v-if="scope.row.manageFlag == '1'" type="text" size="small" @click="cancelManageFlagHandle(scope.row.id)">解除管理员</el-button>
<el-button v-if="scope.row.manageFlag == '0'" type="text" size="small" @click="setManageFlagHandle(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>
@ -79,6 +79,26 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog
title="确认要设置管理员身份吗?"
:visible.sync="setManagerDialog"
width="30%">
<span>将该成员设置为管理员身份管理员可以将通知和话题置顶关闭等权限</span>
<span slot="footer" class="dialog-footer">
<el-button @click="setManagerDialog = false"> </el-button>
<el-button type="primary" @click="updateManageFlagHandle" :disabled="disAbled"> </el-button>
</span>
</el-dialog>
<el-dialog
title="确认要解除管理员身份吗?"
:visible.sync="cancelManagerDialog"
width="30%">
<span>将该成员的管理权限解除解除后无法管理不能置顶关闭等权限</span>
<span slot="footer" class="dialog-footer">
<el-button @click="cancelManagerDialog = false"> </el-button>
<el-button type="primary" @click="updateManageFlagHandle" :disabled="disAbled"> </el-button>
</span>
</el-dialog>
</div>
</el-card>
</template>
@ -114,7 +134,11 @@ export default {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
}
},
updateManageFlagId: '',
disAbled: false,
setManagerDialog: false,
cancelManagerDialog: false
}
},
components: {
@ -135,25 +159,31 @@ export default {
return '管理员'
}
},
updateManageFlagHandle (id, promptInfo) {
this.$confirm(this.$t('prompt.info', { 'handle': promptInfo }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.get(`/cloudAnalysis/masteruserrelation/updateManageFlag/` + id).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
setManageFlagHandle (id) {
this.setManagerDialog = true
this.updateManageFlagId = id
},
cancelManageFlagHandle (id) {
this.cancelManagerDialog = true
this.updateManageFlagId = id
},
updateManageFlagHandle () {
this.disAbled = true
this.$http.get(`/cloudAnalysis/masteruserrelation/updateManageFlag/${this.updateManageFlagId}`).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.setManagerDialog = false
this.cancelManagerDialog = false
this.disAbled = false
this.getDataList()
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => { })
})
}).catch(() => { })
}
}

Loading…
Cancel
Save