diff --git a/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java b/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java index 91fe22437c..9c27f998f8 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java @@ -210,6 +210,11 @@ public class IssuesController { return issuesService.getPlatformTransitions(request); } + @PostMapping("/platform/status") + public List getPlatformStatus(@RequestBody PlatformIssueTypeRequest request) { + return issuesService.getPlatformStatus(request); + } + @GetMapping("/platform/option") public List getPlatformOptions() { return platformPluginService.getPlatformOptions(); diff --git a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java index 115ea10c8e..53fa2c47e4 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java @@ -1449,16 +1449,45 @@ public class IssuesService { return extIssuesMapper.getIssues(request); } + public List getPlatformStatus(PlatformIssueTypeRequest request) { + List platformStatusDTOS = new ArrayList<>(); + Project project = baseProjectService.getProjectById(request.getProjectId()); + String projectConfig = PlatformPluginService.getCompatibleProjectConfig(project); + String platform = project.getPlatform(); + if (PlatformPluginService.isPluginPlatform(platform)) { + return platformPluginService.getPlatform(platform) + .getStatusList(projectConfig) + .stream().map(item -> { + // 全部插件化后简化 + PlatformStatusDTO platformStatusDTO = new PlatformStatusDTO(); + platformStatusDTO.setLabel(item.getLabel()); + platformStatusDTO.setValue(item.getValue()); + return platformStatusDTO; + }) + .collect(Collectors.toList()); + } else { + List platforms = getPlatforms(project); + if (CollectionUtils.isEmpty(platforms)) { + return platformStatusDTOS; + } + + IssuesRequest issuesRequest = getDefaultIssueRequest(request.getProjectId(), request.getWorkspaceId()); + return IssueFactory.createPlatform(platform, issuesRequest).getTransitions(request.getPlatformKey()); + } + } + public List getPlatformTransitions(PlatformIssueTypeRequest request) { List platformStatusDTOS = new ArrayList<>(); if (!StringUtils.isBlank(request.getPlatformKey())) { Project project = baseProjectService.getProjectById(request.getProjectId()); + String projectConfig = PlatformPluginService.getCompatibleProjectConfig(project); String platform = project.getPlatform(); if (PlatformPluginService.isPluginPlatform(platform)) { return platformPluginService.getPlatform(platform) - .getStatusList(request.getPlatformKey()) + .getTransitions(projectConfig, request.getPlatformKey()) .stream().map(item -> { + // 全部插件化后简化 PlatformStatusDTO platformStatusDTO = new PlatformStatusDTO(); platformStatusDTO.setLabel(item.getLabel()); platformStatusDTO.setValue(item.getValue()); diff --git a/test-track/frontend/src/api/issue.js b/test-track/frontend/src/api/issue.js index 251fbc2a79..bb7eaeeedf 100644 --- a/test-track/frontend/src/api/issue.js +++ b/test-track/frontend/src/api/issue.js @@ -212,6 +212,10 @@ export function getPlatformStatus(param) { return post('/issues/platform/status', param); } +export function getPlatformTransitions(param) { + return post('/issues/platform/transitions', param); +} + export function enableThirdPartTemplate(projectId) { return get(BASE_URL + 'third/part/template/enable/' + projectId); } diff --git a/test-track/frontend/src/business/issue/IssueEditDetail.vue b/test-track/frontend/src/business/issue/IssueEditDetail.vue index 9bd70780d1..3ab02127d4 100644 --- a/test-track/frontend/src/business/issue/IssueEditDetail.vue +++ b/test-track/frontend/src/business/issue/IssueEditDetail.vue @@ -200,13 +200,11 @@ import {hasLicense} from "metersphere-frontend/src/utils/permission"; import { enableThirdPartTemplate, getIssuePartTemplateWithProject, - getPlatformStatus, - getIssuesById, saveOrUpdateIssue, saveFollow, getFollow, getComments, - getTapdUser + getTapdUser, getPlatformTransitions } from "@/api/issue"; import { uploadIssueAttachment, @@ -433,7 +431,7 @@ export default { projectId: getCurrentProjectID(), workspaceId: getCurrentWorkspaceId() } - getPlatformStatus(data).then(response => { + getPlatformTransitions(data).then(response => { if (response.data.length > 0) { this.platformTransitions = response.data; } diff --git a/test-track/frontend/src/business/issue/IssueList.vue b/test-track/frontend/src/business/issue/IssueList.vue index f30620ff71..cddd7f54f0 100644 --- a/test-track/frontend/src/business/issue/IssueList.vue +++ b/test-track/frontend/src/business/issue/IssueList.vue @@ -65,15 +65,14 @@