From 933c2ef860fe3c6aafa4ebe025f3681afdeda31e Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Mon, 19 Dec 2022 17:11:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF&=E6=8C=87=E4=BB=A4=E5=88=97=E8=A1=A8-?= =?UTF-8?q?=E6=9C=AA=E6=98=BE=E7=A4=BA=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020979 --user=张大海 【UI测试】场景&指令列表-未显示运行环境字段 https://www.tapd.cn/55049933/s/1317055 --- .../sdk-parent/frontend/src/utils/default-table-header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/sdk-parent/frontend/src/utils/default-table-header.js b/framework/sdk-parent/frontend/src/utils/default-table-header.js index 0fb2e21883..13243a637a 100644 --- a/framework/sdk-parent/frontend/src/utils/default-table-header.js +++ b/framework/sdk-parent/frontend/src/utils/default-table-header.js @@ -90,7 +90,7 @@ export let CUSTOM_TABLE_HEADER = { // {id: 'versionId', key: 'f', label: 'project.version.name', xpack: true}, {id: 'creatorName', key: 'd', label: 'api_test.automation.creator'}, {id: 'principalName', key: '6', label: 'api_test.definition.api_principal'}, - // {id: 'environmentMap', key: 'e', label: 'commons.environment'}, + {id: 'environmentMap', key: 'e', label: 'commons.environment'}, {id: 'updateTime', key: '7', label: 'api_test.definition.api_last_time'}, {id: 'stepTotal', key: '8', label: 'api_test.automation.step'}, {id: 'lastResult', key: 'a', label: 'api_test.automation.last_result'}, @@ -104,6 +104,7 @@ export let CUSTOM_TABLE_HEADER = { {id: 'tags', key: '5', label: 'commons.tag'}, {id: 'creatorName', key: 'd', label: 'api_test.automation.creator'}, {id: 'principalName', key: '6', label: 'api_test.definition.api_principal'}, + {id: 'environmentMap', key: '8', label: 'commons.environment'}, {id: 'updateTime', key: '7', label: 'api_test.definition.api_last_time'}, {id: 'lastResult', key: 'a', label: 'ui.debug_result_label'}, {id: 'createTime', key: 'c', label: 'commons.create_time'}, From 0f773dd7a66f37c4eafa49ad900fc520b98bfc0b Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 19 Dec 2022 17:08:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=A2=9E=E5=8A=A0mock=E6=9C=9F=E6=9C=9B?= =?UTF-8?q?=E6=97=B6=E5=88=97=E8=A1=A8=E4=B8=8D=E5=88=B7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020971 --user=宋天阳 【接口测试】mock期望添加后,需要刷新才能看到 https://www.tapd.cn/55049933/s/1316934 --- .../io/metersphere/service/MockConfigService.java | 3 ++- .../definition/components/mock/MockEditDrawer.vue | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java b/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java index da855718b9..0a3c0aafed 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java @@ -137,7 +137,8 @@ public class MockConfigService { } if (request.getApiId() != null) { criteria.andApiIdEqualTo(request.getApiId()); - } else { + } else if (StringUtils.isEmpty(request.getId())) { + //todo 刚子有时间把这里优化下: 如果不满足什么条件需要直接返回的话,增加一个check,提前返回。 尽可能不要在逻辑中途返回。会很难维护。 return new MockConfigResponse(null, new ArrayList<>()); } if (request.getProjectId() != null) { diff --git a/api-test/frontend/src/business/definition/components/mock/MockEditDrawer.vue b/api-test/frontend/src/business/definition/components/mock/MockEditDrawer.vue index 41004a94c7..6706ba9137 100644 --- a/api-test/frontend/src/business/definition/components/mock/MockEditDrawer.vue +++ b/api-test/frontend/src/business/definition/components/mock/MockEditDrawer.vue @@ -254,9 +254,8 @@ export default { if (this.isTcp && this.$refs.tcpParam) { this.$refs.tcpParam.saveData(); } - let mockConfigId = this.mockConfigId; - this.mockExpectConfig.mockConfigId = mockConfigId; - let formCheckResult = this.checkMockExpectForm('mockExpectForm', true); + this.mockExpectConfig.mockConfigId = this.mockConfigId; + this.checkMockExpectForm('mockExpectForm', true); }, cleanMockExpectConfig() { this.showHeadTable = false; @@ -290,7 +289,6 @@ export default { updateMockExpectConfig(param, null, bodyFiles).then((response) => { let returnData = response.data; this.mockExpectConfig.id = returnData.id; - this.$emit('refreshMockInfo', param.mockConfigId); if (clearForm) { this.cleanMockExpectConfig(); } @@ -298,7 +296,11 @@ export default { type: 'success', message: this.$t('commons.save_success'), }); - this.close(); + + this.$nextTick(() => { + this.$emit('refreshMockInfo', param.mockConfigId); + this.close(); + }); }); }, getBodyUploadFiles(data) {