131 lines
5.7 KiB
HTML
131 lines
5.7 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>layui</title>
|
||
<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, maximum-scale=1">
|
||
<link rel="stylesheet" href="../../../lib/layui-v2.5.5/css/layui.css" media="all">
|
||
<link rel="stylesheet" href="../../../css/public.css" media="all">
|
||
<style>
|
||
body {
|
||
background-color: #ffffff;
|
||
}
|
||
</style>
|
||
</head>
|
||
|
||
<body class="layui-layout-body layuimini-all">
|
||
<div class="layui-layout layui-layout-admin" style="width: 14.5%;height: 100%; float: left;">
|
||
<div class="layui-btn-container">
|
||
<button type="button" class="layui-btn layui-btn-sm" lay-demo="addProject">新增项目</button>
|
||
</div>
|
||
|
||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0;">
|
||
<legend>项目目录</legend>
|
||
</fieldset>
|
||
<div id="ProjectTree" class="demo-tree"></div>
|
||
</div>
|
||
<div style="width: 85%;height: 100%;float: right;border:1px solid #ccc;">
|
||
<iframe src="MainPage.html" frameborder="0" id="iFramePage"
|
||
style="width: 100%; height:800px; border-radius: 2px;"></iframe>
|
||
</div>
|
||
|
||
|
||
<script src="../../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
|
||
<script src="../../../js/md5/md5.js" charset="utf-8"></script>
|
||
<script src="../../../js/PublicParameters/PublicParameters.js" charset="utf-8"></script>
|
||
<script>
|
||
layui.use(['tree', 'util', 'form'], function () {
|
||
var tree = layui.tree
|
||
, layer = layui.layer
|
||
, util = layui.util
|
||
, $ = layui.$
|
||
, form = layui.form;
|
||
|
||
var apiUrl = GetWebApiUrl();
|
||
//数据模型
|
||
var dataMolde =
|
||
[
|
||
{
|
||
title: '一级1'
|
||
, id: 1
|
||
, field: 'name1'
|
||
, href: 'https://www.layui.com/'
|
||
, children: [{
|
||
title: '二级1-1 可允许跳转'
|
||
, id: 3
|
||
, field: 'name11'
|
||
, href: 'https://www.layui.com/'
|
||
}, {
|
||
title: '二级1-2'
|
||
, id: 4
|
||
, field: 'name11'
|
||
, href: 'https://www.layui.com/'
|
||
}, {
|
||
title: '二级1-3'
|
||
, id: 20
|
||
, field: 'name11'
|
||
, href: 'https://www.layui.com/'
|
||
}]
|
||
}
|
||
];
|
||
|
||
|
||
var params = [];
|
||
|
||
$.ajax({
|
||
url: apiUrl + '/api/services/app/Project/GetProjectParams', //请求的url地址
|
||
dataType: "json", //返回格式为json
|
||
async: false,//请求是否异步,默认为异步,这也是ajax重要特性
|
||
data: {}, //参数值
|
||
type: 'GET', //请求方式
|
||
success: function (req) {
|
||
//请求成功时处理
|
||
for (let index = 0; index < req.result.arrData.length; index++) {
|
||
params.push({ title: req.result.arrData[index].code + '【' + req.result.arrData[index].name + '】', id: req.result.arrData[index].id, field: req.result.arrData[index].code, href: 'viewProject.html', children: [] });
|
||
params[index].children.push({ title: '图样管理', id: req.result.arrData[index].id, field: req.result.arrData[index].code, href: 'PattrenList.html' });
|
||
params[index].children.push({ title: '标准文件', id: req.result.arrData[index].id, field: req.result.arrData[index].code, href: 'StandardDocumentList.html' });
|
||
params[index].children.push({ title: '设计文件', id: req.result.arrData[index].id, field: req.result.arrData[index].code, href: 'DesigningDocumentsList.html' });
|
||
params[index].children.push({ title: '工艺文件', id: req.result.arrData[index].id, field: req.result.arrData[index].code, href: 'ProcessDocumentsList.html' });
|
||
params[index].children.push({ title: '其他资料管理', id: req.result.arrData[index].id, field: req.result.arrData[index].code, href: 'OtherDocumentsList.html' });
|
||
}
|
||
},
|
||
});
|
||
|
||
//按钮事件
|
||
util.event('lay-demo', {
|
||
addProject: function (othis) {
|
||
var index = layer.open({
|
||
title: '添加项目',
|
||
type: 2,
|
||
shade: 0.2,
|
||
maxmin: true,
|
||
shadeClose: true,
|
||
area: ['50%', '95%'],
|
||
content: 'addProject.html',
|
||
});
|
||
$(window).on("resize", function () {
|
||
layer.full(index);
|
||
});
|
||
}
|
||
});
|
||
|
||
//仅节点左侧图标控制收缩
|
||
tree.render({
|
||
elem: '#ProjectTree'
|
||
, data: params
|
||
, onlyIconControl: true //是否仅允许节点左侧图标控制展开收缩
|
||
, click: function (obj) {
|
||
//layer.msg(JSON.stringify(obj.data));
|
||
document.getElementById("iFramePage").src = obj.data.href + '?ProjectID=' + obj.data.id + '&ProjectCode=' + obj.data.field;
|
||
}
|
||
});
|
||
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
|
||
</html> |