<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:c="leaf.application.action" xmlns:p="uncertain.proc"
          xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script"
          trace="true">
    <a:init-procedure>
        <model-query model="zjwfl.ZJWFL5110.sdic_wfl_to_do_list_count" rootpath="to_do_list_count"/>
        <a:model-query model="sys.SYS100.sys_notice_msg_count" rootpath="notice_msg_count"/>
        <a:model-query model="sys.SYS100.sys_notice_title_count" rootPath="notice_title_count_rp"/>
        <a:model-query defaultWhereClause="v.menu_type=&apos;MENU&apos; and v.parent_menu_id is null" fetchAll="true" model="sys.sys_page_menu" rootPath="main_menu_list"/>
        <a:model-query defaultWhereClause="v.menu_type=&apos;MENU&apos; and v.parent_menu_id is not null" fetchAll="true" model="sys.sys_page_menu" rootPath="sub_menu_list"/>
        <a:model-query defaultWhereClause="v.menu_type = &apos;FUNCTION&apos;" fetchAll="true" model="sys.sys_page_menu" rootPath="menu_function_list"/>
        <a:model-query fetchAll="true" model="sys.sys_page_function_favorites" rootPath="favorites_list"/>
        <a:model-query fetchAll="true" model="sys.sys_page_function_last_visits" rootPath="last_visits_list"/>
        <a:model-query fetchAll="true" model="sys.sys_page_function_most_visits" rootPath="most_visits_list"/>
        <a:model-query fetchAll="true" model="sys.sys_page_home_page" rootPath="home_page_list"/>
        <a:model-query model="basic.sys_session_info" rootPath="mainPage_session_record"/>
        <!--<a:model-query fetchAll="true" model="basic.hls_get_sys_parameter_tab_function_value" rootPath="hls_get_sys_parameter_open_tab_path"/>-->
        <a:model-query defaultWhereClause="t1.role_id=${/session/@role_id} and t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="sys.SYS890.hls_sys_role_home_page_vl" rootPath="fast_button_record"/>
        <a:model-query defaultWhereClause="user_id=${/session/@user_id}" fetchAll="true" model="sys.sys_user_theme" rootPath="sys_user_theme_path"/>
       <s:server-script><![CDATA[
                   var sys_user_theme_path = $ctx.get('/model/sys_user_theme_path').getChildren();
                   if(sys_user_theme_path.length > 0){
                   $ctx.session.theme = sys_user_theme_path[0].theme;
                   $ctx.session.subject = sys_user_theme_path[0].subject;
                   $session.theme = sys_user_theme_path[0].theme;
                   $session.subject = sys_user_theme_path[0].subject;
                   } else {
                   $ctx.session.theme = 'hap';
                   $ctx.session.subject = 'HAP';
                   $session.theme = 'hap';
                   $session.subject = 'HAP';
                   }
                   $ctx.parameter.global_tab_flag='Y';
                   ]]>
               </s:server-script>
    </a:init-procedure>
    <a:view>
        <a:link id="bmLink_function_query" model="sys.SYS890.hls_sys_role_home_page_vl" modelaction="query"/>
        <a:link id="BmLink_MainScreen_functionHit" model="sys.sys_page_function_visit" modelaction="update"/>
        <a:link id="BmLink_MainScreen_AddFunctionFavorite" model="sys.sys_page_function_favorites" modelaction="insert"/>
        <a:link id="BmLink_MainScreen_DelFunctionFavorite" model="sys.sys_page_function_favorites" modelaction="delete"/>
        <a:link id="BmLink_MainScreen_SetHomePage" model="sys.sys_page_home_page" modelaction="update"/>
        <a:link id="PageLink_MainScreen_LoginTimeout" url="${/request/@context_path}/login_timeout.lview"/>
        <a:link id="pageLink_update_self_password" url="${/request/@context_path}/update_self_password.lview"/>
        <a:link id="pageLink_show_session" url="${/request/@context_path}/main_show_session.lview"/>
        <a:link id="theme_select_link" url="${/request/@context_path}/leaf_theme_select.lview"/>
        <a:link id="gloabl_tab_iframe_link" url="${/request/@context_path}/global_tab_iframe.lview"/>
        <a:link id="fast_btn_config" url="${/request/@context_path}/fast_btn_config.lview"/>
        <a:link id="subject_select_link" url="${/request/@context_path}/sys_subject_select.lview"/>
        <a:link id="login_timeout_id" url="${/request/@context_path}/login_timeout.lview"/>

        <a:link id="my_profile_config" url="${/request/@context_path}/sys_user_config.lview"/>

        <a:link id="bmLink_sys_function_v_query" model="home.sys_function_group_item_vl" modelaction="query"/>
        <a:link id="bmLink_sys_page_menu_query" model="home.sys_page_menu" modelaction="query"/>
        <a:link id="bmLink_sys_function_query" model="sys.SYS860.sys_function" modelaction="query"/>
        <a:link id="bmLink_sys_notice_msg" model="sys.SYS100.sys_notice_msg" modelaction="query"/>
        <a:link id="bmLink_wfl_instance_node" model="zjwfl.ZJWFL5110.sdic_wfl_instance_node_recipient" modelaction="query"/>


        <link href="${/request/@context_path}/lib/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
        <link href="${/request/@context_path}/lib/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />

        <link href="${/request/@context_path}/css/${/session/@theme}/home_page/home-page-css.css" rel="stylesheet" type="text/css"/>
        <link href="${/request/@context_path}/css/common/main_common.css" rel="stylesheet"
              type="text/css"/>
        <link href="${/request/@context_path}/css/common/sys-notice.css" rel="stylesheet"
              type="text/css"/>
        <script src="${/request/@context_path}/javascripts/jquery.slimscroll.min.js"
                type="text/javascript"></script>
        <!--<script src="${/request/@context_path}/javascripts/module-box.js"-->
                <!--type="text/javascript"></script>-->
        <link href="${/request/@context_path}/css/reset.css" rel="stylesheet" type="text/css"/>
        <script>
            var contextPath = '${/request/@context_path}';
        </script>
        <script src="${/request/@context_path}/javascripts/websocket/sockjs.js"
                type="text/javascript"></script>
        <script src="${/request/@context_path}/javascripts/websocket/show_notice.js"
                type="text/javascript"></script>
        <style>

            .custTree .clip-minusTop, .custTree .clip-minusBottom, .custTree .clip-minus {
                background: url(${/request/@context_path}/images/minus.gif) no-repeat 50%;
            }

            .custTree .clip-plusTop, .custTree .clip-plusBottom, .custTree .clip-plus {
                background: url(${/request/@context_path}/images/plus.gif) no-repeat 50%;
            }

            .custTree .item-node {
                padding-top: 5px;
            }

            .custTree .icon-node {
                background: url(${/request/@context_path}/images/chart_bar.png) no-repeat 50%;
            }
            .searchBox {
                background: #fff url(${/request/@context_path}/images/search.png) 2px 2px no-repeat;
                padding-left: 5px;
            }
            #sidemenu div s {
                display: inline-block;
                float: left;
                width: 28px;
                height: 30px;
                background: url(${/request/@context_path}/images/blue_bg.gif) 0 -96px;
                vertical-align: middle;
            }

            .sidebar-toggler {
                background-image: url(${/request/@context_path}/lib/assets/layouts/layout4/img/sidebar-toggle-light.png);
                width: 18px;
                height: 14px;
                display: inline-block;
                opacity: 0.6;
                cursor: pointer;
            }

            .sidebar-toggler-top {
                background-image: url(${/request/@context_path}/images/main_navigation_bar.png);
                width: 18px;
                height: 14px;
                display: inline-block;
                opacity: 0.6;
                cursor: pointer;
            }
            .item-tab-strip-bar{
                display: none;
            }
            .item-tab-body {
                /* border: 1px solid #ddd; */
                position: relative;
                overflow: hidden;
                /* background-color: #ebf1f5; */
                background-color: #eee;
                /* margin-top: 10px; */
                width: 100%;
                border-top: none;
            }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow{
                position: absolute;
                right: 55px;
                top: 26px;
                height: 21px;
                width: 157px;
                background-color: rgba(0, 0, 0, 0.298039);
                display:none;
            }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #search-function{
                position: absolute;
                right: 107px;
                width: 52px;
                height: 21px;
            }
            /*.hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #search-function:hover{*/
                /*background: #3D3D3D !important;*/
                /*display: block;*/
            /*}*/
            .hap-main-screen-toolbar-contain #page-topbar .topbar #preview-image{
                position: absolute;
                right: 73px;
                width: 136px;
                height: 136px;
                display: none;
                top: 63px;
                z-index: 1003;

            }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow .middle-line{
                position: absolute;
                right: 52px;
                width: 1px;
                height: 8px;
                background: #fff;
                top: 6px;
            }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow .middle-line1{
                position: absolute;
                right: 105px;
                width: 1px;
                height: 8px;
                background: #fff;
                top: 6px;
             }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #click-workflow{
                width:52px;
                position:absolute;
                left:52px;
                display:block;
                height:100%;
                padding:0px;
                background: none;
            }

            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #click-workflow img{

            }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #user-info img{
                width:15px;
                height:15px;
                padding-left:18px;
                margin-top: 2px;
                cursor: pointer;
               }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #user-info{
                width:52px;
                position:absolute;
                right:0px;
                display:block;
                height:100%;
            }
            /*.hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #user-info:hover{*/
                /*background: #3D3D3D !important;*/
                /*display: block;*/
            /*}*/
            .hap-main-screen-toolbar-contain #page-topbar .topbar #user-workflow #user-info #userDetail{
                box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);
                -moz-box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);
                -webkit-box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);
                border-radius:5px !important;
                font-family: NotoSansHans-Bold;
            }
            .hap-main-screen-toolbar-contain #page-topbar .topbar #cover{
                position:absolute;left:0px;top:0px;
                background:rgba(0, 0, 0, 0.4);
                width:100%;  /*宽度设置为100%,这样才能使隐藏背景层覆盖原页面*/
                height:100%;
                filter:alpha(opacity=60);  /*设置透明度为60%*/
                opacity:0.6;  /*非IE浏览器下设置透明度为60%*/
                display:none;
                /*z-Index:999;*/
            }
            .hap-main-screen-toolbar-contain #show-workflow-page{
                    box-shadow: rgba(0, 0, 0, 0.14902) 0px 8px 10px 0px;
                    border-radius: 5px !important;
                    display: none;
                    height: 464px;
                    width: 216px;
                    background: white;
                    position:absolute;
                    right:46px;
            }
        </style>
        <script><![CDATA[
        function refreshFrame() {
            $("mainTab").selectTab($("mainTab").getTab($("mainTab").activeTab).index,true);
        }
        function getBreadMessage(url,code) {
            var html = '';
            Leaf.request({
                url: $('bmLink_sys_page_menu_query').getUrl(),
                scope: this,
                para: {function_code: code},
                success: function (res) {
                    if (res.success) {
                        var datas = res.result.record;
                        if(!(datas instanceof Array)){
                            datas = new Array(datas);
                        }
                        for(var  i = 0; i < datas.length; i++) {
                            if (datas[i].grand_parent_function_name != null && datas[i].parent_function_name != null) {
                                var text = datas[i].grand_parent_function_name + '&nbsp;&nbsp;/&nbsp;&nbsp;'
                                    + datas[i].parent_function_name + '&nbsp;&nbsp;/&nbsp;&nbsp;' + datas[i].function_name;
                                html = '<span style="margin-left: 15px;width: 295px;display: inline-block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" title="' + text + '">' + text +'</span>'
                            }
                        }
                        initBread(url,html);
                    }
                }
            });
        }
        //为nodeList添加forEach方法
        if (!!window.ActiveXObject || "ActiveXObject" in window) {
            NodeList.prototype.forEach = Array.prototype.forEach || function (callback) {
                var isArray = Object.prototype.toString.call(this) == '[object Array]';
                if (isArray) {
                    for (var key in this) {
                        if (key != 'forEach') {
                            callback.call(this[key], key, this[key], this);
                        }
                    }
                } else {
                    throw TypeError;
                }
            };
        }

        var global_tab_flag = '${/parameter/@global_tab_flag}';
        var frameId = 0;

        function updatePassword() {
            new Leaf.Window({
                id: 'update_password_window',
                url: $('pageLink_update_self_password').getUrl(),
                params:{
                    user_name:jQuery("#userName").text()
                },
                title: '修改密码',
                closeable: true,
                draggable: false,
                height: 240,
                width: 260
            });
        }

        function mainScreen_doOperation(o_type) {
            var function_code = Leaf.getCookie('FUNCTION_CODE');
            if (Ext.isEmpty(function_code)) {
                Leaf.showMessage('提示', '页面不存在');
                return;
            }

            var Urlconfig = {
                'addFavorite': 'BmLink_MainScreen_AddFunctionFavorite',
                'delFavorite': 'BmLink_MainScreen_DelFunctionFavorite',
                'setHomePage': 'BmLink_MainScreen_SetHomePage'
            };

            var link = Urlconfig[o_type];
            var url = $(link).getUrl();

            Leaf.request({
                url: url,
                para: {
                    function_code: function_code
                },
                scope: this,
                success: function() {
                    Leaf.showMessage('提示', '操作成功!刷新页面或者下次登录时生效');
                }
            });
        }

        function removeHistory(key,code,index) {
            var name = historyList[key];
            var index = 0;
            for(var v in historyList){
                if(v == key){
                    $("mainTab").closeTab(index);
                }
                index++;
            }
            delete historyList[key];
            // document.getElementById('history').removeChild(document.querySelector('a[url="'+ key +'"]'));
            document.getElementById('function_history_content_x').removeChild(document.querySelector('div[key="'+ key +'"]'));
            if(jQuery(".function_history_item_hover").length == 0) {
                jQuery(".function_history_item").eq(index - 2).addClass("function_history_item_hover");
                jQuery(".function_history_item").eq(index - 2).find(".history_description").click();
            }
            jQuery("#function_history_content_x").css("width",jQuery("#function_history_content_x div").length*135 +"px");
            if(jQuery("#function_history_content_x").width() <= jQuery("#function_history_content").width()){
                jQuery("#function_history_content_next").hide();
                jQuery("#function_history_content_pre").hide();
            }
            if (window.currentTab === code) {
                /*goToHomePage();*/
                document.querySelectorAll('.fast_btn_span').forEach(function (value) {
                    value.style.color = '#fff';
                    value.style.borderBottom = '';
                })
            }
            document.getElementById('history').style.display = 'none';
        }



        //请求面包屑数据
        function makeBread(url, code) {
            getBreadMessage(url,code);
        }
        //生成面包屑数据
        function initBread(url,html){
            document.querySelector('#bread > span').innerHTML = html;

            var sort = 0 ;
            histories.forEach(function (value,index) {
                (value.url === url) && (sort = index);
            })
            if (sort + 1 === histories.length){
                document.getElementById('main_forward').classList.remove('main-bread-img');
                document.getElementById('main_forward').classList.add('main-bread-img-cannot');
                if (sort === 0) {
                    document.getElementById('main_back').classList.remove('main-bread-img');
                    document.getElementById('main_back').classList.add('main-bread-img-cannot');
                } else {
                    document.getElementById('main_back').classList.remove('main-bread-img-cannot');
                    document.getElementById('main_back').classList.add('main-bread-img');
                }
                document.getElementById('main_forward').onclick = function (ev) {  };
                document.getElementById('main_back').onclick = function (ev) {
                    mainJumpUrl(histories[sort - 1].url,histories[sort -1].function_name,histories[sort -1].code)
                }
            } else {
                document.getElementById('main_forward').classList.remove('main-bread-img-cannot');
                document.getElementById('main_forward').classList.add('main-bread-img');
                if (sort === 0) {
                    document.getElementById('main_back').classList.remove('main-bread-img');
                    document.getElementById('main_back').classList.add('main-bread-img-cannot');
                } else {
                    document.getElementById('main_back').classList.remove('main-bread-img-cannot');
                    document.getElementById('main_back').classList.add('main-bread-img');
                }
                document.getElementById('main_forward').onclick = function (ev) {
                    mainJumpUrl(histories[sort + 1].url, histories[sort + 1].function_name,histories[sort + 1].code)
                };
                document.getElementById('main_back').onclick = function (ev) {
                    mainJumpUrl(histories[sort - 1].url,histories[sort -1].function_name,histories[sort -1].code)
                }
            }

            //makePullDown();
            jQuery("#function_history_content").css("width",jQuery(window).width()-jQuery("#bread").width()-135);

        }

        function checkHistories(url) {
            var result = true;
            histories.forEach(function (value) {
                value.url == url && (result = false)
            })
            return result;
        }

        var historyList = {};
        var histories = [];
        var firstBarHeight = 50;
        var secondBarHeight = 40;
        var marginTop = 0;

        function findCodeByUrl(url){
            for(var i = 0; i < histories.length; i++){
                if(histories[i].url == url){
                    return histories[i].code
                }
            }
        }

        var initLoadMainFlag = 'N';

        function mainJumpUrl(url, func_name ,code) {
            //
            makeBread(url,code);
            var screenHeight = Leaf.getViewportHeight();
            if(code == 'SYS_HOME_PAGE'&&initLoadMainFlag=='N'){
                initLoadMainFlag='Y';
                jQuery(".function_tool_bar").hide();
                $('mainTab').setMainHeight(screenHeight - firstBarHeight+marginTop);
                jQuery("#mainTab").css("margin-top",firstBarHeight-marginTop);
            }else{
                jQuery(".function_tool_bar").show();
                $('mainTab').setMainHeight(screenHeight - firstBarHeight-secondBarHeight+marginTop);
                jQuery("#mainTab").css("margin-top",firstBarHeight+secondBarHeight-marginTop);
            }
            Leaf.setThemeUnload('${/session/@theme}');
            hideCurrentMenu();
            Leaf.setCookie('TARGETURL', url, 0.5);
            if(url.indexOf("function_code")==-1){
                openTab($('gloabl_tab_iframe_link').getUrl() + '?frame_id=' + (++frameId) + '&screen=' + url+'&function_code='+code, func_name);
            }else{
                openTab($('gloabl_tab_iframe_link').getUrl() + '?frame_id=' + (++frameId) + '&screen=' + url, func_name);
            }
                historyList[url] = func_name;
                if (checkHistories(url)) {
                    histories.push({
                        url: url,
                        function_name: func_name,
                        code: code
                    });
                }
                var html = '';
                for (var key in historyList) {
                    var function_code = findCodeByUrl(key);
                    var className = 'function_float_left function_history_item';
                    if(key == url){
                        className = className + " function_history_item_hover";
                    }
                    html = html + '<div key="'+key+'" class="'+className+'"><span class="history_description" title="'+historyList[key]+'" onclick="mainJumpUrl(\''+key+'\',\''+historyList[key]+'\',\''+function_code+'\')">'+historyList[key]+'</span>';
                    if(key !== 'leaf_user_role_home_page.lview'){
                        html = html + '<span class="history_close" onclick="removeHistory(\''+key+'\',\''+function_code+'\')">X</span></div>';
                    }else{
                        html = html + '</div>';
                    }
                }

                jQuery("#function_history_content_x").html(html);
                jQuery("#function_history_content_x").css("width",jQuery("#function_history_content_x div").length*135 + "px");
                if((jQuery("#function_history_content_x").width() > jQuery("#function_history_content").width()) && jQuery("#function_history_content").width() != 0){
                    jQuery("#function_history_content_next").show();
                    jQuery("#function_history_content_pre").show();
                }
                /*document.getElementById('mainFrame').onload = function(){
                    jQuery(parent.jQuery("#mainFrame")[0].contentWindow.document.querySelectorAll("html")).niceScroll()
                }*/
                /*document.getElementById('mainFrame').src = url;*/

                //显示面包屑
                document.getElementById('bread').style.display = 'inline-block';
                jQuery("#function_history_content").scrollLeft(jQuery("#function_history_content_x").width()-jQuery("#function_history_content").width());
        }

        function openTab(url, prompt) {
            var tabArr = $('mainTab').items;
            if (tabArr && tabArr.length && tabArr.length > 0) {
                for (var i = 0;i < tabArr.length;i++) {
                    if (tabArr[i].prompt == prompt) {
                        $('mainTab').selectTab(i);
                        var frameIDReg = /frame_id=\d+\&/;
                        var frameIDStrArr = tabArr[i].ref.match(frameIDReg);
                        if (frameIDStrArr && frameIDStrArr[0]) {
                            var frameID = frameIDStrArr[0].replace('frame_id=', '').replace('&', '');
                            /*document.getElementById('tabFrame' + frameID).src = window['frame_url_' + frameID];*/
                        }
                        return;
                    }
                }
            }
            $('mainTab').openTab(url, prompt);
            var ifarme = $jq("iframe").filter(function(index,obj){
                return obj.src == url;
            });
        }

        function mainScreen_hitPage(function_code) {
            if (Ext.isEmpty(function_code)) {
                return;
            }
            Leaf.setCookie('FUNCTION_CODE', function_code, 0.5);

            Leaf.request({
                url: '${/request/@context_path}/autocrud/sys.sys_page_function_visit/update',
                para: {
                    function_code: function_code
                    // function_name: function_code
                },
                scope: this,
                success: function(res) {
//                    var mainServiceName = 'leaf_user_role_home_page.lview';

                    var mainServiceName = res.result['main_service_name'];
                    if(mainServiceName=='user_role_home_page.lview'){
                        mainServiceName = 'leaf_user_role_home_page.lview'
                    }
                    var layout_code = res.result['layout_code'];
                    if (Ext.isEmpty(mainServiceName)) {
                        Leaf.showMessage('提示', '功能不存在');
                        return;
                    } else {
                        if (layout_code) {
                            mainServiceName = mainServiceName + '?layout_code=' + layout_code + '&function_code=' + function_code;
                        }
                        var func_name = res.result['function_name'];
                        mainJumpUrl(mainServiceName, func_name ,function_code);
                    }
                }
            });
        }

        function mainScreen_refreshMainContent() {
            //如果cookie中未找到,则跳转到首页
            var function_code = Leaf.getCookie('FUNCTION_CODE');
            if (Ext.isEmpty(function_code)) {
                goToHomePage();
            } else {
                mainScreen_hitPage(function_code);
            }
        }

        function mainJumpCode(function_code ,isMainMenu) {
            // document.getElementById('')
            if (isMainMenu) {
                document.querySelectorAll('.fast_btn_span').forEach(function (value) {
                    value.style.color ='#fff';
                    value.style.borderBottom = '';
                    document.getElementById('main_menu_id').style.display = 'none';
                })
            }
            if (!Ext.isEmpty(function_code)) {
                window.currentTab = function_code;
                mainScreen_hitPage(function_code);
            }
        }

        var global_function_code;

        function goToHomePage() {

            var function_code = '${/model/home_page_list/record/@function_code}';
            if (Ext.isEmpty(function_code)) {
                //function_code = 'SYS_HOME_PAGE';
                function_code = "SYS_HOME_PAGE";
            }
            global_function_code = function_code;
            mainJumpCode(function_code);
        }

        function doSearch() {
            var function_code = (document.getElementById('sp-searchtext').value).toUpperCase();
            Leaf.request({
                url:$('bmLink_sys_function_v_query').getUrl(),
                scope:this,
                para:{
                    function_name:'%'+document.getElementById('sp-searchtext').value+'%',
                    enabled_flag: 'Y',
                    role_id: ${/session/@role_id}
                },
                success:function (res) {
                    if(res.result.record){
                        if (res.result.record[0]){
                            function_code = res.result.record[0].function_code;
                        }else{
                            function_code = res.result.record.function_code;
                        }
                    }

                    if (!function_code) {
                        return;
                    } else {
                        mainScreen_hitPage(function_code);
                    }
                }
            });



        }

        function hideSubmenu(code) {
            document.getElementById('SUBMENU_' + code).style.display = 'none';
            document.querySelectorAll('div[childMenu]').forEach(function (value) { value.style.display = 'none' });
            window.subModel = null;
        }

        function hideCurrentMenu() {
            if (window.subModel) {
                hideSubmenu(window.subModel);
            }
        }

        function hideTargetUrl(code) {
            /*document.querySelectorAll('.menu').forEach(function (value) { value.style.display = 'none' });
             if (window.currentModel && window.currentModel != code) {
             window.subModel = null;
             Ext.get('M_MENU_' + window.currentModel).child('a').removeClass('active');
             document.getElementById('SUBMENU_' + window.currentModel).style.display = 'none';
             }
             window.currentModel = code;
             Ext.get('M_MENU_' + code).child('a').addClass('active');
             hideSubmenu(code);*/
        }

        function cleanKeepMainMenu(dom) {
            var subCode = dom.id.substring(8);
            keepMainMenuTimeOuts.forEach(function (value) {
                window.clearTimeout(value);
            });
            keepMainMenuTimeOuts = [];
            chooseMainMenu(subCode)


        }

        function chooseMainMenu(code) {
            return function () {
                if (!checkIsColse()) {
                    document.querySelectorAll('.head_c').forEach(function (value) {
                        //value.style.color = '#333333';

                    });
                    var subMenuFlag = false;
                    document.querySelectorAll('.menu').forEach(function (value) {
                        ($jq(value).css('display') !== 'none') && (subMenuFlag = true);
                    });
                    document.querySelectorAll('.menu').forEach(function (value) {
                        value.style.display = 'none'
                    });
                    if (window.currentModel && window.currentModel != code) {
                        window.subModel = null;
                        document.querySelectorAll('div[childMenu]').forEach(function (value) {
                            value.style.display = 'none';
                        });
                        Ext.get('M_MENU_' + window.currentModel).child('a').removeClass('active');
                        document.getElementById('SUBMENU_' + window.currentModel).style.display = 'none';
                    }
                    window.currentModel = code;
                    Ext.get('M_MENU_' + code).child('a').addClass('active');


                    window.subModel = code;
                    var x = Ext.get('M_MENU_' + code).child('a').getXY()[0];
//              Ext.get('SUBMENU_' + code).setLeft(x - 10);
//                     Ext.get('SUBMENU_' + code).fadeIn();
                    Ext.get('SUBMENU_' + code).dom.style.display = 'block';
                    Ext.get('SUBMENU_' + code).setHeight($jq('#main_menu_id').height());

                    if (!subMenuFlag) {
                        document.querySelectorAll('#SUBMENU_' + code + ' ul').forEach(function (value) {
                            value.style.display = 'none';
                        });
                        document.querySelectorAll('#SUBMENU_' + code + ' span').forEach(function (value) {
                            value.style.display = 'none';
                        });
                        Ext.get('SUBMENU_' + code).dom.classList.add('main_menu_show_up');
                        setTimeout(function () {
                            document.querySelectorAll('#SUBMENU_' + code + ' span').forEach(function (value) {
                                value.style.display = '';
                            });
                            document.querySelectorAll('#SUBMENU_' + code + ' ul').forEach(function (value) {
                                value.style.display = '';
                            });
                            Ext.get('SUBMENU_' + code).dom.classList.remove('main_menu_show_up');

                        }, 300);
                    }
                }

                document.getElementById('main_menu_id').style.borderBottomRightRadius = '0px';
                document.getElementById('main_menu_id').style.borderTopRightRadius = '0px';
                document.getElementById('solidblockmenu').style.borderBottomRightRadius = '0px';
                document.getElementById('solidblockmenu').style.borderTopRightRadius = '0px';
                document.querySelectorAll('.menu').forEach(function (value) {
                    value.style.borderTopRightRadius = '10px';
                    value.style.borderBottomRightRadius = '10px';
                });
            }
        }

        //用于存放主菜单timouts
        var keepMainMenuTimeOuts = [];
        function mainSetTargeturl(code) {
            keepMainMenuTimeOuts.push(setTimeout(chooseMainMenu(code).bind(this), 300));
        }

        function show_tool_tip(e, code) {
            $L.ToolTip.show(e, code);
        }

        function hide_tool_tip(e) {
            $L.ToolTip.hide(e);
        }

        function showSessionMessage() {
            new Leaf.Window({
                id: 'main_show_session',
                url: $('pageLink_show_session').getUrl(),
                title: '查看SESSION',
                params: {
                    jsid: Leaf.getCookie('JSID')
                },
                width: 420,
                height: 550
            });
        }

        function exitSystem() {
            Leaf.showConfirm('提示', '你确定要退出登陆吗?', function() {
                Leaf.request({
                    url: 'logout.lsc',
                    para: {},
                    success: function() {
                        try {
                            if (window.opener) {
                                opener.location.href = 'login';
                                window.close();
                            } else {
                                location.href = 'login';
                            }
                        } catch (e) {
                            window.close();
                        }
                    },
                    scope: this
                });
            }, null, 400);
        }

        function showTheme() {

            var url = $('theme_select_link').getUrl();
            var themeWindow = new Leaf.Window({
                id: 'theme_window',
                url: url,
                title: '皮肤选择',
                height: 216,
                width: 700
            });
        }

        function to_do_interval() {
            $('to_do_list_count_ds').query();
        }

        //setInterval('to_do_interval()', 1000 * 60 * 1);
        var con_time = new Date();

        function to_do_load() {
            var to_do_count_id = $('to_do_list_count_ds');
            var record = to_do_count_id.getAt(0);

            var max_date = record.get('max_date');
            if (max_date <= con_time) {
                //start('up');//测试用
            } else {
                con_time = max_date;
                start('up');
            }

        }

        window.onload = function() {
            var divTip = document.createElement("div");
            divTip.id = "main_message_tip";
            divTip.innerHTML = "<h1><a href='javascript:void(0)' onclick='start()'>×</a>new message!</h1><p><a href='javascript:void(0)' onclick='showwin()'>您有新的待办事项!</a></p>";
            divTip.style.height = '0px';
            divTip.style.bottom = '0px';
            divTip.style.position = 'fixed';
            document.body.appendChild(divTip);
            //加载通知与待办信息
        };

        var handle;

        function start(param) {
            var obj = document.getElementById("main_message_tip");
            // if (parseInt(obj.style.height) == 0) {
            // obj.style.display = "block";
            // //handle = setInterval("changeH('up')", 20);
            // obj.style.height = "100px";
            // } else {
            // //handle = setInterval("changeH('down')", 20);
            // obj.style.display = "none";
            // obj.style.height = "0px";
            // }
            if (param == 'up') {
                obj.style.display = "block";
                obj.style.height = "100px";
            } else {
                obj.style.display = "none";
                obj.style.height = "0px";
            }
        }

        //页面浮出效果,暂不用


        function changeH(str) {
            var obj = document.all ? document.all["main_message_tip"] : document.getElementById("tip");
            if (str == "up") {
                if (parseInt(obj.style.height) > 100) {
                    clearInterval(handle);
                } else {
                    obj.style.height = (parseInt(obj.style.height) + 8).toString() + "px";
                }
            }
            if (str == "down") {
                if (parseInt(obj.style.height) < 8) {
                    clearInterval(handle);
                    obj.style.display = "none";
                } else {
                    obj.style.height = (parseInt(obj.style.height) - 8).toString() + "px";
                }
            }
        }

        function showwin() {
            start(); //隐藏消息窗口
            mainScreen_hitPage('ZJWFL5110');
        }


        function chooseSubMenu(dom) {
            return function () {
               //
                if (!checkIsColse()) {
                    document.querySelectorAll('.head_c').forEach(function (value) {
                        //value.style.color = '#fff';

                    });
                    //dom.style.color = '#000';

                    var childMenuFlag = false;
                    document.querySelectorAll('div[childMenu]').forEach(function (val) {
                        val.style.display !== 'none' && (childMenuFlag = true);
                    });
                    document.querySelectorAll('div[childMenu]').forEach(function (val) {
                        val.style.display = 'none'
                    });
                    if (!childMenuFlag) {
                        document.querySelectorAll('.childMenu a').forEach(function (value) {
                            value.style.display = 'none';
                        });
                        dom.lastChild.classList.add('child_menu_show_up');
                        setTimeout(function () {
                            document.querySelectorAll('.childMenu a').forEach(function (value) {
                                value.style.display = 'inline-block';
                            });
                            dom.lastChild.classList.remove('child_menu_show_up');
                        }.bind(this), 300);
                    }
                    dom.lastChild.style.display = 'inline';
                }else {
                    document.getElementById('main_menu_id').style.display = 'block';
                }
                document.querySelectorAll('.menu').forEach(function (value) {
                    value.style.borderTopRightRadius = '0px';
                    value.style.borderBottomRightRadius = '0px';
                });
            }
        }

        //二级菜单timeouts数列
        var subMenuTimeOuts = [];
        function showSubChildMenu(dom) {
            subMenuTimeOuts.push(window.setTimeout(chooseSubMenu(dom), 300));
        }

        function cleanKeepSubMenu() {
            subMenuTimeOuts.forEach(function (value) {
                window.clearTimeout(value);
            });
            subMenuTimeOuts = [];
        }

        var hideTimerFirst;
        var hideTimerSecond;
        function lightButton(dom) {
            //
            dom.classList.remove('main_menu_clear');
            if (hideTimerFirst && hideTimerSecond) {
                // window.clearTimeout(hideTimerFirst);
                window.clearTimeout(hideTimerSecond);
            }

            window.clearTimeout(mainMenuTimeOut);
            if ($jq("#main_menu_id").css("display") === 'none') {
                document.getElementById('main_menu_id').style.display = 'block';
                document.getElementById('main_menu_id').classList.add('main_menu_show_up');
                setTimeout(function () {
                    document.getElementById('main_menu_id').classList.remove('main_menu_show_up');
                }, 500);
            }
            document.getElementById('main_menu_id').style.borderBottomRightRadius = '10px';
            document.getElementById('main_menu_id').style.borderTopRightRadius = '10px';
            document.getElementById('solidblockmenu').style.borderBottomRightRadius = '10px';
            document.getElementById('solidblockmenu').style.borderTopRightRadius = '10px';
        }

        function lightFastBtn(dom) {
            dom.style['border-bottom'] = '4px solid #00C1DE';
            dom.style.color = '#00C1DE';
        }

        var mainMenuTimeOut;
        function disableLight(dom) {
           //
            dom.style.background = '';
            mainMenuTimeOut = setTimeout(function () {
                document.getElementById('main_menu_id').style.display = 'none';
            },1000);

        }

        function disableLightFast(dom) {
            dom.style['border-bottom'] = '';
            dom.style.color = '';
        }

        function showThis(dom) {
            window.clearTimeout(keepMainMenuTimeOuts_copy);
            window.clearTimeout(mainMenuTimeOut);
            if (!checkIsColse()) {
                dom.style.display = 'block';
            }
        }

        function checkIsColse() {
            var isClose = false;
            document.querySelectorAll('div[childMenu]').forEach(function (value) {
                value.classList.contains('child_menu_clear') && (isClose = true);
            });
            document.querySelectorAll('.subMenu .menu').forEach(function (value) {
                value.classList.contains('main_menu_clear') && (isClose = true);
            });
            document.querySelectorAll('#main_menu_id').forEach(function (value) {
                value.classList.contains('main_menu_clear') && (isClose = true);
            });
            return isClose;
        }

        var keepMainMenuTimeOuts_copy;
        function hideThis(dom) {
            keepMainMenuTimeOuts_copy = (window.setTimeout(function () {
                document.querySelectorAll('div[childMenu]').forEach(function (value) {
                    hideMenu(value, 'child_menu_clear', '.menu a');
                });
                window.hideTimerFirst = setTimeout(function () {
                    document.querySelectorAll('.subMenu .menu').forEach(function (value) {
                        hideMenu(value,'main_menu_clear','.subMenu .menu span,.subMenu .menu ul');
                    });
                }.bind(this),100);
                window.hideTimerSecond = setTimeout(function () {
                    hideMenu(document.getElementById('main_menu_id'),'main_menu_clear','.subMenu .menu span,.subMenu .menu ul');
                }.bind(this),200);
            },1500));


            // dom.style.display = 'none';
        }

        function hideMenu(dom,className,domstr) {
            if (dom.style && $jq(dom).css("display") !== 'none') {
                dom.classList.add(className);
                setTimeout(function () {
                    document.querySelectorAll(domstr).forEach(function (value1) {
                        value1.style.display = 'none';
                    })
                }, 20);
                setTimeout(function () {
                    document.querySelectorAll(domstr).forEach(function (value1) {
                        value1.style.display = 'inline-block';
                    });
                    dom.style.display = 'none';
                    dom.classList.remove(className);
                }.bind(this), 100);
            }
        }

        function showNavigation() {
            var linkDisplay = $jq("#fast-link").css("display");
            linkDisplay === 'none' ? document.getElementById('fast-link').style.display = 'block'
                : document.getElementById('fast-link').style.display = 'none';
        }

        var historyTimeOut;
        function showPageHistory() {
            window.clearTimeout(historyTimeOut);
            document.querySelector('#history').style.display = 'block';
        }
        function hidePageHistory() {
            historyTimeOut = setTimeout(function () {
                document.querySelector('#history').style.display = 'none';
            },1000);
        }
        function to_get_code() {
            var userCodes = $('sys_role_ds').getAll();
            var roleId = ${/session/@role_id};
            var roleCode;
            userCodes.forEach(function(value) { value.data.role_id == roleId && (roleCode = value.data.role_code) });
            // $('sys_role_function_query_ds').query();
        }

        function openNewTab(dom) {
            // dom.style.color = 'rgb(0, 193, 222)';
            // dom.style.borderBottom = '4px solid rgb(0, 193, 222)';
            document.getElementById('borderLand').style.display = 'none';
            mainJumpCode(dom.id);
        }

        var fastFunctionList = [];


        function render_fast_link() {
            Leaf.request({
                url: $('bmLink_function_query').getUrl(),
                para:{
                    enabled_flag: 'Y',
                    role_id: ${/session/@role_id}
                    //fixme roleId
                },
                scope:this,
                success:function (res) {

                    if (res.success) {
                        fastFunctionList = res.result.record;
                        var html = '';
                        document.getElementById('fastButton').innerHTML = html;
                        if(fastFunctionList) {
                            fastFunctionList.forEach(function (value) {
                                html += '<span id="' + value.function_code + '" onclick="openNewTab(this)" class="fast_btn_span">' + value.function_name + '</span>'
                            });
                        }
                        html = html + '<img onclick="showFastBtnConfig()" class="fast_button_add" src="${/request/@context_path}/leafresource/images/MAIN/fast_button_add.png"/>';
                        document.getElementById('fastButton').innerHTML = html;
                        document.getElementById('pullDown').style.display = 'none';
                    }
                    makePullDown(true);
                }
            })

        }

        function makePullDown(isDataChanged) {
            if (fastFunctionList.length === 0) {
                render_fast_link();
            }
            document.getElementById('fastButton').style.width = $jq(window).width()
                - document.getElementById('allBar').offsetWidth
                - document.getElementById('bread').offsetWidth
                - 85 + 'px';
            var addtionfastBtnList = [];
            var fastBtnBorderLand = document.getElementById('fastButton').offsetLeft + document.getElementById('fastButton').offsetWidth;
            document.getElementById('fastButton').childNodes.forEach(function (value) {
                if (value.offsetLeft + value.offsetWidth > fastBtnBorderLand) {
                    document.getElementById('pullDown').style.display = 'inline-block';
                    addtionfastBtnList.push({
                        id: value.id,
                        name: value.innerText
                    });
                    value.style.display = 'none';
                }
            });
            var addtionHtml = '';
            addtionfastBtnList.forEach(function (value) {
                addtionHtml += '<span onclick="mainJumpCode(this.id)" id="' + value.id + '" class="fast_btn_span" style="display: inline-block;line-height: 25px;height: 25px;padding: 5px 25px;width: 150px;">' + value.name + '</span>';
            });
            if (isDataChanged) {
                document.getElementById('addtionBtn').innerHTML = addtionHtml;
            } else {
                document.getElementById('addtionBtn').innerHTML += addtionHtml;
            }
        }

        (function () {
            Leaf.request({
                url:"${/request/@context_path}/autocrud/sys.sys_user/query",
                para: {},
                scope: this,
                success:function (res) {
                    if (res.success) {
                        var userName = '';
                        res.result.record.forEach(function (value) {
                            if (value.user_id == ${/session/@user_id}){
                                userName = value.user_name;
                            }
                        });
                        document.getElementById('userName').innerHTML = userName;
                    }
                }
            })
        })();
        function userDsHandler() {
            var userDs = $('userDs').getAll();
            var userName;
            userDs.forEach(function (value) {
                value.data.userId == ${/session/@user_id} ? userName = value.data.user_name : userName = '';
            });

        }
        // var userDetailFlag = true;
        function showUserMsg() {
            window.clearTimeout(timeOut);
            document.getElementById('userDetail').style.display = 'block';
            document.getElementById('userDetail').style.height = '240px';
            document.getElementById('userDetail').style.width = '203px';
            document.getElementById('userDetail').style.background = 'white';
            document.getElementById('userDetail').style.marginRight = '26px';

        }

        var timeOut;
        function hideUserMsg() {
            timeOut = setTimeout(hideUserDetail,100);
        }

        function hideUserDetail() {
            document.getElementById('userDetail').style.display = 'none';
        }

        function borderInput(dom) {
            isSearchFocus = true;
            document.getElementById('search_box').style.border = '';
            document.getElementById('search_box').style.background = '';

        }

        function disBorderInput(dom) {
            isSearchFocus = false;
           /* document.getElementById('search_box').style.border = '';
            document.getElementById('search_box').style.background = '';*/
            disExtend();
        }

        var borderLandTimeOut;
        var focusItem;
        function borderShowUp(dom) {
            focusItem = dom;

            window.clearTimeout(borderLandTimeOut);
            window.clearTimeout(borderHideTimer);


            borderLandTimeOut = setTimeout(function () {
                $jq('#borderLand').show();
                if (focusItem === dom) {
                    Ext.get('borderLand').shift({
                        width: dom.offsetWidth, //元素的新宽度
                        height: 4, //元素的新高度
                        x: dom.offsetLeft, //元素的新 x 坐标
                        // y: 10 , //元素的新 y 坐标
                        easing: 'easeOut',
                        duration: .3
                    });
                } else {
                    Ext.get('borderLand').stopFx();
                }
            }.bind(this),200);
        }

        var borderHideTimer;
        function boderHide(dom) {
            document.querySelectorAll('.fast_btn_span').forEach(function (value) {
                value.style.color = '#fff';
                value.style.borderBottom = '';
            });

            borderHideTimer = setTimeout(function () {
                document.getElementById('borderLand').style.width = 0;
                document.getElementById('borderLand').style.left = 0;
            },500);

        }

        var isSearchFocus = false;

        function extendInput() {
            if (!isSearchFocus) {
                Ext.get('sp-searchtext').stopFx();
                Ext.get('sp-searchtext').shift({
                    width: 300, //元素的新宽度
                    easing: 'easeOut',
                    duration: .5
                })
            }
        }

        function disExtend(){
            if (!isSearchFocus) {
                Ext.get('sp-searchtext').stopFx();
                Ext.get('sp-searchtext').shift({
                    width: 200,
                    easing: 'easeOut',
                    duration: .5
                })
            }
        }


        function showFastBtnConfig() {
            new Leaf.Window({
                id: 'fast_btn_config_id',
                url: $('fast_btn_config').getUrl(),
                title: '快速导航配置',
                width: 420,
                height: Leaf.getViewportHeight()
            });
        }


        function myProfile() {
            document.getElementById('mainFrame').src = $('my_profile_config').getUrl();
        }

        var adttionTimeOut;
        function showAddtion() {
            window.clearTimeout(adttionTimeOut);
            document.getElementById('addtionBtn').style.display = 'inline-block';
        }

        function hideAddtion() {
            adttionTimeOut = window.setTimeout(function () {
                document.getElementById('addtionBtn').style.display = 'none';
            },500);
        }
        //点击右边图标
        var hideNoticeFirst;
        var hideNoticeSecond;
        function showHidden(dom){
            dom.classList.remove('notice_menu_clear');
            if (hideNoticeFirst && hideNoticeSecond) {
                // window.clearTimeout(hideTimerFirst);
                window.clearTimeout(hideTimerSecond);
            }

            window.clearTimeout(mainMenuTimeOut);
            if ($jq("#user-workflow").css("display") === 'none') {
                document.getElementById('user-workflow').style.display = 'block';
//                document.getElementById('user-workflow').classList.add('main_menu_show_up');
//                setTimeout(function () {
//                    document.getElementById('user-workflow').classList.remove('main_menu_show_up');
//                }, 500);
            }
        }
        function hiddenInfo(dom) {

            dom.style.background = '';
            mainMenuTimeOut = setTimeout(function () {
                document.getElementById('user-workflow').style.display = 'none';
            },1000);
        }
        //用户信息
        function userInfo(){

            document.getElementById('searchFunction').style.display = 'none';
            document.getElementById('sp-searchtext').style.width = '0px';
            showUserMsg();
            initThemeImage();
            $jq("#notice_menu").hide();
        }



        function exit(){
            document.getElementById('exit-modal').style.display = 'block';
            var h = document.documentElement.clientHeight || document.body.clientHeight;
            var w = document.documentElement.clientWidth || document.body.clientWidth;
            document.getElementById('cover').style.display = 'block';
            document.getElementById('cover').style.height = h+'px';
            document.getElementById('exit-modal').style.top = (h-97)/2+'px';
            document.getElementById('exit-modal').style.left = (w-281)/2+'px';
            //$jq('.notice_menu_search_content').css.display='block'
        }
        function exit_cancel(){
            //
            document.getElementById('cover').style.display = 'none';
            document.getElementById('exit-modal').style.display = 'none';
        }
        function exit_confirm(){
            //
            document.getElementById('cover').style.display = 'none';
            document.getElementById('exit-modal').style.display = 'none';
            Leaf.request({
                url: 'logout.lsc',
                para: {},
                success: function() {
                    try {
                        if (window.opener) {
                            opener.location.href = 'login';
                            window.close();
                        } else {
                            location.href = 'login';
                        }
                    } catch (e) {
                        window.close();
                    }
                },
                scope: this
            });
        }

        $jq("body").keydown(function(){
            //
            if(document.getElementById('exit-modal').style.display == 'block'){
                if(event.keyCode == 13)
                {
                    exit_confirm()
                }
            }

        });

        function initThemeImage(){
            var theme='${/session/@theme}';
            if(theme=='hap-leaf'){
                document.getElementById('show-theme-black').style.display='none'
            }else if(theme=='hap-leaf-ice-pink'){
                document.getElementById('show-theme-ice-pink').style.display='none'
            }else if(theme=='hap-leaf-amber-yellow'){
                document.getElementById('show-theme-amber-yellow').style.display='none'
            }else if(theme=='hap-leaf-brook-green'){
                document.getElementById('show-theme-brook-green').style.display='none'
            }else if(theme=='hap-leaf-lushan-blue'){
                document.getElementById('show-theme-lushan-blue').style.display='none'
            }else if(theme=='hap-leaf-lychee-green'){
                document.getElementById('show-theme-lychee-green').style.display='none'
            }
        }
        function preview_them_image(dom){

            document.getElementById("preview-image").style.display='block'
            document.getElementById("preview-image").src=dom
        }
        function hidden_theme_image(){
            document.getElementById("preview-image").style.display='none'
        }

        //切换主题皮肤
        function theme_select_ds_query(ds,para) {
            para['user_id'] = '${/session/@user_id}';
        }
        function saveD(theme){
            Leaf.setTheme(theme);
            //alert(theme)
           //

            if($("theme_select_ds").getAll().length == 0){
                $("theme_select_ds").create({
                    "user_id":'${/session/@user_id}',
                    "theme":theme
                });
            }else if($("theme_select_ds").getAll().length == 1){
                $("theme_select_ds").getAt(0).set("theme",theme);
            }

            $("theme_select_ds").submit();
        }

        function showSubject() {

            var url = $('subject_select_link').getUrl();
            new Leaf.Window({
                id: 'subject_window',
                url: url,
                title: '切换主题',
                params:{
                    subject:"${/session/@subject}"
                },
                height: 400,
                width: 857
            });
        }

        ]]></script>


        <div class="hap-main-screen-toolbar-contain">
            <div id="page-topbar" style="position: fixed;Z-INDEX: 1000;width: 100%;height:50px;background-image: url(${/request/@context_path}/lib/assets/layouts/layout4/img/background-img@2x.png);    background-size: 100% 130%;
                                                                                                                                                                                                                               background-repeat: no-repeat;">
                <div class="topbar topbar-logo">
                    <div class="page-topbar-menu-logo menu_hieght" onmouseover="lightButton(this)" onmouseleave="disableLight(this)">
                        <img style="width:16px;height:14px;margin-top:26px;margin-left:24px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/allFunc@2x.png" onclick="goToHomePage()"/>
                    </div>
                    <!--<div id="show-module-list-btn" style="float:left" onclick="showModuleList()">
                         <img style="width:16px;height:14px;margin-top:26px;margin-left:24px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/allFunc@2x.png" onclick="goToHomePage()"/>
                    </div>-->
                    <div style="margin:0 auto;width:90px;height:29px;">
                        <img style="width:100%;margin-top:14px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/easy-rent@2x.png"/>
                        <!--<span class="menu_line_height">融租易</span>-->
                    </div>
                    <!--<div class="menu-toggler sidebar-toggler-top" style="margin-left: 23px;margin-top: 18px;position: absolute;display: none"></div>-->
                    <!--<div id="user-workflow" >-->
                        <!--<div class="middle-line"></div>-->
                        <!--<div onmouseover="clickWorkflow()" id="click-workflow" class="page-topbar-fast-menu menu_hieght" >-->
                            <!--<img style=" width:19px;height:16px;padding-left:16px;margin-top: 3px;"  src="${/request/@context_path}/lib/assets/layouts/layout4/img/bell@2x.png" />-->
                            <!--<div id="notice_menu" class="notice_menu">-->
                                <!--<div class="notice_menu_header">-->
                                    <!--<div class="notice_menu_body">-->
                                        <!--<div style="position: absolute;left:125px;width: 1px;height: 10px;margin-top: 17px;background: #ccc;"></div>-->
                                        <!--<div class="notice_menu_body_left notice_menu_body_common notice_menu_header_line_height"><span>待办</span><span id="todo_message_num"></span></div>-->
                                        <!--<div class="notice_menu_body_right notice_menu_body_common notice_menu_header_line_height"><span>通知</span><span id="notice_message_num"></span></div>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="notice_menu_search">-->
                                    <!--<div class="notice_menu_search_content">-->
                                        <!--<div style="position: absolute;left:60px;width: 1px;height: 14px;margin-top: 4px;background: #ccc;"></div>-->
                                        <!--<img class="notice_menu_search_img" src="${/request/@context_path}/lib/assets/layouts/layout4/img/search@2x.png"/>-->
                                        <!--<input class="notice_menu_search_input"/>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="notice_menu-img" style="background: white"><img style="width: 28px;  margin-left: 19px; margin-top: 10px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/to-do@2x.png"/></div>-->
                                <!--<div class="notice_menu_body_class">-->
                                    <!--<div class="notice_menu_contain" id="system_todo"></div>-->
                                    <!--<div class="todo_menu_foot">-->
                                        <!--<div style="position: absolute;left:125px;    opacity: 0.5;width: 1px;height: 14px;margin-top: 13px;   background: white;"></div>-->
                                        <!--<div class="todo_menu_foot_common" onclick="mainJumpCode('ZJWFL5110',true)">更多</div>-->
                                        <!--<div class="todo_menu_foot_common"  onclick="mainJumpCode('ZJWFL3040',true)">历史流程</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="notice_menu_body_class">-->
                                    <!--<div class="notice_menu_contain" id="system_notice"></div>-->
                                    <!--<div class="notice_menu_foot" onclick="mainJumpCode('ZJWFL5110',true)">-->
                                        <!--更多-->
                                    <!--</div>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<div id="user-info" onmouseover="userInfo()">-->
                            <!--<img src="${/request/@context_path}/lib/assets/layouts/layout4/img/user@2x.png"/>-->
                        <!--</div>-->
                    <!--</div>-->
                    <img id="preview-image" src=""/>
                    <div onclick="exit_cancel()"  id="cover"></div>
                    <div id="exit-modal"  style="z-Index: 1000; background: white;    height: 115px; width: 281px; position:absolute;border-radius: 5px;border: 1px solid #657efe;;display: none">
                        <div style="    margin-left: 263px; margin-top: 9px;"><img onclick="exit_cancel()" style="width: 10px;;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/exit@2x.png"/></div>
                        <div style="height: 38px;">
                            <div style="float:left;margin-left: 19px"><img style="width: 21px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/tip@2x.png"/></div>
                            <div style="    float: left;margin-left: 8px;">
                                <div style="margin-bottom: 8px;font-weight: normal;font-family: NotoSansHans-Bold; color: #657efe;">This is a tip!</div>
                                <div>确定退出登录吗?</div>
                            </div>
                        </div>
                        <div style="float:left;margin-top: 20px;margin-left: 151px">
                            <div style="float:left;margin-right: 15px;"><img onclick="exit_cancel()" style="width: 50px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/exit-cancel@2x.png"/></div>
                            <div style="float:left;"><img onclick="exit_confirm()" style="width: 50px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/exit-confirm@2x.png"/></div>
                        </div>
                    </div>

                    <div style="width:17px;height:14px;float: right;margin-top:-10px;margin-right:26px" onmouseover="showHidden(this)" onmouseleave="hiddenInfo(this)" >
                        <img alt="" style="border-radius:0px !important;width:17px;height:14px;" class="img-circle" src="${/request/@context_path}/lib/assets/layouts/layout4/img/userInfo@2x.png"/>
                        <div id="user-workflow" >
                            <div class="middle-line"></div>
                            <div class="middle-line1"></div>
                            <div id="search-function" onmouseover="showSearch(this)">
                                <img onclick="doSearch()" style=" width:16px;margin-left:16px;margin-top: 2px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/search-function@2x.png"/>
                                <div  style="    position: absolute;right: 52px; top: 0px;display: none"  id="searchFunction" >
                                    <input style="width: 0px;height: 17px" name="function_code" placeholder="功能代码或功能名称" id="sp-searchtext" accessKey="s" autocomplete="off"
                                           type="text"/>
                                </div>
                            </div>
                            <div onmouseover="clickWorkflow(this)" id="click-workflow" style="margin-top: -60px;"  class="dropdown-menu dropdown-menu-default">
                                <img style=" width:19px;height:16px;padding-left:16px;margin-top: 3px;"  src="${/request/@context_path}/lib/assets/layouts/layout4/img/bell@2x.png" />
                                <div id="notice_menu" class="notice_menu">
                                    <div class="notice_menu_header">
                                        <div class="notice_menu_body">
                                            <div style="width: 1px;height:10px;position:absolute;background: #ccc;    left: 125px;top: 12px;"></div>
                                            <div class="notice_menu_body_left notice_menu_body_common notice_menu_header_line_height"><span>待办</span><span id="todo_message_num"></span></div>
                                            <div class="notice_menu_body_right notice_menu_body_common notice_menu_header_line_height"><span>通知</span><span id="notice_message_num"></span></div>
                                        </div>
                                    </div>
                                    <div class="workflow_menu_img" ><img style="width: 28px;margin-left: 19px;margin-top:10px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/to-do@2x.png"/></div>
                                    <div class="notice_menu_img"><img style="width: 28px;margin-left: 19px;margin-top:10px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/notice@2x.png"/></div>
                                    <div class="notice_menu_search">
                                        <div class="notice_menu_search_content">
                                            <div style="width: 1px;height:8px;position: absolute;background: #ccc;left:50px;margin-top: 8px;"></div>
                                            <img id="notice-search-img" onclick="doSearchMessage()" class="notice_menu_workflow_img" src="${/request/@context_path}/lib/assets/layouts/layout4/img/search@2x.png"/>
                                            <input id="notice_search_input" class="notice_menu_search_input"/>
                                            <img id="workflow-search-img" onclick="doSearchWorkflow()" class="notice_menu_workflow_img" src="${/request/@context_path}/lib/assets/layouts/layout4/img/search@2x.png"/>
                                            <input id="todo_search_input" class="notice_menu_search_input"/>
                                        </div>

                                    </div>
                                    <div class="notice_menu_body_class">
                                        <div class="notice_menu_contain" id="system_todo"></div>
                                        <div class="todo_menu_foot">
                                            <div style="position: absolute;left:125px;width: 1px;height: 8px;background: white;margin-top:16px"></div>
                                            <div class="todo_menu_foot_common" onclick="mainJumpCode('ZJWFL5110',true)">更多</div>
                                            <div class="todo_menu_foot_common"  onclick="mainJumpCode('ZJWFL3040',true)">历史流程</div>
                                        </div>
                                    </div>
                                    <div class="notice_menu_body_class">
                                        <div class="notice_menu_contain" id="system_notice"></div>
                                        <div class="notice_menu_foot" onclick="mainJumpCode('ZJWFL5110',true)">
                                            更多
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div id="user-info" onmouseover="userInfo(this)">
                                <img src="${/request/@context_path}/lib/assets/layouts/layout4/img/user@2x.png"/>
                                <div class="dropdown-menu dropdown-menu-default"  id="userDetail" >
                                    <div style="margin:16px 0px 0px 57px">
                                        <img onclick="showSubject()" style="width:88px;height:74px;padding-left: 0px;margin-top: 0px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/change-theme@2x.png"/>
                                    </div>
                                    <div style="letter-spacing: 2px;color: #333333;margin-top:6px;text-align:center;font-size:12px;font-family: NotoSansHans-Thin;" id="userName"></div>
                                    <div style="margin:11px 0px 5px 0px;height:20px;font-size:12px;color: #333333;font-family:NotoSansHans-Medium;">
                                        <div style="float:left;margin-left:35px;font-weight: 500;">Theme</div>
                                        <div style="float:left;height:8px;width:1px;background:#ccc;margin-top: 3px;    position: absolute;left: 101px;"></div>
                                        <div onclick="updatePassword()" style="float:left;display:block;margin-left:18px;color: #cccccc;position: absolute;right:30px;    cursor: pointer;">Setting</div>
                                    </div>
                                    <div style="margin-left:23px;height:28px">
                                        <div onclick="saveD(&apos;hap-leaf-ice-pink&apos;)" onmouseleave="hidden_theme_image()" onmouseover="preview_them_image(&apos;${/request/@context_path}/lib/assets/layouts/layout4/img/theme-ice-pink@2x.png&apos;)" id="show-theme-ice-pink" style="background-color: #4a413c;width:28px;height:28px;float:left;margin-right:6px;padding-left: 0px;margin-top: 0px"></div>
                                        <div onclick="saveD(&apos;hap-leaf-lushan-blue&apos;)" onmouseleave="hidden_theme_image()" onmouseover="preview_them_image(&apos;${/request/@context_path}/lib/assets/layouts/layout4/img/theme-lushan-blue@2x.png&apos;)" id="show-theme-lushan-blue" style="	background-color: #5774a0;width:28px;height:28px;float:left;margin-right:6px;padding-left: 0px;margin-top: 0px"></div>
                                        <div onclick="saveD(&apos;hap-leaf-amber-yellow&apos;)" onmouseleave="hidden_theme_image()" onmouseover="preview_them_image(&apos;${/request/@context_path}/lib/assets/layouts/layout4/img/theme-amber-yellow@2x.png&apos;)" id="show-theme-amber-yellow" style="background-color: #f5c173;padding-left: 0px;margin-top: 0px;width:28px;height:28px;float:left;margin-right:6px;"></div>
                                        <div onclick="saveD(&apos;hap-leaf-lychee-green&apos;)" onmouseleave="hidden_theme_image()" onmouseover="preview_them_image(&apos;${/request/@context_path}/lib/assets/layouts/layout4/img/theme-lychee-green@2x.png&apos;)" id="show-theme-lychee-green" style="background-color: #6e8e7d;padding-left: 0px;margin-top: 0px;width:28px;height:28px;float:left;margin-right:6px;"></div>
                                        <div onclick="saveD(&apos;hap-leaf-brook-green&apos;)" onmouseleave="hidden_theme_image()" onmouseover="preview_them_image(&apos;${/request/@context_path}/lib/assets/layouts/layout4/img/theme-brook-green@2x.png&apos;)" id="show-theme-brook-green" style="background-color: #87ccd3;padding-left: 0px;margin-top: 0px;width:28px;height:28px;float:left;margin-right:6px;"></div>
                                        <div onclick="saveD(&apos;hap-leaf&apos;)" onmouseleave="hidden_theme_image()" onmouseover="preview_them_image(&apos;${/request/@context_path}/lib/assets/layouts/layout4/img/theme-gray@2x.png&apos;)" id="show-theme-black" style="background-color: #333333;opacity: 0.95;padding-left: 0px;margin-top: 0px;width:28px;height:28px;float:left;"></div>
                                    </div>
                                    <img onclick="exit();" style="position:absolute;right:20px;width:15px;height:15px;margin-top:30px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/quit@2x.png"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div style="height: 0px;" class="page-topbar-fast-menu menu_hieght" id="system_notice_button">
                        <img style="display: none" class="menu-right-img" src="${/request/@context_path}/leafresource/images/MAIN/message_menu.png"/>
                        <!--<div id="notice_menu" class="notice_menu">-->
                            <!--<div class="notice_menu_header">-->
                                <!--<div class="notice_menu_body">-->
                                    <!--<div class="notice_menu_body_left notice_menu_body_common notice_menu_header_line_height"><span>待办</span><span id="todo_message_num"></span></div>-->
                                    <!--<div class="notice_menu_body_right notice_menu_body_common notice_menu_header_line_height"><span>通知</span><span id="notice_message_num"></span></div>-->
                                <!--</div>-->
                            <!--</div>-->
                            <!--<div class="notice_menu_search">-->
                                <!--<div class="notice_menu_search_content">-->
                                    <!--<img class="notice_menu_workflow_img" src="${/request/@context_path}/leafresource/images/MAIN/hls-todo-search.png"/>-->
                                    <!--<input class="notice_menu_search_input"/>-->
                                <!--</div>-->
                            <!--</div>-->
                            <!--<div class="notice_menu_body_class">-->
                            <!--<div class="notice_menu_contain" id="system_todo"></div>-->
                                <!--<div class="todo_menu_foot">-->
                                    <!--<div class="todo_menu_foot_common" onclick="mainJumpCode('ZJWFL5110',true)">更多</div>-->
                                    <!--<div class="todo_menu_foot_common"  onclick="mainJumpCode('ZJWFL3040',true)">历史流程</div>-->
                                <!--</div>-->
                            <!--</div>-->
                            <!--<div class="notice_menu_body_class">-->
                            <!--<div class="notice_menu_contain" id="system_notice"></div>-->
                                <!--<div class="notice_menu_foot" onclick="mainJumpCode('ZJWFL5110',true)">-->
                                    <!--更多-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->
                    </div>


                    <div id="fastButton" class="fast_toolbar"></div>
                    <div style="display:none;" class="page-topbar-fast-menu menu_hieght" id="fast-menu-toolbar">
                        <img class="menu-right-img" src="${/request/@context_path}/leafresource/images/MAIN/fast_menu.png"/>
                    </div>

                   <!-- <li style="display: inline-block;float: right;">
                        <div class="search">
                            <div id="search_box" class="searchbox" onmouseover="extendInput()" onmouseleave="disExtend()">
                                <input name="function_code" placeholder="功能代码或功能名称" id="sp-searchtext" accessKey="s" autocomplete="off" onfocus="borderInput(this)" onblur="disBorderInput(this)"
                                       type="text"/>
                                <img class="aliyun-common-search-icon" src="${/request/@context_path}/leafresource/images/MAIN/search-icon.png" onclick="doSearch()"></img>
                            </div>
                        </div>
                    </li>-->

                    <div class="clearfix"/>
                    </div>
                <div class="function_tool_bar">

                    <div id="bread" class="function_home_height function_home_line_height function_float_left">
                        <div class="function_home_title_img function_home_height">
                            <img onclick="mainJumpUrl('leaf_user_role_home_page.lview','用户角色首页','ZJWFL1060')" src="${/request/@context_path}/leafresource/images/MAIN/function_home_page.png"/>
                        </div>
                        <div class="function_toolbar function_home_height">
                            <img id="main_back" class="main-bread-img" src="${/request/@context_path}/leafresource/images/MAIN/function_left.png" width="20" height="20"/>
                            <img id="main_forward" class="main-bread-img" src="${/request/@context_path}/leafresource/images/MAIN/function_right.png" width="20" height="20"/>
                            <img class="main-bread-img" src="${/request/@context_path}/leafresource/images/MAIN/function_reflash.png" width="20" height="20" onclick="refreshFrame()"/>
                        </div>

                        <span class="function_descript function_home_height function_home_line_height">
                        <span style="height: 60px;margin-left: 15px;display: inline-block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"/>
                    </span>
                    </div>
                    <div class="function_history_content_pre function_history_content_button" id="function_history_content_pre"></div>
                    <div id="function_history_content" class="function_home_height function_home_line_height function_float_left">
                        <div id="function_history_content_x" class="function_home_height function_home_line_height"></div>
                    </div>
                    <div class="function_history_content_next function_history_content_button" id="function_history_content_next"></div>
                </div>
                <div class="topbar topbar-user-role">

                </div>
            </div>

            <!--<div class="dropdown-menu dropdown-menu-default" style="box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);-moz-box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);-webkit-box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.15);border-radius:5px !important" id="userDetail" >-->
                <!--<div style="margin:16px 0px 0px 57px">-->
                    <!--<img style="width:88px;height:74px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/change-avatar@2x.png"/>-->
                <!--</div>-->
                <!--<div style="letter-spacing: 2px;color: #333333;margin-top:6px;text-align:center;font-size:12px;font-family: NotoSansHans-Thin;">管理员</div>-->
                <!--<div style="margin:11px 0px 5px 0px;height:20px;font-size:12px;">-->
                    <!--<div style="float:left;margin-left:35px;font-family: NotoSansHans-Thin;color: #000000;font-weight: 500;">Theme</div>-->
                    <!--<div style="float:left;height:8px;width:1px;background:#ccc;margin-top: 3px;    position: absolute;left: 101px;"></div>-->
                    <!--<div onclick="updatePassword()" style="float:left;display:block;margin-left:18px;font-family: NotoSansHans-Thin;color: #cccccc;position: absolute;right:30px">Setting</div>-->
                <!--</div>-->
                <!--<div style="margin-left:23px;height:28px">-->
                    <!--<img style="width:28px;height:28px;float:left;margin-right:6px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/page-color1@2x.png"/>-->
                    <!--<img style="width:28px;height:28px;float:left;margin-right:6px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/page-color2@2x.png"/>-->
                    <!--<img style="width:28px;height:28px;float:left;margin-right:6px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/page-color3@2x.png"/>-->
                    <!--<img style="width:28px;height:28px;float:left;margin-right:6px;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/page-color4@2x.png"/>-->
                    <!--<img style="width:28px;height:28px;float:left;" src="${/request/@context_path}/lib/assets/layouts/layout4/img/page-color4@2x.png"/>-->
                <!--</div>-->
                <!--<img onclick="javascript:exitSystem();" style="position:absolute;right:20px;width:15px;height:15px;margin-top:30px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/quit@2x.png"/>-->
            <!--</div>-->


            <div id="history" class="history_class" onmouseover="showPageHistory()" onmouseleave="hidePageHistory()"></div>
            <div id="fast-link" style="display: none;position: fixed;z-index: 1000;width: 100%;top: 40px;">
                <div class="fast-link-contain" style="height:50px;line-height: 50px;">
                <span id="allBar" class="topbar-light" onmouseover="lightButton(this)" onmouseleave="disableLight(this)">
                    <div style="display: inline-block;position: absolute;top: 18px;">
                        <span class="sidebar-toggler"></span>
                    </div>
                    <span style="margin-left: 28px;">全部导航</span>
                </span>

                    <div id="addtionBtn"  class="hap-main-addtinBtn" onmouseover="showAddtion()" onmouseleave="hideAddtion()" style="display: none;position: fixed;top: 98px;width: 200px;padding: 4px 0;right: 0"></div>
                    <span id="pullDown" style="display: none;height: 40px;float: left;padding: 14px 20px 0 0;cursor: pointer;" onmouseover="showAddtion()" onmouseleave="hideAddtion()">
                    <img src="${/request/@context_path}/images/home_page/pull-down.png" width="20" height="20"></img>
                </span>
                </div>

            </div>
        </div>
        <div id="borderLand" style="position: fixed;height: 0px;background: #00C1DE;z-index: 1001;top: 102px;"></div>
        <a:dataSets>
                <a:dataSet id="theme_select_ds" autoQuery="true" model="sys.sys_user_theme">
                    <a:events>
                        <a:event name="query" handler="theme_select_ds_query"/>
                    </a:events>
                </a:dataSet>
            <a:dataSet id="sys_notice_msg_result_main_ds" loadData="true" fetchAll="true" model="sys.SYS100.sys_notice_msg">
            </a:dataSet>
            <a:dataSet id="main_toDoDs" loadData="true" fetchAll="true" model="zjwfl.ZJWFL5110.sdic_wfl_instance_node_recipient">
            </a:dataSet>
            <a:dataSet id="to_do_list_count_ds" model="zjwfl.ZJWFL5110.zj_wfl_to_do_max_date">
                <a:fields>
                    <a:field name="max_date"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="to_do_load"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="sys_role_ds" autoQuery="true" model="sys.sys_role_vl">
                <a:fields>
                    <a:field name="role_id"/>
                    <a:field name="role_code"/>
                    <a:field name="role_name"/>
                    <a:field name="description"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="to_get_code"/>
                </a:events>
            </a:dataSet>
            <!--todo 参数 rolecode-->
            <a:dataSet id="sys_role_function_query_ds">
                <a:datas dataSource="/model/fast_button_record">
                </a:datas>
            </a:dataSet>

            <a:dataSet id="userDs" autoQuery="true" model="sys.SYS8210.login_account_query" pageSize="100">
                <a:events>
                    <a:event name="load" handler="userDsHandler"/>
                </a:events>
            </a:dataSet>

        </a:dataSets>

        <div id="main_menu_id" style="opacity: 0.95;" class="main_menu_back_contain" onmouseleave="hideThis(this)" onmouseover="showThis(this)">
            <table id="main" border="0" cellPadding="0" cellSpacing="0" style="width:100%;height:100%;">
                <tbody>
                <tr>
                    <td>
                        <ul id="solidblockmenu" class="solidblockmenu">

                            <a:freeMarker><![CDATA[
                                <#if model.getObject("/model/main_menu_list").getChilds()??>
                                <#list model.getObject("/model/main_menu_list").getChilds() as item>
                                <#if item_index == 0>
                                <li id="M_MENU_${item.getString('function_code')}" class="first">
                                    <#else>
                                <li id="M_MENU_${item.getString('function_code')}" >
                                </#if>

                                <#if item.getString('parent_menu_id')??>
                                <a hidefocus="true" href="#" >${(item.getString('function_name')!"")?html}</a>
                                <#else>
                                <a hidefocus="true" onmouseover="javascript:mainSetTargeturl('${item.getString('function_code')}');" onmouseleave="hideTargetUrl('${item.getString('function_code')}')" href="javascript:goToModuleWidge('${item.getString('module_flag')}','${item.getString('function_id')}','${item.getString('function_code')}','${item.getString('function_name')}')">
                                    <span>${(item.getString('function_name')!"")?html}</span>
                                    <span style="display: inline-block;float: right;">&gt;</span>
                                </a>

                            </#if>

                            </li>
                        </#list>
                    </#if>
                    ]]></a:freeMarker>

                    <div class="middle"/>

                    </ul>
                    </td>
                </tr>
                <tr style="position: absolute;">
                    <td id="subMenu" class="subMenu">
                        <div style="position:relative">
                            <a:freeMarker><![CDATA[
                                <#if model.getObject("/model/main_menu_list").getChilds()??>
                                <#list model.getObject("/model/main_menu_list").getChilds() as main_menu>
                                <div class="menu" id="SUBMENU_${main_menu.getString('function_code')}" onmouseover="cleanKeepMainMenu(this)">

                                    <#if model.getObject("/model/sub_menu_list").getChilds()??>
                                    <#list model.getObject("/model/sub_menu_list").getChilds() as sm>
                                    <#if sm.getString('parent_menu_id') == main_menu.getString('menu_id')>
                                    <div style="float:left;margin-left: 5px">
                                        <div class="head_c" onmouseover="showSubChildMenu(this)" onclick="goToModuleWidge('${sm.getString('module_flag')}','${sm.getString('function_id')}','${sm.getString('function_code')}','${sm.getString('function_name')}')">
                                            <span>${(sm.getString('function_name')!"")?html}</span>
                                            <span style="float: right;">&gt;</span>

                                            <div class="childMenu" childMenu="Y" onmouseover="cleanKeepSubMenu()">
                                            <#if (sm.getString('sub_menu_count')?number gt 19)>
                                            <ul style="width:200px;height:auto;">
                                                <#else>
                                                <ul style="height:180px;width: 200px;margin: 0;">
                                                </#if>
                                                <#if model.getObject("/model/menu_function_list").getChilds()??>
                                                <#list model.getObject("/model/menu_function_list").getChilds() as function>
                                                <#if function.getString('parent_menu_id') == sm.getString('menu_id') >
                                                <li style="margin: 0 0 0 5px;padding: 0">
                                                    <a style="min-width: 160px;width:160px;padding: 6px 20px;height: 24px;line-height: 24px;display: inline-block;" onmouseout="javascript:hide_tool_tip(this);" onmouseover="javascript:show_tool_tip(this,'${(function.getString('function_code')!"")?html}');" hidefocus="true"  href="javascript:mainJumpCode('${function.getString('function_code')}',true)" >${(function.getString('function_name')!"")?html}</a>
                                                </li>
                                            </#if>
                                        </#list>
                                        </ul>
                                    </#if>
                                </div>
                                        </div>
                        </div>
                    </#if>
                </#list>
                </#if>

                <#if main_menu.getString('function_code')=='SYS_OPERATION'>
                <ul style="min-width: 200px">
                    <li class="head">操作</li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:goToHomePage();">首页</a></li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:mainScreen_doOperation('setHomePage');">设为首页</a></li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:updatePassword();">修改密码</a></li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:showSessionMessage();">查看SESSION</a></li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:exitSystem();">退出系统</a></li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:showTheme();">皮肤选择</a></li>
                    <li><a hidefocus="true" href="javascript:void(0);" onclick="javascript:showSubject();">切换主题</a></li>
                </ul>
                <ul>
                    <li class="head">最近访问</li>
                    <#if model.getObject("/model/last_visits_list").getChilds()??>
                    <#list model.getObject("/model/last_visits_list").getChilds() as par>
                    <li><a href="javascript:mainJumpCode('${par.getString('function_code')}')">${(par.getString('function_name')!"")?html}</a></li>
                </#list>
            </#if>
            </ul>
            <ul>
                <li class="head">最多访问</li>
                <#if model.getObject("/model/most_visits_list").getChilds()??>
                <#list model.getObject("/model/most_visits_list").getChilds() as pam>
                <li><a href="javascript:mainJumpCode('${pam.getString('function_code')}')">${(pam.getString('function_name')!"")?html}</a></li>
            </#list>
        </#if>
        </ul>
    </#if>

    </div>
</#list>
</#if>
]]></a:freeMarker>
</div>
</td>
</tr>


</tbody>
</table>
</div>
<a:switch test="/parameter/@global_tab_flag">
    <a:case value="Y">
        <a:tabPanel id="mainTab" marginHeight="0" marginWidth="0" style="margin-top:50px;"/>
    </a:case>
    <a:case value="*">
        <iframe name="mainIFrame" id="mainFrame" border="0" frameborder="0" height="100%" style="border:none;padding:0px;margin-top: 50px;" width="100%"><![CDATA[ ]]></iframe>
    </a:case>
</a:switch>
<script language="javascript"><![CDATA[

//设置背景图片
if('${/session/@theme}' != 'hap-leaf') {
    jQuery("#page-topbar").css("background-image", "url('${/request/@context_path}/images/${/session/@theme}/toolBar.png')");
}
//模块首页
function goToModuleWidge(module_flag,function_group_id,function_code, function_name){
    if(module_flag === 'role_module' || module_flag === 'module'){
        mainJumpUrl("user_module_home_page.lview?module_flag="+module_flag+";function_group_id="+function_group_id, function_code , function_name);
    }
}

goToHomePage();


//此处进行修改在确定系统超时的时候设置istimeout标记到cookie中

function showlogin() {
    Leaf.setCookie('ISTIMEOUT', true, 0.05);
    Leaf.showWarningMessage('提示','登陆已过期请重新登陆!',goLogin);
    /*new Leaf.Window({
        id: 'login_timeout',
        url: $('login_timeout_id').getUrl(),
        title: '系统已超时锁定,请解锁',
        height: 280,
        width: 400,
        draggable: false,
        closeable: false
    });*/
}

function goLogin(){
    top.location.href = '${/request/@context_path}/login';
}

Leaf.manager.on('timeout', function() {
    showlogin();
    return false;
});

var jsid = Leaf.getCookie('JSID');

window.scannJSID = {
    run: function() {
        var jid = Leaf.getCookie('JSID');
        if (jid != window.jsid) {
            Ext.TaskMgr.stop(window.scannJSID);
            var reloginWindow = new Leaf.Window({
                id: 'relogin_window',
                url: 'error_repeatlogin.lview',
                title: '${l:PROMPT}',
                closeable: false,
                draggable: false,
                height: 120,
                width: 350
            });
        }
    },
    interval: 1000
};
Ext.TaskMgr.start(window.scannJSID);

function initMainSize() {
    var tabFunctionHeight = 0;
    if (global_tab_flag == 'Y') {
        tabFunctionHeight = 38;
    }
    var topBarHeight = Ext.fly('page-topbar').getHeight();
    var fastBarHeight = Ext.fly('fast-link').getHeight();
    var screenWidth = Leaf.getViewportWidth();
    var screenHeight = Leaf.getViewportHeight();
    var bottomHeight = screenHeight - topBarHeight - tabFunctionHeight - fastBarHeight;
    // document.cookie = "vh="+(bottomHeight);
    // document.cookie = "vw="+ (screenWidth);
    $L.setCookie('vh', bottomHeight);
    $L.setCookie('vw', screenWidth);

    if (global_tab_flag == 'Y') {
        //自适应宽度
        var marginWidth = 2;
        var marginHeight = 0;
        $('mainTab').setWidth(screenWidth - marginWidth);
        $jq("#mainTab table").css("width",screenWidth - marginWidth);
        document.getElementById('mainTab').style.float = 'right';
        if($jq(".function_tool_bar").css("display") == "none"){
            $('mainTab').setMainHeight(screenHeight - firstBarHeight + marginTop);
            jQuery("#mainTab").css("margin-top", firstBarHeight - marginTop);
        }else{
            $('mainTab').setMainHeight(screenHeight - firstBarHeight - secondBarHeight + marginTop);
            jQuery("#mainTab").css("margin-top", firstBarHeight + secondBarHeight - marginTop);
        }

    } else {
        Ext.get('mainFrame').setHeight(bottomHeight);
    }
}

initMainSize();

Ext.lib.Event.on(window, "resize", function() {
    initMainSize();
   // makePullDown();
}, this);

Ext.onReady(function() {
    Ext.get('sp-searchtext').on('focus', function() {
       // Ext.get('search_box').addClass('s_active');
    }).on('blur', function() {
        //Ext.get('search_box').removeClass('s_active');
    }).on('keydown', function(e) {
        if (e.keyCode == 13) {
            doSearch();

        }
    });

});

//查询消息通知
function doSearchMessage() {
    var noticeMessage = document.getElementById('notice_search_input').value;
    /*if (noticeMessage == "") {
     return;
     }*/
    Leaf.request({
        url: $('bmLink_sys_notice_msg').getUrl(),
        scope: this,
        para: {
            notice_message: noticeMessage
        },
        success: function (res) {
            if (res.result.record) {
                var records = res.result.record;
                if (Array.isArray(records)) {
                    records = records
                } else {
                    records = [records]
                }
                $jq("#system_notice").empty();
                var html = "";
                var notice_msg_count = 0;
                $jq.each(records, function (index, value) {
                    if (value.expand_flag == 'N') {
                        notice_msg_count += 1;
                        var picSequence = (index + 1) % 3;
                        //var picUrl = "${/request/@context_path}/leafresource/images/MAIN/system_notice" + picSequence + "@2x.png";
                        var message = value.msg_title + '--' + value.msg_body;
                        var time = value.creation_date;
                        var date = new Date(value.creation_date);
                        var month_day=date.getMonth() + 1 + '月' + date.getDate()+'日';
                        var a = new Array("日", "一", "二", "三", "四", "五", "六");
                        var week = date.getDay();
                        var weekday = "星期"+ a[week];
                        var url = value.notice_url;
                        var instance_id = value.source_id;
                        html = html + '<div class="notice_menu_item notice_menu_item_height">';
//                        html = html + '<div class="notice_menu_item_img notice_menu_item_height">';
//                        html = html + '<img src="' + picUrl + '"/></div>';
                        html = html + '<div class="notice_menu_item_content notice_menu_item_height" onclick="winOpen_notice_url(\'' + url + '\',' + instance_id + ')">';
                        html = html + '<div class="notice_menu_item_content_msg" title="' + message + '">' + message + '</div>';
                        html = html + '<div class="notice_menu_item_content_time">' + month_day+weekday + '</div></div></div>';
                    }
                });
                $jq("#notice_message_num").html("(" + notice_msg_count + ")");
                $jq("#system_notice").html(html);
                var todo_num = Number($jq("#todo_message_num").html().replace("(", "").replace(")", ""));
//                if (Number(notice_msg_count + todo_num)) {
//                    $jq("#message_img").attr('src', "${/request/@context_path}/leafresource/images/MAIN/message_menu@2x.png")
//                } else {
//                    $jq("#message_img").attr('src', "${/request/@context_path}/leafresource/images/MAIN/message_menu_no@2x.png")
//                }
            }
        }
    })
}
//查询代办列表
function doSearchWorkflow() {
    var documentInfo = document.getElementById('todo_search_input').value;
    /*if (documentInfo == "") {
     return;
     }*/
    Leaf.request({
        url: $('bmLink_wfl_instance_node').getUrl(),
        scope: this,
        para: {
            any_info: documentInfo,
            workflow_info: documentInfo,
            document_info: documentInfo
        },
        success: function (res) {
            if (res.result.record) {
                var records = res.result.record;
                if (Array.isArray(records)) {
                    records = records
                } else {
                    records = [records]
                }
                $jq("#system_todo").empty();
                var todoHtml = "";
                var todo_num = 0;
                $jq.each(records, function (index, value) {
                    todo_num += 1;
                    var title = value.workflow_info;
                    var time = value.creation_date_format;
                    var date = new Date(value.creation_date_format);
                    var month_day=date.getMonth() + 1 + '月' + date.getDate()+'日';
                    var a = new Array("日", "一", "二", "三", "四", "五", "六");
                    var week = date.getDay();
                    var weekday = "星期"+ a[week];
                    var content = value.document_info;
                    var submit = value.submitted_by_name;
                    var instance_id = value.instance_id;
                    var node_id = value.node_id;
                    var record_id = value.record_id;
                    var workflow_id = value.workflow_id;
                    var record_type = value.record_type;
                    todoHtml = todoHtml + '<div class="notice_menu_item todo_menu_item_height">';
                    todoHtml = todoHtml + '<div class="todo_menu_item_content todo_menu_item_height" onclick="winOpen_zjwfl5110_wfl_approve(' + instance_id + ',' + node_id + ',' + record_id + ',' + workflow_id + ',\'' + record_type + '\')">';
                    todoHtml = todoHtml + '<div class="todo_title">';
                    todoHtml = todoHtml + '<span class="title" title="'+title+'">'+title+'</span>';

                    todoHtml = todoHtml + '</div>';
                    //todoHtml = todoHtml + '<div class="todo_msg" title="'+content+'">'+content+'</div>';
                    todoHtml = todoHtml + '<div class="todo_info" title="'+submit+'">'+'from'+' '+submit+'</div>';
                    todoHtml = todoHtml + '<div class="month_day" title="'+time+'">'+month_day+' '+weekday+'</div>';
                    //todoHtml = todoHtml + '<div class="weekday" title="'+time+'">'+weekday+'</div>';
                    todoHtml = todoHtml + '</div></div>';
                });
                $jq("#todo_message_num").html("(" + todo_num + ")");
                $jq("#system_todo").html(todoHtml);
                var notice_msg_count = Number($jq("#notice_message_num").html().replace("(", "").replace(")", ""));
                if (Number(notice_msg_count + todo_num)) {
                    $jq("#message_img").attr('src', "${/request/@context_path}/leafresource/images/MAIN/message_menu@2x.png")
                } else {
                    $jq("#message_img").attr('src', "${/request/@context_path}/leafresource/images/MAIN/message_menu_no@2x.png")
                }
            }
        }
    })
}

//顶部高度
var topToolbarHeight = 50;

document.getElementById('main_menu_id').style.height = Leaf.getViewportHeight() - topToolbarHeight-20 + 'px';
$jq('.menu ul').css('height',Leaf.getViewportHeight() - topToolbarHeight-20 + 'px');
$jq('.menu ul').css('overflow','auto');
$jq('.menu ul').slimScroll(
    {
        height: Leaf.getViewportHeight() - 70,
        railColor: '#272B2E'
    }
);
$jq('#solidblockmenu').css('height',Leaf.getViewportHeight() - 70 + 'px');
$jq('#solidblockmenu').css('overflow','auto');
$jq('#solidblockmenu').slimScroll(
    {
        height: Leaf.getViewportHeight() - 70,
        railColor: '#272B2E'
    }
);
/*$jq('.subMenu .menu').css('height',Leaf.getViewportHeight() - 111 + 'px');
$jq('.subMenu .menu').css('overflow','auto');*/



document.querySelectorAll('div[childMenu]').forEach(function (value) {
    value.style.height = Leaf.getViewportHeight() - 70  + 'px';
});

//渲染快速导航栏
!function() {
    document.getElementById('fastButton').style.width = $jq(window).width() - 469 + 'px';
    var datas = $('sys_role_function_query_ds').getAll();
    var html = '';
    document.getElementById('fastButton').innerHTML = html;
    datas.forEach(function(value){
        if (value.data.enabled_flag === 'Y' && value.data.role_id == ${/session/@role_id}) {
            html += '<span id="' + value.data.function_code + '" onclick="openNewTab(this)" class="fast_btn_span"' + value.data.function_name + '</span>'
        }
    });
    html = html + '<img onclick="showFastBtnConfig()" class="fast_button_add" src="${/request/@context_path}/leafresource/images/MAIN/fast_button_add.png"/>';
    document.getElementById('fastButton').innerHTML = html;

    var fastBtnBorderLand = document.getElementById('fastButton').offsetLeft + document.getElementById('fastButton').offsetWidth;
    var addtionfastBtnList = [];
    document.getElementById('pullDown').style.display = 'none';
    document.getElementById('fastButton').childNodes.forEach(function (value) {
        if (value.offsetLeft + value.offsetWidth > fastBtnBorderLand) {
            document.getElementById('pullDown').style.display = 'inline-block';
            addtionfastBtnList.push({
                id: value.id,
                name: value.innerText
            });
            // document.getElementById('fast-link').appendChild(value);
            value.style.display = 'none';
        }
    });
    var addtionHtml = '';
    addtionfastBtnList.forEach(function (value) {
        addtionHtml += '<span onclick="mainJumpCode(this.id)" id="' + value.id + '" class="fast_btn_span" style="display: inline-block;line-height: 25px;height: 25px;padding: 5px 25px;width: 150px;">' + value.name + '</span>';
    });
    document.getElementById('addtionBtn').innerHTML = addtionHtml;
}();


if( navigator.userAgent.match(/Android/i)
    || navigator.userAgent.match(/webOS/i)
    || navigator.userAgent.match(/iPhone/i)
    || navigator.userAgent.match(/iPad/i)
    || navigator.userAgent.match(/iPod/i)
    || navigator.userAgent.match(/BlackBerry/i)
    || navigator.userAgent.match(/Windows Phone/i)
){

    document.getElementById('allBar').setAttribute('onmouseover','');
    document.getElementById('allBar').onclick = function (ev) {
        document.getElementById('main_menu_id').style.display = 'block';

    };

    // return true;
}
else {
    // return false;
    Ext.onReady(function() {
        Ext.getBody().on('click', function(el) {
        //
            var solidblockmenu = Ext.get('solidblockmenu');
            var subMenu = Ext.get('subMenu');
            if (solidblockmenu.contains(el.target) || solidblockmenu.dom === el.target) {
                return;
            }
            if (subMenu.contains(el.target) || subMenu.dom === el.target) {
                return;
            }
            hideCurrentMenu();
            document.getElementById('main_menu_id').style.display = 'none';
        });
    })
}
function showMenuPhone() {
    document.getElementById('main_menu_id').style.display = 'block';
}

jQuery("#function_history_content_pre").click(function(){
    jQuery("#function_history_content").scrollLeft(jQuery("#function_history_content").scrollLeft()-140);
});
jQuery("#function_history_content_next").click(function(){
    jQuery("#function_history_content").scrollLeft(jQuery("#function_history_content").scrollLeft()+140);
});
/*jQuery("#fast-menu-toolbar").mouseenter(function(){
    jQuery(".fast_toolbar").show();
    jQuery("#fast-menu-toolbar").css("background","#232b32");
    jQuery(".fast_toolbar").animate({height:"48px"});
});*/
/*jQuery("#fast_toolbar").mouseleave(function(){
    jQuery("#fast-menu-toolbar").css("background","none");
    jQuery(".fast_toolbar").animate({height:"0px"},function(){
        jQuery(".fast_toolbar").hide();
    });
});*/
/*jQuery(window).click(function(e){
    jQuery("#fast-menu-toolbar").css("background","none");
    jQuery(".fast_toolbar").animate({height:"0px"},function(){
        jQuery(".fast_toolbar").hide();
    });
});*/
jQuery("#fast-menu-toolbar").click(function(e){
    //
    if(jQuery(".fast_toolbar").css("display") == 'none'){
        jQuery(".fast_toolbar").show();
        jQuery("#fast-menu-toolbar").addClass("fast-menu-toolbar-background");
        jQuery(".fast_toolbar").animate({height:"48px"});
    }else{
        jQuery("#fast-menu-toolbar").removeClass("fast-menu-toolbar-background");
        jQuery(".fast_toolbar").animate({height:"0px"},function(){
            jQuery(".fast_toolbar").hide();
        });
    }
    $jq("#notice_menu").hide();
    e.stopPropagation();
});
(function initNotice(){
    //
    $jq(".notice_menu_body_common").eq(0).addClass("notice_menu_body_common_hover");
    $jq(".notice_menu_body_class").eq(0).show();
    $jq(".workflow_menu_img").show();
    $jq(".notice_menu_img").hide();
    $jq("#notice-search-img").hide();
    $jq("#notice_search_input").hide();
    $jq("#workflow-search-img").show();
    $jq("#todo_search_input").show();
    $jq(".notice_menu_body_common").each(function(index,obj){
        this.index = index;
        $jq(this).hover(function(){
            $jq(".notice_menu_body_common").removeClass("notice_menu_body_common_hover");
            $jq(".notice_menu_body_class").hide();
            $jq(".notice_menu_body_class").eq(this.index).show();
            //$jq(".notice_menu_search_content").hide();
            //
            if(this.index==0){
                $jq(".workflow_menu_img").show();
                $jq(".notice_menu_img").hide();
                $jq("#notice-search-img").hide();
                $jq("#notice_search_input").hide();
                $jq("#workflow-search-img").show();
                $jq("#todo_search_input").show();
            }else{
                $jq(".notice_menu_img").show();
                $jq(".workflow_menu_img").hide();
                $jq("#notice-search-img").show();
                $jq("#workflow-search-img").hide();
                $jq("#notice_search_input").show();
                $jq("#todo_search_input").hide();
            }
            $jq(".notice_menu_body_common").eq(this.index).addClass("notice_menu_body_common_hover");
        });
    });
})();
Leaf.onReady(function() {
    var notice_msg_count = ${/model/notice_msg_count/record/@list_count};
    var todo_count = ${/model/to_do_list_count/record/@list_count};
    $jq("#notice_message_num").html("("+notice_msg_count+")");
    $jq("#todo_message_num").html("("+todo_count+")");
    $jq("#system_notice").empty();
    $jq("#system_todo").empty();
    var html = "";
    $("sys_notice_msg_result_main_ds").each(function(obj,index){
        //
        if(obj.data.expand_flag == 'N'){
            var message = obj.data.msg_title+'--'+obj.data.msg_body;
            var time = obj.data.creation_date;
            var date = new Date(obj.data.creation_date);
            var month_day=date.getMonth() + 1 + '月' + date.getDate()+'日';
            var a = new Array("日", "一", "二", "三", "四", "五", "六");
            var week = date.getDay();
            var weekday = "星期"+ a[week];
            var url = obj.data.notice_url;
            var instance_id = obj.data.source_id;
            html = html + '<div class="notice_menu_item notice_menu_item_height">';
            html = html + '<div class="notice_menu_item_img notice_menu_item_height">';
            //html = html + '<img src="${/request/@context_path}/leafresource/images/MAIN/system_notice.png"/></div>';
            html = html + '<div class="notice_menu_item_content notice_menu_item_height" onclick="winOpen_notice_url(\''+url+'\','+instance_id+')">';
            html = html + '<div class="notice_menu_item_content_msg" title="'+message+'">'+message+'</div>';
            html = html + '<div class="notice_menu_item_content_time">'+month_day+weekday+'</div></div></div>';
        }
    });
    $jq("#system_notice").html(html);
    var todoHtml = "";
    $("main_toDoDs").each(function(obj,index){
        //
        var title = obj.data.workflow_info;
        var date = new Date(obj.data.creation_date_format);
        var month_day=date.getMonth() + 1 + '月' + date.getDate()+'日';
        var a = new Array("日", "一", "二", "三", "四", "五", "六");
        var week = date.getDay();
        var weekday = "星期"+ a[week];
        var time = obj.data.creation_date_format;
        var content = obj.data.document_info;
        var submit = obj.data.submitted_by_name;
        var instance_id = obj.data.instance_id;
        var node_id = obj.data.node_id;
        var record_id = obj.data.record_id;
        var workflow_id = obj.data.workflow_id;
        var record_type = obj.data.record_type;
        todoHtml = todoHtml + '<div class="notice_menu_item todo_menu_item_height">';
        todoHtml = todoHtml + '<div class="todo_menu_item_content todo_menu_item_height" onclick="winOpen_zjwfl5110_wfl_approve('+instance_id+','+node_id+','+record_id+','+workflow_id+',\''+record_type+'\')">';
        todoHtml = todoHtml + '<div class="todo_title">';
        //todoHtml = todoHtml + '<img src="${/request/@context_path}/leafresource/images/MAIN/notice_todo.png"/>';
        todoHtml = todoHtml + '<span class="title" title="'+title+'">'+title+'</span>';

        todoHtml = todoHtml + '</div>';
        //todoHtml = todoHtml + '<div class="todo_msg" title="'+content+'">'+content+'</div>';
        todoHtml = todoHtml + '<div class="todo_info" title="'+submit+'">'+'from'+' '+submit+'</div>';
        todoHtml = todoHtml + '<div class="month_day" title="'+time+'">'+month_day+' '+weekday+'</div>';
        //todoHtml = todoHtml + '<div class="weekday" title="'+time+'">'+weekday+'</div>';
        todoHtml = todoHtml + '</div></div>';
    });
    $jq("#system_todo").html(todoHtml);
})
function winOpen_notice_url(url, instance_id) {
    new Leaf.Window({
        id: 'sys_notice_url',
        url: '${/request/@context_path}/modules/' + url,
        params: {
            instance_id: instance_id
        },
        title: '明细',
        fullScreen: true
    });
}
function winOpen_zjwfl5110_wfl_approve(instance_id, node_id, record_id, workflow_id,record_type) {
    var url_type;
    if (record_type=='NOTICE'){
        url_type='NOTICE';
    }else{
        url_type='DISPLAY';
    }
    var win = new Leaf.Window({
        id: 'zj_wfl_approve_win',
        url: '${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve.lview',
        params:{
            instance_id : instance_id,
            node_id : node_id,
            record_id : record_id,
            workflow_id : workflow_id,
            record_type : record_type,
            url_type    : url_type
        },
        title: '工作流审批',
        height: 500,
        width: 860,
        fullScreen: true
    });
    win.on('close',function(){
        //query_zjwfl5110_toDoDs();
        location.reload();
    });
}
//jQuery("#click-workflow").click(function(e){
//
//
//      if($jq("#notice_menu").css("display") == 'none'){
//    $jq("#notice_menu").show();
//    jQuery("#notice_menu").animate({height: "475px"});
//     }else{
//        if (!jQuery(e.target).parents().hasClass("notice_menu")) {
//            jQuery("#system_notice_button").removeClass("system_notice_button_background");
//            jQuery("#notice_menu").animate({height: "0px"}, function () {
//                jQuery("#notice_menu").hide();
//            });
//        }
//    }
//    jQuery("#fast-menu-toolbar").css("background", "none");
//    jQuery(".fast_toolbar").animate({height: "0px"}, function () {
//        jQuery(".fast_toolbar").hide();
//    });
//
//      e.stopPropagation();
//})
function clickWorkflow(dom){

    document.getElementById('userDetail').style.display = 'none';
    document.getElementById('searchFunction').style.display = 'none';
    document.getElementById('sp-searchtext').style.width = '0px';
    $jq("#notice_menu").show();
    document.getElementById('notice_menu').style.height = '475px';

}
function showSearch(dom){

    document.getElementById('userDetail').style.display = 'none';
    document.getElementById('notice_menu').style.display = 'none';
    document.getElementById('searchFunction').style.display = 'block';
    $jq("#sp-searchtext").animate({width:'135px'});
}
]]></script>
</a:view>
</a:screen>