<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-1-22 下午02:19:46  
    $Revision: 1.0  
    $Purpose: 系统公告新增
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure><![CDATA[
	]]></a:init-procedure>
    <a:view>
        <a:link id="sys_notice_mas_add_detail_link" url="${/request/@context_path}/modules/sys/SYS101/sys_notice_msg_add_detail.lview"/>
        <a:link id="bmLink_close_msg" model="sys.SYS101.sys_notice_msg_close" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
            var win;
            
            function sys101_add() {
                win = new Leaf.Window({
                    id: 'sys_notice_mas_add_detail_win',
                    url: $('sys_notice_mas_add_detail_link').getUrl(),
                    title: '系统公告新增',
                    fullScreen: true
                });
            
                win.on('close', sys101_refresh);
            }
            
            function sys101_close() {
                var ds = $('sys_notice_msg_result_ds');
                if (ds.getSelected().length == 0) {
                    return;
                }
                var data = ds.getJsonData(true);
                Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认?', function() {
                    Leaf.request({
                        url: $('bmLink_close_msg').getUrl(),
                        para: data,
                        success: function() {
                            sys101_refresh();
                        },
                        failure: function() {},
                        error: function() {},
                        scope: this
                    });
                }, function() {});
            }
            
            function sys101_refresh() {
                $('sys_notice_msg_result_ds').query();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="sys_notice_msg_result_ds" autoPageSize="true" autoQuery="true" model="sys.SYS101.sys_notice_msg_all_query" selectable="true"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="sys101_add" text="HLS.NEW"/>
                <a:gridButton click="sys101_close" text="关闭"/>
                <a:gridButton click="sys101_refresh" text="HLS.REFRESH"/>
            </a:screenTopToolbar>
            <a:grid id="sys_notice_msg_result_grid" bindTarget="sys_notice_msg_result_ds" marginHeight="130" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="notice_user_desc" prompt="用户" width="150"/>
                    <a:column name="msg_title" prompt="主题" width="100"/>
                    <a:column name="msg_body" autoAdjust="false" prompt="内容" showTitle="true" width="400"/>
                    <a:column name="start_date_active" prompt="到达时间" width="150"/>
                    <a:column name="end_date_active" prompt="结束时间" renderer="Leaf.formatDateTime" width="150"/>
                    <a:column name="priority_desc" prompt="优先等级" width="80"/>
                    <a:column name="status" prompt="状态"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>