original data format
let obj =[
{1:"20190805",2:"1",3:"success"},
{1:"20191120",2:"1.1",3:"success"},
{1:"20190212",2:"1.1.1",3:"success"},
{1:"20190212",2:"1.1.2",3:"success"},
{1:"20190212",2:"1.1.3",3:"success"},
{1:"20190212",2:"1.2",3:"success"},
{1:"20190212",2:"1.2.1",3:"success"},
{1:"20190212",2:"2",3:"success"},
{1:"20190212",2:"2.1",3:"success"},
{1:"20190212",2:"2.2.1",3:"success"},
{1:"20190212",2:"2.2",3:"success"},
{1:"20190212",2:"2.3",3:"success"},
{1:"20190212",2:"2.3.1",3:"success"},
...
]
finally, I want the following result format. How can I achieve it
?let data = [
{1: "20190805", 2: "1", 3: "success", children: [
{1: "20191120", 2: "1.1", 3: "success", children: [
{1: "20190212", 2: "1.1.1", 3: "success"},
{1: "20190212", 2: "1.1.2", 3: "success"},
{1: "20190212", 2: "1.1.3", 3: "success"},
]}, {1: "20191120", 2: "1.2", 3: "success", children: [
{1: "20190212", 2: "1.2.1", 3: "success"},
]
}]
},
{1: "20190212", 2: "2", 3: "success", children: [
{1: "20190212", 2: "2.1", 3: "success", children: [
{1: "20190212", 2: "2.2.1", 3: "success"},
]},
{1: "20190212", 2: "2.2", 3: "success"},
{1: "20190212", 2: "2.3", 3: "success", children: [
{1: "20190212", 2: "2.3.1", 3: "success"}]
}]
},
...
]