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

54 lines
2.2 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<%
String PG_TITLE = null;
String PG_CONTENT_TITLE = null;
String PG_CONTNET_TEXT = "请点击左侧列表";//默认的内容区文字
String PG_LEFT_WIDTH = "320";//默认的treeview宽度
OHTMLTreeView tviTemp = new OHTMLTreeView(CurPage, "代码语言配置", "right");
String sTempId = "xxxxx";
@SuppressWarnings("unchecked")
List<BizObject> bos = JBOFactory.createBizObjectQuery("jbo.sys.CODE_CATALOG", "CodeName is not null and CodeName <> ' ' and exists (select 1 from jbo.sys.CODE_LIBRARY CI where CI.CodeNo = O.CodeNo and CI.IsInUse = '1') order by CodeTypeOne, CodeTypeTwo, CodeName").getResultList(false);
String sOldCodeTypeOne = null, sOldCodeTypeTwo = null;
String sCodeTypeOneId = null, sCodeTypeTwoId = null;
for(BizObject bo : bos){
String sCodeTypeOne = bo.getAttribute("CodeTypeOne").getString();
String sCodeTypeTwo = bo.getAttribute("CodeTypeTwo").getString();
String parentId;
if(!StringX.isSpace(sCodeTypeOne) && !StringX.isSpace(sCodeTypeTwo)){
if(!sCodeTypeOne.equals(sOldCodeTypeOne)){
sCodeTypeOneId = tviTemp.insertFolder("root", sCodeTypeOne, "", 0);
sOldCodeTypeOne = sCodeTypeOne;
}
if(!sCodeTypeTwo.equals(sOldCodeTypeTwo)){
sCodeTypeTwoId = tviTemp.insertFolder(sCodeTypeOneId, sCodeTypeTwo, "", 0);
sOldCodeTypeTwo = sCodeTypeTwo;
}
parentId = sCodeTypeTwoId;
}else{
parentId = sTempId;
}
tviTemp.insertPage(parentId, bo.getAttribute("CodeName").getString()+"("+bo.getAttribute("CodeNo").getString()+")", bo.getAttribute("CodeNo").getString(), "", 0);
}
tviTemp.insertFolder(sTempId, "root", "不明确分类", "", "", 0);
tviTemp.insertPage(sTempId, "未定义类别", sTempId, "", 0);
%>
<%@include file="/Resources/CodeParts/View04.jsp"%>
<script type="text/javascript">
function TreeViewOnClick(){
var node = getCurTVItem();
if(!node.value) return false;
AsControl.OpenView("/AppConfig/LanguageManage/Language4CodeList.jsp", node.value=="<%=sTempId%>"?"":"CodeNo="+node.value, "right");
}
function initTreeView(){
<%=tviTemp.generateHTMLTreeView()%>
expandNode('root');
click_change(0, true);
}
initTreeView();
</script>
<%@ include file="/IncludeEnd.jsp"%>