index.esp 5.5 KB
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
    <link href="scripts/easyui/themes/icon.css" rel="stylesheet" />
    <link href="css/frame.css" rel="stylesheet" />
    <link href="css/index.css" rel="stylesheet" />
</head>

<body class="easyui-layout mainContainer" data-options="fit:true" id="mainLayout">
    <!-- 后端验证用户是否登录的逻辑,不需要修改 -->
    <%
            cchar* loginedUser = getSessionVar("loginedUser");
            if(loginedUser == NULL)
			{
	            redirect("login.html");
			}
			else
			{
				puts("+++++++++++++*****************--------------");
				printf("loginedUser: %s\n", loginedUser);
				puts("+++++++++++++*****************--------------");
			}
        %>
        <div data-options="region:'north',border:false" class="main-north">
            <div class="log">

            </div>
            <div class="navMenu" data-bind=" with: menuData">
                <ul class="menus_lv1" data-bind="foreach:menus">
                    <li class="menu_level1" data-bind="click: $root.selectMenuLv1, css: { disabled: $root.isLv1MenuDisabled($data) }">
                        <div class="menu_level1_icon" data-bind="attr:{style:getMenuIcon(id)}"></div>
                        <span class="menu_level1_text" data-bind="text:name"></span>
                    </li>
                </ul>
            </div>
            <div class="userInfo">
                <div class="userInfoContainer">
                    <span id="loginedUser">
                        <span class="i18n-item" data-i18n-key="current_user"></span>:
                        <!-- 显示已登录的用户名 -->
                        <%= getSessionVar("loginedUser") %>
                    </span>&nbsp;&nbsp;
                    <a href="#" onclick="loginout()">
                        <span class="i18n-item" data-i18n-key="log_out"></span>
                    </a>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div data-options="region:'west',border:false,collapsible:false,closeDuration:0" class="left_menu">
            <ul class="lv2MenuContainer" data-bind="foreach:selectedMenuItems">
                <!--当有可用的子菜单时才显示二级菜单-->
                <li class="menuLv2Item" data-bind="click:$root.selectMenuLv2,clickBubble: false,css:{disabled:!$root.isLevel2MenuValid(url,children)}">
                    <div class="menuLv2Title">
                        <span class="menuName" data-bind="text:name"></span>
                        <span class="menuLv2Icon"></span>
                    </div>
                    <ul class="lv3MenuContainer" data-bind="foreach:children">
                        <li class="menuLv3Item" data-bind="text:name,css:{disabled:$root.isLv3MenuDisabled($data)},click:$root.selectMenuLv3,clickBubble: false"></li>
                    </ul>
                </li>
            </ul>
        </div>
        <div data-options="region:'center',border:false" class="main-center">
            <iframe id="mainPageFrame" frameborder="0" src=""></iframe>
        </div>
        <!-- 消息控件,用来向浏览器抛出事件,发送抓拍图片,抓拍信息,流量信息 -->
        <object id="infoOcxObj" classid="clsid:09614DB3-38D7-4C11-8C02-4D1BA8675153" style="height: 0; width: 0;"></object>
        <!-- 需要的js文件 -->
        <script src="scripts/console-polyfill.js"></script>
        <script src="scripts/core-js/core.min.js"></script>
        <script src="scripts/easyui/jquery.min.js"></script>
        <script src="scripts/i18n/jquery.i18n.properties.js"></script>
        <script src="scripts/easyui/easyloader.js"></script>
        <script src="scripts/knockout-3.2.0.js"></script>
        <script src="scripts/utilities.js"></script>
        <script src="scripts/i18n/i18nHelper.js"></script>
        <script src="index.js"></script>

        <!-- 下面的script标签,是用来响应Ocx控件的事件, for指向ocx的Id, event指向要响应的事件及参数 -->
        <script type="text/javascript" for="infoOcxObj" event="ResultRecved(jsonStr)">
            var data = $.parseJSON(jsonStr);
            var mainPageViewModel = window.frames["mainPageFrame"].mainPageViewModel;
            if (mainPageViewModel) {
                mainPageViewModel.processInfo(data);
            }
        </script>
        <script type="text/javascript" for="infoOcxObj" event="AlarmRecved(jsonStr)">
            var alarmJsonData = $.parseJSON(jsonStr);
            var mainPageViewModel = window.frames["mainPageFrame"].mainPageViewModel;
            if (mainPageViewModel) {
                mainPageViewModel.processAlarmInfo(alarmJsonData);
            }
        </script>
        <script type="text/javascript" for="infoOcxObj" event="FlowRecved(jsonStr)">
            var flowJsonData = $.parseJSON(jsonStr);
            var mainPageViewModel = window.frames["mainPageFrame"].mainPageViewModel;
            if (mainPageViewModel) {
                mainPageViewModel.processFlowInfo(flowJsonData);
            }
        </script>
        <script type="text/javascript" for="infoOcxObj" event="LightStatusRecved(jsonStr)">
            var flowJsonData = $.parseJSON(jsonStr);
            var mainPageViewModel = window.frames["mainPageFrame"].mainPageViewModel;
            if (mainPageViewModel) {
                mainPageViewModel.signalLight(flowJsonData);
            }
        </script>
</body>

</html>