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.
316 lines
12 KiB
Plaintext
316 lines
12 KiB
Plaintext
<!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>
|
|
<link href="../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
|
<link href="../Scripts/easyUI/themes/default/tree.css" rel="stylesheet" type="text/css" />
|
|
<link href="../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
|
|
<script src="../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
|
|
<script src="../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
|
|
<script src="../Scripts/EasyUIUtility.js" type="text/javascript"></script>
|
|
|
|
<!-- 引用通用的js文件. -->
|
|
<script src="../Scripts/QueryString.js" type="text/javascript"></script>
|
|
<script src="../Scripts/config.js" type="text/javascript"></script>
|
|
<script src="Gener.js" type="text/javascript"></script>
|
|
<script src="JS/Tree.js" type="text/javascript"></script>
|
|
|
|
<script type="text/javascript" language="javascript" >
|
|
|
|
//定义公共个变量.
|
|
var webUser = new WebUser();
|
|
var expnode = [];
|
|
//页面启动函数.
|
|
$(function () {
|
|
|
|
if (webUser.No == undefined) {
|
|
alert('登录信息丢失,请重新登录。');
|
|
return;
|
|
}
|
|
|
|
var ensName = GetQueryString("EnsName");
|
|
|
|
if (ensName == null || ensName == undefined) {
|
|
$("#Msg").html("必要的参数EnsName没有传入.");
|
|
return;
|
|
}
|
|
|
|
$("#Msg").html("<img src=../Img/loading.gif /> 正在加载,请稍后......");
|
|
|
|
//初始化工具栏.
|
|
InitToolbar();
|
|
|
|
//绑定数据.
|
|
BindTree();
|
|
|
|
|
|
|
|
$("#Msg").html("");
|
|
});
|
|
|
|
function InitToolbar() {
|
|
|
|
//创建处理器.
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Comm");
|
|
handler.AddUrlData(); //增加参数.
|
|
//获得map基本信息.
|
|
var mapBase = handler.DoMethodReturnString("Search_MapBaseInfo");
|
|
if (mapBase.indexOf('err@') == 0) {
|
|
alert(mapBase);
|
|
return;
|
|
}
|
|
|
|
|
|
mapBase = JSON.parse(mapBase);
|
|
|
|
document.title = mapBase.EnDesc;
|
|
|
|
$("#title").html(document.title);
|
|
|
|
//获得权限, 生成toolbar.
|
|
var IsInsert = mapBase.IsInsert;
|
|
var IsUpdata = mapBase.IsUpdata;
|
|
var IsDelete = mapBase.IsDelete;
|
|
var IsView = mapBase.IsView;
|
|
//是否有新增权限,无,则新建同级、新建下级的功能隐藏
|
|
if (IsInsert.toString().toLowerCase() == "false") {
|
|
$("#Create_Sample_Node").hide();
|
|
$("#Create_Sub_Node").hide();
|
|
$("#Create_Sample_Node_1").hide();
|
|
$("#Create_Sub_Node_1").hide();
|
|
}
|
|
|
|
//是否有修改权限,无则修改、上移、下移的功能隐藏
|
|
if (IsUpdata.toString().toLowerCase() == "false") {
|
|
$("#Edit_Node").hide();
|
|
$("#Up_Node").hide();
|
|
$("#Down_Node").hide();
|
|
$("#Edit_Node_1").hide();
|
|
$("#Up_Node_1").hide();
|
|
$("#Down_Node_1").hide();
|
|
$("#View_Node").show();
|
|
$("#View_Node_1").show();
|
|
} else {
|
|
$("#View_Node").hide();
|
|
$("#View_Node_1").hide();
|
|
}
|
|
|
|
//是否有删除权限,无则删除功能隐藏
|
|
if (IsDelete.toString().toLowerCase() == "false") {
|
|
$("#Delete_Node").hide();
|
|
$("#Delete_Node_1").hide();
|
|
}
|
|
|
|
//如果是admin用户登陆时增加设置功能
|
|
if (webUser.No != "admin") {
|
|
$("#Set").hide();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function findChildren(jsonArray, parentNo) {
|
|
var appendToTree = function (treeToAppend, o) {
|
|
$.each(treeToAppend, function (i, child) {
|
|
if (o.id == child.ParentNo)
|
|
o.children.push({
|
|
"id": child.No,
|
|
"text": child.Name,
|
|
"children": []
|
|
});
|
|
});
|
|
|
|
$.each(o.children, function (i, o) {
|
|
appendToTree(jsonArray, o);
|
|
});
|
|
|
|
};
|
|
|
|
var jsonTree = [];
|
|
var jsonchildTree = [];
|
|
if ($.isArray(jsonArray) && typeof parentNo !== "undefined") {
|
|
$.each(jsonArray, function (i, o) {
|
|
if (o.ParentNo == parentNo) {
|
|
jsonchildTree.push(o);
|
|
jsonTree.push({
|
|
"id": o.No,
|
|
"text": o.Name,
|
|
"children": []
|
|
});
|
|
}
|
|
});
|
|
|
|
$.each(jsonTree, function (i, o) {
|
|
appendToTree(jsonArray, o);
|
|
});
|
|
|
|
}
|
|
|
|
function _(treeArray) {
|
|
$.each(treeArray, function (i, o) {
|
|
if ($.isArray(o.children)) {
|
|
if (o.children.length == 0) {
|
|
o.children = undefined;
|
|
} else {
|
|
_(o.children);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
_(jsonTree);
|
|
return jsonTree;
|
|
}
|
|
function BindTree() {
|
|
|
|
//创建处理器.
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Comm");
|
|
handler.AddUrlData(); //增加参数.
|
|
//获得map基本信息.
|
|
var pushData = handler.DoMethodReturnString("Tree_Init");
|
|
if (pushData.indexOf("err@") != -1) {
|
|
alert(pushData);
|
|
$("#enTree").append("<li>" + pushData.replace("err@", "").replace("entity", this.GetQueryString("EnsName")) + "</li>");
|
|
return;
|
|
}
|
|
|
|
pushData = ToJson(pushData);
|
|
var parentNo = GetQueryString("ParentNo");
|
|
if (parentNo == null || parentNo == undefined || parentNo == "")
|
|
parentNo = "0";
|
|
else {
|
|
//获取这个元素的父节点
|
|
var ensName = GetQueryString("EnsName");
|
|
var en = new Entity(ensName.substr(0, ensName.length - 1), parentNo);
|
|
parentNo = en.ParentNo;
|
|
}
|
|
|
|
var jsonTree = findChildren(pushData, parentNo);
|
|
|
|
//绑定树结构.
|
|
// var pushData = cceval('(' + treeJson + ')');
|
|
//加载类别树
|
|
$("#enTree").tree({
|
|
data: jsonTree,
|
|
collapsed: true,
|
|
lines: true,
|
|
onLoadSuccess: function () {
|
|
if (expnode.length == 0) {
|
|
//获取根节点
|
|
var rooNode = $("#enTree").tree('getRoot');
|
|
$("#enTree").tree("collapseAll");
|
|
//默认展开根节点
|
|
$("#enTree").tree('expand', rooNode);
|
|
} else {
|
|
var list = [];
|
|
for (var j = 0; j < expnode.length; j++) {
|
|
list.push(expnode[j])
|
|
}
|
|
$("#enTree").tree("collapseAll");
|
|
for (var i = 0; i < list.length; i++) {
|
|
var node = $('#enTree').tree('find', list[i]);
|
|
$('#enTree').tree('expand', node.target);
|
|
}
|
|
}
|
|
|
|
},
|
|
onBeforeExpand: function (node) {
|
|
expnode.push(node.id.toString());
|
|
},
|
|
onBeforeCollapse: function (node) {
|
|
var i = expnode.indexOf(node.id.toString());
|
|
if (i >= 0) {
|
|
expnode.splice(i, 1);
|
|
}
|
|
},
|
|
onDblClick: function (node) {
|
|
if ($("#View_Node").is(":hidden"))
|
|
EditNode(0);
|
|
else
|
|
EditNode(1);
|
|
|
|
}
|
|
|
|
});
|
|
$("#enTree").bind('contextmenu', function (e) {
|
|
e.preventDefault();
|
|
$('#treeMM').menu('show', {
|
|
left: e.pageX,
|
|
top: e.pageY
|
|
});
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//获得enName.
|
|
function GetEnName() {
|
|
|
|
var ensName = GetQueryString("EnsName");
|
|
return ensName.substring(0, ensName.length - 1);
|
|
}
|
|
|
|
function Setting() {
|
|
var user = new WebUser();
|
|
var url = "./Sys/SearchSetting.htm?EnsName=" + GetQueryString("EnsName") + "&m=" + Math.random();
|
|
OpenEasyUiDialogExt(url, '设置', 800, 500, true);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body >
|
|
|
|
<form id="cc">
|
|
<center> <div id='Msg'></div> </center>
|
|
<div class="easyui-layout" data-options="region:'center'" border="false">
|
|
<div class="panel-header" style="width: 100%;height: 20px;">
|
|
<div id='title' class="panel-title"></div><div class="panel-tool"></div>
|
|
</div>
|
|
<div style="width: 100%; height: 100%; overflow: auto;">
|
|
<div id="toolBar" style="padding: 0px; background: #fafafa; width: 100%;">
|
|
<a href="#" id="Create_Sample_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-new'" onclick="CreateSampleNode();">新建同级</a>
|
|
<a href="#" id="Create_Sub_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-new'" onclick="CreateSubNode();">新建下级</a>
|
|
<a href="#" id="Edit_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-edit'" onclick="EditNode(0);">修改</a>
|
|
<a href="#" id="View_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-search'" onclick="EditNode(1);">查看</a>
|
|
<a href="#" id="Delete_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'" onclick="DeleteNode();">删除</a>
|
|
<a href="#" id="Open_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-open'" onclick="OpenNode(0);">全部展开</a>
|
|
<a href="#" id="Up_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-up'" onclick="DoUp();">上移</a>
|
|
<a href="#" id="Down_Node" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-down'" onclick="DoDown();">下移</a>
|
|
<a href="#" id="Set" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-4'" onclick="Setting();">设置</a>
|
|
</div>
|
|
<ul id="enTree" class="easyui-tree-line" data-options="animate:false,dnd:false" style="width:400px;">
|
|
</ul>
|
|
<div id="treeMM" class="easyui-menu" style="width: 120px;">
|
|
<div id="Create_Sample_Node_1" data-options="iconCls:'icon-new'" onclick="CreateSampleNode();">
|
|
新建同级
|
|
</div>
|
|
<div id="Create_Sub_Node_1" data-options="iconCls:'icon-new'" onclick="CreateSubNode();">
|
|
新建下级
|
|
</div>
|
|
<div id="Edit_Node_1" data-options="iconCls:'icon-edit'" onclick="EditNode(0);">
|
|
修改
|
|
</div>
|
|
<div id="View_Node_1" data-options="iconCls:'icon-search'" onclick="EditNode(1);">
|
|
查看
|
|
</div>
|
|
<div id="Delete_Node_1" data-options="iconCls:'icon-cancel'" onclick="DeleteNode();">
|
|
删除
|
|
</div>
|
|
<div class="menu-sep">
|
|
</div>
|
|
<div id="Open_Node_1" data-options="iconCls:'icon-open'" onclick="OpenNode(1);">
|
|
展开该节点
|
|
</div>
|
|
<div id="Up_Node_1" data-options="iconCls:'icon-up'" onclick="DoUp();">
|
|
上移
|
|
</div>
|
|
<div id="Down_Node_1" data-options="iconCls:'icon-down',disabled:false" onclick="DoDown();">
|
|
下移
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</body>
|
|
</html>
|