Commit 1e863357 authored by chenfenglei's avatar chenfenglei

根据角色筛选帐户

parent db69b5ac
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="角色"> <el-form-item label="角色">
<el-select v-model="searchFrom.role_id" placeholder="请选择用户等级" @change="getList"> <el-select v-model="searchFrom.role_name" placeholder="请选择用户等级" @change="getList">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="超级管理员" value="超级管理员"></el-option> <el-option label="超级管理员" value="超级管理员"></el-option>
<el-option label="管理员" value="管理员"></el-option> <el-option label="管理员" value="管理员"></el-option>
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
searchFrom:{ searchFrom:{
user_name: '', user_name: '',
status: '', status: '',
role_id:"" role_name:""
}, },
dialog:{ dialog:{
dialogType:0, dialogType:0,
...@@ -277,11 +277,26 @@ ...@@ -277,11 +277,26 @@
if (this.searchFrom.status !== ''){ if (this.searchFrom.status !== ''){
json.status = this.searchFrom.status json.status = this.searchFrom.status
} }
if (this.searchFrom.role_id !== ''){ // if (this.searchFrom.role_id !== ''){
json.role_id = this.searchFrom.role_id // json.role_id = this.searchFrom.role_id
} // }
// console.log(json) //管理员筛选查看
getAdminListApi(json).then(res=>{ getAdminListApi(json).then(res=>{
if(this.searchFrom.role_name !== ''){
switch(this.searchFrom.role_name){
case '超级管理员':
res.list=res.list.filter(function(item,i){
return item.role_name == "超级管理员"
})
break;
case '管理员':
res.list=res.list.filter(function(item,i){
return item.role_name == "管理员"
})
break;
default:
break;
}
}
this.adminList = res.list; this.adminList = res.list;
this.total=Number(res.total) this.total=Number(res.total)
this.$store.commit('mainCanShow') this.$store.commit('mainCanShow')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment