-
+
@@ -18,7 +18,10 @@
pageList: [],
linkList: [],
activePage: '',
- multiPage: true,
+ multiPage: true,
+ ignoreParamPath: [
+ "/data/export",
+ ],
}
},
computed: {
@@ -27,20 +30,24 @@
}
},
created() {
- this.pageList.push(this.$route);
- this.linkList.push(this.$route.fullPath);
- this.activePage = this.$route.fullPath;
- },
- watch: {
- '$route': function (newRoute, oldRoute) {
- this.activePage = newRoute.fullPath;
- if (this.linkList.indexOf(newRoute.fullPath) < 0) {
- this.linkList.push(newRoute.fullPath);
- this.pageList.push(newRoute);
+ this.pageList.push(this.$route);
+ let activePage = this.getRouteRealPath(this.$route);
+ this.linkList.push(activePage);
+ this.activePage = activePage;
+ },
+ watch: {
+ '$route': function (newRoute, oldRoute) {
+ let activePage = this.getRouteRealPath(newRoute);
+ this.activePage = activePage;
+ if (this.linkList.indexOf(activePage) < 0) {
+ this.linkList.push(activePage);
+ this.pageList.push(newRoute);
}
},
'activePage': function (key) {
- this.$router.push(key)
+ if (!this.isIgnoreParamPath(key)) {
+ this.$router.push(key);
+ }
},
},
methods: {
@@ -49,6 +56,12 @@
},
loadDatasourceList() {
this.$emit('loadDatasourceList');
+ },
+ isIgnoreParamPath(path) {
+ return this.ignoreParamPath.indexOf(path) >= 0;
+ },
+ getRouteRealPath(route) {
+ return this.isIgnoreParamPath(route.path) ? route.path : route.fullPath;
},
changePage(key) {
this.activePage = key.name;
@@ -61,7 +74,7 @@
this.$message.warning('这是最后一页,不能再关闭了啦');
return
}
- this.pageList = this.pageList.filter(item => item.fullPath !== key);
+ this.pageList = this.pageList.filter(item => this.getRouteRealPath(item) !== key);
let index = this.linkList.indexOf(key);
this.linkList = this.linkList.filter(item => item !== key);
index = index >= this.linkList.length ? this.linkList.length - 1 : index;
diff --git a/zyplayer-doc-ui/db-ui/src/views/data/Export.vue b/zyplayer-doc-ui/db-ui/src/views/data/Export.vue
index 9471c23e..22d9a7a1 100644
--- a/zyplayer-doc-ui/db-ui/src/views/data/Export.vue
+++ b/zyplayer-doc-ui/db-ui/src/views/data/Export.vue
@@ -87,7 +87,6 @@
downloadFileType: 1,
exportTypeChoiceVisible: false,
// 页面展示相关
- nowDatasourceShow: {},
databaseList: [],
tableList: [],
selectTables: [],
@@ -99,14 +98,30 @@
downloadType: 'insert',
dropTableFlag: 0,
createTableFlag: 0,
- }
- },
- mounted: function () {
- this.loadDatasourceList();
- },
+ }
+ },
+ activated() {
+ this.initQueryParam(this.$route);
+ },
+ mounted() {
+ this.loadDatasourceList();
+ },
methods: {
- datasourceChangeEvents() {
- this.nowDatasourceShow = this.choiceDatasourceId;
+ initQueryParam(to) {
+ let queryParam = to.query;
+ let sourceId = parseInt(queryParam.sourceId);
+ if (!sourceId || !queryParam.dbName) {
+ return;
+ }
+ if (this.choiceDatasourceId === sourceId && this.choiceDatabase === queryParam.dbName) {
+ return;
+ }
+ this.choiceDatasourceId = sourceId;
+ this.choiceDatabase = queryParam.dbName;
+ this.datasourceChangeEvents();
+ this.databaseChangeEvents();
+ },
+ datasourceChangeEvents() {
this.loadDatabaseList(this.choiceDatasourceId);
},
databaseChangeEvents() {
diff --git a/zyplayer-doc-ui/db-ui/src/views/table/Info.vue b/zyplayer-doc-ui/db-ui/src/views/table/Info.vue
index e916cca4..0cd5e24d 100644
--- a/zyplayer-doc-ui/db-ui/src/views/table/Info.vue
+++ b/zyplayer-doc-ui/db-ui/src/views/table/Info.vue
@@ -162,7 +162,7 @@
});
}, 500);
},
- activated: function () {
+ activated() {
this.initQueryParam(this.$route);
},
components: {