ComplianceServer/oldcode/Core.Web/Views/News/Log.cshtml

287 lines
10 KiB
Plaintext

@using Core.Web.WebHelper
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
.self-table-click td {
background-color: #f3ebbc;
}
.auditimg {
width: 200px;
height: 200px;
}
ul.imglist {
margin: 0 auto;
width: 400px;
overflow: hidden
}
ul.imglist li {
float: left;
padding: 4px 8px;
width: 160px;
border: 5px solid white;
border-radius: 5px;
}
ul.imglist li span i {
display: none;
}
ul.imglist li:hover {
border: 5px solid #e2dfdf;
}
ul.imglist li:hover span i {
display: block;
cursor: pointer;
}
ul.imglist li img {
display: block;
width: 160px;
height: 90px
}
ul.imglist li span {
display: block;
width: 100%;
height: 30px;
line-height: 30px;
background: #F6F6F6;
}
</style>
<div class="x-body">
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
<div id="AuditDialog" class="layui-form" style="display:none;">
<div class="x-body">
<form class="layui-form">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline">
<ul class="imglist" id="imglist"></ul>
</div>
</div>
</div>
</form>
</div>
</div>
<div id="AttDialog" class="layui-form" style="display:none;">
<div class="x-body">
<table class="layui-hide" id="tabl3" lay-filter="tabl3"></table>
</div>
</div>
<script>
var selectRow = {};
var table;
layui.use(['table', 'form', 'layer', 'upload', 'laydate'], function () {
table = layui.table;
var form = layui.form;
var layer = layui.layer;
var upload = layui.upload;
table.render({
id: 'NewsList',//列表别名ID
elem: '#tabl1',//表ID
url: '/News/NewsLog?Id=@Html.Raw(ViewBag.Id)',
method: 'POST',
cols: [[
{ field: 'id', title: 'ID',width:60 }
, { field: 'NewsType', title: '类型', templet: '#typeTpl', width: 60 }
, { field: 'Title', title: '标题' }
, {
field: 'Content', title: '链接', templet: function (d) {
if (d.Content) {
if (d.Content.indexOf("http") == 0) {
return '<div><a href="' + d.Content + '" target="_blank" class="layui-table-link">' + d.Content + '</a></div>'
} else {
return d.Content;
}
} else {
return "";
}
}
}
, { field: 'Att', title: '附件', templet: '#attTpl' }
, { field: 'Remark', title: '内容' }
, { field: 'Channels', title: '渠道' }
, { field: 'Author', title: '作者' }
, { field: 'OpEvent', title: '事件', width: 120 }
, { field: 'CTime', title: '时间'}
, { field: 'OpName', title: '执行人' }
, { field: 'CheckRemark', title: '审核备注' }
, { field: 'ReasonStr', title: '驳回理由' }
//, {
// field: 'AuditImg1', title: '审核图片', templet: function (d) {
// if (d.AuditImg1 || d.AuditImg2 || d.AuditImg3 || d.AuditImg4 || d.AuditImg5 || d.AuditImg6) {
// return "<a class=\"layui-table-link\" href='javascript:ShowImg(\"" + d.AuditImg1 + "\",\"" + d.AuditImg2 + "\",\"" + d.AuditImg3 + "\",\"" + d.AuditImg4 + "\",\"" + d.AuditImg5 + "\",\"" + d.AuditImg6 +"\")'>查看<a>";
// } else {
// return "<font color='#dddddd'>无</font>"
// }
// }
//}
, {
field: 'Attachment', title: '审核附件', templet: function (d) {
if (d.Attachment && d.Attachment != '[]') {
return "<a class=\"layui-table-link\" href='javascript:ShowAtt()'>查看<a>";
} else {
return "<font color='#dddddd'>无</font>"
}
}
}
]]
, page: {
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
//,curr: 5 //设定初始在第 5 页
, groups: 5 //只显示 1 个连续页码
}
, where: GetParams("mytoolbar")
});
table.render({
id: 'testReload3'//列表别名ID
, elem: '#tabl3'//表ID
, data: []
, cols: [[
{ field: 'id', title: '序号', type: 'numbers', align: "center", width: 60 }
, { field: 'fileName', title: '文件名称', align: "center", width: 250 }
, { field: 'fileSize', title: '文件大小', align: "center", width: 100 }
, { field: 'fileUrl', title: '操作', templet: '#fileTpl', width: 100, align: "center" }
, { field: 'uploader', title: '上传人', align: "center", width: 100 }
, { field: 'uploadTime', title: '上传时间', align: "center", width: 180 }
]],
limit: 15
});
$('#mytoolbar .layui-btn').on('click', function (data) {
table.reload('NewsList', {
page: { curr: 1 },
where: GetParams("mytoolbar")
});
});
//监听行单击事件
table.on('row(tabl1)', function (obj) {
var data = obj.data;
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
$('.layui-btn-group .layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method].call(this, othis) : '';
});
});
function ShowLog(id) {
alert(id);
}
function ShowAtt() {
layui.use(['table', 'form', 'layer', 'upload', 'laydate'], function () {
var layer = layui.layer;
var data = JSON.parse(selectRow.Attachment);
console.log(data);
table.reload('testReload3', {
data: data
});
layer.open({
title: '查看审核附件',
type: 1,
content: $('#AttDialog'),
area: ['850px', '500px']
, btn: ['关闭']
, yes: function (index, layero) {
layer.closeAll();
//$("#audit").click();
}
});
});
}
function ShowImg(AuditImg1, AuditImg2, AuditImg3, AuditImg4, AuditImg5, AuditImg6) {
$("#imglist").html("");
var imgurl = "";
if (selectRow.AuditImg1) {
$("#imglist").append('<li><a href="' + selectRow.AuditImg1 + '" target="_blank"><img src="' + selectRow.AuditImg1 + '" /></a></li>');
imgurl = selectRow.AuditImg1;
}
if (selectRow.AuditImg2) {
$("#imglist").append('<li><a href="' + selectRow.AuditImg2 + '" target="_blank"><img src="' + selectRow.AuditImg2 + '" /></a></li>');
imgurl = imgurl + "|" + selectRow.AuditImg2;
}
if (selectRow.AuditImg3) {
$("#imglist").append('<li><a href="' + selectRow.AuditImg3 + '" target="_blank"><img src="' + selectRow.AuditImg3 + '" /></a></li>');
imgurl = imgurl + "|" + selectRow.AuditImg3;
}
if (selectRow.AuditImg4) {
$("#imglist").append('<li><a href="' + selectRow.AuditImg4 + '" target="_blank"><img src="' + selectRow.AuditImg4 + '" /></a></li>');
imgurl = imgurl + "|" + selectRow.AuditImg4;
}
if (selectRow.AuditImg5) {
$("#imglist").append('<li><a href="' + selectRow.AuditImg5 + '" target="_blank"><img src="' + selectRow.AuditImg5 + '" /></a></li>');
imgurl = imgurl + "|" + selectRow.AuditImg5;
}
if (selectRow.AuditImg6) {
$("#imglist").append('<li><a href="' + selectRow.AuditImg6 + '" target="_blank"><img src="' + selectRow.AuditImg6 + '" /></a></li>');
imgurl = imgurl + "|" + selectRow.AuditImg6;
}
//$("#ImgListValue").val(imgurl);
//if ($("#imglist").find("li").length > 5) {
// $("#uploadAuditImg").hide();
//}
layer.open({
title: '查看审核图片',
type: 1,
content: $('#AuditDialog'),
area: ['40%', '70%']
, btn: ['关闭']
, yes: function (index, layero) {
layer.closeAll();
//$("#audit").click();
}
});
}
</script>
<script type="text/html" id="typeTpl">
{{# if(d.NewsType == "activity"){ }}
活动
{{# } else if(d.NewsType == "plan"){ }}
策划
{{# } else if(d.NewsType == "ad"){ }}
推广
{{# }else if(d.NewsType == "service"){ }}
客户服务内容
{{# } }}
</script>
@{
if (ViewBag.Eid == 10000 || ViewBag.Eid == 2001 || ViewBag.Eid == 2007)
{
<script type="text/html" id="eventBar">
<a class="layui-btn layui-btn-xs layui-bg-red" lay-event="audit">审核</a>
</script>
}
}
<script type="text/html" id="statusTpl">
{{# if(d.Status == 1){ }}
<i class="layui-icon layui-icon-ok layui-bg-green"></i>
{{# } else if(d.Status == -1) { }}
<i class="layui-icon layui-icon-close layui-bg-red"></i>
{{# } else { }}
<i class="layui-icon layui-icon-more layui-bg-blue"></i>
{{# } }}
</script>
<script type="text/html" id="attTpl">
{{# if(d.Att != null){ }}
<a href="{{d.Att}}" target="_blank" class="layui-table-link">下载</a>
{{# } }}
</script>
<script type="text/html" id="fileTpl">
{{# if(d.fileUrl != null){ }}
<a href="{{d.fileUrl}}" target="_blank" class="layui-table-link" download="{{d.fileName}}">下载</a>
{{# } }}
</script>