101 lines
2.8 KiB
JavaScript
101 lines
2.8 KiB
JavaScript
|
import {mapUrl} from "../../../public/js/url.js";
|
||
|
import {getstationcount,stationInfoPageReq} from "../../cmddispatch/js/orgApi/getStationInfo.js";
|
||
|
import { showAiAlarmList } from "./showAiAlarmList.js";
|
||
|
import { showPushbuttonAlarmList } from "./showPushbuttonAlarmList.js";
|
||
|
import { showPoliceAlarm,showPersonPoliceAlarm } from "./showPoliceAlarm.js";
|
||
|
import { openAlarmHistory } from "./history.js";
|
||
|
|
||
|
|
||
|
|
||
|
let layuiObj={};
|
||
|
let clockloginInfo=null;
|
||
|
let eventMap=null;
|
||
|
let stationInfoTableList=[];
|
||
|
layui.use(['carousel','table','form','laydate','slider','element'],function() {
|
||
|
layuiObj["layer"] = layui.layer;
|
||
|
layuiObj["carousel"] = layui.carousel;
|
||
|
layuiObj["layuitable"] = layui.table;
|
||
|
layuiObj["rate"] = layui.rate;
|
||
|
layuiObj["layuiForm"] = layui.form;
|
||
|
layuiObj["laydate"] =layui.laydate;
|
||
|
layuiObj["slider"] =layui.slider;
|
||
|
layuiObj["element"] =layui.element;
|
||
|
var loginJson=sessionStorage.getItem("unameInfoStr");
|
||
|
clockloginInfo=JSON.parse(loginJson);
|
||
|
axios.defaults.headers.common['Authorization'] = clockloginInfo["session"];
|
||
|
eventMapInit();
|
||
|
})
|
||
|
|
||
|
async function eventMapInit(){
|
||
|
eventMap = L.map('eventMap',{
|
||
|
center: [28.19,113.03],
|
||
|
zoom: 15,
|
||
|
attributionControl:false,
|
||
|
zoomControl:false,
|
||
|
minZoom :1,
|
||
|
maxZoom :18
|
||
|
});
|
||
|
L.tileLayer(`${mapUrl}/roadmap/{z}/{x}/{y}.png`, {
|
||
|
attribution: ''
|
||
|
}).addTo(eventMap);
|
||
|
//获取学校的信息
|
||
|
var stationcountRes=await getstationcount();
|
||
|
var stationcount=stationcountRes.data.data.count;
|
||
|
var stationlistRes= await stationInfoPageReq(stationcount)
|
||
|
stationlistRes.forEach(item=>{
|
||
|
var data=item.data.data;
|
||
|
for(let i=0;i<data.length;i++){
|
||
|
stationInfoTableList.push(data[i]);
|
||
|
}
|
||
|
})
|
||
|
|
||
|
//获取天网预警的数据
|
||
|
showPoliceAlarm();
|
||
|
addHistoryEvent();
|
||
|
}
|
||
|
|
||
|
function addHistoryEvent(){
|
||
|
$(".historyMore").on('click',function(){
|
||
|
openAlarmHistory();
|
||
|
})
|
||
|
|
||
|
layuiObj.layuiForm.on("radio(earlyWarningRadio)", function (data) {
|
||
|
var value=parseInt(data["value"]);
|
||
|
$("#policeAlarmForm").css("display","none");
|
||
|
switch(value){
|
||
|
case 1:
|
||
|
$("#policeAlarmForm").css("display","block");
|
||
|
showPoliceAlarm();
|
||
|
break;
|
||
|
case 2:
|
||
|
showPushbuttonAlarmList();
|
||
|
break;
|
||
|
case 3:
|
||
|
break;
|
||
|
case 4:
|
||
|
showAiAlarmList();
|
||
|
break;
|
||
|
}
|
||
|
})
|
||
|
|
||
|
|
||
|
layuiObj.layuiForm.on("radio(policeAlarmTypeRadio)", function (data) {
|
||
|
var value=data["value"];
|
||
|
if(value=="station"){
|
||
|
showPoliceAlarm();
|
||
|
}else{
|
||
|
showPersonPoliceAlarm();
|
||
|
}
|
||
|
})
|
||
|
|
||
|
}
|
||
|
|
||
|
export {
|
||
|
eventMap,
|
||
|
layuiObj,
|
||
|
stationInfoTableList
|
||
|
}
|
||
|
|
||
|
|
||
|
|