diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.java index 03d9e7b122..1a76228f25 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.java @@ -2,7 +2,7 @@ package io.metersphere.base.mapper.ext; import io.metersphere.api.dto.automation.TestPlanScenarioRequest; import io.metersphere.base.domain.TestPlanUiScenario; -import io.metersphere.dto.TestPlanFailureUiScenarioDTO; +import io.metersphere.dto.TestPlanUiScenarioDTO; import io.metersphere.dto.UiScenarioDTO; import io.metersphere.track.dto.PlanReportCaseDTO; import org.apache.ibatis.annotations.Param; @@ -29,9 +29,9 @@ public interface ExtTestPlanUiScenarioCaseMapper { List selectForPlanReport(String planId); - List getFailureList(@Param("planId") String planId, @Param("status") String status); + List getPlanUiScenarioByStatusList(@Param("planId") String planId, @Param("statusList") List statusList); - List getFailureListByIds(@Param("ids") Collection ids,@Param("status") String status); + List getFailureListByIds(@Param("ids") Collection ids, @Param("status") String status); List getUnderwaySteps(@Param("ids") List underwayIds); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.xml index 0a47b8fb06..76cbc33311 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanUiScenarioCaseMapper.xml @@ -237,31 +237,7 @@ SELECT id FROM ui_scenario where status is null or status != 'Trash' ) - - - select t.id, t.last_result, t.report_id, c.user_id, c.module_path, c.name, c.level,c.create_user,c.principal, c.status,c.step_total, c.step_total, c.project_id, @@ -319,6 +295,26 @@ order by `order` desc limit 1; + + and ${versionTable}.version_id = #{request.versionId} diff --git a/backend/src/main/java/io/metersphere/commons/constants/TestPlanUiResultStatus.java b/backend/src/main/java/io/metersphere/commons/constants/TestPlanUiResultStatus.java new file mode 100644 index 0000000000..aa36426dd7 --- /dev/null +++ b/backend/src/main/java/io/metersphere/commons/constants/TestPlanUiResultStatus.java @@ -0,0 +1,5 @@ +package io.metersphere.commons.constants; + +public enum TestPlanUiResultStatus { + Error, Success, UnExecute +} diff --git a/backend/src/main/java/io/metersphere/controller/ShareController.java b/backend/src/main/java/io/metersphere/controller/ShareController.java index 73bc980ecf..e8f72ee24e 100644 --- a/backend/src/main/java/io/metersphere/controller/ShareController.java +++ b/backend/src/main/java/io/metersphere/controller/ShareController.java @@ -159,28 +159,11 @@ public class ShareController { return testPlanScenarioCaseService.getUnExecuteCases(planId); } - @GetMapping("/test/plan/uiScenario/case/list/failure/{shareId}/{planId}") - public List getUiScenarioFailureList(@PathVariable String shareId, @PathVariable String planId) { + @PostMapping("/test/plan/uiScenario/case/list/all/{shareId}/{planId}") + public List getUiScenarioAllList(@PathVariable String shareId, @PathVariable String planId, + @RequestBody(required = false) List statusList) { shareInfoService.validate(shareId, planId); - return testPlanUiScenarioCaseService.getFailureCases(planId); - } - - @GetMapping("/test/plan/uiScenario/case/list/all/{shareId}/{planId}") - public List getUiScenarioAllList(@PathVariable String shareId, @PathVariable String planId) { - shareInfoService.validate(shareId, planId); - return testPlanUiScenarioCaseService.getAllCases(planId); - } - - @GetMapping("/test/plan/uiScenario/case/list/errorReport/{shareId}/{planId}") - public List getUiScenarioErrorReportList(@PathVariable String shareId, @PathVariable String planId) { - shareInfoService.validate(shareId, planId); - return testPlanUiScenarioCaseService.getErrorReportCases(planId); - } - - @GetMapping("/test/plan/uiScenario/case/list/unExecute/{shareId}/{planId}") - public List geUitUnExecuteScenarioCases(@PathVariable String shareId, @PathVariable String planId) { - shareInfoService.validate(shareId, planId); - return testPlanUiScenarioCaseService.getUnExecuteCases(planId); + return testPlanUiScenarioCaseService.getAllCasesByStatusList(planId, statusList); } @GetMapping("/api/definition/report/getReport/{shareId}/{testId}") diff --git a/backend/src/main/java/io/metersphere/dto/TestPlanFailureUiScenarioDTO.java b/backend/src/main/java/io/metersphere/dto/TestPlanUiScenarioDTO.java similarity index 81% rename from backend/src/main/java/io/metersphere/dto/TestPlanFailureUiScenarioDTO.java rename to backend/src/main/java/io/metersphere/dto/TestPlanUiScenarioDTO.java index 9b9925a42f..a41bc19236 100644 --- a/backend/src/main/java/io/metersphere/dto/TestPlanFailureUiScenarioDTO.java +++ b/backend/src/main/java/io/metersphere/dto/TestPlanUiScenarioDTO.java @@ -8,6 +8,6 @@ import lombok.Setter; @Getter @Setter @JsonInclude(JsonInclude.Include.NON_NULL) -public class TestPlanFailureUiScenarioDTO extends UiScenarioDTO { +public class TestPlanUiScenarioDTO extends UiScenarioDTO { private APIScenarioReportResult response; } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java index a8f0d22927..50394139b7 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java @@ -38,24 +38,10 @@ public class TestPlanUiScenarioCaseController { return PageUtils.setPageInfo(page, testPlanUiScenarioCaseService.list(request)); } - @GetMapping("/list/failure/{planId}") - public List getFailureList(@PathVariable String planId) { - return testPlanUiScenarioCaseService.getFailureCases(planId); - } - - @GetMapping("/list/errorReport/{planId}") - public List getErrorReportList(@PathVariable String planId) { - return testPlanUiScenarioCaseService.getErrorReportCases(planId); - } - - @GetMapping("/list/unExecute/{planId}") - public List getUnExecuteCases(@PathVariable String planId) { - return testPlanUiScenarioCaseService.getUnExecuteCases(planId); - } - - @GetMapping("/list/all/{planId}") - public List getAllList(@PathVariable String planId) { - return testPlanUiScenarioCaseService.getAllCases(planId); + @PostMapping("/list/all/{planId}") + public List getAllList(@PathVariable String planId, + @RequestBody(required = false) List statusList) { + return testPlanUiScenarioCaseService.getAllCasesByStatusList(planId, statusList); } @PostMapping("/selectAllTableRows") diff --git a/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java b/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java index ef79f22f35..2435917bea 100644 --- a/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java +++ b/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java @@ -4,6 +4,7 @@ import io.metersphere.api.dto.automation.TestPlanFailureApiDTO; import io.metersphere.api.dto.automation.TestPlanFailureScenarioDTO; import io.metersphere.base.domain.IssuesDao; import io.metersphere.base.domain.TestPlanReportContent; +import io.metersphere.dto.TestPlanUiScenarioDTO; import lombok.Getter; import lombok.Setter; @@ -43,14 +44,19 @@ public class TestPlanSimpleReportDTO extends TestPlanReportContent { List functionAllCases; List issueList; - List apiFailureCases; - List apiAllCases; - List scenarioFailureCases; - List scenarioAllCases; + List loadAllCases; List loadFailureCases; + + List apiAllCases; List errorReportCases; - List errorReportScenarios; + List apiFailureCases; List unExecuteCases; + + List scenarioAllCases; + List errorReportScenarios; + List scenarioFailureCases; List unExecuteScenarios; + + List uiAllCases; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index 0f072c8ac4..6dc0234b2a 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -16,7 +16,7 @@ import io.metersphere.commons.utils.*; import io.metersphere.constants.RunModeConstants; import io.metersphere.dto.RunModeConfigDTO; import io.metersphere.dto.TestPlanExecuteReportDTO; -import io.metersphere.dto.TestPlanFailureUiScenarioDTO; +import io.metersphere.dto.TestPlanUiScenarioDTO; import io.metersphere.i18n.Translator; import io.metersphere.log.vo.OperatingLogDetails; import io.metersphere.service.EnvironmentGroupProjectService; @@ -1104,9 +1104,9 @@ public class TestPlanReportService { content.setPlanLoadCaseReportStruct(JSONObject.toJSONString(loadCaseReportIdMap)); } if (MapUtils.isNotEmpty(uiScenarioReportMap)) { - List uiScenarios = + List uiScenarios = extTestPlanUiScenarioCaseMapper.getFailureListByIds(uiScenarioReportMap.keySet(), null); - for (TestPlanFailureUiScenarioDTO dto : uiScenarios) { + for (TestPlanUiScenarioDTO dto : uiScenarios) { dto.setReportId(uiScenarioReportMap.get(dto.getId())); } content.setPlanUiScenarioReportStruct(JSONObject.toJSONString(uiScenarios)); diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java index bc2ed3718e..be4f081ddb 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java @@ -504,19 +504,6 @@ public class TestPlanScenarioCaseService { calculatePlanReport(report, planReportCaseDTOS); } - public void calculatePlanReportByScenarioList(List scenarioList, TestPlanSimpleReportDTO report) { - List planReportCaseDTOS = new ArrayList<>(); - for (TestPlanFailureScenarioDTO scenario : scenarioList) { - PlanReportCaseDTO dto = new PlanReportCaseDTO(); - dto.setCaseId(scenario.getCaseId()); - dto.setId(scenario.getId()); - dto.setStatus(scenario.getStatus()); - dto.setReportId(scenario.getReportId()); - planReportCaseDTOS.add(dto); - } - calculatePlanReport(report, planReportCaseDTOS); - } - private void calculatePlanReport(TestPlanSimpleReportDTO report, List planReportCaseDTOS) { TestPlanApiResultReportDTO apiResult = report.getApiResult(); diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 154efc6049..37ae1b1286 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1364,15 +1364,11 @@ public class TestPlanService { List allCases = null; List statusList = getFunctionalReportStatusList(config); if (statusList != null) { + // 不等于null,说明配置了用例,根据配置的状态查询用例 allCases = testPlanTestCaseService.getAllCasesByStatusList(planId, statusList); report.setFunctionAllCases(allCases); } - if (checkReportConfig(config, "functional", "all")) { - allCases = testPlanTestCaseService.getAllCases(planId); - report.setFunctionAllCases(allCases); - } - if (checkReportConfig(config, "functional", "issue")) { List issueList = issuesService.getIssuesByPlanId(planId); report.setIssueList(issueList); @@ -1380,6 +1376,28 @@ public class TestPlanService { } } + public void buildUiReport(TestPlanSimpleReportDTO report, JSONObject config, String planId, boolean saveResponse) { + if (checkReportConfig(config, "ui")) { + List allCases; + List statusList = getUiReportStatusList(config); + if (statusList != null) { + // 不等于null,说明配置了用例,根据配置的状态查询用例 + allCases = testPlanUiScenarioCaseService.getAllCasesByStatusList(planId, statusList); + report.setUiAllCases(allCases); + if (saveResponse) { + buildUiScenarioResponse(allCases); + } + } + } + } + + /** + * 如果配置了全部用例返回空的数组 + * 如果没有,则添加对应的状态 + * 都没配置就返回 null + * @param config + * @return + */ public List getFunctionalReportStatusList(JSONObject config) { List statusList = new ArrayList<>(); if (checkReportConfig(config, "functional", "all")) { @@ -1397,6 +1415,20 @@ public class TestPlanService { return statusList.size() > 0 ? statusList : null; } + public List getUiReportStatusList(JSONObject config) { + List statusList = new ArrayList<>(); + if (checkReportConfig(config, "ui", "all")) { + return statusList; + } + if (checkReportConfig(config, "ui", "failure")) { + statusList.add(TestPlanUiResultStatus.Error.name()); + } + if (checkReportConfig(config, "ui", "unExecute")) { + statusList.add(TestPlanUiResultStatus.UnExecute.name()); + } + return statusList.size() > 0 ? statusList : null; + } + public void buildApiReport(TestPlanSimpleReportDTO report, JSONObject config, String planId, boolean saveResponse) { if (checkReportConfig(config, "api")) { List apiAllCases = null; @@ -1474,6 +1506,14 @@ public class TestPlanService { } } + public void buildUiScenarioResponse(List cases) { + if (!CollectionUtils.isEmpty(cases)) { + cases.forEach((item) -> { + item.setResponse(apiScenarioReportService.get(item.getReportId(), true)); + }); + } + } + public void buildLoadResponse(List cases) { if (!CollectionUtils.isEmpty(cases)) { cases.forEach(item -> { @@ -1792,6 +1832,7 @@ public class TestPlanService { buildFunctionalReport(report, config, planId); buildApiReport(report, config, planId, saveResponse); buildLoadReport(report, config, planId, saveResponse); + buildUiReport(report, config, planId, saveResponse); return report; } @@ -1817,21 +1858,27 @@ public class TestPlanService { return true; } else { JSONObject configItem = config.getJSONObject(key); + if (configItem == null) { + return true; + } return configItem.getBoolean("enable"); } } public Boolean checkReportConfig(JSONObject config, String key, String subKey) { - if (config == null) { + if (config == null || config.getJSONObject(key) == null) { return true; } else { JSONObject configItem = config.getJSONObject(key); Boolean enable = configItem.getBoolean("enable"); - if (!enable) { - return false; - } else { + if (enable) { JSONObject subConfig = configItem.getJSONObject("children").getJSONObject(subKey); - return subConfig == null ? true : subConfig.getBoolean("enable"); + if (subConfig == null) { + return true; + } + return subConfig.getBoolean("enable"); + } else { + return false; } } } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java index 8977d67974..5e8edc7085 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java @@ -451,19 +451,6 @@ public class TestPlanUiScenarioCaseService { calculatePlanReport(report, planReportCaseDTOS); } - public void calculatePlanReportByScenarioList(List scenarioList,TestPlanSimpleReportDTO report){ - List planReportCaseDTOS = new ArrayList<>(); - for (TestPlanFailureUiScenarioDTO scenario : scenarioList) { - PlanReportCaseDTO dto = new PlanReportCaseDTO(); - dto.setCaseId(scenario.getCaseId()); - dto.setId(scenario.getId()); - dto.setStatus(scenario.getStatus()); - dto.setReportId(scenario.getReportId()); - planReportCaseDTOS.add(dto); - } - calculatePlanReport(report, planReportCaseDTOS); - } - private void calculatePlanReport(TestPlanSimpleReportDTO report, List planReportCaseDTOS) { TestPlanUiResultReportDTO uiResult = report.getUiResult(); @@ -524,18 +511,18 @@ public class TestPlanUiScenarioCaseService { } } - public List getAllCases(String planId) { - List apiTestCases = - extTestPlanUiScenarioCaseMapper.getFailureList(planId, null); - return buildCases(apiTestCases); + public List getAllCasesByStatusList(String planId, List statusList) { + List uiTestCases = + extTestPlanUiScenarioCaseMapper.getPlanUiScenarioByStatusList(planId, statusList); + return buildCases(uiTestCases); } - public List getAllCases(Map idMap, Map scenarioInfoDTOMap) { + public List getAllCases(Map idMap, Map scenarioInfoDTOMap) { String defaultStatus = "Fail"; Map reportStatus = apiScenarioReportService.getReportStatusByReportIds(idMap.values()); Map savedReportMap = new HashMap<>(idMap); - List apiTestCases = new ArrayList<>(); - for (TestPlanFailureUiScenarioDTO dto : scenarioInfoDTOMap.values()) { + List apiTestCases = new ArrayList<>(); + for (TestPlanUiScenarioDTO dto : scenarioInfoDTOMap.values()) { String reportId = savedReportMap.get(dto.getId()); savedReportMap.remove(dto.getId()); dto.setReportId(reportId); @@ -556,13 +543,7 @@ public class TestPlanUiScenarioCaseService { return buildCases(apiTestCases); } - public List getFailureCases(String planId) { - List apiTestCases = - extTestPlanUiScenarioCaseMapper.getFailureList(planId, "Fail"); - return buildCases(apiTestCases); - } - - public List buildCases(List apiTestCases) { + public List buildCases(List apiTestCases) { if (CollectionUtils.isEmpty(apiTestCases)) { return apiTestCases; } @@ -603,16 +584,4 @@ public class TestPlanUiScenarioCaseService { extTestPlanUiScenarioCaseMapper::getLastOrder, testPlanUiScenarioMapper::updateByPrimaryKeySelective); } - - public List getErrorReportCases(String planId) { - List apiTestCases = - extTestPlanUiScenarioCaseMapper.getFailureList(planId, ExecuteResult.ERROR_REPORT_RESULT.toString()); - return buildCases(apiTestCases); - } - - public List getUnExecuteCases(String planId) { - List apiTestCases = - extTestPlanUiScenarioCaseMapper.getFailureList(planId, "unExecute"); - return buildCases(apiTestCases); - } } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue index 0d5998bedd..1d733503c8 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue @@ -8,34 +8,31 @@ - - - {{ $t('api_test.automation.rerun') }} - + - + - - - - {{ $t('api_test.automation.rerun') }} - + - - - {{ $t('api_test.automation.rerun') }} - - + @@ -46,26 +43,26 @@ import MsFormDivider from "@/business/components/common/components/MsFormDivider import UiResult from "@/business/components/track/plan/view/comonents/report/detail/component/UiResult"; import TestPlanReportContainer from "@/business/components/track/plan/view/comonents/report/detail/TestPlanReportContainer"; -import ApiCases from "@/business/components/track/plan/view/comonents/report/detail/component/ApiCases"; import TabPaneCount from "@/business/components/track/plan/view/comonents/report/detail/component/TabPaneCount"; import {hasLicense} from "@/common/js/utils"; +import { + getPlanUiScenarioAllCase, + getSharePlanUiScenarioAllCase, +} from "@/network/test-plan"; +import UiScenarioResult from "@/business/components/track/plan/view/comonents/report/detail/component/UiScenarioResult"; export default { name: "TestPlanUiReport", - components: {TabPaneCount, ApiCases, TestPlanReportContainer, UiResult, MsFormDivider}, + components: {UiScenarioResult, TabPaneCount, TestPlanReportContainer, UiResult, MsFormDivider}, data() { return { activeName: 'first', failureSize: 0, - errorReportSize: 0, unExecuteSize: 0, allSize: 0, - showRerunBtn: false, + uiAllCases: [] }; }, - created() { - // this.showRerunBtn = !this.isShare && hasLicense(); - }, props: [ 'report', 'planId', 'isTemplate', 'isShare', 'shareId', 'isDb' ], @@ -78,10 +75,6 @@ export default { let disable = this.report.config && this.report.config.ui.children.failure.enable === false; return !disable; }, - errorReportEnable() { - let disable = this.report.config && this.report.config.ui.children.errorReport && this.report.config.ui.children.errorReport.enable === false; - return !disable; - }, unExecuteEnable() { let disable = this.report.config && this.report.config.ui.children.unExecute && this.report.config.ui.children.unExecute.enable === false; return !disable; @@ -89,13 +82,6 @@ export default { allEnable() { let disable = this.report.config && this.report.config.ui.children.all.enable === false; return !disable; - }, - isRerun() { - return ((this.report && this.report.apiFailureCases) - || (this.report && this.report.unExecuteCases) - || (this.report && this.report.scenarioFailureCases) - || (this.report && this.report.unExecuteScenarios) - || (this.report && this.report.loadFailureCases)); } }, watch: { @@ -105,15 +91,16 @@ export default { failureEnable() { this.initActiveName(); }, - errorReportEnable() { - this.initActiveName(); - }, allEnable() { this.initActiveName(); }, + 'report.config'() { + this.getAllUiCase(); + } }, mounted() { this.initActiveName(); + this.getAllUiCase(); }, methods: { initActiveName() { @@ -121,18 +108,13 @@ export default { this.activeName = 'first'; } else if (this.failureEnable) { this.activeName = 'second'; - } else if (this.errorReportEnable) { - this.activeName = 'third'; } else if (this.allEnable) { - this.activeName = 'fourth'; + this.activeName = 'third'; } }, setFailureSize(size) { this.failureSize = size; }, - setErrorReportSize(size) { - this.errorReportSize = size; - }, setUnExecuteSize(size) { this.unExecuteSize = size; }, @@ -141,66 +123,41 @@ export default { }, handleClick(tab, event) { }, - rerun() { - let type = "TEST_PLAN"; - let scenarios = []; - let cases = []; - let performanceCases = []; - let rerunObj = { - type: type, - reportId: this.report.id, - scenarios: scenarios, - cases: cases, - performanceCases: performanceCases - } - // 获取需要重跑的用例 - if (this.report && this.report.apiFailureCases) { - this.format(cases, this.report.apiFailureCases); - } - if (this.report && this.report.unExecuteCases) { - this.format(cases, this.report.unExecuteCases); - } - // 获取需要重跑的场景 - if (this.report && this.report.scenarioFailureCases) { - this.format(scenarios, this.report.scenarioFailureCases); - } - if (this.report && this.report.unExecuteScenarios) { - this.format(scenarios, this.report.unExecuteScenarios); - } - // 获取需要重跑的性能用例 - if (this.report && this.report.loadFailureCases) { - this.format(performanceCases, this.report.loadFailureCases); - } - this.$post('/ui/test/exec/rerun', rerunObj, res => { - if (res.data !== 'SUCCESS') { - this.$error(res.data); - } else { - this.$success(this.$t('api_test.automation.rerun_success')); + getAllUiCase() { + if (this.isTemplate || this.isDb) { + this.uiAllCases = this.report.uiAllCases ? this.report.uiAllCases : []; + } else if (this.isShare) { + let param = this.getStatusList(); + if (param) { + getSharePlanUiScenarioAllCase(this.shareId, this.planId, param, (data) => { + this.uiAllCases = data; + }); + } + } else { + let param = this.getStatusList(); + if (param) { + this.result = getPlanUiScenarioAllCase(this.planId, param, (data) => { + this.uiAllCases = data; + }); } - }); - }, - format(cases, datas) { - if (this.report && datas) { - datas.forEach(item => { - if (item) { - let obj = {id: item.id, reportId: item.reportId, userId: item.createUser}; - cases.push(obj); - } - }); } + }, + getStatusList() { + let statusList = []; + if (this.allEnable) { + return statusList; + } + if (this.failureEnable) { + statusList.push('Error'); + } + if (this.unExecuteEnable) { + statusList.push('UnExecute'); + } + return statusList.length > 0 ? statusList : null; } } } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCases.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCases.vue index 931950cde4..ff73e09732 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCases.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCases.vue @@ -1,7 +1,7 @@