Commit db28093d0496fd1ff2806b21e5f3f3cec90bc213
1 parent
4319969b35
Exists in
master
查询完成
Showing 6 changed files with 100 additions and 33 deletions
- center.manager/src/main/java/com/lyms/cm/controller/sys/SysRolesController.java
- center.manager/src/main/java/com/lyms/cm/controller/sys/SysUsersController.java
- center.manager/src/main/webapp/WEB-INF/views/role/role_edit.html
- center.manager/src/main/webapp/WEB-INF/views/role/role_list.html
- center.manager/src/main/webapp/WEB-INF/views/user/user_edit.html
- center.manager/src/main/webapp/WEB-INF/views/user/user_list.html
center.manager/src/main/java/com/lyms/cm/controller/sys/SysRolesController.java
View file @
db28093
| ... | ... | @@ -61,6 +61,18 @@ |
| 61 | 61 | Page<SysRoles> page = getPage(); |
| 62 | 62 | EntityWrapper<SysRoles> ew = new EntityWrapper<SysRoles>(); |
| 63 | 63 | ew.where("ifDel=0"); |
| 64 | + String id = getParameter("id"); | |
| 65 | + String name = getParameter("name"); | |
| 66 | + String type = getParameter("type"); | |
| 67 | + if(StrUtils.isNotEmpty(id)){ | |
| 68 | + ew.and("id like {0}", name.trim() + "%"); | |
| 69 | + } | |
| 70 | + if(StrUtils.isNotEmpty(name)){ | |
| 71 | + ew.and("name like {0}", name.trim() + "%"); | |
| 72 | + } | |
| 73 | + if(StrUtils.isNotEmpty(type)){ | |
| 74 | + ew.and("type={0}", type); | |
| 75 | + } | |
| 64 | 76 | return toGridData(sysRolesService.selectPage(page, ew)); |
| 65 | 77 | } |
| 66 | 78 |
center.manager/src/main/java/com/lyms/cm/controller/sys/SysUsersController.java
View file @
db28093
| ... | ... | @@ -92,6 +92,18 @@ |
| 92 | 92 | Page<SysUsers> page = getPage(); |
| 93 | 93 | EntityWrapper<SysUsers> ew = new EntityWrapper<SysUsers>(); |
| 94 | 94 | ew.where("ifDel=0"); |
| 95 | + String searchName = getParameter("name"); | |
| 96 | + String searchAccount = getParameter("account"); | |
| 97 | + String searchPhone = getParameter("phone"); | |
| 98 | + if(StrUtils.isNotEmpty(searchName)){ | |
| 99 | + ew.and("name like {0}", searchName.trim() + "%"); | |
| 100 | + } | |
| 101 | + if(StrUtils.isNotEmpty(searchAccount)){ | |
| 102 | + ew.and("account like {0}", searchAccount.trim() + "%"); | |
| 103 | + } | |
| 104 | + if(StrUtils.isNotEmpty(searchPhone)){ | |
| 105 | + ew.and("phone like {0}", searchPhone.trim() + "%"); | |
| 106 | + } | |
| 95 | 107 | page = userService.selectPage(page,ew); |
| 96 | 108 | return toGridData(page); |
| 97 | 109 | } |
center.manager/src/main/webapp/WEB-INF/views/role/role_edit.html
View file @
db28093
| ... | ... | @@ -120,6 +120,15 @@ |
| 120 | 120 | </div> |
| 121 | 121 | </div> |
| 122 | 122 | <div class="form-group"> |
| 123 | + <label class="col-sm-3 control-label">角色类型:</label> | |
| 124 | + <div class="col-sm-8"> | |
| 125 | + <select class="form-control m-b" name="type"> | |
| 126 | + <option value="1" #if ($role.type == 1) selected="selected" #end >用户角色</option> | |
| 127 | + <option value="0" #if ($role.type == 0) selected="selected" #end >管理员角色</option> | |
| 128 | + </select> | |
| 129 | + </div> | |
| 130 | + </div> | |
| 131 | + <div class="form-group"> | |
| 123 | 132 | <label class="col-sm-3 control-label">角色备注:</label> |
| 124 | 133 | <div class="col-sm-8"> |
| 125 | 134 | <input type="text" placeholder="角色备注" value="$!role.remarks" aria-required="true" required="true" class="form-control" minlength="2" name="remarks" id="remarks"> |
center.manager/src/main/webapp/WEB-INF/views/role/role_list.html
View file @
db28093
| ... | ... | @@ -4,16 +4,23 @@ |
| 4 | 4 | <div style="padding-top:30px;"> |
| 5 | 5 | <form role="form" class="form-inline"> |
| 6 | 6 | <div class="form-group"> |
| 7 | - <input type="text" placeholder="请输入角色名称" id="usernameSearch" class="form-control"> | |
| 7 | + <input type="text" placeholder="角色名" id="searchName" class="form-control"> | |
| 8 | 8 | </div> |
| 9 | 9 | <div class="form-group"> |
| 10 | - <input type="text" placeholder="请输入角色描述" id="idSearch" class="form-control"> | |
| 10 | + <select class="form-control m-b" name="type" id="searchType" style="margin-bottom: 0;"> | |
| 11 | + <option value="">所有</option> | |
| 12 | + <option value="1">用户角色</option> | |
| 13 | + <option value="0">管理员角色</option> | |
| 14 | + </select> | |
| 11 | 15 | </div> |
| 16 | + <div class="form-group"> | |
| 17 | + <input type="text" placeholder="角色id编号" id="searchId" class="form-control"> | |
| 18 | + </div> | |
| 12 | 19 | </form> |
| 13 | 20 | </div> |
| 14 | 21 | </div> |
| 15 | 22 | <div class="col-sm-2"> |
| 16 | - <div class="title-action"> | |
| 23 | + <div class="title-action" onclick="search();"> | |
| 17 | 24 | <a class="btn btn-primary"><i class="fa fa-search"></i> 查询</a> |
| 18 | 25 | </div> |
| 19 | 26 | </div> |
| ... | ... | @@ -35,6 +42,16 @@ |
| 35 | 42 | <script type="text/javascript"> |
| 36 | 43 | var controllerRequestMappint = "/sysRoles/"; |
| 37 | 44 | |
| 45 | +function search(){ | |
| 46 | + var queryParams = { | |
| 47 | + query:{ | |
| 48 | + name: $("#searchName").val(), | |
| 49 | + id: $("#searchId").val(), | |
| 50 | + type: $("#searchType").val() | |
| 51 | + } | |
| 52 | + } | |
| 53 | + $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 54 | +} | |
| 38 | 55 | function add() { |
| 39 | 56 | fullWindow("新增角色", APP.PATH + controllerRequestMappint + "0/toEdit"); |
| 40 | 57 | } |
| ... | ... | @@ -42,7 +59,7 @@ |
| 42 | 59 | function edit(){ |
| 43 | 60 | var id = getSingleSelectedValue("dataTable","id"); |
| 44 | 61 | if(id){ |
| 45 | - fullWindow("修改橘色", APP.PATH + controllerRequestMappint + id + "/toEdit"); | |
| 62 | + fullWindow("修改角色", APP.PATH + controllerRequestMappint + id + "/toEdit"); | |
| 46 | 63 | } |
| 47 | 64 | } |
| 48 | 65 | |
| 49 | 66 | |
| 50 | 67 | |
| 51 | 68 | |
| ... | ... | @@ -56,28 +73,32 @@ |
| 56 | 73 | field: 'check_state', |
| 57 | 74 | title: '', |
| 58 | 75 | checkbox: true |
| 59 | - },{ | |
| 60 | - field: 'id', | |
| 61 | - title: '编号' | |
| 62 | 76 | }, { |
| 63 | 77 | field: 'name', |
| 64 | 78 | title: '角色名' |
| 65 | 79 | }, { |
| 66 | 80 | field: 'type', |
| 67 | - title: '角色类型' | |
| 68 | - }, { | |
| 81 | + title: '角色类型', | |
| 82 | + formatter:function(value,row,index){ | |
| 83 | + if(value == 0){ | |
| 84 | + return '管理员' | |
| 85 | + }else{ | |
| 86 | + return '用户'; | |
| 87 | + } | |
| 88 | + } | |
| 89 | + },{ | |
| 69 | 90 | field: 'remarks', |
| 70 | 91 | title: '备注' |
| 71 | 92 | },{ |
| 72 | 93 | field: 'orgId', |
| 73 | 94 | title: '机构id' |
| 74 | 95 | },{ |
| 75 | - field: 'publishId', | |
| 76 | - title: '发布人id' | |
| 77 | - },{ | |
| 78 | 96 | field: 'enable', |
| 79 | 97 | title: '启/停用', |
| 80 | 98 | formatter:enableFormatter |
| 99 | + },{ | |
| 100 | + field: 'id', | |
| 101 | + title: '编号' | |
| 81 | 102 | }]; |
| 82 | 103 | </script> |
| 83 | 104 | #end |
center.manager/src/main/webapp/WEB-INF/views/user/user_edit.html
View file @
db28093
| ... | ... | @@ -116,7 +116,7 @@ |
| 116 | 116 | <div class="col-sm-8"> |
| 117 | 117 | <input type="text" placeholder="登录账号" value="$!user.account" aria-required="true" required="true" class="form-control" minlength="2" name="account" id="account"> |
| 118 | 118 | </div> |
| 119 | - </div> | |
| 119 | + </div> | |
| 120 | 120 | <div class="form-group"> |
| 121 | 121 | <label class="col-sm-3 control-label">用户姓名:</label> |
| 122 | 122 | <div class="col-sm-8"> |
| 123 | 123 | |
| ... | ... | @@ -126,13 +126,13 @@ |
| 126 | 126 | <div class="form-group"> |
| 127 | 127 | <label class="col-sm-3 control-label">密码:</label> |
| 128 | 128 | <div class="col-sm-8"> |
| 129 | - <input type="text" placeholder="登录密码" value="" #if("$!user.id" == "") aria-required="true" required="true" minlength="2" #end class="form-control" name="pwd" id="pwd"> | |
| 129 | + <input type="password" placeholder="登录密码" value="" #if("$!user.id" == "") aria-required="true" required="true" minlength="2" #end class="form-control" name="pwd" id="pwd"> | |
| 130 | 130 | </div> |
| 131 | 131 | </div> |
| 132 | 132 | <div class="form-group"> |
| 133 | 133 | <label class="col-sm-3 control-label">手机号:</label> |
| 134 | 134 | <div class="col-sm-8"> |
| 135 | - <input type="text" placeholder="手机号" value="$!user.phone" aria-required="true" required="true" class="form-control" minlength="2" name="phone" id="phone"> | |
| 135 | + <input type="text" placeholder="手机号" value="$!user.phone" aria-required="true" required="true" class="form-control" minlength="11" maxlength="11" name="phone" id="phone"> | |
| 136 | 136 | </div> |
| 137 | 137 | </div> |
| 138 | 138 | <div class="form-group"> |
center.manager/src/main/webapp/WEB-INF/views/user/user_list.html
View file @
db28093
| ... | ... | @@ -3,17 +3,20 @@ |
| 3 | 3 | <div class="col-sm-10"> |
| 4 | 4 | <div style="padding-top:30px;"> |
| 5 | 5 | <form role="form" class="form-inline"> |
| 6 | + <div class="form-group"> | |
| 7 | + <input type="text" placeholder="登录账号" id="searchAccount" class="form-control"> | |
| 8 | + </div> | |
| 6 | 9 | <div class="form-group"> |
| 7 | - <input type="text" placeholder="请输入用户名" id="usernameSearch" class="form-control"> | |
| 10 | + <input type="text" placeholder="用户姓名" id="searchName" class="form-control"> | |
| 8 | 11 | </div> |
| 9 | 12 | <div class="form-group"> |
| 10 | - <input type="text" placeholder="请输入ID" id="idSearch" class="form-control"> | |
| 13 | + <input type="text" placeholder="手机号" id="searchPhone" class="form-control"> | |
| 11 | 14 | </div> |
| 12 | 15 | </form> |
| 13 | 16 | </div> |
| 14 | 17 | </div> |
| 15 | 18 | <div class="col-sm-2"> |
| 16 | - <div class="title-action"> | |
| 19 | + <div class="title-action" onclick="search();"> | |
| 17 | 20 | <a class="btn btn-primary"><i class="fa fa-search"></i> 查询</a> |
| 18 | 21 | </div> |
| 19 | 22 | </div> |
| ... | ... | @@ -34,6 +37,16 @@ |
| 34 | 37 | #override("js") |
| 35 | 38 | <script type="text/javascript"> |
| 36 | 39 | var controllerRequestMappint = "/sysUsers/"; |
| 40 | +function search(){ | |
| 41 | + var queryParams = { | |
| 42 | + query:{ | |
| 43 | + name: $("#searchName").val(), | |
| 44 | + account: $("#searchAccount").val(), | |
| 45 | + phone: $("#searchPhone").val() | |
| 46 | + } | |
| 47 | + } | |
| 48 | + $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 49 | +} | |
| 37 | 50 | |
| 38 | 51 | function add() { |
| 39 | 52 | fullWindow("新增用户", APP.PATH + controllerRequestMappint + "0/toEdit"); |
| 40 | 53 | |
| 41 | 54 | |
| ... | ... | @@ -57,25 +70,12 @@ |
| 57 | 70 | title: '', |
| 58 | 71 | checkbox: true |
| 59 | 72 | },{ |
| 60 | - field: 'id', | |
| 61 | - title: '编号' | |
| 73 | + field: 'name', | |
| 74 | + title: '姓名' | |
| 62 | 75 | },{ |
| 63 | - field: 'type', | |
| 64 | - title: '类型', | |
| 65 | - formatter:function(value,row,index){ | |
| 66 | - if(value == 0){ | |
| 67 | - return '管理员' | |
| 68 | - }else{ | |
| 69 | - return '用户'; | |
| 70 | - } | |
| 71 | - } | |
| 72 | - }, { | |
| 73 | 76 | field: 'account', |
| 74 | 77 | title: '帐号' |
| 75 | 78 | },{ |
| 76 | - field: 'name', | |
| 77 | - title: '姓名' | |
| 78 | - },{ | |
| 79 | 79 | field: 'orgId', |
| 80 | 80 | title: '机构' |
| 81 | 81 | },{ |
| 82 | 82 | |
| ... | ... | @@ -85,9 +85,22 @@ |
| 85 | 85 | field: 'phone', |
| 86 | 86 | title: '手机号' |
| 87 | 87 | },{ |
| 88 | + field: 'type', | |
| 89 | + title: '类型', | |
| 90 | + formatter:function(value,row,index){ | |
| 91 | + if(value == 0){ | |
| 92 | + return '管理员' | |
| 93 | + }else{ | |
| 94 | + return '用户'; | |
| 95 | + } | |
| 96 | + } | |
| 97 | + },{ | |
| 88 | 98 | field: 'enable', |
| 89 | 99 | title: '启/停用', |
| 90 | 100 | formatter:enableFormatter |
| 101 | + },{ | |
| 102 | + field: 'id', | |
| 103 | + title: '编号' | |
| 91 | 104 | }]; |
| 92 | 105 | </script> |
| 93 | 106 | #end |