xls2ddl/docs/crud_tree.md
2025-11-18 13:32:39 +08:00

28 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 树形结构的数据crud
当一张数据表中存在一个父节点的字段指向本表中另条记录的主键id,那么这个表就是一个树形结构的表
## 树形机构表的crud
json格式的数据
{
"tblname" # 表名
"alias" # 别名当需多个crud界面时可用alias来生成份不同的功能
"uitype": "tree"# 给定uitype为"tree"指定用树状结构数据crud
"title" # 标题,如果不给定,使用数据表定义中的表标题
"params":{ # crud 的参数
"idField": # 必须指定树节点的id字段
"textField" # 指定树节点显示内容字段
"sortby" # 指定排序字段,可以多个字段,用[a desc, b]形式给出按照多个字段排序,"desc“表示倒排不给定就是正排
"editable" # true代表可编辑false表示不可编辑通常给定true
"edit_exclouded_fields" # 设置不参与编辑(新增和修改)字段,数组
"parentField" # 父节点字段
"subtables":[ # 外键清单(表中存在字段指向本表主键记录)
{
"field" # 外键表字段
"title" # 可选,不选用外键表的表标题
"url" # 当alias定义时需要用{{entire_url(...)方式定义指向表的url
"subtable" # 外键表名称
}
],
}
}