import { Injector } from '@angular/core'; import { BindingList, ViewModel, Repository, Entity } from '@farris/devkit'; import { Observable } from 'rxjs'; import { BatchEditDialogService } from '@farris/ui-batch-edit-dialog'; import { DateTimeHelperService } from '@farris/ui-common/date'; import { ComponentManagerService } from './component-manager.service'; import { LanguageService } from './languag.service'; import { FormNotifyService } from './form-notify.service'; import { UploadService } from '@gsp-svc/formdoc-upload'; /** * 批量编辑服务 */ export declare class BatchEditService { private injector; private componentManagerService; private viewModel; private repository; private batchEditDialogService; private dateService; private languageService; private formNotifyService; private fileUploadService; private formLoadingService; private onHelpClose; constructor(injector: Injector, componentManagerService: ComponentManagerService, viewModel: ViewModel, repository: Repository, batchEditDialogService: BatchEditDialogService, dateService: DateTimeHelperService, languageService: LanguageService, formNotifyService: FormNotifyService, fileUploadService: UploadService); private readonly formErrorService; /** * 打开批量编辑对话框 * @param frameId frameId */ openBatchEditDialog(frameId: string, enableDictPicking?: boolean | string): Observable; /** * 打开隐藏帮助 * @param helpId 帮助id */ openHiddenHelp(helpId: string): void; /** * 清空帮助勾选(只能挂载到帮助前事件) */ clearHelpSelections(): void; /** * 勾选当前行 * @param frameId frameId * @param mapFields 字段映射 * @param primaryKeyValue 帮助主键字段 */ checkCurrentRow(frameId: string, mapFields: string, primaryKeyValue: string): void; /** * 以帮助勾选数据作为依据,批量新增主表数据 * @param frameId 主表所在frame的id * @param mapFields 帮助字段与主表字段映射 * @description 以帮助勾选数据作为依据,批量新增主表数据 */ batchAppend(frameId: string, mapFields: string): Observable; /** * 以帮助勾选数据作为依据,批量新增从表/从从表 * @param frameId 从表/从从表所在frame的id * @param mapFields 帮助字段与从表/从从表字段映射 * @description 以帮助勾选数据作为依据,批量新增从表/从从表 */ batchAppendByPathBasedOnHelpSelections(frameId: string, mapFields: string): Observable; /** * 批量新增带附件的从表或从从表数据 * @param frameId * @param mapFields * @param attachmentInfoFieldPath 附件udt字段路径,可支持多个,以逗号分隔 * @param rootId 附件存储根目录 * @param path 附件存储目录 * @description 批量新增带附件的从表或从从表数据与批量新增从表从从表数据一致,在批量新增数据的基础上增加了附件复制 * @todo 目前附件复制在前端调用,会发起多个请求,且存在安全问题,后续应在vo集成 */ batchAppendByPathWithAttachment(frameId: string, mapFields: string, attachmentInfoFieldPath: string, rootId: string, path: string): Observable; /** * 构造默认值数组 * @param selectedValues * @param mapFields * @returns */ private buildDefaultValues; /** * 复制行中所有附件 * @param row * @param attachmentFields * @param rootId * @param path * @returns */ private copyRowFiles; /** * 行内帮助多选批量新增或替换子表数据 * @param frameId frameId, optional,为空时使用命令执行时所在的上下文 * @param mapFields 字段映射 * @param primaryKey 帮助主键字段,默认为id * @returns */ batchAppendBasedOnRowHelpSelections(frameId: string, mapFields: string): Observable; /** * 复制主表数据 * @param id 要复制的数据id * @param fields 要复制的字段 * @description 仅支持复制主表数据 * @deprecated 该方法已被废弃,请使用clone方法替代。 */ copy(id: string): Observable; /** * 复制数据(支持主表、从表、从从表) * @param id 要复制的行 * @param path 请求路径 * @returns */ clone(id: string, path: string): Observable; /** * 带附件的复制 * @param id * @param url * @param attachmentInfoFieldPath * @param rootId * @param path * @returns */ cloneWithAttachment(id: string, url: string, attachmentInfoFieldPath: string, rootId: string, path: string): Observable; private clearAttachmentInfo; /** * 复制行 * @param frameId frameId * @param ignoreFields 复制时忽略字段 * @param repeat 重复复制次数,默认为1 */ copyRow(frameId: string, ignoreFields: string, repeat?: number): Observable<{}>; /** * 增量多选帮助批量赋值帮助后事件 * @param frameId frameId * @param mapFields 字段映射 * @param associatedField 关联字段 */ afterIncrementalSelectHelpClose(frameId: string, mapFields: string, associatedField: string): Observable<{} | Entity>; /** * 多选帮助批量赋值帮助前事件 */ beforeMultiSelectHelpOpen(): void; /** * 多选帮助批量赋值帮助后事件 * @param frameId 绑定路径 * @param mapFields 字段映射 * @param commandFrameId 回调命令所在frameId * @param commandName 回调命令 * @deprecated 模拟用户操作,待批量赋值支持主表后废弃 */ afterMultiSelectHelpClose(frameId: string, mapFields: string, commandFrameId?: string, commandName?: string): Observable; /** * 帮助关闭后处理器 * @param frameId frameid * @param mapFields mapFields * @param result 帮助数据结果 */ private onHelpCloseHandler; private suspendFrameContextEvent; private resumeFrameContextEvent; private setValueByPath; private getValueByPath; /** * 构造子表路径 * @param bindingPath 绑定路径 * @param id id */ private buildPath; /** * 获取绑定路径的当前行数组 * @param bindingPath bindingPath * @returns */ private buildIds; private updateBindingData; private updateSimpleField; private updateLookupField; private updateBindingList; private getBindingPathArray; private getValue; protected readonly bindingList: BindingList; /** * 根据映射将数据赋值给bindingData * @param data * @param mapFields * @param bindingData */ private mappingRow; /** * 通过frameId获取对应的组件上下文 * @param frameId frameId * @returns */ private getFrameContextById; private getEntityByPath; private endEdit; }