移动新ui
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
hb_cyjc_yd/WebRoot/hbcyjc/video/spjk_manager.html

167 lines
4.5 KiB

<html>
<head>
<title>视频管理</title>
<meta charset="UTF-8">
<style>
table
{
border-collapse:collapse;
border:1px solid black;
}
td
{
height:60px;
border:1px solid black;
}
a
{
display:inline-block;
margin-left:20px ;
}
button
{
height:40px;
padding:10px 15px;
}
</style>
<script src="https://cdn.staticfile.org/jquery/3.7.0/jquery.js" type="text/javascript"></script>
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<script>
//var vip = "http://192.168.0.156:10000" ;
var vip = "http://211.90.38.239:10000" ;
var video_url = "" ;
var msgColor = "red" ;
var isBatch = false ;
//对某一路视频的操作 编号,及开关
function videoOper(vsn,command){
var vname = $("#sid_"+vsn).text() ;
//alert(vname);
var oper=(command=='start')?"开启":"关闭";
// 单个开启弹出确认框
//alert(''+!isBatch) ;
if(!isBatch){
if(!confirm('确认是否要'+oper+'['+vname+']的监控视频?')){
return false ;
}
}
if(vsn == ''){
return false ;
}
if(command == 'start'){
video_url = vip+"/api/v1/getdevicestream?device="+vsn+"&channel=01&protocol=RTSP&reserve=1" ;
msgColor = "green" ;
}else{
video_url = vip+"/api/v1/freedevicestream?device="+vsn+"&channel=01&protocol=RTSP&reserve=1" ;
msgColor = "red" ;
}
//alert('command:'+command+'\r\nvideo_url:'+video_url) ;
//console.log('command:'+command+'video_url:'+video_url);
//异步请求 返回状态
$.ajax({
type:"get", //请求方式
async:true, //是否异步
//url:"http://192.168.0.193/zjk_ly_bigdata/tsfxdatanum/querycomplaintnum.do",
url:video_url,
dataType:"jsonp", //跨域json请求一定是jsonp
jsonp: "callbackparam", //跨域请求的参数名,默认是callback
//jsonpCallback:"successCallback", //自定义跨域参数值,回调函数名也是一样,默认为jQuery自动生成的字符串
//data:{"query":"civilnews"}, //请求参数
beforeSend: function() {
//请求前的处理
},
success: function(data) {
//请求成功处理,和本地回调完全一样
$("#div_info").html('SSSSSSS')
},
complete: function() {
//请求完成的处理
$("#div_info").html(vname+'视频<font color="'+msgColor+'">'+oper+'</font>成功')
},
error: function() {
//请求出错处理
$("#div_info").html('EEEEEEE')
}
});
}
//全部开启
function startAll(){
if(confirm('确认是否要开启全部监控视频?')){
isBatch = true ;
videoOper('1001','start') ;
videoOper('1006','start') ;
videoOper('1007','start') ;
videoOper('1009','start') ;
isBatch = false ;
$("#div_info").html('全部监控视频<font color="green">开启</font>成功');
}
}
//全部关闭
function shutAll(){
if(confirm('确认是否要开启全部监控视频?')){
isBatch = true ;
videoOper('1001','shut') ;
videoOper('1006','shut') ;
videoOper('1007','shut') ;
videoOper('1009','shut') ;
isBatch = false ;
$("#div_info").html('全部监控视频<font color="red">关闭</font>成功');
}
}
</script>
</head>
<body>
<h2>视频管理页面</h2>
<button name="全部开启" onclick="startAll();">全部开启</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name="全部关闭" onclick="shutAll();">全部关闭</button>
<BR/><BR/>
<table width="100%" cellpadding="0" cellspacing="0" border="1">
<tr bgcolor="#eeeeee">
<th> 序号</th>
<th> 监控位置</th>
<th> 操作</th>
</tr>
<tr>
<td> 1</td>
<td id="sid_1001">前门内东</td>
<td>
<a href="#" onclick="videoOper('1001','start')">开启 </a>
<a href="#" onclick="videoOper('1001','shut')"">关闭 </a>
</td>
</tr>
<tr>
<td> 2</td>
<td id="sid_1006">合符坛台阶</td>
<td>
<a href="#" onclick="videoOper('1006','start')">开启 </a>
<a href="#" onclick="videoOper('1006','shut')"">关闭 </a>
</td>
</tr>
<tr>
<td> 3</td>
<td id="sid_1007">景区大门</td>
<td>
<a href="#" onclick="videoOper('1007','start')">开启 </a>
<a href="#" onclick="videoOper('1007','shut')"">关闭 </a>
</td>
</tr>
<tr>
<td> 4</td>
<td id="sid_1009">合符坛入口</td>
<td>
<a href="#" onclick="videoOper('1009','start')">开启 </a>
<a href="#" onclick="videoOper('1009','shut')"">关闭 </a>
</td>
</tr>
<div id = "div_info"></div>
</html>