@@ -100,36 +100,55 @@ export default {
100100 sessionStorage .setItem (' historys' , JSON .stringify (this .historys ))
101101 },
102102 closeLeft () {
103+ let right
103104 const rightIndex = this .historys .findIndex (
104- item => item .name == this .rightActive
105+ item => {
106+ if (item .name == this .rightActive ){
107+ right = item
108+ }
109+ return item .name == this .rightActive
110+ }
105111 )
106112 const activeIndex = this .historys .findIndex (
107113 item => item .name == this .activeValue
108114 )
109115 this .historys .splice (0 , rightIndex)
110116 if (rightIndex > activeIndex) {
111- this .$router .push ({ name : this . rightActive } )
117+ this .$router .push (right )
112118 }
113119 sessionStorage .setItem (' historys' , JSON .stringify (this .historys ))
114120 },
115121 closeRight () {
122+ let right
116123 const leftIndex = this .historys .findIndex (
117- item => item .name == this .rightActive
124+ item => {
125+ if (item .name == this .rightActive ){
126+ right = item
127+ }
128+ return item .name == this .rightActive
129+ }
118130 )
119131 const activeIndex = this .historys .findIndex (
120132 item => item .name == this .activeValue
121133 )
122134 this .historys .splice (leftIndex + 1 , this .historys .length )
123135 if (leftIndex < activeIndex) {
124- this .$router .push ({ name : this . rightActive } )
136+ this .$router .push (right )
125137 }
126138 sessionStorage .setItem (' historys' , JSON .stringify (this .historys ))
127139 },
128140 closeOther () {
141+ let right
129142 this .historys = this .historys .filter (
130- item => item .name == this .rightActive
143+ item => {
144+ if (item .name == this .rightActive ){
145+ right = item
146+ }
147+ return item .name == this .rightActive
148+ }
131149 )
132- this .$router .push ({ name: this .rightActive })
150+ console .log (right)
151+ this .$router .push (right)
133152 sessionStorage .setItem (' historys' , JSON .stringify (this .historys ))
134153 },
135154 setTab (route ) {
@@ -154,9 +173,9 @@ export default {
154173 this .$router .push ({ name: ' dashboard' })
155174 } else {
156175 if (index < this .historys .length - 1 ) {
157- this .$router .push ({ name: this .historys [index + 1 ].name })
176+ this .$router .push ({ name: this .historys [index + 1 ].name ,query : this . historys [index + 1 ]. query ,params : this . historys [index + 1 ]. params })
158177 } else {
159- this .$router .push ({ name: this .historys [index - 1 ].name })
178+ this .$router .push ({ name: this .historys [index - 1 ].name ,query : this . historys [index - 1 ]. query ,params : this . historys [index - 1 ]. params })
160179 }
161180 }
162181 }
0 commit comments