<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">
|
<style>
|
.search {
|
display: inline;
|
width: auto;
|
}
|
|
.h-picture {
|
|
width: 120px;
|
}
|
|
.v-picture {
|
height: 120px;
|
}
|
|
.form-group {
|
margin-bottom: 20px;
|
}
|
|
.bianhao {
|
margin: 0;
|
}
|
</style>
|
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top">
|
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
|
</div>
|
<div id="neirong">
|
<div class="erjidh search-div" style="padding: 10px;">
|
|
<select name="select" class="form-control search select-state">
|
|
<option value="-1">全部</option>
|
<option value="1">显示</option>
|
<option value="0">隐藏</option>
|
|
</select>
|
|
<div class="form-group search" role="search">
|
<input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索">
|
</div>
|
<button type="button" class="btn btn-default search-button">搜索</button>
|
|
<div class="tianjia" class="search">
|
<a href="tvlive_channel_add.html" class="btn btn-primary" role="button">添加频道 +</a>
|
</div>
|
|
</div>
|
<div class="bottom">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" class="check-all" value="#">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-primary pl-add-to-category" type="button">添加到分类</button>
|
<button class="btn btn-warning pl-del" type="button">批量删除</button>
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</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" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<div class="zhuti">
|
<div class="zhutisousuo">
|
<table class="table">
|
<thead>
|
<th width="5%">选择</th>
|
<th width="10%">编号</th>
|
<th width="9%">频道名称</th>
|
<th width="9%">封面横图</th>
|
<th width="9%">封面竖图</th>
|
<th width="9%">当前节目信息</th>
|
<th width="9%">下个节目信息</th>
|
<th width="8%">状态</th>
|
<th width="12%">创建时间</th>
|
<th width="12%">更新时间</th>
|
<th width="12%">操作</th>
|
<th width="5%">删除</th>
|
<th width="5%">编辑</th>
|
</thead>
|
|
<tbody>
|
<tr v-for="(item,index) in list">
|
<td>
|
<div class="xuanze">
|
<label>
|
<input type="checkbox" class="check-item" v-bind:keys="item.id"
|
value="#">
|
</label>
|
</div>
|
</td>
|
<td>
|
<div class="bianhao">{{item.id}}</div>
|
</td>
|
<td>
|
<div class="bianhao name">
|
<a href="#">{{item.name}}</a>
|
</div>
|
</td>
|
|
<td>
|
<img class="h-picture" v-bind:src="item.hPicture" v-if="item.hPicture">
|
</td>
|
|
<td>
|
<img class="v-picture" v-bind:src="item.vPicture" v-if="item.vPicture">
|
</td>
|
|
|
<td>
|
<div class="bianhao">
|
{{item.nowProgramTime}}
|
<br>
|
{{item.nowProgram}}
|
</div>
|
</td>
|
|
<td>
|
<div class="bianhao">
|
{{item.nextProgramTime}}
|
<br>
|
{{item.nextProgram}}
|
</div>
|
</td>
|
|
<td>{{item.state==1?'显示':'隐藏'}}</td>
|
<td class="">{{item.createTime}}</td>
|
<td class="">{{item.updateTime}}</td>
|
|
<td class="">
|
|
<!--<div class="btn btn-primary" v-on:click="showCategorySelect(item.id)">添加到分类</div>-->
|
<!--<div class="btn btn-primary" style="margin-top: 10px;" v-on:click="showCategorySelect(item.id)">来源管理</div>-->
|
<!-- Single button -->
|
<div class="btn-group">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
操作 <span class="caret"></span>
|
</button>
|
<ul class="dropdown-menu">
|
<li><a href="#" v-on:click="showCategorySelect(item.id)">添加到分类</a></li>
|
<li><a v-bind:href="'tvlive_channel_resource.html?id='+item.id">来源管理</a></li>
|
</ul>
|
</div>
|
|
|
</td>
|
<td>
|
<div class="anniu"><img src="image/dustbin.png" class="delete"
|
v-on:click="deleteSpecial(item.id,index)">
|
</div>
|
</td>
|
<td>
|
<div class="anniu">
|
<a v-bind:keys="item.id" href="javascript:void(0)" class="edit"
|
v-on:click="edit(item.id)"><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" class="check-all" value="#">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-primary pl-add-to-category" type="button">添加到分类</button>
|
<button class="btn btn-warning pl-del" type="button">批量删除</button>
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</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" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
|
|
<!-- 分类选择 -->
|
<div class="modal fade" id="categoryDialog" tabindex="-1" role="dialog" aria-hidden="true" style="width: ">
|
<input type="hidden" class="channelids"/>
|
<div class="modal-dialog">
|
<div class="modal-content" style="width: 500px;margin: 0 auto">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<h4 class="modal-title" id="myModalLabel">分类选择</h4>
|
</div>
|
<div class="modal-body ">
|
<div class="form-horizontal">
|
<div class="form-group">
|
<label for="input1" class="changdu1 control-label col-sm-2">分类</label>
|
<div class="col-sm-10">
|
<select class="form-control category">
|
<option>分类1</option>
|
</select>
|
</div>
|
|
</div>
|
<div class="form-group">
|
<label for="input1" class="changdu1 control-label col-sm-2">权重</label>
|
<div class="col-sm-10">
|
<input type="text" class="form-control weight" placeholder="可不填写">
|
</div>
|
|
</div>
|
</div>
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
<button type="button" class="btn btn-primary">确定</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
|
<script src="js/jquery-1.9.1.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/page.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="js/common.js"></script>
|
<script src="js/vue.min.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
$(function () {
|
|
var app = new Vue({
|
el: "#neirong",
|
data: {
|
list: [],
|
},
|
methods: {
|
specialList: function (page) {
|
var index = layer.load(1, {
|
shade: false
|
})
|
|
var data = {
|
"page": page,
|
"key": $("#kw").val()
|
};
|
if (parseInt($(".search-div .select-state").val()) > 0) {
|
data.state = $(".search-div .select-state").val();
|
}
|
|
$.post('api/tvlive/channel/getChannelList', data, function (data) {
|
layer.close(index);
|
if (data.code != 0)
|
return;
|
app.list = data.data.data;
|
|
fillPage(data.data.pageEntity, function (pageIndex) {
|
app.specialList(pageIndex);
|
});
|
}, 'json');
|
},
|
changeSuper: function (id, detailSystemId, e) {
|
if ($(e.target).is(":checked")) {
|
$.post('api/homerecommend/addSuperSpecial', {
|
"id": id,
|
"detailSystemId": detailSystemId
|
}, function (data) {
|
if (data.code != 0) {
|
layer.msg(data.msg);
|
} else {
|
layer.msg("操作成功");
|
}
|
}, 'json');
|
} else {
|
$.post('api/homerecommend/deleteSuperSpecial', {
|
"id": id,
|
"detailSystemId": detailSystemId
|
}, function (data) {
|
if (data.code != 0) {
|
layer.msg(data.msg);
|
} else {
|
layer.msg("操作成功");
|
}
|
}, 'json');
|
}
|
},
|
deleteSpecial: function (id, index) {
|
var indexDialog = layer.confirm('是否删除该条目?', {
|
btn: ['是', '否'] //按钮
|
}, function () {
|
$.post('api/homerecommend/deleteSpcial', {
|
'ids': id
|
}, function (data) {
|
layer.close(indexDialog);
|
if (data.code == 0) {
|
if (index > -1) {
|
app.list.splice(index, 1);
|
} else {
|
var ids = id.split(",");
|
console.log(ids);
|
for (var i = 0; i < ids.length; i++) {
|
for (var j = 0; j < app.list.length; j++) {
|
console.log(app.list[j].special.id + ":" + ids[i])
|
if (app.list[j].special.id == ids[i]) {
|
app.list.splice(j, 1);
|
break;
|
}
|
}
|
}
|
}
|
layer.msg("删除成功");
|
} else {
|
layer.msg(data.msg);
|
}
|
}, 'json');
|
}, function () {
|
|
});
|
},
|
edit: function (id) {
|
window.location.href = "edit-tuijian-home-labels.html?id=" + id;
|
},
|
showCategorySelect: function (ids) {
|
$("#categoryDialog .btn-primary").unbind();
|
$("#categoryDialog .channelids").val(ids);
|
$("#categoryDialog .btn-primary").bind("click", function () {
|
var data = {
|
channelIds: ids,
|
categoryId: $("#categoryDialog select").val()
|
};
|
if ($("#categoryDialog .weight").val()) {
|
data.weight = $("#categoryDialog .weight").val();
|
}
|
|
$.post('api/tvlive/channel/addCategoryChannel', data, function (data) {
|
if (data.code == 0) {
|
layer.msg("添加成功")
|
} else {
|
layer.msg(data.msg);
|
}
|
}, 'json');
|
})
|
$("#categoryDialog").modal("show");
|
},
|
|
getCategorys: function () {
|
$.post('api/tvlive/category/getCategoryList', {page: 1}, function (data) {
|
if (data.code != 0)
|
return;
|
data = data.data.data;
|
$("#categoryDialog .category").empty();
|
for (var i = 0; i < data.length; i++) {
|
$("#categoryDialog .category").append("<option value='" + data[i].category.id + "'>" + data[i].category.name + "</option>");
|
}
|
}, 'json');
|
|
}
|
}
|
|
|
});
|
|
$(".search-div .search-button").click(function () {
|
app.specialList(1);
|
});
|
|
app.specialList(1);
|
app.getCategorys();
|
|
function getCheckedItems() {
|
var ids = "";
|
for (var i = 0; i < $(".check-item").length; i++) {
|
if ($(".check-item").eq(i).is(':checked')) {
|
ids += $(".check-item").eq(i).attr("keys") + ",";
|
}
|
}
|
if (ids.length > 0)
|
ids = ids.substr(0, ids.length - 1);
|
return ids;
|
}
|
|
$(".check-all").change(function () {
|
if (this.checked) {
|
$(".check-item").each(function () {
|
this.checked = true;
|
})
|
}
|
else {
|
$(".check-item").each(function () {
|
this.checked = false;
|
})
|
}
|
});
|
|
$(".pl-del").click(function () {
|
var ids = getCheckedItems();
|
if (ids.length < 1) {
|
layer.msg("请选择栏目");
|
return;
|
}
|
|
app.deleteSpecial(ids, -1);
|
|
});
|
|
|
$(".pl-add-to-category").click(function () {
|
var ids = getCheckedItems();
|
if (ids.length < 1) {
|
layer.msg("请选择栏目");
|
return;
|
}
|
app.showCategorySelect(ids);
|
});
|
|
|
});
|
</script>
|
|
</body>
|
|
</html>
|