Commit 11b567e0 by YoMon

修改

parent 844b0d17
...@@ -163,13 +163,13 @@ export default { ...@@ -163,13 +163,13 @@ export default {
this.$router.push({ this.$router.push({
path: '/' path: '/'
}) })
console.log(this.$store.state.tagsView.visitedViews) // console.log(this.$store.state.tagsView.visitedViews)
}, },
entriesClick(item) { entriesClick(item) {
this.$router.push({ this.$router.push({
path: item.pagePath path: item.pagePath
}) })
console.log(this.$store.state.tagsView.visitedViews) // console.log(this.$store.state.tagsView.visitedViews)
}, },
// 获取窗口可视范围的高度 // 获取窗口可视范围的高度
getClientHeight() { getClientHeight() {
......
...@@ -3,8 +3,8 @@ const getters = { ...@@ -3,8 +3,8 @@ const getters = {
sCachedViews: state => state.systemTags.sCachedViews, sCachedViews: state => state.systemTags.sCachedViews,
gVisitedViews: state => state.goodsTags.gVisitedViews, gVisitedViews: state => state.goodsTags.gVisitedViews,
gCachedViews: state => state.goodsTags.gCachedViews, gCachedViews: state => state.goodsTags.gCachedViews,
oVisitedViews: state => state.goodsTags.oVisitedViews, oVisitedViews: state => state.orderTags.oVisitedViews,
oCachedViews: state => state.goodsTags.oCachedViews, oCachedViews: state => state.orderTags.oCachedViews,
fVisitedViews: state => state.financalTags.fVisitedViews, fVisitedViews: state => state.financalTags.fVisitedViews,
fCachedViews: state => state.financalTags.fCachedViews fCachedViews: state => state.financalTags.fCachedViews
} }
......
...@@ -3,8 +3,8 @@ import Vuex from 'vuex' ...@@ -3,8 +3,8 @@ import Vuex from 'vuex'
import systemTags from './modules/system-tags' import systemTags from './modules/system-tags'
import usrAuth from './modules/usr-auth' import usrAuth from './modules/usr-auth'
import goodsTags from './modules/goods-tags' import goodsTags from './modules/goods-tags'
import orderTags from './modules/order-manage-tags' // import orderTags from './modules/order-manage-tags'
import financalTags from './modules/financal-tags' // import financalTags from './modules/financal-tags'
import getters from './getters' import getters from './getters'
Vue.use(Vuex) Vue.use(Vuex)
...@@ -15,9 +15,7 @@ const store = () => { ...@@ -15,9 +15,7 @@ const store = () => {
modules: { modules: {
usrAuth, usrAuth,
systemTags, systemTags,
goodsTags, goodsTags
orderTags,
financalTags
}, },
getters getters
}) })
......
...@@ -6,7 +6,7 @@ const financalTags = { ...@@ -6,7 +6,7 @@ const financalTags = {
mutations: { mutations: {
F_ADD_VISITED_VIEWS: (state, view) => { F_ADD_VISITED_VIEWS: (state, view) => {
if (state.fVisitedViews.some(v => v.path === view.path)) return if (state.fVisitedViews.some(v => v.path === view.path)) return
if (view.path === '/') return // if (view.path === '/') return
state.fVisitedViews.push( state.fVisitedViews.push(
Object.assign({}, view, { Object.assign({}, view, {
title: view.meta.title || 'no-name' title: view.meta.title || 'no-name'
......
...@@ -6,7 +6,7 @@ const goodsTags = { ...@@ -6,7 +6,7 @@ const goodsTags = {
mutations: { mutations: {
G_ADD_VISITED_VIEWS: (state, view) => { G_ADD_VISITED_VIEWS: (state, view) => {
if (state.gVisitedViews.some(v => v.path === view.path)) return if (state.gVisitedViews.some(v => v.path === view.path)) return
if (view.path === '/') return // if (view.path === '/') return
state.gVisitedViews.push( state.gVisitedViews.push(
Object.assign({}, view, { Object.assign({}, view, {
title: view.meta.title || 'no-name' title: view.meta.title || 'no-name'
...@@ -52,22 +52,22 @@ const goodsTags = { ...@@ -52,22 +52,22 @@ const goodsTags = {
} }
}, },
actions: { actions: {
gaddVisitedViews({ commit }, view) { gAddVisitedViews({ commit }, view) {
commit('G_ADD_VISITED_VIEWS', view) commit('G_ADD_VISITED_VIEWS', view)
}, },
gdelVisitedViews({ commit, state }, view) { gDelVisitedViews({ commit, state }, view) {
return new Promise(resolve => { return new Promise(resolve => {
commit('G_DEL_VISITED_VIEWS', view) commit('G_DEL_VISITED_VIEWS', view)
resolve([...state.gVisitedViews]) resolve([...state.gVisitedViews])
}) })
}, },
gdelOthersViews({ commit, state }, view) { gDelOthersViews({ commit, state }, view) {
return new Promise(resolve => { return new Promise(resolve => {
commit('G_DEL_OTHERS_VIEWS', view) commit('G_DEL_OTHERS_VIEWS', view)
resolve([...state.gVisitedViews]) resolve([...state.gVisitedViews])
}) })
}, },
gdelAllViews({ commit, state }) { gDelAllViews({ commit, state }) {
return new Promise(resolve => { return new Promise(resolve => {
commit('G_DEL_ALL_VIEWS') commit('G_DEL_ALL_VIEWS')
resolve([...state.gVisitedViews]) resolve([...state.gVisitedViews])
...@@ -75,4 +75,5 @@ const goodsTags = { ...@@ -75,4 +75,5 @@ const goodsTags = {
} }
} }
} }
export default goodsTags export default goodsTags
...@@ -6,7 +6,7 @@ const orderTags = { ...@@ -6,7 +6,7 @@ const orderTags = {
mutations: { mutations: {
O_ADD_VISITED_VIEWS: (state, view) => { O_ADD_VISITED_VIEWS: (state, view) => {
if (state.oVisitedViews.some(v => v.path === view.path)) return if (state.oVisitedViews.some(v => v.path === view.path)) return
if (view.path === '/') return // if (view.path === '/') return
state.oVisitedViews.push( state.oVisitedViews.push(
Object.assign({}, view, { Object.assign({}, view, {
title: view.meta.title || 'no-name' title: view.meta.title || 'no-name'
......
...@@ -6,7 +6,7 @@ const systemTags = { ...@@ -6,7 +6,7 @@ const systemTags = {
mutations: { mutations: {
S_ADD_VISITED_VIEWS: (state, view) => { S_ADD_VISITED_VIEWS: (state, view) => {
if (state.sVisitedViews.some(v => v.path === view.path)) return if (state.sVisitedViews.some(v => v.path === view.path)) return
if (view.path === '/') return // if (view.path === '/') return
state.sVisitedViews.push( state.sVisitedViews.push(
Object.assign({}, view, { Object.assign({}, view, {
title: view.meta.title || 'no-name' title: view.meta.title || 'no-name'
......
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