From 6db623ca7cbd1afca9d695f5bc0a6aacb7d8c0c1 Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Thu, 11 Apr 2024 17:38:53 +0800 Subject: [PATCH] =?UTF-8?q?style(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86=E5=8F=98=E6=9B=B4=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1036363 --user=宋天阳 https://www.tapd.cn/55049933/s/1494814 --- .../bug/service/BugHistoryService.java | 6 +++++- .../system/dto/OperationHistoryDTO.java | 2 ++ .../mapper/BaseOperationHistoryMapper.java | 2 ++ .../mapper/BaseOperationHistoryMapper.xml | 7 +++++++ .../components/bugHistoryTab.vue | 2 ++ .../components/templateManagement.vue | 20 +++++++++++-------- .../organization/template/locale/en-US.ts | 1 + .../organization/template/locale/zh-CN.ts | 1 + 8 files changed, 32 insertions(+), 9 deletions(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugHistoryService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugHistoryService.java index f6256d7480..d66f973e62 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugHistoryService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugHistoryService.java @@ -10,6 +10,7 @@ import io.metersphere.system.dto.OperationHistoryDTO; import io.metersphere.system.dto.request.OperationHistoryRequest; import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.log.constants.OperationLogType; +import io.metersphere.system.mapper.BaseOperationHistoryMapper; import io.metersphere.system.mapper.OperationHistoryMapper; import io.metersphere.system.mapper.UserMapper; import jakarta.annotation.Resource; @@ -31,6 +32,8 @@ public class BugHistoryService { @Resource private OperationHistoryMapper operationHistoryMapper; + @Resource + private BaseOperationHistoryMapper baseOperationHistoryMapper; /** * 缺陷变更历史分页列表 @@ -50,6 +53,7 @@ public class BugHistoryService { userExample.createCriteria().andIdIn(userIds); List users = userMapper.selectByExample(userExample); Map userMap = users.stream().collect(Collectors.toMap(User::getId, User::getName)); + Long latestVersionId = baseOperationHistoryMapper.selectLatestIdByOperationId(request.getSourceId()); return history.stream().map(h -> { OperationHistoryDTO dto = new OperationHistoryDTO(); BeanUtils.copyBean(dto, h); @@ -61,7 +65,7 @@ public class BugHistoryService { } else if (StringUtils.equals(dto.getType(), OperationLogType.DELETE.name())) { dto.setType(Translator.get("delete")); } - + dto.setLatest(latestVersionId != null && latestVersionId.longValue() == dto.getId().longValue()); return dto; }).toList(); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/OperationHistoryDTO.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/OperationHistoryDTO.java index 401afdb0a4..dfdf2d8e3e 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/OperationHistoryDTO.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/OperationHistoryDTO.java @@ -23,4 +23,6 @@ public class OperationHistoryDTO extends OperationHistory implements Serializabl // 版本 private String versionName; + //是否是最新 + private boolean isLatest; } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.java b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.java index d7e8f38b0c..71b9d60184 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.java @@ -18,4 +18,6 @@ public interface BaseOperationHistoryMapper { List list(@Param("request") OperationHistoryRequest request); List listWidthTable(@Param("request") OperationHistoryRequest request, @Param("table") String table); + + Long selectLatestIdByOperationId(String bugId); } \ No newline at end of file diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.xml index a78284a0db..404efb0a07 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationHistoryMapper.xml @@ -67,4 +67,11 @@ + diff --git a/frontend/src/views/bug-management/components/bugHistoryTab.vue b/frontend/src/views/bug-management/components/bugHistoryTab.vue index 0f3f2d2ff1..5e0f801ecf 100644 --- a/frontend/src/views/bug-management/components/bugHistoryTab.vue +++ b/frontend/src/views/bug-management/components/bugHistoryTab.vue @@ -2,6 +2,7 @@ @@ -10,6 +11,7 @@ import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import { MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; + import MsTag from '@/components/pure/ms-tag/ms-tag.vue'; import { getChangeHistoryList } from '@/api/modules/bug-management'; import { useI18n } from '@/hooks/useI18n'; diff --git a/frontend/src/views/project-management/template/components/templateManagement.vue b/frontend/src/views/project-management/template/components/templateManagement.vue index 36bd126803..5854392763 100644 --- a/frontend/src/views/project-management/template/components/templateManagement.vue +++ b/frontend/src/views/project-management/template/components/templateManagement.vue @@ -32,15 +32,19 @@