⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 popmenu_old.jsp

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JSP
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,java.sql.*,oa.main.DealString,javax.swing.tree.DefaultMutableTreeNode"%>
<jsp:useBean id="rtBean" scope="page" class="oa.bean.RightBean"/>

<!--
/**********************************************************
Copyright (C),2003-10-17, Beijing  USTB.
All rights reserved.
Filename: popmenu.htm
Author: 
Version 1.0
Date:2003-10-17
Description:组织机构的右键快捷菜单
Other:
Variable List:

Function List:

History:
***********************************************************/
//-->
<STYLE>
.skin1 {
    BORDER-RIGHT: buttonhighlight 0px outset; BORDER-TOP: buttonhighlight 0px outset; FONT-SIZE: 9pt; VISIBILITY: hidden; BORDER-LEFT: buttonhighlight 0px outset; WIDTH: 90px; CURSOR: default; BORDER-BOTTOM: buttonhighlight 0px outset; FONT-FAMILY: Arial, Helvetica, sans-serif; POSITION: absolute; BACKGROUND-COLOR: #CCCCCC; TEXT-ALIGN: center
}
.menuitems {
    PADDING-RIGHT: 10px; PADDING-LEFT: 10px
}
</STYLE>

<SCRIPT language=JavaScript1.2>
<!-- Begin
var menuskin = "skin1"; // skin0, or skin1
var display_url = 0; // Show URLs in status bar?

function showmenuie5() {
	var rightedge = document.body.clientWidth-event.clientX;
	var bottomedge = document.body.clientHeight-event.clientY;
	if (rightedge < ie5menu.offsetWidth)
		ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
	else
		ie5menu.style.left = document.body.scrollLeft + event.clientX;
	if (bottomedge < ie5menu.offsetHeight)
		ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
	else
		ie5menu.style.top = document.body.scrollTop + event.clientY;
	
	ie5menu.style.visibility = "visible";
/*	delorg1.style.visibility = "hidden";
	addorg1.style.visibility = "hidden";
	modorg1.style.visibility = "hidden";
	addduty1.style.visibility = "hidden";
	dutylist1.style.visibility = "hidden";
	psinf1.style.visibility = "hidden";
	news1.style.visibility = "hidden";
*/	delorg1.style.display = "none";
	addorg1.style.display = "none";
	modorg1.style.display = "none";
	addduty1.style.display = "none";
	dutylist1.style.display = "none";
	psinf1.style.display = "none";
//	news1.style.display = "none";
	var str = document.all.txt_orgno.value;
	var id= document.all.txt_test.value; //@bmbh:czqx@bmbh:czqx@bmbh:czqx@bmbh:czqx
	var ids = id.split("@");
var num = 0;
	var addorgflg=false;
	var modorgflg=false;
	var delorgflg=false;
	var dutylistflg=false;
	var adddutyflg=false;
	var psinfflg=false;
	var newsflg=false;

		for(var i=0;i<ids.length;i++)
		{
			var bmrt = ids[i].split(":");
			var bmsub = '';
			for(var n=19;n>=0;n--)
			{
				bmsub = bmrt[0].charAt(n);
				if(bmsub!='0')
					break;
			}

			if(bmrt[0]==str || bmrt[0].substring(0,n+1)==str.substring(0,n+1))
			{
				var rts = bmrt[1].split(",");
				for(var j=0;j<rts.length;j++)
				{
					if(rts[j]=="58")//增加子部门
					{
						addorg1.style.display = "block";
						addorgflg = true;
						num++;
					}
					if(addorgflg == true)
						addorg1.style.display = "block";
					else
						addorg1.style.display = "none";

					if(rts[j]=="59")//修改部门
					{
						modorg1.style.display = "block";
						modorgflg = true;
						num++;
					}
					if(modorgflg == true)
						modorg1.style.display = "block";
					else
						modorg1.style.display = "none";

					if(rts[j]=="60" && bmrt[0]!=str)//删除部门
					{
						delorg1.style.display = "block";
						delorgflg = true;
						num++;
					}
					if(delorgflg == true)
						delorg1.style.display = "block";
					else
						delorg1.style.display = "none";

					if(rts[j]=="61")//职务列表
					{
						dutylist1.style.display = "block";
						dutylistflg = true;
						num++;
					}
					if(dutylistflg == true)
						dutylist1.style.display = "block";
					else
						dutylist1.style.display = "none";

					if(rts[j]=="62")//增加职务
					{
						addduty1.style.display = "block";
						adddutyflg = true;
						num++;
					}
					if(adddutyflg == true)
						addduty1.style.display = "block";
					else
						addduty1.style.display = "none";

					if(rts[j]=="63")//人员信息
					{
						psinf1.style.display = "block";
						psinfflg = true;
						num++;
					}
					if(psinfflg == true)
						psinf1.style.display = "block";
					else
						psinf1.style.display = "none";
					
				/*	if(rts[j]=="126")//新闻类别
					{
						news1.style.display = "block";
						newsflg = true;
						num++;
					}

					if(newsflg == true)
						news1.style.display = "block";
					else
						news1.style.display = "none";
				*/}
			}
		}
    //ie5menu.style.height=num*20;
	addorgflg=false;
	modorgflg=false;
	delorgflg=false;
	dutylistflg=false;
	adddutyflg=false;
	psinfflg=false;
	newsflg=false;
	return false;
}

function hidemenuie5() {
	delorg1.style.display = "none";
	addorg1.style.display = "none";
	modorg1.style.display = "none";
	addduty1.style.display = "none";
	dutylist1.style.display = "none";
	psinf1.style.display = "none";
//	news1.style.display = "none";
	ie5menu.style.visibility = "hidden";
}

function highlightie5() {
	if (event.srcElement.className == "menuitems") {
		event.srcElement.style.backgroundColor = "highlight";
		event.srcElement.style.color = "white";
		if (display_url)
		window.status = event.srcElement.url;
   }
}

function lowlightie5() {
	if (event.srcElement.className == "menuitems") {
		event.srcElement.style.backgroundColor = "";
		event.srcElement.style.color = "black";
		window.status = "";
   }
}

function jumptoie5() {
	if (event.srcElement.className == "menuitems") {
		if (event.srcElement.getAttribute("target") != null)
		window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
	else
		window.location = event.srcElement.url;
   }
}
//  End -->
</SCRIPT>

<q class=skin1 id=ie5menu onmouseover="highlightie5()" 
style="LEFT: 280px; TOP: 28px" onclick="jumptoie5()"; onmouseout="lowlightie5()" height=2>

<q id=addorg1>
 <table width="100%">
  <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" bgColor=#ffcc00 height=20 
    scroll="no" onload="window.defaultStatus='00009876.4567.net';" onclick="addorg()">
      <CENTER><font color="#000000"style="font-size:9pt"><b>增加子部门</b></font></CENTER>
	</TD>
  </TR>
 </table>
</q>
<q id=modorg1>
 <table width="100%">
  <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" bgColor=#ffcc00 height=20 onclick="modorg()">
       <CENTER><font color="#000000"style="font-size:9pt"><b>修改部门</b></font></CENTER>
	</TD>
  </TR>
 </table>
</q>
<q id=delorg1>
   <table width="100%">
  <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" vAlign=center 
    bgColor=#ffcc00 height="20" onclick="delorg()">
      <CENTER><font color="#000000"style="font-size:9pt"><b>删除部门</b></font></CENTER></TD></TR></table></q>
<q id=addduty1>
   <table width="100%">
   <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" vAlign=center 
    bgColor=#ffcc00 height="20" onclick="addduty()">
      <CENTER><font color="#000000"style="font-size:9pt"><b>增加职务</b></font></CENTER></TD></TR></table></q>
<q id=dutylist1>
   <table width="100%">
  <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" vAlign=center 
    bgColor=#ffcc00 height="20" onclick="dutylist()">
      <CENTER><font color="#000000"style="font-size:9pt"><b>职务列表</b></font></CENTER></TD></TR></table></q>
 <q id=psinf1>
   <table width="100%">
  <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" vAlign=center 
    bgColor=#ffcc00 height="20" onclick="disperson()">
      <CENTER><font color="#000000"style="font-size:9pt"><b>人员信息</b></font></CENTER></TD></TR></table></q>
 <!--q id=news1>
   <table width="100%">
 <TR>
    <TD 
    onmouseover="this.style.backgroundColor='#ff9900'; this.style.cursor='hand';" 
    onmouseout="this.style.backgroundColor='#ffcc00';" vAlign=center 
    bgColor=#ffcc00 height="20" onclick="disnews()">
      <CENTER><font color="#000000"style="font-size:9pt"><b>新闻类别</b></font></CENTER></TD></TR></table></q--->
<!--/TBODY></TABLE></q--></q>

<SCRIPT language=JavaScript1.2>
  
	var tag = "1";
	function onclickshow(id)
	{
		document.all.txt_orgno.value = id;
		tag = "2";

		document.oncontextmenu = showmenuie5;
		document.body.onclick = hidemenuie5;
	}

	if (document.all && window.print)
	{
		ie5menu.className = menuskin;
		document.oncontextmenu = showmenuie5;
		document.body.onclick = hidemenuie5;
	}

	function nocontextmenu() 
	{
		event.cancelBubble = true
		event.returnValue = false; 
		return false;
	}
 
	function norightclick(e) 
	{
		if (window.Event) 
		{
			if (e.which == 2 || e.which == 3)
			return false;
		}
		else if (event.button == 2 || event.button == 3)
		{
			event.cancelBubble = true
			event.returnValue = false;
			return false;
		} 
	}

	function onclickhide()
	{
	if (window.Event) 
		document.captureEvents(Event.MOUSEUP); 

		if(tag=="1")//鼠标单击在显示菜单地方之外
		{	
			//document.all.txt_orgno.value = "";
			document.oncontextmenu = nocontextmenu;  // for IE5+
			document.onmousedown = norightclick;  // for all others
		}
		tag = "1";
	}

	function addorg()
	{
		document.all.txt_type.value = "1";
		document.all.txt_edit.value = "1";
		document.all.form1.action = "index.jsp";
		document.all.form1.submit();
	}

	function modorg()
	{
			document.all.txt_type.value = "1";
			document.all.txt_edit.value = "2";
			document.all.form1.action = "index.jsp";
			document.all.form1.submit();
	}

	function delorg()
	{
		if(document.all.txt_orgno.value=="00000000000000000000")
		{
			alert("总公司不能删除!");
		}
		else
		{
			if(!confirm("是否真的要删除?"))
			{
			}
			else
			{
				document.all.txt_type.value = "1";
				document.all.txt_edit.value = "3";
				document.all.form1.action = "../../Org";
				document.all.form1.submit();
			}
		}
	}

	function dutylist()
	{
		document.all.txt_type.value = "2";
		document.all.txt_edit.value = "";
		document.all.form1.action = "index.jsp";
		document.all.form1.submit();
	}

	function addduty()
	{
		document.all.txt_type.value = "2";
		document.all.txt_edit.value = "1";
		document.all.form1.action = "index.jsp";
		document.all.form1.submit();
	}
	function disperson()
	{
		document.all.txt_type.value = "3";
		document.all.txt_edit.value = "";
		document.all.form1.action = "index.jsp";
		document.all.form1.submit();
	}

	function disnews()
	{
		document.all.txt_type.value = "5";
		document.all.txt_edit.value = "";
		document.all.form1.action = "indexmenu.jsp?txt_type=5";
		document.all.form1.submit();
	}
</SCRIPT>
<%
rtBean.closeConn();
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -