fix: 保存报告打开重新加载

This commit is contained in:
chenjianxing 2021-08-26 18:14:46 +08:00 committed by jianxing
parent 0675e591e3
commit 41d308493b
8 changed files with 28 additions and 20 deletions

View File

@ -110,9 +110,9 @@ export default {
getScenarioApiCase() {
if (this.isTemplate || this.isDb) {
if (this.isAll) {
this.apiCases = this.report.apiAllCases;
this.apiCases = this.report.apiAllCases ? this.report.apiAllCases : [];
} else {
this.apiCases = this.report.apiFailureCases;
this.apiCases = this.report.apiFailureCases ? this.report.apiFailureCases : [];
}
} else if (this.isShare) {
if (this.isAll) {

View File

@ -106,9 +106,9 @@ export default {
getScenarioApiCase() {
if (this.isTemplate || this.isDb) {
if (this.isAll) {
this.scenarioCases = this.report.scenarioAllCases;
this.scenarioCases = this.report.scenarioAllCases ? this.report.scenarioAllCases : [];
} else {
this.scenarioCases = this.report.scenarioFailureCases;
this.scenarioCases = this.report.scenarioFailureCases ? this.report.scenarioFailureCases : [];
}
} else if (this.isShare) {
if (this.isAll) {

View File

@ -106,9 +106,9 @@ export default {
getFunctionalTestCase() {
if (this.isTemplate || this.isDb) {
if (this.isAll) {
this.testCases = this.report.functionAllCases;
this.testCases = this.report.functionAllCases ? this.report.functionAllCases : [];
} else {
this.testCases = this.report.functionFailureCases;
this.testCases = this.report.functionFailureCases ? this.report.functionFailureCases : [];
}
} else if (this.isShare) {
if (this.isAll) {

View File

@ -87,7 +87,7 @@ export default {
methods: {
getIssues() {
if (this.isTemplate || this.isDb) {
this.data = this.report.issueList;
this.data = this.report.issueList ? this.report.issueList : [];
} else if (this.isShare) {
this.result = getShareIssuesByPlanId(this.shareId, this.planId, (data) => {
this.data = data;

View File

@ -88,9 +88,9 @@ export default {
getFailureTestCase() {
if (this.isTemplate || this.isDb) {
if (this.isAll) {
this.loadTestCases = this.report.loadAllCases;
this.loadTestCases = this.report.loadAllCases ? this.report.loadAllCases : [];
} else {
this.loadTestCases = this.report.loadFailureCases;
this.loadTestCases = this.report.loadFailureCases ? this.report.loadFailureCases : [];
}
} else if (this.isShare) {
if (this.isAll) {

View File

@ -23,7 +23,7 @@
</el-row>
<el-scrollbar>
<div class="container">
<test-plan-report-content :is-db="true" :report-id="report.id" :plan-id="report.testPlanId"/>
<test-plan-report-content v-if="showReport" :is-db="true" :report-id="report.id" :plan-id="report.testPlanId"/>
</div>
</el-scrollbar>
</template>
@ -43,7 +43,8 @@ export default {
result: {},
showDialog: false,
report: {},
isTestManagerOrTestUser: false
isTestManagerOrTestUser: false,
showReport: false
}
},
mounted() {
@ -61,7 +62,12 @@ export default {
// this.handleClose();
// },
open(report) {
this.showReport = false;
//
this.$nextTick(() => {
this.showReport = true;
this.report = report;
});
this.showDialog = true;
// this.listenGoBack();
},

View File

@ -23,7 +23,7 @@
</el-row>
<el-scrollbar>
<div class="container">
<test-plan-report-content :plan-id="plan.id"/>
<test-plan-report-content v-if="showReport" :plan-id="plan.id"/>
</div>
</el-scrollbar>
</template>
@ -43,7 +43,8 @@ export default {
result: {},
showDialog: false,
plan: {},
isTestManagerOrTestUser: false
isTestManagerOrTestUser: false,
showReport: false
}
},
mounted() {
@ -61,9 +62,10 @@ export default {
// this.handleClose();
// },
open(plan) {
this.showReport = false;
//
this.plan = {id: null}
this.$nextTick(() => {
this.showReport = true;
this.plan = plan;
});
this.showDialog = true;

View File

@ -71,10 +71,10 @@ export function getSharePerformanceReportResponseCodeChart(shareId, reportId, ca
}
export function getPerformanceReportDetailContent(reportKey, reportId, callback) {
return reportId ? baseGet('/performance/report/content/' + reportKey + '/' + reportId, callback) : new Promise(()=>{});
return reportId ? baseGet('/performance/report/content/' + reportKey + '/' + reportId, callback) : new Promise(() => {});
}
export function getSharePerformanceReportDetailContent(shareId, reportKey, reportId, callback) {
return reportId ? baseGet('/share/performance/report/content/' + shareId + '/' + reportKey + '/' + reportId, callback) : new Promise(()=>{});
return reportId ? baseGet('/share/performance/report/content/' + shareId + '/' + reportKey + '/' + reportId, callback) : new Promise(() => {});
}
export function getPerformanceReportContent(reportId, callback) {
@ -113,15 +113,15 @@ export function getSharePerformanceReportLogResourceDetail(shareId, reportId, re
}
export function getPerformanceMetricQueryResource(resourceId, callback) {
return resourceId ? baseGet('/metric/query/resource/' + resourceId, callback) : new Promise(()=>{});
return resourceId ? baseGet('/metric/query/resource/' + resourceId, callback) : new Promise(() => {});
}
export function getSharePerformanceMetricQueryResource(shareId, resourceId, callback) {
return resourceId ? baseGet('/share/metric/query/resource/' + shareId + '/' + resourceId, callback) : new Promise(()=>{});
return resourceId ? baseGet('/share/metric/query/resource/' + shareId + '/' + resourceId, callback) : new Promise(() => {});
}
export function getPerformanceMetricQuery(resourceId, callback) {
return resourceId ? baseGet('/metric/query/' + resourceId, callback) : {};
}
export function getSharePerformanceMetricQuery(shareId, resourceId, callback) {
return resourceId ? baseGet('/share/metric/query/' + shareId + '/' + resourceId, callback) : new Promise(()=>{});
return resourceId ? baseGet('/share/metric/query/' + shareId + '/' + resourceId, callback) : new Promise(() => {});
}