ttk-app-core
Version:
@ttk/recat enterprise develop framework
48 lines (40 loc) • 1.34 kB
JavaScript
import { Map, fromJS, List } from 'immutable'
import moment from 'moment'
// 所有的reducers函数在框架初始化时都会被框架自动调用一次,以初始化state数据。调用时action的值为{type:0.022444457651 },type是一个小于1的随机值
// export function dialogTempState(state = Map({
// isEdit: false,
// loading: false
// }), action) {
// switch (action.type) {
// case 'setEdit':
// return state.sf(['isEdit'], action.data)
// case 'setLoading':
// return state.sf(['loading'], action.data)
// default:
// return state
// }
// }
/************************** 属性表单 start **************************/
export function validateState(state = Map({
name: { state: 'success', message: '' },
sortNo: { state: 'success', message: '' },
isCycle: { state: 'success', message: '' },
isUse: { state: 'success', message: '' },
remark: { state: 'success', message: '' },
}), action) {
switch (action.type) {
case 'update':
return state.sfs(fromJS(action.data))
default:
return state
}
}
export function attributeForm(state = Map(), action) {
switch (action.type) {
case 'update':
return state.sfs(fromJS(action.data))
default:
return state
}
}
/************************** 属性表单 end **************************/