1 Star 0 Fork 54

wxzain/bootstrap-treetable

forked from Swifly/bootstrap-treetable 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
demo_v4.html 58.50 KB
一键复制 编辑 原始数据 按行查看 历史
Swifly 提交于 2018-11-03 22:01 . ### 2018-11-03 更新内容
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>bootstrap-treetable</title>
<meta name="keywords" content="bootstrap-treetable">
<meta name="description" content="bootstrap-treetable">
<link rel="stylesheet" href="./libs/v4/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="./bootstrap-treetable.css" type="text/css" />
</head>
<body>
<div id="demo-toolbar" class="btn-group btn-group-toggle" data-toggle="buttons">
<button id="addBtn" type="button" class="btn btn-secondary">向表格添加数据</button>
<button id="selectBtn" type="button" class="btn btn-secondary">测试选中</button>
<button id="expandRowBtn" type="button" class="btn btn-secondary">展开/折叠【系统管理】</button>
<button id="expandAllBtn" type="button" class="btn btn-secondary">展开/折叠 所有</button>
<button id="showColumnBtn" type="button" class="btn btn-secondary">显示/隐藏 【排序】列</button>
<button id="destroyBtn" type="button" class="btn btn-secondary">销毁</button>
</div>
<table id="demo"></table>
<!-- 全局js -->
<script type="text/javascript" src="./libs/jquery.min.js"></script>
<script type="text/javascript" src="./libs/v4/popper.min.js"></script>
<script type="text/javascript" src="./libs/v4/bootstrap.min.js"></script>
<script type="text/javascript" src="./bootstrap-treetable.js"></script>
<script type="text/javascript">
/**
rootIdValue: null,//设置根节点id值----可指定根节点,默认为null,"",0,"0"
id : "id", // 选取记录返回的值,用于设置父子关系
parentId : "parentId", // 用于设置父子关系
type: 'get', // 请求方式(*)
url: "./data.json", // 请求后台的URL(*)
ajaxParams : {}, // 请求数据的ajax的data属性
expandColumn : 0, // 在哪一列上面显示展开按钮
expandAll : false, // 是否全部展开
expandFirst : true, // 是否默认第一级展开--expandAll为false时生效
toolbar: null,//顶部工具条
height: 0,
expanderExpandedClass : 'glyphicon glyphicon-chevron-down',// 展开的按钮的图标
expanderCollapsedClass : 'glyphicon glyphicon-chevron-right',// 缩起的按钮的图标
**/
var treeTable = $('#demo').bootstrapTreeTable({
toolbar: "#demo-toolbar", //顶部工具条
expandColumn : 1, // 在哪一列上面显示展开按钮
height:500,
columns: [{
field: 'selectItem',
radio: true
},{
title: '菜单名称',
field: 'menuName',
width: '20%',
formatter: function(value,row, index) {
if (row.icon == null || row == "") {
return row.menuName;
} else {
return '<i class="' + row.icon + '"></i> <span class="nav-label">' + row.menuName + '</span>';
}
}
},
{
field: 'orderNum',
title: '排序',
width: '10%',
align: "left",
valign: "bottom",
visible: true
},
{
field: 'url',
title: '请求地址',
width: '15%',
align: "left"
},
{
title: '类型',
field: 'menuType',
width: '10%',
align: "center",
valign: "top",
formatter: function(value,item, index) {
if (item.menuType == 'M') {
return '<span class="label label-success">目录</span>';
}
else if (item.menuType == 'C') {
return '<span class="label label-primary">菜单</span>';
}
else if (item.menuType == 'F') {
return '<span class="label label-warning">按钮</span>';
}
}
},
{
field: 'visible',
title: '可见',
width: '10%',
align: "center",
visible: false,
formatter: function(value,row, index) {
return value;
}
},
{
field: 'perms',
title: '权限标识',
width: '15%',
align: "center",
},
{
title: '操作',
width: '20%',
align: "center",
formatter: function(value,row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs " href="#"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs " href="#"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-danger btn-xs " href="#" ><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}],
data:[{
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1,
"menuName": "系统管理",
"parentName": null,
"parentId": 0,
"orderNum": "1",
"url": "#",
"menuType": "M",
"visible": 0,
"perms": "",
"icon": "glyphicon glyphicon-thumbs-up"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 2,
"menuName": "系统监控",
"parentName": null,
"parentId": 0,
"orderNum": "2",
"url": "#",
"menuType": "M",
"visible": 0,
"perms": "",
"icon": "glyphicon glyphicon-thumbs-up"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 3,
"menuName": "系统工具",
"parentName": null,
"parentId": 0,
"orderNum": "3",
"url": "#",
"menuType": "M",
"visible": 0,
"perms": "",
"icon": "glyphicon glyphicon-thumbs-up"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 100,
"menuName": "用户管理",
"parentName": null,
"parentId": 1,
"orderNum": "1",
"url": "/system/user",
"menuType": "C",
"visible": 0,
"perms": "system:user:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 101,
"menuName": "角色管理",
"parentName": null,
"parentId": 1,
"orderNum": "2",
"url": "/system/role",
"menuType": "C",
"visible": 0,
"perms": "system:role:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 102,
"menuName": "菜单管理",
"parentName": null,
"parentId": 1,
"orderNum": "3",
"url": "/system/menu",
"menuType": "C",
"visible": 0,
"perms": "system:menu:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 103,
"menuName": "部门管理",
"parentName": null,
"parentId": 1,
"orderNum": "4",
"url": "/system/dept",
"menuType": "C",
"visible": 0,
"perms": "system:dept:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 104,
"menuName": "岗位管理",
"parentName": null,
"parentId": 1,
"orderNum": "5",
"url": "/system/post",
"menuType": "C",
"visible": 0,
"perms": "system:post:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 105,
"menuName": "字典管理",
"parentName": null,
"parentId": 1,
"orderNum": "6",
"url": "/system/dict",
"menuType": "C",
"visible": 0,
"perms": "system:dict:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 106,
"menuName": "参数设置",
"parentName": null,
"parentId": 1,
"orderNum": "7",
"url": "/system/config",
"menuType": "C",
"visible": 0,
"perms": "system:config:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 107,
"menuName": "通知公告",
"parentName": null,
"parentId": 1,
"orderNum": "8",
"url": "/system/notice",
"menuType": "C",
"visible": 0,
"perms": "system:notice:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 108,
"menuName": "日志管理",
"parentName": null,
"parentId": 1,
"orderNum": "9",
"url": "#",
"menuType": "M",
"visible": 0,
"perms": "",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 109,
"menuName": "在线用户",
"parentName": null,
"parentId": 2,
"orderNum": "1",
"url": "/monitor/online",
"menuType": "C",
"visible": 0,
"perms": "monitor:online:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 110,
"menuName": "定时任务",
"parentName": null,
"parentId": 2,
"orderNum": "2",
"url": "/monitor/job",
"menuType": "C",
"visible": 0,
"perms": "monitor:job:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 111,
"menuName": "数据监控",
"parentName": null,
"parentId": 2,
"orderNum": "3",
"url": "/monitor/data",
"menuType": "C",
"visible": 0,
"perms": "monitor:data:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 112,
"menuName": "表单构建",
"parentName": null,
"parentId": 3,
"orderNum": "1",
"url": "/tool/build",
"menuType": "C",
"visible": 0,
"perms": "tool:build:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 113,
"menuName": "代码生成",
"parentName": null,
"parentId": 3,
"orderNum": "2",
"url": "/tool/gen",
"menuType": "C",
"visible": 0,
"perms": "tool:gen:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 114,
"menuName": "系统接口",
"parentName": null,
"parentId": 3,
"orderNum": "3",
"url": "/tool/swagger",
"menuType": "C",
"visible": 0,
"perms": "tool:swagger:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 500,
"menuName": "操作日志",
"parentName": null,
"parentId": 108,
"orderNum": "1",
"url": "/monitor/operlog",
"menuType": "C",
"visible": 0,
"perms": "monitor:operlog:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 501,
"menuName": "登录日志",
"parentName": null,
"parentId": 108,
"orderNum": "2",
"url": "/monitor/logininfor",
"menuType": "C",
"visible": 0,
"perms": "monitor:logininfor:view",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1000,
"menuName": "用户查询",
"parentName": null,
"parentId": 100,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:user:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1001,
"menuName": "用户新增",
"parentName": null,
"parentId": 100,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:user:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1002,
"menuName": "用户修改",
"parentName": null,
"parentId": 100,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:user:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1003,
"menuName": "用户删除",
"parentName": null,
"parentId": 100,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:user:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1004,
"menuName": "重置密码",
"parentName": null,
"parentId": 100,
"orderNum": "5",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:user:resetPwd",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1005,
"menuName": "角色查询",
"parentName": null,
"parentId": 101,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:role:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1006,
"menuName": "角色新增",
"parentName": null,
"parentId": 101,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:role:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1007,
"menuName": "角色修改",
"parentName": null,
"parentId": 101,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:role:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1008,
"menuName": "角色删除",
"parentName": null,
"parentId": 101,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:role:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1009,
"menuName": "菜单查询",
"parentName": null,
"parentId": 102,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:menu:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1010,
"menuName": "菜单新增",
"parentName": null,
"parentId": 102,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:menu:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1011,
"menuName": "菜单修改",
"parentName": null,
"parentId": 102,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:menu:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1012,
"menuName": "菜单删除",
"parentName": null,
"parentId": 102,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:menu:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1013,
"menuName": "部门查询",
"parentName": null,
"parentId": 103,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dept:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1014,
"menuName": "部门新增",
"parentName": null,
"parentId": 103,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dept:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1015,
"menuName": "部门修改",
"parentName": null,
"parentId": 103,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dept:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1016,
"menuName": "部门删除",
"parentName": null,
"parentId": 103,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dept:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1017,
"menuName": "岗位查询",
"parentName": null,
"parentId": 104,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:post:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1018,
"menuName": "岗位新增",
"parentName": null,
"parentId": 104,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:post:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1019,
"menuName": "岗位修改",
"parentName": null,
"parentId": 104,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:post:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1020,
"menuName": "岗位删除",
"parentName": null,
"parentId": 104,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:post:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1021,
"menuName": "字典查询",
"parentName": null,
"parentId": 105,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dict:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1022,
"menuName": "字典新增",
"parentName": null,
"parentId": 105,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dict:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1023,
"menuName": "字典修改",
"parentName": null,
"parentId": 105,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dict:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1024,
"menuName": "字典删除",
"parentName": null,
"parentId": 105,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:dict:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1025,
"menuName": "参数查询",
"parentName": null,
"parentId": 106,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:config:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1026,
"menuName": "参数新增",
"parentName": null,
"parentId": 106,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:config:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1027,
"menuName": "参数修改",
"parentName": null,
"parentId": 106,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:config:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1028,
"menuName": "参数删除",
"parentName": null,
"parentId": 106,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:config:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1029,
"menuName": "公告查询",
"parentName": null,
"parentId": 107,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:notice:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1030,
"menuName": "公告新增",
"parentName": null,
"parentId": 107,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:notice:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1031,
"menuName": "公告修改",
"parentName": null,
"parentId": 107,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:notice:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1032,
"menuName": "公告删除",
"parentName": null,
"parentId": 107,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "system:notice:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1033,
"menuName": "操作查询",
"parentName": null,
"parentId": 500,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:operlog:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1034,
"menuName": "操作删除",
"parentName": null,
"parentId": 500,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:operlog:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1035,
"menuName": "详细信息",
"parentName": null,
"parentId": 500,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:operlog:detail",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1036,
"menuName": "登录查询",
"parentName": null,
"parentId": 501,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:logininfor:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1037,
"menuName": "登录删除",
"parentName": null,
"parentId": 501,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:logininfor:remove",
"icon": "#"
}]
});
$("#selectBtn").click(function(){
var selecteds = $('#demo').bootstrapTreeTable('getSelections');
$.each(selecteds,function(_i,_item){
console.log(_item);
});
alert("看console");
})
$("#addBtn").click(function(){
var data = [{
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1038,
"menuName": "在线查询",
"parentName": null,
"parentId": 109,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:online:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1039,
"menuName": "批量强退",
"parentName": null,
"parentId": 109,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:online:batchForceLogout",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1040,
"menuName": "单条强退",
"parentName": null,
"parentId": 109,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:online:forceLogout",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1041,
"menuName": "任务查询",
"parentName": null,
"parentId": 110,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:job:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1042,
"menuName": "任务新增",
"parentName": null,
"parentId": 110,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:job:add",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1043,
"menuName": "任务修改",
"parentName": null,
"parentId": 110,
"orderNum": "3",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:job:edit",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1044,
"menuName": "任务删除",
"parentName": null,
"parentId": 110,
"orderNum": "4",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:job:remove",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1045,
"menuName": "状态修改",
"parentName": null,
"parentId": 110,
"orderNum": "5",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "monitor:job:changeStatus",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1046,
"menuName": "生成查询",
"parentName": null,
"parentId": 113,
"orderNum": "1",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "tool:gen:list",
"icon": "#"
}, {
"searchValue": null,
"createBy": "admin",
"createTime": "2018-03-16 11:33:00",
"updateBy": null,
"updateTime": null,
"remark": null,
"params": null,
"id": 1047,
"menuName": "生成代码",
"parentName": null,
"parentId": 113,
"orderNum": "2",
"url": "#",
"menuType": "F",
"visible": 0,
"perms": "tool:gen:code",
"icon": "#"
}];
$('#demo').bootstrapTreeTable('appendData',data);
})
$("#expandRowBtn").click(function(){
$('#demo').bootstrapTreeTable('toggleRow',1);
})
var _expandFlag_all = false;
$("#expandAllBtn").click(function(){
if(_expandFlag_all){
$('#demo').bootstrapTreeTable('expandAll');
}else{
$('#demo').bootstrapTreeTable('collapseAll');
}
_expandFlag_all = _expandFlag_all?false:true;
})
var _showFlag = true;
$("#showColumnBtn").click(function(){
if(_showFlag){
$('#demo').bootstrapTreeTable('hideColumn',"orderNum");
}else{
$('#demo').bootstrapTreeTable('showColumn',"orderNum");
}
_showFlag = _showFlag?false:true;
})
$("#destroyBtn").click(function(){
$('#demo').bootstrapTreeTable('destroy');
})
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/wxzain/bootstrap-treetable.git
[email protected]:wxzain/bootstrap-treetable.git
wxzain
bootstrap-treetable
bootstrap-treetable
master

搜索帮助