[vue] Update report id in the url on report tree click
@@ -137,9 +137,27 @@ export default {
}));
},
+ updateUrl() {
+ const reportId = this.report.reportId.toString();
+ const currentReportId = this.$router.currentRoute.query["reportId"];
+ if (reportId !== currentReportId) {
+ this.$router.replace({
+ query: {
+ ...this.$route.query,
+ "reportId": reportId
+ }
+ }).catch(() => {});
+ }
+ },
+
onReportTreeClick(item) {
if (!item) return;
+ if (item.report) {
+ this.report = item.report;
+ this.updateUrl();
+ }
+
this.treeItem = item;
}
}
