mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-01-18 19:42:49 +08:00
组件tree
This commit is contained in:
parent
5aab9d96c2
commit
70be66fd66
28
data/magic-api/api/系统管理/组件/保存tree.ms
Normal file
28
data/magic-api/api/系统管理/组件/保存tree.ms
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "c01db2a3b18246c89ef1a6ad6b39342c",
|
||||
"script" : null,
|
||||
"groupId" : "6f106ebdee21489db34b956f7770ff03",
|
||||
"name" : "保存tree",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1709468623502,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/save/tree",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
return db.table("sys_dynamic_component").primary("id").saveOrUpdate({
|
||||
pid,
|
||||
name
|
||||
})
|
27
data/magic-api/api/系统管理/组件/获取源码.ms
Normal file
27
data/magic-api/api/系统管理/组件/获取源码.ms
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "2e3a230acf004dcdb679ff3a46a8a20a",
|
||||
"script" : null,
|
||||
"groupId" : "6f106ebdee21489db34b956f7770ff03",
|
||||
"name" : "获取源码",
|
||||
"createTime" : 1709459380012,
|
||||
"updateTime" : null,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/getSourceCode",
|
||||
"method" : "GET",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
return db.selectValue("""
|
||||
select source_code from sys_dynamic_component where is_del=0 and name = #{name}
|
||||
""")
|
31
data/magic-api/api/系统管理/组件/获取组件tree.ms
Normal file
31
data/magic-api/api/系统管理/组件/获取组件tree.ms
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "8ba14d61082e4ba69324fdc9de080f38",
|
||||
"script" : null,
|
||||
"groupId" : "6f106ebdee21489db34b956f7770ff03",
|
||||
"name" : "获取组件tree",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1709459290517,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/tree",
|
||||
"method" : "GET",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"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
|
||||
var list = toTree(db.select('select id,name,pid from sys_dynamic_component where is_del = 0 order by name'),'0')
|
||||
|
||||
return {
|
||||
list: list,
|
||||
total: list.getLength()
|
||||
}
|
Loading…
Reference in New Issue
Block a user