<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wujun  
    $Date: 2017-3-1 14:26:32  
    $Revision: 1.0  
    $Purpose: 项目重启
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="hn_project_restart_link" model="prj.PRJ950.hn_project_restart_info" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
            //项目重启
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
                var prj_project_result_ds = $(ds_id);
                var records = prj_project_result_ds.getSelected();
                if (records.length != 1) {
                    Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
                    return;
                }
                var record = records[0];
                var project_id = record.get('project_id');

                Leaf.showConfirm('${l:HLS.PROMPT}', '确定要重启项目吗?', function() {
                    window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
                    Leaf.request({
                        url: $('hn_project_restart_link').getUrl(),
                        para: {
                            project_id: project_id
                        },
                        success: function(res) {
                            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                            $(ds_id).query();
                        },
                        failure: function() {
                            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        },
                        error: function() {
                            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        },
                        scope: this
                    });
                });   
            };
            
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PROJECT&amp;function_code=PRJ501"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>