• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Tree-Table Configuration:How to Configure Tree-Tables


I. Left Tree as Model A, Right Table as Model B

Take Model A as Category and Model B as Category Attributes as an example. Model code example:

@Model.model(AriesPlatformCategory.MODEL_MODEL)
@Model(displayName = "Platform Background Category", labelFields = "name")
@Model.Advanced(type = ModelTypeEnum.PROXY)
public class AriesPlatformCategory extends AriesCategory {
    public static final String MODEL_MODEL = "aries.item.AriesPlatformCategory";

    @Field.many2one
    @Field.Relation(relationFields = {"parentCateCode"}, referenceFields = {"code"},store = true)
    @Field(displayName = "Platform Parent Category")
    private AriesPlatformCategory platformCategory;

    @Field.one2many
    @Field(displayName = "Category Attributes")
    @Field.Relation(relationFields = "code", referenceFields = "categoryCode", store = true)
    private List<AriesPlatformCategoryAttr> platformCategoryAttrs;

}
@Model.model(AriesPlatformCategoryAttr.MODEL_MODEL)
@Model(displayName = "Aries_Platform Category Attributes", labelFields = "name")
@Model.Advanced(type = ModelTypeEnum.PROXY)
public class AriesPlatformCategoryAttr extends CategoryAttr {
    public static final String MODEL_MODEL = "aries.item.AriesPlatformCategoryAttr";

    @Field.many2one
    @Field(displayName = "Platform Background Category")
    @Field.Relation(relationFields = "categoryCode", referenceFields = "code", store = true)
    private AriesPlatformCategory platformCategory;

}

Before designing the left tree-right table in the designer, the association relationships need to be configured in the model. The following code configures the association between categories and parent categories.

@Field.many2one
@Field.Relation(relationFields = {"parentCateCode"}, referenceFields = {"code"},store = true)
@Field(displayName = "Platform Parent Category")
private AriesPlatformCategory platformCategory;

Configure the association between categories and category attributes. One category can have multiple category attributes, a one-to-many (one2many) relationship.

@Field.one2many
@Field(displayName = "Category Attributes")
@Field.Relation(relationFields = "code", referenceFields = "categoryCode", store = true)
private List<AriesPlatformCategoryAttr> platformCategoryAttrs;

In the category attribute model, configure the association between attributes and categories. One category attribute belongs to only one category, while one category can have multiple category attributes. Category attributes have a many-to-one (many2one) relationship with categories.

@Field.many2one
@Field(displayName = "Platform Background Category")
@Field.Relation(relationFields = "categoryCode", referenceFields = "code", store = true)
private AriesPlatformCategory platformCategory;

Designer examples:

  1. Select Platform Category Attributes as the main model to create a tree-table page Build the association relationship, select Platform Background Category, set the first-level filter condition as empty parent code, and select Platform Category Attributes as the table association relationship field.
  2. Build the association relationship, select Platform Background Category, set the first-level filter condition as empty parent code, and select Platform Category Attributes as the table association relationship field.
  3. Drag and drop the required attribute fields in the table

II. Left Tree as Model A, Right Table also as Model A

Take Model A as Organizational Structure Management for both left and right as an example.

(I) Model Code Example:

@Model.model(BasicOrg.MODEL_MODEL)
@Model(displayName = "Organizational Structure Management", summary = "Organizational Structure Management", labelFields = {"orgName"})
@Model.Code(sequence = "ORDERLY_SEQ", prefix = "Org", size = 5, initial = 0)
public class BasicOrg {
    public static final String MODEL_MODEL = "basic.BasicOrg";

    @Field.String
    @Field(displayName = "Name")
    private String orgName;

    @Field.Enum
    @Field(displayName = "Organization Type", summary = "Organization Type")
    private OrgTypeEnum deptType;

    @Field.Enum
    @Field(displayName = "Factory Type", summary = "Visible when organization type is factory")
    private FactoryTypeEnum factoryType;

    @Field.Enum
    @Field(displayName = "Warehouse Type", summary = "Visible when organization type is warehouse")
    private WarehouseTypeEnum warehouseType;

    @Field.String
    @Field(displayName = "Principal", summary = "Principal")
    private String principal;

    @Field.String
    @Field(displayName = "Contact Number", summary = "Contact Number")
    private String phone;

    @Field(displayName = "Parent Organization")
    @Field.many2one
    @Field.Relation(relationFields = {"parentCode"}, referenceFields = {"code"})
    private BasicOrg parent;

    @Field.Text
    @Field(displayName = "Remarks")
    private String remark;

    @Field.Enum
    @Field(displayName = "Data Status", required = true, defaultValue = "ENABLED")
    private DataStatusEnum dataStatus;

    @Field.String
    @Field(displayName = "Parent Organization Code")
    private String parentCode;

    @Field.String(size = 256)
    @Field(displayName = "Tree Code", required = true)
    private String treeCode;

    @Field.one2many
    @Field.Relation(relationFields = "id", referenceFields = "orgId")
    @Field(displayName = "Basic - Affiliated Organization Employees")
    private List<BasicEmployee> basicEmployees;
}

Configure self-association:

@Field(displayName = "Parent Organization")
@Field.many2one
@Field.Relation(relationFields = {"parentCode"}, referenceFields = {"code"})
private BasicOrg parent;

(II) Designer Operations:

  1. Select the model Organizational Structure Management, create a page, choose Table as the view type, and select Tree-Table as the layout.
  1. Set the linkage relationship: select Organizational Structure Management as the model; set the first-level filter condition as empty parent code, and select Organizational Structure Management - Parent Organization (field name: parent) as the table association relationship field.
  2. Drag and drop the required attribute fields in the table.
Edit this page
Last Updated:1/15/26, 4:02 AM
Prev
Permission Extension:How to Skip Fixed Path Permissions
Next
Validation Customization:How to Implement Special Requirements with Custom Expressions? Extending Built-in Function Expressions
默认页脚
Copyright © 2026 Mr.Hope