//根据人员ID查询人员详细信息,并弹出气泡
|
function getPoliceById_3D(id,pos) {
|
var policerArgs = JSON.stringify({
|
"deviceNum" : id
|
});
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getPoliceAndEquipmentsByPuid.action",
|
dataType: "json",
|
data : policerArgs,
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
if(data !== undefined){
|
showManVideo(data,pos);
|
}else{
|
console.log("人员查询结果为undefined")
|
}
|
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("根据人员ID获取信息请求失败!");
|
}
|
});
|
}
|
//根据人员ID查询人员详细信息
|
function getPoliceInfoById_3D(id) {
|
var policerArgs = JSON.stringify({
|
"deviceNum" : id
|
});
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getPoliceByPuid.action",
|
data : policerArgs,
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
if (data[0] !== undefined) {
|
showInfoPolice_3D(data[0]);
|
};
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("根据人员ID获取信息请求失败!");
|
}
|
});
|
}
|
//更新人员目录树列表
|
function freshPolicelayer(){
|
var manData;
|
var count;
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getPolice.action",
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
manData = data;
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/countPolice.action",
|
contentType : "application/json;charset=utf-8",
|
success : function(data1) {
|
if(data !== undefined){
|
count = data1;
|
createManZTree(manData,count);
|
}
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("获取人员总数请求失败!");
|
}
|
});
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
// 请求失败时执行该函数
|
console.log("获取人员信息失败!");
|
}
|
});
|
}
|
function getManPosByDn(deviceNum){
|
var args = JSON.stringify({
|
"deviceNum" : deviceNum
|
});
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getManPosByDn.action",
|
data : args,
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
if (data[0] !== undefined) {
|
var posArr = data[0].realPos.split(',');
|
var poi = [Number(posArr[0]), Number(posArr[1]), Number(posArr[2])+500];
|
flyToLocation(poi);
|
};
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("根据人员ID获取信息请求失败!");
|
}
|
});
|
}
|
//获取设备GPS
|
function getGpsRealdata(deviceList){
|
if(deviceList.length==0){
|
deletePolice3DMarks();
|
return;
|
}
|
var args = JSON.stringify({
|
'deviceNums': deviceList
|
});
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getManPosWithNameAndOrigin.action",
|
data : args,
|
contentType : "application/json;charset=utf-8",
|
success : function(realdata) {
|
showPolice_3D(realdata);
|
return;
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("获取人员实时信息失败!");
|
}
|
});
|
}
|
|
var smartEyesession;
|
function smartEyelogin(){
|
if (!smartEyesession) {
|
var urlArrtemp = serverUrl.split(':');
|
var urlArr = urlArrtemp[1].split('\//');
|
smartEyesession = new jSW.SWSession({
|
server: urlArr[1], // 如果是jSW.CallProtoType.OCX方式,这里需要填写具体的IP
|
port: 9701,
|
onopen: function (sess) {
|
sess.swLogin({
|
user: 'admin',
|
password: '123456'
|
});
|
}
|
});
|
}
|
}
|
function smartEyelogout(){
|
if (smartEyesession) {
|
smartEyesession.swLogout();
|
}
|
}
|
var dlghandleArr = [];
|
function openSmartEyeVideo(deviceNum,divobj,type) {
|
var chanel = smartEyesession.swGetPuChanel(deviceNum, 0);
|
if (chanel) {
|
var result = chanel.swOpenEx({
|
ismuti: true,
|
div: divobj,
|
prototype: 'auto', //rtmp > hls
|
callback: function (options, response, dlghandle) {
|
var obj = {'dn':deviceNum,'dlghandle':dlghandle,'type':type};
|
dlghandleArr.push(obj);
|
}
|
});
|
|
if (result != jSW.RcCode.RC_CODE_S_OK) {
|
console.log('打开视频失败: ' + result);
|
}
|
} else {
|
console.log('没有该设备通道');
|
}
|
}
|
function closeSmartEyeVideo(deviceNum,type) {
|
var chanel = smartEyesession.swGetPuChanel(deviceNum, 0);
|
if (chanel) {
|
for(var j = 0; j < dlghandleArr.length; j++){
|
if(dlghandleArr[j].type==type){
|
if(deviceNum==dlghandleArr[j].dn){
|
var result = chanel.swClose(dlghandleArr[j].dlghandle.hdlg);
|
dlghandleArr.splice(j, 1);
|
break;
|
}
|
}
|
}
|
} else {
|
console.log('没有该设备通道');
|
}
|
}
|