改字段名

This commit is contained in:
zegezy 2023-04-01 23:20:47 +08:00
parent f9b24bded4
commit f90f15f51f
2 changed files with 153 additions and 21 deletions

View File

@ -5,7 +5,7 @@
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
"name" : "所有机构",
"createTime" : null,
"updateTime" : 1651892081106,
"updateTime" : 1680361919209,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
@ -16,7 +16,7 @@
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1651892073882,\n \"executeTime\": null\n}",
"responseBody" : "{\n \"code\": 500,\n \"message\": \"系统内部出现错误\",\n \"data\": null,\n \"timestamp\": 1680361909126,\n \"executeTime\": 175\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
@ -32,7 +32,7 @@
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "402",
"value" : "500",
"description" : "",
"required" : false,
"dataType" : "Integer",
@ -44,7 +44,7 @@
"children" : [ ]
}, {
"name" : "message",
"value" : "凭证已过期",
"value" : "系统内部出现错误",
"description" : "",
"required" : false,
"dataType" : "String",
@ -68,7 +68,7 @@
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1651892073882",
"value" : "1680361909126",
"description" : "",
"required" : false,
"dataType" : "Long",
@ -80,7 +80,7 @@
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "null",
"value" : "175",
"description" : "",
"required" : false,
"dataType" : "Integer",
@ -92,10 +92,10 @@
"children" : [ ]
} ]
}
}
================================
var toTree = (list,pid) => select t.*,toTree(list,t.value) children from list t where t.pid = pid
var list = toTree(db.select('select id value,name label,pid from sys_office where is_del = 0 order by sort'),'0')
}
================================
var toTree = (list,pid) => select t.*,toTree(list,t.key) children from list t where t.pid = pid
var list = toTree(db.select('select id "key",name label,pid from sys_office where is_del = 0 order by sort'),'0')
return {
list: list,

View File

@ -5,7 +5,7 @@
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "选择组件",
"createTime" : null,
"updateTime" : 1655521303906,
"updateTime" : 1680361687356,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
@ -16,7 +16,7 @@
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 500,\n \"message\": \"系统内部出现错误\",\n \"data\": null,\n \"timestamp\": 1655521300755,\n \"executeTime\": 17\n}",
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [{\n \"value\": \"55ff62aa20144b7bb5c6dfb5d76c8139\",\n \"label\": \"数据管理(/data)\",\n \"children\": [{\n \"value\": \"eb5dbed949de4f50ba4bf59f483252a5\",\n \"label\": \"测试生成(/test)\",\n \"children\": [{\n \"value\": \"data-test-list\",\n \"label\": \"列表(/list)\"\n }]\n }]\n }],\n \"timestamp\": 1680361660407,\n \"executeTime\": 17\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
@ -32,7 +32,7 @@
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "500",
"value" : "200",
"description" : "",
"required" : false,
"dataType" : "Integer",
@ -44,7 +44,7 @@
"children" : [ ]
}, {
"name" : "message",
"value" : "系统内部出现错误",
"value" : "success",
"description" : "",
"required" : false,
"dataType" : "String",
@ -56,7 +56,7 @@
"children" : [ ]
}, {
"name" : "data",
"value" : "null",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
@ -65,10 +65,142 @@
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
"children" : [ {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "value",
"value" : "55ff62aa20144b7bb5c6dfb5d76c8139",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "label",
"value" : "数据管理(/data)",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "children",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Array",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "value",
"value" : "eb5dbed949de4f50ba4bf59f483252a5",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "label",
"value" : "测试生成(/test)",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "children",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Array",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "value",
"value" : "data-test-list",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "label",
"value" : "列表(/list)",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
} ]
} ]
} ]
} ]
} ]
}, {
"name" : "timestamp",
"value" : "1655521300755",
"value" : "1680361660407",
"description" : "",
"required" : false,
"dataType" : "Long",
@ -92,13 +224,13 @@
"children" : [ ]
} ]
}
}
================================
}
================================
import org.ssssssss.magicapi.utils.PathUtils
import org.ssssssss.magicapi.core.service.MagicResourceService
var getFiles = (groupId) => {
return MagicResourceService.listFiles(groupId).map(file => {
value: PathUtils.replaceSlash(String.format("%s/%s", MagicResourceService.getGroupPath(file.groupId), file.path)).replace(/^\//,'').replace(/\/\//, '/').replace('/', '-'),
key: PathUtils.replaceSlash(String.format("%s/%s", MagicResourceService.getGroupPath(file.groupId), file.path)).replace(/^\//,'').replace(/\/\//, '/').replace('/', '-'),
label: `${file.name}(${file.path})`
})
}
@ -106,7 +238,7 @@ var toTree = (children) => {
var treeData = []
children.forEach(it => {
var chi = {}
chi.value = it.node.id
chi.key = it.node.id
chi.label = `${it.node.name}(${it.node.path})`
if(it.children.length > 0){
chi.children = toTree(it.children)