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 @@