Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
admin-yweb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yfront
admin-yweb
Commits
8b77b308
Commit
8b77b308
authored
Aug 27, 2018
by
YoMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
844b0d17
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
270 deletions
+25
-270
layouts/default.vue
+20
-20
store/getters.js
+1
-7
store/index.js
+4
-7
store/modules/financal-tags.js
+0
-78
store/modules/goods-tags.js
+0
-78
store/modules/order-manage-tags.js
+0
-80
No files found.
layouts/default.vue
View file @
8b77b308
...
@@ -48,16 +48,16 @@ export default {
...
@@ -48,16 +48,16 @@ export default {
},
},
computed
:
{
computed
:
{
visitedViews
()
{
visitedViews
()
{
//
return this.$store.state.systemTags.sVisitedViews
return
this
.
$store
.
state
.
systemTags
.
sVisitedViews
if
(
this
.
tabNow
===
0
)
{
//
if (this.tabNow === 0) {
return
this
.
$store
.
state
.
systemTags
.
sVisitedViews
//
return this.$store.state.systemTags.sVisitedViews
}
else
if
(
this
.
tabNow
===
1
)
{
//
} else if (this.tabNow === 1) {
return
this
.
$store
.
state
.
goodsTags
.
gVisitedViews
//
return this.$store.state.goodsTags.gVisitedViews
}
else
if
(
this
.
tabNow
===
2
)
{
//
} else if (this.tabNow === 2) {
return
this
.
$store
.
state
.
orderTags
.
oVisitedViews
//
return this.$store.state.orderTags.oVisitedViews
}
else
{
//
} else {
return
this
.
$store
.
state
.
financalTags
.
fVisitedViews
//
return this.$store.state.financalTags.fVisitedViews
}
//
}
}
}
},
},
watch
:
{
watch
:
{
...
@@ -77,16 +77,16 @@ export default {
...
@@ -77,16 +77,16 @@ export default {
if
(
!
route
)
{
if
(
!
route
)
{
return
false
return
false
}
}
//
this.$store.dispatch('sAddVisitedViews', route)
this
.
$store
.
dispatch
(
'sAddVisitedViews'
,
route
)
if
(
this
.
tabNow
===
0
)
{
//
if (this.tabNow === 0) {
this
.
$store
.
dispatch
(
'sAddVisitedViews'
,
route
)
//
this.$store.dispatch('sAddVisitedViews', route)
}
else
if
(
this
.
tabNow
===
1
)
{
//
} else if (this.tabNow === 1) {
this
.
$store
.
dispatch
(
'gAddVisitedViews'
,
route
)
//
this.$store.dispatch('gAddVisitedViews', route)
}
else
if
(
this
.
tabNow
===
2
)
{
//
} else if (this.tabNow === 2) {
this
.
$store
.
dispatch
(
'oAddVisitedViews'
,
route
)
//
this.$store.dispatch('oAddVisitedViews', route)
}
else
{
//
} else {
this
.
$store
.
dispatch
(
'fAddVisitedViews'
,
route
)
//
this.$store.dispatch('fAddVisitedViews', route)
}
//
}
},
},
// 获取列表数据
// 获取列表数据
getOrderCtg
()
{
getOrderCtg
()
{
...
...
store/getters.js
View file @
8b77b308
const
getters
=
{
const
getters
=
{
sVisitedViews
:
state
=>
state
.
systemTags
.
sVisitedViews
,
sVisitedViews
:
state
=>
state
.
systemTags
.
sVisitedViews
,
sCachedViews
:
state
=>
state
.
systemTags
.
sCachedViews
,
sCachedViews
:
state
=>
state
.
systemTags
.
sCachedViews
gVisitedViews
:
state
=>
state
.
goodsTags
.
gVisitedViews
,
gCachedViews
:
state
=>
state
.
goodsTags
.
gCachedViews
,
oVisitedViews
:
state
=>
state
.
goodsTags
.
oVisitedViews
,
oCachedViews
:
state
=>
state
.
goodsTags
.
oCachedViews
,
fVisitedViews
:
state
=>
state
.
financalTags
.
fVisitedViews
,
fCachedViews
:
state
=>
state
.
financalTags
.
fCachedViews
}
}
export
default
getters
export
default
getters
store/index.js
View file @
8b77b308
...
@@ -2,9 +2,9 @@ import Vue from 'vue'
...
@@ -2,9 +2,9 @@ import Vue from 'vue'
import
Vuex
from
'vuex'
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
)
...
@@ -14,10 +14,7 @@ const store = () => {
...
@@ -14,10 +14,7 @@ const store = () => {
return
new
Vuex
.
Store
({
return
new
Vuex
.
Store
({
modules
:
{
modules
:
{
usrAuth
,
usrAuth
,
systemTags
,
systemTags
goodsTags
,
orderTags
,
financalTags
},
},
getters
getters
})
})
...
...
store/modules/financal-tags.js
deleted
100644 → 0
View file @
844b0d17
const
financalTags
=
{
state
:
{
fVisitedViews
:
[],
fCachedViews
:
[]
},
mutations
:
{
F_ADD_VISITED_VIEWS
:
(
state
,
view
)
=>
{
if
(
state
.
fVisitedViews
.
some
(
v
=>
v
.
path
===
view
.
path
))
return
if
(
view
.
path
===
'/'
)
return
state
.
fVisitedViews
.
push
(
Object
.
assign
({},
view
,
{
title
:
view
.
meta
.
title
||
'no-name'
})
)
if
(
!
view
.
meta
.
noCache
)
{
state
.
fCachedViews
.
push
(
view
.
name
)
}
},
F_DEL_VISITED_VIEWS
:
(
state
,
view
)
=>
{
for
(
const
[
i
,
v
]
of
state
.
fVisitedViews
.
entries
())
{
if
(
v
.
path
===
view
.
path
)
{
state
.
fVisitedViews
.
splice
(
i
,
1
)
break
}
}
for
(
const
i
of
state
.
fCachedViews
)
{
if
(
i
===
view
.
name
)
{
const
index
=
state
.
fCachedViews
.
indexOf
(
i
)
state
.
fCachedViews
.
splice
(
index
,
1
)
break
}
}
},
F_DEL_OTHERS_VIEWS
:
(
state
,
view
)
=>
{
for
(
const
[
i
,
v
]
of
state
.
fVisitedViews
.
entries
())
{
if
(
v
.
path
===
view
.
path
)
{
state
.
fVisitedViews
=
state
.
fVisitedViews
.
slice
(
i
,
i
+
1
)
break
}
}
for
(
const
i
of
state
.
fCachedViews
)
{
if
(
i
===
view
.
name
)
{
const
index
=
state
.
fCachedViews
.
indexOf
(
i
)
state
.
fCachedViews
=
state
.
fCachedViews
.
slice
(
index
,
index
+
1
)
break
}
}
},
F_DEL_ALL_VIEWS
:
state
=>
{
state
.
sVisitedViews
=
[]
state
.
fCachedViews
=
[]
}
},
actions
:
{
fAddVisitedViews
({
commit
},
view
)
{
commit
(
'F_ADD_VISITED_VIEWS'
,
view
)
},
fDelVisitedViews
({
commit
,
state
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'F_DEL_VISITED_VIEWS'
,
view
)
resolve
([...
state
.
fVisitedViews
])
})
},
fDelOthersViews
({
commit
,
state
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'F_DEL_OTHERS_VIEWS'
,
view
)
resolve
([...
state
.
fVisitedViews
])
})
},
fDelAllViews
({
commit
,
state
})
{
return
new
Promise
(
resolve
=>
{
commit
(
'F_DEL_ALL_VIEWS'
)
resolve
([...
state
.
fVisitedViews
])
})
}
}
}
export
default
financalTags
store/modules/goods-tags.js
deleted
100644 → 0
View file @
844b0d17
const
goodsTags
=
{
state
:
{
gVisitedViews
:
[],
gCachedViews
:
[]
},
mutations
:
{
G_ADD_VISITED_VIEWS
:
(
state
,
view
)
=>
{
if
(
state
.
gVisitedViews
.
some
(
v
=>
v
.
path
===
view
.
path
))
return
if
(
view
.
path
===
'/'
)
return
state
.
gVisitedViews
.
push
(
Object
.
assign
({},
view
,
{
title
:
view
.
meta
.
title
||
'no-name'
})
)
if
(
!
view
.
meta
.
noCache
)
{
state
.
gCachedViews
.
push
(
view
.
name
)
}
},
G_DEL_VISITED_VIEWS
:
(
state
,
view
)
=>
{
for
(
const
[
i
,
v
]
of
state
.
gVisitedViews
.
entries
())
{
if
(
v
.
path
===
view
.
path
)
{
state
.
gVisitedViews
.
splice
(
i
,
1
)
break
}
}
for
(
const
i
of
state
.
gCachedViews
)
{
if
(
i
===
view
.
name
)
{
const
index
=
state
.
gCachedViews
.
indexOf
(
i
)
state
.
gCachedViews
.
splice
(
index
,
1
)
break
}
}
},
G_DEL_OTHERS_VIEWS
:
(
state
,
view
)
=>
{
for
(
const
[
i
,
v
]
of
state
.
gVisitedViews
.
entries
())
{
if
(
v
.
path
===
view
.
path
)
{
state
.
gVisitedViews
=
state
.
gVisitedViews
.
slice
(
i
,
i
+
1
)
break
}
}
for
(
const
i
of
state
.
gCachedViews
)
{
if
(
i
===
view
.
name
)
{
const
index
=
state
.
gCachedViews
.
indexOf
(
i
)
state
.
gCachedViews
=
state
.
gCachedViews
.
slice
(
index
,
index
+
1
)
break
}
}
},
G_DEL_ALL_VIEWS
:
state
=>
{
state
.
gVisitedViews
=
[]
state
.
gCachedViews
=
[]
}
},
actions
:
{
gaddVisitedViews
({
commit
},
view
)
{
commit
(
'G_ADD_VISITED_VIEWS'
,
view
)
},
gdelVisitedViews
({
commit
,
state
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'G_DEL_VISITED_VIEWS'
,
view
)
resolve
([...
state
.
gVisitedViews
])
})
},
gdelOthersViews
({
commit
,
state
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'G_DEL_OTHERS_VIEWS'
,
view
)
resolve
([...
state
.
gVisitedViews
])
})
},
gdelAllViews
({
commit
,
state
})
{
return
new
Promise
(
resolve
=>
{
commit
(
'G_DEL_ALL_VIEWS'
)
resolve
([...
state
.
gVisitedViews
])
})
}
}
}
export
default
goodsTags
store/modules/order-manage-tags.js
deleted
100644 → 0
View file @
844b0d17
const
orderTags
=
{
state
:
{
oVisitedViews
:
[],
oCachedViews
:
[]
},
mutations
:
{
O_ADD_VISITED_VIEWS
:
(
state
,
view
)
=>
{
if
(
state
.
oVisitedViews
.
some
(
v
=>
v
.
path
===
view
.
path
))
return
if
(
view
.
path
===
'/'
)
return
state
.
oVisitedViews
.
push
(
Object
.
assign
({},
view
,
{
title
:
view
.
meta
.
title
||
'no-name'
})
)
if
(
!
view
.
meta
.
noCache
)
{
state
.
oCachedViews
.
push
(
view
.
name
)
}
},
O_DEL_VISITED_VIEWS
:
(
state
,
view
)
=>
{
for
(
const
[
i
,
v
]
of
state
.
oVisitedViews
.
entries
())
{
if
(
v
.
path
===
view
.
path
)
{
state
.
oVisitedViews
.
splice
(
i
,
1
)
break
}
}
for
(
const
i
of
state
.
oCachedViews
)
{
if
(
i
===
view
.
name
)
{
const
index
=
state
.
oCachedViews
.
indexOf
(
i
)
state
.
oCachedViews
.
splice
(
index
,
1
)
break
}
}
},
O_DEL_OTHERS_VIEWS
:
(
state
,
view
)
=>
{
for
(
const
[
i
,
v
]
of
state
.
oVisitedViews
.
entries
())
{
if
(
v
.
path
===
view
.
path
)
{
state
.
oVisitedViews
=
state
.
oVisitedViews
.
slice
(
i
,
i
+
1
)
break
}
}
for
(
const
i
of
state
.
oCachedViews
)
{
if
(
i
===
view
.
name
)
{
const
index
=
state
.
oCachedViews
.
indexOf
(
i
)
state
.
oCachedViews
=
state
.
oCachedViews
.
slice
(
index
,
index
+
1
)
break
}
}
},
O_DEL_ALL_VIEWS
:
state
=>
{
state
.
oVisitedViews
=
[]
state
.
oCachedViews
=
[]
}
},
actions
:
{
oAddVisitedViews
({
commit
},
view
)
{
commit
(
'O_ADD_VISITED_VIEWS'
,
view
)
},
oDelVisitedViews
({
commit
,
state
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'O_DEL_VISITED_VIEWS'
,
view
)
resolve
([...
state
.
visitedViews
])
})
},
oDelOthersViews
({
commit
,
state
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'O_DEL_OTHERS_VIEWS'
,
view
)
resolve
([...
state
.
oVisitedViews
])
})
},
oDelAllViews
({
commit
,
state
})
{
return
new
Promise
(
resolve
=>
{
commit
(
'O_DEL_ALL_VIEWS'
)
resolve
([...
state
.
oVisitedViews
])
})
}
}
}
export
default
orderTags
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment