UNPKG

ttk-app-core

Version:

@ttk/recat enterprise develop framework

46 lines (39 loc) 1.2 kB
import { Map, fromJS, List } from 'immutable' import moment from 'moment' // 所有的reducers函数在框架初始化时都会被框架自动调用一次,以初始化state数据。调用时action的值为{type:0.022444457651 },type是一个小于1的随机值 export function attributeForm(state = Map(), action) { switch (action.type) { case 'update': return state.sfs(fromJS(action.data)) default: return state } } 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 status(state = Map({ step: 1, loading: false }), action) { switch (action.type) { case 'loading': return state.sfs({loading: action.data}) case 'step': return state.sfs({step: action.data}) default: return state } } /************************** 属性表单 end **************************/