97 lines
3.2 KiB
HTML
97 lines
3.2 KiB
HTML
|
|
<!DOCTYPE html >
|
||
|
|
<html xmlns=http://www.w3.org/1999/xhtml>
|
||
|
|
<head>
|
||
|
|
<title>
|
||
|
|
流程资产文件设计页面
|
||
|
|
</title>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<link rel="stylesheet" type="text/css" href="../commons/js/jquery/themes/default/public.css">
|
||
|
|
<link rel="stylesheet" href="../commons/css/awsui.css"/>
|
||
|
|
<style>
|
||
|
|
|
||
|
|
.button.blue { background-color: #2375BE; border: 0 none; color: #FFFFFF; line-height: 18px; padding: 4px 21px; }
|
||
|
|
.button, .button:visited { background-image: none !important;}
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body style="overflow-x:hidden;">
|
||
|
|
<div style="padding:5px;height:265px;width:250px;float:left;overflow:auto;">
|
||
|
|
<input type="hidden" value="<#sid>" name="sid" >
|
||
|
|
<input type="hidden" value="<#attrType>" name="attrType" >
|
||
|
|
<input type="hidden" value="<#selectIds>" name="selectIds" >
|
||
|
|
<ul id="tree" style="padding:5px 0px;">
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
<script type="text/javascript" src="../commons/js/jquery/scripts/jquery.js"></script>
|
||
|
|
<script type="text/javascript" src="../commons/js/awsui.js"></script>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var setting = {
|
||
|
|
checkbox:true,
|
||
|
|
autoHeight:true,
|
||
|
|
onCheck:onCheck
|
||
|
|
};
|
||
|
|
var checkTree;
|
||
|
|
|
||
|
|
var data =<#data>;
|
||
|
|
setting.dataModel = {
|
||
|
|
data:data
|
||
|
|
};
|
||
|
|
$(document).ready(function(){
|
||
|
|
checkTree = awsui.tree.init($("#tree"), setting);
|
||
|
|
checkNode();
|
||
|
|
});
|
||
|
|
function getValue(){
|
||
|
|
var nodes = checkTree.getCheckedNodes();
|
||
|
|
var result = [];
|
||
|
|
//获取节点名称/可以拿数据源中已有的任何数据
|
||
|
|
for(var i = 0;i < nodes.length; i++){
|
||
|
|
result.push(nodes[i].name);
|
||
|
|
}
|
||
|
|
//去掉重复项
|
||
|
|
var data = [];
|
||
|
|
var obj = {};
|
||
|
|
for(var i = 0; i < result.length; i++){
|
||
|
|
obj[result[i]] = result[i];
|
||
|
|
}
|
||
|
|
for(key in obj){
|
||
|
|
if(obj.hasOwnProperty(key)){
|
||
|
|
data.push(key);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//$("#values").html(data.join(" , "));
|
||
|
|
return data;
|
||
|
|
}
|
||
|
|
function onCheck(ck){
|
||
|
|
//console.log(ck);
|
||
|
|
if(ck.prev("nodestate").length){
|
||
|
|
ck.prev("nodestate").trigger("mosueup");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function toggleRoot(){
|
||
|
|
$.each(checkTree.getRootNode(),function(i,node){
|
||
|
|
checkTree.toggleCheck(node);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
//把已经存在的属性√上
|
||
|
|
function checkNode(){
|
||
|
|
var attrType = $("input[name='attrType']").val();
|
||
|
|
var nodes="";
|
||
|
|
if(attrType=="1"){
|
||
|
|
nodes=window.parent.exitAttributesJsonId;
|
||
|
|
}else{
|
||
|
|
nodes=[];
|
||
|
|
var selectIds=$("input[name='selectIds']").val();
|
||
|
|
if(selectIds){
|
||
|
|
// selectIds =selectIds.substr(0, selectIds.lastIndexOf("|"));
|
||
|
|
selectIds=selectIds.split("|");
|
||
|
|
for (var i = 0; i < selectIds.length; i++) {
|
||
|
|
if(selectIds[i]==""){continue;}
|
||
|
|
nodes.push(selectIds[i]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if(nodes.length>0)checkTree.setCheckNodes(nodes, true);
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|