fix(性能测试): 修复报告对比时页面缓存的问题

This commit is contained in:
Captain.B 2021-04-07 17:34:17 +08:00 committed by 刘瑞斌
parent 9f2d0187e2
commit 41ca21f90c
1 changed files with 25 additions and 27 deletions

View File

@ -317,19 +317,13 @@ export default {
}, },
compareReports() { compareReports() {
this.$refs.compareReports.open(this.report); this.$refs.compareReports.open(this.report);
}
}, },
created() { getReport(reportId) {
this.isReadOnly = false; this.result = this.$get("/performance/report/" + reportId, res => {
if (!checkoutTestManagerOrTestUser()) {
this.isReadOnly = true;
}
this.reportId = this.$route.path.split('/')[4];
this.result = this.$get("/performance/report/" + this.reportId, res => {
let data = res.data; let data = res.data;
if (data) { if (data) {
this.status = data.status; this.status = data.status;
this.$set(this.report, "id", this.reportId); this.$set(this.report, "id", data.id);
this.$set(this.report, "status", data.status); this.$set(this.report, "status", data.status);
this.$set(this.report, "testId", data.testId); this.$set(this.report, "testId", data.testId);
this.$set(this.report, "name", data.name); this.$set(this.report, "name", data.name);
@ -345,7 +339,15 @@ export default {
this.$error(this.$t('report.not_exist')) this.$error(this.$t('report.not_exist'))
} }
}); });
}
},
created() {
this.isReadOnly = false;
if (!checkoutTestManagerOrTestUser()) {
this.isReadOnly = true;
}
this.reportId = this.$route.path.split('/')[4];
this.getReport(this.reportId);
}, },
watch: { watch: {
'$route'(to) { '$route'(to) {
@ -354,14 +356,10 @@ export default {
if (!checkoutTestManagerOrTestUser()) { if (!checkoutTestManagerOrTestUser()) {
this.isReadOnly = true; this.isReadOnly = true;
} }
let reportId = to.path.split('/')[4]; this.reportId = to.path.split('/')[4];
this.reportId = reportId; this.getReport(this.reportId);
this.initBreadcrumb((response) => { this.initBreadcrumb((response) => {
let data = response.data; let data = response.data;
this.$set(this.report, "id", reportId);
this.$set(this.report, "status", data.status);
this.checkReportStatus(data.status); this.checkReportStatus(data.status);
this.initReportTimeInfo(); this.initReportTimeInfo();
}); });