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

<!--
    $Author:WJW
    $Revision: 1.0
    工作流通知列表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application"
          xmlns:s="leaf.plugin.script" trace="true">
    <a:init-procedure>
    </a:init-procedure>
    <a:view template="default" package="leaf.ui.std">
        <!--<meta name="_csrf" content="${/session/@_csrf.token}"/>-->
        <!--<meta name="_csrf_header" content="X-CSRF-TOKEN" />-->
        <a:link id="leaf_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="leaf_hls_bp_master_modify_link" url="${/request/@context_path}/modules/hls/HLS214N/hls_bp_master_modify.lview"/>
        <style>
            html, body {
                width: 239px;
                height: 552px;
                margin: 0;
                padding: 0;
            }

            .widget_wfl_notice {
                box-sizing: border-box;
                width: 239px;
                height: 552px;
                background-color: #fff;
                position: relative;
                border: 1px solid #F0F0F3;
                padding: 0;
                cursor: default;
            }

            .widget_wfl_notice .search {
            / / height: 50 px;
                /*border-bottom: 1px solid #F0F0F3;*/
                clear: left;
            }

            .widget_wfl_notice .search .search_content {
                height: 28px;
                margin: 0px 16px;
                background: #FFFFFF;
                box-shadow: 0 1px 4px 0 rgba(90, 127, 255, 0.60);
                border-radius: 5px;
            }
            .widget_wfl_notice .search .line{
                height: 12px;
                width: 1px;
                background: #ccc;
                position: absolute;
                display: inline-block;
                /*left: 54px;*/
                /* top: 8px; */
                margin-top: 8px;
            }
            .widget_wfl_notice .search .search_content #leaf_wfl_search_id {
                height: 24px;
                border: none;
                width: 160px;
                display: inline-block;
                position: absolute;
                margin: 2px 0px 2px 10px;
            }

            .widget_wfl_notice .search .search_content .search_img {
                width: 15px;
                display: inline-block;
                margin: 4px;
                cursor: pointer;
            }

            .widget_wfl_notice .wfl-title {
            / / height: 70 px;
                /*width: 100%;*/
                margin: 19px 0 24px 22px;
                float: left;
            }

            .widget_wfl_notice .wfl-title .title-desc {
                float: left;
                height: 23px;
                /*border-bottom: 2px solid #657efe;*/
                font-family: NotoSansHans-Regular;
                font-size: 14px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 0px;
                color: #333333;
            }
            .widget_wfl_notice .wfl-title .title-desc-line{
                width: 29px;
                height: 5px;
                background-color: #657efe;
                position: absolute;
                margin-left: 43px;
                margin-top: 20px;
            }
            .widget_wfl_notice .wfl-title .title-icon{
                float: left;
                margin-right: 27px;
            }
            .widget_wfl_notice .wfl-title .title-icon img{
                width: 16px;
            }
            /*.widget_wfl .wfl-title .switch {*/
                /*margin-left: 16px;*/
                /*width: 97px;*/
            /*/ / border: 1 px solid rgba(75, 80, 90, 0.15);*/
            /*/ / border-radius: 5 px 0 0 5 px;*/
            /*/ / float: right;*/
                /*height: 23px;*/
                /*margin-bottom: 16px;*/
                /*cursor: pointer;*/
            /*}*/

            /*.widget_wfl .wfl-title .switch .switch_approve {*/
                /*display: block;*/
                /*width: 47px;*/
                /*float: left;*/
                /*font-size: 12px;*/
                /*text-align: center;*/
                /*border: 1px solid rgba(75, 80, 90, 0.15);*/
                /*line-height: 22px;*/
                /*color: rgba(75, 80, 90, 0.75);*/

            /*}*/

            /*.widget_wfl .wfl-title .switch #switch_unapprove_id {*/
                /*border-bottom-left-radius: 5px;*/
                /*border-top-left-radius: 5px;*/
            /*}*/

            /*.widget_wfl .wfl-title .switch #switch_approved_id {*/
                /*border-top-right-radius: 5px;*/
                /*border-bottom-right-radius: 5px;*/
                /*margin-left: -1px;*/
            /*}*/

            .widget_wfl_notice #zjwfl_grid-wraper {
                display: inline-block;
                position: relative;
                height: 329px;
            / / margin: 9 px 0 0 0;
                font-family: PingFangSC-Regular;
                font-size: 12px;
                color: #5A7FFF;
                letter-spacing: 0;
            }

            .widget_wfl_notice .hls-pagging-grid {
                width: 100%;
                height: 400px;
                -webkit-box-shadow: none;
                box-shadow: none;
            //overflow: auto;
            }

            .widget_wfl_notice .hls-pagging-grid .grid-title{
                display:none;
            }
            .widget_wfl_notice .hls-pagging-grid .grid-body{
                padding:0;
                margin-top: 10px;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table>tr:first-child{
                display:none;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tbody tr:first-child{
                height:56px;
                /*border-top:1px solid #F0F0F3;*/
                margin-top: 10px;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr:hover{
                background: rgba(90,127,255,0.08);
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table-active{
                background: rgba(90,127,255,0.08);
            }
            .widget_wfl_notice .hls-pagging-grid .grid-foot{
                margin-top:0;
                line-height:36px;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr{
                height:56px;
                border-bottom:1px solid #F0F0F3;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td{
                height:56px;
                width:100%;
                padding:0 16px;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left{
                float:left;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left .bp_name{
                height:17px;
                line-height:17px;
                max-width:180px;
                overflow:hidden;
                text-overflow:ellipsis;
                white-space:nowrap;
                cursor:pointer;
                font-family: NotoSansHans-Thin;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #333333;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left .left_row2{
                height:17px;
                line-height:17px;
                margin-top:6px;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left .left_row2 .type_icon{
                width:15px;
                height:14px;
                vertical-align:bottom;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left .left_row2 .type_new{
                margin-left:5px;
                font-family: NotoSansHans-Thin;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #66ccff;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left .left_row2 .type_update{
                margin-left:5px;
                font-family: NotoSansHans-Thin;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #66ccff;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .left .left_row2 .date{
                margin-left:30px;
                font-family: NotoSansHans-Thin;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #cccccc;
            }
            .widget_wfl_notice .hls-pagging-grid .hls-table tr td .right{
                width:14px;
                height:14px;
                float:right;
                position:relative;
                right:0;
                top:13px;
                cursor:pointer;
            }
            .widget_wfl_notice .clearFloat{
                clear:both;
                height:0;
                line-height:0;
                font-size:0;
            }
        </style>
        <script><![CDATA[
        function widget_notice_grid_renderer(record,index){
            var bp_name = record.data['bp_name'] || '商业伙伴名称';
            var latest_date = record.data['latest_date'] || new Date;
            var type = record.data['type'] || 'new';

            var latest_date_str = latest_date.format("yyyy-mm-dd HH:MM");
            var type_str = (type=='new') ? '<span class="type_new">新增</span>' : '<span class="type_update">更新</span>';

            var html='';
            html+='<div class="left">'
                +'<div class="bp_name" title="'+ record.data['bp_name'] +'">' + record.data['bp_name'] + '</div>'
                +'<div class="left_row2">'

                +type_str
                +'<span class="date">' + latest_date_str + '</span>'
                +'</div></div>'
                +'<img class="right goDetail" src="${/request/@context_path}/leafresource/images/widget/rightSquare.png" onclick="open_bp_modify_win(\'' + record.ds.id + '\',' + record.id + ')"/>'
                +'<div class="clearFloat"></div>';
            return html;
        };
        function open_bp_modify_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['cond_para2'] = param['bp_type'];
            param['function_code'] = 'HLS224D';
            param['function_usage'] = 'MODIFY';
            param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';

            var bm_url_link='leaf_con_contract_get_layout_code_link_id';
            var list_ds=ds_id;

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $(bm_url_link).getUrl(),
                para: param,
                success: function(res) {
                    Leaf.Masker.unmask(Ext.getBody());
                    param['layout_code'] = 'BP_MODIFY';
                    param['winid'] = 'hls_doc_get_layout_code_winid';
                    var win = new Leaf.Window({
                        id: param['winid'],
                        params: param,
                        url: $('leaf_hls_bp_master_modify_link').getUrl(),
                        title: param['url_title'] + '(BP_MODIFY)',
                        fullScreen: true,
                        draggable: true
                    });
                    win.on('close', function() {
                        if (list_ds) {
                            $(list_ds).query();
                        }
                    });
                },
                failure: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                error: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                scope: this
            });
        }

        function searchWfl() {
            var documentInfo = document.getElementById('leaf_wfl_search_id').value;

            var params = {
                bp_name: documentInfo
            }
            $('widget_notice_ds').qpara = params;
            $('widget_notice_ds').query();
        }


        ]]></script>
        <a:dataSets>
            <a:dataSet id="widget_notice_ds" autoQuery="true" pageSize="5" model="bp.bp_trend">
                <a:fields>
                    <a:field name="type"/>
                    <a:field name="bp_name"/>
                    <a:field name="latest_date"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>

        <div class="widget_wfl_notice">
            <div class="wfl-title">
                <div class="title-icon"><img src="${/request/@context_path}/leafresource/images/wfl/wfl-icon@2x.png"/></div>
                <div class="title-desc">最新动态</div>
                <div class="title-desc-line"></div>
            </div>
            <div class="search">
                <div class="search_content">
                    <img src="${/request/@context_path}/lib/assets/layouts/layout4/img/search@2x.png" class="search_img" onclick="leafsearchWfl()"/>
                    <div class="line"></div>
                    <input id="leaf_wfl_search_id" class="search_input"/>
                </div>
            </div>
            <div class="workflow_menu_img" ><img style="width: 37px;margin-left: 16px;margin-top:10px" src="${/request/@context_path}/lib/assets/layouts/layout4/img/to-do@2x.png"/></div>
            <!--<div class="wfl-title">-->
                <!--<div class="title">审批事项</div>-->
                <!--<div class="switch">-->
                    <!--<div class="switch_approve" id="switch_unapprove_id" onclick="clickUnapprove()">待办</div>-->
                    <!--<div class="switch_approve" id="switch_approved_id" onclick="clickApprove()">已办</div>-->
                <!--</div>-->
            <!--</div>-->
                <a:hapGrid id="widget_notice_render" bindTarget="widget_notice_ds" canWheel="true">
                    <a:columns>
                        <a:column template="widget_notice_grid_renderer"/>
                    </a:columns>
                </a:hapGrid>
        </div>
        <a:screenBody style="display:none"></a:screenBody>
    </a:view>
</a:screen>