From 415c6ae553d9d5233f0f2dda909762409426936c Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 24 Jun 2024 15:27:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=81=9C=E6=AD=A2=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiTaskCenterService.java | 4 ++-- .../io/metersphere/system/log/constants/OperationLogType.java | 3 ++- .../metersphere/plan/service/TestPlanTaskCenterService.java | 4 ++-- frontend/src/config/common.ts | 4 ++++ frontend/src/views/setting/system/log/components/logCards.vue | 4 ++++ frontend/src/views/setting/system/log/locale/en-US.ts | 1 + frontend/src/views/setting/system/log/locale/zh-CN.ts | 1 + 7 files changed, 16 insertions(+), 5 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java index c8fa46d7e6..dbf170fdfb 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java @@ -350,12 +350,12 @@ public class ApiTaskCenterService { LogDTO dto = LogDTOBuilder.builder() .projectId(reportDTO.getProjectId()) .organizationId(orgMap.get(reportDTO.getProjectId())) - .type(OperationLogType.UPDATE.name()) + .type(OperationLogType.STOP.name()) .module(module) .method(OperationLogAspect.getMethod()) .path(OperationLogAspect.getPath()) .sourceId(reportDTO.getId()) - .content(String.format("停止任务:%s", reportDTO.getName())) + .content(reportDTO.getName()) .createUser(userId) .build().getLogDTO(); logs.add(dto); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogType.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogType.java index 390f7288d2..1fc01db6e9 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogType.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogType.java @@ -19,7 +19,8 @@ public enum OperationLogType { DISASSOCIATE, ASSOCIATE, QRCODE, - ARCHIVED; + ARCHIVED, + STOP; public boolean contains(OperationLogType keyword) { return this.name().contains(keyword.name()); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java index e670086c54..cd7f6ea45b 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java @@ -350,12 +350,12 @@ public class TestPlanTaskCenterService { LogDTO dto = LogDTOBuilder.builder() .projectId(reportDTO.getProjectId()) .organizationId(orgMap.get(reportDTO.getProjectId())) - .type(OperationLogType.UPDATE.name()) + .type(OperationLogType.STOP.name()) .module(module) .method(OperationLogAspect.getMethod()) .path(OperationLogAspect.getPath()) .sourceId(reportDTO.getId()) - .content(String.format("停止任务:%s", reportDTO.getName())) + .content(reportDTO.getName()) .createUser(userId) .build().getLogDTO(); logs.add(dto); diff --git a/frontend/src/config/common.ts b/frontend/src/config/common.ts index 6a673105f3..682bb3290a 100644 --- a/frontend/src/config/common.ts +++ b/frontend/src/config/common.ts @@ -84,4 +84,8 @@ export const operationTypeOptions = [ label: 'system.log.operateType.archived', value: 'ARCHIVED', }, + { + label: 'system.log.operateType.stop', + value: 'STOP', + }, ]; diff --git a/frontend/src/views/setting/system/log/components/logCards.vue b/frontend/src/views/setting/system/log/components/logCards.vue index 22015fed4f..475e057ec4 100644 --- a/frontend/src/views/setting/system/log/components/logCards.vue +++ b/frontend/src/views/setting/system/log/components/logCards.vue @@ -455,6 +455,10 @@ label: 'system.log.operateType.archived', value: 'ARCHIVED', }, + { + label: 'system.log.operateType.stop', + value: 'STOP', + }, ]; function resetFilter() { diff --git a/frontend/src/views/setting/system/log/locale/en-US.ts b/frontend/src/views/setting/system/log/locale/en-US.ts index 5c98a5f75c..5b1f6a5d2b 100644 --- a/frontend/src/views/setting/system/log/locale/en-US.ts +++ b/frontend/src/views/setting/system/log/locale/en-US.ts @@ -35,4 +35,5 @@ export default { 'system.log.log': 'Operation log', 'system.log.time': 'Operation time', 'system.log.content': 'in {module} under {range}', + 'system.log.operateType.stop': 'Stop', }; diff --git a/frontend/src/views/setting/system/log/locale/zh-CN.ts b/frontend/src/views/setting/system/log/locale/zh-CN.ts index e127564f93..d0fe0c353f 100644 --- a/frontend/src/views/setting/system/log/locale/zh-CN.ts +++ b/frontend/src/views/setting/system/log/locale/zh-CN.ts @@ -35,4 +35,5 @@ export default { 'system.log.log': '操作日志', 'system.log.time': '操作时间', 'system.log.content': '{operator} 在 {range} 下的 {module} 中 ', + 'system.log.operateType.stop': '停止', };