screen.availWidth - nWidth)/2; var nTop = _nTop || (window.screen.availHeight - nHeight)/2; //2.Construct parameters for dialog var sFeatures = "dialogHeight: "+nHeight+"px; dialogWidth: "+nWidth+"px; " + "dialogTop: "+nTop+"; dialogLeft: "+nLeft+"; " + "center: Yes; scroll:Yes;help: No; resizable: No; status: No;"; //3.display Dialog var sDialogUrl = TRSAction_ROOT_PATH + "/include/dialog_window.html"; var sURL = this.getActionURL(); var arArgs = new Array(); arArgs[0] = sURL; arArgs[1] = window.location.href; arArgs[2] = _oArgs; try{ var sResult = window.showModalDialog(sDialogUrl, arArgs, sFeatures); return sResult; }catch(e){ alert("您的IE插件现已将对话框阻拦!\n" + "请将阻拦去掉-->点击退出-->封闭IE,然后从头翻开IE登录即可!\n" + "给您形成不方便,TRS致以抱歉!"); return true; } } /** * 宣布带有滚动条非模态对话框交互的恳求 * @param {int} _nWidth 对话框宽度 * @param {int} _nHeight 对话框高度 * @param {object} _oArgs 传入对话框的参数(可认为int string array htmlelement;其它自定义目标不可) * @throws 假如浏览器设置了阻拦,会弹出免除阻拦提示 * @return {object} 返回值 */ function CTRSAction_doModelessDialogAction(_nWidth, _nHeight, _oArgs, _nTop, _nLeft){ //1.verify parameters if(!this.validateActionURL()) return; var nWidth = _nWidth || 200; var nHeight = _nHeight || 200; var nLeft = _nLeft || (window.screen.availWidth - nWidth)/2; var nTop = _nTop || (window.screen.availHeight - nHeight)/2; //2.Construct parameters for dialog var sFeatures = "dialogHeight: "+nHeight+"px; dialogWidth: "+nWidth+"px; " + "dialogTop: "+nTop+"; dialogLeft: "+nLeft+"; " + "center: Yes; scroll:Yes;help: No; resizable: No; status: No;"; //3.display Dialog var sDialogUrl = TRSAction_ROOT_PATH + "/include/dialog_window.html"; var sURL = this.getActionURL(); var arArgs = new Array(); arArgs[0] = sURL; arArgs[1] = window.location.href; arArgs[2] = _oArgs; try{ var sResult = window.showModelessDialog(sDialogUrl, arArgs, sFeatures); return sResult; }catch(e){ alert("您的IE插件现已将对话框阻拦!\n" + "请将阻拦去掉-->点击退出-->封闭IE,然后从头翻开IE登录即可!\n" + "给您形成不方便,TRS致以抱歉!"); return true; } } /**@private*/ var m_oXMLHttpTemp = null; var INTERVAL_CHECK_XMLHTTP_STATE = 1000; /**@private*/ function CTRSAction_checkXMLHttpStatus(){ if(m_oXMLHttpTemp == null || m_oXMLHttpTemp.readyState == 4){ if(RunningProcessBar){ RunningProcessBar.close(); } if(m_oXMLHttpTemp.status != 200){ switch(m_oXMLHttpTemp.status){ case 401: //CTRSAction_alert("您登录超时,请从头登录!"); window.top.location.href = "../include/not_login.htm"; return null; default: CTRSAction_displyInfo(600, 600, m_oXMLHttpTemp.responseText); return null; } } m_oXMLHttpTemp = null; return; } setTimeout("CTRSAction_checkXMLHttpStatus();", INTERVAL_CHECK_XMLHTTP_STATE); } /** * 宣布XMLHttp恳求 * @param {string} _sPostData 传送的数据 * @param {boolean} _bAsync 是否为非同步方法 * @param {boolean} _bStartingProcessBar 非同步方法的时分是否显现进度条 */ function CTRSAction_doXMLHttpAction(_sPostData, _bAsync, _bStartingProcessBar){ //1.verify parameters if(!this.validateActionURL()) return; var bAsync = false; if(_bAsync)bAsync = true; var oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); //树立XMLHTTP目标 if(_bStartingProcessBar){ if(!RunningProcessBar){ CTRSAction_alert("Pleas include [../js/CRunningProcessBar.js]"); return; } RunningProcessBar.start(); try{ oXMLHttp.open("POST", this.getActionURL(), bAsync); oXMLHttp.send(_sPostData); }catch(e){ if(e == "[object Error]"){ alert("体系现已封闭!请退出!"); window.top.window.close(); return null; } } m_oXMLHttpTemp = oXMLHttp; setTimeout("CTRSAction_checkXMLHttpStatus();", INTERVAL_CHECK_XMLHTTP_STATE); return; } oXMLHttp.open("POST", this.getActionURL(), bAsync); try{ oXMLHttp.send(_sPostData); if(oXMLHttp.status != 200){ switch(oXMLHttp.status){ case 401: //alert("您登录超时,请从头登录!"); //CTRSAction_displyInfo(600, 600, oXMLHttp.responseText); window.top.location.href = "../include/not_login.htm"; return null; default: CTRSAction_displyInfo(600, 600, oXMLHttp.responseText); return null; } } }catch(e){ if(e == "[object Error]"){ alert("体系现已封闭!请退出!"); window.top.window.close(); return null; } } delete oXMLHttp; return oXMLHttp.responseText; } /** * 宣布弹出窗口的交互恳求 * @param {int} _nWidth 对话框宽度 * @param {int} _nHeight 对话框高度 */ function CTRSAction_doOpenWinActionX(_sName, _bReplaced, _nWidth, _nHeight){ if(!this.validateActionURL()) return; var nWidth = _nWidth || (window.screen.availWidth - 20); var nHeight = _nHeight || (window.screen.availHeight - 40); var nLeft =(window.screen.availWidth - nWidth-10)/2; var nTop = (window.screen.availHeight - nHeight-20)/2; var sName = _sName || ""; var oWin = window.open(this.getActionURL(), sName, "top="+nTop+",left="+nLeft+",fullscreen =true,menubar =no,toolbar =no,width="+nWidth+",height="+nHeight+",scrollbars=yes,location =no,titlebar=no", _bReplaced); if(oWin == null){ alert("您的IE插件现已将窗口阻拦!\n" + "请将阻拦去掉-->点击退出-->封闭IE,然后从头翻开IE登录即可!\n" + "给您形成不方便,TRS致以抱歉!"); window.close(); }else{ oWin.opener = window; oWin.focus(); } //window.showModalDialog('../include/open_win.jsp', args,'dialogWidth:1px;dialogHeight:1px;dialogTop:1;dialogLeft:1;'); } function CTRSAction_doOpenWinAction(_nWidth, _nHeight){ this.doOpenWinActionX("", false, _nWidth, _nHeight); } /** * 宣布不带滚动条对话框交互的恳求 * @param {int} _nWidth 对话框宽度 * @param {int} _nHeight 对话框高度 * @param {object} _oArgs 传入对话框的参数(可认为int string array htmlelement;其它自定义目标不可) * @throws 假如浏览器设置了阻拦,会弹出免除阻拦提示 * @return {object} 返回值 */ function CTRSAction_doNoScrollDialogAction(_nWidth, _nHeight, _oArgs){ //1.verify parameters if(!this.validateActionURL()) return; var nWidth = _nWidth || 200; var nHeight = _nHeight || 200; var nLeft = (window.screen.availWidth - nWidth)/2; var nTop = (window.screen.availHeight - nHeight)/2; //2.Construct parameters for dialog var sFeatures = "dialogHeight: "+nHeight+"px; dialogWidth: "+nWidth+"px; " + "dialogTop: "+nTop+"; dialogLeft: "+nLeft+"; " + "center: Yes; scroll:No;help: No; resizable: No; status: No;"; //3.display Dialog var sDialogUrl = TRSAction_ROOT_PATH + "/include/dialog_window.html"; var sURL = this.getActionURL(); var arArgs = new Array(); arArgs[0] = sURL; arArgs[1] = window.location.href; arArgs[2] = _oArgs; try{ var sResult = window.showModalDialog(sDialogUrl, arArgs, sFeatures); return sResult; }catch(e){ alert("您的IE插件现已将对话框阻拦!\n" + "请将阻拦去掉-->点击退出-->封闭IE,然后从头翻开IE登录即可!\n" + "给您形成不方便,TRS致以抱歉!"); return true; } } /**@private*/ function CTRSAction_inheritParameters(){ this.oActionParam.setAllParameters(TRSRequestParam); } //Self Action 1----refreshMe /** * 改写当时的页面 */ function CTRSAction_refreshMe(){ var oTRSAction = new CTRSAction(); oTRSAction.doAction(); } //Self Action 2----gotoPage /** * 在列表页面中定位到指定分页 * @param {int} _nPageIndex 页面序号,从1开端 */ function CTRSAction_gotoPage(_nPageIndex){ var oTRSAction = new CTRSAction(); oTRSAction.setParameter("PageIndex", _nPageIndex); oTRSAction.doAction(); } //Self Action 3----doSearch /** * 依照Form中的数据对当时页面进行检索,一般应用在列表页面 * @param {Form} _oForm 检索数据的Form目标 */ function CTRSAction_doSearch(_oForm){ var oForm = _oForm; if(_oForm == null) oForm = document.frmSearch; var oTRSAction = new CTRSAction(); var arEls = oForm.elements;//get All data from the form for(var i = 0;i 200){ CTRSAction_displyReports(300, 200, "对不住,您输入的检索内容过长,超出最大长度[200],请从头输入!"); return; } */ oTRSAction.setParameter(arEls[i].name, sValue); } //oTRSAction.setParameter("SearchKey", oForm.SearchKey.value); //oTRSAction.setParameter("SearchValue", oForm.SearchValue.value); oTRSAction.setParameter("PageIndex", 1); oTRSAction.doAction(); } //Self Action 4----doOrderBy /** * 依照指定的方法对页面进行排序,应用在列表页面中 * @param {String} _sOrderField 排序字段