btyjj-inspection/src/main/resources/static/route/industryuser/list-tree-industryuser.html
2020-06-30 19:36:51 +08:00

110 lines
4.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<base href="/inspection/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" href="assets/js/vendor/zTree3/css/metroStyle/metroStyle.css"/>
<link rel="stylesheet" href="assets/layuiadmin/style/common.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row layui-col-space15">
<div class="layui-col-md2">
<div class="layui-card">
<div class="layui-card-body left-tree-wrap">
<div id="leftTreeWrap">
<ul id="leftTree" class="ztree"></ul>
</div>
</div>
</div>
</div>
<div class="layui-col-md10">
<div class="layui-card">
<div id="listContentWrap" class="layui-card-body">
<iframe id="listContent" frameborder="0" class="layadmin-iframe"></iframe>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
var common;
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'ztree', 'common'], function() {
common = layui.common;
var $ = layui.$;
var $win = $(window);
var resizeTimeout = null;
var parentId = 0;
var parentName;
// 初始化IFrame
function initIFrame() {
$('#listContent').attr('src', top.restAjax.path('route/industryuser/list-industryuser.html?industryId={parentId}&industryName={parentName}', [parentId, encodeURI(parentName)]));
}
// 初始化大小
function initSize() {
$('#leftTreeWrap').css({
height: $win.height() - 30,
overflow: 'auto'
});
$('#listContentWrap').css({
height: $win.height() - 50,
});
}
// 初始化树
function initThree() {
// 这里之前是行业类型,换成企业分类
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionaryallbyparentid/27694872-7295-4b41-aaa0-297fc6dbac3e', []), {}, null, function(code, data) {
var setting = {
data: {
key: {
title: 'dictionaryName',
name: 'dictionaryName',
id: 'dictionaryId',
// children: 'subDictionary'
},
},
callback: {
onClick: function (event, treeId, treeNode) {
parentId = treeNode.dictionaryId;
parentName = treeNode.dictionaryName;
initIFrame();
return false;
}
},
};
var zTree = $.fn.zTree.init($("#leftTree"), setting, data);
if(data.length > 0) {
parentId = data[0].dictionaryId;
parentName = data[0].dictionaryName;
}
initIFrame();
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initSize();
initThree();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
initSize();
}, 500);
});
});
</script>
</body>
</html>