删除权限
This commit is contained in:
30
klp-ui/src/store/modules/category.js
Normal file
30
klp-ui/src/store/modules/category.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { listCategory } from '@/api/wms/category';
|
||||
|
||||
const state = {
|
||||
categoryList: []
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
SET_CATEGORY_LIST(state, list) {
|
||||
state.categoryList = list;
|
||||
}
|
||||
};
|
||||
|
||||
const actions = {
|
||||
getCategoryList({ state, commit }) {
|
||||
if (state.categoryList.length > 0) {
|
||||
return Promise.resolve(state.categoryList);
|
||||
}
|
||||
return listCategory().then(res => {
|
||||
commit('SET_CATEGORY_LIST', res.rows || []);
|
||||
return res.rows || [];
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
};
|
||||
Reference in New Issue
Block a user