diff --git a/frontend/src/business/components/performance/report/PerformanceReportCompare.vue b/frontend/src/business/components/performance/report/PerformanceReportCompare.vue
index 3193c0c973..5e80cfa5e2 100644
--- a/frontend/src/business/components/performance/report/PerformanceReportCompare.vue
+++ b/frontend/src/business/components/performance/report/PerformanceReportCompare.vue
@@ -1,9 +1,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -12,15 +24,16 @@
import MsContainer from "@/business/components/common/components/MsContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
+import OverviewCompareCard from "@/business/components/performance/report/components/OverviewCompareCard";
+import MsChart from "@/business/components/common/chart/MsChart";
+import LoadCompareCard from "@/business/components/performance/report/components/LoadCompareCard";
+import ResponseTimeCompareCard from "@/business/components/performance/report/components/ResponseTimeCompareCard";
export default {
name: "PerformanceReportCompare",
- components: {MsMainContainer, MsContainer},
+ components: {ResponseTimeCompareCard, LoadCompareCard, MsChart, OverviewCompareCard, MsMainContainer, MsContainer},
mounted() {
- let reportId = this.$route.path.split('/')[4];
- console.log(reportId);
- let items = localStorage.getItem("compareReportIds");
- console.log(JSON.parse(items));
+ this.init();
},
computed: {
isReadOnly() {
@@ -30,11 +43,28 @@ export default {
data() {
return {}
},
- methods: {}
+ methods: {
+ init() {
+ this.$refs.overviewCard.initTable();
+ this.$refs.loadCard.initCard();
+ this.$refs.responseTimeCard.initCard();
+ }
+ },
+ watch: {
+ '$route'(to) {
+ if (to.name !== "ReportCompare") {
+ return;
+ }
+ this.init();
+ }
+ }
}
diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue
index c496eb8646..d7934bc6b2 100644
--- a/frontend/src/business/components/performance/report/PerformanceReportView.vue
+++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue
@@ -332,6 +332,8 @@ export default {
this.$set(this.report, "id", this.reportId);
this.$set(this.report, "status", data.status);
this.$set(this.report, "testId", data.testId);
+ this.$set(this.report, "name", data.name);
+ this.$set(this.report, "createTime", data.createTime);
this.$set(this.report, "loadConfiguration", data.loadConfiguration);
this.checkReportStatus(data.status);
if (this.status === "Completed" || this.status === "Running") {
diff --git a/frontend/src/business/components/performance/report/components/LoadCompareCard.vue b/frontend/src/business/components/performance/report/components/LoadCompareCard.vue
new file mode 100644
index 0000000000..8cba2a523f
--- /dev/null
+++ b/frontend/src/business/components/performance/report/components/LoadCompareCard.vue
@@ -0,0 +1,182 @@
+
+
+
+ Load
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/business/components/performance/report/components/OverviewCompareCard.vue b/frontend/src/business/components/performance/report/components/OverviewCompareCard.vue
new file mode 100644
index 0000000000..18298b9967
--- /dev/null
+++ b/frontend/src/business/components/performance/report/components/OverviewCompareCard.vue
@@ -0,0 +1,67 @@
+
+
+
+ Overview
+
+
+
+
+
+ {{ scope.row.createTime | timestampFormatDate }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/business/components/performance/report/components/ResponseTimeCompareCard.vue b/frontend/src/business/components/performance/report/components/ResponseTimeCompareCard.vue
new file mode 100644
index 0000000000..1f48b5ea2c
--- /dev/null
+++ b/frontend/src/business/components/performance/report/components/ResponseTimeCompareCard.vue
@@ -0,0 +1,188 @@
+
+
+
+ Response Time
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/business/components/performance/report/components/SameTestReports.vue b/frontend/src/business/components/performance/report/components/SameTestReports.vue
index 6e203f66fb..216ab7d1da 100644
--- a/frontend/src/business/components/performance/report/components/SameTestReports.vue
+++ b/frontend/src/business/components/performance/report/components/SameTestReports.vue
@@ -5,20 +5,23 @@
:visible.sync="loadReportVisible">
+ prop="name"
+ :label="$t('commons.name')"
+ show-overflow-tooltip>
+
+ {{ scope.row.name }}
+
+ prop="userName"
+ :label="$t('report.user_name')"
+ show-overflow-tooltip>
@@ -27,7 +30,7 @@
+ :label="$t('commons.create_time')">
{{ scope.row.createTime | timestampFormatDate }}
@@ -55,46 +58,56 @@ export default {
return {
loadReportVisible: false,
reportLoadingResult: {},
- compareReports: [],
+ tableData: [],
currentPage: 1,
pageSize: 10,
total: 0,
selectIds: new Set,
+ report: {},
+ compareReports: [],
}
},
methods: {
open(report) {
- this.getCompareReports(report.testId);
+ this.report = report;
+ this.getCompareReports(report);
+
+ this.compareReports.push(report);
+
this.loadReportVisible = true;
},
close() {
this.loadReportVisible = false;
},
- getCompareReports(testId) {
+ getCompareReports(report) {
let condition = {
- testId: testId,
+ testId: report.testId,
filters: {status: ["Completed"]}
};
this.reportLoadingResult = this.$post('/performance/report/list/all/' + this.currentPage + "/" + this.pageSize, condition, res => {
let data = res.data;
this.total = data.itemCount;
- this.compareReports = data.listObject;
+ this.tableData = data.listObject;
})
},
handleCompare() {
let reportIds = [...this.selectIds];
- localStorage.setItem("compareReportIds", JSON.stringify(reportIds));
+ this.tableData
+ .filter(r => reportIds.indexOf(r.id) > -1 && this.report.id !== r.id)
+ .forEach(r => this.compareReports.push(r));
+
+ localStorage.setItem("compareReports", JSON.stringify(this.compareReports));
this.close();
this.$router.push({path: '/performance/report/compare/' + reportIds[0]});
},
handleSelectAll(selection) {
if (selection.length > 0) {
- this.compareReports.forEach(item => {
+ this.tableData.forEach(item => {
this.selectIds.add(item.id);
});
} else {
- this.compareReports.forEach(item => {
+ this.tableData.forEach(item => {
if (this.selectIds.has(item.id)) {
this.selectIds.delete(item.id);
}