From b148152d0283e844e76fa1075bab6cff0c39a77f Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 25 Aug 2021 11:24:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=8A=A5=E5=91=8A=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/detail/TestPlanApiReport.vue | 27 +++++++++--- .../detail/TestPlanFunctionalReport.vue | 40 ++++++++++++++---- .../report/detail/TestPlanLoadReport.vue | 28 ++++++++++--- .../report/detail/TestPlanReportContent.vue | 5 +++ .../detail/component/ApiCaseFailureResult.vue | 42 ++++++++----------- .../report/detail/component/ApiCases.vue | 34 +++++++++++++-- .../component/ApiScenarioFailureResult.vue | 33 +++++++-------- .../detail/component/FunctionalCases.vue | 7 ++++ .../detail/component/FunctionalIssueList.vue | 7 ++++ .../report/detail/component/LoadAllResult.vue | 22 ++++++---- .../detail/component/LoadFailureResult.vue | 7 ++++ .../report/detail/component/TabPaneCount.vue | 25 +++++++++++ 12 files changed, 202 insertions(+), 75 deletions(-) create mode 100644 frontend/src/business/components/track/plan/view/comonents/report/detail/component/TabPaneCount.vue diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue index 8a196e9487..0ec68074d9 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue @@ -4,11 +4,17 @@ - - + + + - - + + + @@ -20,12 +26,15 @@ import ApiResult from "@/business/components/track/plan/view/comonents/report/de 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"; export default { name: "TestPlanApiReport", - components: {ApiCases, TestPlanReportContainer, ApiResult, MsFormDivider}, + components: {TabPaneCount, ApiCases, TestPlanReportContainer, ApiResult, MsFormDivider}, data() { return { - activeName: 'first' + activeName: 'first', + failureSize: 0, + allSize: 0, }; }, props: [ @@ -69,6 +78,12 @@ export default { this.activeName = 'third'; } }, + setFailureSize(size) { + this.failureSize = size; + }, + setAllSize(size) { + this.allSize = size; + }, handleClick(tab, event) { } } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanFunctionalReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanFunctionalReport.vue index 2f22c4999e..824eda9f5d 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanFunctionalReport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanFunctionalReport.vue @@ -4,14 +4,23 @@ - - + + + - - + + + - - + + + @@ -26,12 +35,18 @@ import FunctionalIssueList from "@/business/components/track/plan/view/comonents/report/detail/component/FunctionalIssueList"; import TestPlanReportContainer from "@/business/components/track/plan/view/comonents/report/detail/TestPlanReportContainer"; +import TabPaneCount from "@/business/components/track/plan/view/comonents/report/detail/component/TabPaneCount"; export default { name: "TestPlanFunctionalReport", - components: {TestPlanReportContainer, FunctionalIssueList, FunctionalCases, FunctionalResult, MsFormDivider}, + components: { + TabPaneCount, + TestPlanReportContainer, FunctionalIssueList, FunctionalCases, FunctionalResult, MsFormDivider}, data() { return { - activeName: 'first' + activeName: 'first', + failureSize: 0, + issueSize: 0, + allSize: 0, }; }, props: [ @@ -84,6 +99,15 @@ export default { this.activeName = 'fourth'; } }, + setFailureSize(size) { + this.failureSize = size; + }, + setIssueSize(size) { + this.issueSize = size; + }, + setAllSize(size) { + this.allSize = size; + }, handleClick(tab, event) { } } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanLoadReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanLoadReport.vue index eeadbc6a75..0e07544648 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanLoadReport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanLoadReport.vue @@ -4,11 +4,19 @@ - - + + + - - + + + @@ -22,17 +30,21 @@ import TestPlanReportContainer import LoadFailureResult from "@/business/components/track/plan/view/comonents/report/detail/component/LoadFailureResult"; import LoadAllResult from "@/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult"; +import TabPaneCount from "@/business/components/track/plan/view/comonents/report/detail/component/TabPaneCount"; export default { name: "TestPlanLoadReport", components: { + TabPaneCount, LoadAllResult, LoadFailureResult, TestPlanReportContainer, LoadResult, MsFormDivider}, data() { return { - activeName: 'first' + activeName: 'first', + failureSize: 0, + allSize: 0, }; }, props: [ @@ -78,6 +90,12 @@ export default { this.activeName = 'third'; } }, + setFailureSize(size) { + this.failureSize = size; + }, + setAllSize(size) { + this.allSize = size; + }, handleClick(tab, event) { } } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue index 8aff7f3a27..62a6bdf023 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue @@ -197,4 +197,9 @@ export default { padding-top: 15px; } +/deep/ .empty { + text-align: center; + width: 100%; + padding: 40px; +} diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue index b1c172e3a9..47f649c04a 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue @@ -48,9 +48,10 @@ - - + + +
内容为空
@@ -90,7 +91,14 @@ export default { apiCases: [], result: {}, response: {}, - showResponse: true + showResponse: false + } + }, + watch: { + apiCases() { + if (this.apiCases) { + this.$emit('setSize', this.apiCases.length); + } } }, mounted() { @@ -104,61 +112,47 @@ export default { } else { this.apiCases = this.report.apiFailureCases; } - this.handleDefaultClick(); } else if (this.isShare) { if (this.isAll) { this.result = getSharePlanApiAllCase(this.shareId, this.planId, (data) => { this.apiCases = data; - this.handleDefaultClick(); }); } else { this.result = getSharePlanApiFailureCase(this.shareId, this.planId, (data) => { this.apiCases = data; - this.handleDefaultClick(); }); } } else { if (this.isAll) { this.result = getPlanApiAllCase(this.planId, (data) => { this.apiCases = data; - this.handleDefaultClick(); }); } else { this.result = getPlanApiFailureCase(this.planId, (data) => { this.apiCases = data; - this.handleDefaultClick(); }); } } }, - handleDefaultClick() { - let data = this.apiCases; - if (data && data.length > 0) { - this.rowClick(data[0]); - } - }, rowClick(row) { - this.showResponse = true; + this.showResponse = false; if (this.isTemplate) { - if (!row.response) { - this.showResponse = false; - } else { + if (row.response) { + this.showResponse = true; this.response = JSON.parse(row.response); } } else if (this.isShare) { getShareApiReport(this.shareId, row.id, (data) => { - if (!data || !data.content) { - this.showResponse = false; - } else { + if (data && data.content) { + this.showResponse = true; this.response = JSON.parse(data.content); } }); } else { // todo getApiReport(row.id, (data) => { - if (!data || !data.content) { - this.showResponse = false; - } else { + if (data && data.content) { + this.showResponse = true; this.response = JSON.parse(data.content); } }); 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 4a7d646b29..a8e9b19bf3 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,11 +1,19 @@