|
@@ -59,6 +59,7 @@ import { getToken, removeToken } from '../api/auth'
|
|
|
import {apiPostremoveByToken, apiGetMenuData} from '../api/api'
|
|
|
export default {
|
|
|
components: {MenuTree},
|
|
|
+ inject: ['reload'],
|
|
|
data() {
|
|
|
return {
|
|
|
forecastDatas: [],
|
|
@@ -336,14 +337,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleNodeClick(index, indexPath) {
|
|
|
- let tagsArr = []
|
|
|
if (indexPath) {
|
|
|
this.forecastDatas.forEach(it =>{
|
|
|
if (it.index !== '') {
|
|
|
if (it.index === indexPath[0]) {
|
|
|
if (!it.children) {
|
|
|
let showM = 0
|
|
|
- tagsArr.forEach(item =>{
|
|
|
+ this.routeTags.forEach(item =>{
|
|
|
if (item.name === it.name) {
|
|
|
showM++
|
|
|
}
|
|
@@ -353,20 +353,20 @@ export default {
|
|
|
index: it.index,
|
|
|
name: it.name
|
|
|
}
|
|
|
- tagsArr.push(obj)
|
|
|
+ this.routeTags.push(obj)
|
|
|
}
|
|
|
} else {
|
|
|
it.children.forEach(iv =>{
|
|
|
if (iv.index !== '') {
|
|
|
if (iv.index === indexPath[1]) {
|
|
|
let showM = 0
|
|
|
- tagsArr.forEach(item =>{
|
|
|
+ this.routeTags.forEach(item =>{
|
|
|
if (item.name === iv.name) {
|
|
|
showM++
|
|
|
}
|
|
|
})
|
|
|
if (showM === 0) {
|
|
|
- tagsArr.push(iv)
|
|
|
+ this.routeTags.push(iv)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -375,9 +375,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- this.routeTags = tagsArr.concat(this.routeTags)
|
|
|
window.sessionStorage.setItem('routeTags', JSON.stringify(this.routeTags))
|
|
|
}
|
|
|
+ this.$nextTick(() =>{
|
|
|
+ this.reload()
|
|
|
+ })
|
|
|
},
|
|
|
handleClose(tag) {
|
|
|
if (this.routeTags.length > 1) {
|