/** * Model创建时初始化配置,为什么配置需要与Model分离: * 1. UDK模块的Model无法使用自动扫描,只能手工创建 * 2. Model需要通过@see{IModelHelper}创建以方便纳入生命周期管理 * 3. 业务层可能会对IModelHelper进行定制后再注入,所以Model的加载会延迟 * 也就无法提前使用默认的ModelHelper进行创建了 */ import { DvaModelCreateOption, IIrsApis } from '@amc-udk/types' export const IrsModelOptionsForWeb: { [key in keyof IIrsApis]?: DvaModelCreateOption } = { broker: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, actionCallbacks: [ { namespace: 'broker', type: 'getAllForSelect', payload: {}, after: { model: 'app', phase: 'authorized', }, }, ], }, rank: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, actionCallbacks: [ { namespace: 'rank', type: 'afterAppAuthenticated', payload: {}, after: { model: 'app', phase: 'authorized', }, }, { namespace: 'rank', type: 'getAllForSelect', payload: {}, after: { model: 'app', phase: 'authorized', }, }, ], }, preconfig: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, actionCallbacks: [ { namespace: 'preconfig', type: 'getAllForSelect', payload: {}, after: { model: 'rank', phase: 'authorized', }, }, ], }, researcher: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, actionCallbacks: [ { namespace: 'researcher', type: 'getAllForSelect', payload: {}, after: { model: 'app', phase: 'authorized', }, }, ], }, service: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, // actionCallbacks: [ // { // namespace: 'service', // type: 'getAllForSelect', // payload: {}, // after: { // model: 'app', // phase: 'authorized', // }, // }, // ], }, vote: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, }, points: { module: 'irs', pageable: true, storeable: true, loadStateOnload: true, storageType: 'local', createdByContainer: false, actionCallbacks: [ { namespace: 'points', type: 'getAllForSelect', payload: {}, after: { model: 'rank', phase: 'authorized', }, }, ], }, } export const IrsModelOptionsForMobile: { [model: string]: DvaModelCreateOption } = {}