<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*" %>
<%@ page import="com.gx.webpage.engine.menupage.designdbengine.factory.*" %>
<%@ page import="com.gx.webpage.engine.menupage.designdbengine.valueobject.*" %>
<%@ page import="com.gx.webpage.framework.valueobject.*" %>
<%@ page import="com.gx.webpage.engine.menupage.designdbengine.api.*" %>
<%@ page import="com.gx.webpage.framework.util.inoutformat.DataBean" %>
<%
    String errStr = "";
    boolean isError = false;
    String parentUID = "";
    String parentName = "";
    SysMenuModel menuModel = null;
    String icon = "";
    String name = "";
    String desc = "";
    String uuid = "";
		int indexNum = 0;
		int menuLevel = 0;
		String parentUuid = "";
		int systemId = 0;
		String targetPage = "";
		UserInfoCtxModel uicm = new UserInfoCtxModel();
    try
    {
        uuid = DataBean.getStr(request, "uuid");
        uicm.setUserId("cc");
        EbiMenuMgr delegate = MenuFactory.getInstance().getEbiMenuMgr();
				uicm.setNeedAcl(true);
				uicm.setAclType(uicm.ACLTYPE_ROW);
				uicm.setRowCatPath("com.cc.menu");
				Collection colPerIds = new ArrayList();
				colPerIds.add("search");
				uicm.setRowColPerId(colPerIds);
        if(uuid.length()>0)
        {
					menuModel = delegate.findSysMenu(uuid,true,uicm);
        }
        if(menuModel != null)
        {
            systemId = menuModel.getSystemId();
            name = DataBean.getStr(menuModel.getName());
            desc = DataBean.getStr(menuModel.getDescription());
            uuid = DataBean.getStr(menuModel.getUuid());
						menuLevel = menuModel.getMenuLevel();
						icon = DataBean.getStr(menuModel.getIcon());
						indexNum = menuModel.getIndexNum();
						parentUuid = DataBean.getStr(menuModel.getParentUuid());
						targetPage = 	DataBean.getStr(menuModel.getTargetPage());
            String puuid = DataBean.getStr(menuModel.getParentUuid());
            if(puuid.length() > 0)
            {
                SysMenuModel menuModelParent = delegate.findSysMenu(puuid,true,uicm);
                if(menuModelParent != null)
                {
                    parentUID = DataBean.getStr(menuModelParent.getUuid());
                    parentName = DataBean.getStr(menuModelParent.getName());
                }
            }
        }
    }
    catch(Exception ex)
    {
      errStr = DataBean.getErrStr(ex);
      isError = true;
    }
if(isError)
       {
%>
           <p class="error">查询失败. (<%= errStr%>)
<%
					return;
       }
%>
<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="./../../../webpage/common/css/common.css" rel="StyleSheet"  type="text/css" />
<script language="javascript" src="./../../../webpage/common/engine/constant.js"></script>
<script language="JScript.Encode" src="./../../../webpage/common/engine/common.js"></script>
    </head>
    <body class="main">
    <p class="title">菜单信息
<%
    if(menuModel == null)
    {
%>
     <p class="information">请选择菜单进行操作.
<%
    }
    else
    {
%>
  <div align="center">
    <table class="content">
      <tr>
        <td width = "30%">所属系统</td>
				<%
						String sysIdStr = menuModel.getViewSysId();
						if(sysIdStr==null || sysIdStr.trim().length()==0){
							sysIdStr = "系统";
						}
				%>
        <td width = "70%"><%=sysIdStr %>&nbsp;</td>
      </tr>
      <tr>
        <td width = "30%">菜单层次号</td>
				<%
						String menuLevelStr = menuModel.getViewMenuLevel();
						if(menuLevelStr==null || menuLevelStr.trim().length()==0){
							menuLevelStr = "系统级";
						}
				%>
        <td width = "70%"><%= menuLevelStr %>&nbsp;</td>
      </tr>
			<tr>
        <td width = "30%">菜单顺序号</td>
        <td width = "70%"><%= indexNum%>&nbsp;</td>
      </tr>
      <tr>
        <td width = "30%">上级菜单名称</td>
        <td width = "70%"><%= parentName %>&nbsp;</td>
      </tr>
      <tr>
        <td width = "30%">本级菜单名称</td>
        <td width = "70%"><%= name %>&nbsp;</td>
      </tr>
	    <tr>
        <td width = "30%">图标位置</td>
        <td width = "70%"><%= icon%>&nbsp;</td>
      </tr>
			<tr>
        <td width = "30%">操作页面</td>
        <td width = "70%"><%= targetPage%>&nbsp;</td>
      </tr>
      <tr>
        <td width = "30%">描述</td>
        <td width = "70%"><textarea rows="5" name="desc" cols="50"><%= desc %></textarea></td>
      </tr>
    </table>
    <table class="buttable1">
      <tr>
<%
try{
	if(menuLevel<SysMenuModel.MENULEVEL_THREE){
%>
        <td align = "center" width = "20%"><input class="butACTION" type="button" value="添加子菜单" name="butAddChild"
            onclick = "window.navigate('menuAdd.jsp?parentUuid=<%= uuid %>&parentName=<%= name %>')"></td>
<%
	}
%>
        <td align = "center" width = "20%"><input class="butACTION" type="button" value="编　　　辑" name="butEdit"
            onclick = "window.navigate('menuUpdate.jsp?uuid=<%= uuid %>')"></td>
        <td align = "center" width = "20%"><input class="butACTION" type="button" value="删　　　除" name="butDelete"
            onclick = "window.navigate('menuDelete.jsp?uuid=<%= uuid %>&name=<%= name %>')"></td>
      </tr>
<%
}catch(Exception err){
}
%>
    </table>
  </div>
<%}%>
</body>
</html>
