import { Observable } from 'rxjs'; import { Entity, FrameContext } from '@farris/devkit'; import { FormLoadingService } from '../form-loading/form-loading.service'; import { FormNotifyService } from '../form-notify.service'; import { LanguageService } from '../languag.service'; import { FormMessageService } from '../form-message.service'; import { FormErrorService } from '../error/form-error.service'; import { BaseDataService } from './base-data.service'; /** * 树数据服务 */ declare class TreeDataService extends BaseDataService { private messageService; private loadingService; private notifyService; private errorService; private languageService; /** * 分级信息字段名 */ private readonly hierarchyInfoKey; private readonly virtualRootFrameContext; /** * 构造函数 */ constructor(frameContext: FrameContext, messageService: FormMessageService, loadingService: FormLoadingService, notifyService: FormNotifyService, errorService: FormErrorService, languageService: LanguageService); /** * 加载数据 */ load(filters?: string, sorts?: string, hierarchyInfoKey?: string): Observable; /** * 分层加载数据 */ loadByLevel(filters?: string, sorts?: string, frozenCurrentRow?: boolean | string): Observable; /** * 加载完整树 * @param virtualPropertyName 虚拟字段 * @param fullTreeType 是否是完整树加载 0:完整树 1:部分树 * @param loadType 是否分级加载 0:全部加载 1:分级加载 * @param filter 过滤条件 * @param frozenCurrentRow 冻结当前行 */ loadFullTree(virtualPropertyName: string, fullTreeType: string, loadType: string, filters: string, frozenCurrentRow?: boolean | string): Observable; /** * 获取最新展开的节点 */ getIdToExpand(): any; /** * 设置最新展开的节点 */ setIdToExpand(idToExpand: string): void; /** * 解析过滤条件 */ parseConditions(conditions?: string): any[]; /** * 新增同级 */ addSibling(id: string): Observable; /** * 新增下级 */ addChild(id: string): Observable; /** * 批量保存 */ save(): Observable; /** * 删除 */ remove(id: string, successMsg?: string): Observable; /** * 取消时检测未保存记录 */ cancel(): Observable; /** * 构造分页信息 * @param parentId parentId * @returns */ private buildPaginationInfo; /** * 取消变更 */ private _cancel; /** * 检查是否存在下级节点(内部方法,请勿使用) */ hasChildNodes(id: string, treeNodesData: any[]): boolean; /** * 计算删除后的当前节点id(内部方法,请勿使用) */ getNextNodeIdAfterRemoving(idToRemove: string, treeNodesData: any[]): string; /** * 设置删除后的当前节点节点(内部方法,请勿使用) */ setNextNodeAfterRemoving(nextNodeId: string): void; /** * 设置树的当前行(给完整树使用) * @param id id */ setCurrentId(id: string): void; /** * 选中树的第一个节点 */ selectFirstRow(): void; /** * 获取树节点工具类实例 */ private getTreeNodeUtil; /** * 记录加载状态 * @todo:待删除 */ private setLoadByLevelState; /** * 展开当前节点 * @todo:待删除 */ private reloadByLevel; private getHierarchyType; /** * 获取根组件消息管道 */ private readonly messagePipe; } export { TreeDataService };