209 lines
5.8 KiB
Plaintext
209 lines
5.8 KiB
Plaintext
@using System.Linq
|
|
@using FSLib.Data
|
|
@using Newtonsoft.Json
|
|
@using Web12306.Models
|
|
@using Web12306.Models.Entity.ChatRoom
|
|
@{
|
|
Layout = null;
|
|
|
|
var t = Request.QueryString["t"].ToInt32(2);
|
|
var page = Request.QueryString["p"].ToInt32(1);
|
|
var pagesize = t == 2 ? (int?)null : 50;
|
|
var db = new ChatRoomDb();
|
|
|
|
var count = db.AbuseReports.Count(s => s.Is_Check == t);
|
|
var tpages = pagesize == null ? 1 : (int)(Math.Ceiling(count * 1.0 / pagesize.Value));
|
|
var pageinfo = new PagingInfo(0, count, page) { PageCount = tpages };
|
|
|
|
var list = db.QueryAbuseReports(t, page, pagesize);
|
|
}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width" />
|
|
<title>聊天室举报管理</title>
|
|
<link rel="stylesheet" type="text/css" href="http://static.fishlee.net/resources/cache/admin.css?20140615094216" />
|
|
<link rel="stylesheet" type="text/css" href="http://static.fishlee.net/content/style/fronticons.css?20130708111555" />
|
|
<style>
|
|
.text-container img {
|
|
max-height: 150px;
|
|
max-width: 500px;
|
|
}
|
|
|
|
.text-container {
|
|
max-width: 550px;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
var _static_resource_root = 'http://static.fishlee.net';
|
|
var _dynamic_resource_root = 'http://dynamic.fishlee.net';
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="container container-70 margin-top-xs">
|
|
<div class="nav nav-tabs">
|
|
<li role="presentation" class="@(t == 2 ? "active" : "")"><a href="?t=2">未处理举报</a></li>
|
|
<li role="presentation" class="@(t == 1 ? "active" : "")"><a href="?t=1">已处理举报</a></li>
|
|
</div>
|
|
<table id="rlist" class="table table-bordered table-striped table-hover margin-top-xs">
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>房间</th>
|
|
<th>内容</th>
|
|
<th>举报人</th>
|
|
<th>被举报人</th>
|
|
<th>举报时间</th>
|
|
<th style="width: 90px;">操作</th>
|
|
</tr>
|
|
@foreach (var item in list)
|
|
{
|
|
var chatdata = JsonConvert.DeserializeObject<ChatRoomMessageItem>(item.Data);
|
|
<tr data-id="@item.Id" data-report="@item.Reporting_Account" data-target="@item.Alleged_WrongDoer_Account">
|
|
<td>@item.Id</td>
|
|
<td>
|
|
<div>@item.RoomKey</div>
|
|
<div>
|
|
<span class="label label-@(item.Is_Check==1?"success":"primary")">@(item.Is_Check == 1 ? "已处理" : "未处理")</span>
|
|
</div>
|
|
</td>
|
|
<td class="text-container">
|
|
@chatdata.Detail.Items.Select(s => s.Text).JoinAsString(";")
|
|
@{
|
|
if (chatdata.Detail.Media != null)
|
|
{
|
|
foreach (var media in chatdata.Detail.Media)
|
|
{
|
|
<a href="@media.Url" target="_blank"><img src="@media.Url" /></a>
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(chatdata.Detail.Image))
|
|
{
|
|
<a href="@chatdata.Detail.Image" target="_blank"><img src="@chatdata.Detail.Image" /></a>
|
|
}
|
|
}
|
|
</td>
|
|
<td>
|
|
<strong>@item.Reporting_Name</strong>
|
|
<br />
|
|
@item.Reporting_Account
|
|
</td>
|
|
<td>
|
|
<strong>@item.Alleged_WrongDoer_Name</strong>
|
|
<br />
|
|
@item.Alleged_WrongDoer_Account
|
|
</td>
|
|
<td>@item.Ctime.ToString()</td>
|
|
<td>
|
|
@if (item.Is_Check == 2)
|
|
{
|
|
<div class="btn-group-vertical">
|
|
<button type="button" class="btn btn-sm btn-primary">
|
|
<i class="glyphicon glyphicon-ok"></i>
|
|
封被举报人
|
|
</button>
|
|
<button type="button" class="btn btn-sm btn-danger">
|
|
<i class="glyphicon glyphicon-user"></i>
|
|
封举报人
|
|
</button>
|
|
<button type="button" class="btn btn-sm btn-default">
|
|
<i class="glyphicon glyphicon-remove-sign"></i>
|
|
忽略
|
|
</button>
|
|
</div>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
<tr>
|
|
<td colspan="7">
|
|
@pageinfo.GetMvcPagingHtml("?t=" + t + "&p={0}")
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<script type="text/javascript" src="http://static.fishlee.net/resources/cache/admin.js?20140615094228"></script>
|
|
<script type="text/javascript" src="http://static.fishlee.net/resources/js/tablink.js?20130708112317"></script>
|
|
<script type="text/javascript" src="http://static.fishlee.net/content/scripts/common.js?20131210025634"></script>
|
|
<script>
|
|
$(function() {
|
|
$("#rlist").on("click", ".btn-primary", banReportTarget)
|
|
.on("click", ".btn-danger", banReporter)
|
|
.on("click", ".btn-default", ignoreReport);
|
|
});
|
|
|
|
function ignoreReport() {
|
|
var row = $(this).closest("tr");
|
|
var id = row[0].dataset.id;
|
|
|
|
if (!confirm("确认操作?"))
|
|
return;
|
|
|
|
var dlg = $.createLoadingDialog("正在操作...");
|
|
dlg.showDialog({
|
|
onShow:function() {
|
|
$.post("@Url.Action("IgnoreReport")", { id: id }).done(function(data) {
|
|
dlg.setState(data.ret ? "ok" : "block", data.ret ? "操作成功" : "操作失败");
|
|
|
|
if (data.ret) {
|
|
row.remove();
|
|
}
|
|
|
|
dlg.autoCloseDialog(500);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function banReporter() {
|
|
var row = $(this).closest("tr");
|
|
var id = row[0].dataset.id;
|
|
|
|
if (!confirm("确认操作?"))
|
|
return;
|
|
|
|
var dlg = $.createLoadingDialog("正在操作...");
|
|
dlg.showDialog({
|
|
onShow:function() {
|
|
$.post("@Url.Action("BanReporter")", { id: id }).done(function(data) {
|
|
dlg.setState(data.ret ? "ok" : "block", data.ret ? "操作成功" : "操作失败");
|
|
|
|
if (data.ret) {
|
|
$("#rlist tr[data-report='" + data.user + "']").remove();
|
|
row.remove();
|
|
}
|
|
|
|
dlg.autoCloseDialog(500);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function banReportTarget() {
|
|
var row = $(this).closest("tr");
|
|
var id = row[0].dataset.id;
|
|
|
|
if (!confirm("确认操作?"))
|
|
return;
|
|
|
|
var dlg = $.createLoadingDialog("正在操作...");
|
|
dlg.showDialog({
|
|
onShow:function() {
|
|
$.post("@Url.Action("BanTarget")", { id: id }).done(function(data) {
|
|
dlg.setState(data.ret ? "ok" : "block", data.ret ? "操作成功" : "操作失败");
|
|
|
|
if (data.ret) {
|
|
$("#rlist tr[data-target='" + data.user + "']").remove();
|
|
row.remove();
|
|
}
|
|
|
|
dlg.autoCloseDialog(500);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|