2024-03-03 20:47:53 +08:00
|
|
|
{
|
|
|
|
"properties" : { },
|
|
|
|
"id" : "8ba14d61082e4ba69324fdc9de080f38",
|
|
|
|
"script" : null,
|
|
|
|
"groupId" : "6f106ebdee21489db34b956f7770ff03",
|
|
|
|
"name" : "获取组件tree",
|
|
|
|
"createTime" : null,
|
2024-04-10 20:35:24 +08:00
|
|
|
"updateTime" : 1712742831654,
|
2024-03-03 20:47:53 +08:00
|
|
|
"lock" : null,
|
|
|
|
"createBy" : null,
|
|
|
|
"updateBy" : null,
|
|
|
|
"path" : "/tree",
|
|
|
|
"method" : "GET",
|
|
|
|
"parameters" : [ ],
|
2024-03-10 23:22:31 +08:00
|
|
|
"options" : [ {
|
|
|
|
"name" : "permission",
|
|
|
|
"value" : "component:tree",
|
|
|
|
"description" : "允许拥有该权限的访问",
|
|
|
|
"required" : false,
|
|
|
|
"dataType" : "String",
|
|
|
|
"type" : null,
|
|
|
|
"defaultValue" : null,
|
|
|
|
"validateType" : null,
|
|
|
|
"error" : null,
|
|
|
|
"expression" : null,
|
|
|
|
"children" : null
|
|
|
|
} ],
|
2024-03-03 20:47:53 +08:00
|
|
|
"requestBody" : "",
|
|
|
|
"headers" : [ ],
|
|
|
|
"paths" : [ ],
|
|
|
|
"responseBody" : null,
|
|
|
|
"description" : null,
|
|
|
|
"requestBodyDefinition" : null,
|
|
|
|
"responseBodyDefinition" : null
|
|
|
|
}
|
|
|
|
================================
|
|
|
|
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
|
2024-04-10 20:35:24 +08:00
|
|
|
var list = toTree(db.select("""
|
|
|
|
select
|
|
|
|
dc.id,
|
|
|
|
(case when dc.remark is not null and dc.remark != '' then concat(dc.name,'(',dc.remark, ')') else dc.name end) name,
|
|
|
|
dc.pid,
|
|
|
|
(case when dc.type = 0 then 1 else 0 end) is_group
|
|
|
|
from sys_dynamic_component dc
|
|
|
|
where dc.is_del = 0
|
|
|
|
order by dc.name
|
|
|
|
"""),'0')
|
2024-03-03 20:47:53 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
list: list,
|
|
|
|
total: list.getLength()
|
|
|
|
}
|