From 33a17a3c4e54ece47fdfa7169f922af4613d1378 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 14 Dec 2022 23:05:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=80=9A=E7=94=A8=E5=8A=9F=E8=83=BD):?= =?UTF-8?q?=20=E7=89=88=E6=9C=AC=E7=BD=AE=E6=96=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020864 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020864 --bug=1020866 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020866 --bug=1020869 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020869 --- .../mapper/ext/ExtApiDefinitionMapper.xml | 1 + .../components/version/MxVersionHistory.vue | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index c4d75a6b1b..a1efe88119 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -290,6 +290,7 @@ api_definition.status, api_definition.user_id, api_definition.create_time, api_definition.update_time, api_definition.delete_user_id, api_definition.create_user,api_definition.delete_time, api_definition.remark, api_definition.version_id, + api_definition.latest, project_version.name as version_name, api_definition.ref_id, user.name as user_name from api_definition left join user on api_definition.user_id = user.id diff --git a/framework/sdk-parent/frontend/src/components/version/MxVersionHistory.vue b/framework/sdk-parent/frontend/src/components/version/MxVersionHistory.vue index 7f48a71ce1..51c98e772b 100644 --- a/framework/sdk-parent/frontend/src/components/version/MxVersionHistory.vue +++ b/framework/sdk-parent/frontend/src/components/version/MxVersionHistory.vue @@ -12,6 +12,9 @@ {{ scope.row.name }} + + {{ $t('api_test.api_import.latest_version') }}  +
- + {{ $t('project.version.set_new') }} 
@@ -66,8 +69,6 @@
... - -
@@ -109,7 +110,7 @@ export default { hasLatest: { type: Boolean, default: false - }, + } }, data() { return { @@ -118,6 +119,7 @@ export default { versionOptions: [], userData: {}, currentVersion: {}, + dataLatestId: '' }; }, methods: { @@ -176,6 +178,10 @@ export default { this.loading = false; return; } + let latestData = versionData.filter((v) => v.latest === true); + if (latestData) { + this.dataLatestId = latestData[0].versionId; + } this.versionOptions.forEach(version => { let vs = versionData.filter(v => v.versionId === version.id); version.isCheckout = vs.length > 0; // 已存在可以切换,不存在则创建 @@ -210,7 +216,7 @@ export default { testUsers() { this.updateUserDataByExternal(); } - } + }, };