123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /**
- * Created by zhumingyue on 2016/2/27.
- */
- var pos = {afterX:0,afterY:0,nowX:0,nowY:0,divX:0,divY:0};
- $(function(){
- setWH();
- $(window).resize(function(){
- setWH();
- });
-
- $("body").mouseover(function(){
- $(".search_emer_video").show();
- });
-
- $("body").mouseout(function(){
- $(".search_emer_video").hide();
- });
- });
-
- $(function(){
- LoginServer();
- $(".show_bar").toggle(
- function(){ $("#sideBar").slideUp(0); },
- function(){ $("#sideBar").slideDown(0); }
- );
- });
-
- function resolveUrl(){
- var encondeCondition=window.location.search;
- var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length)));
- var conditionArr=condition.split("&");
- var condJson={};
- for(var item in conditionArr){
- var temArr=conditionArr[item].split("=");
- condJson[temArr[0]]=temArr[1];
- }
- userInfo = condJson;
- return condJson;
- };
-
- /**
- * 登录
- */
- function LoginServer(){
- var url = $.pathname() + "/ws/cockpit/CockpitService/getSyncConfig";
- $.post(url,function(data){
- ocx.LoginServer(data.ip,data.port,data.name,data.pwd,data.mode);
- // ocx.LoginServer(data.ip,data.port,"tang","009cd3e062b7ae641621d234be10df3a",data.mode);
- },'json');
-
- }
- function setWH(){
- var winHei = $(window).height();
- var winWid = $(window).width();
- $("#main_tab").height(winHei-30);
- $("#main_tab").width(winWid);
- };
- function activityPanl(){
- $(".top_bar").css("height","100%");
- $(".bottom_bar").css("height","0");
- $("#con_panl").addClass("con_panl");
- };
- function removeActivity(){
- $(".top_bar").css("height","45%");
- $(".bottom_bar").css("height","55%");
- $("#con_panl").removeClass("con_panl");
- };
- /* 树形菜单和拖动框初始化 */
- function initComplete(){
- var deptId = resolveUrl()["dept_id"];
- var setting = {
- async: {
- enable: true,
- dataType: 'JSON',
- //返回的JSON数据的名字
- dataName: 'treeNodes',
- contentType: "application/json",
- url:'/nwyj/ws/cockpit/CockpitService/getSync',
- otherParam:{"deptId":deptId},
- autoParam: ["id", "name", "name=reName"]
- }
- };
- zTree = $.fn.zTree.init($("#dept_tree"), setting);
- };
- /* 监听鼠标是否移动 */
- function showcoords(e,obj){
- var e = window.event || e;
- pos.nowX = e.clientX;
- pos.nowY = e.clientY;
- }
- function changeXY(){
- if(pos.afterX==pos.nowX && pos.afterY==pos.nowY){
- $("#m_img").slideUp(0);
- $("#s_img").slideUp(0);
- }else{
- pos.afterX = pos.nowX;
- pos.afterY = pos.nowY;
- }
- };
- /* 拖动控制栏 */
- function cl(x,y){
- pos.divX = x ;
- pos.divY = y ;
- $(document).bind('mousemove',function(e){
- con_panl_move(event,this);
- });
- }
- function al(){
- $(document).unbind('mousemove');
- }
- function con_panl_move(e,obj){
- var e = window.event || e;
- var x = e.clientX - pos.divX;
- var y = e.clientY - pos.divY;
- $("#x").val("X:" + x);
- $("#y").val("Y:" + y);
- $("#con_panl").css({left:x+"px",top:y+"px"});
- }
- /* 分屏 */
- function SetWinNum(winnum){
- ocx.SetWndNum(winnum);
- }
- /* 打开视频 */
- function openVideo(CameraID){
- //var CameraID=$("#vid").val();
- //$(".titleBar").html(CameraID);
- con_panl.window.setVideoId(CameraID);
- var nSelWndNo = 0;
- nSelWndNo = ocx.GetSelWndIndex();
- ocx.OpenVideo(CameraID,nSelWndNo );
- }
- /* 关闭 */
- function closeVideo(){
- var nSelWndNo = 0;
- nSelWndNo = ocx.GetSelWndIndex();
- ocx.CloseVideo(nSelWndNo);
- }
- /* 抓图 */
- function capturePicture(){
- ocx.CapturePicture("f:\\1111111.bmp");
- }
- /* 录屏 */
- function startRecord(){
- ocx.StartRecord("f:\\22222222.dav");
- }
- /* 停止录屏 */
- function stopRecord(){
- ocx.StopRecord();
- }
- /* 操控 */
- function PTZControl(cmd,stop){
- // var step = $("#steps").val();//步长设置
- var step = window.frames["con_panl"].$("#steps").val();
- ocx.PTZControl(cmd,step,stop);
- }
|