From 86061ffe7d31a694862faa8cf3e25aef355b68f4 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sat, 24 Apr 2021 09:35:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
public/map/images/point.png | 0
public/map/widgets/securityMap/SecurityMap.js | 35 +++++++-
public/map/widgets/supervisoryMap/SupervisoryMap.js | 203 ++++++++++++++++++++++++++++++++++++++------------
public/map/widgets/securityMap/SecurityMap.css | 1
4 files changed, 186 insertions(+), 53 deletions(-)
diff --git a/public/map/images/point.png b/public/map/images/point.png
new file mode 100644
index 0000000..407e872
--- /dev/null
+++ b/public/map/images/point.png
Binary files differ
diff --git a/public/map/widgets/securityMap/SecurityMap.css b/public/map/widgets/securityMap/SecurityMap.css
index 607af90..1c5a942 100644
--- a/public/map/widgets/securityMap/SecurityMap.css
+++ b/public/map/widgets/securityMap/SecurityMap.css
@@ -56,6 +56,7 @@
background-color: #ffffff;
position: absolute;
display: none;
+ border-radius: 5px;
}
.tips span {
diff --git a/public/map/widgets/securityMap/SecurityMap.js b/public/map/widgets/securityMap/SecurityMap.js
index 4e57a9d..09b16d2 100644
--- a/public/map/widgets/securityMap/SecurityMap.js
+++ b/public/map/widgets/securityMap/SecurityMap.js
@@ -203,6 +203,12 @@
//删除电子围栏点击事件
$(".mapBtn .delBtn").click(function() {
+ if (!that.isEngineer) {
+ layui.use('layer', function() {
+ layui.layer.msg('请先新增电子围栏信息!')
+ })
+ return;
+ }
//需选中电子围栏,然后进行删除
layer.confirm('是否确认删除', {
btn: ['确定', '取消'], //按钮
@@ -237,8 +243,10 @@
//判断
if (that.isEngineer) {
layui.use('layer', function() {
- layui.layer.msg('已存在电子围栏');
- })
+ layui.layer.msg('已存在电子围栏');
+ })
+ //新增按钮颜色改回
+ $("#insertEngineeringMap").css("color", "#757575");
} else {
layui.use('layer', function() {
layui.layer.msg('请开始划分电子围栏');
@@ -250,6 +258,12 @@
//编辑电子围栏
$('.mapBtn .editBtn').click(function() {
+ if (!that.isEngineer) {
+ layui.use('layer', function() {
+ layui.layer.msg('请先新增电子围栏信息!')
+ })
+ return;
+ }
$("#editEngineeringMap").css("color", "#3385FF");
//修改为可编辑状态
that.isEdit = true;
@@ -366,8 +380,12 @@
success: function(result) {
if (result.code == 200) {
layui.use('layer', function() {
- layui.layer.msg('新增电子围栏成功!')
- })
+ layui.layer.msg('新增电子围栏成功!')
+ })
+ //清除点信息
+ that.polygonData = [];
+ //新增按钮颜色改回
+ $("#insertEngineeringMap").css("color", "#757575");
}
}
})
@@ -548,6 +566,7 @@
layui.layer.msg('电子围栏修改成功!');
})
$("#editEngineeringMap").css("color", "#757575");
+ $("#securityMapTips4").css("display", "none");
self.isEdit = false;
self.editToolbarStatus = false;
}
@@ -564,6 +583,7 @@
var tool = 0;
this.editToolbar = new Edit(this._map);
+
// if (registry.byId("tool_move").checked) {
tool = tool | Edit.MOVE;
@@ -608,7 +628,11 @@
//在地图上新增点
addPoint: function(entitys, lgtd, lttd, img) {
- var symbol = new esri.symbol.PictureMarkerSymbol(img, 22, 22);
+ if (img == undefined) {
+ var symbol = new esri.symbol.PictureMarkerSymbol('./images/point.png', 22, 22);
+ } else {
+ var symbol = new esri.symbol.PictureMarkerSymbol(img, 22, 22);
+ }
var pt = new Point(lgtd, lttd, new SpatialReference({
wkid: 4326
}));
@@ -616,6 +640,7 @@
entitys.add(graphic);
},
+
//绘制多边形
addPolygon: function(entitys, rings) {
entitys.clear();
diff --git a/public/map/widgets/supervisoryMap/SupervisoryMap.js b/public/map/widgets/supervisoryMap/SupervisoryMap.js
index 6d5fb1f..5ed8fd4 100644
--- a/public/map/widgets/supervisoryMap/SupervisoryMap.js
+++ b/public/map/widgets/supervisoryMap/SupervisoryMap.js
@@ -285,16 +285,16 @@
$($('.analysis-container > div')[ind]).stop().show().siblings().stop().hide();
var overText = $('#policeCategory > div:eq(0)').text().trim() == '全部' ? '' : $('#policeCategory > div:eq(0)').text().trim();
var levelText = $('#policeArea > div:eq(0)').text().trim() == '全部' ? '' : $('#policeArea > div:eq(0)').attr('areaid');
- if (ind == 0) {
+ if (ind == 1) {
that.getArea($('#policeArea'));
that.getPoliceTableAnalysis($($('.analysis-container > div')[ind]).find('.tbody tbody'),
$('#analysis_select_time_start').val() + ':00',
$('#analysis_select_time_end').val() + ':00', overText, levelText)
- } else if (ind == 1) {
+ } else if (ind == 2) {
that.getOwnerType($('#ownerCategory'));
that.getOwnerDj($('#ownerLevel'), '');
that.getOwnerTable($($('.analysis-container > div')[ind]).find('.tbody tbody'), '', '');
- } else if (ind == 2) {
+ } else if (ind == 0) {
that.getEquipmentTable($($('.analysis-container > div')[ind]).find('.tbody tbody'), '');
}
@@ -349,28 +349,70 @@
})
// 警情列表中的点击事件
- $('.analysis-container-police .analysis-table-content .tbody').off('click', 'tr').on('click', 'tr', function () {
+ $('.analysis-container-police .analysis-table-content .tbody').off('click', 'tr').on('click', 'tr', function (event) {
var id = $(this).attr('term-list');
- var url = './popup/html/police-details.html?obj=' + id;
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/police-details.css'
- });
- that.layuiLayer.close(that.layuiLayer.index);
- that.layuiLayer.open({
- title: '警情详情',
- type: 2,
- shadeClose: true,
- shade: false,
- maxmin: false, //开启最大化最小化按钮
- area: ['500px', '400px'],
- offset: 'auto',
- skin: 'police-details',
- content: url,
- closeBtn: 1,
- });
- })
+ // var url = './popup/html/police-details.html?obj=' + id;
+ // layui.use('layer', function () {
+ // that.layuiLayer = layui.layer;
+ // that.layuiLayer.config({
+ // extend: 'myskin/police-details.css'
+ // });
+ // that.layuiLayer.close(that.layuiLayer.index);
+ // that.layuiLayer.open({
+ // title: '警情详情',
+ // type: 2,
+ // shadeClose: true,
+ // shade: false,
+ // maxmin: false, //开启最大化最小化按钮
+ // area: ['500px', '400px'],
+ // offset: 'auto',
+ // skin: 'police-details',
+ // content: url,
+ // closeBtn: 1,
+ // });
+ // })
+
+ event.stopPropagation();
+ var lgtd = Number($(this).find('input').attr('lgtd'));
+ var lttd = Number($(this).find('input').attr('lttd'));
+ // console.log($(this).find('input').attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
+ that._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+
+ var y = +window.innerHeight / 2 + 200;
+ var x = (+window.innerWidth - 360) / 2 + 360 + 70;
+ // document.elementFromPoint(x, y).click();
+ // console.log(x, y)
+
+ // var a = document.elementFromPoint(21, 122);
+ // console.log(a);
+
+ // console.log(that.clusterLayer, that._map, 6)
+ // console.log(id, 'id');
+ // console.log(that.clusterLayer);
+ var Tattributes = null
+ , ds = that.clusterLayer.allData;
+ for (var key in ds) {
+ if (ds[key].id == id) {
+ Tattributes = ds[key];
+ }
+ }
+ if (mySelf.onceTimeMethod == null) {//防抖.限制时间内点击次数,否则会造成不能正确销毁前一个弹窗
+ var evtdata = {};
+ evtdata = {
+ graphic: {
+ attributes: Tattributes,
+ },
+ screenX: x,
+ screenY: y,
+ }
+ that.clusterLayer._clickOpenOnclick(evtdata, '控制端', that.clusterLayer.indexs);
+ mySelf.onceTimeMethod = setTimeout(() => {
+ mySelf.onceTimeMethod = null;
+ }, mySelf.onceTime);
+ } else {
+ };
})
$('.analysis-container-police .analysis-table-content .tbody').off('click', '.location').on('click', '.location', function (event) {
event.stopPropagation();
@@ -384,28 +426,70 @@
})
// 业主列表中的点击事件
- $('.analysis-container-owner .analysis-table-content .tbody').off('click', 'tr').on('click', 'tr', function () {
+ $('.analysis-container-owner .analysis-table-content .tbody').off('click', 'tr').on('click', 'tr', function (event) {
var id = $(this).attr('term-list');
- var url = './popup/html/owner-details.html?id=' + id;
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/owner-details.css'
- });
- that.layuiLayer.close(that.layuiLayer.index);
- that.layuiLayer.open({
- title: '业主详情',
- type: 2,
- shadeClose: true,
- shade: false,
- maxmin: false, //开启最大化最小化按钮
- area: ['500px', '340px'],
- offset: 'auto',
- skin: 'owner-details',
- content: url,
- closeBtn: 1,
- });
- })
+ // var url = './popup/html/owner-details.html?id=' + id;
+ // layui.use('layer', function () {
+ // that.layuiLayer = layui.layer;
+ // that.layuiLayer.config({
+ // extend: 'myskin/owner-details.css'
+ // });
+ // that.layuiLayer.close(that.layuiLayer.index);
+ // that.layuiLayer.open({
+ // title: '业主详情',
+ // type: 2,
+ // shadeClose: true,
+ // shade: false,
+ // maxmin: false, //开启最大化最小化按钮
+ // area: ['500px', '340px'],
+ // offset: 'auto',
+ // skin: 'owner-details',
+ // content: url,
+ // closeBtn: 1,
+ // });
+ // })
+
+ event.stopPropagation();
+ var lgtd = Number($(this).find('input').attr('lgtd'));
+ var lttd = Number($(this).find('input').attr('lttd'));
+ // console.log($(this).find('input').attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
+ that._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+
+ var y = +window.innerHeight / 2 + 200;
+ var x = (+window.innerWidth - 360) / 2 + 360 + 70;
+ // document.elementFromPoint(x, y).click();
+ // console.log(x, y)
+
+ // var a = document.elementFromPoint(21, 122);
+ // console.log(a);
+
+ // console.log(that.clusterLayer, that._map, 6)
+ // console.log(id, 'id');
+ // console.log(that.clusterLayer);
+ var Tattributes = null
+ , ds = that.clusterLayer.allData;
+ for (var key in ds) {
+ if (ds[key].id == id) {
+ Tattributes = ds[key];
+ }
+ }
+ if (mySelf.onceTimeMethod == null) {//防抖.限制时间内点击次数,否则会造成不能正确销毁前一个弹窗
+ var evtdata = {};
+ evtdata = {
+ graphic: {
+ attributes: Tattributes,
+ },
+ screenX: x,
+ screenY: y,
+ }
+ that.clusterLayer._clickOpenOnclick(evtdata, '控制端', that.clusterLayer.indexs);
+ mySelf.onceTimeMethod = setTimeout(() => {
+ mySelf.onceTimeMethod = null;
+ }, mySelf.onceTime);
+ } else {
+ };
})
$('.analysis-container-owner .analysis-table-content .tbody').off('click', '.location').on('click', '.location', function (event) {
event.stopPropagation();
@@ -677,14 +761,16 @@
})
},
getPoliceTableAnalysis: function (dom, beginTime, endTime, waringType, addvcd) {
- dom.empty();
+ dom.empty();//警情信息
var that = this;
$.ajax({
url: "/api/blade-jfpts/alarm/alarm/page?current=1&size=99999&waringType=&beginTime=" + beginTime + "&endTime=" + endTime + "&province=36&city=3601&district=" + addvcd,
type: 'get',
dataType: 'JSON',
success: function (data) {
- var result = data.data.records;
+ // var result = data.data.records;
+ var oldData = data.data.records
+ var result = oldData;
var str = '';
that.entitysData = [];
that.analysisAddEntitys.clear();
@@ -706,12 +792,31 @@
y = result[i].alarmTime.substr(5, 5);
h = result[i].alarmTime.substr(11, 5);
a = Number(i) + 1;
+
str += '<tr term-list=' + result[i].id + '>';
str += '<td>' + a + '</td>';
str += '<td title=' + result[i].waringType + '>' + result[i].waringType + '</td>';
str += '<td title=' + result[i].alarmPeople + '>' + result[i].alarmPeople + '</td>';
str += "<td><a href='javascript:;' title=" + time + ">" + y + ' ' + h + "</a></td>";
str += "<td class='location'> <input type='button' value='定位'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+ // if (result[i].state != '') {
+ // stares = '故障';
+ // str += "<td class='location'> <input style='background-image:linear-gradient(to right, #F49966 , #F49966' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+ // } else {
+ // if (result[i].jtype != 1) {
+ // if (result[i].onlineStatus == 1) {//el-tabs__active-bar
+ // stares = '在线';
+ // str += "<td class='location'> <input style='background-image:linear-gradient(to right, #32C1A2 , #32C1A2' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+ // } else {
+ // stares = '离线';
+ // str += "<td class='location'> <input style='background-image:linear-gradient(to right, #CDCDCD , #CDCDCD' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+ // }
+ // } else {
+ // stares = '警报';
+ // str += "<td class='location'> <input style='background-image:linear-gradient(to right, #F35B5B , #F35B5B' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+ // }
+ // }
+
str += '</tr>';
dom.append(str);
str = '';
@@ -767,7 +872,9 @@
type: 'GET',
dataType: 'JSON',
success: function (data) {
- var result = data.data;
+ // var result = data.data;
+ var oldData = data.data
+ var result = oldData;
var str = '';
that.entitysData = [];
that.analysisAddEntitys.clear();
--
Gitblit v1.9.3