From 6f8e4ef7bda12010a556ee5ba0bcb7ebdc0481c5 Mon Sep 17 00:00:00 2001 From: metersphere-bot <78466014+metersphere-bot@users.noreply.github.com> Date: Thu, 3 Mar 2022 15:34:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E6=90=9C=E7=B4=A2=E5=88=9B=E5=BB=BA=E4=BA=BA=E6=97=A0?= =?UTF-8?q?=E6=95=88=E7=9A=84=E7=BC=BA=E9=99=B7=20(#11139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010788 --user=王孝刚 [接口测试] github#11114接口定义高级搜索创建人查询无效 https://www.tapd.cn/55049933/s/1112995 Co-authored-by: wxg0103 <727495428@qq.com> --- .../mapper/ext/ExtApiDefinitionMapper.xml | 2 +- .../environment/EnvironmentHttpConfig.vue | 2 +- .../components/search/search-components.js | 30 ++++++++++++++++++- frontend/src/i18n/zh-CN.js | 2 +- frontend/src/i18n/zh-TW.js | 2 +- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 6c56d42133..0e10d8c4b4 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -162,7 +162,7 @@ - and api_definition.create_user + and api_definition.user_id diff --git a/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue b/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue index cedb1e9576..39cd1af63e 100644 --- a/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue +++ b/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue @@ -288,7 +288,7 @@ export default { } this.httpConfig.conditions[index].details = [this.pathDetails]; } else { - if (this.condition.details.length === 0) { + if (this.condition.type === "MODULE" && this.condition.details.length === 0) { this.$warning(this.$t('api_test.environment.module_warning')); return; } diff --git a/frontend/src/business/components/common/components/search/search-components.js b/frontend/src/business/components/common/components/search/search-components.js index 99ebf0d019..e1a98fa267 100644 --- a/frontend/src/business/components/common/components/search/search-components.js +++ b/frontend/src/business/components/common/components/search/search-components.js @@ -415,6 +415,34 @@ export const PRINCIPAL = { } }; +export const PRINCIPALAPI = { + key: "creator", + name: 'MsTableSearchSelect', + label: 'api_test.definition.request.responsible', + operator: { + options: [OPERATORS.IN, OPERATORS.NOT_IN, OPERATORS.CURRENT_USER], + change: function (component, value) { // 运算符change事件 + if (value === OPERATORS.CURRENT_USER.value) { + component.value = value; + } + } + }, + options: { // 异步获取候选项 + url: "/user/list", + labelKey: "name", + valueKey: "id", + showLabel: option => { + return option.label + "(" + option.value + ")"; + } + }, + props: { + multiple: true + }, + isShow: operator => { + return operator !== OPERATORS.CURRENT_USER.value; + } +}; + export const STAGE = { key: "stage", name: 'MsTableSearchSelect', @@ -512,7 +540,7 @@ export const TEST_CASE_CONFIGS = [NAME, API_TAGS, MODULE, PRIORITY, CREATE_TIME, export const TEST_PLAN_CONFIGS = [NAME, UPDATE_TIME, CREATE_TIME, PRINCIPAL, TEST_PLAN_STATUS, STAGE]; -export const API_DEFINITION_CONFIGS = [NAME, API_METHOD, API_PATH, API_STATUS, API_TAGS, UPDATE_TIME, CREATE_TIME, CREATOR,ISREFERENCE]; +export const API_DEFINITION_CONFIGS = [NAME, API_METHOD, API_PATH, API_STATUS, API_TAGS, UPDATE_TIME, CREATE_TIME, PRINCIPALAPI, ISREFERENCE]; export const API_CASE_CONFIGS = [NAME, API_CASE_PRIORITY, API_TAGS, API_CASE_RESULT, UPDATE_TIME, CREATE_TIME, CREATOR,ISREFERENCE]; diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 316c4d0c25..0e7e5be783 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1181,7 +1181,7 @@ export default { api_path: "路径", api_definition_path: "API路径", api_case_path: "用例路径", - api_principal: "负责人", + api_principal: "责任人", api_last_time: "最后更新时间", api_case_number: "用例数", api_case_status: "用例状态", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 3c8b5901d4..50c5df50f9 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1181,7 +1181,7 @@ export default { api_path: "路徑", api_definition_path: "API路徑", api_case_path: "用例路徑", - api_principal: "負責人", + api_principal: "責任人", api_last_time: "最後更新時間", api_case_number: "用例數", api_case_status: "用例狀態",