<?xml version="1.0" encoding="UTF-8"?>

<!--
    :Think
    : 1.0
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default" package="leaf.ui.std">
        <a:link id="bmLink_function_query" model="sys.SYS890.hls_sys_role_home_page_vl" modelaction="query"/>
        <style>
            html, body {
                width: 552px;
                height: 72px;
                margin: 0;
                padding: 0;
            }

            .widget-module {
                width: 552px;
                height: 72px;
                background: #FFFFFF;
                border: 1px solid #F0F0F3;
            }

            .widget-module .module {
                float: left;
                width: 50px;
                margin: 12px 20px 6px 20px;
                display: inline-block;
                text-align: center;
                cursor: pointer;
            }

            .widget-module .module .module-img {
                width: 32px;
                height: 32px;
                background: #FFFFFF;
                box-shadow: 0 2px 12px 0 rgba(78, 104, 142, 0.10);
                border-radius: 4px;
                margin-left: 8px;
                margin-bottom: 5px;
            }
            .widget-module .module .module-img img{
                width: 18px;
                margin-top: 7px;

            }

            .widget-module .module div {
                font-size: 12px;
                color: rgba(75, 80, 90, 0.65);
                text-align: center;
                overflow: hidden;
                text-overflow: ellipsis;
                width: 50px;
                height: 15px;
                word-break: keep-all;
            }

        </style>
        <script><![CDATA[
        //渲染数据
        !function () {
            Leaf.request({
                url: $('bmLink_function_query').getUrl(),
                para: {
                    role_id: ${/session/@role_id}
                },
                scope: this,
                success: function (res) {
                    if (res.success && res.result.record) {
                        var fastFunctionList = res.result.record;
                        if (Array.isArray(fastFunctionList)) {
                            fastFunctionList = fastFunctionList
                        } else {
                            fastFunctionList = [fastFunctionList]
                        }
                        var widget_module = jQuery(".widget-module");
                        for(var i = 0; i < fastFunctionList.length && i < 6; i++){
                            var module = jQuery('<div class="module"></div>');
                            module.appendTo(widget_module);
                            var module_img = jQuery('<div class="module-img"></div>');
                            module_img.appendTo(module);
                            var img = jQuery('<img src="${/request/@context_path}/leafresource/images/former-rent-grey@2x.png"/>');
                            img.appendTo(module_img);
                            var span = jQuery('<div title="'+fastFunctionList[i].function_name+'">'+fastFunctionList[i].function_name+'</div>');
                            span.appendTo(module);
                            module[0].function_code = fastFunctionList[i].function_code;
                            module.click(function(){
                                top.mainJumpCode(this.function_code);
                            });
                        }
                    }
                }
            })
        }();

        ]]></script>
        <a:dataSets></a:dataSets>
        <div class="widget-module">
            <!--<div class="module">
                <div class="module-img">
                    <img src="${/request/@context_path}/leafresource/images/report-gray@2x.png"/>
                </div>

                <div>报表管理</div>
            </div>
            <div class="module">
                <div class="module-img">
                    <img src="${/request/@context_path}/leafresource/images/former-rent-grey@2x.png"/>
                </div>
                <div>租前管理</div>
            </div>
            <div class="module">
                <div class="module-img">
                    <img src="${/request/@context_path}/leafresource/images/workflow-grey@2x.png"/>
                </div>
                <div>工作流</div>
            </div>
            <div class="module">
                <div class="module-img">
                    <img src="${/request/@context_path}/leafresource/images/contract-purple@2x.png"/>
                </div>
                <div>合同管理</div>
            </div>
            <div class="module">
                <div class="module-img">
                    <img src="${/request/@context_path}/leafresource/images/systemSettings-grey@2x.png"/>
                </div>
                <div>系统管理</div>
            </div>
            <div class="module">
                <div class="module-img">
                    <img src="${/request/@context_path}/leafresource/images/add@2x.png"/>
                </div>
            </div>-->

        </div>


        <a:screenBody style="display:none"></a:screenBody>
    </a:view>
</a:screen>