<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-8-30 上午10:24:11  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
            function hls_doc_get_layout_code(bm_url_link, param, win_url_link, list_ds) {
                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());
                        if (!res.result.layout_code) {
                            Leaf.showMessage('${l:PROMPT}', '${l:HLS.LAYOUT_CODE_IS_NULL}');
                            return;
                        }
                        var win = new Leaf.Window({
                            id: 'hls_doc_get_layout_code_winid',
                            params: {
                                document_id: param['document_id'],
                                document_category: param['document_category'],
                                from_master_flag:'Y',
                                company_id: param['company_id'],
                                division:param['division'],
                                layout_code: res.result.layout_code,
                                function_usage: param['function_usage'],
                                master_id:param['master_id'],
                                master_type: param['master_type'],
                                function_code: param['function_code'],
                                maintain_type: param['maintain_type'],
                                default_value_dsid:param['default_value_dsid'],
                                winid: 'hls_doc_get_layout_code_winid'
                            },
                            url: $(win_url_link).getUrl(),
                            title: param['url_title'] + '(' + res.result.layout_code + ')',
                            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
                });
            }
        ]]></script>
    </a:view>
</a:screen>
