apzl_leasing/WebContent/Common/ScriptEditor/ScriptEditorForAFS.jsp
2018-06-03 22:26:41 +08:00

162 lines
6.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page import="com.amarsoft.biz.finance.*" %>
<%@ page contentType="text/html; charset=GBK"%><%@ include file="/IncludeBeginMD.jsp"%><%
String sScriptText = CurPage.getParameter("ScriptText");
String sModelNo = CurPage.getParameter("ModelNo");
if (sScriptText==null) sScriptText="";
if (sModelNo==null) sModelNo="";
sScriptText = StringFunction.replace(sScriptText,"$[wave]","~");
//¶¨ÒåTreeview
OHTMLTreeView tviTemp = new OHTMLTreeView(CurPage, "¹«Ê½ÉèÖÃ","right");
int i=0;
int j=0;
String sFolder = "";
String sSql2="";
String sSql="select O.ModelNo,O.ModelName from O,jbo.finasys.REPORT_CATALOG RC2 "+
"where O.ModelClass=RC2.ModelClass and RC2.ModelNo=:ModelNo order by O.ModelNo";
List<BizObject> list = JBOFactory.createBizObjectQuery("jbo.finasys.REPORT_CATALOG", sSql).setParameter("ModelNo",sModelNo).getResultList(false);
for(BizObject rc : list){
j=0;
String modelName = rc.getAttribute("ModelName").getString();
String modelNo = rc.getAttribute("ModelNo").getString();
String displayName = modelName+"["+modelNo+"]";
sFolder = tviTemp.insertFolder("root",modelName,modelNo,i++);
sSql2 = "select distinct FI.ItemNo,FI.ItemName from O,jbo.finasys.FINANCE_ITEM FI "+
"where O.RowSubject=FI.ItemNo and O.ModelNo=:ModelNo order by FI.ItemNo";
List<BizObject> list2 = JBOFactory.createBizObjectQuery("jbo.finasys.REPORT_MODEL", sSql2).setParameter("ModelNo",modelNo).getResultList(false);
for(BizObject fi : list2){
String itemDisplayName = fi.getAttribute("ItemName").getString()+"["+fi.getAttribute("ItemNo").getString()+"]";
tviTemp.insertPage(sFolder,itemDisplayName,"javascript:parent.mySelection(\""+displayName+"\",\""+itemDisplayName+"\")",j++);
}
}
%>
<html>
<body leftmargin="0" topmargin="0" class="windowbackground" onload="">
<table style="width: 100%;height: 100%;border: 0;" cellspacing="0" cellpadding="0">
<tr height=1>
<td>
<table>
<tr>
<td><%=new Button("È·¶¨", "È·¶¨", "translateScriptText()", "", "").getHtmlText()%></td>
<td><%=new Button("È¡Ïû", "È¡Ïû", "cancel()", "", "").getHtmlText()%></td>
<td valign=middle>»á¼ÆÔ·ݣº
<select name="MyAccount">
<%
sSql="select ItemNo,ItemName from O where codeno='RelativeMonth' order by SortNo";
List<BizObject> cl = JBOFactory.createBizObjectQuery("jbo.sys.CODE_LIBRARY", sSql).getResultList(false);
for (BizObject bo : cl){
String itemNo = bo.getAttribute("ItemNo").getString();
String itemName = bo.getAttribute("ItemName").getString();
out.println("<option value='"+itemNo+"' id='ID"+itemNo+"' text='"+itemName+"'>"+itemName+"</option>");
}
%>
</select>
</td>
<td width=10>&nbsp;</td>
<td >¿ÉÑ¡±íÏ
<input type="radio" value="LEFT" name="myColOption" onclick="javascript:clickMyColOption('LEFT','×óÀ¸')" checked>×óÀ¸
<input type="radio" value="RIGHT" name="myColOption" onclick="javascript:clickMyColOption('RIGHT','ÓÒÀ¸')">ÓÒÀ¸
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table style="width: 100%;height: 100%;border: 0;" cellspacing="0" cellpadding="0" class="content_table" id="content_table">
<tr>
<td id="myleft" width=25%>
<iframe name="left" src="" width=100% height=100% frameborder=0 scrolling=no ></iframe>
</td>
<td id="mycenter" class="mycenter">
<div id=divDrag title='¿ÉÍÏ×§¸Ä±ä´°¿Ú´óС Drag to resize' style="z-index:0; cursor: w-resize; " ondrag="if(event.x>16 && event.x<400) {myleft_top.style.display='block';myleft.style.display='block';myleft_bottom.style.display='block';myleft.width=event.x-6;}if(event.x<=16 && event.y>=4) {myleft_top.style.display='none';myleft.style.display='none';myleft_bottom.style.display='none';}if(event.x<4) window.event.returnValue = false;">
<span class="imgDrag" style="display:inline-block;">&nbsp;</span>
</div>
</td>
<td id="myright" class="myright">
<table style="width: 100%;height: 100%;border: 0;" cellspacing="0" cellpadding="0">
<tr>
<td colspan=2 >
<div class="groupboxmaxcontent" id="window1">
<textarea id="myTextArea" name="myTextArea" rows="35" cols="100" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" WRAP=soft style="overflow:auto">
</textarea>
<iframe name="right" style="display:none"></iframe>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
//ÖÿÉÑ¡±íÏîµÄ³õʼֵ
var sCurOptValue="LEFT";
var sCurOptName="×óÀ¸";
function startMenu(){
<%=tviTemp.generateHTMLTreeView()%>
}
function returnText(){
sReturn = PopPageAjax("/Common/ScriptEditor/TranslateAFSBackToSourceAjax.jsp");
parent.AsDialog.ClosePage(amarsoft2Real(sReturn));
}
function translateScriptText(){
saveParaToComp("AFScriptSourceAfterEdit="+document.getElementById("myTextArea").value,"returnText()");
}
function cancel(){
parent.AsDialog.ClosePage();
}
//Ñ¡Ôñ¡°×óÀ¸¡±ºÍ¡°ÓÒÀ¸¡±
function clickMyColOption(sPara1,sPara2){
sCurOptValue=sPara1;
sCurOptName=sPara2;
}
function mySelection(sPara1,sPara2){
var sCurAccountValue=document.all("MyAccount").value;
var sCurAccountName=document.all("ID"+sCurAccountValue).text;
var returnValue="{"+sCurAccountName+"."+sPara1+"."+sPara2+"."+sCurOptName+"}";
if (confirm("È·¶¨²åÈ룺"+returnValue+"?")){
insertAtCaret(document.getElementById("myTextArea"), returnValue);
}
}
//È·¶¨Ñ¡ÔñµÄλÖÃ
function storeCaret (textEl) {
if (textEl.createTextRange)
textEl.caretPos = document.selection.createRange().duplicate();
}
//²åÈëÊý¾Ý
function insertAtCaret (textEl, text) {
if (textEl.createTextRange && textEl.caretPos) {
var caretPos = textEl.caretPos;
caretPos.text =text;
}else
textEl.value = textEl.value+text;
}
//ÀûÓÃString.replaceº¯Êý£¬½«×Ö·û´®×óÓÒÁ½±ßµÄ¿Õ¸ñÌæ»»³É¿Õ×Ö·û´®
function Trim (sTmp){
return sTmp.replace(/^(\s+)/,"").replace(/(\s+)$/,"");
}
$(document).ready(function(){
startMenu();
expandNode('root');
//ÔØÈëʱȥ³ýÖµÁ½±ßµÄ¿Õ¸ñ
document.getElementById("myTextArea").value = amarsoft2Real("<%=ReportManager.transExpression(0,sScriptText.trim(),Sqlca)%>");
});
</script>
<%@ include file="/IncludeEnd.jsp"%>