import { stationurl,brigade } from "../../public/js/url.js"; import { layuiObj} from "../../pages/cmddispatch/js/index.js" import {getCurrData} from "../../public/js/timestamp.js"; import {getSchoolOptions} from "../cmddispatch/js/tree.js"; import {showAlarmEventImg} from "../cmddispatch/js/orgApi/getAlarmEventList.js" var faceWaringArr=[]; var faceWaringLoad=null; function getFaceWarningEventList(data){ var loginurl=stationurl+"/firectrl/client/sensor/alarm_event/getlist_diff"; return axios({ method: 'post', url:loginurl, data: data }) } function load(){ faceWaringLoad= layuiObj.layer.load(); } function closeLoad(){ layuiObj.layer.close(faceWaringLoad); } function showFaceWarning(){ layuiObj.layer.open({ type: 1, title: '人脸预警', //不显示标题栏 area: ['1400px', '580px'], shade: 0.6, id:new Date().getTime(), //设定一个id,防止重复弹出 btnAlign: 'c', moveType: 1, //拖拽模式,0或者1 content: `
`, success: function(layero){ faceWaringFromRender(); showFaceWaringHistoryContent([]) } }); } function faceWaringFromRender(){ $("#faceWaringHistorySelect").html(getSchoolOptions()); layuiObj.layuiForm.render("select","faceWaringHistoryForm"); layuiObj.laydate.render({ elem: '#faceWaringHistoryStart', type: 'datetime', }); layuiObj.laydate.render({ elem: '#faceWaringHistoryEnd', type: 'datetime', }); $("#faceWaringHistoryBtn").on('click',function(e){ e.preventDefault(); var station=$("#faceWaringHistorySelect").find("option:selected").val(); var signobj={ "brigade":brigade, "pagesize":2000, "pageindex":0, "start":$("#faceWaringHistoryStart").val(), "end":$("#faceWaringHistoryEnd").val() } if(station!="000"){ signobj["station"]=station } load(); getFaceWarningEventList(signobj).then(res=>{ console.log(res) faceWaringArr=[]; var code=res.data.code; if(code==0){ var data=res.data.data; for(var i=0;i` }}, {field:'opear', width:"20%", title: '操作',toolbar: '#faceWaringScript'}, ]], limit:Number.MAX_VALUE // 数据表格默认全部显示 }); //监听行工具事件 layuiObj.layuitable.on('tool(faceWaringHistoryTable)',function(obj){ var data=obj["data"]; showAlarmEventImg(data) }) } export {showFaceWarning}