瀏覽代碼

前后:角色管理加用户加查询

dubch 5 年之前
父節點
當前提交
549d6a7b1e

+ 5 - 0
src/dashoo.cn/backend/api/controllers/casbin/role.go

@@ -150,6 +150,7 @@ func (this *RoleController) OrgAllList() {
 // @router /getauditerbydept/:deptId [get]
 func (this *RoleController) GetAuditerByDept() {
 	Id := this.Ctx.Input.Param(":deptId")
+	username := this.GetString("userName")
 	page := this.GetPageInfoForm()
 	var users []userRole.Base_User
 	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
@@ -166,6 +167,10 @@ func (this *RoleController) GetAuditerByDept() {
 	//}
 	where += " and IsCompanyUser = 0"
 
+	if username != "" {
+		where += " and RealName like '%" + username + "%'"
+	}
+
 	total := rsvc.GetPagingEntitiesWithSortCode(page.CurrentPage, page.Size, "Id asc", &users, where)
 	//rsvc.GetEntitysByWhere(BaseUserName, where, &users)
 	var datainfo DataInfo

+ 7 - 1
src/dashoo.cn/frontend_web/src/pages/system/userrole.vue

@@ -152,6 +152,8 @@
         </el-row>
         <el-row :gutter="10">
           <span style="margin-top:10px;">
+            <el-input size="mini" style="width: 150px;" v-model="selectName" placeholder="请输入用户名"></el-input>&nbsp;
+          <el-button size="small"  @click="getauditerbydept(setroledepid)" type="primary">查 询</el-button>
         <el-button size="small" @click="adminadduser = false">取 消</el-button>
         <el-button type="primary" size="small" @click="toggleSelection()">确 定</el-button>
       </span>
@@ -174,6 +176,8 @@
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
+        <el-input size="mini" style="width: 150px;" v-model="selectName" placeholder="请输入用户名"></el-input>&nbsp;
+        <el-button size="small"  @click="getauditerbydept(setroledepid)" type="primary">查 询</el-button>
         <el-button size="small" @click="addUserShow = false">取 消</el-button>
         <el-button type="primary" size="small" @click="adduerinrole()">确 定</el-button>
       </span>
@@ -371,6 +375,7 @@
         currentPerIdForAddRoleToOps: '',
         appclient: '',
         Roleids: '',
+        selectName: ''
       }
     },
     created() {
@@ -523,7 +528,8 @@
         this.userOptions = []
         const params = {
           _currentPage: this.currentSetRolePage,
-          _size: this.setrolesize
+          _size: this.setrolesize,
+          userName: this.selectName,
         }
         this.$axios.get('role/getauditerbydept/' + deptid, {params}).then(res => {
           this.userOptions = res.data.items