Commit b55515f3 authored by yaqizhang's avatar yaqizhang

Merge branch 'master' of ssh://111.61.77.35:15/yaqizhang/zanhuangyingji into master

parents 8ba8faac 59535284
$(function () { $(function () {
layui.use(['layer', 'table', 'element'], function () { layui.use(["layer", "table", "element"], function () {
layLayer = layui.layer; layLayer = layui.layer;
layTable = layui.table; layTable = layui.table;
element = layui.element; element = layui.element;
...@@ -13,15 +13,15 @@ $(function () { ...@@ -13,15 +13,15 @@ $(function () {
let circle = new AMap.Circle({ let circle = new AMap.Circle({
center: new AMap.LngLat(lng, lat), // 圆心位置 center: new AMap.LngLat(lng, lat), // 圆心位置
radius: radius, //半径 radius: radius, //半径
strokeColor: '#F33', //线颜色 strokeColor: "#F33", //线颜色
strokeOpacity: 1, //线透明度 strokeOpacity: 1, //线透明度
strokeWeight: 1, //线粗细度 strokeWeight: 1, //线粗细度
fillColor: '#ee2200', //填充颜色 fillColor: "#ee2200", //填充颜色
fillOpacity: 0.35, //填充透明度 fillOpacity: 0.35, //填充透明度
}); });
let poiIcon = new AMap.Icon({ let poiIcon = new AMap.Icon({
size: new AMap.Size(102, 102), size: new AMap.Size(102, 102),
image: './images/flag.png', image: "./images/flag.png",
imageSize: new AMap.Size(62, 62), imageSize: new AMap.Size(62, 62),
imageOffset: new AMap.Pixel(0, 0), imageOffset: new AMap.Pixel(0, 0),
}); });
...@@ -48,63 +48,65 @@ $(function () { ...@@ -48,63 +48,65 @@ $(function () {
function removeAllOverlay() { function removeAllOverlay() {
map.clearMap(); map.clearMap();
map.setCenter(defaultCenter); map.setCenter(defaultCenter);
$('#legend a').removeClass('selected'); $("#legend a").removeClass("selected");
} }
//搜索按钮 //搜索按钮
function getBtmSearchData(param) { function getBtmSearchData(param) {
let opts = { let opts = {
url: apis.mapSearch, url: apis.mapSearch,
type: 'post', type: "post",
data: JSON.stringify({ keywords: param }), data: JSON.stringify({ keywords: param }),
success: function (res) { success: function (res) {
if (res.code === 0) { if (res.code === 0) {
let arr = res.data.pageData; let arr = res.data.pageData;
if (arr.length > 0) { if (arr.length > 0) {
let html = ''; let html = "";
removeAllOverlay(); removeAllOverlay();
$('#legend li a').removeClass('selected'); $("#legend li a").removeClass("selected");
arr.map((ele) => { arr.map((ele) => {
html += `<div class="btm-list-item" data-id="${ele.id}">${ele.fullName}</div>`; html += `<div class="btm-list-item" data-id="${ele.id}">${ele.fullName}</div>`;
let ar = []; let ar = [];
ar.push(ele); ar.push(ele);
addMarker(ar, ele.showType, null); addMarker(ar, ele.showType, null);
}); });
$('#listWrap').html(html); $("#listWrap").html(html);
// $('.btm-list-item').click(function(){ // $('.btm-list-item').click(function(){
// let id = $(this).attr('data-id'); // let id = $(this).attr('data-id');
// let rowobj = arr.filter(ele => ele.id = id) // let rowobj = arr.filter(ele => ele.id = id)
// addMarker(rowobj, rowobj.showType, null) // addMarker(rowobj, rowobj.showType, null)
// }) // })
} else { } else {
$('#listWrap').html('<div class="btm-list-item" style="text-align:center;">无搜索结果!</div>'); $("#listWrap").html(
'<div class="btm-list-item" style="text-align:center;">无搜索结果!</div>'
);
} }
} }
}, },
}; };
jQueryAjax(opts); jQueryAjax(opts);
} }
$('.uative').on('click', function () { $(".uative").on("click", function () {
$('#btmSearch > *').fadeIn(100); $("#btmSearch > *").fadeIn(100);
$(this).hide(); $(this).hide();
}); });
$('.activebtn').on('click', function (e) { $(".activebtn").on("click", function (e) {
let val = $('#btnInput').val(); let val = $("#btnInput").val();
getBtmSearchData(val); getBtmSearchData(val);
}); });
$('.guan').click(function () { $(".guan").click(function () {
$('#btmSearch > *').hide(); $("#btmSearch > *").hide();
$('.uative').show(); $(".uative").show();
}); });
$('#removeSerBtn').click(function () { $("#removeSerBtn").click(function () {
removeAllOverlay(); removeAllOverlay();
}); });
$('#mulitVideoBtn').click(function () { $("#mulitVideoBtn").click(function () {
showMulitVideo(); showMulitVideo();
}); });
$('#btnInput').bind('input', function (e) { $("#btnInput").bind("input", function (e) {
let val = e.target.value; let val = e.target.value;
if (!val) { if (!val) {
$('#listWrap').html(''); $("#listWrap").html("");
removeAllOverlay(); removeAllOverlay();
} }
}); });
...@@ -128,116 +130,174 @@ $(function () { ...@@ -128,116 +130,174 @@ $(function () {
});*/ });*/
$('.controlBtn .button').mousedown(function () { $(".controlBtn .button").mousedown(function () {
var self = this; var self = this;
console.log($(self).data('action'),"dfdf===----------------===============",$("#controllerDeviceId").val()); console.log(
videoControlling($("#controllerDeviceId").val(),0,$(self).data('action')); $(self).data("action"),
}) "dfdf===----------------===============",
$("#controllerDeviceId").val()
$('.controlBtn .button').mouseup(function () { );
var self = this; videoControlling($("#controllerDeviceId").val(), 0, $(self).data("action"));
console.log($(self).data('action'),"dfdf===----------------===============",$("#controllerDeviceId").val()); });
videoControlling($("#controllerDeviceId").val(),1,$(self).data('action'));
}) $(".controlBtn .button").mouseup(function () {
var self = this;
console.log(
$(self).data("action"),
"dfdf===----------------===============",
$("#controllerDeviceId").val()
);
videoControlling($("#controllerDeviceId").val(), 1, $(self).data("action"));
});
// 鼠标滚动放大缩小 // 鼠标滚动放大缩小
$('.reset').on('mousewheel DOMMouseScroll', function (e) { $(".reset").on("mousewheel DOMMouseScroll", function (e) {
var delta = var delta =
(e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie (e.originalEvent.wheelDelta &&
(e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
(e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox (e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox
if (!videoController) { if (!videoController) {
return; return;
} }
if (videoController.getInChoiceVideo() === undefined) { if (videoController.getInChoiceVideo() === undefined) {
layLayer.msg('请先点击视频以选中'); layLayer.msg("请先点击视频以选中");
return; return;
} }
if (delta > 0) { if (delta > 0) {
// 向上滚 // 向上滚
videoController.setChoiceWindow(0); videoController.setChoiceWindow(0);
videoController.holder('zoomout', { speed: 4000, group: 0, present: 0, time: 0 }, false); videoController.holder(
"zoomout",
{ speed: 4000, group: 0, present: 0, time: 0 },
false
);
var mousewheelUpTimer = setTimeout(function () { var mousewheelUpTimer = setTimeout(function () {
videoController.holder('zoomout', { speed: 4000, group: 0, present: 0, time: 0 }, true); videoController.holder(
"zoomout",
{ speed: 4000, group: 0, present: 0, time: 0 },
true
);
clearTimeout(mousewheelUpTimer); clearTimeout(mousewheelUpTimer);
}, 500); }, 500);
} else if (delta < 0) { } else if (delta < 0) {
// 向下滚 // 向下滚
videoController.setChoiceWindow(0); videoController.setChoiceWindow(0);
videoController.holder('zoomin', { speed: 4000, group: 0, present: 0, time: 0 }, false); videoController.holder(
"zoomin",
{ speed: 4000, group: 0, present: 0, time: 0 },
false
);
var mousewheelDownTimer = setTimeout(function () { var mousewheelDownTimer = setTimeout(function () {
videoController.holder('zoomin', { speed: 4000, group: 0, present: 0, time: 0 }, true); videoController.holder(
"zoomin",
{ speed: 4000, group: 0, present: 0, time: 0 },
true
);
clearTimeout(mousewheelDownTimer); clearTimeout(mousewheelDownTimer);
}, 500); }, 500);
} }
}); });
// 监听图例点击事件 // 监听图例点击事件
$('#legend').on('click', function (ev) { $("#legend").on("click", function (ev) {
let isJkelected = $('.layui-layer-btn .jkBtn').hasClass('selected'); const target = $(ev.target);
const li = target.closest("li");
let isJkelected = $(".layui-layer-btn .jkBtn").hasClass("selected");
if (isJkelected) { if (isJkelected) {
removeMaker('jk'); removeMaker("jk");
$('.layui-layer-btn .jkBtn').removeClass('selected'); $(".layui-layer-btn .jkBtn").removeClass("selected");
} }
// 当点的不是a标签
if (ev.target.tagName.toLowerCase() !== "a") {
// 根据li的active属性拍判断是否是选中状态,因为初始是undefind 所哟要!!转化为boolea,状态是在点击a标签的时候发生改变的
// 如果全选了 那li状态就味true,否则都是false
const aciveFlag = !!li.data("active");
const clickArr = li.find("a");
filterClick(clickArr, aciveFlag);
} else {
if (ev.target.tagName.toLowerCase() !== 'a') { // 当点的是a
$(ev.target).closest('li').find('a').click(); if ($(ev.target)[0].classList.toString().indexOf("selected") === -1) {
if( $(ev.target).closest('li').find(".legendchild").css("display")=="block"){ removeMaker($(ev.target).data("id"));
$(ev.target).closest('li').find(".legendchild").css({display:"none"}); addCateMarker(
$(ev.target).closest('li').css({"backgroundImage":"url(images/re.png)"}); $(ev.target).data("id"),
}else{ $(ev.target).closest("li").data("id")
$("#legend").find("li .legendchild").css({display:"none"}); );
// $("#legend").find("li").css({"backgroundImage":"url(images/re.png)"}); } else {
$(ev.target).closest('li').find(".legendchild").css({display:"block"}); removeMaker($(ev.target).data("id"));
$(ev.target).closest('li').css({"backgroundImage":"url(images/vectorbot.png)"})
} }
$(ev.target).toggleClass("selected");
} else { // 获取当先元素下的a
if ($(ev.target)[0].classList.toString().indexOf('selected') === -1) { const domArr = $(ev.target).closest(".legendchild").find("a");
removeMaker($(ev.target).data('id')); // 计算a是否都被选中
addCateMarker($(ev.target).data('id'), $(ev.target).closest('li').data('id')); const selectedFlag = domArr.get().every((item) => {
return $(item).hasClass("selected");
});
// 如果全被选中,就让li状态改为全选,否则状态就是未被全选
if (selectedFlag) {
$(ev.target).closest("li").data("active", true);
li.css({ backgroundImage: "url(images/vectorbot.png)" });
} else { } else {
removeMaker($(ev.target).data('id')); $(ev.target).closest("li").data("active", false);
} }
$(ev.target).toggleClass('selected');
} }
}); });
$('.legendcss').on('mouseover', function (ev) { // 当点击li时,如果a元素自身场景选择是否被点击,li选中状态的时候,a标签要全都选中,l没被选中的时候,a标签要全部清楚
console.log(ev.target.className); function filterClick(clickArr, bool) {
if (ev.target.tagName.toLowerCase() !== 'ul' &&ev.target.tagName.toLowerCase()!=="a"&& ev.target.className !=="legendchild" ) { $.each(clickArr, function (index, ele) {
$("#legend").find("li .legendchild").hide(); if ($(ele).hasClass("selected") == bool) {
$(ev.target).closest('li').find(".legendchild").show(); $(ele).click();
$(ev.target).closest('li').css({"backgroundImage":"url(images/vectorbot.png)"}) }
}else{ });
}
let timer = null;
let timer2 = null;
$(".legendcss").on("mouseover", function (ev) {
const target = $(ev.target);
// if (target.get(0).tagName == "UL") return;
const li = target.closest("li");
// 当被li是被选中状态
if (li.data("active")) {
} else {
// 当li不是选中状态才触发自动换背景颜色
li.css({ backgroundImage: "url(images/vectorbot.png)" });
li.data("hover", true);
} }
// if(ev.target.tagName.toLowerCase()=="a" || ev.target.className =="legendchild"){
// $(ev.target).closest('li').css({"backgroundImage":"url(images/re.png)"});
// }
})
$('.legendcss').on('mouseout', function (ev) {
// if (ev.target.tagName.toLowerCase()=="a" || ev.target.className =="legendchild") {
// $("#legend").find("li .legendchild").hide();
// $(e.target).closest('li').find(".legendchild").hide();
// }else{
// } const arr = $("#legend").find("li");
// 全体归位清零
$.each(arr, function (index, ele) {
$(ele).children(".legendchild").hide();
});
// 当前div出现
li.find(".legendchild").show();
});
$(".legendcss").on("mouseout", function (ev) {
const target = $(ev.target);
}) const li = target.closest("li");
if (li.data("active")) {
} else {
// 当li不是选中状态才触发自动换背景颜色,只有移出的时候才切换北京颜色
li.css({ backgroundImage: "url(images/re.png)" });
li.data("hover", false);
}
li.find(".legendchild").hide();
});
/*全局变量*/ /*全局变量*/
var currentEventObj = {}; //点击评估处理时当前事件obj var currentEventObj = {}; //点击评估处理时当前事件obj
(currEventsArr = []), //当前事件Arrary (currEventsArr = []), //当前事件Arrary
(getCurrEventsArr = []), (getCurrEventsArr = []),
(socketCurrEventsArr = []), (socketCurrEventsArr = []),
(checkEventEype = ''), //回顾事件 review 处理当前 current (checkEventEype = ""), //回顾事件 review 处理当前 current
(stepWord = 0); //处理中事件 到了哪一步了 0-3 step (stepWord = 0); //处理中事件 到了哪一步了 0-3 step
/* /*
* 绑定window操作事件* * 绑定window操作事件*
...@@ -245,21 +305,21 @@ $(function () { ...@@ -245,21 +305,21 @@ $(function () {
window.CAEVT = { window.CAEVT = {
//查看预案详情 //查看预案详情
check(d) { check(d) {
$('.yjdetali').show(); $(".yjdetali").show();
$('.yjdetali').html(`<h1>${d.planTitle} ${d.planLevel + '级'}</h1> $(".yjdetali").html(`<h1>${d.planTitle} ${d.planLevel + "级"}</h1>
<table id="members" lay-filter="members"></table>${d.planContents}`); <table id="members" lay-filter="members"></table>${d.planContents}`);
layTable.render({ layTable.render({
elem: '#members', elem: "#members",
size: 'sm', size: "sm",
skin: 'nob', skin: "nob",
cols: [ cols: [
[{ align: 'center', title: '人员列表', colspan: 5 }], [{ align: "center", title: "人员列表", colspan: 5 }],
[ [
{ field: 'deptName', title: '部门' }, { field: "deptName", title: "部门" },
{ field: 'userName', title: '联系人' }, { field: "userName", title: "联系人" },
{ field: 'mobilePhone', title: '手机号' }, { field: "mobilePhone", title: "手机号" },
{ field: 'phone', title: '电话' }, { field: "phone", title: "电话" },
{ field: 'email', title: '邮箱' }, { field: "email", title: "邮箱" },
], ],
], ],
data: d.rdeptInfoList, data: d.rdeptInfoList,
...@@ -267,7 +327,7 @@ $(function () { ...@@ -267,7 +327,7 @@ $(function () {
}, },
//查看预案详情 //查看预案详情
checkPlan(planid) { checkPlan(planid) {
BOTMTOOLBAR.genericPlan('', planid); BOTMTOOLBAR.genericPlan("", planid);
}, },
//关联预案 //关联预案
connect(d) { connect(d) {
...@@ -278,14 +338,14 @@ $(function () { ...@@ -278,14 +338,14 @@ $(function () {
layLayer.confirm(`确定关联此预案《${d.planTitle}》吗?`, function () { layLayer.confirm(`确定关联此预案《${d.planTitle}》吗?`, function () {
let opt = { let opt = {
url: apis.contentPlan, url: apis.contentPlan,
type: 'post', type: "post",
data: JSON.stringify(obj), data: JSON.stringify(obj),
success: function (res) { success: function (res) {
if (res.code == 0) layLayer.msg('关联成功!', { icon: 1 }); if (res.code == 0) layLayer.msg("关联成功!", { icon: 1 });
//修改事件状态 //修改事件状态
STEPEVENTS.changeStatus('2'); STEPEVENTS.changeStatus("2");
//关联预案成功跳转到态势决策 //关联预案成功跳转到态势决策
$('#yingjlistbox').hide(); $("#yingjlistbox").hide();
}, },
}; };
jQueryAjax(opt); jQueryAjax(opt);
...@@ -300,7 +360,7 @@ $(function () { ...@@ -300,7 +360,7 @@ $(function () {
success: function (res) { success: function (res) {
if (res.code == 0) { if (res.code == 0) {
if (res.data) { if (res.data) {
$('#mainTitle span').html(res.data.value); $("#mainTitle span").html(res.data.value);
} }
} }
}, },
...@@ -310,7 +370,7 @@ $(function () { ...@@ -310,7 +370,7 @@ $(function () {
//评估处理 //评估处理
handleEvent(obj) { handleEvent(obj) {
currentEventObj = { ...obj }; currentEventObj = { ...obj };
if (obj.eventStatus == 0) STEPEVENTS.changeStatus('1'); if (obj.eventStatus == 0) STEPEVENTS.changeStatus("1");
else STEPEVENTS.toStepChange(obj.eventStatus); else STEPEVENTS.toStepChange(obj.eventStatus);
}, },
//执行预案 //执行预案
...@@ -319,20 +379,20 @@ $(function () { ...@@ -319,20 +379,20 @@ $(function () {
/* 启动预案 */ url: apis.carryPlan + currentEventObj.id, /* 启动预案 */ url: apis.carryPlan + currentEventObj.id,
success: function (res) { success: function (res) {
if (res.code == 0) { if (res.code == 0) {
layLayer.msg('启动预案成功!', { icon: 1 }); layLayer.msg("启动预案成功!", { icon: 1 });
STEPEVENTS.changeStatus('3'); STEPEVENTS.changeStatus("3");
} }
}, },
}, },
addOpt = { addOpt = {
/* 增补预案 */ type: 'post', /* 增补预案 */ type: "post",
data: JSON.stringify({ data: JSON.stringify({
addPlanContent: $('textarea[name=addPlan]').val(), addPlanContent: $("textarea[name=addPlan]").val(),
}), }),
url: apis.addPlan + currentEventObj.id, url: apis.addPlan + currentEventObj.id,
success: function (res) { success: function (res) {
if (res.code == 0) { if (res.code == 0) {
layLayer.msg('增补预案成功!', { icon: 1 }); layLayer.msg("增补预案成功!", { icon: 1 });
jQueryAjax(carryOpt); jQueryAjax(carryOpt);
} }
}, },
...@@ -344,11 +404,11 @@ $(function () { ...@@ -344,11 +404,11 @@ $(function () {
let defaultHtml = `<div id="${id}" class="fixedbox"> let defaultHtml = `<div id="${id}" class="fixedbox">
<div class="fixedbox-tit">${title}<span class="cbtn"><i class="layui-icon layui-icon-close"></i></span></div></div>`; <div class="fixedbox-tit">${title}<span class="cbtn"><i class="layui-icon layui-icon-close"></i></span></div></div>`;
if ($(`#${id}`).length == 0) { if ($(`#${id}`).length == 0) {
$('body').append(defaultHtml); $("body").append(defaultHtml);
$(`#${id} .fixedbox-tit`).after(addhtml); $(`#${id} .fixedbox-tit`).after(addhtml);
$(`#${id}`).show(); $(`#${id}`).show();
} }
$('body').on('click', `#${id} .cbtn`, function () { $("body").on("click", `#${id} .cbtn`, function () {
$(`#${id}`).remove(); $(`#${id}`).remove();
}); });
}, },
...@@ -365,7 +425,7 @@ $(function () { ...@@ -365,7 +425,7 @@ $(function () {
getCurrEventsArr = [...currarr]; getCurrEventsArr = [...currarr];
_this.renderEventList(); _this.renderEventList();
/* 历史事件 */ /* 历史事件 */
$('.hisEvNum').html(resData.historyEventNum); $(".hisEvNum").html(resData.historyEventNum);
_this.historyEvent(resData.historyEventList); _this.historyEvent(resData.historyEventList);
} }
}, },
...@@ -375,46 +435,48 @@ $(function () { ...@@ -375,46 +435,48 @@ $(function () {
//渲染当前事件列表 //渲染当前事件列表
renderEventList() { renderEventList() {
currEventsArr = [...getCurrEventsArr, ...socketCurrEventsArr]; currEventsArr = [...getCurrEventsArr, ...socketCurrEventsArr];
$('.currEvNum').html(currEventsArr.length); $(".currEvNum").html(currEventsArr.length);
if (getCurrEventsArr.length > 0) $('.escbox-txt').html('<font style="color:red">有待处理事件!</font>'); if (getCurrEventsArr.length > 0)
if (socketCurrEventsArr.length > 0) $('.escbox-txt').html('<font style="color:red">发生事件!</font>'); $(".escbox-txt").html('<font style="color:red">有待处理事件!</font>');
if (socketCurrEventsArr.length > 0)
$(".escbox-txt").html('<font style="color:red">发生事件!</font>');
layTable.render({ layTable.render({
elem: '#currEvents', elem: "#currEvents",
size: 'sm', size: "sm",
cols: [ cols: [
[ [
{ field: 'alarmTime', title: '时间' }, { field: "alarmTime", title: "时间" },
{ {
field: 'eventName', field: "eventName",
title: '事件名称', title: "事件名称",
event: 'tanDetail', event: "tanDetail",
templet: function (d) { templet: function (d) {
return `<span style="text-decoration:underline;cursor:pointer">${d.eventName}</span>`; return `<span style="text-decoration:underline;cursor:pointer">${d.eventName}</span>`;
}, },
}, },
{ {
field: '', field: "",
title: '操作', title: "操作",
templet: function (d) { templet: function (d) {
let txt; let txt;
if (d.eventStatus == 0) txt = '评估处理'; if (d.eventStatus == 0) txt = "评估处理";
else txt = evenStepNameArr[Number(d.eventStatus) - 1]; else txt = evenStepNameArr[Number(d.eventStatus) - 1];
return '<span class="txtbtn">' + txt + '</span>'; return '<span class="txtbtn">' + txt + "</span>";
}, },
event: 'handle', event: "handle",
}, },
], ],
], ],
data: currEventsArr, data: currEventsArr,
}); });
layTable.on('tool(currEvents)', function (obj) { layTable.on("tool(currEvents)", function (obj) {
let rowData = obj.data, let rowData = obj.data,
rowEvent = obj.event; rowEvent = obj.event;
if (rowEvent == 'handle') { if (rowEvent == "handle") {
//评估处理 //评估处理
checkEventEype = 'current'; checkEventEype = "current";
CARYEVENTS.handleEvent(rowData); CARYEVENTS.handleEvent(rowData);
} else if (rowEvent == 'tanDetail') { } else if (rowEvent == "tanDetail") {
let detaliHtml = let detaliHtml =
`<div class="eventDeatail">` + `<div class="eventDeatail">` +
`<P>事件名称:${rowData.eventName}</p>` + `<P>事件名称:${rowData.eventName}</p>` +
...@@ -424,50 +486,50 @@ $(function () { ...@@ -424,50 +486,50 @@ $(function () {
`<P>报案人联系电话:${rowData.alarmPeoplePhone}</p>` + `<P>报案人联系电话:${rowData.alarmPeoplePhone}</p>` +
`<P>事发时间:${rowData.alarmTime}</p>` + `<P>事发时间:${rowData.alarmTime}</p>` +
`</div>`; `</div>`;
CARYEVENTS.tanDialogFun('事件详情', 'eventDetail', detaliHtml); CARYEVENTS.tanDialogFun("事件详情", "eventDetail", detaliHtml);
} }
}); });
}, },
//渲染历史事件列表 //渲染历史事件列表
historyEvent(historyList) { historyEvent(historyList) {
layTable.render({ layTable.render({
elem: '#esctable', elem: "#esctable",
size: 'sm', size: "sm",
cols: [ cols: [
[ [
{ field: 'alarmTime', title: '时间' }, { field: "alarmTime", title: "时间" },
{ {
field: 'eventName', field: "eventName",
title: '事件名称', title: "事件名称",
event: 'tanDetail', event: "tanDetail",
templet: function (d) { templet: function (d) {
return `<span style="text-decoration:underline;cursor:pointer">${d.eventName}</span>`; return `<span style="text-decoration:underline;cursor:pointer">${d.eventName}</span>`;
}, },
}, },
{ {
field: '', field: "",
title: '操作', title: "操作",
templet: function (d) { templet: function (d) {
return '<span class="txtbtn layui-tab layui-tab-brief">回顾</span>'; return '<span class="txtbtn layui-tab layui-tab-brief">回顾</span>';
}, },
event: 'review', event: "review",
}, },
], ],
], ],
data: historyList, data: historyList,
}); });
layTable.on('tool(esctable)', function (obj) { layTable.on("tool(esctable)", function (obj) {
let rowData = obj.data, let rowData = obj.data,
rowEvent = obj.event; rowEvent = obj.event;
if (rowEvent == 'review') { if (rowEvent == "review") {
$(`#esc-tit`).show(); $(`#esc-tit`).show();
$(`#esc-tit .abt`).addClass('done').removeClass('not'); $(`#esc-tit .abt`).addClass("done").removeClass("not");
currentEventObj = { ...rowData }; currentEventObj = { ...rowData };
checkEventEype = 'review'; checkEventEype = "review";
STEPEVENTS.switchItem(1); STEPEVENTS.switchItem(1);
// STEPEVENTS.estimateEvent(); // STEPEVENTS.estimateEvent();
} }
if (rowEvent == 'tanDetail') { if (rowEvent == "tanDetail") {
let detaliHtml = let detaliHtml =
`<div class="eventDeatail">` + `<div class="eventDeatail">` +
`<P>事件名称:${rowData.eventName}</p>` + `<P>事件名称:${rowData.eventName}</p>` +
...@@ -477,7 +539,7 @@ $(function () { ...@@ -477,7 +539,7 @@ $(function () {
`<P>报案人联系电话:${rowData.alarmPeoplePhone}</p>` + `<P>报案人联系电话:${rowData.alarmPeoplePhone}</p>` +
`<P>事发时间:${rowData.alarmTime}</p>` + `<P>事发时间:${rowData.alarmTime}</p>` +
`</div>`; `</div>`;
CARYEVENTS.tanDialogFun('事件详情', 'eventDetail', detaliHtml); CARYEVENTS.tanDialogFun("事件详情", "eventDetail", detaliHtml);
} }
}); });
}, },
...@@ -518,17 +580,17 @@ $(function () { ...@@ -518,17 +580,17 @@ $(function () {
var STEPEVENTS = { var STEPEVENTS = {
//初步研判 //初步研判
estimateEvent() { estimateEvent() {
if (checkEventEype == 'review') { if (checkEventEype == "review") {
$('#connectPlanBtn').hide(); $("#connectPlanBtn").hide();
$('.resouce').show(); $(".resouce").show();
} else { } else {
$('#connectPlanBtn').show(); $("#connectPlanBtn").show();
} }
let obj = { ...currentEventObj }; let obj = { ...currentEventObj };
/*加载应急资源*/ /*加载应急资源*/
function getResource(keywords = '') { function getResource(keywords = "") {
let opt = { let opt = {
type: 'post', type: "post",
url: apis.mapSearch, url: apis.mapSearch,
data: JSON.stringify({ data: JSON.stringify({
distance: 3000, distance: 3000,
...@@ -539,13 +601,15 @@ $(function () { ...@@ -539,13 +601,15 @@ $(function () {
success: function (res) { success: function (res) {
let resArr = res.data.numList; let resArr = res.data.numList;
if (resArr.length > 0) { if (resArr.length > 0) {
let html = ''; let html = "";
resArr.map((ele, index) => { resArr.map((ele, index) => {
html += `<p>${ele.legendName}<font class="num">${ele.num}</font></p>`; html += `<p>${ele.legendName}<font class="num">${ele.num}</font></p>`;
}); });
$('#escboxBottomItem1 .resouce .tbl').html('<p>资源名称<font class="num">资源数量</font></p>' + html); $("#escboxBottomItem1 .resouce .tbl").html(
'<p>资源名称<font class="num">资源数量</font></p>' + html
);
} else { } else {
$('#escboxBottomItem1 .resouce .tbl').html('暂无资源!'); $("#escboxBottomItem1 .resouce .tbl").html("暂无资源!");
} }
}, },
}; };
...@@ -559,7 +623,7 @@ $(function () { ...@@ -559,7 +623,7 @@ $(function () {
mapSearch( mapSearch(
{ {
distance: 3000, distance: 3000,
keywords: '', keywords: "",
latitude: obj.latitude, latitude: obj.latitude,
longitude: obj.longitude, longitude: obj.longitude,
}, },
...@@ -571,7 +635,7 @@ $(function () { ...@@ -571,7 +635,7 @@ $(function () {
addFlag(); addFlag();
}, 3000); }, 3000);
}, },
'close', "close"
); );
} }
/*加中心点旗帜*/ /*加中心点旗帜*/
...@@ -579,7 +643,7 @@ $(function () { ...@@ -579,7 +643,7 @@ $(function () {
let overlays = [], let overlays = [],
poiIcon = new AMap.Icon({ poiIcon = new AMap.Icon({
size: new AMap.Size(102, 102), size: new AMap.Size(102, 102),
image: './images/flag.png', image: "./images/flag.png",
imageSize: new AMap.Size(100, 100), imageSize: new AMap.Size(100, 100),
imageOffset: new AMap.Pixel(0, 0), imageOffset: new AMap.Pixel(0, 0),
}); });
...@@ -597,7 +661,7 @@ $(function () { ...@@ -597,7 +661,7 @@ $(function () {
}, },
//态势决策 //态势决策
carryPlan() { carryPlan() {
let html = '', let html = "",
_this = this, _this = this,
opt = { opt = {
/* 查询已关联预案 */ url: apis.searchEventPlan + currentEventObj.id, /* 查询已关联预案 */ url: apis.searchEventPlan + currentEventObj.id,
...@@ -609,18 +673,18 @@ $(function () { ...@@ -609,18 +673,18 @@ $(function () {
`<p style="text-decoration: underline;cursor:pointer;" onclick="window.CAEVT.checkPlan(&quot;${obj.planId}&quot;)">预案标题:${obj.planTitle}</p>` + `<p style="text-decoration: underline;cursor:pointer;" onclick="window.CAEVT.checkPlan(&quot;${obj.planId}&quot;)">预案标题:${obj.planTitle}</p>` +
`<p>预案等级:${obj.planLevel}级</p>` + `<p>预案等级:${obj.planLevel}级</p>` +
`<p>所属部门:${obj.deptName}</p>`; `<p>所属部门:${obj.deptName}</p>`;
if (checkEventEype == 'review') { if (checkEventEype == "review") {
html += `<p>增补预案内容:${obj.addPlanContent}</p>`; html += `<p>增补预案内容:${obj.addPlanContent}</p>`;
$('#addPlan, #carryPalnBtn').hide(); $("#addPlan, #carryPalnBtn").hide();
} else { } else {
$('#addPlan, #carryPalnBtn').show(); $("#addPlan, #carryPalnBtn").show();
} }
$('.item2 .cn').html(html); $(".item2 .cn").html(html);
} }
} }
}, },
}; };
$('body').on('click', '#carryPalnBtn', function () { $("body").on("click", "#carryPalnBtn", function () {
layLayer.confirm(`确定启动预案吗?`, function () { layLayer.confirm(`确定启动预案吗?`, function () {
CARYEVENTS.carryPlanEv(); CARYEVENTS.carryPlanEv();
}); });
...@@ -629,7 +693,7 @@ $(function () { ...@@ -629,7 +693,7 @@ $(function () {
}, },
//事件处理过程 //事件处理过程
eventCirculate() { eventCirculate() {
let html = '', let html = "",
opt = { opt = {
url: apis.checkCirculate + currentEventObj.id, url: apis.checkCirculate + currentEventObj.id,
success: function (res) { success: function (res) {
...@@ -638,12 +702,14 @@ $(function () { ...@@ -638,12 +702,14 @@ $(function () {
res.data.map((ele, inde) => { res.data.map((ele, inde) => {
let date = ele.handleTime.substring(0, 10), let date = ele.handleTime.substring(0, 10),
time = ele.handleTime.substring(11, 16); time = ele.handleTime.substring(11, 16);
html += `<li><p>${date}<br><span>${time}</span></p><div class="con">${inde + 1 + '.'} ${ele.handleContent}</div></li>`; html += `<li><p>${date}<br><span>${time}</span></p><div class="con">${
inde + 1 + "."
} ${ele.handleContent}</div></li>`;
}); });
$('ul.timeLine').html(html); $("ul.timeLine").html(html);
$(`#esc-tit .abt:eq(2)`).addClass('done'); $(`#esc-tit .abt:eq(2)`).addClass("done");
} else { } else {
$('ul.timeLine').html('暂无处理过程!'); $("ul.timeLine").html("暂无处理过程!");
} }
} }
}, },
...@@ -657,10 +723,10 @@ $(function () { ...@@ -657,10 +723,10 @@ $(function () {
success: function (res) { success: function (res) {
if (res.code == 0) { if (res.code == 0) {
if (res.data && res.data.evaluateContent) { if (res.data && res.data.evaluateContent) {
$('#evaluatCon').html(res.data.evaluateContent); $("#evaluatCon").html(res.data.evaluateContent);
$(`#esc-tit .abt:eq(3)`).addClass('done'); $(`#esc-tit .abt:eq(3)`).addClass("done");
} else { } else {
$('#evaluatCon').html('暂无评估内容!'); $("#evaluatCon").html("暂无评估内容!");
} }
} }
}, },
...@@ -671,12 +737,16 @@ $(function () { ...@@ -671,12 +737,16 @@ $(function () {
changeStatus(step, EventId = null) { changeStatus(step, EventId = null) {
let _this = this, let _this = this,
opt = { opt = {
url: apis.changeStatus + `${EventId == null ? currentEventObj.id : EventId}/${step}`, url:
apis.changeStatus +
`${EventId == null ? currentEventObj.id : EventId}/${step}`,
success: function (res) { success: function (res) {
if (res.code == 0 && EventId == null) { if (res.code == 0 && EventId == null) {
_this.toStepChange(step); //跳转 _this.toStepChange(step); //跳转
if (step == 1) { if (step == 1) {
let index = socketCurrEventsArr.findIndex((ele) => ele.id == currentEventObj.id); let index = socketCurrEventsArr.findIndex(
(ele) => ele.id == currentEventObj.id
);
socketCurrEventsArr.splice(index, 1); socketCurrEventsArr.splice(index, 1);
} }
CARYEVENTS.getEventList(); //刷新列表 CARYEVENTS.getEventList(); //刷新列表
...@@ -691,22 +761,24 @@ $(function () { ...@@ -691,22 +761,24 @@ $(function () {
let _this = this; let _this = this;
toIndex = Number(toIndex); toIndex = Number(toIndex);
$(`.escbox-bottom, #esc-tit`).show(); $(`.escbox-bottom, #esc-tit`).show();
$(`#esc-tit .abt`).addClass('not').removeClass('done'); $(`#esc-tit .abt`).addClass("not").removeClass("done");
if (toIndex > 0) { if (toIndex > 0) {
let num = toIndex - 1; let num = toIndex - 1;
while (num > 0) { while (num > 0) {
num--; num--;
$(`#esc-tit .abt:eq(${num})`).addClass('done'); $(`#esc-tit .abt:eq(${num})`).addClass("done");
} }
} }
$(`#esc-tit .abt:eq(${toIndex - 1})`).removeClass('not'); $(`#esc-tit .abt:eq(${toIndex - 1})`).removeClass("not");
$(`.escbox-bottom .item${toIndex}`).show().siblings().hide(); $(`.escbox-bottom .item${toIndex}`).show().siblings().hide();
_this.switchItem(toIndex); _this.switchItem(toIndex);
}, },
//获取相应item的内容 //获取相应item的内容
switchItem(toIndex) { switchItem(toIndex) {
let _this = this; let _this = this;
$(`.escbox-bottom .item${toIndex} h3`).html(`事件名称:${currentEventObj.eventName}`); $(`.escbox-bottom .item${toIndex} h3`).html(
`事件名称:${currentEventObj.eventName}`
);
switch (toIndex) { switch (toIndex) {
case 1: case 1:
_this.estimateEvent(); _this.estimateEvent();
...@@ -728,171 +800,183 @@ $(function () { ...@@ -728,171 +800,183 @@ $(function () {
*/ */
var cont = 0; var cont = 0;
var heatmap; var heatmap;
marker['heatmk'] = []; marker["heatmk"] = [];
var BOTMTOOLBAR = { var BOTMTOOLBAR = {
//GIS调度 //GIS调度
eventDevelopAnalysis() { eventDevelopAnalysis() {
/*removeAllOverlay(); /*removeAllOverlay();
map.setCenter([114.195771, 38.247808]); map.setCenter([114.195771, 38.247808]);
$('#legend a').removeClass('selected');*/ $('#legend a').removeClass('selected');*/
if(cont==0){ if (cont == 0) {
this.initEventDevelope(); this.initEventDevelope();
cont++; cont++;
}else{ } else {
cont = 0; cont = 0;
heatmap.hide(); heatmap.hide();
map.remove(marker['heatmk']); map.remove(marker["heatmk"]);
map.setZoom(11); map.setZoom(11);
} }
}, },
//查询事件列表 //查询事件列表
getHeatmap() { getHeatmap() {
var data = {}; var data = {};
if("year" == $("#choiceTime input[type = 'radio']:checked").val()){ if ("year" == $("#choiceTime input[type = 'radio']:checked").val()) {
if(0==$("#sel_year").val() || '' == $("#sel_year").val()){ if (0 == $("#sel_year").val() || "" == $("#sel_year").val()) {
layLayer.alert('请选择年份!'); layLayer.alert("请选择年份!");
return; return;
} }
data.year = $("#sel_year").val(); data.year = $("#sel_year").val();
}else{ } else {
if((0==$("#sel_year").val() || '' == $("#sel_year").val()) || (00==$("#sel_month").val() || '' == $("#sel_month").val())){ if (
layLayer.alert('请选择年月!'); 0 == $("#sel_year").val() ||
return; "" == $("#sel_year").val() ||
} 00 == $("#sel_month").val() ||
if($("#sel_month").val()<10){ "" == $("#sel_month").val()
data.yearAndMonth = $("#sel_year").val()+"-0"+ $("#sel_month").val(); ) {
}else{ layLayer.alert("请选择年月!");
data.yearAndMonth = $("#sel_year").val()+"-"+ $("#sel_month").val(); return;
}
if ($("#sel_month").val() < 10) {
data.yearAndMonth =
$("#sel_year").val() + "-0" + $("#sel_month").val();
} else {
data.yearAndMonth =
$("#sel_year").val() + "-" + $("#sel_month").val();
}
}
if (heatmap) {
heatmap.hide();
map.remove(marker["heatmk"]);
}
let _this = this,
opt = {
url: apis.getEventInfoList,
data: data,
success: function (res) {
if (res.code == 0) {
let resData = res.data.pageData;
let history = resData.historyEventList;
let data = [];
for (var i = 0; i < history.length; i++) {
let location = {};
location.lat = history[i].latitude;
location.lng = history[i].longitude;
location.count = 50;
data.push(location);
//_this.estimateEvent(aa[i]);
var poiIcon = new AMap.Icon({
size: new AMap.Size(0, 0),
});
var heatmk = new AMap.Marker({
map: map,
icon: poiIcon,
offset: new AMap.Pixel(-20, -20),
position: [history[i].longitude, history[i].latitude],
});
marker["heatmk"].push(heatmk);
heatmk.setLabel({
offset: new AMap.Pixel(0, -5),
content: history[i].eventName,
direction: "top",
});
} }
} map.plugin(["AMap.Heatmap"], function () {
if(heatmap){ //初始化heatmap对象
heatmap.hide(); heatmap = new AMap.Heatmap(map, {
map.remove(marker['heatmk']); radius: 27, //给定半径
} opacity: [0, 0.8],
let _this = this, gradient: {
opt = { 0.5: "#8CFC0A",
url: apis.getEventInfoList, 0.8: "yellow",
data: data, 1.0: "red",
success: function (res) {
if (res.code == 0) {
let resData = res.data.pageData;
let history = resData.historyEventList;
let data =[];
for(var i=0;i<history.length;i++){
let location ={};
location.lat = history[i].latitude;
location.lng =history[i].longitude;
location.count=50;
data.push(location);
//_this.estimateEvent(aa[i]);
var poiIcon = new AMap.Icon({
size: new AMap.Size(0, 0),
});
var heatmk = new AMap.Marker({
map: map,
icon: poiIcon,
offset: new AMap.Pixel(-20, -20),
position: [history[i].longitude, history[i].latitude],
});
marker["heatmk"].push(heatmk);
heatmk.setLabel({
offset: new AMap.Pixel(0, -5),
content: history[i].eventName,
direction: 'top',
});
}
map.plugin(["AMap.Heatmap"], function () {
//初始化heatmap对象
heatmap = new AMap.Heatmap(map, {
radius: 27, //给定半径
opacity: [0, 0.8],
gradient:{
0.5: '#8CFC0A',
0.8: 'yellow',
1.0: 'red'
}
});
heatmap.setDataSet({
data: data,
max: 100
});
});
map.setZoom(12);
}
}, },
}; });
jQueryAjax(opt); heatmap.setDataSet({
}, data: data,
//初始化事态查询 max: 100,
initEventDevelope(){ });
var date = new Date() });
var y = date.getFullYear(); map.setZoom(12);
var m = date.getMonth()+1; }
var d = date.getDate(); },
var nowTime = ""+ y+"-0"+m+"-"+d; };
var detaliHtml = '<div style="width: 570px;height: 200px;margin: 23px;" id="choiceTime">'+ jQueryAjax(opt);
'<div style="height: 30px;">' + },
'<div>'+ //初始化事态查询
'<input name="data" type="radio" style="float: left;position: relative;top: 3px;" value="year" checked/>'+ initEventDevelope() {
'<p style="float: left; margin-left: 5px;">年份</p>'+ var date = new Date();
' </div>'+ var y = date.getFullYear();
'<div>'+ var m = date.getMonth() + 1;
'<input name="data" type="radio" style="float: left;margin-left: 50px;position: relative;top: 3px;" value="month"/>'+ var d = date.getDate();
'<p style="margin-left: 5px;">月份</p>'+ var nowTime = "" + y + "-0" + m + "-" + d;
' </div>' + var detaliHtml =
'</div>'+ '<div style="width: 570px;height: 200px;margin: 23px;" id="choiceTime">' +
' <p style="float: left;height: 30px;line-height: 30px;">年份:</P>'+ '<div style="height: 30px;">' +
'<select id="sel_year" style="float: left;position: relative;top: 6px;width: 73px;border: 1px solid #708090;border-radius: 2px;"></select>'+ "<div>" +
' <p style="float: left;margin-left: 45px;height: 30px;line-height: 30px;">月份:</P>'+ '<input name="data" type="radio" style="float: left;position: relative;top: 3px;" value="year" checked/>' +
'<select id="sel_month" style="position: relative;top: -5px;width: 60px;border: 1px solid #708090;border-radius: 2px;"></select>'+ '<p style="float: left; margin-left: 5px;">年份</p>' +
'<button id="eventBtn" style="position: relative;top: 81px;left: -61px;background-color: #4476a7;color: white;width: 157px;height: 43px;border-radius: 5px;">事态分析查询</button>'+ " </div>" +
'</div>'; "<div>" +
CARYEVENTS.tanDialogFun('事态分析','qqfdsf',detaliHtml); '<input name="data" type="radio" style="float: left;margin-left: 50px;position: relative;top: 3px;" value="month"/>' +
$.ms_DatePicker({ '<p style="margin-left: 5px;">月份</p>' +
YearSelector: ".sel_year", " </div>" +
MonthSelector: ".sel_month", "</div>" +
DaySelector: ".sel_day" ' <p style="float: left;height: 30px;line-height: 30px;">年份:</P>' +
}); '<select id="sel_year" style="float: left;position: relative;top: 6px;width: 73px;border: 1px solid #708090;border-radius: 2px;"></select>' +
$.ms_DatePicker(); ' <p style="float: left;margin-left: 45px;height: 30px;line-height: 30px;">月份:</P>' +
'<select id="sel_month" style="position: relative;top: -5px;width: 60px;border: 1px solid #708090;border-radius: 2px;"></select>' +
'<button id="eventBtn" style="position: relative;top: 81px;left: -61px;background-color: #4476a7;color: white;width: 157px;height: 43px;border-radius: 5px;">事态分析查询</button>' +
"</div>";
CARYEVENTS.tanDialogFun("事态分析", "qqfdsf", detaliHtml);
$.ms_DatePicker({
YearSelector: ".sel_year",
MonthSelector: ".sel_month",
DaySelector: ".sel_day",
});
$.ms_DatePicker();
if("year" == $("#choiceTime input[type = 'radio']:checked").val()){ if ("year" == $("#choiceTime input[type = 'radio']:checked").val()) {
$("#sel_month").attr("disabled","disabled") $("#sel_month").attr("disabled", "disabled");
} }
$("#choiceTime input[type = 'radio']").click(function () { $("#choiceTime input[type = 'radio']").click(function () {
if("year" == $(this).val()){ if ("year" == $(this).val()) {
$("#sel_month").attr("disabled","disabled"); $("#sel_month").attr("disabled", "disabled");
}else { } else {
$("#sel_month").removeAttr("disabled"); $("#sel_month").removeAttr("disabled");
} }
}) });
$("#eventBtn").click(function () { $("#eventBtn").click(function () {
BOTMTOOLBAR.getHeatmap(); BOTMTOOLBAR.getHeatmap();
}); });
}, },
//值守通讯 //值守通讯
dutyBookFun() { dutyBookFun() {
CARYEVENTS.tanDialogFun('值守通讯录', 'dutyBooklist', '<div id="Booklist"></div>'); CARYEVENTS.tanDialogFun(
"值守通讯录",
"dutyBooklist",
'<div id="Booklist"></div>'
);
layTable.render({ layTable.render({
elem: '#Booklist', elem: "#Booklist",
url: iocUrl + '/frontApi/getDutyContactsList', url: iocUrl + "/frontApi/getDutyContactsList",
method: 'get', method: "get",
cols: [ cols: [
[ [
{ field: 'deptName', title: '部门', align: 'center' }, { field: "deptName", title: "部门", align: "center" },
{ field: 'userName', title: '姓名', align: 'center' }, { field: "userName", title: "姓名", align: "center" },
{ {
field: 'sex', field: "sex",
title: '姓别', title: "姓别",
align: 'center', align: "center",
templet: function (obj) { templet: function (obj) {
return obj.sex == 1 ? '男' : '女'; return obj.sex == 1 ? "男" : "女";
}, },
}, },
{ field: 'mobliePhone', title: '手机号', align: 'center' }, { field: "mobliePhone", title: "手机号", align: "center" },
{ field: 'phone', title: '座机', align: 'center' }, { field: "phone", title: "座机", align: "center" },
{ field: 'email', title: '邮箱', align: 'center' }, { field: "email", title: "邮箱", align: "center" },
], ],
], ],
}); });
...@@ -907,44 +991,48 @@ $(function () { ...@@ -907,44 +991,48 @@ $(function () {
// }, // },
//事件回顾 //事件回顾
EventReview() { EventReview() {
$('.escbox-top').show(); $(".escbox-top").show();
element.tabChange('layTAb', 'layTAb_hisy'); element.tabChange("layTAb", "layTAb_hisy");
}, },
//综合保障 //综合保障
guaranteeFun() { guaranteeFun() {
let opt = { let opt = {
url: iocUrl + '/frontApi/getSecurityInfoNum', url: iocUrl + "/frontApi/getSecurityInfoNum",
success: function (res) { success: function (res) {
let html = ''; let html = "";
CARYEVENTS.tanDialogFun('综合保障', 'ensurelistbox', '<div id="numbox" class="xstty"></div><div id="ensurelist"></div>'); CARYEVENTS.tanDialogFun(
"综合保障",
"ensurelistbox",
'<div id="numbox" class="xstty"></div><div id="ensurelist"></div>'
);
if (res.data.length > 0) { if (res.data.length > 0) {
res.data.map((ele) => { res.data.map((ele) => {
html += `<div class="item" data-code="${ele.legendCode}"><span class="itemTitle">${ele.legendAliasName}</span>&ensp;<span class="num">${ele.num}</span></div>`; html += `<div class="item" data-code="${ele.legendCode}"><span class="itemTitle">${ele.legendAliasName}</span>&ensp;<span class="num">${ele.num}</span></div>`;
}); });
$('#numbox').html(html); $("#numbox").html(html);
$('body').on('click', '.xstty .item', function () { $("body").on("click", ".xstty .item", function () {
$('#ensurelistbox .layui-table-view').show(); $("#ensurelistbox .layui-table-view").show();
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass("active").siblings().removeClass("active");
let lcode = $(this).attr('data-code'); let lcode = $(this).attr("data-code");
layTable.render({ layTable.render({
elem: '#ensurelist', elem: "#ensurelist",
url: iocUrl + `/frontApi/getSecurityInfoList/${lcode}`, url: iocUrl + `/frontApi/getSecurityInfoList/${lcode}`,
method: 'get', method: "get",
cols: [ cols: [
[ [
{ field: 'fullName', title: '名称', align: 'center' }, { field: "fullName", title: "名称", align: "center" },
{ field: 'contacts', title: '联系人', align: 'center' }, { field: "contacts", title: "联系人", align: "center" },
{ field: 'telephone', title: '电话', align: 'center' }, { field: "telephone", title: "电话", align: "center" },
{ field: 'address', title: '地址', align: 'center' }, { field: "address", title: "地址", align: "center" },
{ field: 'introduce', title: '介绍', align: 'center' }, { field: "introduce", title: "介绍", align: "center" },
], ],
], ],
}); });
}); });
} else { } else {
$('#numbox').html('无记录!'); $("#numbox").html("无记录!");
} }
$('#ensurelistbox').show(); $("#ensurelistbox").show();
}, },
}; };
jQueryAjax(opt); jQueryAjax(opt);
...@@ -980,10 +1068,10 @@ $(function () { ...@@ -980,10 +1068,10 @@ $(function () {
// }); // });
// }, // },
//应急预案 //应急预案
genericPlan(key = '', planID = '') { genericPlan(key = "", planID = "") {
function getPlansli() { function getPlansli() {
let opt = { let opt = {
type: 'post', type: "post",
url: apis.plansGetList, url: apis.plansGetList,
data: JSON.stringify({ data: JSON.stringify({
page: 1, page: 1,
...@@ -992,40 +1080,45 @@ $(function () { ...@@ -992,40 +1080,45 @@ $(function () {
success: function (res) { success: function (res) {
let Arr = res.data.pageData, let Arr = res.data.pageData,
resArr; resArr;
if (planID != '') resArr = Arr.filter((ele) => ele.id == planID); if (planID != "") resArr = Arr.filter((ele) => ele.id == planID);
else resArr = [...Arr]; else resArr = [...Arr];
if (resArr.length > 0) { if (resArr.length > 0) {
layTable.render({ layTable.render({
elem: '#yingjlist', elem: "#yingjlist",
size: 'sm', size: "sm",
cols: [ cols: [
[ [
{ field: 'deptName', title: '所属单位' }, { field: "deptName", title: "所属单位" },
{ field: 'planTitle', title: '预案标题' }, { field: "planTitle", title: "预案标题" },
{ {
field: 'planLevel', field: "planLevel",
title: '预案登记', title: "预案登记",
templet: function (d) { templet: function (d) {
return d.planLevel + '级'; return d.planLevel + "级";
}, },
}, },
{ {
field: '', field: "",
title: '操作', title: "操作",
templet: function (d) { templet: function (d) {
let s; let s;
if (key == 'gl') { if (key == "gl") {
s = `<span class="txtbtn yjck" onclick="window.CAEVT.check(${JSON.stringify(d).replace( s = `<span class="txtbtn yjck" onclick="window.CAEVT.check(${JSON.stringify(
d
).replace(
/"/g, /"/g,
'&quot;', "&quot;"
)})">查看</span>&nbsp;&nbsp;<span class="txtbtn glya" onclick="window.CAEVT.connect(${JSON.stringify(d).replace( )})">查看</span>&nbsp;&nbsp;<span class="txtbtn glya" onclick="window.CAEVT.connect(${JSON.stringify(
/"/g, d
'&quot;', ).replace(/"/g, "&quot;")})">关联预案</span>`;
)})">关联预案</span>`; } else if (planID != "") {
} else if (planID != '') { s = `<span class="txtbtn yjck" onclick="window.CAEVT.check(${JSON.stringify(
s = `<span class="txtbtn yjck" onclick="window.CAEVT.check(${JSON.stringify(d).replace(/"/g, '&quot;')})">详情</span>`; d
).replace(/"/g, "&quot;")})">详情</span>`;
} else { } else {
s = `<span class="txtbtn yjck" onclick="window.CAEVT.check(${JSON.stringify(d).replace(/"/g, '&quot;')})">查看</span>`; s = `<span class="txtbtn yjck" onclick="window.CAEVT.check(${JSON.stringify(
d
).replace(/"/g, "&quot;")})">查看</span>`;
} }
return s; return s;
}, },
...@@ -1039,8 +1132,12 @@ $(function () { ...@@ -1039,8 +1132,12 @@ $(function () {
}; };
jQueryAjax(opt); jQueryAjax(opt);
} }
CARYEVENTS.tanDialogFun('应急预案', 'yingjlistbox', '<div id="yingjlist"></div><div class="yjdetali detali"></div>'); CARYEVENTS.tanDialogFun(
$('#yingjlistbox').addClass('yjbs'); "应急预案",
"yingjlistbox",
'<div id="yingjlist"></div><div class="yjdetali detali"></div>'
);
$("#yingjlistbox").addClass("yjbs");
getPlansli(); getPlansli();
}, },
}; };
...@@ -1053,65 +1150,65 @@ $(function () { ...@@ -1053,65 +1150,65 @@ $(function () {
function defalutMApP() { function defalutMApP() {
cont = 0; cont = 0;
map.clearMap(); map.clearMap();
district.search('新乐市', function (status, result) { district.search("新乐市", function (status, result) {
var bounds = result.districtList[0].boundaries; var bounds = result.districtList[0].boundaries;
var mask = []; var mask = [];
for (var i = 0; i < bounds.length; i += 1) { for (var i = 0; i < bounds.length; i += 1) {
mask.push([bounds[i]]); mask.push([bounds[i]]);
} }
var defaultCenter = [114.72995, 38.37417]; var defaultCenter = [114.72995, 38.37417];
map = new AMap.Map('container', { map = new AMap.Map("container", {
mask: mask, mask: mask,
center: defaultCenter, center: defaultCenter,
// resizeEnable: true, // resizeEnable: true,
disableSocket: true, disableSocket: true,
viewMode: '3D', viewMode: "3D",
showLabel: true, showLabel: true,
// labelzIndex: 110, // labelzIndex: 110,
pitch: 8, pitch: 8,
zoom: 11.5, zoom: 11.5,
// mapStyle: 'amap://styles/darkblue', // mapStyle: 'amap://styles/darkblue',
mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae', mapStyle: "amap://styles/3b679a15f448a4740ba2ff7524e1a4ae",
}); });
//添加描边 //添加描边
for (var i = 0; i < bounds.length; i += 1) { for (var i = 0; i < bounds.length; i += 1) {
new AMap.Polyline({ new AMap.Polyline({
path: bounds[i], path: bounds[i],
strokeColor: '#22eae4', strokeColor: "#22eae4",
strokeWeight: 5, strokeWeight: 5,
strokeOpacity: 7, strokeOpacity: 7,
map: map, map: map,
}); });
} }
}) });
$('#esc-tit , .escbox-bottom, .escbox-bottom .item').hide(); $("#esc-tit , .escbox-bottom, .escbox-bottom .item").hide();
$('.abt').addClass('not').removeClass('done'); $(".abt").addClass("not").removeClass("done");
} }
$('.escTitClose').click(function () { $(".escTitClose").click(function () {
// defalutMApP(); // defalutMApP();
$('#esc-tit ').hide(); $("#esc-tit ").hide();
}); });
$('.closeBtn').click(function () { $(".closeBtn").click(function () {
$('.escbox-top,.escbox-bottom,#esc-tit').hide(); $(".escbox-top,.escbox-bottom,#esc-tit").hide();
defalutMApP(); defalutMApP();
}); });
$('.escbox-tip-b .item').click(function () { $(".escbox-tip-b .item").click(function () {
let inde = $(this).index('.escbox-tip-b .item'); let inde = $(this).index(".escbox-tip-b .item");
$('.escbox-top').show(); $(".escbox-top").show();
element.on('tab(layTAb)', function (data) { element.on("tab(layTAb)", function (data) {
defalutMApP(); defalutMApP();
}); });
if (inde == 0) element.tabChange('layTAb', 'layTAb_curr'); if (inde == 0) element.tabChange("layTAb", "layTAb_curr");
if (inde == 1) element.tabChange('layTAb', 'layTAb_hisy'); if (inde == 1) element.tabChange("layTAb", "layTAb_hisy");
}); });
//关联按钮事件 //关联按钮事件
$('body').on('click', '#connectPlanBtn', function () { $("body").on("click", "#connectPlanBtn", function () {
BOTMTOOLBAR.genericPlan('gl'); BOTMTOOLBAR.genericPlan("gl");
}); });
$('#bottomMenu .btn').click(function () { $("#bottomMenu .btn").click(function () {
let inde = $(this).index('#bottomMenu .btn'); let inde = $(this).index("#bottomMenu .btn");
//if (inde == 0) BOTMTOOLBAR.GISFun(); //if (inde == 0) BOTMTOOLBAR.GISFun();
if (inde == 0) BOTMTOOLBAR.eventDevelopAnalysis(); if (inde == 0) BOTMTOOLBAR.eventDevelopAnalysis();
if (inde == 1) BOTMTOOLBAR.dutyBookFun(); if (inde == 1) BOTMTOOLBAR.dutyBookFun();
...@@ -1121,18 +1218,18 @@ $(function () { ...@@ -1121,18 +1218,18 @@ $(function () {
if (inde == 4) BOTMTOOLBAR.genericPlan(); if (inde == 4) BOTMTOOLBAR.genericPlan();
// if (inde == 6) BOTMTOOLBAR.konwlegeFun(); // if (inde == 6) BOTMTOOLBAR.konwlegeFun();
}); });
$('body').on('click', '.cbtn', function () { $("body").on("click", ".cbtn", function () {
let id = $(this).parent().parent().attr('id'); let id = $(this).parent().parent().attr("id");
$(`#${id}`).hide(); $(`#${id}`).hide();
if (id == 'ensurelistbox') $('#ensurelistbox .layui-table-view').hide(); if (id == "ensurelistbox") $("#ensurelistbox .layui-table-view").hide();
if (id == 'zsbox') $('.yjbs .detali').hide(); if (id == "zsbox") $(".yjbs .detali").hide();
}); });
$('.ty') $(".ty")
.find('a.abt') .find("a.abt")
.click(function () { .click(function () {
if (checkEventEype == 'review') { if (checkEventEype == "review") {
let ind = $(this).index('a.abt'); let ind = $(this).index("a.abt");
$('.escbox-bottom').show(); $(".escbox-bottom").show();
$(`.escbox-bottom .item${ind + 1}`) $(`.escbox-bottom .item${ind + 1}`)
.show() .show()
.siblings() .siblings()
...@@ -1144,11 +1241,11 @@ $(function () { ...@@ -1144,11 +1241,11 @@ $(function () {
}); });
}); });
$('#mouseToolBtn').click(function () { $("#mouseToolBtn").click(function () {
$('.toolsbox').show('fast'); $(".toolsbox").show("fast");
}); });
$('.toolsbox h3 span').click(function () { $(".toolsbox h3 span").click(function () {
$('.toolsbox').hide(); $(".toolsbox").hide();
}); });
// 启动 // 启动
...@@ -1161,14 +1258,14 @@ $(function () { ...@@ -1161,14 +1258,14 @@ $(function () {
createLegendList(); createLegendList();
// renderAlarmNum(); // renderAlarmNum();
renderEventNum(); renderEventNum();
createDeviceNumPieChart('deviceNumPie'); createDeviceNumPieChart("deviceNumPie");
createDeviceNumLineChartday('deviceNumLineday'); createDeviceNumLineChartday("deviceNumLineday");
createDeviceNumLineChartmouth('deviceNumLinemouth'); createDeviceNumLineChartmouth("deviceNumLinemouth");
renderLegendTypeNum('categoryAlarmNum'); renderLegendTypeNum("categoryAlarmNum");
initVideo('videoHandler'); initVideo("videoHandler");
getAlarmData(); getAlarmData();
//调用当前值班信息接口 //调用当前值班信息接口
getDutyInfo(); getDutyInfo();
// showMulitVideo(); // showMulitVideo();
// 连接 websocket // 连接 websocket
......
...@@ -627,7 +627,7 @@ function createLegendList() { ...@@ -627,7 +627,7 @@ function createLegendList() {
tmpLi += tmpLi +=
'<li data-id="' + '<li data-id="' +
items[i].id + items[i].id +
'" class="legendItem"><div><img class="legendPic" style="padding: 7px 0;" src="./images/legend/' + '" class="legendItem"><div class="first"><img class="legendPic" style="padding: 7px 0;" src="./images/legend/' +
items[i].legendCode + items[i].legendCode +
'.png" alt=""/><span class="legendTitle">' + '.png" alt=""/><span class="legendTitle">' +
items[i].legendName + items[i].legendName +
...@@ -645,15 +645,15 @@ function createLegendList() { ...@@ -645,15 +645,15 @@ function createLegendList() {
var legendchild=document.getElementsByClassName("legendchild"); var legendchild=document.getElementsByClassName("legendchild");
for (var i=0; i<legenditem.length;i++){ for (var i=0; i<legenditem.length;i++){
// legenditem[i].index = i; // legenditem[i].index = i;
legenditem[i].onclick = function(){ // legenditem[i].onclick = function(){
if(this.lastChild.style.display == "none"){ // if(this.lastChild.style.display == "none"){
this.style.backgroundImage="url(images/vectorbot.png)"; // this.style.backgroundImage="url(images/vectorbot.png)";
this.lastChild.style.display = "block"; // this.lastChild.style.display = "block";
}else{ // }else{
this.style.backgroundImage="url(images/re.png)"; // this.style.backgroundImage="url(images/re.png)";
this.lastChild.style.display = "none"; // this.lastChild.style.display = "none";
} // }
}; // };
} }
// 默认显示视频监控设备 // 默认显示视频监控设备
// $('.legendItem').eq(0).click(); // $('.legendItem').eq(0).click();
......
...@@ -317,7 +317,7 @@ table.layui-table th { ...@@ -317,7 +317,7 @@ table.layui-table th {
.legendItem { .legendItem {
margin: 3px 0; margin: 3px 0;
overflow: hidden; overflow: hidden;
cursor: pointer; /* cursor: pointer; */
float: left; float: left;
background: url(../images/re.png); background: url(../images/re.png);
background-size: 100% 100%; background-size: 100% 100%;
...@@ -325,11 +325,16 @@ table.layui-table th { ...@@ -325,11 +325,16 @@ table.layui-table th {
padding: 0 5px; padding: 0 5px;
margin-left: 10px; margin-left: 10px;
} }
.legendItem .first{
cursor: pointer;
}
.legendchild{ .legendchild{
display: none; display: none;
width: auto; width: auto;
position: fixed; position: fixed;
bottom: 85px; bottom: 50px;
height: 70px;
} }
/* .legendItem:active + .legendchild{ /* .legendItem:active + .legendchild{
display: block; display: block;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment