Org.aspx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:17k
- <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_rlki_npp" theme="Normal" %>
- <!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 runat="server">
- <base target="_self" />
- <title>组织机构</title>
- <link href="style/treeStyle.css" type="text/css" rel="stylesheet"/>
- <%-- <link href="style/menuStyle.css" type="text/css" rel="stylesheet"/>--%>
- <link href="style/portal.css" type="text/css" rel="stylesheet" />
-
- <style type="text/css">
- <!--
- .MenuGroup
- {
- background-image:url(style/menu_images/group_background.gif);
- background-color:white;
- border:solid 1px #7E7E81;
- text-align:left;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12pt;
- width:90px;
- cursor:default;
- font:menutext;
- position:absolute;
- visibility:hidden;
- border:2 outset buttonhighlight;
- }
- .MenuItem
- {
- color:black;
- font-family:tahoma;
- font-size:12px;
- margin:4px;
- cursor:default;
- padding-left:0px;
- padding-right:2px;
- }
- .MenuItemHover
- {
- background-color:#FFEEC2;
- color:black;
- font-family:tahoma;
- font-size:11px;
- border:solid 1px #4B4B6F;
- cursor:default;
- }
- .MenuBreak
- {
- background-image:url(menu_images/break_bg.gif);
- width:100%;
- height:1px;
- }
- .skin1 {
- cursor:default;
- font:menutext;
- position:absolute;
- text-align:left;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 10pt;
- width:120px;
- background-color:menu;
- border:1 solid buttonface;
- visibility:hidden;
- border:2 outset buttonhighlight;
- }
- .menuitems {
- padding-left:15px;
- padding-right:10px;
- }
- -->
- </style>
- <%--<script type="text/javascript">
- <!-- Begin
- function verScroll(dir, spd, loop) {
- loop = true;
- direction = "up";
- speed = 10;
- scrolltimer = null;
- if (document.layers)
- {
- var page = eval(document.MenuID5);
- }
- else
- {
- if (document.getElementById)
- {
- var page= eval("document.getElementById(MenuID5).style");
- }
- else
- {
- if (document.all)
- {
- var page = eval(document.all.MenuID5.style);
- }
- }
- }
- direction = dir;
- speed = parseInt(spd);
- var y_pos = parseInt(page.top);
- if (loop == true)
- {
- if (direction == "dn")
- {
- page.top = (y_pos - (speed));
- } else
- {
- if (direction == "up" && y_pos < 10)
- {
- page.top = (y_pos + (speed));
- } else
- {
- if (direction == "top")
- {
- page.top = 10;
- }
- }
- }
- scrolltimer = setTimeout("verScroll(direction,speed)", 1);
- }
- }
- function stopScroll() {
- loop = false;
- clearTimeout(scrolltimer);
- }
- // End -->
- </script> --%>
-
- <script type="text/javascript" >
- var StrValue,StrParent,Level=0,OrgPath;
- function ShowMenu() {
- var nowEvenObj = event.srcElement;
- if (nowEvenObj.type != undefined)
- {
- // alert(MenuID5.childNodes.length);
- if(nowEvenObj.nodeName == "A"){
- var strHrefs = nowEvenObj.href.split(",");
- if(strHrefs.length == 2){
- var StrPold;
- var j;
- StrPold = strHrefs[1].split("'")[1];
- StrPold = StrPold.split("\\");
- Level = StrPold.length;
- OrgPath ="";
- StrValue ="";
- StrParent ="";
- for ( j=0;j<Level;j++) {
- if (StrValue=="") {
- OrgPath ="1";
- StrValue = StrPold[j];
- StrParent = "-1";
- }
- else {
- if (StrValue == "s1") {StrParent="1";}
- else {StrParent =StrValue;}
- StrValue = StrPold[j];
- OrgPath = OrgPath +"/" + StrPold[j];
- }
-
- }
- // if (StrParent == undefined) {
- // StrValue ="1";
- // StrParent = "-1";
- // OrgPath ="1";
- // }
- if (StrParent == "-1") {StrValue ="1";}
- // alert(StrParent);
- // alert(StrValue);
- // if(strHrefs[1].split("'").length == 3)
- // alert(strHrefs[1].split("'")[1])
- }
-
- }
- // alert(OrgPath);
- // alert(StrParent);
- // alert(StrValue);
- // var s = event.srcElement.id;
- // var ind = s.replace("t1", "");
- // s = s.replace("t1", "t2");
- var imgurl1= new Array(5);
- imgurl1[0]="style/menu_images/icon_bullets.gif";
- imgurl1[1]="style/menu_images/icon_copy.gif";
- imgurl1[2]="style/menu_images/icon_copy.gif";
- imgurl1[3]="style/menu_images/icon_open.gif";
- imgurl1[4]="style/menu_images/icon_cut.gif";
- imgurl1[5]="style/menu_images/icon_properties.gif";
- var ToolTextName = new Array(5);
- ToolTextName[0]="展开所有节点";
- ToolTextName[1]="在当前机构中增加一个子级机构";
- ToolTextName[2]="在当前机构中增加一个职工";
- ToolTextName[3]="修改当前选中的信息";
- ToolTextName[4]="删除当前选中的信息";
- ToolTextName[5]="转移到新的组织机构";
- var UrlName = new Array(5);
- UrlName[0] ="";
- UrlName[1] = "";
- UrlName[2] ="";
- //UrlName[1] ="AddNewOrg.aspx?StrValue=" + StrValue + "&StrParent=" +StrParent + "&StrLevel=" + Level + "&StrPath=" + OrgPath;
- //UrlName[2] ="AddEmployee.aspx?StrValue=" + StrValue + "&StrParent=" + StrParent;
- UrlName[3]="";
- UrlName[4] ="";
- // alert(UrlName[2]);
- var i;
- for (i=1;i<=MenuID5.childNodes.length;i++) {
- document.getElementById(i).url = UrlName[i-1];
- var nowCenter = document.getElementById(i).innerText;
- document.getElementById(i).innerHTML = "<img align=absbottom src='"+imgurl1[i-1]+"' /> "+nowCenter;
- document.getElementById(i).title=ToolTextName[i-1];
- }
-
- // var ch = document.getElementById(s);
- // if (ch != null){
- // document.getElementById('2').url = "style/menu_images/icon_cut.gif";
- // document.getElementById('2').innerText = "新增机构";
- // }
- //// else
- //// document.getElementById('2').outerHTML="<div id=2 class=MenuItem url=''>111</div>"
- var rightedge = document.body.clientWidth-event.clientX;
- var bottomedge = document.body.clientHeight-event.clientY;
-
- // alert(bottomedge);
- // alert(document.body.scrollTop);
- // alert(MenuID5.offsetHeight);
- if (rightedge < MenuID5.offsetWidth)
- MenuID5.style.left = document.body.scrollLeft + event.clientX - MenuID5.offsetWidth;
- else
- MenuID5.style.left = document.body.scrollLeft + event.clientX + 5;
- // alert(MenuID5.style.top);
-
- if (bottomedge < MenuID5.offsetHeight)
- if (event.clientY>100)
- MenuID5.style.top = document.body.scrollTop + event.clientY - MenuID5.offsetHeight;
- else
- MenuID5.style.top = document.body.scrollTop + event.clientY;
- else
- MenuID5.style.top = document.body.scrollTop + event.clientY;
- MenuID5.style.visibility = "visible";
- }
- else
- {
- MenuID5.style.visibility = "hidden";
- }
- return false;
- }
- function hidemenuie5() {
- MenuID5.style.visibility = "hidden";
- }
- function highlightie5() {
- if (event.srcElement.className == "MenuItem") {
- event.srcElement.style.backgroundColor = "#FFEEC2";
- event.srcElement.style.border="solid 1px #4B4B6F";
- // if (display_url)
- // window.status = event.srcElement.url;
- }
- }
- function lowlightie5() {
- if (event.srcElement.className == "MenuItem") {
- event.srcElement.style.backgroundColor = "";
- event.srcElement.style.color = "black";
- event.srcElement.style.border="";
- window.status = "";
- }
- }
-
- function MenuClick() {
- var nowObj = event.srcElement;
- if (nowObj.className == "MenuItem") {
- switch (nowObj.id) {
- case '1':
- // form1.SMenuID.value = "1";
- // document.all('Button1').click();
- var n,m;
n =form1.TreeCount.value;
var TObj;
for (m=0;m<n;m++)
{
TObj =document.getElementById("TreeOrgn" + m +"Nodes");
if (TObj != null)
{
TObj.style.display ="block";
var TObjNext;
TObjNext = document.getElementById("TreeOrgn" + m);
var altname;
altname = TObjNext.innerHTML.split("alt");
altname = altname[1].split(" ");
altname = altname[1].substring(0,altname[1].length -1);
if (TObjNext != null) TObjNext.innerHTML ="<img align=absbottom src='image/dashminus.gif' style='border-width:0;' alt='" + altname +"'/>";
// TObj.innerHTML = "<img align=absbottom src='image/dashminus.gif' />" + TObj.href;
// TObj.src ="../image/dashminus.gif";
// TObj.scr = "..image/dashplus.gif";
}
}
- break;
- case '2':
- if (StrValue.substring(0,2)=="职工")
- {
- alert("系统提示:请选择组织机构");
- return
- }
- if (Level > 2) {
- alert("系统提示:系统不支持4级组织机构");
- return
- }
- var SUrl ="AddNewOrg.aspx?StrValue=" + StrValue + "&StrParent=" +StrParent + "&StrLevel=" + Level + "&StrPath=" + OrgPath + "&StrM=N";
- // window.open(SUrl);
- window.showModalDialog(SUrl,"新增组织机构","dialogWidth=450px;scroll=no;help=no;dialogHeight=300px;");
- window.location.reload();
- break;
- case '3':
- if (StrValue.substring(0,2)=="职工")
- {
- alert("系统提示:请选择组织机构");
- return
- }
- var SUrl3 ="AddEmployee.aspx?StrValue=" + StrValue + "&StrParent=" + StrParent + "&StrM=N";
- // window.location = event.srcElement.url;
- // window.open(event.srcElement.url,"新增职工","channelmode=1,fullscreen=0");
- window.showModalDialog(SUrl3,"新增职工","dialogWidth=540px;scroll=no;help=no;dialogHeight=350px;");
- window.location.reload();
- break;
- case '4':
- var MUrl="";
- if (StrValue.substring(0,2)=="职工") {
- StrValue = StrValue.substring(2,StrValue.length);
- MUrl="AddEmployee.aspx?StrValue=" + StrValue + "&StrParent=" + StrParent + "&StrM=M";
- window.showModalDialog(MUrl,"修改职工","dialogWidth=540px;scroll=no;help=no;dialogHeight=350px;");
- window.location.reload();
- return
- }
- if (Level==1) {
- alert("系统提示:对不起,此组织机构不允许修改!");
- return
- }
- MUrl ="AddNewOrg.aspx?StrValue=" + StrValue + "&StrParent=" +StrParent + "&StrLevel=" + Level + "&StrPath=" + OrgPath + "&StrM=M";
- window.showModalDialog(MUrl,"修改组织机构","dialogWidth=450px;scroll=no;help=no;dialogHeight=300px;");
- window.location.reload();
- break;
- case '5':
- if (confirm('你确实要删除该条信息吗?')== true)
- {
- form1.dellValue.value = StrValue;
- document.all('Button1').click();
- }
- break;
- case '6':
- if (StrValue.substring(0,2)=="职工") {
- StrValue = StrValue.substring(2,StrValue.length);
- var MUrl ="OrganzationTree.aspx?StrValue=" + StrValue;
- // window.open(MUrl);
- window.showModalDialog(MUrl,"修改组织机构","dialogWidth=450px;help=no;dialogHeight=300px;");
- window.location.reload();
- }
- else {
- alert("系统提示:请选择职工!");
- }
- break;
- default:
- break;
- }
- }
- }
-
- function jumptoie5() {
- if (event.srcElement.className == "MenuItem") {
- // alert(event.srcElement.getAttribute("target"));
- // alert(event.srcElement.url);
- alert(document.getElementById.childNodes);
-
- if (event.srcElement.getAttribute("target") != null)
- window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
- else
- window.location = event.srcElement.url;
- }
- }
- // End -->
- function TreeOnClientClick()
{
var nowEvenObj = event.srcElement;
if (nowEvenObj.nodeName != "IMG") return false;
var sherf =nowEvenObj.href;
if (sherf.indexOf("user.gif") != "-1") return false;
}
-
-
- </script>
- </head>
- <body style="height:100%">
- <form id="form1" runat="server" method="post">
- <input type="hidden" name="dellValue" id="dellValue"/>
- <input type="hidden" id="SMenuID" name="SMenuID" />
- <input type="hidden" id ="TreeCount" name ="TreeCount" runat="server" />
- <table style="height:18;" cellspacing="0" cellpadding="0" width="100%" border="0" >
- <tr>
- <td style="background-color:#f7f7f7; height:21px;"> <strong>组织机构和职工信息</strong></td>
- </tr>
- <tr>
- <td valign="top">
- <asp:TreeView ID="TreeOrg" runat="server" CollapseImageUrl="image/dashminus.gif" ExpandImageUrl="image/dashplus.gif" CssClass="TreeView" NoExpandImageUrl="image/user.gif" ShowLines="True">
- <%--<SelectedNodeStyle CssClass="SelectedTreeNode"/>--%>
- </asp:TreeView>
- <asp:Button ID="Button1" runat="server" Text="Button" style="display:none" OnClick="Button1_Click"/>
- <div id="MenuID5" class="MenuGroup" onmouseover="highlightie5()" onmouseout="lowlightie5()" onclick="MenuClick();">
- <div id="1" class="MenuItem">全部展开
- </div>
- <div id="2" class="MenuItem" >新增机构
- </div>
- <div id="3" class="MenuItem">新增职工
- </div>
- <div id="4" class="MenuItem">修 改
- </div>
- <div id="5" class="MenuItem">删 除
- </div>
- <div id="6" class="MenuItem">转移机构
- </div>
- </div>
- </td>
- </tr>
- </table>
- </form>
- <script type="text/javascript">
- if (document.all) {
- MenuID5.className = "MenuGroup";
- document.getElementById('treeorg').oncontextmenu = ShowMenu;
- document.body.onclick = hidemenuie5;
- }
- </script>
-
- </body>
- </html>