<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="referrer" content="never">
|
<title>分区搜索专题</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<script src="js/vue.min.js"></script>
|
<![endif]-->
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
<!-- <dt>
|
<div class="tubiao"><span class="glyphicon glyphicon-pencil"></span></div>
|
数据</dt>-->
|
</dl>
|
</div>
|
<div id="neirong">
|
<div class="erjidh">
|
<table class="table">
|
<tbody>
|
<tr>
|
<td class="xiala">
|
<select id="classtype" name="select" class="form-control">
|
</select>
|
</td>
|
<td class="xiala">
|
<select id="appclass" name="select" class="form-control">
|
<option value="">全部</option>
|
</select>
|
</td>
|
<td>
|
<form class="form-inline" role="form">
|
<div class="form-group" role="search">
|
<input type="text" id="search-text" class="form-control" style="width:200px;"
|
placeholder="搜索">
|
</div>
|
<button type="button" id="search" class="btn btn-default">搜索</button>
|
</form>
|
</td>
|
<td>
|
<div class="tianjia">
|
<a href="edit-recommend-banner.html" class="btn btn-primary" type="button">添加内容 +</a>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<div class="bottom" style="display: none;">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" value="#" name="checkAll" onclick="checkAll(this)">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-warning" type="button" name='delVideos' data-container="body" data-toggle="popover"
|
data-placement="right">批量删除
|
</button>
|
<ul class="pagination">
|
<li class="disabled">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</a>
|
</li>
|
<li>
|
<a href="#">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
<div class="zhuti">
|
<div class="zhutisousuo">
|
<table class="table">
|
<thead>
|
<tr>
|
<th width="7%">选择</th>
|
<th width="7%">编号</th>
|
<th width="7%">名称</th>
|
<th width="7%">标识</th>
|
<th width="5%">展现列数</th>
|
<th width="19%">备注</th>
|
<th width="15%">创建时间</th>
|
<th width="15%">更新时间</th>
|
<th width="7%">删除</th>
|
<th width="7%">编辑</th>
|
</tr>
|
</thead>
|
</table>
|
</div>
|
<div class="liebiao">
|
<table class="table">
|
<tbody>
|
<tr v-for="(item,index) in list">
|
<td width="7%">
|
<div class="xuanze"><label><input type="checkbox" name="videoName" :value="item.id"></label>
|
</div>
|
</td>
|
<td width="7%">
|
<div>{{item.id}}</div>
|
</td>
|
<td width="7%">
|
<div>{{item.name}}</div>
|
</td>
|
<td width="7%">
|
<div>{{item.key}}</div>
|
</td>
|
|
<td width="5%">
|
<div>{{item.column}}</div>
|
</td>
|
|
<td width="19%">
|
<div>{{item.remarks}}</div>
|
</td>
|
|
<td width="15%">
|
<div>{{item.createTime}}</div>
|
</td>
|
|
<td width="15%">
|
<div>{{item.updateTime}}</div>
|
</td>
|
<td width="7%">
|
<div class="anniu"><img onclick="delVideo(453)" src="image/dustbin.png" data-toggle="modal"
|
data-target="#myModal"></div>
|
</td>
|
<td width="7%">
|
<div class="anniu"><a href="edit-recommend-banner.html?key=453"><img src="image/bianji.png"></a>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
<div class="bottom">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" value="#" name="checkAll" onclick="checkAll(this)">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-warning" type="button" name='delVideos'>批量删除</button>
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li>
|
<a href="#" class="next">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" id="customPage" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script src="js/jquery.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/page.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="layer/layer.js"></script>
|
|
<script>
|
var allSystems;
|
$(function () {
|
|
var app = new Vue({
|
el: "",
|
data: {
|
list: []
|
},
|
methods: {
|
getList: function (key, page) {
|
$.post("api/class/getAllFirstClass", {
|
key: key,
|
page: page
|
}, function (data) {
|
|
}, 'json');
|
},
|
delete: function () {
|
layer.confirm('您确定要删除?', {
|
btn: ['否', '是'] //按钮
|
}, function (index) {
|
layer.close(index);
|
return false;
|
}, function () {
|
var ids = "" + iid + "";
|
$.post("api/class/deleteCategoryRecommendVideo", {'ids': ids}, function (data) {
|
if (data == "yes") {
|
getData(1);
|
}
|
}, 'text');
|
});
|
},
|
edit: function () {
|
|
},
|
|
}
|
});
|
});
|
</script>
|
<script>
|
|
function set(obj) {
|
var appid = $(obj).attr("name");
|
var key = $(obj).attr("key");
|
var ck = $(obj).context.checked;
|
var type = ck ? "add" : "delete";
|
|
$.post("api/class/CategoryRecommendVideoAdminServlet", {
|
'type': type,
|
'id': key,
|
'systemid': appid
|
}, function (data) {
|
if ("yes" == data) {
|
if (ck) {
|
layer.msg("添加成功!");
|
} else {
|
layer.msg("删除成功!");
|
}
|
}
|
}, 'text');
|
}
|
|
function jump() {
|
var val = $("#customPage").val();
|
var reg = new RegExp("^[0-9]*$");
|
if (reg.test(val)) {
|
getData(val);
|
} else {
|
layer.msg("请输入一个正整数!");
|
}
|
}
|
|
|
function delVideo(iid) {
|
|
layer.confirm('您确定要删除?', {
|
btn: ['否', '是'] //按钮
|
}, function (index) {
|
layer.close(index);
|
return false;
|
}, function () {
|
var ids = "" + iid + "";
|
$.post("api/class/deleteCategoryRecommendVideo", {'ids': ids}, function (data) {
|
if (data == "yes") {
|
getData(1);
|
}
|
}, 'text');
|
});
|
}
|
|
function getData(pageIndex) {
|
var keyText = $("#search-text").val();
|
var classTypeVal = $("#classtype").val();
|
var detailsystem = $("#appclass").val();
|
$.post("api/class/getseachList", {
|
'key': keyText,
|
'page': pageIndex,
|
'videotype': classTypeVal,
|
'detailsystem': detailsystem
|
}, function (data) {
|
if (data.code == 0) {
|
//var len = (data.pageEntity.pageSize < data.pageEntity.totalCount) ? data.pageEntity.pageSize : data.pageEntity.totalCount;
|
setData(data, pageIndex);
|
fillPage(data.pageEntity, function (page) {
|
getData(page);
|
});
|
}
|
}, 'json');
|
}
|
|
function checkAll(obj) {
|
if (obj.checked) {
|
$("input[name='videoName']").prop('checked', true)
|
} else {
|
$("input[name='videoName']").prop('checked', false)
|
}
|
};
|
|
function setData(data, pageIndex) {
|
$(".liebiao").empty();
|
pageIndex = pageIndex - 1; //
|
var pageSize = data.pageEntity.pageSize;
|
var totalCount = data.pageEntity.totalCount;
|
var len = (pageSize < totalCount - (pageIndex * pageSize)) ? pageSize : totalCount - (pageIndex * pageSize);
|
var ll = len;
|
len = (pageIndex * pageSize) + len;
|
var ii = pageIndex * pageSize;
|
for (var qq = 0; ii < len && ii < totalCount; ii++, qq++) {
|
var info = data.crv[qq].categoryRecommendVideo.categoryRecommendVideo.videoInfo;
|
var id = data.crv[qq].categoryRecommendVideo.categoryRecommendVideo.id;
|
var name = info.name;
|
var timeMS = info.createtime;
|
var mydate = new Date(parseInt(timeMS)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
|
var picture = data.crv[qq].categoryRecommendVideo.categoryRecommendVideo.picture;
|
$(".liebiao").append("<table class='table'>" +
|
"<tbody>" +
|
"<tr>" +
|
"<td width='7%'>" +
|
"<div class='xuanze'>" +
|
"<label>" +
|
"<input type='checkbox' name='videoName' value='" + id + "'>" +
|
"</label>" +
|
"</div>" +
|
"</td>" +
|
"<td width='7%'>" +
|
"<div class='bianhao' id='" + id + "'>" + id + "</div>" +
|
"</td>" +
|
"<td width='15%'>" +
|
"<div class='bianhao' name='" + name + "'>" + name + "</div>" +
|
"</td>" +
|
"<td width='23%'>" +
|
"<div class='tupian-banner'><img alt src='" + picture + "' style='width:240px;'></div>" +
|
"</td>" +
|
"<td width='19%' name='apptd'>" +
|
"</td>" +
|
"<td width='15%' style='text-align:center; line-height:105px;'>" + mydate + "</td>" +
|
"<td width='7%'>" +
|
"<div class='anniu'><img onclick='delVideo(" + id + ")' src='image/dustbin.png' data-toggle='modal' data-target='#myModal'/>" +
|
"</div>" +
|
"</td>" +
|
"<td width='7%'>" +
|
"<div class='anniu'>" +
|
"<a href='edit-recommend-banner.html?key=" + id + "'><img src='image/bianji.png'></a>" +
|
"</div>" +
|
"</td>" +
|
"</tr>" +
|
"</tbody>" +
|
"</table>" +
|
"<hr>");
|
}
|
var apptd = $("td[name='apptd']");
|
for (var index in allSystems) {
|
var edata = allSystems[index];
|
apptd.append("<div class='appname'>" +
|
"<div class='checkbox'>" +
|
"<label>" +
|
"<input type='checkbox' name='" + edata.id + "' onclick='set(this)' value='#'>" +
|
" " + edata.name + "</label>" +
|
"</div>" +
|
"</div>");
|
}
|
var mm = 0;
|
for (; mm < ll; mm++) {
|
var nn = 0;
|
data.crv[mm].detailSystemList.forEach(function () {
|
var appid = data.crv[mm].detailSystemList[nn].detailSystem.id;
|
var sele = data.crv[mm].detailSystemList[nn].selected;
|
var id = data.crv[mm].categoryRecommendVideo.categoryRecommendVideo.id;
|
$(".appname .checkbox input[name='" + appid + "']").eq(mm).prop("checked", sele);
|
$(".appname .checkbox input[name='" + appid + "']").eq(mm).attr("key", id);
|
nn++;
|
});
|
}
|
}
|
</script>
|
</body>
|
|
</html>
|