<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-12-29 下午3:21:14  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[

    
  ]]></a:init-procedure>
    <a:view>
        <a:link id="insert_into_data" model="hls.HLS106.hls_bp_type_assign" modelaction="insert"/>
        <script type="text/javascript"><![CDATA[
            function assignScreen_close() {
                $('sys_get_user_role_assign').close();
            }
            
            function assignDs_grid_add() {
                $('assignDs_grid').showEditorByRecord($('assignDs').create());
            
            }
            
            function assignDs_grid_clear() {
                $('assignDs_grid').clear();
            }
            
            function assignDs_grid_save() {
                var ds = $('assignDs');
                ds.submit();
            
                // var assign_id = $('assignDs').getCurrentRecord().get('assign_id') ;
                // var user_id =$('assignDs').getCurrentRecord().get('user_id') ;
                // var bp_type =$('assignDs').getCurrentRecord().get('bp_type') ;
                // var enable_flag =$('assignDs').getCurrentRecord().get('enable_flag') ;
                // var s='${/parameter/@bp_type}';
                // Leaf.request({
                // url: $('insert_into_data').getUrl(),
                // para: {
                // 'assign_id': assign_id,
                // 'user_id':user_id,
                // 'bp_type':bp_type,
                // 'enable_flag':enable_flag
                // },
            
                // success: function() {
                // $('assignDs').query();
                // $('assignDs_grid').query();
            
                // },
                // error: function() {
            
                // },
                // scope: this
                // });
            
            }
            
            function editorFun_assignDs_grid(record, name) {
                if (record.isNew) {
                    return 'assignDs_grid_lov';
                }
                return '';
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="assignDs" autoQuery="true" fetchAll="false" model="hls.HLS106.hls_bp_type_assign" queryUrl="${/request/@context_path}/autocrud/hls.HLS106.hls_bp_type_assign/query?ORDER_FIELD=name&amp;bp_type=${/parameter/@bp_type}" selectable="true">
                <a:fields>
                    <a:field name="user_name" autoComplete="true" lovGridHeight="340" lovHeight="460" lovService="hls.HLS106.sys_user_lv" lovWidth="500" required="true" title="用户名">
                        <a:mapping>
                            <a:map from="user_id" to="user_id"/>
                            <a:map from="user_name" to="user_name"/>
                            <a:map from="description" to="user_name_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="enable_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="bp_type" defaultValue="${/parameter/@bp_type}"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="assignScreen_close" text="HLS.CLOSE"/>
                <a:gridButton click="assignDs_grid_add" text="HLS.NEW"/>
                <a:gridButton click="assignDs_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="assignDs_grid_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
        </a:screenBody>
        <a:grid id="assignDs_grid" bindTarget="assignDs" height="300" navBar="true" width="810">
            <a:columns>
                <a:column name="user_name" align="center" editorFunction="editorFun_assignDs_grid" prompt="用户代码"/>
                <a:column name="user_name_desc" align="center" editor="assignDs_grid_tf" prompt="用户名"/>
                <!--  <a:column id="bp_type" align="center"   editor="assignDs_grid_tf"   sortable="true" width="200" prompt="类型"  /> -->
                <a:column name="enable_flag" align="center" editor="assignDs_grid_checkBox_id" prompt="启用"/>
            </a:columns>
            <a:editors>
                <a:lov id="assignDs_grid_lov"/>
                <a:textField id="assignDs_grid_tf"/>
                <a:checkBox id="assignDs_grid_checkBox_id"/>
            </a:editors>
        </a:grid>
    </a:view>
</a:screen>
