socializationLaborReducers.js
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import * as types from '../constants/ActionTypes';
// 默认数据
const initialState = {
posCategory: null,
qualifyCertificate: [],
// postlist: [],
getLaborAllDataList: [],
getPostList: [],
higher_up_data:[],
errordata:[]
};
export default (state = initialState, action) => {
if (action.type == types.GET_POST_LIST) { // 获取岗位 的 默认列表
return {
...state,
getPostList: action.data
}
}
if (action.type == types.GET_LABOR_ALL_DATA_LIST) {
return {
...state,
getLaborAllDataList: action.data
}
}
if (action.type == types.GET_POSCATEGORY) {
return {
...state,
posCategory: action.posCategory
}
}
if (action.type == types.GETPOSTALL) {
return {
...state,
higher_up_data:action.data
// posCategory: action.posCategory
}
}
if (action.type == types.ADD_CERTIFICATE_BOX) {
return {
...state,
qualifyCertificate: state.qualifyCertificate.concat([action.data])
}
}
if (action.type == types.REMOVE_CERTIFICATE_BOX) {
return {
...state,
qualifyCertificate: action.data
}
}
if (action.type == types.PUT_POST) { //添加岗位 (新增add)
// return {
// ...state,
// getPostList: state.getPostList.concat(action.data)
// }
return Object.assign({}, state, {
getPostList: action.data
});
}
if (action.type == types.DATA_ERRORS) { //添加岗位 (新增add)
return Object.assign({}, state, {
errordata: action.data
});
}
return state;
}