UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

95 lines (94 loc) 3.02 kB
import { DesignerHostService } from "../../../designer-canvas"; /** * 视图模型字段及分组树列表数据源实体 */ export interface FieldTreeNode { canChangeControlType: boolean; children: FieldTreeNode[]; componentId: string; componentType: string; control: any; data: any; expanded: boolean; groupId: string; isBindVariable: boolean; isComplexField: boolean; isGroupNode: boolean; isInGroupNode: boolean; isNoBinding: boolean; isRemoved: boolean; nodeType: string; } /** * 构造视图模型字段及分组树列表数据源 */ export declare class FieldTreeBuilder { private designerHostService; private componentId; private controlsInfo; formSchemaUtils: any; designViewModelUtils: any; private viewModelId; constructor(designerHostService: DesignerHostService, componentId: string); /** * 构造视图模型字段及分组树列表数据源 * @param viewModelId 视图模型标识 */ buildFieldTreeData(): FieldTreeNode[]; /** * 获取指定组件实例内的所有UI控件 * @param component 组件实例 */ private getAllControlsInComponents; /** * 根据组件内控件顺序构造包含分组的视图模型字段树所需要的数据源 * @param dgViewModelFields 视图模型字段集合 * @param controls 视图模型对应组件内的UI控件集合 * @param componentType 组件类型 */ private buildFieldTreeDataByControls; /** * 由UI控件元素及视图模型字段集合构造树节点 * @param control UI控件元素 * @param dgViewModelFields 视图模型字段集合 * @param componentId 组件标识 * @param componentType 组件类型 */ private buildFieldTreeNodeFromControl; /** * 构造仅有控件,没有绑定视图模型字段的节点 * @param control UI控件元素 */ private buildFieldTreeNodeWithoutControlBinding; /** * 构造绑定了视图模型变量的字段节点 * @param control UI控件元素 */ private buildFieldTreeNodeWithBindingVariable; /** * 构造绑定了视图模型字段的树节点 * @param control UI控件元素 * @param dgViewModelFields 视图模型字段集合 * @param componentId 组件标识 * @param componentType 组件类型 */ private buildFieldTreeNodeWithBindingEntityField; /** * 构造字段分组节点 * @param control UI控件元素 * @param dgViewModelFields 视图模型字段集合 * @param fieldsetList FieldSet元素集合 */ private buildFieldTreeGroupNodeWithBindingEntityField; /** * 获取组件内的集合类控件节点 * response-form、data-grid、tree-grid * @param contents 容器 */ private getFormLayoutInCmp; /** * 获取组件中绑定字段/变量的所有控件 * @param contents 组件内容 */ private getAllControlsInLayout; }