2018-06-03 22:26:41 +08:00

120 lines
4.3 KiB
Plaintext
Raw Permalink 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 contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Main00;Describe=注释区;]~*/%>
<%
/*
Content: 申请主页面_Main
Input Param:
*/
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Main01;Describe=定义页面属性;]~*/%>
<%
String PG_TITLE = "申请主页面"; // 浏览器窗口标题 <title> PG_TITLE </title>
String PG_CONTENT_TITLE = "&nbsp;&nbsp;申请主页面&nbsp;&nbsp;"; //默认的内容区标题
String PG_CONTNET_TEXT = "请点击左侧列表";//默认的内容区文字
String PG_LEFT_WIDTH = "200";//默认的treeview宽度
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Main02;Describe=定义变量,获取参数;]~*/%>
<%
//定义变量
String sItemName = "";//存放申请类型名称
String sItemDescribe = "";//存放ApplyMain页面左边树图的CodeNo
String sCompID = "";//组件编号
String sCompName = "";//组件名称
//获得组件参数 :申请类型
String sApplyType = "CreditLineApply";//这里直接改为写死的ApplyType
String sPhaseType = CurComp.getParameter("PhaseType");
//将空值转换成空字符串
if(sApplyType == null) sApplyType = "";
if(sPhaseType == null) sPhaseType = "1010";
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Main03;Describe=定义树图;]~*/%>
<%
//根据申请类型从代码表CODE_LIBRARY中查询出ApplyMain的树图以及该申请的阶段、申请类型名称、组件ID组件Name
String sSql = " select ItemDescribe,ItemName,Attribute7,Attribute8 from CODE_LIBRARY where CodeNo = 'ApplyType' and ItemNo = :ItemNo ";
ASResultSet rs = Sqlca.getASResultSet(new SqlObject(sSql).setParameter("ItemNo",sApplyType));
if(rs.next()){
sItemDescribe = rs.getString("ItemDescribe");
sItemName = rs.getString("ItemName");
sCompID = rs.getString("Attribute7");
sCompName = rs.getString("Attribute8");
//将空值转化成空字符串
if(sItemDescribe == null) sItemDescribe = "";
if(sItemName == null) sItemName = "";
if(sCompID == null) sCompID = "";
if(sCompName == null) sCompName = "";
//设置窗口标题
PG_TITLE = sItemName;
PG_CONTENT_TITLE = "&nbsp;&nbsp;"+PG_TITLE+"&nbsp;&nbsp;";
}else{
throw new Exception("没有找到相应的申请类型定义CODE_LIBRARY.ApplyType:"+sApplyType+"");
}
rs.getStatement().close();
//定义Treeview
HTMLTreeView tviTemp = new HTMLTreeView(Sqlca,CurComp,sServletURL,sItemName,"right");
tviTemp.toRegister = false; //设置是否需要将所有的节点注册为功能点及权限点
tviTemp.TriggerClickEvent=true; //是否自动触发选中事件
//定义树图结构从代码表CODE_LIBRARY中查询出ApplyMain页面左边有效的树型菜单信息
String sSqlTreeView = "from CODE_LIBRARY where CodeNo = '"+sItemDescribe+"' and IsInUse = '1' ";
tviTemp.initWithSql("SortNo","ItemName","Attribute5","","",sSqlTreeView,"Order By SortNo",Sqlca);
//参数从左至右依次为: ID字段,Name字段,Value字段,Script字段,Picture字段,From子句,OrderBy子句,Sqlca
%>
<%/*~END~*/%>
<%/*~BEGIN~不可编辑区[Editable=false;CodeAreaID=Main04;Describe=主体页面;]~*/%>
<%@include file="/Resources/CodeParts/Main04.jsp"%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区[Editable=true;CodeAreaID=Main05;Describe=树图事件;]~*/%>
<script type="text/javascript">
<%/*~[Describe=treeview单击选中事件;]~*/%>
function TreeViewOnClick(){
var sCurItemDescribe = getCurTVItem().value;
sCurItemDescribe = sCurItemDescribe.split("@");
sCurItemDescribe1 = sCurItemDescribe[0];
sCurItemDescribe2 = sCurItemDescribe[1];
sApplyType = "<%=sApplyType%>";
if(sCurItemDescribe1 != "root"){
AsControl.OpenView(sCurItemDescribe1,"ApplyType=<%=sApplyType%>&PhaseType="+getCurTVItem().id,"right");
setTitle(getCurTVItem().name);
}
}
<%/*~[Describe=生成treeview;]~*/%>
function initTreeView(){
<%=tviTemp.generateHTMLTreeView()%>
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区[Editable=true;CodeAreaID=Main06;Describe=在页面装载时执行,初始化;]~*/%>
<script type="text/javascript">
initTreeView();
expandNode('root');
selectItem('<%=sPhaseType%>');
sApplyType = "<%=sApplyType%>";
</script>
<%/*~END~*/%>
<%@ include file="/IncludeEnd.jsp"%>