JXMovies/CMS/JXCMS.CMS.Movie/Admin/Views/Collection/Index.cshtml

242 lines
11 KiB
Plaintext
Raw Normal View History

2020-02-09 19:10:05 +08:00
@using JXCMS.CMS.Movie.Entity
<div class="container-fluid p-t-15">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-toolbar clearfix">
<form class="pull-right search-bar" method="get" action="#!" role="form">
<div class="input-group">
<div class="input-group-btn">
<input type="hidden" name="search_field" id="search-field" value="title">
<button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
标题 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a tabindex="-1" href="javascript:void(0)" data-field="title">标题</a>
</li>
<li>
<a tabindex="-1" href="javascript:void(0)" data-field="cat_name">栏目</a>
</li>
</ul>
</div>
<input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
</div>
</form>
<div class="toolbar-btn-action">
2020-02-10 22:30:27 +08:00
<a data-src="@Url.Action("WebSiteDialog", "Collection", new {id = 0})" class="btn btn-primary m-r-5" id="new" data-toggle="modal" data-target="#exampleModal"><i class="mdi mdi-plus"></i> 新增</a>
<a class="btn btn-success m-r-5" onclick="enableWebsiteBatch()"><i class="mdi mdi-check"></i> 启用</a>
<a class="btn btn-warning m-r-5" onclick="disableWebsiteBatch()"><i class="mdi mdi-block-helper"></i> 禁用</a>
<a class="btn btn-danger" onclick="delWebsiteBatch()"><i class="mdi mdi-window-close"></i> 删除</a>
2020-02-09 19:10:05 +08:00
</div>
</div>
<div class="card-body">
<div class="table-responsive">
2020-02-10 22:30:27 +08:00
<form id="batchForm" action="#" method="post">
<table class="table table-bordered">
<thead>
2020-02-09 19:10:05 +08:00
<tr>
2020-02-10 22:30:27 +08:00
<th>
2020-02-09 19:10:05 +08:00
<label class="lyear-checkbox checkbox-primary">
2020-02-10 22:30:27 +08:00
<input type="checkbox" id="check-all"><span></span>
2020-02-09 19:10:05 +08:00
</label>
2020-02-10 22:30:27 +08:00
</th>
<th>网站名称</th>
<th>网站url</th>
<th>采集cron</th>
<th>状态</th>
<th>操作</th>
2020-02-09 19:10:05 +08:00
</tr>
2020-02-10 22:30:27 +08:00
</thead>
<tbody>
@foreach (WebSiteEntity webSiteEntity in ViewBag.website)
{
<tr>
<td>
<label class="lyear-checkbox checkbox-primary">
<input type="checkbox" name="ids[]" value="@webSiteEntity.Id"><span></span>
</label>
</td>
<td>@webSiteEntity.WebSiteName</td>
<td>@webSiteEntity.ApiUrl</td>
<td>@webSiteEntity.Cron</td>
<td>
<span class="text-success">@(webSiteEntity.IsEnable ? "正常" : "已禁用")</span>
</td>
<td>
<div class="btn-group">
<a class="btn btn-xs btn-default" data-src="@Url.Action("WebSiteDialog", "Collection", new {id = webSiteEntity.Id})" title="编辑" data-toggle="modal" data-target="#exampleModal">
<i class="mdi mdi-pencil"></i>
</a>
2020-02-12 15:23:34 +08:00
<a class="btn btn-xs btn-default" href="#" title="绑定分类" onclick="delWebsite(@webSiteEntity.Id, '@webSiteEntity.WebSiteName')">
<i class="mdi mdi-link-variant"></i>
</a>
<a class="btn btn-xs btn-default" href="#" title="删除" onclick="delWebsite(@webSiteEntity.Id, '@webSiteEntity.WebSiteName')">
2020-02-10 22:30:27 +08:00
<i class="mdi mdi-window-close"></i>
</a>
</div>
</td>
</tr>
}
</tbody>
</table>
</form>
2020-02-09 19:10:05 +08:00
</div>
<ul class="pagination">
2020-02-10 22:30:27 +08:00
@if (ViewBag.pageNumber != 1)
{
<li>
<a href="@Url.Action("Index", "Collection")">&lt;&lt;</a>
</li>
}
@for (int i = ViewBag.pageNumber - 3; i < ViewBag.pageNumber + 3; i++)
{
if (i < 1 || i > ViewBag.totlePage)
{
continue;
}
if (i == ViewBag.pageNumber)
{
<li class="active">
<span>@i</span>
</li>
}
else
{
<li>
<a href="@Url.Action("Index", "Collection", new {pageNumber = i})">@i</a>
</li>
}
}
@if (ViewBag.pageNumber < ViewBag.totlePage)
{
<li>
<a href="@Url.Action("Index", "Collection", new {pageNumber = ViewBag.totlePage})">&gt;&gt;</a>
</li>
}
2020-02-09 19:10:05 +08:00
</ul>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
正在加载,请稍后...
</div>
</div>
</div>
2020-02-10 22:30:27 +08:00
<form id="delForm" action="@Url.Action("DeleteWebSite")" method="post">
<input type="hidden" name="id" id="delId"/>
</form>
2020-02-09 19:10:05 +08:00
</div>
2020-02-10 22:30:27 +08:00
2020-02-09 22:43:16 +08:00
@section style
{
<link rel="stylesheet" href="@Url.ContentAdmin("js/jconfirm/jquery-confirm.min.css")">
}
2020-02-09 19:10:05 +08:00
@section script
{
<script src="@Url.ContentAdmin("js/bootstrap-notify.min.js")"></script>
2020-02-10 22:30:27 +08:00
<script type="text/javascript" src="@Url.ContentAdmin("js/lightyear.js")"></script>
2020-02-09 22:43:16 +08:00
<script type="text/javascript" src="@Url.ContentAdmin("js/Validate.js")"></script>
<script src="@Url.ContentAdmin("js/jconfirm/jquery-confirm.min.js")"></script>
<script>
2020-02-10 22:30:27 +08:00
$('#exampleModal').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget); // Button that triggered the modal
var recipient = button.data('src'); // Extract info from data-* attributes
var content = $(this).find(".modal-content");
content.html("正在加载,请稍后...");
$.get(recipient, function(data, status) {
if (status === "success") {
content.html(data)
} else{
content.html("发生错误,请重试")
}
})
2020-02-09 22:43:16 +08:00
});
2020-02-10 22:30:27 +08:00
function delWebsite(id, name) {
2020-02-09 22:43:16 +08:00
$.alert({
2020-02-10 22:30:27 +08:00
title: '删除采集地址' + name,
content: '是否删除' + name + '?该操作不可恢复',
2020-02-09 22:43:16 +08:00
buttons: {
confirm: {
2020-02-10 22:30:27 +08:00
text: '是',
2020-02-09 22:43:16 +08:00
btnClass: 'btn-primary',
action: function(){
2020-02-10 22:30:27 +08:00
$('#delId').val(id);
$('#delForm').submit();
2020-02-09 22:43:16 +08:00
}
},
cancel: {
2020-02-10 22:30:27 +08:00
text: '否'
2020-02-09 22:43:16 +08:00
}
}
});
}
2020-02-10 22:30:27 +08:00
function delWebsiteBatch() {
$.alert({
title: '批量删除采集地址',
content: '是否要批量删除选中的采集地址?该操作不可恢复',
buttons: {
confirm: {
text: '是',
btnClass: 'btn-primary',
action: function(){
$('#batchForm').attr('action', '@Url.Action("DeleteWebSiteBatch")').submit();
}
},
cancel: {
text: '否'
}
}
});
}
function enableWebsiteBatch() {
$.alert({
title: '批量启用采集地址',
content: '是否要批量启用选中的采集地址?',
buttons: {
confirm: {
text: '是',
btnClass: 'btn-primary',
action: function(){
$('#batchForm').attr('action', '@Url.Action("EnableWebSiteBatch")').submit();
}
},
cancel: {
text: '否'
}
}
});
}
function disableWebsiteBatch() {
$.alert({
title: '批量禁用采集地址',
content: '是否要禁用删除选中的采集地址?',
buttons: {
confirm: {
text: '是',
btnClass: 'btn-primary',
action: function(){
$('#batchForm').attr('action', '@Url.Action("DisableWebSiteBatch")').submit();
}
},
cancel: {
text: '否'
}
}
});
}
2020-02-09 22:43:16 +08:00
</script>
2020-02-09 19:10:05 +08:00
}