import BaseCmd from './Base/BaseCmd'; /** * 服务须知: * 1. objectService 业务对象服务数组,该数据来自redux 或 qryBusiObjectServicesByAppId * 2. findSingleBusiObjectService 查找业务对象服务详情api, 对应低代码主工程api.findSingleBusiObjectService。 * 3. busiObjectId 业务对象id * 4. serviceCode 业务对象编码 例如:insert(新增)、batchInsert(批量新增)、deleteByKey(根据主键删除数据)等 */ export declare const SERVICE_CODE: { /** 插入 */ readonly INSERT: "insert"; /** 批量新增 */ readonly BATCH_INSERT: "batchInsert"; /** 根据主键删除数据 */ readonly DELETE_BYKEY: "deleteByKey"; /** 批量删除 */ readonly BATCH_DELETE: "batchDelete"; /** 根据主键更新数据 */ readonly UPDATE_BY_KEY: "updateByKey"; /** 根据主键获取数据 */ readonly SELECT_BY_KEY: "selectByKey"; /** 根据主键集合获取数据 */ readonly SELECT_BY_KEYS: "selectByKeys"; /** 查询列表数据 */ readonly SELECT_ALL_LIST: "selectAllList"; /** 根据父节点查询树结构数据 */ readonly SELECT_TREE: "selectTree"; /** 查询分页数据 */ readonly SELECT_ALL_PAGE: "selectAllPage"; }; export declare type ValueOf = T[keyof T]; declare type ServiceCodeType = typeof SERVICE_CODE[keyof typeof SERVICE_CODE]; export interface ServiceOptions { } export interface BusiObjectOptions { /** * 业务对象数组 */ objectService: any[] /** */; /** * 查找单个服务的项 * @param param0 * @returns */ findSingleBusiObjectService: () => Promise; /** * 服务默认值,只遍历顶层节点。如果需要深层复制可使用paramsSetFunc */ bindSetParams?: Record; /** * 复制函数回调,返回当前字段的值 */ paramsSetFunc?: (item: any, prefix: string) => any; } declare class Service extends BaseCmd { /** * 业务对象字段 */ busiObject?: BusiObjectOptions & { options?: any; }; constructor(props: ServiceOptions); /** * 初始化业务对象, 创建业务对象类型服务必须调用。 * @param config */ initialBusiObject(config: BusiObjectOptions): void; private setApiParamsCycle; /** * 通过获取ApiRequest的options * @param busiObjectId */ getBusiObjectOptions(busiObjectId: string, serviceCode: ServiceCodeType): Promise; /** * 创建creatApiRequest * @param */ creatApiRequest(ctx: { callback1?: any[]; callback2?: any; pageJsonId: string; path: string[]; busiObjectId: string; serviceCode: ServiceCodeType; platform: 'h5' | 'pc'; }): Promise; } export default Service;