<html xmlns:v>
<head>
<title>WorkflowDesign</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<STYLE>v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<LINK href="paintfile/dotmenu.css" type="text/css" rel="stylesheet">
<LINK href="paintfile/blocks.css" type="text/css" rel="stylesheet">
<LINK href="paintfile/officexp.css" type="text/css" rel="stylesheet">
<SCRIPT src="paintfile/SmartXPaint.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript">
//取数据OBJECT数组boxes,connectors,linetexts
var org;
function addbox()//增加块
{
alert("");
if(org ==undefined){
org = new OrgChart( 100, 100 );
}
alert(org);
var n1 = org.addBox("0",".....", 100, 100);
for(var _i=0;_i<org.boxes.length;_i++)
{
var _box = org.boxes[_i];
}
//alert(org.boxes)
//alert(org.connectors.length);
//var n2 = org.addBox("....", 120, 150);
}
function CkLineNo(linebox)
{
for(var i=0;i<org.boxes.length;i++)
{
var _box =org.boxes[i];
if(linebox == _box)
{
return i;
break;
}
}
}
function saveinfo()
{
var boxstr ="";//收集块的数据
if(org)
{
for(var i=0;i<org.boxes.length;i++)
{
var _box =org.boxes[i];
var _str = _box.id+","+_box.txt+","+_box.el.style.left+","+_box.el.style.top
boxstr += _str;
if(i!=org.boxes.length-1)
{
boxstr +="|";
}
}
document.all("<%=BoxInfo.ClientID%>").value = boxstr;
var linestr="";//收集线的数据
for(var i=0;i<org.connectors.length;i++)
{
var box0 = org.connectors[i][0];
var box1 = org.connectors[i][1];
var boxnum0 = CkLineNo(box0);
var boxnum1 = CkLineNo(box1);
var _str = boxnum0 +"," +boxnum1;
linestr += _str;
if(i!=org.connectors.length-1)
{
linestr +="|";
}
}
// alert(linestr);
document.all("ConnectInfo").value = linestr;
var numstr ="";
for(var i=0;i<org.linetexts.length;i++)
{
numstr += org.linetexts[i].ml.innerText;
if(i!=org.linetexts.length-1)
{
numstr +="|";
}
}
document.all("NumInfo").value = numstr;
}
}
function loadmap()
{
var boxstr = document.all("BoxInfo").value;
var constr = document.all("ConnectInfo").value;
var numstr = document.all("NumInfo").value;
if(org ==undefined)
{
org = new OrgChart( 100, 100 );
}
//---------------------------------------显示BOXES
var boxarray = [];
var boxstrs = boxstr.split("|");
for(var i=0;i<boxstrs.length;i++)
{
var _boxay = boxstrs[i].split(",");
var _x = parseInt(_boxay[3].substring(0,_boxay[3].length-2));
var _y = parseInt(_boxay[4].substring(0,_boxay[4].length-2));
var _obj = org.addBox(_boxay[1],_boxay[2], _x, _y);
boxarray.push(_obj);
}
//----------------------------------------------------显示lines
var constrs = constr.split("|");
for(var i=0;i<constrs.length;i++)
{
var _line = constrs[i].split(",");
var _box0Num = parseInt(_line[0]);
var _box1Num = parseInt(_line[1]);
if(_box0Num>=0)
{
org.connectors.push([boxarray[_box0Num],boxarray[_box1Num]]);
}
}
org.drawVectors();
//---------------------------------------------------修改线上时间
var numstrs =numstr.split("|");
for(var i=0;i<org.linetexts.length;i++)
{
org.linetexts[i].ml.innerText = numstrs[i];
}
}
//window.doIt()
</SCRIPT>
</head>
<body onload=loadmap();>
<form id="form1">
<input type="hidden" id="BoxInfo" runat="server"><input type="hidden" id="ConnectInfo">
<input type="hidden" id="NumInfo">
<input type="button" value="add activity" class="MainButton120" onclick="addbox();">
<input type="button" id ="getinfo" onclick="saveinfo();" style="display:none"/>
<div>
</div>
</form>
</body>
</html>