import { getFaceAlarmStationSummary } from "../api/getFaceAlarmStationSummary.js"; import { getFaceAlarmBlacklistSummary } from "../api/getFaceAlarmBlacklistSummary.js"; import { layuiObj,eventMap} from "./index.js"; import {drawAlarmEventMarker} from "./marker/schoolMarker.js"; import { brigade } from "../../../public/js/url.js"; import { getPoliceAlarm } from "../api/getPoliceAlarm.js"; import { getPersonBlackList } from "../api/getPersonInfo.js"; import { getTime } from "./time.js"; import { timestampFormatTime } from "../../../public/js/timestamp.js"; import { stationurl } from "../../../public/js/url.js"; let policeAlarmList=[]; let policeAlarmItemList=[];//保存的是每一条记录 var currentStation=""; var polygonArr=[]; //按照学校统计天网的告警 function showPoliceAlarm(){ var reqdata={ brigade, pageindex: 0, pagesize: 2000, year:(new Date().getFullYear()).toString(), month:(new Date().getMonth()+1).toString(), day:(new Date().getDate()).toString() } getFaceAlarmStationSummary(reqdata).then(res=>{ var code=res["data"]["code"]; if(code==0){ var data=res["data"]["data"]; if(data!=null){ policeAlarmList=data; policeAlarmList.reverse(); } } showPoliceAlarmDiv(); }) } //按照人员的统计 function showPersonPoliceAlarm(){ var reqdata={ brigade, pageindex: 0, pagesize: 2000, year:(new Date().getFullYear()).toString(), month:(new Date().getMonth()+1).toString(), day:(new Date().getDate()).toString() } getFaceAlarmBlacklistSummary(reqdata).then(res=>{ var code=res["data"]["code"]; if(code==0){ var data=res["data"]["data"]; if(data!=null){ policeAlarmList=data; policeAlarmList.reverse(); } } showPoliceAlarmDiv(); }) } function showPoliceAlarmDiv(){ var div=""; for(var i=0;idiv").on('click',function(){ var eventId=$(this).attr("eventId"); var type=$(this).attr("type"); currentStation=eventId if(type=="station"){ var reqData={ station:eventId, } }else{ var reqData={ certificateNumber:eventId, } } var time=getTime(); reqData["pageindex"]=0; reqData["pagesize"]=2000 reqData["start"]=time["startTime"] reqData["end"]=time["endTime"] getPoliceAlarm(reqData).then(res=>{ console.log(res); var code=res["data"]["code"]; if(code==0){ var data=res["data"]["data"] if(data!=null){ policeAlarmItemList=data; policeAlarmItemList.reverse(); drawAlarmEventMarker(data); showSchoolInfoBox(data,type) } } }) }) } function openPoliceAlarm(item){ layuiObj.layer.open({ type: 1, title: "天网预警", //不显示标题栏 area: ['auto','auto'], shade: 0.6, id:new Date().getTime(), //设定一个id,防止重复弹出 btnAlign: 'c', moveType: 1, //拖拽模式,0或者1 content: `
${showPoliceAlarmItemDetail(item)}
`, success: function(layero){ console.log(item); } }); } //显示学校信息 function showStationInfo(list){ var item=list[0]; return `

学校名称: ${item["station"]}

派出所: ${item["borough"]}

警务区: ${item["detachment"]}

次数: ${list.length}

`; } //获取人员信息 async function getPersonInfo(){ var data={ personId:currentStation } var personInfoReq= await getPersonBlackList(data) var imageUrl=""; var groupType=""; var genderName=""; if(personInfoReq["data"]["data"].length>0){ var personInfoObj=personInfoReq["data"]["data"][0]; imageUrl=stationurl+personInfoObj["imageUrl"] groupType=personInfoObj["groupType"] genderName=personInfoObj["genderName"] } return { imageUrl, groupType, genderName } } //显示人员信息 async function showPersonInfo(list){ getPersonInfo().then(res=>{ console.log(res); var item=list[0]; var blackType=item["certificateTypeName"] var idNumber=item["certificateNumber"]; var blackName=item["personName"]; var div=`

${blackType}: ${blackName}/${idNumber}

性别: ${res["genderName"]}

类型: ${res["groupType"]}

出现次数: ${list.length}

`; $(".schoolInfoBox").html(div) }) } function showSchoolInfoBox(list,type){ if(type=="station"){ $(".mainContentR_top>p:nth-child(1)").html("学校信息:"+currentStation) var div=showStationInfo(list); $(".schoolInfoBox").html(div) }else if(type=="person"){ $(".mainContentR_top>p:nth-child(1)").html("人员信息:"+currentStation) showPersonInfo(list) } showSchoolWarnAlarmInfo(list); } function getAlarmPersonInfoDiv(item,type){ var alarmCount=item["alarmCount"]; if("personId" in item){ var text=item["personId"] var type="person"; } if("station" in item){ var text=item["station"]; var type="station"; } var lastPicUrl=item["lastPicUrl"]; var lastTimestamp=item["lastTimestamp"]; var div=""; div+=`

[${text}] 【${alarmCount}】

最后一次时间: ${lastTimestamp}

`; return div; } function showSchoolWarnAlarmInfo(arr){ var div=""; for(var i=0;i

[${personLibName}]

告警时间: ${alarmTime}

位置: ${address}

`; } function addPoliceAlarmItemEvent(){ $(".policeDetailBtn").on('click',function(){ var alarmId=$(this).parent().parent().parent().attr("alarmId"); for(var i=0;i

[${personLibName}]

告警时间: ${alarmTime}

位置: ${address}

`; } function emptyPoygon(){ for(var i=0;i