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(); } - } + }, };