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

📄 weith_oa_scrip.js

📁 一个漂亮的OA 界面d
💻 JS
📖 第 1 页 / 共 2 页
字号:
	objMenuDiv.childNodes[intDO].fireEvent("onclick");
};


/*创建下级浮动菜单(暂用于'更换皮肤','系统设置')*/
/*菜单层*/
var __T_M_F_D =null; __T_M_IF=null;
function CreateFloatMenu(eventObj, arrDatas){
	var obj=getParentKeyObj(eventObj, 'M_DIV_1');
	if(obj==null)return;
	var objxy = obj.getBoundingClientRect();
	var st=(arrDatas[0].text=='默认')?true:false;
	
	var IF = __T_M_IF = document.createElement('iframe');
	var MD = document.createElement('div');
		MD.className = 'F_MD';
		MD.innerHTML = '';
		IF.style.cssText='top:'+objxy.bottom+';left:'+(objxy.left-1)+';position:absolute;z-index:99;overflow:hidden;filter:alpha(opacity=0);';
	document.body.insertAdjacentElement('beforeEnd', IF);
	document.body.insertAdjacentElement('beforeEnd', MD);
	var FL=0;
	for(var o=0; o< arrDatas.length; o++){var tFL=arrDatas[o].text.LenB();FL=(FL<tFL)?tFL:FL;}
	FL = FL * 6 + 60;
	var hr=0;
	for(var i=0; i<arrDatas.length; i++){
		if(arrDatas[i].text==='__HR'){
			MD.insertAdjacentHTML('beforeEnd', '<div class="F_HR"><div></div></div>');
			hr++;
		}else{
			var ico=(st && US_N==arrDatas[i].text)?'1,2':arrDatas[i].ico;
			var MenuBody = '<div class="F_IMGBOX"><div class="F_IMG"><img src="'+ico16+'" onload="setIco(this.parentNode, \''+ico+'\', 16);" /></div></div>';
				MenuBody+= '<div class="F_FONT">'+arrDatas[i].text+'</div>';

			var MenuBox = document.createElement('div'); 
				MenuBox.innerHTML = MenuBody;

				MenuBox.onclick=new Function('DelNode();' + arrDatas[i].action);
				MenuBox.onmouseover=function(){
					with(this.childNodes[0].style){
						borderColor=MO_C.FM_BC_e;
						background=MO_C.FM_BG_e;
					}
					with(this.childNodes[1].style){
						borderColor=MO_C.FM_BC_e;
						background=MO_C.FM_BG_e;
					}
				}
				MenuBox.onmouseout=function(){
					with(this.childNodes[0].style){
						borderColor=MO_C.FM_BC_t;
						background=MO_C.FM_BG_t;
					}
					with(this.childNodes[1].style){
						background='#FFF';
						borderColor='#FFF';
					}				
				}
			MenuBox.childNodes[1].style.width=FL;
			MD.appendChild(MenuBox);
		}
	}
	IF.style.width=FL + 26;
	IF.style.height=hr*10+((i-hr)*21);
	MD.style.width= FL + 26;
	MD.style.pixelTop=objxy.bottom;
	MD.style.pixelLeft=objxy.left-1;
	MD.onmousedown=function(){window.event.cancelBubble=true;}
	__T_M_F_D = MD;
};

/*浮动菜单子函数,用于删除创建的节点信息*/
function DelNode(){
	var obj=null;
	try{
		obj=getParentKeyObj(window.event.srcElement, 'M_DIV_1');
	}catch(e){
		try{
			obj=getParentKeyObj(SYS_BODY.window.event.srcElement, 'M_DIV_1');
			}
		catch(e){
			obj=getParentKeyObj(SYS_HELP.window.event.srcElement, 'M_DIV_1');
		}
	}
		if(__onC && __onO ==obj)return;
		if(__T_M_F_D != null){
			__T_M_IF.removeNode(true);
			__T_M_IF=null;
			__T_M_F_D.removeNode(true);
			__T_M_F_D=null;
			__onO.fireEvent("onmouseout");
			__onO=null;
		}
};
document.attachEvent("onmousedown", DelNode);

/*创建模态窗*/
var __SYS_MV_OBJ={'ifr':null, 'obj':null, 'down':false, 'top':0, 'left':0, 'width':0, 'height':0}
function OpenModalWin(sURL, sTitle, sWidth, sHeight, sIco, iClose){
	__SYS_MV_OBJ.width=sWidth; __SYS_MV_OBJ.height=sHeight;var ico=(sIco=='')?'2,1':sIco;
	if(__SYS_MV_OBJ.ifr==null && __SYS_MV_OBJ.obj==null){
		var i = __SYS_MV_OBJ.ifr = document.createElement('iframe');
		var o = __SYS_MV_OBJ.obj = document.createElement('div');
		var b = '<div style="background:#175398;width:100%;height:20px;font-weight:bold;border-bottom:1px solid #808080;cursor:default;"><div style="float:left;width:16px;height:16px;margin:2px 3px auto 1px;overflow:hidden;"><img src="'+ico16+'" onload="setIco(this.parentNode, \''+ico+'\', 16);" /></div><div style="float:left;margin-top:2px;color:#FFF;">'+sTitle+'</div><div style="float:right;width:16px;height:16px;margin:1px 1px auto auto;overflow:hidden;display:none;" onclick="CloseModalWin();" onmousedown="window.event.cancelBubble=true;setIco(this, \'6,3\', 16);" onmouseout="window.event.cancelBubble=true;setIco(this, \'6,2\', 16);" ondragstart="window.event.returnValue=false;" title="关闭"><img src="'+ico16+'" onload="setIco(this.parentNode, \'6,2\', 16);" /></div></div><div><iframe src="'+getNewURL(sURL)+'" frameborder="0" width="100%" height="100%" border="0" scrolling="no" id="__MV_IF__"></iframe></div>';
		i.style.cssText='width:100%;height:100%;top:0;left:0;position:absolute;z-index:254;overflow:hidden;filter:alpha(opacity=0);display:none;';
		o.style.cssText='width:'+sWidth+';height:'+sHeight+';top:'+(WinSize.height - sHeight)/2+';left:'+(WinSize.width - sWidth)/2+';background:#FFF;position:absolute;z-index:255;border:2px outset;cursor:default;display:none;';
		o.insertAdjacentHTML('beforeEnd', b);
		o.childNodes[0].childNodes[2].style.display=(iClose==1)?'block':'none';
		o.childNodes[0].onmousedown=function(){this.setCapture();__SYS_MV_OBJ.down = true;__SYS_MV_OBJ.left = window.event.clientX - parseInt(__SYS_MV_OBJ.obj.style.left,10);__SYS_MV_OBJ.top  = window.event.clientY - parseInt(__SYS_MV_OBJ.obj.style.top,10);}
		o.childNodes[0].onmouseup=function(){this.releaseCapture(); __SYS_MV_OBJ.down = false;}
		i.src='none.htm';
		document.body.insertAdjacentElement('beforeEnd', i);
		document.body.insertAdjacentElement('beforeEnd', o);
		o.style.display='block';
		i.style.display='block';
	}else{
		__SYS_MV_OBJ.obj.childNodes[1].childNodes[0].src=getNewURL(sURL);
		setIco(__SYS_MV_OBJ.obj.childNodes[0].childNodes[0], ico, 16);
		__SYS_MV_OBJ.obj.childNodes[0].childNodes[1].innerText=sTitle;
		__SYS_MV_OBJ.obj.childNodes[0].childNodes[2].style.display=(iClose==1)?'block':'none';
		with(__SYS_MV_OBJ.ifr.style){display='block';}
		with(__SYS_MV_OBJ.obj.style){width=sWidth;height=sHeight;top= (WinSize.height - sHeight)/2;left=(WinSize.width - sWidth)/2;display='block';}
		__SYS_MV_OBJ.obj.childNodes[0].childNodes[2].fireEvent("onmouseout");
	}
};
document.onmousemove=function(){
	if(__SYS_MV_OBJ.down){
		var dx = window.event.clientX- __SYS_MV_OBJ.left;
		var dy = window.event.clientY- __SYS_MV_OBJ.top;
		var tw = WinSize.width-10;
		var th = WinSize.height-10;
		__SYS_MV_OBJ.obj.style.left = dx>-(__SYS_MV_OBJ.width-10) ? (dx>tw ? tw : dx) : -(__SYS_MV_OBJ.width-10);
		__SYS_MV_OBJ.obj.style.top  = dy>-10 ? (dy>th-10 ? th-1 : dy) : -12;
	}
};
/*关闭模态窗*/
function CloseModalWin(){
	if(__SYS_MV_OBJ.ifr != null)__SYS_MV_OBJ.ifr.style.display='none';
	if(__SYS_MV_OBJ.obj != null){
		__SYS_MV_OBJ.obj.childNodes[1].childNodes[0].src='about:blank';
		__SYS_MV_OBJ.obj.style.display='none';
	}
};

function saveas(obj){
	var winSave = window.open();
	winSave.document.open ("html","gb2312");
	winSave.document.write (obj.outerHTML);
	winSave.document.execCommand ("SaveAs",true,"test.htm");
	winSave.close();
}



/*表单检测测*/
function Load_CheckForm(theForm){
	if (theForm.P_UserName.value.Trim()=='' || theForm.P_UserName.value.LenB()>20){alert("错误:"+hr+"您没有输入管理员用户名.\n(用户名长度不能超过20字节)"+hr);theForm.P_UserName.focus();return false;}
	if (theForm.P_UserPass.value.Trim()=='' || theForm.P_UserPass.value.LenB()>20){alert("错误:"+hr+"您没有输入 管理员密码.\n(密码长度不能超过20字节)"+hr);theForm.P_UserPass.focus();return false;}
	CloseModalWin();
	return false;
};

function Lock_CheckForm(theForm){
	if(theForm.P_USERPASS.value.Trim()==''){alert("错误:"+hr+"请输入你的用户密码!"+hr);theForm.P_USERPASS.focus();return false;}
	if(theForm.P_USERPASS.value.Trim()!='123'){alert("错误:"+hr+"密码错误!"+hr);theForm.P_USERPASS.value='';theForm.P_USERPASS.focus();return false;}
	else{CloseModalWin();}
	return false;
};
function EditPass_CheckForm(oForm){
	if(oForm.P_Y_USERPASS.value.Trim()==''){alert("错误:"+hr+"请输入你的旧密码!"+hr);oForm.P_Y_USERPASS.focus();return false;}
	if(oForm.P_X_USERPASS.value.Trim()==''){alert("错误:"+hr+"请输入你的新密码!"+hr);oForm.P_X_USERPASS.focus();return false;}
	if(oForm.P_C_USERPASS.value.Trim()==''){alert("错误:"+hr+"请输入确认新密码!"+hr);oForm.P_C_USERPASS.focus();return false;}
	if(oForm.P_C_USERPASS.value.Trim()!=oForm.P_X_USERPASS.value.Trim()){alert("错误:"+hr+"你输入的新密码和确认密码错误!"+hr);oForm.P_C_USERPASS.value='';oForm.P_X_USERPASS.value='';oForm.P_X_USERPASS.focus();return false;}
	else{CloseModalWin();}
	return false;
};
function Search_CheckForm(oForm){
	if(oForm.P_SEARCH_KEY.value.Trim()==''){alert("错误:"+hr+"请输入你需要搜索的关健字!"+hr);oForm.P_SEARCH_KEY.focus();return false;}
	else{CloseModalWin();}
	return false;
};

/*初始化函数*/
function FnInit(){
	try{
		if(document.readyState != "complete" && document.body.readyState != "complete"){
			window.setTimeout("FnInit();", 100);
			return false;
		}else{
			WinSize = getClientWidthHeight();
			showTime();
			window.defaultStatus='微系科技 MicroSystem.cn';
			var testHeight= (document.getElementById('UI_LEFT_BOX').lastChild.id=='UI_RESINFO')?204:76;
			document.getElementById('UI_LEFT').style.height=WinSize.height-testHeight;
			document.getElementById('UI_RIGHT_BOX').style.width=WinSize.width-175;
			document.getElementById('UI_BODY').style.height=WinSize.height-99;
			CreateLeftBottomMenu(document.getElementById('MENU_BODY_GROUP'), Menu_Left_Datas, 0);
			CreateMenu(document.getElementById('M_BODY'), TopSystemMenuDatas, null, 1);
		}
	}catch(e){alert(e)}
};

/*主框架初始化函数*/
function FrameFnInit(){
	//try{
		if(document.readyState != "complete" && document.body.readyState != "complete"){
			window.setTimeout("FnInit();", 100);
			return false;
		}else{
			WinSize = getClientWidthHeight();
			showTime();
			window.defaultStatus='昆明威士科技公司';
			document.getElementById('UI_FUNCTIONS_BOX').childNodes[0].childNodes[1].style.height=WinSize.height-94;
			var lst_H=(WinSize.height-(38*4+8*3))/4;
			with(document.getElementById('UI_REQUEST_BOX')){
				childNodes[1].childNodes[1].style.height=lst_H;
				childNodes[4].childNodes[1].style.height=lst_H;
				childNodes[7].childNodes[1].style.height=lst_H;
				childNodes[10].childNodes[1].style.height=lst_H;
			}
			//alert(WinSize.width+','+WinSize.height)
			//CreateMenu(document.getElementById('M_BODY'), FrameTopSystemMenuDatas, null, 1);
			//CreateMostlyMenu(document.getElementById('SYS_GNK'), FrameMenuDatas);
		}
	//}catch(e){alert(e)}
};

⌨️ 快捷键说明

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