WIDGET-BP-COUNT-old-bak.lview 6.29 KB
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:
    $Date: 2018/8/2
    $Revision: 1.0
    1.商业伙伴统计
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default" package="leaf.ui.std">
        <!--Beyond styles-->
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/beyond.min.css" rel="stylesheet" />
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/demo.min.css" rel="stylesheet" />
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/typicons.min.css" rel="stylesheet" />
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/animate.min.css" rel="stylesheet" />

        <!--Basic Scripts-->
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/skins.min.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/bootstrap.min.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/slimscroll/jquery.slimscroll.min.js"></script>
        <!--Beyond Scripts-->
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/beyond.min.js"></script>

        <!--Page Related Scripts-->
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/charts/morris/raphael-2.0.2.min.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/charts/morris/morris.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/charts/morris/morris-init.js"></script>

        <style>
            html,body{
            background-color:#eee;
            width:870px;
            height:355px;
            margin: 0;
            padding: 0;
            }
            .widget_bp_count{
            width:870px;
            height:355px;
            background-color:#fff;
            }
            .widget_bp_count .clickable{
            cursor:pointer;
            }
            .widget_bp_count_title{
            background:#E75B8D;
            color:#fff;
            height:50px;
            line-height:50px;
            border-top-left-radius:5px;
            border-top-right-radius:5px;
            }
            .widget_bp_count_title img{
            width:25px;
            height:25px;
            position:relative;
            top:12.5px;
            }
            .widget_bp_count_title .title-left{
            display:inline-block;
            float:left;
            line-height:50px;
            margin-left:15px;
            }
            .widget_bp_count_title .title-right{
            display:inlne-block;
            float:right;
            line-height:50px;
            margin-right:15px;
            }
            .widget_bp_count_title .clearFloat{
            clear:both;
            height:0;
            line-height:0;
            font-size:0
            }
            .widget_bp_count_chart{
            background-color:#fff;
            }
        </style>
        <script><![CDATA[
        function on_bp_category_count_ds_load(){
            var records=$('bp_category_count_ds').data;
            var data=[];
            if(records!==null && records.length>0){
                records.forEach(function(i){
                    data.push(i.data);
                });
            }
            Morris.Bar({
              noDataContent: "暂无数据",
              element: 'chart',
              data: data,
              xkey: 'category',
              ymax: 'auto',
              ykeys: ['count'],
              labels: ['人数'],
              hideHover: 'auto',
              barColors:['#42A5F5'],
              barSizeRatio:0.3,
              xLabelMargin:3
            });
        };
        function total_count_label_renderer(value,record,name){
            return '总数'+value
        }
        function this_month_count_label_renderer(value,record,name){
            return '本月新增'+value
        }
        function go_bp_query(){
            <!--top.mainJumpCode('HLS214N');-->
            location.href='/modules/hls/HLS214N/hls_bp_master_modify_entrance.lview?layout_code=BP_MODIFY_ENTRANCE&function_code=HLS214N';
        }
            ]]></script>
        <a:dataSets>
            <a:dataSet id="bp_category_count_ds" autoQuery="true" model="bp.bp_category_count">
                <a:fields>
                    <a:field name="category"/>
                    <a:field name="count"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="on_bp_category_count_ds_load"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="bp_total_count_ds" autoQuery="true" model="bp.bp_total_count">
                <a:fields>
                    <a:field name="total"/>
                    <a:field name="this_month_total"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <div class="widget_bp_count">
            <div class="widget_bp_count_title">
                <div class="title-left">
                    <img src="${base.contextPath}/leafresource/images/widget/line.png" alt="png"/>
                </div>
                <div class="title-left">
                    <span class="title_style">商业伙伴统计</span>
                </div>
                <a:label className="title-left" bindTarget="bp_total_count_ds" name="total" renderer="total_count_label_renderer" style="width:auto"/>
                <a:label className="title-left" bindTarget="bp_total_count_ds" name="this_month_total" renderer="this_month_count_label_renderer" style="width:auto"/>
                <div class="title-right">
                    <img class="clickable" src="${base.contextPath}/leafresource/images/widget/homeAdd.png" style="margin-right:3px"/>
                    <img class="clickable" onclick="go_bp_query()" src="${base.contextPath}/leafresource/images/widget/whiteQuery.png"/>
                </div>
                <div class="clearFloat"></div>
            </div>
            <div class="widget_bp_count_chart">
                <div id="chart" style="width:870px;height:305px"></div>
            </div>
        </div>
        <a:screenBody style="display:none">

        </a:screenBody>
    </a:view>
</a:screen>