import { getPoliceAlarm } from "../api/getPoliceAlarm.js" import { layuiObj,eventMap} from "./index.js"; import {drawAlarmEventMarker,drawPersonEventMarker} from "./marker/schoolMarker.js"; import { timestampFormatTime } from "../../../public/js/timestamp.js"; import { getskynetfence } from "../api/getSkyNetfence.js"; import { getTime } from "./time.js"; import { brigade } from "../../../public/js/url.js"; import { sendFacealarmBroadcast } from "../api/sendFacealarmBroadcast.js"; let policeAlarmList=[]; var currentStation=""; var currnetAlarmTarget=""; var skynetfenceObj={} var polygonArr=[]; function showPoliceAlarm(){ var time=getTime(); var reqdata={ brigade, pageindex: 0, pagesize: 2000, readState:"unread", start:time["startTime"], end:time["endTime"] } getPoliceAlarm(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"); $(".currentSchoolAlarmListAllBox").html(""); $(".schoolAlarmInfo>p:nth-child(1)").html("预警信息"); for(var i=0;idiv>div .broadCastMsgBtn").on('click',function(){ var alarmId=$(this).parent().parent().parent().attr("eventId"); layer.confirm('确定需要广播吗?', {icon: 3, title:'提示'}, function(index){ sendFacealarmBroadcast(alarmId).then(res=>{ var code=res["data"]["code"]; if(code==0){ layer.msg("推送成功") }else{ layer.msg("推送失败") } }) layer.close(index); }); }) $(".warnInfoListall>div>div .policeDetailBtn").on('click',function(){ var alarmId=$(this).parent().parent().parent().attr("eventId"); for(var i=0;i ${getAlarmPersonInfoDiv(item,"noBroadCast")} `, success: function(layero){ console.log(item); } }); } function showSchoolInfoBox(item,type){ var div=`

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

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

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

校长: 王娟(15211120788)

校区民警: 王娟(15211120788)

`; $(".schoolInfoBox").html(div) addSchoolInfoBoxEvent(); } function addSchoolInfoBoxEvent(){ $(".currentSchoolInfo").on('click',function(){ var tempArr=[]; for(var i=0;ip:nth-child(1)").html(currentStation+" 预警信息"); showSkynetFence(); }) $(".currentPersonInfo").on('click',function(){ var tempArr=[]; for(var i=0;ip:nth-child(1)").html(currnetAlarmTarget+" 预警信息"); }) } function showSkynetFence(){ if(!(currentStation in skynetfenceObj)){ getskynetfence(currentStation).then(res=>{ var code=res["data"]["code"]; if(code==0){ var data=res["data"]["data"]; var station=data["station"] skynetfenceObj[station]=data; }else{ layuiObj.layer.msg("无围栏信息"); } drawPolygon(); }) }else{ drawPolygon(); } } function getAlarmPersonInfoDiv(item,type){ var personLibName=item["personLibName"]; var station=item["station"]; var alarmTime=timestampFormatTime(new Date(item["alarmTime"]).getTime()); var address=item["cameraName"]; var eventId=item["alarmId"]; var pic=item["snappedPicUrl"] var blackType=item["certificateTypeName"] var idNumber=item["certificateNumber"]; var blackName=item["personName"]; var groupType=item["groupType"]; var div=`

[${personLibName}] 【${groupType == null?" ":groupType}】

告警时间: ${alarmTime}

学校名称: ${station}

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

位置: ${address}

` if(type!="noBroadCast"){ div+=`

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