import { routerRedux } from 'dva/router';
export default {
	namespace: 'keepAlive',

	state: {
		AuditPageData: {
			// 审批审核页面数据
			'/path': {
				pageCurrent: '',
				searchFormValues: {},
				activeKey: '',
			},
		},
		parentData: {
			'/path': {
				activeTab: '', // 多页签审核页面 激活的tab 解决禅道bug http://scjoyedu.eicp.net:57400/zentao/task-view-3779.html
			},
		},
	},
	effects: {},
	reducers: {
		setAuditPageData(state, { payload }) {
			const { path, value } = payload;
			const AuditPageDataNew = state.AuditPageData;
			AuditPageDataNew[path] = value;
			return {
				...state,
				AuditPageData: AuditPageDataNew,
			};
		},
    setParentData(state, { payload }) {
      const { path, value } = payload;
      const AuditPageDataNew = state.parentData;
      AuditPageDataNew[path] = value;
      return {
        ...state,
        parentData: AuditPageDataNew,
      };
    },
	},
};
