import { EventEmitter, NgZone, OnInit, TemplateRef } from '@angular/core'; import { TreeTableComponent } from '@farris/ui-treetable'; import { NotifyService } from '@farris/ui-notify'; import { DomService, FormSchemaEntity, SchemaService, FormComponent, FormViewModel } from '@farris/designer-services'; import { ControlService } from '../../../../../../service/control.service'; import { HttpClient } from '@angular/common/http'; import { TableFillInFormTempalteService } from './services/table-fillin-template.service'; import { LocaleService } from '@farris/ui-locale'; /** * 动态面板构造类 */ export declare class DynamicAreaItemBuildInfo { dynamicItem: any; components?: FormComponent[]; viewModels?: FormViewModel[]; } /** * 预制的组件模板结构 */ export declare class DynamicTemplateJson { id: string; title: string; /** 模板内容 */ contents: any[]; /** 模板中涉及的子组件 */ components?: FormComponent[]; } /** * 动态面板新增窗口 */ export declare class CreateDynamicItemComponent implements OnInit { private notifyService; private domServ; private controlServ; private schemServ; private http; private tableFillInService; private ngZone; private localeService; save: EventEmitter; cancel: EventEmitter; cls: string; btns: TemplateRef; /** 步骤条数据 */ stepMessages: any[]; /** 当前选中步骤id */ currentStepId: string; /** 当前选中步骤索引 */ activeStepIndex: number; /** 当前表单schema实体 */ schemaEntity: any; /** 实体树表数据源 */ schemaSource: any[]; /** 实体树表列配置 */ schemaTreeColumns: { field: string; title: string; }[]; /** 选中的实体表 */ selectedEntity: FormSchemaEntity; /** 选中的表节点(树节点) */ selectedEntityTreeNode: any; /** 是否选中主表 */ isSelectMainTable: boolean; /** 主实体label */ mainEntityLabel: string; schemaTree: TreeTableComponent; /** 系统预制的组件模板列表 */ componentTemplates: any[]; /** 选中的模板 */ selectedTemplate: any; /** 选中模板的JSON结构 */ selectedTempalteJson: DynamicTemplateJson; /** 展示字段树表实例 */ fieldsTree: TreeTableComponent; /** 展示字段树表数据源 */ fieldsSource: any[]; /** 展示字段树表列配置 */ filedsTreeColumns: ({ field: string; title: string; width?: undefined; } | { field: string; title: string; width: number; })[]; /** 是否全选字段 */ selectedAllFields: boolean; /** 字段勾选配置 */ selected: {}; /** 选中的字段 */ selectedFields: any[]; /** 组件的构造信息 */ buildInfo: DynamicAreaItemBuildInfo; /** 表单中已添加的字段集合,用于添加组件时排除掉页面中同类型组件中已有的字段 */ displayedFieldsMap: Map; /** 选中的实体下是否包含可勾选的字段,用于没有可选字段时不显示全选按钮 */ hasSelectableFields: boolean; constructor(notifyService: NotifyService, domServ: DomService, controlServ: ControlService, schemServ: SchemaService, http: HttpClient, tableFillInService: TableFillInFormTempalteService, ngZone: NgZone, localeService: LocaleService); ngOnInit(): void; private initI18n; /** * 步骤条信息 */ private initProgressData; /** * 组装实体树 */ assembleSchemaSource(): void; /** * 将schema实体组装成树 * 规则: 卡片类型组件只能选择主表,列表类型组件只能选择从表 */ private assembleSchemaBasicInfo2Tree; /** * 切换选中的实体节点 */ selectedEntityChanged(selectedEntityNode: any): void; /** * 上一步 */ clickPreStep(): void; /** * 下一步 */ clickNextStep(): void; private goToNextSetp; /** * schema字段集合组装成树 * @param fields schema字段集合 */ private assembleFields2Tree; /** * 获取指定实体中已在当前表单中被占用的字段,场景:创建卡片组件时将已在其他组件中添加的字段排除掉 */ private getDisplayedFieldsMapBySelectedEntity; /** * 获取模板列表 * @param type 控件类型 */ private getComponentTemplates; /** * 获取模板列表 * @param type 控件类型 */ private getSelectedTemplateJson; changeSelectedTemplate(template: any): void; /** * 取消 */ clickCancel(): void; /** * 触发保存 */ clickSave(): void; private createDynamicItem; /** * 为控件绑定命令,需要根据模板区分 */ private addCommandsToControl; /** * 修改basicFormViewModel,添加字段,默认无分组 */ private addViewModel; /** * 根据实体label获取用于viewModel的bindTo属性 */ private getEntityInfoDataSource; /** * 重置控件id * @param contents * @param idSuffix */ private resetTemplateControlId; private resolveContentsInTemplate; clickSelectAllFieldsCheckbox(): void; selectAllChange(fieldsSource: any): void; clickCheckbox(flag: boolean, rowData: any): void; }