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.

180 lines
6.3 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>等比例列表排列</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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<script type="text/javascript" src="/WF/Scripts/bootstrap/js/jquery.min.js"></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 rel="stylesheet" href="/App/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/App/layuiadmin/style/admin.css" media="all">
<script src="/App/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: '/App/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index']);
$(function () {
var sorts = new Entities("BP.Cloud.Template.FlowSorts");
sorts.RetrieveAll();
var flows = new Entities("BP.Cloud.Template.Flows");
flows.RetrieveAll();
var isAddNew = false;
var html = "";
for (var iSort = 0; iSort < sorts.length; iSort++) {
var sort = sorts[iSort];
html += "<div id='xx' align='left' ><font color=green><a href='javascript:EditFlowSort()'>" + sort.Name + "</a></font></div>";
html += "<div class='layui-row layui-col-space10 demo-list'>";
for (var i = 0; i < flows.length; i++) {
var flow = flows[i];
if (flow.FK_FlowSort != sort.No)
continue;
if (isAddNew == false) {
html += "<div class='layui-col-sm4 layui-col-md3 layui-col-lg2'>";
html += "<div class='layui-card'>";
html += "<A href='javascript:NewFlow();' >";
html += "<div align='center' >";
html += "</br>新建流程模版</br>";
html += "<img style='width:55px' src = './Img/Add.png' />";
html += "</div>";
html += "</A>";
html += "</div>";
html += "</div>";
isAddNew = true;
}
html += "<div class='layui-col-sm4 layui-col-md3 layui-col-lg2'>";
html += "<div class='layui-card'>";
var iconObj = new Object();
if (flow.ICON.indexOf('@') >= 0) { //包含@符号,是按照规则组装的数据
iconObj = flow.ICON.split("@");
}
var str = flow.Name;
if (str.length > 10) {//超出程度用...代替
str = str.substring(0, 10) + "...";
}
html += "<div align='center' >";
html += "<span style='float:right'><a href=\"javascript:DelFlow('" + flow.No + "');\" ><i class='layui-icon'>&#xe640;</i></a></span></div>";
html += "<br/>";
html += "<div align='center' >";
html += "<A href=\"javascript:WinOpenFlowDesigner('" + flow.No + "', '设计:" + flow.Name + "');\" >";
html += "<img style='width:55px' src = 'FlowIcon/" + (iconObj == undefined ? "" : iconObj[0]) + ".png' class='" + (iconObj == undefined ? "" : iconObj[1]) + "' onerror=\"nofind();\" ' />";
html += "</br>" + str + "</br>";
html += "</A>";
html += "</div>";
// html += str + "</a ></br></br><span style='float:right'><a href=\"javascript:DelFlow('" + flow.No + "');\" ><i class='layui-icon'>&#xe640;</i></a></span></div>";
//html += "" + flow.Name;
html += "</div>";
html += "</div>";
}
html += "</div>";
}
$("#docs").html(html);
});
function NewFlow() {
var url = "/App/FlowDesigner/NewFlow.htm";
// SetHref(url);
OpenWindowRight(url, '新建模版');
}
function nofind() {
var img = event.srcElement;
img.src = "/App/FlowDesigner/AppTemplate/DefaultIcon.png";
//img.onerror = null; 控制不要一直跳动
}
//已知URL,在右侧打开页面
function OpenWindowRight(url, title) {
if (top.layui.index) {
top.layui.index.openTabsPage(url, title)
} else {
window.open(url)
}
}
function WinOpenFlowDesigner(flowNo, title) {
var intFlowNo = flowNo;
// var url = "/App/FlowDesigner/FlowTab.htm?FK_Flow=" + flowNo;;
var url = "/App/FlowDesigner/Designer.htm?FK_Flow=" + flowNo;
OpenWindowRight(url, title);
return;
// window.open(url, '_self');
// return;
layer.open({
skin: 'layer-class',
type: 2,
title: title + ' : 流程设计',
area: ['96%', '90%'],
content: url
});
}
function DelFlow(flowNo) {
if (confirm("确定删除流程吗?") == false)
return;
try {
var en = new Entity("BP.Cloud.Template.Flow", flowNo);
en.Delete();
} catch (e) {
alert(e);
return;
}
Reload();
}
function EditFlowSort() {
var url = "/WF/Comm/Ens.htm?EnsName=BP.Cloud.Template.FlowSorts";
WinOpen(url);
}
</script>
</head>
<body>
<style>
/* 这段样式只是用于演示 */
#LAY-component-grid-list .demo-list .layui-card {
height: 120px;
}
</style>
<div class="layui-fluid" id="LAY-component-grid-list">
<div id="docs"></div>
</div>
</body>
</html>