import { Observable } from 'rxjs'; import { FrameContext, Entity } from '@farris/devkit'; import { FormLoadingService } from '../form-loading/form-loading.service'; import { AttachmentInfo } from './types'; /** * 附件调用 */ declare class AttachmentDataService { private frameContext; private loadingService; /** * 实体仓库 */ private readonly repository; /** * 绑定数据 */ private readonly bindingData; constructor(frameContext: FrameContext, loadingService: FormLoadingService); /** * 更新附件信息 */ updateRow(attachmentInfoFieldPath: string, attachmentInfo: AttachmentInfo): Observable; /** * 通过属性名更新附件信息 * @param attachmentInfoFieldPath 附件字段 * @param attachmentInfo 附件信息 */ updateRowWithPropertyName(attachmentInfoFieldPath: string, attachmentInfo: AttachmentInfo): Observable; /** * 删除附件 * @param attachmentInfoFieldPath * @param attachmentInfo * @returns */ removeAttachment(attachmentInfoFieldPath: string, attachmentInfo: AttachmentInfo): Observable; /** * 批量创建附件行数据 */ updateRows(attachmentInfoFieldPath: string, attachmentInfos: AttachmentInfo[]): Observable; /** * 批量创建附件行数据 */ updateRowsWithConfigs(attachmentInfoFieldPath: string, attachmentInfos: AttachmentInfo[], configs: { [prop: string]: any; }): Observable; /** * 根据属性名批量创建附件行数据 */ updateRowsWithPropertyName(attachmentInfoFieldPath: string, attachmentInfos: AttachmentInfo[]): Observable; /** * 创建服务器端需要的更新信息 */ private createUpdateAttachInfo; /** * 创建服务器端需要的批量新增附件信息 */ private createBatchCreateAttachInfo; /** * 同步服务器端最新信息到客户端 * @todo: * 1、主对象批量新增时不支持 */ syncAttachmentInfosToClient(): Observable; /** * 追加主表数据到客户端 */ appendAttachmentInfosToClient(listData: any[], isRootEntity: boolean): Observable; appendAttachmentInfos(listData: any[], keyValues: { [prop: string]: any; }): Observable; private updateEntities; private updateEntity; private setValueByPath; } export { AttachmentDataService };