|
@@ -109,14 +109,21 @@ export default {
|
|
|
},
|
|
|
syncTagViewAndSaveForm() {
|
|
|
const keys = this.$store.state.tagsView.visitedViews.map(
|
|
|
- (item) => item.path
|
|
|
+ (item) => {
|
|
|
+ // console.log(item)
|
|
|
+ return item.path}
|
|
|
);
|
|
|
const searchs = new Searchs();
|
|
|
const allSearch = searchs.getSearchs();
|
|
|
+ console.log(allSearch)
|
|
|
const sks = Object.keys(allSearch);
|
|
|
+
|
|
|
let route = this.$route;
|
|
|
for (const item of sks) {
|
|
|
+ console.log(keys,item)
|
|
|
+ console.log( allSearch[item].bind)
|
|
|
if (!(keys.includes(item) || keys.includes(allSearch[item].bind))) {
|
|
|
+ console.log(item,'删除前')
|
|
|
searchs.removeByKey(item);
|
|
|
}
|
|
|
|
|
@@ -140,6 +147,7 @@ export default {
|
|
|
}
|
|
|
// console.log(this.$route)
|
|
|
await this.$store.dispatch("addVisitedViews", route);
|
|
|
+
|
|
|
this.syncTagViewAndSaveForm();
|
|
|
},
|
|
|
moveToCurrentTag() {
|
|
@@ -193,18 +201,18 @@ export default {
|
|
|
closeMenu() {
|
|
|
this.visible = false;
|
|
|
},
|
|
|
- changeTag(tag) {
|
|
|
- console.log(tag);
|
|
|
- activeKey = this.getSearchsByRealPath(tag);
|
|
|
+ async changeTag(tag) {
|
|
|
+ activeKey = await this.getSearchsByRealPath(tag);
|
|
|
},
|
|
|
getSearchsByRealPath(tag) {
|
|
|
const searchs = new Searchs();
|
|
|
let keyName = "";
|
|
|
|
|
|
- console.log(searchs.searchs);
|
|
|
+
|
|
|
for (const key in searchs.searchs) {
|
|
|
if (Object.hasOwnProperty.call(searchs.searchs, key)) {
|
|
|
const item = searchs.searchs[key];
|
|
|
+
|
|
|
if (tag.path === key || item.bind === tag.path) {
|
|
|
keyName = item.bind || tag.path;
|
|
|
}
|