<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-8-28 下午02:14:57  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="hls030_doc_layout_tab_button_detail_link" url="${/request/@context_path}/modules/hls/HLS030/hls_doc_layout_tab_button_detail.lview"/>
        <a:link id="hls030_doc_layout_tab_button_add_link" url="${/request/@context_path}/modules/hls/HLS030/hls_doc_layout_tab_button_add.lview"/>
        <script type="text/javascript"><![CDATA[
            function hls030_tab_function_close() {
                $('hls_doc_button_setup').close();
            }
            
            function hls030_tab_function_query() {
                $('hls030_tab_function_result_ds').query();
            }
            
            function hls030_tab_function_add() {
                new Leaf.Window({
                    id: 'hls030_doc_layout_tab_button_add_window',
                    url: $('hls030_doc_layout_tab_button_add_link').getUrl(),
                    params: {
                        layout_code: '${/parameter/@layout_code}',
                        layout_desc: '${/parameter/@layout_desc}'
                    },
                    title: '${l:HLS031.LAYOUT_BUTTON_CONFIG}',
                    height: 250,
                    width: 580
                });
            }
            
            function hls030_tab_button_detail_open(record_id) {
                var record = $('hls030_tab_function_result_ds').findById(record_id);
                new Leaf.Window({
                    id: 'hls030_doc_layout_tab_button_detail_window',
                    url: $('hls030_doc_layout_tab_button_detail_link').getUrl(),
                    params: {
                        layout_code: '${/parameter/@layout_code}',
                        layout_desc: '${/parameter/@layout_desc}',
                        function_code: record.get('function_code'),
                        function_name: record.get('function_name'),
                        tab_code: record.get('tab_code'),
                        tab_desc: record.get('tab_desc')
                    },
                    title: '${l:HLS031.LAYOUT_BUTTON_CONFIG_DETAIL}',
                    fullScreen: true
                });
            }
            
            function hls030_tab_function_result_grid_render(value, record, name) {
                return '<a href="javascript:hls030_tab_button_detail_open(\'' + record.id + '\')">${l:HLS031.BUTTON_CONFIG}</a>';
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls030_tab_function_query_ds">
                <a:fields>
                    <a:field name="layout_code" defaultValue="${/parameter/@layout_code}" prompt="HLS030.HLS_DOC_LAYOUT.LAYOUT_CODE" readOnly="true"/>
                    <a:field name="layout_desc" defaultValue="${/parameter/@layout_desc}" prompt="HLS.DESCRIPTION" readOnly="true"/>
                    <a:field name="function_code" autoComplete="true" autoCompleteField="function_code" lovGridHeight="300" lovHeight="460" lovService="sys.SYS8010.sys_function_lov?function_type=F" lovWidth="480" title="功能选择">
                        <a:mapping>
                            <a:map from="function_name" to="function_name"/>
                            <a:map from="function_code" to="function_code"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="function_name" readOnly="true"/>
                    <a:field name="tab_code" lovGridHeight="300" lovHeight="450" lovService="hls.HLS030.hls_doc_layout_tab_lov?layout_code=${/parameter/@layout_code}" lovWidth="500" title="HLS030.HLS_DOC_LAYOUT_TAB.TAB_CODE">
                        <a:mapping>
                            <a:map from="tab_code" to="tab_code"/>
                            <a:map from="tab_desc" to="tab_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="tab_desc" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls030_tab_function_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS030.hls_doc_layout_tab_button_function" queryDataSet="hls030_tab_function_query_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="hls030_tab_function_close" text="HLS.CLOSE"/>
                <a:gridButton click="hls030_tab_function_add" text="HLS.NEW"/>
                <a:gridButton click="hls030_tab_function_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:hBox labelSeparator=" " labelWidth="100">
                <a:textField name="layout_code" bindTarget="hls030_tab_function_query_ds"/>
                <a:textField name="layout_desc" bindTarget="hls030_tab_function_query_ds"/>
            </a:hBox>
            <a:hBox labelSeparator=" " labelWidth="100">
                <a:lov name="function_code" bindTarget="hls030_tab_function_query_ds" prompt="SYS8010.SYS_FUNCTION.FUNCTION_CODE" typeCase="upper"/>
                <a:textField name="function_name" bindTarget="hls030_tab_function_query_ds" prompt="SYS8010.SYS_FUNCTION.FUNCTION_NAME"/>
                <a:lov name="tab_code" bindTarget="hls030_tab_function_query_ds" prompt="HLS030.HLS_DOC_LAYOUT_TAB.TAB_CODE"/>
                <a:textField name="tab_desc" bindTarget="hls030_tab_function_query_ds" prompt="HLS030.HLS_DOC_LAYOUT_TAB.TAB_DESC"/>
            </a:hBox>
            <a:grid id="hls030_tab_function_result_grid" bindTarget="hls030_tab_function_result_ds" marginHeight="200" marginWidth="40" navBar="true">
                <a:columns>
                    <a:column name="function_code" prompt="SYS8010.SYS_FUNCTION.FUNCTION_CODE" width="120"/>
                    <a:column name="function_name" prompt="SYS8010.SYS_FUNCTION.FUNCTION_NAME" width="180"/>
                    <a:column name="tab_code" prompt="HLS030.HLS_DOC_LAYOUT_TAB.TAB_CODE" width="200"/>
                    <a:column name="tab_desc" prompt="HLS030.HLS_DOC_LAYOUT_TAB.TAB_DESC" width="250"/>
                    <a:column name="button_config" align="center" prompt="HLS031.BUTTON_CONFIG" renderer="hls030_tab_function_result_grid_render" width="150"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
