.markdown-body { line-height: 1.75; font-weight: 400; font-size: 16px; overflow-x: hidden; color: rgba(37, 41, 51, 1) }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { line-height: 1.5; margin-top: 35px; margin-bottom: 10px; padding-bottom: 5px }
.markdown-body h1 { font-size: 24px; line-height: 38px; margin-bottom: 5px }
.markdown-body h2 { font-size: 22px; line-height: 34px; padding-bottom: 12px; border-bottom: 1px solid rgba(236, 236, 236, 1) }
.markdown-body h3 { font-size: 20px; line-height: 28px }
.markdown-body h4 { font-size: 18px; line-height: 26px }
.markdown-body h5 { font-size: 17px; line-height: 24px }
.markdown-body h6 { font-size: 16px; line-height: 24px }
.markdown-body p { line-height: inherit; margin-top: 22px; margin-bottom: 22px }
.markdown-body img { max-width: 100% }
.markdown-body hr { border-top: 1px solid rgba(221, 221, 221, 1); border-right: none; border-bottom: none; border-left: none; margin-top: 32px; margin-bottom: 32px }
.markdown-body code { border-radius: 2px; overflow-x: auto; background-color: rgba(255, 245, 245, 1); color: rgba(255, 80, 44, 1); font-size: 0.87em; padding: 0.065em 0.4em }
.markdown-body code, .markdown-body pre { font-family: Menlo, Monaco, Consolas, Courier New, monospace }
.markdown-body pre { overflow: auto; position: relative; line-height: 1.75 }
.markdown-body pre>code { font-size: 12px; padding: 15px 12px; margin: 0; word-break: normal; display: block; overflow-x: auto; color: rgba(51, 51, 51, 1); background: rgba(248, 248, 248, 1) }
.markdown-body a { text-decoration: none; color: rgba(2, 105, 200, 1); border-bottom: 1px solid rgba(209, 233, 255, 1) }
.markdown-body a:active, .markdown-body a:hover { color: rgba(39, 91, 140, 1) }
.markdown-body table { display: inline-block !important; font-size: 12px; width: auto; max-width: 100%; overflow: auto; border: 1px solid rgba(246, 246, 246, 1) }
.markdown-body thead { background: rgba(246, 246, 246, 1); color: rgba(0, 0, 0, 1); text-align: left }
.markdown-body tr:nth-child(2n) { background-color: rgba(252, 252, 252, 1) }
.markdown-body td, .markdown-body th { padding: 12px 7px; line-height: 24px }
.markdown-body td { min-width: 120px }
.markdown-body blockquote { color: rgba(102, 102, 102, 1); padding: 1px 23px; margin: 22px 0; border-left: 4px solid rgba(203, 203, 203, 1); background-color: rgba(248, 248, 248, 1) }
.markdown-body blockquote:after { display: block; content: "" }
.markdown-body blockquote>p { margin: 10px 0 }
.markdown-body ol, .markdown-body ul { padding-left: 28px }
.markdown-body ol li, .markdown-body ul li { margin-bottom: 0; list-style: inherit }
.markdown-body ol li .task-list-item, .markdown-body ul li .task-list-item { list-style: none }
.markdown-body ol li .task-list-item ol, .markdown-body ol li .task-list-item ul, .markdown-body ul li .task-list-item ol, .markdown-body ul li .task-list-item ul { margin-top: 0 }
.markdown-body ol ol, .markdown-body ol ul, .markdown-body ul ol, .markdown-body ul ul { margin-top: 3px }
.markdown-body ol li { padding-left: 6px }
.markdown-body .contains-task-list { padding-left: 0 }
.markdown-body .task-list-item { list-style: none }
@media (max-width: 720px) { .markdown-body h1 { font-size: 24px } .markdown-body h2 { font-size: 20px } .markdown-body h3 { font-size: 18px } }.markdown-body pre, .markdown-body pre>code.hljs { color: rgba(51, 51, 51, 1); background: rgba(248, 248, 248, 1) }
.hljs-comment, .hljs-quote { color: rgba(153, 153, 136, 1); font-style: italic }
.hljs-keyword, .hljs-selector-tag, .hljs-subst { color: rgba(51, 51, 51, 1); font-weight: 700 }
.hljs-literal, .hljs-number, .hljs-tag .hljs-attr, .hljs-template-variable, .hljs-variable { color: rgba(0, 128, 128, 1) }
.hljs-doctag, .hljs-string { color: rgba(221, 17, 68, 1) }
.hljs-section, .hljs-selector-id, .hljs-title { color: rgba(153, 0, 0, 1); font-weight: 700 }
.hljs-subst { font-weight: 400 }
.hljs-class .hljs-title, .hljs-type { color: rgba(68, 85, 136, 1); font-weight: 700 }
.hljs-attribute, .hljs-name, .hljs-tag { color: rgba(0, 0, 128, 1); font-weight: 400 }
.hljs-link, .hljs-regexp { color: rgba(0, 153, 38, 1) }
.hljs-bullet, .hljs-symbol { color: rgba(153, 0, 115, 1) }
.hljs-built_in, .hljs-builtin-name { color: rgba(0, 134, 179, 1) }
.hljs-meta { color: rgba(153, 153, 153, 1); font-weight: 700 }
.hljs-deletion { background: rgba(255, 221, 221, 1) }
.hljs-addition { background: rgba(221, 255, 221, 1) }
.hljs-emphasis { font-style: italic }
.hljs-strong { font-weight: 700 }
[ {  "componentCount": 5,  "categories": [    {      "componentCount": 5,      "elements": [        {          "newName": "Generic - 200mm",          "oldComponentKey": "M1697679454017_144344",          "oldName": "Generic - 200mm",          "newComponentKey": "M1697680099315_144344",          "type": "attribute"        },        {          "newName": "Interior - 138mm Partition (1-hr)",          "oldComponentKey": "M1697679454017_143858",          "oldName": "Interior - 138mm Partition (1-hr)",          "newComponentKey": "M1697680099315_143858",          "type": "geometry"        },        {          "newName": "Generic - 200mm",          "oldComponentKey": "M1697679454017_154279",          "oldName": "Generic - 200mm",          "newComponentKey": "M1697680099315_154279",          "type": "both"        },        {          "newName": "Generic - 200mm",          "oldComponentKey": "M1697679454017_150861",          "oldName": "Generic - 200mm",          "newComponentKey": "M1697680099315_150861",          "type": "attribute"        },        {          "newName": "Generic - 200mm",          "oldComponentKey": "M1697679454017_151331",          "oldName": "Generic - 200mm",          "newComponentKey": "M1697680099315_151331",          "type": "attribute"        }      ],
"categoryName": "墙"
}
]
}
]

这个是我们将数据展示成这样

这是我们的数据结构

[{	"id": 0,	"label": "全部",	"children": [{		"label": "屋顶",		"componentCount": 1,		"componentKey": "",		"id": 1,		"children": [{			"label": "对比组",			"id": 1,			"children": [{				"label": "新Concrete Deck - Tapered Insulation",				"id": "M1598257565598_1400561",				"componentKey": "新M1598257565598_140056",				"type": "new"			}, {				"label": "旧Concrete Deck - Tapered Insulation",				"id": "M1608039229034_1400561",				"componentKey": "新M1608039229034_140056",				"type": "old"			}]
}]
}, {
"label": "模型组",
"componentCount": 2,
"componentKey": "",
"id": 2,
"children": [{
"label": "对比组",
"id": 2,
"children": [{
"label": "新Array Group 1",
"id": "M1598257565598_1328311",
"componentKey": "新M1598257565598_132831",
"type": "new"
}, {
"label": "旧Array Group 1",
"id": "M1608039229034_1328311",
"componentKey": "新M1608039229034_132831",
"type": "old"
}]
},
{
"label": "对比组2",
"id": 3,
"children": [{
"label": "新Array Group 1",
"id": "M1598257565598_1328311",
"componentKey": "新M1598257565598_132831",
"type": "new"
}, {
"label": "旧Array Group 1",
"id": "M1608039229034_1328311",
"componentKey": "新M1608039229034_132831",
"type": "old"
}]
} ]
}]
}]
  componentList.changDataList = [{
id: 0,
label: "全部",
children: [...changeDataChenged(res.data.data.changed.categories)]
}] const changeDataChenged = (data: any) => {
return data.map((item: any, index: number) => {
return {
label: item.categoryName ,
componentCount: item.componentCount ? item.componentCount : 1,
componentKey: item.componentKey ? item.componentKey : '',
id: item.componentKey ? item.componentKey : index + 1,
children: item.elements.length>0 ? item.elements.map((el:any,ind:any)=>{
return {
label: '对比组'+(ind+1),
id: item.componentKey ? item.componentKey : index + 1,
children: [
{
label: '新' +el.newName,
id: el.newComponentKey + 1,
componentKey: '新' + el.newComponentKey,
type: "new"
},
{
label: '旧' + el.oldName,
id: el.oldComponentKey + 1,
componentKey: '旧' + el.oldComponentKey,
type: "old"
}
]
}
}) : []
}
})
}

更改后端的数据格式适配el-tree组织树的更多相关文章

  1. 组织树查询-Jvava实现(递归)

    1.首先查询出组织机构 就是一个简单的查询 List<Dept> deptList = mapper.getDeptList(); Map<Long, OrgNode> nod ...

  2. Mysql B-Tree, B+Tree, B*树介绍

    [摘要] 最近在看Mysql的存储引擎中索引的优化,神马是索引,支持啥索引.全是浮云,目前Mysql的MyISAM和InnoDB都支持B-Tree索引,InnoDB还支持B+Tree索引,Memory ...

  3. 【数据结构】B-Tree, B+Tree, B*树介绍

    [摘要] 最近在看Mysql的存储引擎中索引的优化,神马是索引,支持啥索引.全是浮云,目前Mysql的MyISAM和InnoDB都支持B-Tree索引,InnoDB还支持B+Tree索引,Memory ...

  4. 【数据结构】B-Tree, B+Tree, B*树介绍 转

    [数据结构]B-Tree, B+Tree, B*树介绍 [摘要] 最近在看Mysql的存储引擎中索引的优化,神马是索引,支持啥索引.全是浮云,目前Mysql的MyISAM和InnoDB都支持B-Tre ...

  5. B-Tree, B+Tree, B*树介绍

    [数据结构]B-Tree, B+Tree, B*树介绍 转   [数据结构]B-Tree, B+Tree, B*树介绍 [摘要] 最近在看Mysql的存储引擎中索引的优化,神马是索引,支持啥索引.全是 ...

  6. Mysql存储引擎之TokuDB以及它的数据结构Fractal tree(分形树)

    在目前的Mysql数据库中,使用最广泛的是innodb存储引擎.innodb确实是个很不错的存储引擎,就连高性能Mysql里都说了,如果不是有什么很特别的要求,innodb就是最好的选择.当然,这偏文 ...

  7. 页面设计--Tree目录树

    Tree目录树控件属性: 根据数据集合来配置相应的信息 加载模式有自动加载.自定加载 web中显示效果图:

  8. [转] Splay Tree(伸展树)

    好久没写过了,比赛的时候就调了一个小时,差点悲剧,重新复习一下,觉得这个写的很不错.转自:here Splay Tree(伸展树) 二叉查找树(Binary Search Tree)能够支持多种动态集 ...

  9. CJOJ 1976 二叉苹果树 / URAL 1018 Binary Apple Tree(树型动态规划)

    CJOJ 1976 二叉苹果树 / URAL 1018 Binary Apple Tree(树型动态规划) Description 有一棵苹果树,如果树枝有分叉,一定是分2叉(就是说没有只有1个儿子的 ...

  10. FineReport中如何制作树数据集来实现组织树报表

    1. 问题描述 FineReport,组织树报表中由id与父id来实现组织树报表,若层级数较多时,对每个单元格设置过滤条件和形态会比较繁琐,因此FineReport提供了一种特殊的数据集——树数据集, ...

随机推荐

  1. 【Lodop】02 C-Lodop手册阅读上手

    版本:4.0.6.2 一.概述 C-Lodop云打印是一款精巧快捷的云打印服务产品,以Lodop功能语句为基础,JS语句实现远程打印 移动设备+Wifi+普通打印机+集中打印 C-Lodop对客户端浏 ...

  2. 【转载】 CPU漏洞 —— 一步一步理解CPU芯片漏洞:Meltdown与Spectre

    原文: https://www.freebuf.com/articles/system/159811.html 参考: https://blog.csdn.net/xy010902100449/art ...

  3. 恭喜又一白鲸开源成员成为 Apache SeaTunnel PMC Member

    个人简介 王海林 白鲸开源研发工程师 GitHub ID:hailin0 做过性能监控.数据开发平台等,目前聚焦在数据集成同步及其周边生态的研发 问:作为白鲸开源的一员,您为社区做出过哪些贡献?具体方 ...

  4. 第 358 场周赛 - 力扣(LeetCode)

    第 358 场周赛 - 力扣(LeetCode) 2815. 数组中的最大数对和 - 力扣(LeetCode) 双for遍历即可 class Solution { public: int maxSum ...

  5. 国内IT行业67家外包公司,有多少程序员在里面待过?

    之前写过一篇关于外包公司的文章, <什么是软件外包公司?要不要去外包公司?> 很多粉丝看了后,感觉都在说自己, 存在即合理, 外包大幅度降(可)低(以)了(压)用(榨)人(更)成(多)本( ...

  6. Camera | 4.瑞芯微平台MIPI摄像头应用程序编写

    前面3篇我们讲解了camera的基础概念,MIPI协议,CSI2,常用命令等,本文带领大家入门,如何用c语言编写应用程序来操作摄像头. Linux下摄像头驱动都是基于v4l2架构,要基于该架构编写摄像 ...

  7. JavaScript设计模式样例八 —— 适配器模式

    适配器模式(Adapter Pattern) 定义:将一个类的接口转换成客户希望的另外一个接口,使得原本由于接口不兼容而不能一起工作的那些类能一起工作.目的:主要解决在软件系统中,常常要将一些&quo ...

  8. vmware创建虚拟机

    1.vmware创建麒麟虚拟机 选择安装程序光盘映像文件,会最小化安装桌面版本,新的镜像可能识别不到,比如麒麟等. 麒麟系统类似于欧拉,欧拉类似于CentOS,所以我们选择CentOS 修改虚拟机名称 ...

  9. 图穷匕见-所有反DDD模式都是垃圾

    本文书接上回<主观与客观,破除DDD凭经验魔咒>,关注公众号(老肖想当外语大佬)获取信息: 最新文章更新: DDD框架源码(.NET.Java双平台): 加群畅聊,建模分析.技术实现交流: ...

  10. 光影精灵10 Win1+Ubuntu18.04 双系统 踩坑记录

    前言 第二年准备报名智能车了,当然还是创意组别.刚好买了今年新出的电脑光影精灵10,我想着也给它安一个双系统.但是没想到,相比于之前那个老电脑,新电脑的新硬件和驱动问题远比老电脑麻烦的多. 在经历了一 ...