You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
6.8 KiB
Plaintext

11 months ago
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>流程设计容器</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!--通用js-->
<script src="../../WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
<script src="../../WF/Scripts/config.js" type="text/javascript"></script>
<script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
<link href="../../WF/Scripts/layui/layui/css/layui.css" rel="stylesheet" type="text/css" />
<script src="../../WF/Scripts/layui/layui/layui.js" type="text/javascript"></script>
<style type="text/css">
.layui-tab-item, .layui-tab-content {
height: 100%;
}
.layui-tab-brief > .layui-tab-title .layui-this {
color: white;
background-color: #f3ba20;
}
.layui-tab-brief > .layui-tab-more li.layui-this:after, .layui-tab-brief > .layui-tab-title .layui-this:after {
border: none;
border-radius: 0;
border-bottom: 2px solid #2331d9;
}
.layui-tab-title li .layui-tab-close {
color: #2331d9;
}
.first-tab i.layui-tab-close {
display: none !important;
}
.second-tab i.layui-tab-close {
display: none !important;
}
</style>
<script type="text/javascript">
function Back() {
var url = "Flows.htm";
SetHref(url);
}
</script>
</head>
<body>
<div class="layui-tab layui-tab-brief" lay-filter="demo" lay-allowClose="true">
<ul class="layui-tab-title">
</ul>
<div class="layui-tab-content" style="height: 100%;">
</div>
</div>
<script>
var webUser = new WebUser();
layui.use('element', function () {
var $ = layui.jquery
, element = layui.element; //Tab的切换功能切换事件监听等需要依赖element模块
//触发事件
var active = {
tabAdd: function (nodeId, title, url) {
//新增一个Tab项
element.tabAdd('demo', {
title: title,
content: createIFrame(url, nodeId),
id: nodeId
})
}
, tabDelete: function (othis) {
//删除指定Tab项
element.tabDelete('demo', '44'); //删除:“商品管理”
othis.addClass('layui-btn-disabled');
}
, tabChange: function () {
//切换到指定Tab项
element.tabChange('demo', '22'); //切换到:用户管理
}
};
////流程模板
//element.tabAdd('demo', {
// title: '<img src=/App/Img/Home.png width:30px />流程模板',
// content: createIFrame("./Flows.htm", "flows"),
// id: "flows"
//});
////流程模板
//element.tabAdd('demo', {
// title: '<img src=/App/Img/Share.png width:30px />共享模版',
// content: createIFrame("./Template.htm", "flowsShare"),
// id: "flowsShare"
//});
// //流程模板
//element.tabAdd('demo', {
// title: '<img src=/App/Img/New.png width:30px />新建',
// content: createIFrame("./Template.htm", "flowsShare"),
// id: "flowsShare"
//});
//$($(".layui-tab-title li")[0]).children("i").remove();
//增加流程设计器的Tab项
var flowNo = GetQueryString("FK_Flow");
var flow = new Entity("BP.WF.Flow", flowNo);
element.tabAdd('demo', {
title: '流程设计器',
content: createIFrame("./Designer.htm?RunModel=2&FK_Flow=" + flowNo, flowNo),
id: flowNo + "_" + flow.OrgNo
});
element.tabChange('demo', flowNo + "_" + flow.OrgNo);
//$($(".layui-tab-title li")[1]).children("i").remove();
//自适应页面高度
FrameWH();
function FrameWH() {
var h = $(window).height() - 100;
$("iframe").css("height", h + "px");
}
$(window).resize(function () {
FrameWH();
});
var tabs = $(".layui-tab-title li");
$.each(tabs, function (i, item) {
var layId = item.getAttribute("lay-id");
if (layId == "flows") {
$(item).addClass("first-tab");
$(item).bind("click", function () {
SetHref( "./Flows.htm");
})
}
if (layId == flowNo + "_" + webUser.OrgNo)
$(item).addClass("second-tab");
});
});
function createIFrame(url, id) {
var _html = '<iframe class="myiframe" data-frameid="' + id + '" scrolling="no" frameborder="0" src="' + url + '" height="100%" style="width:100%;" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>';
return _html;
}
function addTab(nodeId, title, url) {
var $ = layui.jquery
, element = layui.element;
//先判断是否已经有了tab
var arrayObj = new Array(); //创建一个数组
$(".layui-tab-title").find('li').each(function () {
var y = $(this).attr("lay-id");
arrayObj.push(y);
});
var have = $.inArray(nodeId, arrayObj);
if (have >= 0) {
element.tabChange('demo', nodeId); //切换到当前点击的页面
} else {
element.tabAdd('demo', {
title: title,
content: createIFrame(url, nodeId),
id: nodeId
})
element.tabChange('demo', nodeId); //切换到当前点击的页面
}
FrameWH();
function FrameWH() {
var h = $(window).height() - 100;
$("iframe").css("height", h + "px");
}
$(window).resize(function () {
FrameWH();
});
}
</script>
</body>
</html>