|
@@ -1,30 +0,0 @@
|
|
|
-import consts from '@/consts'
|
|
|
|
|
-import { queryStaff } from '@/services/staff'
|
|
|
|
|
-
|
|
|
|
|
-export default {
|
|
|
|
|
- namespace: 'employee',
|
|
|
|
|
- state: {
|
|
|
|
|
- data: []
|
|
|
|
|
- },
|
|
|
|
|
- effects: {
|
|
|
|
|
- *fetch({ payload }, { call, put }) {
|
|
|
|
|
- const response = yield call(queryStaff, payload)
|
|
|
|
|
- if (response && response.code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
- yield put({
|
|
|
|
|
- type: 'show',
|
|
|
|
|
- payload: response.data
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- // console.log(response)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- reducers: {
|
|
|
|
|
- // action:是由reducers及effects的触发器,一般是第一个对象,如:{type:'add',payload:todo}
|
|
|
|
|
- show(state, action) {
|
|
|
|
|
- return {
|
|
|
|
|
- ...state,
|
|
|
|
|
- data: action.payload.list
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|