From 42b4dfac7fa8f3847562e27e124fd673a68f98cc Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 5 Mar 2020 13:26:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=8B=E7=94=A8=E6=88=B7=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtUserMapper.java | 11 ++++++ .../base/mapper/ext/ExtUserMapper.xml | 36 +++++++++++++++++++ .../controller/UserController.java | 5 +-- .../controller/request/UserRequest.java | 32 +++++++++++++++++ .../io/metersphere/service/UserService.java | 9 ++++- .../components/settings/system/User.vue | 12 +++++-- 6 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml create mode 100644 backend/src/main/java/io/metersphere/controller/request/UserRequest.java diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java new file mode 100644 index 0000000000..7820c7475d --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java @@ -0,0 +1,11 @@ +package io.metersphere.base.mapper.ext; + +import io.metersphere.base.domain.User; +import io.metersphere.controller.request.UserRequest; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +public interface ExtUserMapper { + + List getUserList(@Param("userRequest") UserRequest request); +} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml new file mode 100644 index 0000000000..eb7fa6fd55 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index 8d1708ecb4..6c7df388c1 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -7,6 +7,7 @@ import io.metersphere.base.domain.User; import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; +import io.metersphere.controller.request.UserRequest; import io.metersphere.controller.request.member.AddMemberRequest; import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; @@ -44,9 +45,9 @@ public class UserController { @PostMapping("/list/{goPage}/{pageSize}") @RequiresRoles(RoleConstants.ADMIN) - public Pager> getUserList(@PathVariable int goPage, @PathVariable int pageSize) { + public Pager> getUserList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody UserRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); - return PageUtils.setPageInfo(page, userService.getUserList()); + return PageUtils.setPageInfo(page, userService.getUserListWithRequest(request)); } @GetMapping("/delete/{userId}") diff --git a/backend/src/main/java/io/metersphere/controller/request/UserRequest.java b/backend/src/main/java/io/metersphere/controller/request/UserRequest.java new file mode 100644 index 0000000000..73dab356a3 --- /dev/null +++ b/backend/src/main/java/io/metersphere/controller/request/UserRequest.java @@ -0,0 +1,32 @@ +package io.metersphere.controller.request; + +public class UserRequest { + + private String id; + private String name; + private String email; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 67eb018ce5..687b10cb81 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -2,9 +2,11 @@ package io.metersphere.service; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.*; +import io.metersphere.base.mapper.ext.ExtUserMapper; import io.metersphere.base.mapper.ext.ExtUserRoleMapper; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.CodingUtil; +import io.metersphere.controller.request.UserRequest; import io.metersphere.controller.request.member.AddMemberRequest; import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; @@ -13,7 +15,6 @@ import io.metersphere.dto.OrganizationMemberDTO; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.dto.UserRoleHelpDTO; -import io.metersphere.i18n.Translator; import io.metersphere.user.SessionUser; import io.metersphere.user.SessionUtils; import org.apache.commons.lang3.StringUtils; @@ -42,6 +43,8 @@ public class UserService { private OrganizationMapper organizationMapper; @Resource private WorkspaceMapper workspaceMapper; + @Resource + private ExtUserMapper extUserMapper; public UserDTO insert(User user) { checkUserParam(user); @@ -112,6 +115,10 @@ public class UserService { return userMapper.selectByExample(null); } + public List getUserListWithRequest(UserRequest request) { + return extUserMapper.getUserList(request); + } + public void deleteUser(String userId) { userMapper.deleteByPrimaryKey(userId); } diff --git a/frontend/src/performance/components/settings/system/User.vue b/frontend/src/performance/components/settings/system/User.vue index d5dbefb41d..a49bf2d4de 100644 --- a/frontend/src/performance/components/settings/system/User.vue +++ b/frontend/src/performance/components/settings/system/User.vue @@ -8,7 +8,9 @@ - + @@ -226,8 +228,14 @@ } }) }, + search() { + this.initTableData(); + }, initTableData() { - this.result = this.$post(this.buildPagePath(this.queryPath),{},response => { + let param = { + name: this.condition + }; + this.result = this.$post(this.buildPagePath(this.queryPath),param,response => { let data = response.data; this.total = data.itemCount; this.tableData = data.listObject; From 70ccc8f0b4c13bcc2cd59f73a8eb554640e41b61 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 5 Mar 2020 13:53:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=92=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B9=E7=9B=AE=E6=97=B6=E5=8E=BB=E6=8E=89=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/i18n/zh-CN.js | 2 +- .../components/project/MsProject.vue | 35 ++++++++----------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 8f9438d68c..55d164f5ed 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -61,7 +61,7 @@ export default { 'search_by_name': '根据名称搜索', 'input_name': '请输入项目名称', 'owning_workspace': '所属工作空间', - 'please_choose_workspace': '选择工作空间', + 'please_choose_workspace': '请选择工作空间', }, member: { 'create': '添加成员', diff --git a/frontend/src/performance/components/project/MsProject.vue b/frontend/src/performance/components/project/MsProject.vue index a8995bc0f5..7a74ab6e09 100644 --- a/frontend/src/performance/components/project/MsProject.vue +++ b/frontend/src/performance/components/project/MsProject.vue @@ -53,16 +53,6 @@ - - - - - -