|
@@ -12,18 +12,27 @@ const useTagsViewStore = defineStore(
|
|
|
this.addCachedView(view)
|
|
|
},
|
|
|
addIframeView(view) {
|
|
|
- if (this.iframeViews.some(v => v.path === view.path)) return
|
|
|
+ console.log(view,123123)
|
|
|
+ if (this.iframeViews.some(v => v.fullPath === view.fullPath)) return
|
|
|
+ let title = view.meta.title || 'no-name'
|
|
|
+ if(view.path == '/platform_manage/process/processApproval') {
|
|
|
+ title = view.query.processType == 10 ? '审批' : view.query.processType == 20 ? '查看' : '发起'
|
|
|
+ }
|
|
|
this.iframeViews.push(
|
|
|
Object.assign({}, view, {
|
|
|
- title: view.meta.title || 'no-name'
|
|
|
+ title: title
|
|
|
})
|
|
|
)
|
|
|
},
|
|
|
addVisitedView(view) {
|
|
|
- if (this.visitedViews.some(v => v.path === view.path)) return
|
|
|
+ if (this.visitedViews.some(v => v.fullPath === view.fullPath)) return
|
|
|
+ let title = view.meta.title || 'no-name'
|
|
|
+ if(view.path == '/platform_manage/process/processApproval') {
|
|
|
+ title = view.query.processType == 10 ? '审批' : view.query.processType == 20 ? '查看' : '发起'
|
|
|
+ }
|
|
|
this.visitedViews.push(
|
|
|
Object.assign({}, view, {
|
|
|
- title: view.meta.title || 'no-name'
|
|
|
+ title: title
|
|
|
})
|
|
|
)
|
|
|
},
|
|
@@ -47,18 +56,18 @@ const useTagsViewStore = defineStore(
|
|
|
delVisitedView(view) {
|
|
|
return new Promise(resolve => {
|
|
|
for (const [i, v] of this.visitedViews.entries()) {
|
|
|
- if (v.path === view.path) {
|
|
|
+ if (v.fullPath === view.fullPath) {
|
|
|
this.visitedViews.splice(i, 1)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- this.iframeViews = this.iframeViews.filter(item => item.path !== view.path)
|
|
|
+ this.iframeViews = this.iframeViews.filter(item => item.fullPath !== view.fullPath)
|
|
|
resolve([...this.visitedViews])
|
|
|
})
|
|
|
},
|
|
|
delIframeView(view) {
|
|
|
return new Promise(resolve => {
|
|
|
- this.iframeViews = this.iframeViews.filter(item => item.path !== view.path)
|
|
|
+ this.iframeViews = this.iframeViews.filter(item => item.fullPath !== view.fullPath)
|
|
|
resolve([...this.iframeViews])
|
|
|
})
|
|
|
},
|
|
@@ -82,9 +91,9 @@ const useTagsViewStore = defineStore(
|
|
|
delOthersVisitedViews(view) {
|
|
|
return new Promise(resolve => {
|
|
|
this.visitedViews = this.visitedViews.filter(v => {
|
|
|
- return v.meta.affix || v.path === view.path
|
|
|
+ return v.meta.affix || v.fullPath === view.fullPath
|
|
|
})
|
|
|
- this.iframeViews = this.iframeViews.filter(item => item.path === view.path)
|
|
|
+ this.iframeViews = this.iframeViews.filter(item => item.fullPath === view.fullPath)
|
|
|
resolve([...this.visitedViews])
|
|
|
})
|
|
|
},
|
|
@@ -125,7 +134,7 @@ const useTagsViewStore = defineStore(
|
|
|
},
|
|
|
updateVisitedView(view) {
|
|
|
for (let v of this.visitedViews) {
|
|
|
- if (v.path === view.path) {
|
|
|
+ if (v.fullPath === view.fullPath) {
|
|
|
v = Object.assign(v, view)
|
|
|
break
|
|
|
}
|
|
@@ -133,7 +142,7 @@ const useTagsViewStore = defineStore(
|
|
|
},
|
|
|
delRightTags(view) {
|
|
|
return new Promise(resolve => {
|
|
|
- const index = this.visitedViews.findIndex(v => v.path === view.path)
|
|
|
+ const index = this.visitedViews.findIndex(v => v.fullPath === view.fullPath)
|
|
|
if (index === -1) {
|
|
|
return
|
|
|
}
|
|
@@ -146,7 +155,7 @@ const useTagsViewStore = defineStore(
|
|
|
this.cachedViews.splice(i, 1)
|
|
|
}
|
|
|
if(item.meta.link) {
|
|
|
- const fi = this.iframeViews.findIndex(v => v.path === item.path)
|
|
|
+ const fi = this.iframeViews.findIndex(v => v.fullPath === item.fullPath)
|
|
|
this.iframeViews.splice(fi, 1)
|
|
|
}
|
|
|
return false
|
|
@@ -156,7 +165,7 @@ const useTagsViewStore = defineStore(
|
|
|
},
|
|
|
delLeftTags(view) {
|
|
|
return new Promise(resolve => {
|
|
|
- const index = this.visitedViews.findIndex(v => v.path === view.path)
|
|
|
+ const index = this.visitedViews.findIndex(v => v.fullPath === view.fullPath)
|
|
|
if (index === -1) {
|
|
|
return
|
|
|
}
|
|
@@ -169,7 +178,7 @@ const useTagsViewStore = defineStore(
|
|
|
this.cachedViews.splice(i, 1)
|
|
|
}
|
|
|
if(item.meta.link) {
|
|
|
- const fi = this.iframeViews.findIndex(v => v.path === item.path)
|
|
|
+ const fi = this.iframeViews.findIndex(v => v.fullPath === item.fullPath)
|
|
|
this.iframeViews.splice(fi, 1)
|
|
|
}
|
|
|
return false
|