import { getPushButtonList } from "../api/getPushButtonList.js"; import { getTime } from "./time.js"; import { brigade } from "../../../public/js/url.js"; import { layuiObj } from "./index.js"; let pushbuttonAlarmList=[]; function showPushbuttonAlarmList(){ var time=getTime(); var reqdata={ brigade, pageindex: 0, pagesize: 2000, start:time["startTime"], end:time["endTime"] } getPushButtonList(reqdata).then(res=>{ var code=res["data"]["code"]; if(code==0){ var data=res["data"]["data"]; if(data!=null){ pushbuttonAlarmList=data; pushbuttonAlarmList.reverse(); } } showPushbuttonAlarmDiv(); }) } function showPushbuttonAlarmDiv(){ var div=""; for(var i=0;i

${station} 【${timestamp}】

位置:${address}

编号:${deviceId}

联系人1:${user1Name}/${user1Phone}

联系人2:${user2Name}/${user2Phone}

联系人3:${user3Name}/${user3Phone}

`; } function showPushbuttonEvent(){ $(".warnInfoListall>div").on('click',function(){ var eventId=$(this).attr("warnId") var arr=pushbuttonAlarmList.filter((item=>{ return item["alarmId"]==eventId; })) openPushbuttonAlarm(arr[0]) }) } function openPushbuttonAlarm(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: `
${getPushbuttonInfoDiv(item)}
`, success: function(layero){ console.log(item); } }); } export { showPushbuttonAlarmList, pushbuttonAlarmList }