fix: 场景报告删除后列表查看结果报错

This commit is contained in:
chenjianxing 2021-09-27 12:02:42 +08:00 committed by jianxing
parent e60dc78e94
commit cb9bb38b3a
3 changed files with 13 additions and 6 deletions

View File

@ -288,16 +288,23 @@ export default {
this.buildReport();
} else if (this.isShare) {
getShareScenarioReport(this.shareId, this.reportId, (data) => {
this.report = data || {};
this.buildReport();
this.handleGetScenarioReport(data);
});
} else {
getScenarioReport(this.reportId, (data) => {
this.report = data || {};
this.buildReport();
this.handleGetScenarioReport(data);
});
}
},
handleGetScenarioReport(data) {
if (data) {
this.report = data;
this.buildReport();
} else {
this.$emit('invisible');
this.$warning('报告已删除');
}
},
buildReport() {
if (this.report) {
if (this.isNotRunning) {

View File

@ -220,7 +220,7 @@
<el-drawer :visible.sync="showReportVisible" :destroy-on-close="true" direction="ltr" :withHeader="true"
:modal="false"
size="90%">
<ms-api-report-detail @refresh="search" :infoDb="infoDb" :report-id="showReportId" :currentProjectId="projectId"/>
<ms-api-report-detail @invisible="showReportVisible = false" @refresh="search" :infoDb="infoDb" :report-id="showReportId" :currentProjectId="projectId"/>
</el-drawer>
<!--测试计划-->
<el-drawer :visible.sync="planVisible" :destroy-on-close="true" direction="ltr" :withHeader="false"

View File

@ -157,7 +157,7 @@
<!-- 执行结果 -->
<el-drawer :visible.sync="runVisible" :destroy-on-close="true" direction="ltr" :withHeader="true" :modal="false"
size="90%">
<ms-api-report-detail @refresh="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId"/>
<ms-api-report-detail @invisible="runVisible = false" @refresh="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId"/>
</el-drawer>
</div>
</el-card>