<?xml version="1.0" encoding="UTF-8"?> <!-- $Date: 2018/9/4 微件-公告栏 WIDGET-SYS-MSG --> <a:screen xmlns:a="http://www.leaf-framework.org/application"> <a:init-procedure/> <a:view template="default" package="leaf.ui.std"> <!--<meta name="_csrf" content="${/session/@_csrf.token}"/>--> <!--<meta name="_csrf_header" content="X-CSRF-TOKEN" />--> <a:link id="widget_sys_notice_msg_url" url="${/request/@context_path}/modules/sys/SYS100/sys_notice_msg_html.lview"/> <a:link id="widget_all_sys_notice_msg_url" url="${/request/@context_path}/modules/sys/SYS100/sys_notice_msg.lview"/> <style> html,body{ background-color:#eee; width:264px; height:360px; margin: 0; padding: 0; } .widget_sys_msg{ box-sizing:border-box; width:264px; height:360px; background-color:#fff; position:relative; border:1px solid #F0F0F3; cursor:default; } .widget_sys_msg .widget_label{ position:absolute; width:40px; height:4px; top:0; left:16px; background-color: #5A7FFF; } .widget_sys_msg .header{ position:relative; height:22px; padding:12px 12px 6px 16px; font-family: PingFangSC-Medium; font-size: 14px; color: #4B505A; } .widget_sys_msg .header{ position:relative; height:22px; padding:12px 12px 6px 16px; font-family: PingFangSC-Medium; font-size: 14px; color: #4B505A; border-bottom:1px solid #F0F0F3; } .widget_sys_msg .header a{ font-family: PingFangSC-Regular; font-size: 12px; color: rgba(93,97,103,0.70); float:right; } .widget_sys_msg .top_msg{ padding:13px 12px 0 12px; width:240px; } .widget_sys_msg .top_msg img{ width:240px; height:120px; } .widget_sys_msg .top_msg .title{ width: 240px; height: 24px; box-sizing: border-box; font-family: PingFangSC-Regular; font-size: 12px; color: #FFFFFF; z-index: 10; background: rgba(41,66,97,0.7); line-height: 24px; padding-left: 8px; position: relative; top: -24px; } .widget_sys_msg .msg_list{ position: relative; box-sizing: border-box; padding: 0 12px 9px 12px; top: -11px; } .widget_sys_msg .msg_list .list_row{ width:100%; height:20px; line-height:20px; margin-bottom:12px; font-family: PingFangSC-Regular; font-size: 12px; color: rgba(0,0,0,0.56); cursor:pointer; } .widget_sys_msg .msg_start_date{ font-family: PingFangSC-Regular; font-size: 13px; color: rgba(0,0,0,0.40); float:right; } </style> <script><![CDATA[ function on_sys_notice_msg_ds_load(ds){ var records = ds.data; var html=''; records.forEach(function(record){ var title = record.data["msg_title"] || ''; var date = record.data["msg_start_date"] || new Date; var id = record.data["notice_msg_id"] || 0; var source_id = record.data["source_id"] || 0; var notice_type = record.data["notice_type"] || ''; var url = record.data["notice_url"] || ''; var dateStr = date.format("mm-dd"); var clickJsStr = ''; if (notice_type == 'URL') { clickJsStr = 'openWin_sys_msg_detail_url(\'' + url + '\',' + source_id + ')'; } else if (notice_type == 'HTML') { clickJsStr = 'openWin_sys_msg_detail_html(' + record.get('notice_msg_id') + ')'; } else { clickJsStr = ''; } html += '<div class="list_row" onclick="' + clickJsStr + '">'; html += '<span class="msg_type">【系统公告】</span>'; html += '<span class="msg_title">' + title + '</span>'; html += '<span class="msg_start_date">' + dateStr + '</span>'; html += '</div>'; }); jQuery(".widget_sys_msg .msg_list").html(html); }; function openWin_sys_msg_detail_url(url,instance_id){ new Leaf.Window({ id: 'sys_notice_url', url: '${/request/@context_path}/modules/' + url, params: { instance_id: instance_id }, title: '明细', fullScreen: true }); } function openWin_sys_msg_detail_html(notice_msg_id){ new Leaf.Window({ id: 'sys_notice_msg_html', url: $('widget_sys_notice_msg_url').getUrl(), params: { notice_msg_id: notice_msg_id }, title: '明细', fullScreen: true }); } function openWin_all_sys_msg(){ new Leaf.Window({ id: 'all_sys_notice_msg', url: $('widget_all_sys_notice_msg_url').getUrl(), title: '全部系统公告', fullScreen: true }); } ]]></script> <a:dataSets> <a:dataSet id="sys_notice_msg_ds" autoQuery="true" pageSize="5" model="sys.SYS8300.sys_notice_msg"> <a:fields> <a:field name="msg_title"/> <a:field name="msg_start_date"/> <a:field name="notice_msg_id"/> </a:fields> <a:events> <a:event name="load" handler="on_sys_notice_msg_ds_load"/> </a:events> </a:dataSet> </a:dataSets> <div class="widget_sys_msg"> <span class="widget_label"> </span> <div class="header"> <span class="title">公告栏</span> <a href="javascript:openWin_all_sys_msg()">查看更多></a> </div> <div class="top_msg"> <img src="${/request/@context_path}/leafresource/images/widget/top_msg_mask.png"/> <div class="title">热烈庆祝公司移动端产品上线</div> </div> <div class="msg_list"> </div> </div> <a:screenBody style="display:none"> </a:screenBody> </a:view> </a:screen>