一、展示效果(treetable基本样式https://www.cnblogs.com/shuihanxiao/p/10413454.html)
二、html文件(若一个页面又多个treetable,必须把所有table的html拼接好后,再调用treetable,treetable的js只初始化一次)
<!DOCTYPE html>
<html lang="en" style="height: 100%;">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="css/screen.css" media="screen"/>
<link rel="stylesheet" href="css/jquery.treetable.css"/>
<link rel="stylesheet" href="css/jquery.treetable.theme.default.css"/>
<style>
#parentId {
display: inline-block;
height: 100%;
width: 100%;
padding: 6px 12px;
border: 1px solid #ccc;
border-radius: 4px;
outline: none;
}
thead {
text-align: center;
}
th {
text-align: center;
}
td {
text-align: center;
}
table.treetable thead tr th {
background: #f2f2f2 !important;
border-top: 1px solid #ddd !important;
border-right: 1px solid #ddd !important;
padding: 8px 10px !important;
color: #555;
font-weight: 700;
text-align: center !important;
}
table.treetable tbody tr td {
padding: 8px 10px !important;
color: #555;
panel panel-default
text-align: center !important;
}
table.treetable tbody tr td:nth-of-type(1) {
text-align: left !important;
}
table.treetable tbody tr td a {
text-decoration: none !important;
color: #2fa4e7;
}
table.treetable tbody tr td a:hover {
color: #157ab5;
text-decoration: none;
}
table.treetable tr.selected {
background: #ffffff !important;
color: #000000 !important;
}
.table th, .table td {
border-left: 1px solid #ddd !important;
border-bottom: 1px solid #ddd !important;
border-right: 1px solid #ddd !important;
}
#example-advanced, #example-advanced1 {
top: 70px;
position: absolute;
}
.tabBox {
padding-left: 4px;
padding-top: 10px;
background: #eee;
overflow: hidden;
}
.tab-item {
float: left;
border-radius: 3px;
padding: 10px;
}
.tab-item-active {
background: #fff;
}
.interfaceInfoBase {
font-size: 13px;
color: #666;
}
.interfaceTitle {
font-size: 14px;
color: #333;
font-weight: 700;
}
.interfaceTitle > div, .interfaceTitle > div {
line-height: 20px;
}
</style>
</head>
<body style='overflow:scroll;overflow-x:hidden;height: 100%;margin: 0'>
<script type="text/javascript">
// $(document).ready(function() {
// $("#treeTable").treeTable({expandLevel : 2});
// });
</script>
<div class="container bs-docs-container" style="width:100%;height: 100%;">
<div class="row" style="height: 100%;">
<div id="interfaceId" style="display: none">
$!{jropenInterfaceInfo.id}
</div>
<form role="form" class="form-horizontal" action="/documentCategory/list" method="post" id="formSubmit"
style="height: 100%;width: 100%">
<div class="col-md-10" style="width:100%;height: 100%">
<div class="panel panel-default" style="height: 100%">
<div class="panel-body">
<!-- 接口基本信息-->
<div>
<div style="interfaceInfoBase">
<div><span style="font-size: 16px;font-weight: 700">参数参数参数参数参数$!{jropenInterfaceInfo.jropenInterfaceInfo.interfaceName}</span><span
style="font-size: 12px;color: #666;margin-left: 15px">1.0.1$!{jropenInterfaceInfo.jropenInterfaceInfo.interfaceName}</span>
</div>
</div>
<div id="fadeBox">
<div>
<span class="interfaceTitle">外部请求接口地址</span>
<span>$!{jropenInterfaceInfo.jropenInterfaceInfo.interfaceName}</span>
</div>
</div>
</div>
<!-- 编辑折叠按钮-->
<div>
<div id="legend" class="mb20 mt15">
<legend class="le" style="overflow: hidden">
<button id="adDocumentCategory" type="button" class="btn btn-primary"
style="float:left"
οnclick="doFadeToggel()">折叠
</button>
</legend>
</div>
</div>
<!-- table切换头-->
<div style="position: relative">
<div class="tabBox">
<div class="tab-item tab-item-active tab-item1">请求参数</div>
<div class="tab-item tab-item2">响应参数</div>
</div>
<table id="example-advanced"
class="example-advanced table table-striped table-bordered table-condensed tree_table">
<thead>
<tr>
<th><span>参数</span></th>
<th><span>参数名称</span></th>
<th><span>数据类型</span></th>
<th><span>参数类型</span></th>
<th><span>必填</span></th>
<th><span>业务字段编码</span></th>