Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcxy-system
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
dcxy-system
Commits
2020d6b4
Commit
2020d6b4
authored
Apr 10, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分页以及筛选模块
parent
f10eb982
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
filters.js
src/store/modules/filters.js
+9
-2
pagination.js
src/store/modules/pagination.js
+13
-1
mutation-types.js
src/store/mutation-types.js
+0
-3
No files found.
src/store/modules/filters.js
View file @
2020d6b4
const
UPDATE_FILTERS
=
'UPDATE_FILTERS'
;
const
UPDATE_FILTERS
=
'UPDATE_FILTERS'
;
const
RESET_FILTERS
=
'RESET_FILTERS'
;
const
initFiltersStore
=
(
const
initFiltersStore
=
(
initState
=
{}
,
initState
=
()
=>
({})
,
otherGetters
=
{},
otherGetters
=
{},
otherActions
=
{},
otherActions
=
{},
otherMutations
=
{}
otherMutations
=
{}
)
=>
{
)
=>
{
const
state
=
()
=>
({
const
state
=
()
=>
({
filters
:
initState
,
filters
:
initState
()
,
});
});
const
getters
=
{
const
getters
=
{
filters
:
state
=>
state
.
filters
,
filters
:
state
=>
state
.
filters
,
...
@@ -17,6 +18,9 @@ const initFiltersStore = (
...
@@ -17,6 +18,9 @@ const initFiltersStore = (
updateFilters
({
commit
},
filters
)
{
updateFilters
({
commit
},
filters
)
{
commit
(
UPDATE_FILTERS
,
filters
);
commit
(
UPDATE_FILTERS
,
filters
);
},
},
resetFilters
({
commit
})
{
commit
(
RESET_FILTERS
);
},
...
otherActions
,
...
otherActions
,
};
};
const
mutations
=
{
const
mutations
=
{
...
@@ -26,6 +30,9 @@ const initFiltersStore = (
...
@@ -26,6 +30,9 @@ const initFiltersStore = (
...
filters
,
...
filters
,
};
};
},
},
[
RESET_FILTERS
]()
{
state
.
filters
=
initState
();
},
...
otherMutations
,
...
otherMutations
,
};
};
...
...
src/store/modules/pagination.js
View file @
2020d6b4
import
{
UPDATE_PAGINATION
}
from
'../mutation-types'
;
const
UPDATE_PAGINATION
=
'UPDATE_PAGINATION'
;
const
RESET_PAGINATION
=
'RESET_PAGINATION'
;
const
state
=
()
=>
({
const
state
=
()
=>
({
pageNum
:
1
,
// 当前分页
pageNum
:
1
,
// 当前分页
...
@@ -17,6 +18,9 @@ const actions = {
...
@@ -17,6 +18,9 @@ const actions = {
updatePagination
({
commit
},
pagination
)
{
updatePagination
({
commit
},
pagination
)
{
commit
(
UPDATE_PAGINATION
,
pagination
);
commit
(
UPDATE_PAGINATION
,
pagination
);
},
},
resetPagination
({
commit
})
{
commit
(
RESET_PAGINATION
);
},
};
};
const
mutations
=
{
const
mutations
=
{
...
@@ -25,6 +29,14 @@ const mutations = {
...
@@ -25,6 +29,14 @@ const mutations = {
...
pagination
,
...
pagination
,
});
});
},
},
[
RESET_PAGINATION
](
state
)
{
state
=
Object
.
assign
(
state
,
{
pageNum
:
1
,
// 当前分页
pageSize
:
10
,
// 分页大小
total
:
0
,
pages
:
0
,
});
},
};
};
export
default
{
export
default
{
...
...
src/store/mutation-types.js
View file @
2020d6b4
export
const
USER_LOGIN
=
'USER_LOGIN'
;
export
const
USER_LOGIN
=
'USER_LOGIN'
;
export
const
FETCH_PRODUCT_LIST
=
'FETCH_PRODUCT_LIST'
;
export
const
FETCH_PRODUCT_LIST
=
'FETCH_PRODUCT_LIST'
;
// pagination
export
const
UPDATE_PAGINATION
=
'UPDATE_PAGINATION'
;
\ 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