From 053a1229e0287153a422d2cc9352c28280dce27d Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 20 Jun 2022 15:34:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E6=8A=A5=E5=91=8A):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=80=89=E6=8B=A9=E7=94=A8=E6=88=B7=E7=BB=84=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=87=BA=E4=BA=86=E6=89=80=E6=9C=89=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=94=A8=E6=88=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014134 --user=宋天阳 【项目报告】在创建项目报告时,收件人选择“项目管理员”角色时,人员为非指定项目的管理员也包含进来了。 https://www.tapd.cn/55049933/s/1186568 --- .../base/mapper/ext/ExtUserGroupMapper.java | 10 ++-- .../base/mapper/ext/ExtUserGroupMapper.xml | 58 ++++++++++++------- .../io/metersphere/dto/UserGroupInfoDTO.java | 1 + .../api/automation/scenario/MsInputTag.vue | 57 +++++++++--------- frontend/src/i18n/en-US.js | 4 +- frontend/src/i18n/zh-CN.js | 2 + frontend/src/i18n/zh-TW.js | 24 ++++---- 7 files changed, 92 insertions(+), 64 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.java index 657837b63c..7f62a9c7fe 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.java @@ -13,7 +13,7 @@ import java.util.List; public interface ExtUserGroupMapper { - List getUserGroup(@Param("userId") String userId , @Param("projectId") String projectId); + List getUserGroup(@Param("userId") String userId, @Param("projectId") String projectId); List getWorkspaceMemberGroups(@Param("workspaceId") String workspaceId, @Param("userId") String userId); @@ -21,15 +21,15 @@ public interface ExtUserGroupMapper { List getProjectMemberList(@Param("request") QueryMemberRequest request); - List getProjectMemberGroups(@Param("projectId") String projectId,@Param("userId") String userId); + List getProjectMemberGroups(@Param("projectId") String projectId, @Param("userId") String userId); List getRelatedSource(@Param("userId") String userId); - List getGroupUser(@Param("request")EditGroupRequest request); + List getGroupUser(@Param("request") EditGroupRequest request); int checkSourceRole(@Param("sourceId") String sourceId, @Param("userId") String userId, @Param("groupId") String groupId); - List getUserGroupInfo(); + List getUserGroupInfoByProjectId(String projectId); - List getProjectMemberOption(@Param("projectId") String projectId); + List getProjectMemberOption(@Param("projectId") String projectId); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.xml index eb46f40e4a..efc069abda 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserGroupMapper.xml @@ -17,7 +17,8 @@ from workspace w join user_group ur on w.id = ur.source_id join `group` r on r.id = ur.group_id - where w.id = #{workspaceId} and ur.user_id = #{userId} + where w.id = #{workspaceId} + and ur.user_id = #{userId} - + select distinct user.id AS userId, + user.name AS userName, + user.email AS userEmail, + ug.source_id AS sourceId, + g.`name` AS groupName, + g.id AS groupId + from user + INNER JOIN user_group ug on user.id = ug.user_id + INNER JOIN `group` g ON ug.group_id = g.id + WHERE g.type = 'PROJECT' + AND ug.source_id = #{0} + order by g.create_time ASC; diff --git a/backend/src/main/java/io/metersphere/dto/UserGroupInfoDTO.java b/backend/src/main/java/io/metersphere/dto/UserGroupInfoDTO.java index 9f9e7d82a4..979548c093 100644 --- a/backend/src/main/java/io/metersphere/dto/UserGroupInfoDTO.java +++ b/backend/src/main/java/io/metersphere/dto/UserGroupInfoDTO.java @@ -11,4 +11,5 @@ public class UserGroupInfoDTO { private String userEmail; private String groupId; private String groupName; + private String sourceId; } diff --git a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue index 6e2aae55ae..578bf60179 100644 --- a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue +++ b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue @@ -1,30 +1,30 @@ @@ -71,10 +71,10 @@ export default { this.currentScenario[this.prop] = this.innerTags; }, 'currentScenario.tags'() { - if(this.prop==='tags'){ - if(!this.currentScenario[this.prop]||this.currentScenario[this.prop]===''||this.currentScenario[this.prop].length===0){ - if(this.innerTags.length!==0){ - this.innerTags=[]; + if (this.prop === 'tags') { + if (!this.currentScenario[this.prop] || this.currentScenario[this.prop] === '' || this.currentScenario[this.prop].length === 0) { + if (this.innerTags.length !== 0) { + this.innerTags = []; } } } @@ -88,6 +88,7 @@ export default { } }, addNew(e) { + this.$emit("onblur"); if (e && (!this.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) { return } @@ -125,8 +126,12 @@ export default { return false }, remove(index) { - this.innerTags.splice(index, 1) - this.tagChange() + this.innerTags.splice(index, 1); + this.tagChange(); + this.$nextTick(() => { + //删除tag元素操作是在输入框中去掉元素,也应当触发onblur操作 + this.$emit("onblur"); + }); }, removeLastTag() { if (this.newTag) { diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index bd2a6d376a..7d2c140191 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -2797,6 +2797,8 @@ export default { mail_subject: "Subject ", mail_addressee: "To ", mail_duplicate: "Cc ", + enter_mail_addressee: "Enter to add email", + enter_mail_duplicate: "Enter to add email", }, notice: { operation: { @@ -3189,7 +3191,7 @@ export default { error_report_library: { name: "Error report", assertion: "Error code assertion", - tips:"Tips: Use error report in \"Project Settings - Project environment-Assertions\"", + tips: "Tips: Use error report in \"Project Settings - Project environment-Assertions\"", use_error_report: "Use error code", use_desc: "In case of conflict between error code and error assertions, it is treated as error code", conflict_with_success: "If request has error report and success assertion:", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index b43ef468f6..e50a5f93cb 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -2806,6 +2806,8 @@ export default { mail_subject: "邮件主题", mail_addressee: "收件人", mail_duplicate: "抄送人", + enter_mail_addressee: "输入回车添加邮箱", + enter_mail_duplicate: "输入回车添加邮箱", }, notice: { operation: { diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 2aa288be7c..c40cac4caf 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1,7 +1,7 @@ export default { commons: { project_permission: '請先添加該項目權限', - no_permission:'暫無權限', + no_permission: '暫無權限', failure_continues: "失敗繼續", full_screen_editing: "全屏編輯", trash: "回收站", @@ -51,7 +51,7 @@ export default { project: '項目', about_us: '關於', current_project: '當前項目', - not_exist:"不存在", + not_exist: "不存在", name: '名稱', description: '描述', annotation: '註釋', @@ -252,8 +252,8 @@ export default { cancel_follow_success: "取消關註成功", type: "類型", type_of_integer: "請輸入整數類型", - type_of_num:"請輸入數字類型", - validity_period:'有效期', + type_of_num: "請輸入數字類型", + validity_period: '有效期', please_select_a_deadline: "請選擇截止時間", relationship: { name: '依賴關系', @@ -1193,14 +1193,14 @@ export default { rule: { input_code: "請輸入 HTTP Code" }, - range_type:{ + range_type: { value_eq: "值-等於[value=]", value_not_eq: "值-不等於[value!=]", - value_contain:"值-包含[include=]", + value_contain: "值-包含[include=]", length_eq: "長度-等于[length=]", length_not_eq: "長度-不等於[length!=]", - length_large_than:"長度-大於[length>]", - length_shot_than:"長度-小於[length<]", + length_large_than: "長度-大於[length>]", + length_shot_than: "長度-小於[length<]", regular_match: "正則匹配", } }, @@ -2800,6 +2800,8 @@ export default { mail_subject: "郵件主題", mail_addressee: "收件人", mail_duplicate: "抄送人", + enter_mail_addressee: "輸入回車添加郵箱", + enter_mail_duplicate: "輸入回車添加郵箱", }, notice: { operation: { @@ -3170,8 +3172,8 @@ export default { delete: "刪除", read: "查看腳本", }, - personal_information:{ - name:'設置', + personal_information: { + name: '設置', personal_setting: '個人設置', api_keys: 'API Keys', edit_password: "修改密碼", @@ -3193,7 +3195,7 @@ export default { error_report_library: { name: "誤報庫", assertion: "誤報斷言", - tips:"注:在\"項目設置-設置環境-全局斷言\"中啟用誤報將進行以下規則匹配", + tips: "注:在\"項目設置-設置環境-全局斷言\"中啟用誤報將進行以下規則匹配", use_error_report: "啟用誤報", use_desc: "失敗斷言與誤報規則衝突時統一處理為誤報", conflict_with_success: "請求同時包含誤報和成功斷言,請求結果處理為:",