From ab678d48c9b8ef47ead8327e1c20397d351f876a Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 7 Mar 2024 20:56:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=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=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1036361 --user=宋天阳 【缺陷管理】缺陷详情-变更历史-列表无类型字段 https://www.tapd.cn/55049933/s/1471764 --- .../io/metersphere/bug/service/BugHistoryService.java | 11 +++++++++++ frontend/src/components/pure/ms-table/base-table.vue | 2 +- .../views/bug-management/components/bugHistoryTab.vue | 8 ++++++-- frontend/src/views/bug-management/locale/en-US.ts | 1 + frontend/src/views/bug-management/locale/zh-CN.ts | 1 + 5 files changed, 20 insertions(+), 3 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 cd5a12dffb..77ddbef5bf 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 @@ -1,6 +1,7 @@ package io.metersphere.bug.service; import io.metersphere.sdk.util.BeanUtils; +import io.metersphere.sdk.util.Translator; import io.metersphere.system.domain.OperationHistory; import io.metersphere.system.domain.OperationHistoryExample; import io.metersphere.system.domain.User; @@ -8,10 +9,12 @@ import io.metersphere.system.domain.UserExample; 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.OperationHistoryMapper; import io.metersphere.system.mapper.UserMapper; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +54,14 @@ public class BugHistoryService { OperationHistoryDTO dto = new OperationHistoryDTO(); BeanUtils.copyBean(dto, h); dto.setCreateUserName(userMap.get(h.getCreateUser()) == null ? h.getCreateUser() : userMap.get(h.getCreateUser())); + if (StringUtils.equals(dto.getType(), OperationLogType.ADD.name())) { + dto.setType(Translator.get("add")); + } else if (StringUtils.equals(dto.getType(), OperationLogType.UPDATE.name())) { + dto.setType(Translator.get("update")); + } else if (StringUtils.equals(dto.getType(), OperationLogType.DELETE.name())) { + dto.setType(Translator.get("delete")); + } + return dto; }).toList(); } diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue index 9d2ab6a5f7..09ca199951 100644 --- a/frontend/src/components/pure/ms-table/base-table.vue +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -189,7 +189,7 @@
- {{ t('msTable.empty') }} + {{ t('common.noData') }}
diff --git a/frontend/src/views/bug-management/components/bugHistoryTab.vue b/frontend/src/views/bug-management/components/bugHistoryTab.vue index 7c600a6340..865a1d99e7 100644 --- a/frontend/src/views/bug-management/components/bugHistoryTab.vue +++ b/frontend/src/views/bug-management/components/bugHistoryTab.vue @@ -2,8 +2,6 @@ @@ -30,6 +28,12 @@ dataIndex: 'id', width: 200, }, + { + title: 'bugManagement.history.operation', + dataIndex: 'type', + showTooltip: true, + width: 200, + }, { title: 'bugManagement.history.operationMan', dataIndex: 'createUserName', diff --git a/frontend/src/views/bug-management/locale/en-US.ts b/frontend/src/views/bug-management/locale/en-US.ts index a14558fb71..730a14d253 100644 --- a/frontend/src/views/bug-management/locale/en-US.ts +++ b/frontend/src/views/bug-management/locale/en-US.ts @@ -120,6 +120,7 @@ export default { history: { changeNumber: 'Change number', operationMan: 'Operator', + operation: 'Operation', updateTime: 'Update time', restore: 'Restore', current: 'Current', diff --git a/frontend/src/views/bug-management/locale/zh-CN.ts b/frontend/src/views/bug-management/locale/zh-CN.ts index e6e5912bb5..ffbedda87c 100644 --- a/frontend/src/views/bug-management/locale/zh-CN.ts +++ b/frontend/src/views/bug-management/locale/zh-CN.ts @@ -120,6 +120,7 @@ export default { history: { changeNumber: '变更序号', operationMan: '操作人', + operation: '操作', updateTime: '更新时间', restore: '恢复', current: '当前',