safesite/safesite/templates/noticedetail.html

132 lines
6.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="easyui-layout" id="result" style="width:100%;height:100%"></div>
<script>loading();</script>
<script type="text/html" id="text">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">关闭</a>
</div>
<div data-options="region:'center'" style="height:100%;">
{% verbatim %}
<div id="tt" class="easyui-tabs" border=false>
<div title="通知信息" style="height:100%;padding:15px 15px;">
<table class='detailtable'>
<tr>
<td colspan="2">主题{{notice.title}}</td>
</tr>
<tr>
<td style="width:50%">发布部门:{{notice.pubpart__partname}}</td>
<td style="width:50%">发布人:{{notice.pubuser__name}}</td>
</tr>
<tr>
<td>发布时间:{{notice.submittime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
<td>修改时间:{{notice.modifytime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
</tr>
</table>
<div class="labeldiv">相关附件</div>
<table class='detailtable'>
<thead>
<tr>
<th style="width:10%">
序号
</th>
<th style="width:90%">
文件名
</th>
</tr>
</thead>
{{each notice.material}}
<tr>
<td>{{$index+1}}</td>
<td><a href='{{$value}}' target="_blank">{{$value|gfilename}}</a></td>
</tr>
{{/each}}
</table>
<div class="labeldiv">内容</div>
<div >{{@notice.content}}</div>
</div>
{{if notice.isgg==0}}
<div title="阅读状态" style="height:100%;padding:15px 15px;">
<div>已阅人数<span class='labeldiv'> {{readpeople}}</span></div>
<div>阅读量<span class='labeldiv'> {{readsnum}}</span></div>
<table class='detailtable'>
<thead>
<tr>
<th style="width:10%">
序号
</th>
<th style="width:40%">
姓名
</th>
<th style="width:50%">
状态
</th>
</tr>
</thead>
{{each reads}}
<tr>
<td>{{$index+1}}</td>
<td>{{$value.receiver__name}}</td>
{{if $value.read==0}}
<td><font color="red">未读</font></td>
{{else}}
<td><font color="green">已读</font></td>
{{/if}}
</tr>
{{/each}}
</table>
</div>
{{/if}}
</div>
{% endverbatim %}
</div>
</script>
<script type="text/javascript" src="/static/safesite/mystatic/js/template-web.js"></script>
<script>
var html;
var tzid = {{ id }};
template.defaults.imports.dateFormat = function (date, format) {
date = new Date(date);
var map = {
"M": date.getMonth() + 1, //月份
"d": date.getDate(), //日
"h": date.getHours(), //小时
"m": date.getMinutes(), //分
"s": date.getSeconds(), //秒
"q": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
var v = map[t];
if (v !== undefined) {
if (all.length > 1) {
v = '0' + v;
v = v.substr(v.length - 2);
}
return v;
}
else if (t === 'y') {
return (date.getFullYear() + '').substr(4 - all.length);
}
return all;
});
return format;
};
template.defaults.imports.gfilename = function (value) {
x = value.split('/').pop();
return x;
}
$.ajax({
type: "get",
url: "api/notice?a=detail",
data: { id: tzid },
async: false, // ajax同步使用false
success: function (data) {
html = template('text', data);
}
});
$('#result').html(html);
removeLoading();
</script>