123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <!--
- //===================================== 参数设定部分 =======================================================
- var strMenu;//菜单信息 Array
- var win2; //
- var VALUE=19.5; //menuitem is height 20
- var omenulayer; //存放菜单对象
- //===================================== WEB 页面显示部分 =====================================================
- var strFrame; //存放菜单层的HTML代码
- document.writeln('<iframe name=rightMenuLayer scrolling="no" Author=wayx frameborder=0 style="color: #000000; position: absolute;width:120px;height:20px;z-index:9999; visibility: hidden;" onblur="parent.closeLayer();"></iframe>');
-
- strFrame=' <style>';
- strFrame+=' .RightMenu';
- strFrame+=' {';
- strFrame+=' font-family:宋体;';
- strFrame+=' color:#FFFFFF;';
- strFrame+=' font-size:12px;';
- strFrame+=' background-color:#EAE8E2;';
- strFrame+=' cursor:default;';
- strFrame+=' }';
-
- strFrame+=' .RightMenuOver {';
- strFrame+=' font-family:宋体;';
- strFrame+=' color: #FFFFFF;';
- strFrame+=' font-size: 12px;';
- strFrame+=' background-color: #316AC5;';
- strFrame+=' PADDING-LEFT: 15px;';
- strFrame+=' PADDING-RIGHT: 10px;';
- strFrame+=' PADDING-TOP: 2px;';
- strFrame+=' PADDING-BOTTOM: 2px;';
- strFrame+=' cursor:default;';
- strFrame+=' }';
-
- strFrame+=' .menuitems {';
- strFrame+=' font-family:宋体;';
- strFrame+=' color: #000000;';
- strFrame+=' font-size: 12px;';
- strFrame+=' background-color: #EAE8E2;';
- strFrame+=' PADDING-LEFT: 15px;';
- strFrame+=' PADDING-RIGHT: 10px;';
- strFrame+=' PADDING-TOP: 2px;';
- strFrame+=' PADDING-BOTTOM: 2px;';
- strFrame+=' cursor:default;';
- strFrame+=' }';
- strFrame+=' </style>';
-
- strFrame+='<script language="JavaScript" type="text/JavaScript">';
- strFrame+='<!--\n';
- strFrame+='var pageState = 0;\n';
- strFrame+='var display_url = 0;\n';
- strFrame+='function highlightie5() { //高亮度鼠标经过的菜单条项目\n';
- strFrame+='if (event.srcElement.className == "menuitems") {';
- strFrame+='event.srcElement.className="RightMenuOver";';
- strFrame+='if (display_url)';
- strFrame+='window.status = event.srcElement.url;';
- strFrame+='}';
- strFrame+='}\n';
- strFrame+='';
- strFrame+='function lowlightie5() { //恢复菜单条项目的正常显示\n';
- strFrame+='if (event.srcElement.className == "RightMenuOver") {';
- strFrame+='event.srcElement.className = "menuitems";';
- strFrame+='window.status = "";';
- strFrame+='}';
- strFrame+='}\n';
- strFrame+='//-->';
- strFrame+='</script>\n';
-
- strFrame+='<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onselectstart="return false;" oncontextmenu="return false;">\n';
- strFrame+='<div id="divId" class="RightMenu" style="z-index:9999;" OnMouseover="highlightie5();" OnMouseout="lowlightie5();" OnClick="parent.closeLayer();" spring="yes">';
-
- strFrame+='</div>\n';
- strFrame+='</body>\n';
- //-------------------------------------------------------------------------------------------------------------------------------
- function initMenu(){
- window.frames.rightMenuLayer.document.writeln(strFrame);
- window.frames.rightMenuLayer.document.close();
- omenulayer=window.frames.rightMenuLayer.document;
- }
- //== WEB 页面显示部分 ==============
- function closeLayer() { //这个层的关闭
- document.getElementsByName("rightMenuLayer")[0].style.visibility="hidden";
- }
- function isLayer() {//判断是否显示
- if (document.getElementsByName("rightMenuLayer")[0].style.visibility=="hidden") {
- return false;
- } else {
- return true;
- }
- }
- function setMenuTypeWF(aObj,type,win1,x,y){ //主调函数 aObj 为对象; type 为菜单项
- closeLayer();
- setType(type,aObj);
- win2 = win1;
-
- var rightedge = x;
- var bottomedge = y;
- var strText = "";
- var j=0;
- if(strMenu.length!=0) {
- for (var i = 0;i < strMenu.length;i++) {
- if (strMenu[i]!="-") {
- var strMenuItem = strMenu[i].split("|");
- if ( strMenuItem.length==1)
- strText+='<div id="divId'+ i + '" class="menuitems" OnClick="alert(\''+aObj.id+'\');">' + strMenu[i] + '</div>\n';
- if ( strMenuItem.length==2)
- strText+='<div id="divId'+ i + '" class="menuitems" OnClick="parent.win2.'+ strMenuItem[1] +';">' + strMenuItem[0] + '</div>\n';
- if (strMenuItem.length==3)
- strText+='<div id="divId'+ i + '" class="menuitems" url="'+ strMenuItem[2]+'" OnClick="parent.win2.'+ strMenuItem[1] +';">' + strMenuItem[0] + '</div>\n';
- } else {
- strText+='<hr>\n';
- j++;
- }
- }
- var dads = document.getElementsByName("rightMenuLayer")[0].style;
- if (strMenu.length==1) {
- dads.height=(strMenu.length*VALUE)-(strMenu.length*4)+(strMenu.length%2)+3-(j*2)+"px";
- } else {
- dads.height=(strMenu.length*VALUE)-(strMenu.length*2)+(strMenu.length%2)+3-(j*2)+"px";
- }
- omenulayer.all.item("divId").innerHTML = strText;
- bottomedge = bottomedge + document.body.scrollTop; //定位
- rightedge = rightedge + document.body.scrollLeft;
- //如果从鼠标位置到窗口下边的空间小于菜单的高度,就定位菜单的上坐标(Top)为当前鼠标位置向上一个菜单高度
- if ((bottomedge + parseInt(dads.height)) > window.document.body.scrollHeight + window.document.body.scrollTop)
- dads.top = bottomedge - parseInt(dads.height); //否则,就定位菜单的左坐标为当前鼠标位置
- else
- dads.top = bottomedge;
- //如果从鼠标位置到窗口右边的空间小于菜单的宽度,就定位菜单的左坐标(Left)为当前鼠标位置向左一个菜单宽度
- if ((rightedge + parseInt(dads.width)) > ( window.document.body.scrollWidth + window.document.body.scrollLeft)) {
- dads.left = rightedge - parseInt(dads.width);
- }
- else{
- //否则,就定位菜单的上坐标为当前鼠标位置
- dads.left = rightedge
- }
- //设置菜单可见
- dads.visibility="visible";
- document.getElementsByName("rightMenuLayer")[0].focus();
- }
- }
- //菜单项类型
- function setType(i,aObj){
- var nodeId = aObj.nodeId;
- var moduletype = aObj.nodeId;
- if(moduletype.indexOf(".") != -1) moduletype = moduletype.substring(moduletype.indexOf(".") + 1);
-
- switch(i) {
- case 1:
- strMenu=new Array();
- strMenu[0]="新增模块|add('/nwyj/admin/setup/sysmodel/objmanager/module/edit.jsp?action=0')|2";
- strMenu[1]="刷新模块|refreshNode('"+aObj.nodeId+"')|2";
- break;
-
- case 10:
- strMenu=new Array();
- strMenu[0]="修改|edit('"+aObj.href+"')|2";
- strMenu[1]="删除|deleteObj('/nwyj/admin/setup/sysmodel/objmanager/module/editExc.jsp?action=del&code="+nodeId+"')|2";
- break;
-
- case 2:
- strMenu=new Array();
- strMenu[0]="新增数据库链接|add('/nwyj/admin/setup/sysmodel/objmanager/DBLink/edit.jsp?action=0')|2";
- strMenu[1]="刷新数据库链接|refreshNode('"+aObj.nodeId+"')|2";
- break;
- case 20:
- strMenu=new Array();
- strMenu[0]="修改|edit('"+aObj.href+"')|2";
- strMenu[1]="删除|deleteObj('/nwyj/admin/setup/sysmodel/objmanager/DBLink/editExc.jsp?action=del&dataSourceid="+nodeId+"')|2";
- break;
-
- case 3:
- strMenu=new Array();
- strMenu[0]="新增常量模版|add('/nwyj/admin/setup/sysmodel/objmanager/constant/template/container.jsp')|2";
- strMenu[1]="刷新常量模版|refreshNode('"+aObj.nodeId+"')|2";
- break;
- case 30:
- strMenu=new Array();
- strMenu[0]="修改|edit('"+aObj.href+"')|2";
- strMenu[1]="删除|deleteObj('/nwyj/admin/setup/sysmodel/objmanager/constant/template/editExc.jsp?action=del&name="+nodeId+"')|2";
- break;
-
- case 4:
- strMenu=new Array();
- strMenu[0]="新增常量|add('/nwyj/admin/setup/sysmodel/objmanager/constant/edit.jsp?action=0&type="+moduletype+"')|2";
- strMenu[1]="刷新常量|refreshNode('"+aObj.nodeId+"')|2";
- break;
- case 40:
- strMenu=new Array();
- strMenu[0]="修改常量|edit('"+aObj.href+"')|2";
- strMenu[1]="删除常量|deleteObj('/nwyj/admin/setup/sysmodel/objmanager/constant/editExc.jsp?action=del&name="+nodeId+"')|2";
- strMenu[2]="-";
- strMenu[3]="生成表|refreshNode()";
- strMenu[4]="更新表|openFileProperty('propertyAdjunctFile.jsp',364,238)";
- break;
- case 5:
- strMenu=new Array();
- strMenu[0]="新增表|add('/nwyj/admin/setup/sysmodel/objmanager/table/container.jsp?type="+moduletype+"')|2";
- strMenu[1]="刷新表|refreshNode('"+aObj.nodeId+"')|2";
- break;
- case 50:
- strMenu=new Array();
- strMenu[0]="修改表|edit('"+aObj.href+"')|2";
- strMenu[1]="删除表|deleteObj('/nwyj/admin/setup/sysmodel/objmanager/table/editExc.jsp?action=del&classid="+nodeId+"')|2";
- strMenu[2]="-";
- strMenu[3]="生成表|creatTable('/nwyj/admin/setup/sysmodel/dbmanager/table/create/createExc.jsp?classid="+nodeId+"&type=1')|2";
- strMenu[4]="更新表|openFileProperty('propertyAdjunctFile.jsp',364,238)";
- break;
- case 6:
- strMenu=new Array();
- strMenu[0]="新增列表配置|add('/nwyj/admin/setup/listmodel/objmanager/container.html?type="+moduletype+"')|2";
- strMenu[1]="刷新列表配置|refreshNode('"+aObj.nodeId+"')|2";
- break;
- case 60:
- strMenu=new Array();
- strMenu[0]="修改列表配置|edit('"+aObj.href+"')|2";
- strMenu[1]="删除列表配置|deleteObj('/nwyj/admin/setup/listmodel/objmanager/editExc.jsp?action=del&listid="+nodeId+"')|2";
- strMenu[2]="-";
- strMenu[3]="验证列表配置|edit()";
- break;
- case 7:
- strMenu=new Array();
- strMenu[0]="新增采集配置|add('/nwyj/admin/setup/collectmodel/objmanager/container.html?type="+moduletype+"')|2";
- strMenu[1]="刷新采集配置|refreshNode('"+aObj.nodeId+"')|2";
- break;
- case 70:
- strMenu=new Array();
- strMenu[0]="修改采集配置|edit('"+aObj.href+"')|2";
- strMenu[1]="删除采集配置|deleteObj('/nwyj/admin/setup/collectmodel/objmanager/editExc.jsp?Action=del&pagid="+nodeId+"')|2";
- strMenu[2]="-";
- strMenu[3]="验证采集配置|refreshNode()";
- break;
- default:
- strMenu=new Array();
- alert("没有该类型!");
- }
- }
- /*
- function document.onkeyup(e) { //按Esc键关闭,切换焦点关闭
- if (window.event.keyCode==27) {
- closeLayer();
- } else if (document.activeElement) {
- closeLayer();
- }
- }
- */
- // -->
|