mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-01-20 20:42:48 +08:00
318 lines
11 KiB
Plaintext
318 lines
11 KiB
Plaintext
{
|
|
"properties" : { },
|
|
"id" : "f7fa03a5d8b64dbaa39387c185a21adb",
|
|
"script" : null,
|
|
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
|
"name" : "列表",
|
|
"createTime" : null,
|
|
"updateTime" : 1642134990129,
|
|
"lock" : "0",
|
|
"method" : "GET",
|
|
"path" : "/tree",
|
|
"parameters" : [ ],
|
|
"option" : "[]",
|
|
"requestBody" : "",
|
|
"headers" : [ ],
|
|
"paths" : [ ],
|
|
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"list\": [{\n \"id\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"name\": \"<font color=\\\"yellow\\\">马小东公司</font>\",\n \"pid\": \"0\",\n \"type\": \"2\",\n \"sort\": 10,\n \"code\": \"mxd\",\n \"children\": [{\n \"id\": \"81b5493cdb31477f9ceea85b2cd08f15\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"mxdz\",\n \"children\": []\n }, {\n \"id\": \"31b365008f994e93850186126fce87cb\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司2</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"mxdzz\",\n \"children\": []\n }]\n }, {\n \"id\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽公司</font>\",\n \"pid\": \"0\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"ljz\",\n \"children\": [{\n \"id\": \"1ae0299fc79b43c6b0ae2e14756ec41a\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽子公司</font>\",\n \"pid\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"ljzz\",\n \"children\": []\n }]\n }],\n \"total\": 2\n },\n \"timestamp\": 1642134812650,\n \"executeTime\": 9\n}",
|
|
"description" : null,
|
|
"requestBodyDefinition" : null,
|
|
"responseBodyDefinition" : {
|
|
"name" : "",
|
|
"value" : "",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Object",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ {
|
|
"name" : "code",
|
|
"value" : "200",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Integer",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "message",
|
|
"value" : "success",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "data",
|
|
"value" : "",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Object",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ {
|
|
"name" : "list",
|
|
"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" : "id",
|
|
"value" : "4c37a80226134bce8bc91c8fc04a7d2f",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "name",
|
|
"value" : "<font color=\\\"yellow\\\">马小东公司</font>",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "pid",
|
|
"value" : "0",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "type",
|
|
"value" : "2",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "sort",
|
|
"value" : "10",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Integer",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "code",
|
|
"value" : "mxd",
|
|
"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" : "id",
|
|
"value" : "81b5493cdb31477f9ceea85b2cd08f15",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "name",
|
|
"value" : "<font color=\\\"yellow\\\">马小东子公司</font>",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "pid",
|
|
"value" : "4c37a80226134bce8bc91c8fc04a7d2f",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "String",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "type",
|
|
"value" : "null",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Object",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "sort",
|
|
"value" : "10",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Integer",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "code",
|
|
"value" : "mxdz",
|
|
"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" : "total",
|
|
"value" : "2",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Integer",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
} ]
|
|
}, {
|
|
"name" : "timestamp",
|
|
"value" : "1642134812650",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Long",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
}, {
|
|
"name" : "executeTime",
|
|
"value" : "9",
|
|
"description" : "",
|
|
"required" : false,
|
|
"dataType" : "Integer",
|
|
"type" : null,
|
|
"defaultValue" : null,
|
|
"validateType" : "",
|
|
"error" : "",
|
|
"expression" : "",
|
|
"children" : [ ]
|
|
} ]
|
|
},
|
|
"optionMap" : { }
|
|
}
|
|
================================
|
|
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,type,sort,code from sys_office where is_del = 0 order by sort'),'0')
|
|
|
|
return {
|
|
list: list,
|
|
total: list.getLength()
|
|
} |