update
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<script src="/js/jquery-3.2.1.js"></script>
|
||||
<script src="/js/CommonConfig.js"></script>
|
||||
<script>
|
||||
headerModel=2;
|
||||
headerModel=3;
|
||||
$('#header').load("/html/header.html");
|
||||
</script>
|
||||
|
||||
|
||||
164
Web/html/body/live.html
Normal file
164
Web/html/body/live.html
Normal file
@@ -0,0 +1,164 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>视频管理</title>
|
||||
<link rel="stylesheet" href="/layui/css/layui.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header"></div>
|
||||
<table class="layui-hide" id="roomList" lay-filter="roomTable"></table>
|
||||
</body>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" onclick="createRoom()">添加新房间</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="toolDemo">
|
||||
<div class="layui-clear-space">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="more">
|
||||
更多
|
||||
<i class="layui-icon layui-icon-down"></i>
|
||||
</a>
|
||||
</div>
|
||||
</script>
|
||||
<script src="/layui/layui.js"></script>
|
||||
<script src="/js/jquery-3.2.1.js"></script>
|
||||
<script src="/js/CommonConfig.js"></script>
|
||||
<script src="/js/httpUtils.js"></script>
|
||||
|
||||
<script>
|
||||
headerModel = 1;
|
||||
$('#header').load("/html/header.html");
|
||||
</script>
|
||||
<script>
|
||||
function createRoom(roomId) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "添加新房间",
|
||||
area: ['600px', '500px'],
|
||||
content: '/html/ui/createConfig.html?roomId=' + roomId
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
layui.use(['table', 'dropdown'], function () {
|
||||
var table = layui.table;
|
||||
var dropdown = layui.dropdown;
|
||||
|
||||
// 创建渲染实例
|
||||
table.render({
|
||||
elem: '#roomList',
|
||||
url: '/live/config/all',
|
||||
toolbar: '#toolbarDemo',
|
||||
|
||||
totalRow: true, // 开启合计行
|
||||
page: true,
|
||||
response: {
|
||||
statusCode: 100 // 重新规定成功的状态码为 200,table 组件默认为 0
|
||||
},
|
||||
parseData: function (res) {
|
||||
return {
|
||||
"code": res.status, //解析接口状态
|
||||
"msg": res.message, //解析提示文本
|
||||
"data": res.data, //解析数据列表
|
||||
"count": res.count
|
||||
};
|
||||
},
|
||||
cols: [[
|
||||
{ type: 'checkbox', fixed: 'left' },
|
||||
{ field: 'anchorUid', title: 'UID', width: 100, sort: true, fixed: 'left', templet: '<div><a href="https://space.bilibili.com/{{= d.anchorUid}}" target="_blank">{{= d.anchorUid}}</a>' },
|
||||
{ field: 'anchorName', title: '用户名', width: 100, fixed: 'left' },
|
||||
{ field: 'anchorFace', title: '头像', width: 80, templet: '<div><image src="" onerror="showImage(\'{{= d.anchorFace }}\',this);" style="width: 30px;height: 30px;"></div>' },
|
||||
{ field: 'live_room_id', title: '房间号', width: 80, templet: '<div><a href="https://live.bilibili.com/{{= d.live_room_id}}" target="_blank">{{= d.live_room_id}}</a>' },
|
||||
{ field: 'recordPath', title: '保存路径', width: 120 },
|
||||
{ field: 'recordDanmu', title: '录制弹幕', width: 120, sort: true },
|
||||
{ field: 'recordLive', title: '录制视频', width: 120, sort: true },
|
||||
{ field: 'recordDanmuDate', title: '弹幕录制预定时间', width: 100, sort: true },
|
||||
{ field: 'recordLiveDate', title: '视频录制预定时间', width: 100, sort: true },
|
||||
{ field: 'recordUid', title: '录制账号', width: 120, sort: true, templet: '<div><a href="https://space.bilibili.com/{{= d.recordUid}}" target="_blank">{{= d.recordUid}}</a>' },
|
||||
{ field: 'recordDanmu', title: '录制弹幕', width: 120, sort: true },
|
||||
{ field: 'sql_time', title: '添加时间', width: 100 },
|
||||
{ fixed: "right", title: "操作", width: 190, align: "center", toolbar: "#toolDemo" }
|
||||
]],
|
||||
done: function () {
|
||||
done();
|
||||
},
|
||||
error: function (res, msg) {
|
||||
console.log(res, msg)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function done() {
|
||||
// 工具栏事件
|
||||
table.on('toolbar(roomTable)', function (obj) {
|
||||
var id = obj.config.id;
|
||||
var checkStatus = table.checkStatus(id);
|
||||
var othis = lay(this);
|
||||
switch (obj.event) {
|
||||
case 'getCheckData':
|
||||
var data = checkStatus.data;
|
||||
layer.alert(layui.util.escape(JSON.stringify(data)));
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
// 触发单元格工具事件
|
||||
table.on('tool(roomTable)', function (obj) { // 双击 toolDouble
|
||||
var data = obj.data; // 获得当前行数据
|
||||
console.log(obj)
|
||||
if (obj.event === 'edit') {
|
||||
createRoom(obj.data.live_room_id)
|
||||
} else if (obj.event === 'more') {
|
||||
// 更多 - 下拉菜单
|
||||
dropdown.render({
|
||||
elem: this, // 触发事件的 DOM 对象
|
||||
show: true, // 外部事件触发即显示
|
||||
data: [{
|
||||
title: '查看',
|
||||
id: 'detail'
|
||||
}, {
|
||||
title: '删除',
|
||||
id: 'del'
|
||||
}],
|
||||
click: function (menudata) {
|
||||
if (menudata.id === 'detail') {
|
||||
layer.msg('查看操作,当前行 ID:' + data.live_room_id);
|
||||
} else if (menudata.id === 'del') {
|
||||
layer.confirm('真的删除行 [' + data.anchorName + '] 么', function (index) {
|
||||
deleteRoomConfig(data.live_room_id)
|
||||
.then(data => {
|
||||
layer.msg(data.message)
|
||||
if (data.status == 100) {
|
||||
obj.del(); // 删除对应行(tr)的DOM结构
|
||||
layer.close(index);
|
||||
}
|
||||
})
|
||||
|
||||
// 向服务端发送删除指令
|
||||
});
|
||||
}
|
||||
},
|
||||
align: 'right', // 右对齐弹出
|
||||
style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' // 设置额外样式
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
</html>
|
||||
@@ -38,7 +38,7 @@
|
||||
<script src="/js/jquery-3.2.1.js"></script>
|
||||
<script src="/js/CommonConfig.js"></script>
|
||||
<script>
|
||||
headerModel=3;
|
||||
headerModel=4;
|
||||
$('#header').load("/html/header.html");
|
||||
|
||||
layui.use(['form', 'laytpl'], function () {
|
||||
|
||||
@@ -1,164 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>视频管理</title>
|
||||
<title>视频中心</title>
|
||||
<link rel="stylesheet" href="/layui/css/layui.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header"></div>
|
||||
<table class="layui-hide" id="roomList" lay-filter="roomTable"></table>
|
||||
<body>
|
||||
<div id="view"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" onclick="createRoom()">添加新房间</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="toolDemo">
|
||||
<div class="layui-clear-space">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="more">
|
||||
更多
|
||||
<i class="layui-icon layui-icon-down"></i>
|
||||
</a>
|
||||
</div>
|
||||
<script id="demo" type="text/html">
|
||||
<h3>{{ d.title }}</h3>
|
||||
<ul>
|
||||
{{# layui.each(d.list, function(index, item){ }}
|
||||
<li>
|
||||
<span>{{ item.modname }}</span>
|
||||
<span>{{ item.alias }}:</span>
|
||||
<span>{{ item.site || '' }}</span>
|
||||
</li>
|
||||
{{# }); }}
|
||||
{{# if(d.list.length === 0){ }}
|
||||
无数据
|
||||
{{# } }}
|
||||
</ul>
|
||||
</script>
|
||||
|
||||
<script src="/layui/layui.js"></script>
|
||||
<script src="/js/jquery-3.2.1.js"></script>
|
||||
<script src="/js/CommonConfig.js"></script>
|
||||
<script src="/js/httpUtils.js"></script>
|
||||
|
||||
<script>
|
||||
headerModel = 1;
|
||||
headerModel=2;
|
||||
$('#header').load("/html/header.html");
|
||||
|
||||
layui.use(['form', 'laytpl'], function () {
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
var laytpl = layui.laytpl
|
||||
var data = { //数据
|
||||
"title":"Layui常用模块"
|
||||
,"list":[{"modname":"弹层","alias":"layer","site":"layer.layui99.com"},{"modname":"表单","alias":"form"}]
|
||||
}
|
||||
var getTpl = $("#demo").get(0).innerHTML
|
||||
,view = document.getElementById('view');
|
||||
laytpl(getTpl).render(data, function(html){
|
||||
view.innerHTML = html;
|
||||
console.log(html)
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<script>
|
||||
function createRoom(roomId) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "添加新房间",
|
||||
area: ['500px', '400px'],
|
||||
content: '/html/ui/createConfig.html?roomId=' + roomId
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
layui.use(['table', 'dropdown'], function () {
|
||||
var table = layui.table;
|
||||
var dropdown = layui.dropdown;
|
||||
|
||||
// 创建渲染实例
|
||||
table.render({
|
||||
elem: '#roomList',
|
||||
url: '/live/config/all',
|
||||
toolbar: '#toolbarDemo',
|
||||
|
||||
totalRow: true, // 开启合计行
|
||||
page: true,
|
||||
response: {
|
||||
statusCode: 100 // 重新规定成功的状态码为 200,table 组件默认为 0
|
||||
},
|
||||
parseData: function (res) {
|
||||
return {
|
||||
"code": res.status, //解析接口状态
|
||||
"msg": res.message, //解析提示文本
|
||||
"data": res.data, //解析数据列表
|
||||
"count": res.count
|
||||
};
|
||||
},
|
||||
cols: [[
|
||||
{ type: 'checkbox', fixed: 'left' },
|
||||
{ field: 'anchorUid', title: 'UID', width: 100, sort: true, fixed: 'left', templet: '<div><a href="https://space.bilibili.com/{{= d.anchorUid}}" target="_blank">{{= d.anchorUid}}</a>' },
|
||||
{ field: 'anchorName', title: '用户名', width: 100, fixed: 'left' },
|
||||
{ field: 'anchorFace', title: '头像', width: 80, templet: '<div><image src="" onerror="showImage(\'{{= d.anchorFace }}\',this);" style="width: 30px;height: 30px;"></div>' },
|
||||
{ field: 'live_room_id', title: '房间号', width: 80, templet: '<div><a href="https://live.bilibili.com/{{= d.live_room_id}}" target="_blank">{{= d.live_room_id}}</a>' },
|
||||
{ field: 'recordPath', title: '保存路径', width: 120 },
|
||||
{ field: 'recordDanmu', title: '录制弹幕', width: 120, sort: true },
|
||||
{ field: 'recordLive', title: '录制视频', width: 120, sort: true },
|
||||
{ field: 'recordDanmuDate', title: '弹幕录制预定时间', width: 100, sort: true },
|
||||
{ field: 'recordLiveDate', title: '视频录制预定时间', width: 100, sort: true },
|
||||
{ field: 'recordUid', title: '录制账号', width: 120, sort: true, templet: '<div><a href="https://space.bilibili.com/{{= d.recordUid}}" target="_blank">{{= d.recordUid}}</a>' },
|
||||
{ field: 'recordDanmu', title: '录制弹幕', width: 120, sort: true },
|
||||
{ field: 'sql_time', title: '添加时间', width: 100 },
|
||||
{ fixed: "right", title: "操作", width: 190, align: "center", toolbar: "#toolDemo" }
|
||||
]],
|
||||
done: function () {
|
||||
done();
|
||||
},
|
||||
error: function (res, msg) {
|
||||
console.log(res, msg)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function done() {
|
||||
// 工具栏事件
|
||||
table.on('toolbar(roomTable)', function (obj) {
|
||||
var id = obj.config.id;
|
||||
var checkStatus = table.checkStatus(id);
|
||||
var othis = lay(this);
|
||||
switch (obj.event) {
|
||||
case 'getCheckData':
|
||||
var data = checkStatus.data;
|
||||
layer.alert(layui.util.escape(JSON.stringify(data)));
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
// 触发单元格工具事件
|
||||
table.on('tool(roomTable)', function (obj) { // 双击 toolDouble
|
||||
var data = obj.data; // 获得当前行数据
|
||||
console.log(obj)
|
||||
if (obj.event === 'edit') {
|
||||
createRoom(obj.data.live_room_id)
|
||||
} else if (obj.event === 'more') {
|
||||
// 更多 - 下拉菜单
|
||||
dropdown.render({
|
||||
elem: this, // 触发事件的 DOM 对象
|
||||
show: true, // 外部事件触发即显示
|
||||
data: [{
|
||||
title: '查看',
|
||||
id: 'detail'
|
||||
}, {
|
||||
title: '删除',
|
||||
id: 'del'
|
||||
}],
|
||||
click: function (menudata) {
|
||||
if (menudata.id === 'detail') {
|
||||
layer.msg('查看操作,当前行 ID:' + data.live_room_id);
|
||||
} else if (menudata.id === 'del') {
|
||||
layer.confirm('真的删除行 [' + data.anchorName + '] 么', function (index) {
|
||||
deleteRoomConfig(data.live_room_id)
|
||||
.then(data => {
|
||||
layer.msg(data.message)
|
||||
if (data.status == 100) {
|
||||
obj.del(); // 删除对应行(tr)的DOM结构
|
||||
layer.close(index);
|
||||
}
|
||||
})
|
||||
|
||||
// 向服务端发送删除指令
|
||||
});
|
||||
}
|
||||
},
|
||||
align: 'right', // 右对齐弹出
|
||||
style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' // 设置额外样式
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
<body>
|
||||
<ul class="layui-nav">
|
||||
<li class="layui-nav-item index"><a href="/index.html">监控大厅</a></li>
|
||||
<li class="layui-nav-item live"><a href="/html/body/live.html">直播管理</a></li>
|
||||
<li class="layui-nav-item video"><a href="/html/body/video.html">视频管理</a></li>
|
||||
<li class="layui-nav-item data" ><a href="/html/body/data.html">数据中心</a></li>
|
||||
<li class="layui-nav-item user"><a href="/html/body/user.html">用户中心</a></li>
|
||||
@@ -10,13 +11,15 @@
|
||||
|
||||
<script>
|
||||
$(".index").removeClass("layui-this")
|
||||
$(".live").removeClass("layui-this")
|
||||
$(".video").removeClass("layui-this")
|
||||
$(".data").removeClass("layui-this")
|
||||
$(".user").removeClass("layui-this")
|
||||
switch(headerModel){
|
||||
case 0:$(".index").addClass('layui-this');break;
|
||||
case 1:$(".video").addClass('layui-this');break;
|
||||
case 2:$(".data").addClass('layui-this');break;
|
||||
case 3:$(".user").addClass('layui-this');break;
|
||||
case 1:$(".live").addClass('layui-this');break;
|
||||
case 2:$(".video").addClass('layui-this');break;
|
||||
case 3:$(".data").addClass('layui-this');break;
|
||||
case 4:$(".user").addClass('layui-this');break;
|
||||
}
|
||||
</script>
|
||||
@@ -32,20 +32,20 @@
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">录制日期</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="2" title="周一" lay-skin="tag">
|
||||
<input type="checkbox" name="3" title="周二" lay-skin="tag">
|
||||
<input type="checkbox" name="4" title="周三" lay-skin="tag">
|
||||
<input type="checkbox" name="5" title="周四" lay-skin="tag">
|
||||
<input type="checkbox" name="6" title="周五" lay-skin="tag">
|
||||
<input type="checkbox" name="7" title="周六" lay-skin="tag">
|
||||
<input type="checkbox" name="1" title="周日" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_1" title="周一" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_2" title="周二" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_3" title="周三" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_4" title="周四" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_5" title="周五" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_6" title="周六" lay-skin="tag">
|
||||
<input type="checkbox" checked name="week_7" title="周日" lay-skin="tag">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">弹幕录制时间</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="recordDanmuDate" id="recordDanmuDate" lay-verify="required" autocomplete="off"
|
||||
class="layui-input">
|
||||
<input type="text" name="recordDanmuDate" id="recordDanmuDate" value="00:00:00 - 23:59:59"
|
||||
lay-verify="required" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-text-em" onclick="timeTips(this)"><i
|
||||
class="layui-icon layui-icon-help"></i> </div>
|
||||
@@ -53,8 +53,8 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">视频录制时间</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="recordLiveDate" id="recordLiveDate" lay-verify="required"
|
||||
autocomplete="off" class="layui-input">
|
||||
<input type="text" name="recordLiveDate" id="recordLiveDate" value="00:00:00 - 23:59:59"
|
||||
lay-verify="required" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-text-em" onclick="timeTips(this)"><i
|
||||
class="layui-icon layui-icon-help"></i> </div>
|
||||
@@ -90,7 +90,7 @@
|
||||
<script src="/js/CommonConfig.js"></script>
|
||||
<script>
|
||||
function timeTips(that) {
|
||||
layer.tips('填写[分钟][小时][星期],空格分割,例如预定每周6晚上8点之后才开始录制则填写:* 8 6', that);
|
||||
layer.tips('是从开始到结束时间范围内,主播开播会启动录制,超过结束范围不会中断正在录制的任务', that);
|
||||
}
|
||||
var roomId = getParam("roomId");
|
||||
|
||||
@@ -109,16 +109,24 @@
|
||||
|
||||
// 此处可执行 Ajax 等操作
|
||||
// …
|
||||
var weeks = [
|
||||
]
|
||||
for (let i = 1; i <= 7; i++) {
|
||||
if (field[`week_${i}`] === 'on') {
|
||||
weeks.push(i.toString());
|
||||
}
|
||||
}
|
||||
field.weeks = weeks;
|
||||
console.log(field)
|
||||
// addRoomConfig(field)
|
||||
// .then(json => {
|
||||
// layer.msg(json.message, function () {
|
||||
// if (json.status == 100) {
|
||||
// close()
|
||||
// }
|
||||
// })
|
||||
addRoomConfig(field)
|
||||
.then(json => {
|
||||
layer.msg(json.message, function () {
|
||||
if (json.status == 100) {
|
||||
close()
|
||||
}
|
||||
})
|
||||
|
||||
// })
|
||||
})
|
||||
|
||||
return false; // 阻止默认 form 跳转
|
||||
});
|
||||
@@ -159,13 +167,19 @@
|
||||
.then(data => {
|
||||
if (data.status === 100) {
|
||||
var json = data.data;
|
||||
form.val('form-filter', {
|
||||
var result = {
|
||||
'url': 'https://live.bilibili.com/' + json.live_room_id,
|
||||
'recordLive': json.recordLive,
|
||||
'recordDanmu': json.recordDanmu,
|
||||
'recordDanmuDate': json.recordDanmuDate,
|
||||
'recordLiveDate': json.recordLiveDate
|
||||
});
|
||||
'recordLiveDate': json.recordLiveDate,
|
||||
};
|
||||
|
||||
for (let i = 0; i < json.weeks.length; i++) {
|
||||
result[`week_${json.weeks[i]}`] = true;
|
||||
}
|
||||
form.val('form-filter',result);
|
||||
|
||||
$('#url').get(0).disabled = true;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user