Commit b798852a authored by 高宇's avatar 高宇

关闭标签页清除

parent ef5ddcd0
...@@ -150,13 +150,15 @@ export default { ...@@ -150,13 +150,15 @@ export default {
}) })
}, },
closeSelectedTag(view) { closeSelectedTag(view) {
// 关闭标签页清除存储的筛选条件数据
this.$store.dispatch('searchSave/clearOneParams',this.$route.path)
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
if (this.isActive(view)) { if (this.isActive(view)) {
this.toLastView(visitedViews, view) this.toLastView(visitedViews, view)
} }
if (view.path === '/processManagement/deviceReuse') { // if (view.path === '/processManagement/deviceReuse') {
if (sessionStorage.getItem('recycleform') !== null) { sessionStorage.removeItem('recycleform') } // if (sessionStorage.getItem('recycleform') !== null) { sessionStorage.removeItem('recycleform') }
} // }
}) })
}, },
closeOthersTags() { closeOthersTags() {
......
...@@ -18,7 +18,8 @@ const mutations = { ...@@ -18,7 +18,8 @@ const mutations = {
state.searchParams = {} state.searchParams = {}
}, },
CLEAR_ONE_PARAMS: (state, path) => { CLEAR_ONE_PARAMS: (state, path) => {
path && state.searchParams[path] && delete state.searchParams[path] // path && state.searchParams[path] && delete state.searchParams[path]
state.searchParams[path] = ''
} }
} }
...@@ -32,7 +33,10 @@ const actions = { ...@@ -32,7 +33,10 @@ const actions = {
commit('RSET_SEARCH_PARAMS') commit('RSET_SEARCH_PARAMS')
}, },
clearOneParams({ commit }, path) { clearOneParams({ commit }, path) {
commit('CLEAR_ONE_PARAMS', path) // 延时清除缓存数据,防止路由离开前重新赋值
setTimeout(() => {
commit('CLEAR_ONE_PARAMS', path)
}, 2000)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment