From 9969576896f182ac69b55a1df0107b3be0e36376 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 26 Jul 2021 20:54:17 +0800
Subject: [PATCH] 巡逻区域修改提交
---
public/map/widgets/patrolManagement/template.html | 270 -
src/views/policeInformationDistribution/patrolManagement.vue | 3
public/map/widgets/patrolManagement/template copy.html | 261 +
public/map/popup/html/region-name.html | 8
public/map/widgets/patrolManagement/PatrolManagement copy.js | 2071 +++++++++++
src/views/policeInformationDistribution/patrolManagement copy.vue | 1119 ++++++
public/map/widgets/patrolManagement/PatrolManagement.js | 4374 +++++++++++++-----------
public/map/widgets/patrolManagement/PatrolManagement01.js | 2116 +++++++++++
public/map/widgets/patrolManagement/PatrolManagement.css | 182
public/map/widgets/patrolManagement/template01.html | 262 +
10 files changed, 8,286 insertions(+), 2,380 deletions(-)
diff --git a/public/map/popup/html/region-name.html b/public/map/popup/html/region-name.html
index 02c48d2..b59ea25 100644
--- a/public/map/popup/html/region-name.html
+++ b/public/map/popup/html/region-name.html
@@ -16,12 +16,12 @@
<li>
<input type="text" placeholder="请输入区域名称" class='region-name-input'>
</li>
- <li>
+ <!-- <li>
<textarea placeholder="请输入区域描述" style="resize:none;outline:none;" class='region-name-textarea'></textarea>
- </li>
- <li>
+ </li> -->
+ <!-- <li>
<input type="button" value='开始编辑' class="start-editing">
- </li>
+ </li> -->
</ul>
</div>
</body>
diff --git a/public/map/widgets/patrolManagement/PatrolManagement copy.js b/public/map/widgets/patrolManagement/PatrolManagement copy.js
new file mode 100644
index 0000000..5a6e6ce
--- /dev/null
+++ b/public/map/widgets/patrolManagement/PatrolManagement copy.js
@@ -0,0 +1,2071 @@
+/*
+ * @Description:
+ * @Version: 1.0
+ * @Author: yangsx
+ * @Date: 2019-12-09 19:01:40
+ * @LastEditors: yangsx
+ * @LastEditTime: 2019-12-14 14:44:57
+ */
+define([
+ "dojo",
+ "dojo/_base/declare",
+ "dojo/_base/lang",
+ "base/BaseWidget",
+ "dojo/text!widgets/patrolManagement/template.html",
+ "base/AppEvent",
+ "base/ConfigData",
+ "widgets/patrolManagement/config",
+ "dojo/dom",
+ "dojo/dom-construct",
+ "dojo/dom-attr",
+ "dojo/dom-style",
+ "dojo/on",
+ "esri/layers/ArcGISDynamicMapServiceLayer",
+ "esri/layers/ArcGISTiledMapServiceLayer",
+ "esri/layers/FeatureLayer",
+ "controls/tab/TabControl",
+ "esri/dijit/SymbolStyler",
+ "esri/styles/basic",
+ "dojo/_base/array",
+ "esri/InfoTemplate",
+ "esri/tasks/query",
+ "esri/tasks/QueryTask",
+ "esri/Color",
+ "esri/toolbars/edit",
+ "esri/graphic",
+ "esri/geometry/Point",
+ "esri/geometry/Polyline",
+ "esri/geometry/Polygon",
+ "esri/geometry/Extent",
+ "esri/tasks/FeatureSet",
+ "esri/renderers/HeatmapRenderer",
+ "esri/symbols/SimpleLineSymbol",
+ "esri/symbols/SimpleFillSymbol",
+ "esri/symbols/PictureMarkerSymbol",
+ "esri/symbols/SimpleMarkerSymbol",
+ "esri/SpatialReference",
+ "esri/tasks/GeometryService",
+ "esri/tasks/ProjectParameters",
+ "esri/layers/GraphicsLayer",
+ "esri/layers/LabelLayer",
+ "esri/symbols/TextSymbol",
+ "esri/renderers/SimpleRenderer",
+ "esri/renderers/ClassBreaksRenderer",
+ "esri/tasks/Geoprocessor",
+ "esri/tasks/DataFile",
+ "esri/geometry/webMercatorUtils",
+ "esri/symbols/Font",
+ "esri/geometry/ScreenPoint",
+ "esri/layers/ImageParameters",
+ "esri/geometry/geometryEngine",
+ "esri/dijit/PopupTemplate",
+ "widgets/clientManagement/FlareClusterLayer_v3",
+ "dojo/domReady!"
+], function(
+ dojo,
+ declare,
+ lang,
+ BaseWidget,
+ template,
+ AppEvent,
+ ConfigData,
+ config,
+ dom,
+ domConstruct,
+ domAttr,
+ domStyle,
+ on,
+ ArcGISDynamicMapServiceLayer,
+ ArcGISTiledMapServiceLayer,
+ FeatureLayer,
+ TabControl,
+ SymbolStyler,
+ basic,
+ arrayUtils,
+ InfoTemplate,
+ Query,
+ QueryTask,
+ Color,
+ Edit,
+ Graphic,
+ Point,
+ Polyline,
+ Polygon,
+ Extent,
+ FeatureSet,
+ HeatmapRenderer,
+ SimpleLineSymbol,
+ SimpleFillSymbol,
+ PictureMarkerSymbol,
+ SimpleMarkerSymbol,
+ SpatialReference,
+ GeometryService,
+ ProjectParameters,
+ GraphicsLayer,
+ LabelLayer,
+ TextSymbol,
+ SimpleRenderer,
+ ClassBreaksRenderer,
+ Geoprocessor,
+ DataFile,
+ webMercatorUtils,
+ Font,
+ ScreenPoint,
+ ImageParameters,
+ geometryEngine,
+ PopupTemplate,
+ FlareClusterLayer
+) {
+ var Widget = declare([BaseWidget], {
+ widgetName: "PatrolManagement",
+ label: "巡逻管理",
+ templateString: template,
+ _map: null,
+ objThis: null,
+ _siteLayer: new GraphicsLayer(),
+ layuiLayer: null,
+ layuiLadate: null,
+ tabIndex: 0,
+
+ // 保留添加实体图层的变量
+ addEntitys: null,
+ entitysData: [],
+
+ // 是否派发保安的 文字
+ treatmentIndex: null,
+ securityFlag: false,
+ editParentInd: null,
+
+ // 存储新增点,线,面,数据的地方
+ polygonData: [],
+ polygonFlag: false,
+ editToolbar: null,
+ addPolygonEntitys: null,
+
+ // 所有的面图层
+ entityPolygonAll: null,
+
+ // 用来存储区域名称
+ globalRegionName: null,
+
+ // 用来区域得最大最小经纬度
+ currentDrawing: [],
+
+ // 巡逻区域或者巡逻路线的描述
+ routeOrRegionDescribe: null,
+
+ // 用来记录巡逻区域或者巡逻路线的下标的
+ patrolIndex: 0,
+
+ // 拖拽
+ isDown: false,
+ x: 0,
+ y: 0,
+ offset: null,
+ moveThis: null,
+ // 电子围栏需要新增的Id
+ newElectronicFenceId: null,
+
+ // 新增路线时,派发人员,人员名称,以及人员id
+ peopleRealName: null,
+ pepleRealId: null,
+ constructor: function(options, srcRefNode) {
+ this._map = options.map;
+ objThis = this;
+
+
+ this.addEntitys = new GraphicsLayer({ id: 'addEntitys' });
+
+ // 添加点面线的图层
+ this.addPolygonEntitys = new GraphicsLayer({ id: 'addPolygonEntitys' });
+ // 添加所有图层的地方
+ this.entityPolygonAll = new GraphicsLayer({ id: 'entityPolygonAll' });
+
+
+ this._map.addLayer(this.addEntitys);
+
+
+ this._map.addLayer(this.addPolygonEntitys);
+ this._map.addLayer(this.entityPolygonAll);
+
+
+ },
+
+ startup: function() {
+ //加载树
+ layui.use('tree', function() {
+ var tree = layui.tree;
+
+ //渲染
+ var inst1 = tree.render({
+ elem: '#region-tree',
+ data: [{
+ title: '江西',
+ id: 1,
+ spread: true,
+ children: [{
+ title: '南昌',
+ id: 10,
+ children: [{
+ title: '高新区',
+ id: 20
+ }]
+ }]
+ }],
+ showLine: false,
+ click: function(obj) {
+ var data = obj.data; //获取当前点击的节点数据
+ layer.msg('状态:' + obj.state + '<br>节点数据:' + JSON.stringify(data));
+ }
+ });
+ });
+
+ objThis._map.addLayer(objThis._siteLayer);
+ var that = this;
+ // 顶部tab得切换事件
+ $('.police-dispatching-tab li').click(function() {
+ if (that.tabIndex == $(this).index()) return;
+ if (that.entitysData.length > 0) {
+ that.addEntitys.clear();
+ that.entitysData = [];
+ }
+
+ that.patrolIndex = 0;
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+
+ $(this).addClass('on').siblings().removeClass('on');
+ var ind = $(this).index();
+ $($('.police-container > div')[ind]).stop().show().siblings().stop().hide();
+ if (ind == 0) {
+ $('#distributeCategory div:eq(0)').html('全部' + '<i></i>');
+ $('#distributeState div:eq(0)').html('全部' + '<i></i>');
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
+ } else if (ind == 1) {
+ // that.getOwnerTable($($('.analysis-container > div')[ind]).find('.tbody tbody'), '', '');
+ $('.police-dispatching .police-container .police-container-patrol .tab-header li:eq(0)').addClass('on').siblings().removeClass('on');
+ $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0)').stop().show().siblings().hide();
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
+ } else if (ind == 2) {
+ that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
+ }
+ that.tabIndex = $(this).index();
+ })
+ // 警情分发中的行点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', 'tr').on('click', 'tr', function() {
+ var lgtd = Number($(this).attr('lgtd'));
+ var lttd = Number($(this).attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 })); //根据输入坐标信息找地图上的点
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+ })
+ // 编辑,跟进按钮元素的父元素的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.operation').on('click', '.operation', function(event) {
+ event.stopPropagation();
+ })
+ // 警情分发中的编辑按钮的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.edit').on('click', '.edit', function(event) {
+ event.stopPropagation();
+ that.editParentInd = null;
+ that.editParentInd = $(this).parent().parent().index();
+ var id = $(this).attr('term-list');
+ that.treatmentIndex = null;
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ if (!$('.police-container-distribute-details').is(':hidden')) {
+ $('.police-container-distribute-details').stop().hide();
+ }
+ $('.police-container-distribute-details .content table tbody').empty();
+ var str = '';
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ var result = data.data[0];
+ var t = result.galarmTime.substr(0, 10);
+ var e = result.galarmTime.substr(11);
+ var time = t + ' ' + e;
+
+ str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
+
+ str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+
+ str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+
+ str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
+
+ str += "<tr> <td>处理方式:</td> <td class='treatment-method'> <input type='radio' name='treatmentMethod' value='派发保安' lgtd=" + result.jd + " lttd=" + result.wd + "> <span>派发保安</span> <input type='radio' name='treatmentMethod' value='提示业主'> <span>提示业主</span> </td> <td>处理人:</td> <td class='securityname'></td> </tr>";
+
+ str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + result.deviceNumber + "</td> </tr>";
+ $('.police-container-distribute-details .content table tbody').append(str);
+ $('.police-container-distribute-details .handle-button .confirm').attr('police-id', result.id);
+ $('.police-container-distribute-details .handle-button').stop().show();
+ $('.police-container-distribute-details .header h4').text('警情分发');
+ $('.police-container-distribute-details').stop().show();
+ $('.police-container-distribute-details .content table tbody').off('click', '.treatment-method input').on('click', '.treatment-method input', function() {
+ if (that.treatmentIndex != $(this).val()) {
+ if ($(this).val() == '派发保安') {
+ var str = '';
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').empty();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/position/position/selectry',
+ type: 'POST',
+ data: {
+ coordinate: "point(" + $(this).attr('lgtd') + "," + $(this).attr('lttd') + ")"
+ },
+ dataType: 'JSON',
+ success: function(data) {
+
+ var result = data.data;
+
+ for (var i = 0; i < result.length; i++) {
+ str += "<tr> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].sname + "</td> <td>" + result[i].distance.toFixed(2) + "</td> <td><input type='radio' name='securityStaff' securityid=" + result[i].snumber + " securityname=" + result[i].sname + "> </td> </tr>"
+ }
+
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').append(str);
+ }
+ })
+ $('.police-container-distribute-details .security-guard-nearby').stop().show();
+ } else {
+ $('.police-container-distribute-details .content table tbody .securityname').text('');
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ that.treatmentIndex = $(this).val();
+ }
+ })
+ }
+ })
+ })
+ // 警情分发中的详情的确认按钮
+ $('.police-container-distribute-details .handle-button .confirm').off('click').click(function() {
+ var self = this;
+ layui.use('layer', function() {
+ var layer = layui.layer;
+ if (that.treatmentIndex == null) {
+ layer.msg('请选择处理方式', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ return
+ } else {
+ if (that.treatmentIndex == '派发保安') {
+ if (that.securityFlag == false) {
+ layer.msg('请选取保安', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ return
+ }
+ }
+
+ }
+ var id = $(self).attr('police-id');
+ var handletype = null;
+ if (that.treatmentIndex != null) {
+ if (that.treatmentIndex == '派发保安') {
+ handletype = '0';
+ } else {
+ handletype = '1';
+ }
+ }
+ // 发送请求修改警单数据
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/updateInfo',
+ type: 'POST',
+ data: {
+ id: id,
+ // handleP: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').attr('people-id'),
+ // handName: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').text(),
+ handleP: $('.police-container-distribute-details .content table tbody .securityname').attr('id'),
+ handName: $('.police-container-distribute-details .content table tbody .securityname').text(),
+ handletype: handletype,
+ type: '2'
+ },
+ dataType: 'JSON',
+ success: function(data) {
+ if (data.code == 200) {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+
+ $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(2)').text('处理中');
+
+ $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(4)').html("<input class='follow-up' type='button' value='跟进' >");
+ }
+ }
+ })
+ });
+ })
+ // 警情分发中的跟进按钮的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.follow-up').on('click', '.follow-up', function() {
+ var id = $(this).attr('term-list');
+
+ if (!$('.police-container-distribute-details').is(':hidden')) {
+ $('.police-container-distribute-details').stop().hide();
+ }
+
+ $('.police-container-distribute-details .content table tbody').empty();
+
+ var str = '';
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ var result = data.data[0];
+
+ var t = result.galarmTime.substr(0, 10);
+ var e = result.galarmTime.substr(11);
+ var time = t + ' ' + e;
+
+
+ str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
+
+ str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+
+ str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+
+ str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
+
+ str += "<tr> <td>处理方式:</td> <td class='treatment-method'> " + (result.type == 2 ? '处理中' : '待处理') + " </td> <td>处理人:</td> <td class='securityname'> " + result.handName + " </td> </tr>";
+
+ str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + 1111 + "</td> </tr>";
+ $('.police-container-distribute-details .content table tbody').append(str);
+ $('.police-container-distribute-details .header h4').text('警情跟进');
+ $('.police-container-distribute-details .handle-button').stop().hide();
+ $('.police-container-distribute-details').stop().show();
+
+
+ }
+ })
+
+
+ })
+ // 警情分发中的详情的取消按钮
+ $('.police-container-distribute-details .handle-button .cancel').off('click').click(function() {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+ })
+ // 警情分发中详情的关闭按钮
+ $('.police-container-distribute-details .header .close').off('click').click(function() {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+ })
+ // 派发保安的确认按钮
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-confirm input').off('click').click(function() {
+ var list = $('.police-container-distribute-details .security-guard-nearby .security-staff-content input');
+ that.securityFlag = false;
+ var id = null;
+ var securityname = null;
+ for (var i = 0; i < list.length; i++) {
+ if ($(list[i]).prop('checked') == true) {
+ that.securityFlag = true;
+ id = $(list[i]).attr('securityid');
+ securityname = $(list[i]).attr('securityname');
+ break;
+ }
+ }
+
+ if (that.securityFlag == false) {
+ layui.use('layer', function() {
+ var layer = layui.layer;
+ layer.msg('请选取保安', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ });
+ } else {
+
+ $('.police-container-distribute-details .content table tbody .securityname').attr('id', id).text(securityname);
+
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+
+ })
+ // 警情信息中类别移入事件
+ $('#distributeCategory').mouseenter(function() {
+ if ($('#distributeCategory .select-list').is(':hidden')) {
+ $('#distributeCategory .select-list').stop().slideDown(0);
+ }
+ })
+ // 警情信息中得类别移出事件
+ $('#distributeCategory').mouseleave(function() {
+ if (!$('#distributeCategory .select-list').is(':hidden')) {
+ $('#distributeCategory .select-list').stop().slideUp(0);
+ }
+ })
+ // 警情信息中类别移入事件
+ $('#distributeState').mouseenter(function() {
+ if ($('#distributeState .select-list').is(':hidden')) {
+ $('#distributeState .select-list').stop().slideDown(0);
+ }
+ })
+ // 警情信息中得类别移出事件
+ $('#distributeState').mouseleave(function() {
+ if (!$('#distributeState .select-list').is(':hidden')) {
+ $('#distributeState .select-list').stop().slideUp(0);
+ }
+ })
+ // 警情信息类,业主信息类,设备信息类别,具体项的点击事件
+ $('.police-container > div .select-list').off('click', 'li').on('click', 'li', function(event) {
+
+ var text = $(this).text();
+ $(this).parent().parent().prev().html(text + '<i></i>');
+ $(this).parent().parent().stop().slideUp(0);
+
+ if (text == '全部') text = '';
+
+ var textOrr = '';
+ var textList = '';
+ var stateType = '';
+ if (that.tabIndex == 0) {
+ // that.getPoliceTable($('.analysis-container-police').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), text);
+ if ($(this).attr('key')) {
+ textOrr = $('#distributeState div:eq(0)').text().trim();
+ textList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
+
+ for (var i = 0; i < textList.length; i++) {
+ if (textOrr == $(textList[i]).text()) {
+ stateType = $(textList[i]).attr('statetype');
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', $(this).attr('addvcd'), stateType);
+
+ } else {
+ textOrr = $('#distributeCategory div:eq(0)').text().trim();
+ textList = $('.police-dispatching .police-container .distribute-district .select-list ul li');
+
+ for (var i = 0; i < textList.length; i++) {
+ if (textOrr == $(textList[i]).text()) {
+ stateType = $(textList[i]).attr('addvcd');
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', stateType, $(this).attr('stateType'));
+
+ }
+ }
+
+ })
+ // 时间查询
+ $('#dispatchingSelectTime').off('click').click(function() {
+ var times = $(this).prevAll();
+ // 开始时间
+ var startTime = $(times[1]).val();
+ // 结束时间
+ var endTime = $(times[0]).val();
+
+
+ var textOne = $('#distributeCategory div:eq(0)').text().trim();
+ var addvcd = '';
+ var list = $('.police-dispatching .police-container .distribute-district .select-list ul li');
+ if (textOne == '全部') {
+ addvcd = '';
+ } else {
+ if (list.length > 0) {
+ for (var i = 0; i < list.length; i++) {
+ if (textOne == $(list[i]).text()) {
+ addvcd = $(list[i]).attr('addvcd')
+ }
+ }
+ }
+ }
+
+ var textTwo = $('#distributeState div:eq(0)').text().trim();
+ var stateType = '';
+ var stateList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
+ if (textTwo == '全部') {
+ stateType = '';
+ } else {
+ if (stateList.length > 0) {
+ for (var i = 0; i < stateList.length; i++) {
+ if (textTwo == $(stateList[i]).text()) {
+ stateType = $(stateList[i]).attr('statetype')
+ }
+ }
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), startTime, endTime, '', addvcd, stateType);
+ })
+ // 巡逻区域中的行点击事件
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .table .tbody').off('click', 'tr').on('click', 'tr', function() {
+
+
+ var flyid = $(this).attr('flyid');
+ var flyname = $(this).attr('flyname');
+ var extent = null;
+
+ for (var i = 0; i < that.currentDrawing.length; i++) {
+ if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].regionName) {
+ extent = that.currentDrawing[i].extent;
+ }
+ }
+ // debugger
+ that._map.setExtent(extent.expand(1.5));
+
+ // var myFeatureExtent = new Extent(extent.)
+ // thisObj._map.setExtent(myFeatureExtent.expand(2));
+
+ // var lgtd = Number($(this).attr('lgtd'));
+ // var lttd = Number($(this).attr('lttd'));
+
+ // var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
+ // that._map.centerAndZoom(position, 14);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+ })
+ // 巡逻区域的新增按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .add').off('click').click(function() {
+ var url = './popup/html/region-name.html';
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/region-name.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '区域名称',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '206px'],
+ offset: 'auto',
+ skin: 'region-name',
+ content: url,
+ closeBtn: 1,
+ success: function(layero, index) {
+ layero.find('iframe').contents().find(".start-editing").off('click').click(function() {
+ // 区域名称
+ var regionName = layero.find('iframe').contents().find('.region-name-input').val();
+ var regionDescribe = layero.find('iframe').contents().find('.region-name-textarea').val();
+ if (regionName == '') {
+ that.layuiLayer.msg('请填写区域名称', {
+ time: 1000
+ })
+ return
+ }
+
+ if (regionDescribe == '') {
+ that.layuiLayer.msg('请填写区域描述', {
+ time: 1000
+ })
+ return
+ }
+
+ that.globalRegionName = regionName;
+ that.routeOrRegionDescribe = regionDescribe;
+
+ // 开启,可以勾选线段
+ that.polygonFlag = true;
+ that.layuiLayer.close(index);
+
+ })
+ }
+ });
+ })
+
+ })
+ // 查找按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .query').off('click').click(function() {
+ var routerName = $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val();
+ // if (routerName == '') {
+ // layui.use('layer', function () {
+ // layui.layer.msg('请填写区域名称', {
+ // time: 1000
+ // })
+ // })
+ // return
+ // }
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), routerName);
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val('');
+
+ })
+
+ // 保安出警管理表格中点击事件
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'input').on('click', 'input', function(event) {
+ event.stopPropagation();
+ var lgtd = Number($(this).parent().parent().attr('lgtd'));
+ var lttd = Number($(this).parent().parent().attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 })); //根据输入坐标信息找地图上的点
+ that.newElectronicFenceId = null;
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+ var graphic = that.entityPolygonAll.graphics;
+ for (var i = 0; i < graphic.length; i++) {
+ if (graphic[i].objId.id == $(this).attr('resultid')) {
+ if (graphic[i].geometry.rings[0].length > 0) {
+ that.polygonFlag = false;
+ that.electronicFence();
+ that.activateToolbar(graphic[i]);
+ } else {
+ layui.use('layer', function() {
+ layui.layer.msg('请开始划分电子围栏');
+ })
+ that.polygonFlag = true;
+ that.newElectronicFenceId = graphic[i].objId;
+ }
+ }
+ }
+ })
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr').on('click', 'tr', function(event) {
+ event.stopPropagation();
+ var lgtd = Number($(this).attr('lgtd'));
+ var lttd = Number($(this).attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 })); //根据输入坐标信息找地图上的点
+
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+ var snumber = $(this).attr('term-snumber');
+
+ var url = './popup/html/personnel-information-management.html?id=' + snumber;
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/personnel-information-management.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '保安人员信息',
+ type: 2,
+ shadeClose: true,
+ shade: false,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['400px', '220px'],
+ offset: 'auto',
+ skin: 'personnel-information-management',
+ content: url,
+ closeBtn: 1,
+ });
+ })
+ })
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr td').on('click', 'tr td', function(event) {
+ if ($(this).index() == 4) {
+ event.stopPropagation();
+ return;
+
+ }
+ })
+
+ // 巡逻管理中,巡逻路线和巡逻区域的切换换
+ $('.police-dispatching .police-container .police-container-patrol .tab-header li').off('click').click(function() {
+ if (that.patrolIndex == $(this).index()) return;
+ $(this).addClass('on').siblings().removeClass('on');
+ $(".police-dispatching .police-container .police-container-patrol .main-content li:eq(" + $(this).index() + ")").stop().show().siblings().stop().hide();
+
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+ if ($(this).index() == 1) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ var result = res.data;
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ for (var i = 0; i < result.length; i++) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ }
+ }
+ })
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+ } else {
+
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
+ }
+
+ that.patrolIndex = $(this).index();
+ })
+ // 巡逻管理下面的巡逻路线中的select选择框的移入事件
+ $('#patrolRoute').mouseenter(function() {
+ if ($('#patrolRoute .select-list').is(':hidden')) {
+ $('#patrolRoute .select-list').stop().slideDown(0);
+ }
+ })
+ // 巡逻管理下面的巡逻路线中的select选择框的移出事件
+ $('#patrolRoute').mouseleave(function() {
+ if (!$('#patrolRoute .select-list').is(':hidden')) {
+ $('#patrolRoute .select-list').stop().slideUp(0);
+ }
+ })
+ // 巡逻路线中区域选择的具体项的点击事件
+ $('.police-dispatching .police-container .police-container-patrol .select-list').off('click', 'li').on('click', 'li', function(event) {
+ var text = $(this).text();
+ $(this).parent().parent().prev().html(text + '<i></i>').attr('regionId', $(this).attr('regionId'));
+ $(this).parent().parent().stop().slideUp(0);
+ })
+ // 巡逻路线中的新增按钮的点击事件
+ $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .add').off('click').click(function() {
+ var url = './popup/html/route-name-layer.html';
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/route-name-layer.css'
+ });
+ that.layuiLayer.closeAll();
+ that.layuiLayer.open({
+ title: '路线名称及描述',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '266px'],
+ offset: 'auto',
+ skin: 'route-name-layer',
+ content: url,
+ closeBtn: 1,
+ resize: false,
+ success: function(layero, index) {
+ layero.find('iframe').contents().find(".start-editing").off('click').click(function() {
+ // 区域名称 or 路线名称
+ var routeName = layero.find('iframe').contents().find('.route-name-layer-input').val();
+ var routeDescribe = layero.find('iframe').contents().find('.route-name-layer-textarea').val();
+ var peopleRealName = layero.find('iframe').contents().find('.route-personnel').val();
+ var pepleRealId = layero.find('iframe').contents().find('.route-personnel').attr('peopleid');
+ if (routeName == '') {
+ that.layuiLayer.msg('请填写路线名称', {
+ time: 1000
+ })
+ return
+ }
+
+ if (routeDescribe == '') {
+ that.layuiLayer.msg('请填写路线描述', {
+ time: 1000
+ })
+ return
+ }
+
+ if (pepleRealId == '') {
+ that.layuiLayer.msg('请选择人员', {
+ time: 1000
+ })
+ return
+ }
+ that.peopleRealName = peopleRealName;
+ that.pepleRealId = pepleRealId;
+
+ that.globalRegionName = routeName;
+ that.routeOrRegionDescribe = routeDescribe;
+ // // 开启,可以勾选线段
+ that.polygonFlag = true;
+ that.layuiLayer.close(index);
+
+ })
+ }
+ });
+ })
+
+ })
+ // 巡逻路线行点击事件
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr').on('click', 'tr', function() {
+ var flyid = $(this).attr('flyid');
+ var flyname = $(this).attr('flyname');
+ var extent = null;
+ for (var i = 0; i < that.currentDrawing.length; i++) {
+ if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].routeName) {
+ extent = that.currentDrawing[i].extent;
+ }
+ }
+ that._map.setExtent(extent.expand(1.5));
+ })
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr td').on('click', 'tr td', function(event) {
+ if ($(this).index() == 4) {
+ event.stopPropagation();
+ return;
+
+ }
+ })
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'input').on('click', 'input', function(event) {
+ event.stopPropagation();
+ var routeName = $(this).parent().parent().children('td:eq(2)').text();
+ var routeId = $(this).parent().parent().attr('flyid');
+ var peopleName = $(this).parent().parent().children('td:eq(1)').text();
+ var self = this;
+
+
+ var url = './popup/html/routename-and-peoplename.html?routeName=' + routeName + '&routeId=' + routeId + '&peopleName=' + peopleName;
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/routename-and-peoplename.css'
+ });
+ that.layuiLayer.closeAll();
+ that.layuiLayer.open({
+ title: '路线巡逻人员',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '172px'],
+ offset: 'auto',
+ skin: 'routename-and-peoplename',
+ content: url,
+ closeBtn: 1,
+ resize: false,
+ success: function(layero, index) {
+ layero.find('iframe').contents().find(".confirm-update").off('click').click(function() {
+
+ // 区域名称 or 路线名称
+ var peoplelayerName = layero.find('iframe').contents().find('.peoplename-update').val();
+ var peoplelayerId = layero.find('iframe').contents().find('.peoplename-update').attr('peopleid');
+
+ console.log(peoplelayerName, peoplelayerId);
+
+ if (peoplelayerName == peopleName) {
+ that.layuiLayer.close(index);
+ that.layuiLayer.msg('人员未更改!');
+ } else {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/duty/duty/updatedtInfo',
+ type: 'POST',
+ data: {
+ rid: routeId,
+ snumber: peoplelayerId,
+ sname: peoplelayerName
+ },
+ dataType: 'JSON',
+ success: function(res) {
+ if (res.code == 200) {
+ that.layuiLayer.close(index);
+ $(self).parent().parent().children('td:eq(1)').text(peoplelayerName);
+ that.layuiLayer.msg('人员已更改!');
+ }
+ }
+ })
+ }
+
+ })
+ }
+ });
+ })
+
+
+ })
+
+
+ // 查找按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .operation .query').off('click').click(function() {
+ var routerName = $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val();
+ // if (routerName == '') {
+ // layui.use('layer', function () {
+ // layui.layer.msg('请填写区域名称', {
+ // time: 1000
+ // })
+ // })
+ // return
+ // }
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), routerName);
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val('');
+ })
+
+ },
+ open: function() {
+ var that = this;
+
+ $("#tabcontainer").css("width", "360px");
+ $('#mapcontentClass').addClass('client-max-map'); //追加样式
+ AppEvent.dispatchAppEvent(AppEvent.APPLICATION_RESIZE, {});
+
+
+ document.oncontextmenu = function(event) {
+ event.preventDefault();
+ };
+
+ document.getElementById('mainMapWidget').onmousedown = function(event) {
+ if (event.button == 2) {
+ if (that.polygonData.length < 2) {
+ layui.use('layer', function() {
+ layui.layer.msg('不能形成区域,请继续划分!!!')
+ })
+ return;
+ }
+ if (that.polygonFlag == true) {
+ // 勾画最后一个点
+ var normalizedVal = webMercatorUtils.xyToLngLat(event.mapPoint.x, event.mapPoint.y);
+ that.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ // 声明空字符串,存储数据
+ var dataStr = '';
+ var data = null;
+ if (that.patrolIndex == 1) {
+ that.addPolyline(that.addPolygonEntitys, that.polygonData);
+ // 获取数据
+ data = that.addPolygonEntitys.graphics[0].geometry.paths[0];
+ } else {
+ that.addPolygon(that.addPolygonEntitys, that.polygonData);
+ // 获取数据
+ data = that.addPolygonEntitys.graphics[0].geometry.rings[0];
+ }
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ if (that.tabIndex == 1) {
+ if (that.patrolIndex == 1) {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/insertlx',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ routeName: that.globalRegionName,
+ regionId: $('#patrolRoute div:eq(0)').attr('regionid'),
+ routeInfo: dataStr,
+ remarks: that.routeOrRegionDescribe,
+ creatName: ''
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/duty/duty/insertduty',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ sname: that.peopleRealName,
+ snumber: that.pepleRealId,
+ rid: result.data,
+ regionId: $('#patrolRoute div:eq(0)').attr('regionid'),
+ type: 0
+ },
+ success: function(data) {
+ if (data.code == 200) {
+ alert(1);
+ }
+ }
+ })
+ }
+ }
+ })
+
+
+ // that.peopleRealName = peopleRealName;
+ // that.pepleRealId = pepleRealId;
+ } else {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/insterqy',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ regionName: that.globalRegionName,
+ coordinate: dataStr,
+ remarks: that.routeOrRegionDescribe
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
+ }
+ }
+ })
+ }
+ } else if (that.tabIndex == 2) {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/insertes',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ anumber: that.newElectronicFenceId.anumber,
+ aname: that.newElectronicFenceId.aname,
+ routeInfo: dataStr
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
+ }
+ }
+ })
+ }
+
+
+ }
+ that.polygonFlag = false;
+
+ // that.polygonData = [];
+
+
+ }
+ }
+
+
+ that.treatmentIndex = null;
+ that.tabIndex = 0;
+ $('.police-dispatching-tab li:eq(0)').addClass('on').siblings().removeClass('on');
+ $($('.police-container > div')[0]).stop().show().siblings().stop().hide();
+
+
+ $('.police-dispatching .police-container .distribute-district .select-list ul').empty();
+ $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=''>全部</li>");
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/district/district/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ for (var i = 0; i < data.data.length; i++) {
+ $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=" + data.data[i].addvcd + ">" + data.data[i].addvnm + "</li>");
+ }
+ }
+ })
+
+
+ layui.use('laydate', function() {
+ that.layuiLadate = layui.laydate;
+ //执行一个laydate实例 开始
+ that.layuiLadate.render({
+ elem: '#dispatchingStartTime', //指定元素
+ type: "datetime",
+ format: 'yyyy-MM-dd HH:mm',
+ btns: ['confirm'],
+ trigger: 'click',
+ });
+ // 结束
+ that.layuiLadate.render({
+ elem: '#dispatchingEndTime', //指定元素
+ type: "datetime",
+ format: 'yyyy-MM-dd HH:mm',
+ btns: ['confirm'],
+ trigger: 'click',
+ });
+ });
+
+ // that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
+ that.clickHand();
+
+
+
+
+
+
+
+ $('.police-dispatching-tab li:eq(1)').trigger('click');
+ },
+ close: function() {
+
+ $("#tabcontainer").css("width", "66%");
+ $('#mapcontentClass').removeClass('client-max-map'); //删除样式
+
+ this.entitysData = [];
+
+ this.addEntitys.clear();
+
+ this.entityPolygonAll.clear();
+
+ this.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ this.polygonData = [];
+ this.addPolygonEntitys.clear();
+ },
+ // 鼠标点击事件
+ clickHand: function() {
+ var self = this;
+
+
+ self._map.onClick = mapClick;
+
+ // $('#mainMapWidget')[0].ondblclick = function (event) {
+ // event.preventDefault();
+ // // if ()
+ // self.activateToolbar(event.graphic);
+ // return false;
+ // };
+
+
+ function mapClick(evt) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+
+
+ var y = self._map.toMap({
+ spatialReference: '4326',
+ type: "point",
+ x: evt.screenPoint.x,
+ y: evt.screenPoint.y,
+
+ });
+
+ if (self.tabIndex == 0) {
+ if (evt.graphic) {
+ var result = evt.graphic.geometry.entityData;
+ // var liText = evt.graphic.symbol.name;
+ self.policeDetails(result.id);
+ }
+ } else if (self.tabIndex == 1) {
+ if (self.patrolIndex == 1) {
+ // 编辑中的
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ }
+ } else { // 不在编辑中
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.modifyPolygon();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.modifyPolygon()
+ }
+ }
+ } else {
+ // 编辑中的
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else if (self.polygonData.length == 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ } else if (self.polygonData.length > 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolygon(self.addPolygonEntitys, self.polygonData);
+ }
+ } else { // 不在编辑中
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.modifyPolygon();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.modifyPolygon()
+ }
+ }
+ }
+ } else if (self.tabIndex == 2) {
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else if (self.polygonData.length == 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ } else if (self.polygonData.length > 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolygon(self.addPolygonEntitys, self.polygonData);
+ }
+ } else {
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.electronicFence();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.electronicFence()
+ }
+ }
+
+
+ // self.equipmentDetails(result.id);
+ }
+
+ }
+
+
+ // 提示信息
+ $(document).off('mousemove').mousemove(function(e) {
+ var y = e.clientY + 10;
+ var x = e.clientX + 20;
+
+ if (e.clientX < 40) {
+ var x = 40;
+ }
+
+ if (e.clientY < 42) {
+ y = 42;
+ }
+
+ if (e.clientY > ($(window).height() - 82)) {
+ y = ($(window).height() - 66);
+ }
+
+ if (e.clientX > ($(window).width() - 184)) {
+ x = ($(window).width() - 184);
+ }
+
+ if (self.tabIndex == 1 || self.tabIndex == 2) {
+
+ if (self.polygonFlag == true) {
+ $('.police-dispatching .tips').stop().show();
+
+ if (self.polygonData.length == 0) {
+ $('.police-dispatching .tips').text('单击左键开始绘制。');
+ } else {
+ if (e.clientY > ($(window).height() - 98)) {
+ y = ($(window).height() - 88);
+ }
+ $('.police-dispatching .tips').text('单击左键新增加点。单击右键完成绘制。');
+ }
+
+ $('.police-dispatching .tips').css({
+ 'top': y,
+ 'left': x,
+ })
+ } else {
+ $('.police-dispatching .tips').stop().hide();
+ }
+
+ } else {
+ $('.police-dispatching .tips').stop().hide();
+ }
+ })
+ },
+ // 警情详情弹框
+ /**
+ *
+ * @param {number} id 警情ID
+ */
+ policeDetails: function(id) {
+ var that = this;
+ 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,
+ });
+ })
+ },
+ // 业主详情弹框
+ /**
+ *
+ * @param {number} id 警情ID
+ */
+ ownerDetails: function(id) {
+ var that = this;
+ 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,
+ });
+ })
+ },
+ // 设备详情弹框
+ /**
+ *
+ * @param {number} id 设备ID
+ */
+ equipmentDetails: function(id) {
+ var that = this;
+ var url = './popup/html/equipment-details.html?obj=' + id;
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/equipment-details.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '警情详情',
+ type: 2,
+ shadeClose: true,
+ shade: false,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['520px', '320px'],
+ offset: 'auto',
+ skin: 'equipment-details',
+ content: url,
+ closeBtn: 1,
+ });
+ })
+ },
+ // 获取当前时间,以及昨天现在的时间
+ getTime: function getTime() {
+ var timestamp = Date.parse(new Date());
+
+ // 当前时间
+ var currentTime = new Date(timestamp);
+ // 年
+ var currentY = currentTime.getFullYear();
+ // 月
+ var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1;
+ // 日
+ var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
+ // 时
+ var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours();
+ // 分
+ var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes();
+ // 明天
+ var tomorrowTime = new Date(timestamp - 60 * 60 * 24 * 1000);
+ // 年
+ var tomorrowY = tomorrowTime.getFullYear();
+ // 月
+ var tomorrowM = tomorrowTime.getMonth() + 1 < 10 ? '0' + (tomorrowTime.getMonth() + 1) : tomorrowTime.getMonth() + 1;
+ // 日
+ var tomorrowD = tomorrowTime.getDate() < 10 ? '0' + tomorrowTime.getDate() : tomorrowTime.getDate();
+ // 时
+ var tomorrowH = tomorrowTime.getHours() < 10 ? '0' + tomorrowTime.getHours() : tomorrowTime.getHours();
+ // 分
+ var tomorrowDd = tomorrowTime.getMinutes() < 10 ? '0' + tomorrowTime.getMinutes() : tomorrowTime.getMinutes();
+ return {
+ current: currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd,
+ tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd,
+ month: currentM + currentD
+ };
+ },
+ // 获取警情信息列表
+ /**
+ *
+ * @param {object} dom jq对象
+ * @param {string} beginTime 开始时间
+ * @param {string} endTime 结束时间
+ * @param {*} waringType 警情的类别
+ */
+ getPoliceTable: function(dom, beginTime, endTime, waringType, addvcd, type) {
+ dom.empty();
+ var that = this;
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ beginTime: beginTime,
+ endTime: endTime,
+ waringType: waringType,
+ addvcd: addvcd,
+ type: type
+ },
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ that.entitysData = [];
+ that.addEntitys.clear();
+ for (var a, time, t, e, y, h, i = 0; i < result.length; i++) {
+
+ if (result[i].type != 1) {
+ that.createEntitys(that.addEntitys, that.entitysData, '警情信息', {
+ lgtd: result[i].jd,
+ lttd: result[i].wd,
+ id: result[i].id
+ }, result[i].jd, result[i].wd, './images/jingbaored.png');
+
+
+ t = result[i].galarmTime.substr(0, 10);
+ e = result[i].galarmTime.substr(11);
+ time = t + ' ' + e;
+ y = result[i].galarmTime.substr(5, 5);
+ h = result[i].galarmTime.substr(11, 5);
+ a = Number(i) + 1;
+ str += '<tr term-list=' + result[i].id + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + '>';
+ str += '<td>' + a + '</td>';
+ str += '<td title=' + result[i].addvnm + '>' + result[i].addvnm + '</td>';
+ str += '<td title=' + (result[i].type == 2 ? '处理中' : '待处理') + '>' + (result[i].type == 2 ? '处理中' : '待处理') + '</td>';
+ str += "<td><a href='javascript:;' title=" + time + ">" + y + ' ' + h + "</a></td>";
+ if (result[i].type == 2) {
+ str += "<td class='operation'> <input class='follow-up' type='button' value='跟进' term-list=" + result[i].id + "> </td>";
+ } else {
+ str += "<td class='operation'> <input class='edit' type='button' value='编辑' term-list=" + result[i].id + "> </td>";
+ }
+ str += '</tr>';
+ dom.append(str);
+ str = '';
+
+ }
+
+ }
+
+ for (var i = 0; i < 1000; i++) {
+ var dd = Math.random();
+ var cc = Math.random();
+ }
+ }
+ })
+ },
+ // 获取区域信息列表
+ patrolArea: function(dom, regionName) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ regionName: regionName
+ },
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var i = 0; i < result.length; i++) {
+ entityArr = [];
+ objId = {};
+ entityData = result[i].coordinate.match(/\(([^)]*)\)/);
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.regionId = result[i].regionId;
+ objId.regionName = result[i].regionName;
+ objId.remarks = result[i].remarks;
+
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+
+ str += "<tr flyid=" + result[i].id + " flyname=" + result[i].regionName + "> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].regionName + "</td> <td>" + result[i].ttime + "</td> </tr>";
+ dom.append(str);
+ str = '';
+ }
+ }
+ })
+ },
+ // 获取路线信息列表
+ getRouteInformation: function(dom, routeName) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ routeName: routeName
+ },
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var i = 0; i < result.length; i++) {
+ entityArr = [];
+ objId = {};
+ entityData = result[i].routeInfo.match(/\(([^)]*)\)/);
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.regionId = result[i].regionId;
+ objId.routeName = result[i].routeName;
+ objId.remarks = result[i].remarks;
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+ str += "<tr flyid=" + result[i].id + " flyname=" + result[i].routeName + "> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].sname + "</td> <td>" + result[i].routeName + "</td> <td> <a href='javascript:;' title=" + result[i].rtime + ">" + result[i].rtime.substr(5, 11) + "</a></td> <td><input type='button' value='编辑'></td> </tr>";
+ dom.append(str);
+ str = '';
+ }
+ }
+ })
+ },
+ // 获取保安人员信息列表
+ getSecurityPeople: function(dom, deviceType) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/security/security/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ that.entitysData = [];
+ that.addEntitys.clear();
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var a, i = 0; i < result.length; i++) {
+
+
+ that.createEntitys(that.addEntitys, that.entitysData, '出警信息', {
+ lgtd: result[i].jd,
+ lttd: result[i].wd,
+ id: result[i].id
+ }, result[i].jd, result[i].wd, './images/security.png');
+ entityArr = [];
+ objId = {};
+ entityData = result[i].coordinate.match(/\(([^)]*)\)/);
+
+ a = Number(i) + 1;
+ str += "<tr term-snumber=" + snumber + " lgtd=" + result[i].jd + " lttd=" + result[i].wd + ">";
+ str += '<td>' + a + '</td>';
+ str += '<td title=' + result[i].snumber + '>' + result[i].snumber + '</td>';
+ str += '<td title=' + result[i].sname + '>' + result[i].sname + '</td>';
+ str += '<td title=' + result[i].phone + '>' + result[i].phone + '</td>';
+ str += "<td> <input type='button' value='编辑' resultid=" + result[i].id + "> </td>";
+ str += '</tr>';
+ dom.append(str);
+ str = '';
+
+
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.anumber = result[i].snumber;
+ objId.aname = result[i].sname;
+
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+ }
+
+
+ }
+ })
+ },
+ // 创建实体图层
+ createEntitys: function(entitys, entityContent, name, item, lgtd, lttd, outlineColors) {
+
+ var symbol = new esri.symbol.PictureMarkerSymbol(outlineColors, 26, 26);
+ symbol.name = name;
+ var pt = new Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));
+ pt.entityData = item;
+ var graphic = new esri.Graphic(pt, symbol);
+ entitys.add(graphic);
+
+
+ entityContent.push(item);
+ },
+ addPoint: function(entitys, lgtd, lttd) {
+ var symbol = new esri.symbol.PictureMarkerSymbol('./images/real-time-callPolice.png', 10, 10);
+ var pt = new Point(lgtd, lttd, new SpatialReference({ wkid: 4326 }));
+ var graphic = new esri.Graphic(pt, symbol);
+ entitys.add(graphic);
+ },
+ addPolyline: function(entitys, path) {
+ entitys.clear();
+ var polylineSymbol = new SimpleLineSymbol();
+ polylineSymbol.color = [255, 0, 0, 1];
+ polylineSymbol.width = 4;
+ var polyline = new Polyline({
+ "paths": [path],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ entitys.add(new Graphic(polyline, polylineSymbol));
+ },
+ addPolygon: function(entitys, rings) {
+ entitys.clear();
+ var polygonSymbol = new SimpleFillSymbol();
+ polygonSymbol.color = [24, 255, 243, 0.411];
+ var polygon = new Polygon({
+ "rings": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ entitys.add(new Graphic(polygon, polygonSymbol));
+ },
+
+ activateToolbar: function(graphic) {
+ var tool = 0;
+
+ this.editToolbar = new Edit(this._map);
+
+ // if (registry.byId("tool_move").checked) {
+ tool = tool | Edit.MOVE;
+ // }
+ // if (registry.byId("tool_vertices").checked) {
+ tool = tool | Edit.EDIT_VERTICES;
+ // }
+ // if (registry.byId("tool_scale").checked) {
+ tool = tool | Edit.SCALE;
+ // }
+ // if (registry.byId("tool_rotate").checked) {
+ tool = tool | Edit.ROTATE;
+ // }
+ // enable text editing if a graphic uses a text symbol
+ // if ( graphic.symbol.declaredClass === "esri.symbol.TextSymbol" ) {
+ tool = tool | Edit.EDIT_TEXT;
+ // }
+
+ var options = {
+ allowAddVertices: true,
+ allowDeleteVertices: true,
+ uniformScaling: true
+ };
+ this.editToolbar.activate(tool, graphic, options);
+
+ },
+
+ addPolygonAll: function(entitys, rings, objId) {
+ // entitys.clear();
+ var graphic = null;
+ if (this.patrolIndex == 1) {
+ var polylineSymbol = new SimpleLineSymbol();
+ polylineSymbol.color = [255, 0, 0, 1];
+ polylineSymbol.width = 4;
+ var polyline = new Polyline({
+ "paths": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ graphic = new Graphic(polyline, polylineSymbol)
+
+ } else {
+ var polygonSymbol = new SimpleFillSymbol();
+ polygonSymbol.color = [24, 255, 243, 0.411];
+
+ var polygon = new Polygon({
+ "rings": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ graphic = new Graphic(polygon, polygonSymbol);
+
+ }
+
+ graphic.objId = objId;
+
+ if (this.tabIndex == 1) {
+ if (this.patrolIndex == 1) {
+ this.currentDrawing.push({
+ id: objId.id,
+ regionId: objId.regionId,
+ routeName: objId.routeName,
+ remarks: objId.remarks,
+ extent: graphic.geometry.getExtent()
+ });
+ } else {
+ this.currentDrawing.push({
+ id: objId.id,
+ regionId: objId.regionId,
+ regionName: objId.regionName,
+ remarks: objId.remarks,
+ extent: graphic.geometry.getExtent()
+ });
+ }
+ } else {
+ this.currentDrawing.push({
+ id: objId.id,
+ aname: objId.aname,
+ anumber: objId.anumber,
+ extent: graphic.geometry.getExtent()
+ });
+ }
+
+
+ entitys.add(graphic);
+ },
+
+ modifyPolygon: function() {
+ var self = this;
+ if (self.editToolbar != null) {
+
+ if (self.patrolIndex == 1) {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.paths[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/updatelx',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ regionId: polygon.graphic.objId.regionId,
+ routeName: polygon.graphic.objId.routeName,
+ routeInfo: dataStr,
+ remarks: polygon.graphic.objId.remarks,
+ },
+ success: function(result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ } else {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.rings[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/updateqy',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ regionId: polygon.graphic.objId.regionId,
+ regionName: polygon.graphic.objId.regionName,
+ coordinate: dataStr,
+ remarks: polygon.graphic.objId.remarks
+ },
+ success: function(result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ }
+
+
+ }
+ },
+
+ electronicFence: function() {
+ var self = this;
+ if (self.editToolbar != null) {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.rings[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/updatee',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ aname: polygon.graphic.objId.aname,
+ anumber: polygon.graphic.objId.anumber,
+ routeInfo: dataStr
+ },
+ success: function(result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ }
+ },
+
+ //聚合图层事件
+ flareClusterLayer: function(datas) {
+
+ var that = this;
+
+ var preClustered = false;
+ var displaySingleFlaresAtCount = 10;
+ var areaDisplayMode = "";
+ // var allData = JSON.parse(DATA);
+ // DataManager.setData(allData);
+
+ //init the layer, more options are available and explained in the cluster layer constructor
+ that.clusterLayer = new FlareClusterLayer({
+ id: "flare-cluster-layer",
+ spatialReference: new esri.SpatialReference({ "wkid": 4326 }),
+ subTypeFlareProperty: "facilityType",
+ singleFlareTooltipProperty: "name",
+ displaySubTypeFlares: true,
+ displaySingleFlaresAtCount: displaySingleFlaresAtCount,
+ flareShowMode: "mouse",
+ preClustered: preClustered,
+ clusterRatio: 75,
+ clusterAreaDisplay: areaDisplayMode,
+ clusteringBegin: function() {
+ console.log("clustering begin");
+ },
+ clusteringComplete: function() {
+ console.log("clustering complete");
+ }
+ });
+
+ //set up a class breaks renderer to render different symbols based on the cluster count. Use the required clusterCount property to break on.
+ var defaultSym = new PictureMarkerSymbol("./images/ceshi.png", 32, 32).setOffset(0, 15);
+ var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
+ var xlSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 32, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([200, 52, 59, 0.8]), 1), new dojo.Color([250, 65, 74, 0.8]));
+ var lgSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 28, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([41, 163, 41, 0.8]), 1), new dojo.Color([51, 204, 51, 0.8]));
+ var mdSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 24, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([82, 163, 204, 0.8]), 1), new dojo.Color([102, 204, 255, 0.8]));
+ var smSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([230, 184, 92, 0.8]), 1), new dojo.Color([255, 204, 102, 0.8]));
+ renderer.addBreak(0, 19, smSymbol);
+ renderer.addBreak(20, 150, mdSymbol);
+ renderer.addBreak(151, 1000, lgSymbol);
+ renderer.addBreak(1001, Infinity, xlSymbol);
+
+ that.clusterLayer.setRenderer(renderer); //use standard setRenderer.
+
+ //set up a popup template
+ var template = new PopupTemplate({
+ title: "{name}",
+ fieldInfos: [
+ { fieldName: "facilityType", label: "Facility Type", visible: true },
+ { fieldName: "postcode", label: "Post Code", visible: true },
+ { fieldName: "isOpen", label: "Opening Hours", visible: true }
+ ]
+ });
+
+ //clusterLayer.infoTemplate = template;
+ that._map.infoWindow.titleInBody = false;
+
+ that._map.addLayer(that.clusterLayer);
+
+ //var data = DataManager.getData();
+ that.clusterLayer.addData(datas);
+
+
+ },
+ clearLayer: function() {
+ var that = this;
+ that._map.removeLayer(that.clusterLayer);
+ that.clusterLayer = null;
+ }
+
+ });
+ return Widget;
+});
\ No newline at end of file
diff --git a/public/map/widgets/patrolManagement/PatrolManagement.css b/public/map/widgets/patrolManagement/PatrolManagement.css
index 3c8c08f..4a60e6f 100644
--- a/public/map/widgets/patrolManagement/PatrolManagement.css
+++ b/public/map/widgets/patrolManagement/PatrolManagement.css
@@ -7,7 +7,6 @@
}
div[open-li='police-dispatching']>ul {
-
display: none;
height: 36px;
line-height: 36px;
@@ -33,7 +32,9 @@
background: rgb(255, 255, 255);
}
+
/* 分析研判内容容器 */
+
.police-container {
position: relative;
height: calc(100%);
@@ -49,12 +50,13 @@
left: 0;
}
-
.police-container>div:first-child {
display: block;
}
+
/* 显示信息得表格 */
+
.police-container .police-container-distribute .distribute-table-content {
height: calc(100% - 80px);
}
@@ -90,13 +92,11 @@
scrollbar-width: thin;
}
-
.police-container .table table {
width: 360px;
border-collapse: collapse;
table-layout: fixed;
box-sizing: border-box;
-
}
.police-container .table table tr {
@@ -114,7 +114,6 @@
font-weight: 400;
color: #677788;
box-sizing: border-box;
-
overflow: hidden;
/*超出的文字隐藏*/
text-overflow: ellipsis;
@@ -132,9 +131,7 @@
.police-container .table table tr:first-child td {
border-top: none;
-
}
-
.police-container .table .tbody tr {
cursor: pointer;
@@ -164,8 +161,12 @@
cursor: default;
}
+
/* 编辑和查看 按钮的样式定义 */
+
+
/* 巡逻路线中的编辑按钮样式 */
+
.police-dispatching .police-container .police-container-policeforce .table .tbody tbody td input,
.police-container .police-container-distribute .table .tbody tr td input,
.police-dispatching .police-container .police-container-patrol .main-content>li:nth-child(2) table tr td:nth-child(5) input {
@@ -189,12 +190,10 @@
}
-
-
-
/*
.police-container .police-container-distribute .table .tbody tr td:nth-child(5),
.police-container .police-container-distribute .table .thead tr th:nth-child(5), */
+
.police-container .police-container-patrol .table .tbody tr td:nth-child(5),
.police-container .police-container-patrol .table .thead tr th:nth-child(5),
.police-container .police-container-policeforce .table .tbody tr td:nth-child(5),
@@ -227,13 +226,8 @@
}
-
-
-
-
-
-
/* 警情分发详情样式 */
+
.police-dispatching .police-container-distribute-details {
position: fixed;
top: 0;
@@ -243,7 +237,7 @@
margin: auto;
width: 740px;
height: 308px;
- background:rgb(255, 255, 255);
+ background: rgb(255, 255, 255);
border-radius: 10px;
}
@@ -258,7 +252,6 @@
color: #677788;
font-size: 24px;
}
-
.police-dispatching .police-container-distribute-details .header .close,
.police-dispatching .police-container-distribute-details .security-staff-header .close {
@@ -300,8 +293,8 @@
.police-dispatching .police-container-distribute-details .content table td {
flex: 1;
padding: 0 10px;
- border-top:1px solid rgba(231, 234, 243, 0.7);
- border-left:1px solid rgba(231, 234, 243, 0.7);
+ border-top: 1px solid rgba(231, 234, 243, 0.7);
+ border-left: 1px solid rgba(231, 234, 243, 0.7);
width: 25%;
height: auto !important;
line-height: 36px;
@@ -312,19 +305,23 @@
}
.police-dispatching .police-container-distribute-details .content table tr td:last-child {
- border-right:1px solid rgba(231, 234, 243, 0.7);
+ border-right: 1px solid rgba(231, 234, 243, 0.7);
}
.police-dispatching .police-container-distribute-details .content table tr:last-child td {
- border-bottom:1px solid rgba(231, 234, 243, 0.7);
+ border-bottom: 1px solid rgba(231, 234, 243, 0.7);
}
.police-dispatching .police-container-distribute-details .content table tr td:nth-child(odd) {
color: #15a2fe;
}
+
/* 警情分发中具体某行,以及具体某行的子项的样式 */
+
+
/* 时间 */
+
.police-dispatching .police-container-distribute-details .content table tr td .processing-time {
width: calc(100% - 10px);
height: 24px;
@@ -335,7 +332,7 @@
background: url(../../images/laydata-bg.png) no-repeat;
background-size: 20px 14px;
background-position: 98% center;
- border:1px solid rgba(231, 234, 243, 0.7);
+ border: 1px solid rgba(231, 234, 243, 0.7);
}
.police-dispatching .police-container-distribute-details .content table tr .report-oneonezero input,
@@ -343,9 +340,6 @@
vertical-align: middle;
cursor: pointer;
}
-
-
-
.police-dispatching .police-container-distribute-details .handle-button,
.police-dispatching .police-container-distribute-details .security-staff-confirm {
@@ -383,7 +377,6 @@
}
-
/* 派发保安----附近保安人员选择 */
.police-dispatching .police-container-distribute-details .security-guard-nearby {
@@ -395,12 +388,11 @@
background: rgba(255, 255, 255, 1);
}
-
.police-dispatching .police-container-distribute-details .security-staff-content table th,
.police-dispatching .police-container-distribute-details .security-staff-content table td {
flex: 1;
/* padding: 0 4px; */
- border:1px solid rgba(231, 234, 243, 0.7);
+ border: 1px solid rgba(231, 234, 243, 0.7);
height: auto !important;
line-height: 28px;
font-weight: normal;
@@ -424,12 +416,10 @@
flex: 2;
}
-
.police-dispatching .police-container-distribute-details .security-staff-content table th:last-child,
.police-dispatching .police-container-distribute-details .security-staff-content table td:last-child {
flex: 1;
}
-
.police-dispatching .police-container-distribute-details .security-staff-content table th {
color: #15a2fe;
@@ -440,13 +430,8 @@
}
-
-
-
-
-
-
/* 类别选择,级别选择,以及热力图 */
+
.police-container .distribute-district,
.police-container .distribute-state {
width: 100%;
@@ -478,12 +463,13 @@
flex: 6;
color: #677788;
background: rgb(255, 255, 255);
- border:1px solid rgba(231, 234, 243, 0.7);
+ border: 1px solid rgba(231, 234, 243, 0.7);
box-sizing: border-box;
}
/* 类别选择中得下拉框 */
+
.police-container .distribute-district>ul>li:first-child div:first-child,
.police-container .distribute-state>ul>li:first-child div:first-child {
position: absolute;
@@ -495,7 +481,6 @@
padding-left: 10px;
box-sizing: border-box;
cursor: pointer;
-
}
.police-container .distribute-district>ul>li:first-child div:first-child i,
@@ -521,7 +506,6 @@
width: calc(100% + 2px);
}
-
.police-container .distribute-district>ul>li:first-child ul,
.police-container .distribute-state>ul>li:first-child ul {
display: flex;
@@ -531,10 +515,9 @@
height: auto;
overflow-y: auto;
overflow-x: hidden;
- border:1px solid rgba(231, 234, 243, 0.7);
+ border: 1px solid rgba(231, 234, 243, 0.7);
border-top: none;
box-sizing: border-box;
-
}
.police-container .distribute-district>ul>li:first-child ul li,
@@ -542,7 +525,7 @@
flex: 1;
padding-left: 10px;
height: 34px;
- border-top: 1px solid rgba(231, 234, 243, 0.7);
+ border-top: 1px solid rgba(231, 234, 243, 0.7);
background: rgb(255, 255, 255);
color: #677788;
box-sizing: border-box;
@@ -561,11 +544,8 @@
}
-
-
-
-
/* 时间选择 */
+
.police-container .distribute-selection-criteria {
display: flex;
padding: 4px 6px;
@@ -601,11 +581,6 @@
}
-
-
-
-
-
/* 巡逻管理得样式 */
.police-container .police-container-patrol .distribute-table-content .operation {
@@ -620,15 +595,19 @@
.police-container .police-container-patrol .distribute-table-content .operation>div {
flex: 8;
}
+
.police-container .police-container-patrol .distribute-table-content .operation input[type='text']::-webkit-input-placeholder {
color: #fff;
- }
- input::-moz-input-placeholder {
+}
+
+input::-moz-input-placeholder {
color: #fff;
- }
- input::-ms-input-placeholder {
+}
+
+input::-ms-input-placeholder {
color: #fff;
- }
+}
+
.police-container .police-container-patrol .distribute-table-content .operation input[type='text'] {
flex: 8;
padding: 0 10px;
@@ -651,13 +630,14 @@
border-radius: 5px;
}
+
/*
.police-container .police-container-patrol .distribute-table-content .operation input.query {
} */
-
/* 保安人员出警管理样式调整 */
+
.police-dispatching .police-container .police-container-policeforce .table .thead th:nth-child(2),
.police-dispatching .police-container .police-container-policeforce .table .tbody td:nth-child(2) {
width: 68px;
@@ -669,8 +649,9 @@
}
-
/* 巡逻区域和巡逻路线的切换按钮样式 */
+
+
/* 默认巡逻区域 */
.police-dispatching .police-container .police-container-patrol .tab-header {
@@ -709,8 +690,8 @@
}
-
/* 类别选择,级别选择,以及热力图 */
+
.police-container .main-content .select {
position: relative;
padding: 0 10px;
@@ -751,6 +732,7 @@
/* 类别选择中得下拉框 */
+
.police-container .main-content .select>ul>li:first-child div:first-child {
position: absolute;
top: 0;
@@ -761,7 +743,6 @@
padding-left: 10px;
box-sizing: border-box;
cursor: pointer;
-
}
.police-container .main-content .select>ul>li:first-child div:first-child i {
@@ -785,7 +766,6 @@
width: calc(100% + 2px);
}
-
.police-container .main-content .select>ul>li:first-child ul {
display: flex;
flex-direction: column;
@@ -797,7 +777,6 @@
border: 1px solid rgba(231, 234, 243, 1);
border-top: none;
box-sizing: border-box;
-
}
.police-container .main-content .select>ul>li:first-child ul li {
@@ -824,7 +803,6 @@
border: none;
}
-
.police-dispatching .tips {
display: none;
padding: 2px 4px;
@@ -838,9 +816,6 @@
border-radius: 5px;
letter-spacing: 1px;
}
-
-
-
/* 巡逻路线中表格区域内的样式调整 */
@@ -860,7 +835,78 @@
width: 68px;
}
-.client-max-map{
+.client-max-map {
width: calc(100% - 360px) !important;
left: 360px !important;
+}
+
+.layui-tree-txt {
+ color: #fff !important;
+}
+
+.mapBtn {
+ position: fixed;
+ z-index: 999;
+ align-items: center;
+ left: 50%;
+ top: 30px;
+ background-color: #fff;
+ width: 180px;
+ border-radius: 10px;
+ height: 30px;
+ line-height: 30px;
+}
+
+.insBtn {
+ float: left;
+ margin-left: 10px;
+}
+
+.editBtn {
+ float: left;
+}
+
+.insert {
+ color: #757575;
+}
+
+.edit {
+ color: #757575;
+}
+
+.delete {
+ color: #757575;
+}
+
+.layui-layer-title {
+ background-color: #004CA7;
+ color: #fff;
+}
+
+.layui-layer {
+ background-color: #004CA7;
+}
+
+.layui-layer-input {
+ background-color: #0246E1;
+}
+
+.layui-layer-prompt .layui-layer-input {
+ color: #fff;
+}
+
+.layui-layer-btn .layui-layer-btn0 {
+ border-color: #1D5CE4;
+ background-color: #1D5CE4;
+ color: #fff;
+}
+
+.layui-layer-btn a {
+ border: 1px solid #1D5CE4;
+ background-color: #1D5CE4;
+ color: #fff;
+}
+
+.layui-layer-dialog .layui-layer-content {
+ color: #fff;
}
\ No newline at end of file
diff --git a/public/map/widgets/patrolManagement/PatrolManagement.js b/public/map/widgets/patrolManagement/PatrolManagement.js
index c94831a..210c298 100644
--- a/public/map/widgets/patrolManagement/PatrolManagement.js
+++ b/public/map/widgets/patrolManagement/PatrolManagement.js
@@ -7,2110 +7,2368 @@
* @LastEditTime: 2019-12-14 14:44:57
*/
define([
- "dojo",
- "dojo/_base/declare",
- "dojo/_base/lang",
- "base/BaseWidget",
- "dojo/text!widgets/patrolManagement/template.html",
- "base/AppEvent",
- "base/ConfigData",
- "widgets/patrolManagement/config",
- "dojo/dom",
- "dojo/dom-construct",
- "dojo/dom-attr",
- "dojo/dom-style",
- "dojo/on",
- "esri/layers/ArcGISDynamicMapServiceLayer",
- "esri/layers/ArcGISTiledMapServiceLayer",
- "esri/layers/FeatureLayer",
- "controls/tab/TabControl",
- "esri/dijit/SymbolStyler",
- "esri/styles/basic",
- "dojo/_base/array",
- "esri/InfoTemplate",
- "esri/tasks/query",
- "esri/tasks/QueryTask",
- "esri/Color",
- "esri/toolbars/edit",
- "esri/graphic",
- "esri/geometry/Point",
- "esri/geometry/Polyline",
- "esri/geometry/Polygon",
- "esri/geometry/Extent",
- "esri/tasks/FeatureSet",
- "esri/renderers/HeatmapRenderer",
- "esri/symbols/SimpleLineSymbol",
- "esri/symbols/SimpleFillSymbol",
- "esri/symbols/PictureMarkerSymbol",
- "esri/symbols/SimpleMarkerSymbol",
- "esri/SpatialReference",
- "esri/tasks/GeometryService",
- "esri/tasks/ProjectParameters",
- "esri/layers/GraphicsLayer",
- "esri/layers/LabelLayer",
- "esri/symbols/TextSymbol",
- "esri/renderers/SimpleRenderer",
- "esri/renderers/ClassBreaksRenderer",
- "esri/tasks/Geoprocessor",
- "esri/tasks/DataFile",
- "esri/geometry/webMercatorUtils",
- "esri/symbols/Font",
- "esri/geometry/ScreenPoint",
- "esri/layers/ImageParameters",
- "esri/geometry/geometryEngine",
- "esri/dijit/PopupTemplate",
- "widgets/clientManagement/FlareClusterLayer_v3",
- "dojo/domReady!"
-], function (
- dojo,
- declare,
- lang,
- BaseWidget,
- template,
- AppEvent,
- ConfigData,
- config,
- dom,
- domConstruct,
- domAttr,
- domStyle,
- on,
- ArcGISDynamicMapServiceLayer,
- ArcGISTiledMapServiceLayer,
- FeatureLayer,
- TabControl,
- SymbolStyler,
- basic,
- arrayUtils,
- InfoTemplate,
- Query,
- QueryTask,
- Color,
- Edit,
- Graphic,
- Point,
- Polyline,
- Polygon,
- Extent,
- FeatureSet,
- HeatmapRenderer,
- SimpleLineSymbol,
- SimpleFillSymbol,
- PictureMarkerSymbol,
- SimpleMarkerSymbol,
- SpatialReference,
- GeometryService,
- ProjectParameters,
- GraphicsLayer,
- LabelLayer,
- TextSymbol,
- SimpleRenderer,
- ClassBreaksRenderer,
- Geoprocessor,
- DataFile,
- webMercatorUtils,
- Font,
- ScreenPoint,
- ImageParameters,
- geometryEngine,
- PopupTemplate,
- FlareClusterLayer
+ "dojo",
+ "dojo/_base/declare",
+ "dojo/_base/lang",
+ "base/BaseWidget",
+ "dojo/text!widgets/patrolManagement/template.html",
+ "base/AppEvent",
+ "base/ConfigData",
+ "widgets/patrolManagement/config",
+ "dojo/dom",
+ "dojo/dom-construct",
+ "dojo/dom-attr",
+ "dojo/dom-style",
+ "dojo/on",
+ "esri/layers/ArcGISDynamicMapServiceLayer",
+ "esri/layers/ArcGISTiledMapServiceLayer",
+ "esri/layers/FeatureLayer",
+ "controls/tab/TabControl",
+ "esri/dijit/SymbolStyler",
+ "esri/styles/basic",
+ "dojo/_base/array",
+ "esri/InfoTemplate",
+ "esri/tasks/query",
+ "esri/tasks/QueryTask",
+ "esri/Color",
+ "esri/toolbars/edit",
+ "esri/graphic",
+ "esri/geometry/Point",
+ "esri/geometry/Polyline",
+ "esri/geometry/Polygon",
+ "esri/geometry/Extent",
+ "esri/tasks/FeatureSet",
+ "esri/renderers/HeatmapRenderer",
+ "esri/symbols/SimpleLineSymbol",
+ "esri/symbols/SimpleFillSymbol",
+ "esri/symbols/PictureMarkerSymbol",
+ "esri/symbols/SimpleMarkerSymbol",
+ "esri/SpatialReference",
+ "esri/tasks/GeometryService",
+ "esri/tasks/ProjectParameters",
+ "esri/layers/GraphicsLayer",
+ "esri/layers/LabelLayer",
+ "esri/symbols/TextSymbol",
+ "esri/renderers/SimpleRenderer",
+ "esri/renderers/ClassBreaksRenderer",
+ "esri/tasks/Geoprocessor",
+ "esri/tasks/DataFile",
+ "esri/geometry/webMercatorUtils",
+ "esri/symbols/Font",
+ "esri/geometry/ScreenPoint",
+ "esri/layers/ImageParameters",
+ "esri/geometry/geometryEngine",
+ "esri/dijit/PopupTemplate",
+ "widgets/clientManagement/FlareClusterLayer_v3",
+ "dojo/domReady!"
+], function(
+ dojo,
+ declare,
+ lang,
+ BaseWidget,
+ template,
+ AppEvent,
+ ConfigData,
+ config,
+ dom,
+ domConstruct,
+ domAttr,
+ domStyle,
+ on,
+ ArcGISDynamicMapServiceLayer,
+ ArcGISTiledMapServiceLayer,
+ FeatureLayer,
+ TabControl,
+ SymbolStyler,
+ basic,
+ arrayUtils,
+ InfoTemplate,
+ Query,
+ QueryTask,
+ Color,
+ Edit,
+ Graphic,
+ Point,
+ Polyline,
+ Polygon,
+ Extent,
+ FeatureSet,
+ HeatmapRenderer,
+ SimpleLineSymbol,
+ SimpleFillSymbol,
+ PictureMarkerSymbol,
+ SimpleMarkerSymbol,
+ SpatialReference,
+ GeometryService,
+ ProjectParameters,
+ GraphicsLayer,
+ LabelLayer,
+ TextSymbol,
+ SimpleRenderer,
+ ClassBreaksRenderer,
+ Geoprocessor,
+ DataFile,
+ webMercatorUtils,
+ Font,
+ ScreenPoint,
+ ImageParameters,
+ geometryEngine,
+ PopupTemplate,
+ FlareClusterLayer
) {
- var Widget = declare([BaseWidget], {
- widgetName: "PatrolManagement",
- label: "巡逻管理",
- templateString: template,
- _map: null,
- objThis: null,
- _siteLayer: new GraphicsLayer(),
- layuiLayer: null,
- layuiLadate: null,
- tabIndex: 0,
-
- // 保留添加实体图层的变量
- addEntitys: null,
- entitysData: [],
-
- // 是否派发保安的 文字
- treatmentIndex: null,
- securityFlag: false,
- editParentInd: null,
-
- // 存储新增点,线,面,数据的地方
- polygonData: [],
- polygonFlag: false,
- editToolbar: null,
- addPolygonEntitys: null,
-
- // 所有的面图层
- entityPolygonAll: null,
-
- // 用来存储区域名称
- globalRegionName: null,
-
- // 用来区域得最大最小经纬度
- currentDrawing: [],
-
- // 巡逻区域或者巡逻路线的描述
- routeOrRegionDescribe: null,
-
- // 用来记录巡逻区域或者巡逻路线的下标的
- patrolIndex: 0,
-
- // 拖拽
- isDown: false,
- x: 0,
- y: 0,
- offset: null,
- moveThis: null,
- // 电子围栏需要新增的Id
- newElectronicFenceId: null,
-
- // 新增路线时,派发人员,人员名称,以及人员id
- peopleRealName: null,
- pepleRealId: null,
- constructor: function (options, srcRefNode) {
- this._map = options.map;
- objThis = this;
+ var Widget = declare([BaseWidget], {
+ widgetName: "PatrolManagement",
+ label: "巡逻管理",
+ templateString: template,
+ _map: null,
+ objThis: null,
+ _siteLayer: new GraphicsLayer(),
+ layuiLayer: null,
+ layuiLadate: null,
+ tabIndex: 0,
- this.addEntitys = new GraphicsLayer({
- id: 'addEntitys'
- });
+ isEngineer: false,
- // 添加点面线的图层
- this.addPolygonEntitys = new GraphicsLayer({
- id: 'addPolygonEntitys'
- });
- // 添加所有图层的地方
- this.entityPolygonAll = new GraphicsLayer({
- id: 'entityPolygonAll'
- });
+ // 保留添加实体图层的变量
+ addEntitys: null,
+ entitysData: [],
+
+ // 是否派发保安的 文字
+ treatmentIndex: null,
+ securityFlag: false,
+ editParentInd: null,
+
+ // 存储新增点,线,面,数据的地方
+ polygonData: [],
+ polygonFlag: false,
+ editToolbar: null,
+ addPolygonEntitys: null,
+
+ //基础路径
+ // pathUrl: "http://localhost:83",
+ pathUrl: "http://s16s652780.51mypc.cn/api",
+
+ // 所有的面图层
+ entityPolygonAll: null,
+
+ // 用来存储区域名称
+ globalRegionName: null,
+
+ // 用来区域得最大最小经纬度
+ currentDrawing: [],
+
+ // 巡逻区域或者巡逻路线的描述
+ routeOrRegionDescribe: null,
+
+ // 用来记录巡逻区域或者巡逻路线的下标的
+ patrolIndex: 0,
- this._map.addLayer(this.addEntitys);
+ //是否可编辑
+ isEdit: false,
+
+ // 拖拽
+ isDown: false,
+ x: 0,
+ y: 0,
+ offset: null,
+ moveThis: null,
+ // 电子围栏需要新增的Id
+ newElectronicFenceId: null,
+
+ node: null,
+
+ treeData: null,
+
+ // 新增路线时,派发人员,人员名称,以及人员id
+ peopleRealName: null,
+ pepleRealId: null,
+ constructor: function(options, srcRefNode) {
+ this._map = options.map;
+ objThis = this;
- this._map.addLayer(this.addPolygonEntitys);
- this._map.addLayer(this.entityPolygonAll);
+ this.addEntitys = new GraphicsLayer({
+ id: 'addEntitys'
+ });
+
+ // 添加点面线的图层
+ this.addPolygonEntitys = new GraphicsLayer({
+ id: 'addPolygonEntitys'
+ });
+ // 添加所有图层的地方
+ this.entityPolygonAll = new GraphicsLayer({
+ id: 'entityPolygonAll'
+ });
- },
-
- startup: function () {
- objThis._map.addLayer(objThis._siteLayer);
- var that = this;
- // 顶部tab得切换事件
- $('.police-dispatching-tab li').click(function () {
- if (that.tabIndex == $(this).index()) return;
- if (that.entitysData.length > 0) {
- that.addEntitys.clear();
- that.entitysData = [];
- }
-
- that.patrolIndex = 0;
- that.polygonFlag = false;
- that.entityPolygonAll.clear();
- that.modifyPolygon();
-
- // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
- that.polygonData = [];
- that.addPolygonEntitys.clear();
+ this._map.addLayer(this.addEntitys);
- $(this).addClass('on').siblings().removeClass('on');
- var ind = $(this).index();
- $($('.police-container > div')[ind]).stop().show().siblings().stop().hide();
- if (ind == 0) {
- $('#distributeCategory div:eq(0)').html('全部' + '<i></i>');
- $('#distributeState div:eq(0)').html('全部' + '<i></i>');
- that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
- } else if (ind == 1) {
- // that.getOwnerTable($($('.analysis-container > div')[ind]).find('.tbody tbody'), '', '');
- $('.police-dispatching .police-container .police-container-patrol .tab-header li:eq(0)').addClass('on').siblings().removeClass('on');
- $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0)').stop().show().siblings().hide();
- that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
- } else if (ind == 2) {
- that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
- }
- that.tabIndex = $(this).index();
- })
- // 警情分发中的行点击事件
- $('.police-container .police-container-distribute .table .tbody').off('click', 'tr').on('click', 'tr', function () {
- var lgtd = Number($(this).attr('lgtd'));
- var lttd = Number($(this).attr('lttd'));
- var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
- wkid: 4326
- })); //根据输入坐标信息找地图上的点
- that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
- })
- // 编辑,跟进按钮元素的父元素的点击事件
- $('.police-container .police-container-distribute .table .tbody').off('click', '.operation').on('click', '.operation', function (event) {
- event.stopPropagation();
- })
- // 警情分发中的编辑按钮的点击事件
- $('.police-container .police-container-distribute .table .tbody').off('click', '.edit').on('click', '.edit', function (event) {
- event.stopPropagation();
- that.editParentInd = null;
- that.editParentInd = $(this).parent().parent().index();
- var id = $(this).attr('term-list');
- that.treatmentIndex = null;
- if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
- $('.police-container-distribute-details .security-guard-nearby').stop().hide();
- }
- if (!$('.police-container-distribute-details').is(':hidden')) {
- $('.police-container-distribute-details').stop().hide();
- }
- $('.police-container-distribute-details .content table tbody').empty();
- var str = '';
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
- type: 'POST',
- dataType: 'JSON',
- success: function (data) {
- var result = data.data[0];
- var t = result.galarmTime.substr(0, 10);
- var e = result.galarmTime.substr(11);
- var time = t + ' ' + e;
+ this._map.addLayer(this.addPolygonEntitys);
+ this._map.addLayer(this.entityPolygonAll);
- str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
- str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+ },
- str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+ startup: function() {
+ var that = this;
- str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
-
- str += "<tr> <td>处理方式:</td> <td class='treatment-method'> <input type='radio' name='treatmentMethod' value='派发保安' lgtd=" + result.jd + " lttd=" + result.wd + "> <span>派发保安</span> <input type='radio' name='treatmentMethod' value='提示业主'> <span>提示业主</span> </td> <td>处理人:</td> <td class='securityname'></td> </tr>";
-
- str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + result.deviceNumber + "</td> </tr>";
- $('.police-container-distribute-details .content table tbody').append(str);
- $('.police-container-distribute-details .handle-button .confirm').attr('police-id', result.id);
- $('.police-container-distribute-details .handle-button').stop().show();
- $('.police-container-distribute-details .header h4').text('警情分发');
- $('.police-container-distribute-details').stop().show();
- $('.police-container-distribute-details .content table tbody').off('click', '.treatment-method input').on('click', '.treatment-method input', function () {
- if (that.treatmentIndex != $(this).val()) {
- if ($(this).val() == '派发保安') {
- var str = '';
- $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').empty();
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/position/position/selectry',
- type: 'POST',
- data: {
- coordinate: "point(" + $(this).attr('lgtd') + "," + $(this).attr('lttd') + ")"
- },
- dataType: 'JSON',
- success: function (data) {
-
- var result = data.data;
-
- for (var i = 0; i < result.length; i++) {
- str += "<tr> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].sname + "</td> <td>" + result[i].distance.toFixed(2) + "</td> <td><input type='radio' name='securityStaff' securityid=" + result[i].snumber + " securityname=" + result[i].sname + "> </td> </tr>"
- }
-
- $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').append(str);
- }
- })
- $('.police-container-distribute-details .security-guard-nearby').stop().show();
- } else {
- $('.police-container-distribute-details .content table tbody .securityname').text('');
- $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ //删除巡逻路线点击事件
+ $(".mapBtn .delBtn").click(function() {
+ if (!that.isEngineer) {
+ layui.use('layer', function() {
+ layui.layer.msg('请先新增巡逻路线信息!')
+ })
+ return;
}
- that.treatmentIndex = $(this).val();
- }
- })
- }
- })
- })
- // 警情分发中的详情的确认按钮
- $('.police-container-distribute-details .handle-button .confirm').off('click').click(function () {
- var self = this;
- layui.use('layer', function () {
- var layer = layui.layer;
- if (that.treatmentIndex == null) {
- layer.msg('请选择处理方式', {
-
-
- shade: [0.8, '#393D49'],
-
- time: 1000
- })
- return
- } else {
- if (that.treatmentIndex == '派发保安') {
- if (that.securityFlag == false) {
- layer.msg('请选取保安', {
-
-
- shade: [0.8, '#393D49'],
-
- time: 1000
- })
- return
- }
- }
-
- }
- var id = $(self).attr('police-id');
- var handletype = null;
- if (that.treatmentIndex != null) {
- if (that.treatmentIndex == '派发保安') {
- handletype = '0';
- } else {
- handletype = '1';
- }
- }
- // 发送请求修改警单数据
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/updateInfo',
- type: 'POST',
- data: {
- id: id,
- // handleP: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').attr('people-id'),
- // handName: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').text(),
- handleP: $('.police-container-distribute-details .content table tbody .securityname').attr('id'),
- handName: $('.police-container-distribute-details .content table tbody .securityname').text(),
- handletype: handletype,
- type: '2'
- },
- dataType: 'JSON',
- success: function (data) {
- if (data.code == 200) {
- if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
- $('.police-container-distribute-details .security-guard-nearby').stop().hide();
- }
- $('.police-container-distribute-details').stop().hide();
-
- $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(2)').text('处理中');
-
- $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(4)').html("<input class='follow-up' type='button' value='跟进' >");
- }
- }
- })
- });
- })
- // 警情分发中的跟进按钮的点击事件
- $('.police-container .police-container-distribute .table .tbody').off('click', '.follow-up').on('click', '.follow-up', function () {
- var id = $(this).attr('term-list');
-
- if (!$('.police-container-distribute-details').is(':hidden')) {
- $('.police-container-distribute-details').stop().hide();
- }
-
- $('.police-container-distribute-details .content table tbody').empty();
-
- var str = '';
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
- type: 'POST',
- dataType: 'JSON',
- success: function (data) {
- var result = data.data[0];
-
- var t = result.galarmTime.substr(0, 10);
- var e = result.galarmTime.substr(11);
- var time = t + ' ' + e;
-
-
- str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
-
- str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
-
- str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
-
- str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
-
- str += "<tr> <td>处理方式:</td> <td class='treatment-method'> " + (result.type == 2 ? '处理中' : '待处理') + " </td> <td>处理人:</td> <td class='securityname'> " + result.handName + " </td> </tr>";
-
- str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + 1111 + "</td> </tr>";
- $('.police-container-distribute-details .content table tbody').append(str);
- $('.police-container-distribute-details .header h4').text('警情跟进');
- $('.police-container-distribute-details .handle-button').stop().hide();
- $('.police-container-distribute-details').stop().show();
-
-
- }
- })
-
-
- })
- // 警情分发中的详情的取消按钮
- $('.police-container-distribute-details .handle-button .cancel').off('click').click(function () {
- if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
- $('.police-container-distribute-details .security-guard-nearby').stop().hide();
- }
- $('.police-container-distribute-details').stop().hide();
- })
- // 警情分发中详情的关闭按钮
- $('.police-container-distribute-details .header .close').off('click').click(function () {
- if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
- $('.police-container-distribute-details .security-guard-nearby').stop().hide();
- }
- $('.police-container-distribute-details').stop().hide();
- })
- // 派发保安的确认按钮
- $('.police-container-distribute-details .security-guard-nearby .security-staff-confirm input').off('click').click(function () {
- var list = $('.police-container-distribute-details .security-guard-nearby .security-staff-content input');
- that.securityFlag = false;
- var id = null;
- var securityname = null;
- for (var i = 0; i < list.length; i++) {
- if ($(list[i]).prop('checked') == true) {
- that.securityFlag = true;
- id = $(list[i]).attr('securityid');
- securityname = $(list[i]).attr('securityname');
- break;
- }
- }
-
- if (that.securityFlag == false) {
- layui.use('layer', function () {
- var layer = layui.layer;
- layer.msg('请选取保安', {
-
-
- shade: [0.8, '#393D49'],
-
- time: 1000
- })
- });
- } else {
-
- $('.police-container-distribute-details .content table tbody .securityname').attr('id', id).text(securityname);
-
- $('.police-container-distribute-details .security-guard-nearby').stop().hide();
- }
-
- })
- // 警情信息中类别移入事件
- $('#distributeCategory').mouseenter(function () {
- if ($('#distributeCategory .select-list').is(':hidden')) {
- $('#distributeCategory .select-list').stop().slideDown(0);
- }
- })
- // 警情信息中得类别移出事件
- $('#distributeCategory').mouseleave(function () {
- if (!$('#distributeCategory .select-list').is(':hidden')) {
- $('#distributeCategory .select-list').stop().slideUp(0);
- }
- })
- // 警情信息中类别移入事件
- $('#distributeState').mouseenter(function () {
- if ($('#distributeState .select-list').is(':hidden')) {
- $('#distributeState .select-list').stop().slideDown(0);
- }
- })
- // 警情信息中得类别移出事件
- $('#distributeState').mouseleave(function () {
- if (!$('#distributeState .select-list').is(':hidden')) {
- $('#distributeState .select-list').stop().slideUp(0);
- }
- })
- // 警情信息类,业主信息类,设备信息类别,具体项的点击事件
- $('.police-container > div .select-list').off('click', 'li').on('click', 'li', function (event) {
-
- var text = $(this).text();
- $(this).parent().parent().prev().html(text + '<i></i>');
- $(this).parent().parent().stop().slideUp(0);
-
- if (text == '全部') text = '';
-
- var textOrr = '';
- var textList = '';
- var stateType = '';
- if (that.tabIndex == 0) {
- // that.getPoliceTable($('.analysis-container-police').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), text);
- if ($(this).attr('key')) {
- textOrr = $('#distributeState div:eq(0)').text().trim();
- textList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
-
- for (var i = 0; i < textList.length; i++) {
- if (textOrr == $(textList[i]).text()) {
- stateType = $(textList[i]).attr('statetype');
- }
- }
-
- that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', $(this).attr('addvcd'), stateType);
-
- } else {
- textOrr = $('#distributeCategory div:eq(0)').text().trim();
- textList = $('.police-dispatching .police-container .distribute-district .select-list ul li');
-
- for (var i = 0; i < textList.length; i++) {
- if (textOrr == $(textList[i]).text()) {
- stateType = $(textList[i]).attr('addvcd');
- }
- }
-
- that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', stateType, $(this).attr('stateType'));
-
- }
- }
-
- })
- // 时间查询
- $('#dispatchingSelectTime').off('click').click(function () {
- var times = $(this).prevAll();
- // 开始时间
- var startTime = $(times[1]).val();
- // 结束时间
- var endTime = $(times[0]).val();
-
-
- var textOne = $('#distributeCategory div:eq(0)').text().trim();
- var addvcd = '';
- var list = $('.police-dispatching .police-container .distribute-district .select-list ul li');
- if (textOne == '全部') {
- addvcd = '';
- } else {
- if (list.length > 0) {
- for (var i = 0; i < list.length; i++) {
- if (textOne == $(list[i]).text()) {
- addvcd = $(list[i]).attr('addvcd')
- }
- }
- }
- }
-
- var textTwo = $('#distributeState div:eq(0)').text().trim();
- var stateType = '';
- var stateList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
- if (textTwo == '全部') {
- stateType = '';
- } else {
- if (stateList.length > 0) {
- for (var i = 0; i < stateList.length; i++) {
- if (textTwo == $(stateList[i]).text()) {
- stateType = $(stateList[i]).attr('statetype')
- }
- }
- }
- }
-
- that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), startTime, endTime, '', addvcd, stateType);
- })
- // 巡逻区域中的行点击事件
- $('.police-container .police-container-patrol .main-content>li:eq(0) .table .tbody').off('click', 'tr').on('click', 'tr', function () {
-
-
- var flyid = $(this).attr('flyid');
- var flyname = $(this).attr('flyname');
- var extent = null;
-
- for (var i = 0; i < that.currentDrawing.length; i++) {
- if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].regionName) {
- extent = that.currentDrawing[i].extent;
- }
- }
- // debugger
- that._map.setExtent(extent.expand(1.5));
-
- // var myFeatureExtent = new Extent(extent.)
- // thisObj._map.setExtent(myFeatureExtent.expand(2));
-
- // var lgtd = Number($(this).attr('lgtd'));
- // var lttd = Number($(this).attr('lttd'));
-
- // var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
- // that._map.centerAndZoom(position, 14);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
-
- })
- // 巡逻区域的新增按钮
- $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .add').off('click').click(function () {
- var url = './popup/html/region-name.html';
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/region-name.css'
- });
- that.layuiLayer.close(that.layuiLayer.index);
- that.layuiLayer.open({
- title: '区域名称',
- type: 2,
- shadeClose: false,
- shade: 0.3,
- maxmin: false, //开启最大化最小化按钮
- area: ['320px', '206px'],
- offset: 'auto',
- skin: 'region-name',
- content: url,
- closeBtn: 1,
- success: function (layero, index) {
- layero.find('iframe').contents().find(".start-editing").off('click').click(function () {
- // 区域名称
- var regionName = layero.find('iframe').contents().find('.region-name-input').val();
- var regionDescribe = layero.find('iframe').contents().find('.region-name-textarea').val();
- if (regionName == '') {
- that.layuiLayer.msg('请填写区域名称', {
- time: 1000
- })
- return
- }
-
- if (regionDescribe == '') {
- that.layuiLayer.msg('请填写区域描述', {
- time: 1000
- })
- return
- }
-
- that.globalRegionName = regionName;
- that.routeOrRegionDescribe = regionDescribe;
-
- // 开启,可以勾选线段
- that.polygonFlag = true;
- that.layuiLayer.close(index);
-
- })
- }
- });
- })
-
- })
- // 查找按钮
- $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .query').off('click').click(function () {
- var routerName = $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val();
- // if (routerName == '') {
- // layui.use('layer', function () {
- // layui.layer.msg('请填写区域名称', {
- // time: 1000
- // })
- // })
- // return
- // }
- that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), routerName);
- $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val('');
-
- })
-
- // 保安出警管理表格中点击事件
- $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'input').on('click', 'input', function (event) {
- event.stopPropagation();
- var lgtd = Number($(this).parent().parent().attr('lgtd'));
- var lttd = Number($(this).parent().parent().attr('lttd'));
- var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
- wkid: 4326
- })); //根据输入坐标信息找地图上的点
- that.newElectronicFenceId = null;
- that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
- var graphic = that.entityPolygonAll.graphics;
- for (var i = 0; i < graphic.length; i++) {
- if (graphic[i].objId.id == $(this).attr('resultid')) {
- if (graphic[i].geometry.rings[0].length > 0) {
- that.polygonFlag = false;
- that.electronicFence();
- that.activateToolbar(graphic[i]);
- } else {
- layui.use('layer', function () {
- layui.layer.msg('请开始划分电子围栏');
- })
- that.polygonFlag = true;
- that.newElectronicFenceId = graphic[i].objId;
- }
- }
- }
- })
- $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr').on('click', 'tr', function (event) {
- event.stopPropagation();
- var lgtd = Number($(this).attr('lgtd'));
- var lttd = Number($(this).attr('lttd'));
- var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
- wkid: 4326
- })); //根据输入坐标信息找地图上的点
-
- that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
-
- var snumber = $(this).attr('term-snumber');
-
- var url = './popup/html/personnel-information-management.html?id=' + snumber;
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/personnel-information-management.css'
- });
- that.layuiLayer.close(that.layuiLayer.index);
- that.layuiLayer.open({
- title: '保安人员信息',
- type: 2,
- shadeClose: true,
- shade: false,
- maxmin: false, //开启最大化最小化按钮
- area: ['400px', '220px'],
- offset: 'auto',
- skin: 'personnel-information-management',
- content: url,
- closeBtn: 1,
- });
- })
- })
- $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr td').on('click', 'tr td', function (event) {
- if ($(this).index() == 4) {
- event.stopPropagation();
- return;
-
- }
- })
-
- // 巡逻管理中,巡逻路线和巡逻区域的切换换
- $('.police-dispatching .police-container .police-container-patrol .tab-header li').off('click').click(function () {
- if (that.patrolIndex == $(this).index()) return;
- $(this).addClass('on').siblings().removeClass('on');
- $(".police-dispatching .police-container .police-container-patrol .main-content li:eq(" + $(this).index() + ")").stop().show().siblings().stop().hide();
-
- that.polygonFlag = false;
- that.entityPolygonAll.clear();
- that.modifyPolygon();
-
- // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
- that.polygonData = [];
- that.addPolygonEntitys.clear();
-
- if ($(this).index() == 1) {
- $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
- type: 'GET',
- dataType: 'JSON',
- success: function (res) {
- var result = res.data;
- $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
- for (var i = 0; i < result.length; i++) {
- $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
- }
- }
- })
- that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
- } else {
-
- that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
- }
-
- that.patrolIndex = $(this).index();
- })
- // 巡逻管理下面的巡逻路线中的select选择框的移入事件
- $('#patrolRoute').mouseenter(function () {
- if ($('#patrolRoute .select-list').is(':hidden')) {
- $('#patrolRoute .select-list').stop().slideDown(0);
- }
- })
- // 巡逻管理下面的巡逻路线中的select选择框的移出事件
- $('#patrolRoute').mouseleave(function () {
- if (!$('#patrolRoute .select-list').is(':hidden')) {
- $('#patrolRoute .select-list').stop().slideUp(0);
- }
- })
- // 巡逻路线中区域选择的具体项的点击事件
- $('.police-dispatching .police-container .police-container-patrol .select-list').off('click', 'li').on('click', 'li', function (event) {
- var text = $(this).text();
- $(this).parent().parent().prev().html(text + '<i></i>').attr('regionId', $(this).attr('regionId'));
- $(this).parent().parent().stop().slideUp(0);
- })
- // 巡逻路线中的新增按钮的点击事件
- $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .add').off('click').click(function () {
- var url = './popup/html/route-name-layer.html';
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/route-name-layer.css'
- });
- that.layuiLayer.closeAll();
- that.layuiLayer.open({
- title: '路线名称及描述',
- type: 2,
- shadeClose: false,
- shade: 0.3,
- maxmin: false, //开启最大化最小化按钮
- area: ['320px', '216px'],
- offset: 'auto',
- skin: 'route-name-layer',
- content: url,
- closeBtn: 1,
- resize: false,
- success: function (layero, index) {
- layero.find('iframe').contents().find(".start-editing").off('click').click(function () {
- // 区域名称 or 路线名称
- var routeName = layero.find('iframe').contents().find('.route-name-layer-input').val();
- var routeDescribe = layero.find('iframe').contents().find('.route-name-layer-textarea').val();
- var peopleRealName = layero.find('iframe').contents().find('.route-personnel').val();
- var pepleRealId = layero.find('iframe').contents().find('.route-personnel').attr('peopleid');
- if (routeName == '') {
- that.layuiLayer.msg('请填写路线名称', {
- time: 1000
- })
- return
- }
-
- if (routeDescribe == '') {
- that.layuiLayer.msg('请填写路线描述', {
- time: 1000
- })
- return
- }
-
- // if (pepleRealId == '') {
- // that.layuiLayer.msg('请选择人员', {
- // time: 1000
- // })
- // return
- // }
- that.peopleRealName = peopleRealName;
- that.pepleRealId = '485';
-
- that.globalRegionName = routeName;
- that.routeOrRegionDescribe = routeDescribe;
- // // 开启,可以勾选线段
- that.polygonFlag = true;
- that.layuiLayer.close(index);
-
- })
- }
- });
- })
-
- })
- // 巡逻路线行点击事件
- $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr').on('click', 'tr', function () {
- var flyid = $(this).attr('flyid');
- var flyname = $(this).attr('flyname');
- var extent = null;
- for (var i = 0; i < that.currentDrawing.length; i++) {
- if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].routeName) {
- extent = that.currentDrawing[i].extent;
- }
- }
- that._map.setExtent(extent.expand(1.5));
- })
- $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr td').on('click', 'tr td', function (event) {
- if ($(this).index() == 4) {
- event.stopPropagation();
- return;
-
- }
- })
- $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'input').on('click', 'input', function (event) {
- event.stopPropagation();
- var routeName = $(this).parent().parent().children('td:eq(2)').text();
- var routeId = $(this).parent().parent().attr('flyid');
- var peopleName = $(this).parent().parent().children('td:eq(1)').text();
- var self = this;
-
-
- var url = './popup/html/routename-and-peoplename.html?routeName=' + routeName + '&routeId=' + routeId + '&peopleName=' + peopleName;
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/routename-and-peoplename.css'
- });
- that.layuiLayer.closeAll();
- that.layuiLayer.open({
- title: '路线巡逻人员',
- type: 2,
- shadeClose: false,
- shade: 0.3,
- maxmin: false, //开启最大化最小化按钮
- area: ['320px', '132px'],
- offset: 'auto',
- skin: 'routename-and-peoplename',
- content: url,
- closeBtn: 1,
- resize: false,
- success: function (layero, index) {
- layero.find('iframe').contents().find(".confirm-update").off('click').click(function () {
-
- // 区域名称 or 路线名称
- var peoplelayerName = layero.find('iframe').contents().find('.peoplename-update').val();
- var peoplelayerId = layero.find('iframe').contents().find('.peoplename-update').attr('peopleid');
-
- console.log(peoplelayerName, peoplelayerId);
-
- // if (peoplelayerName == peopleName) {
- // that.layuiLayer.close(index);
- // that.layuiLayer.msg('人员未更改!');
- // } else {
-
-
-
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/duty/duty/updatedtInfo',
- type: 'POST',
- data: {
- rid: routeId,
- snumber: peoplelayerId,
- sname: '张三'
- },
- dataType: 'JSON',
- success: function (res) {
- if (res.code == 200) {
- that.layuiLayer.close(index);
- $(self).parent().parent().children('td:eq(1)').text(peoplelayerName);
- that.layuiLayer.msg('人员已更改!');
- }
- }
- })
-
-
- // }
-
- })
- }
- });
- })
-
-
- })
-
-
- // 查找按钮
- $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .operation .query').off('click').click(function () {
- var routerName = $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val();
- // if (routerName == '') {
- // layui.use('layer', function () {
- // layui.layer.msg('请填写区域名称', {
- // time: 1000
- // })
- // })
- // return
- // }
- that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), routerName);
- $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val('');
- })
-
- },
- open: function () {
- var that = this;
-
- $("#tabcontainer").css("width", "360px");
- $('#mapcontentClass').addClass('client-max-map'); //追加样式
- AppEvent.dispatchAppEvent(AppEvent.APPLICATION_RESIZE, {});
-
-
- document.oncontextmenu = function (event) {
- event.preventDefault();
- };
-
- document.getElementById('mainMapWidget').onmousedown = function (event) {
- if (event.button == 2) {
- if (that.polygonData.length < 2) {
- layui.use('layer', function () {
- layui.layer.msg('不能形成区域,请继续划分!!!')
- })
- return;
- }
- if (that.polygonFlag == true) {
- // 勾画最后一个点
- var normalizedVal = webMercatorUtils.xyToLngLat(event.mapPoint.x, event.mapPoint.y);
- that.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- // 声明空字符串,存储数据
- var dataStr = '';
- var data = null;
- if (that.patrolIndex == 1) {
- that.addPolyline(that.addPolygonEntitys, that.polygonData);
- // 获取数据
- data = that.addPolygonEntitys.graphics[0].geometry.paths[0];
- } else {
- that.addPolygon(that.addPolygonEntitys, that.polygonData);
- // 获取数据
- data = that.addPolygonEntitys.graphics[0].geometry.rings[0];
- }
-
-
- for (var i = 0; i < data.length; i++) {
- dataStr += (data[i][0] + ' ' + data[i][1] + ',');
- }
- // 组装数据
- dataStr = dataStr.substring(0, dataStr.length - 1);
-
- if (that.tabIndex == 1) {
- if (that.patrolIndex == 1) {
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/insertlx',
- type: 'POST',
- dataType: 'JSON',
- data: {
- routeName: that.globalRegionName,
- regionId: $('#patrolRoute div:eq(0)').attr('regionid'),
- routeInfo: dataStr,
- remarks: that.routeOrRegionDescribe,
- creatName: ''
- },
- success: function (result) {
- if (result.code == 200) {
- that.addPolygonEntitys.clear();
- that.polygonData = [];
- that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/duty/duty/insertduty',
+ //需选中巡逻路线,然后进行删除
+ layer.confirm('是否确认删除', {
+ btn: ['确定', '取消'], //按钮
+ title: false
+ }, function() {
+ //删除数据库数据
+ $.ajax({
+ url: that.pathUrl + '/routeIn/routein/removeByRegionId',
type: 'POST',
dataType: 'JSON',
data: {
- sname: that.peopleRealName,
- snumber: that.pepleRealId,
- rid: result.data,
- regionId: $('#patrolRoute div:eq(0)').attr('regionid'),
- type: 0
+ regionId: that.node
},
- success: function (data) {
- if (data.code == 200) {
- }
+ success: function(result) {
+ if (result.code == 200) {
+ layui.use('layer', function() {
+ layui.layer.msg('删除巡逻路线成功!')
+ })
+ }
}
- })
+ })
+ that.addPolygonEntitys.clear();
+ //修改巡逻路线状态
+ that.isEngineer = false;
+ })
+ })
+
+ //编辑巡逻路线
+ $('.mapBtn .editBtn').click(function() {
+ if (!that.isEngineer) {
+ layui.use('layer', function() {
+ layui.layer.msg('请先新增巡逻路线信息!')
+ })
+ return;
+ }
+ $("#editEngineeringMap").css("color", "#3385FF");
+ //修改为可编辑状态
+ that.isEdit = true;
+ layui.use('layer', function() {
+ layui.layer.msg('点击巡逻路线图形即可编辑');
+ })
+ })
+
+ //新增电子围栏
+ $('.mapBtn .insBtn').click(function() {
+ //修改按钮样式
+ $("#insertEngineeringMap").css("color", "#3385FF")
+ //判断
+ if (that.isEngineer) {
+ layui.use('layer', function() {
+ layui.layer.msg('已存在电子围栏');
+ })
+ //新增按钮颜色改回
+ $("#insertEngineeringMap").css("color", "#757575");
+ } else {
+ layui.use('layer', function() {
+ layui.layer.msg('请开始划分电子围栏');
+ })
+ that.polygonFlag = true;
+ }
+ })
+
+
+ //查询数据
+ $.ajax({
+ url: this.pathUrl + '/blade-system/region/lazy-tree?code=3601',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ that.treeData = res.data;
+ //默认展开二级目录
+ that.treeData[0]['spread'] = true;
+ //加载树
+ layui.use('tree', function() {
+ var tree = layui.tree;
+ //渲染
+ var inst1 = tree.render({
+ elem: '#region-tree',
+ data: that.treeData,
+ showLine: false,
+ customOperate: true,
+ id: "regionTree",
+ edit: ['add', 'update', 'del'],
+ click: function(obj) {
+ //获取当前点击的节点数据
+ var data = obj.data;
+ that.node = data.id;
+ that.isEngineer = false;
+ var extent = null;
+ //显示操作按钮
+ document.getElementById('mapBtn').style.display = "block";
+ that.currentDrawing.forEach(item => {
+ if (data.id == item.regionId) {
+ extent = item.extent;
+ that._map.setExtent(extent.expand(1.5));
+ that.isEngineer = true;
+ return;
+ }
+ });
+ },
+ operate: function(obj) {
+ if (obj.type == "add") {
+ //prompt层
+ layer.prompt({ title: '区域名称', formType: 3 }, function(pass, index) {
+ layer.close(index);
+ var data = {
+ parentCode: obj.data.id,
+ name: pass
+ }
+ //新增区域
+ $.ajax({
+ url: that.pathUrl + '/blade-system/region/saves',
+ type: 'POST',
+ dataType: 'JSON',
+ contentType: "application/json",
+ data: JSON.stringify(data),
+ success: function(data) {
+ if (data.code == 200) {
+ $.ajax({
+ url: that.pathUrl + '/blade-system/region/lazy-tree?code=3601',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ that.treeData = res.data;
+ //默认展开二级目录
+ that.treeData[0]['spread'] = true;
+ tree.reload('regionTree', {
+ data: that.treeData
+ })
+ }
+ })
+ }
+ }
+ })
+ });
+
+ }
+
+
+ if (obj.type == "update") {
+ if (obj.data.id.length == 6 || obj.data.id.length == 4) {
+ return;
+ }
+ //prompt层
+ layer.prompt({ title: '区域名称', formType: 3 }, function(pass, index) {
+ layer.close(index);
+ const data = {
+ code: obj.data.id,
+ name: pass
+ }
+ //修改区域名称
+ $.ajax({
+ url: that.pathUrl + '/blade-system/region/update',
+ type: 'POST',
+ dataType: 'JSON',
+ contentType: "application/json",
+ data: JSON.stringify(data),
+ success: function(data) {
+ if (data.code == 200) {
+ $.ajax({
+ url: that.pathUrl + '/blade-system/region/lazy-tree?code=3601',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ that.treeData = res.data;
+ //默认展开二级目录
+ that.treeData[0]['spread'] = true;
+ tree.reload('regionTree', {
+ data: that.treeData
+ })
+ }
+ })
+ }
+ }
+ })
+ });
+
+ }
+
+ if (obj.type == "del") {
+ if (obj.data.id.length == 6 || obj.data.id.length == 4) {
+ return;
+ }
+ //删除区域
+ $.ajax({
+ url: that.pathUrl + '/blade-system/region/remove',
+ type: 'POST',
+ dataType: 'JSON',
+ // contentType: "application/json",
+ data: {
+ id: obj.data.id,
+ },
+ success: function(data) {
+ if (data.code == 200) {
+ $.ajax({
+ url: that.pathUrl + '/blade-system/region/lazy-tree?code=3601',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ that.treeData = res.data;
+ //默认展开二级目录
+ that.treeData[0]['spread'] = true;
+ tree.reload('regionTree', {
+ data: that.treeData
+ })
+ }
+ })
+ }
+ }
+ })
+
+ }
+
+ }
+
+ });
+ });
+ }
+ })
+
+ objThis._map.addLayer(objThis._siteLayer);
+ var that = this;
+ // 顶部tab得切换事件
+ $('.police-dispatching-tab li').click(function() {
+ if (that.tabIndex == $(this).index()) return;
+ if (that.entitysData.length > 0) {
+ that.addEntitys.clear();
+ that.entitysData = [];
}
- }
+
+ that.patrolIndex = 0;
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+
+ $(this).addClass('on').siblings().removeClass('on');
+ var ind = $(this).index();
+ $($('.police-container > div')[ind]).stop().show().siblings().stop().hide();
+ if (ind == 0) {
+ $('#distributeCategory div:eq(0)').html('全部' + '<i></i>');
+ $('#distributeState div:eq(0)').html('全部' + '<i></i>');
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
+ } else if (ind == 1) {
+ // that.getOwnerTable($($('.analysis-container > div')[ind]).find('.tbody tbody'), '', '');
+ $('.police-dispatching .police-container .police-container-patrol .tab-header li:eq(0)').addClass('on').siblings().removeClass('on');
+ $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0)').stop().show().siblings().hide();
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
+ } else if (ind == 2) {
+ that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
+ }
+ that.tabIndex = $(this).index();
+ })
+ // 警情分发中的行点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', 'tr').on('click', 'tr', function() {
+ var lgtd = Number($(this).attr('lgtd'));
+ var lttd = Number($(this).attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ })); //根据输入坐标信息找地图上的点
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+ })
+ // 编辑,跟进按钮元素的父元素的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.operation').on('click', '.operation', function(event) {
+ event.stopPropagation();
+ })
+ // 警情分发中的编辑按钮的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.edit').on('click', '.edit', function(event) {
+ event.stopPropagation();
+ that.editParentInd = null;
+ that.editParentInd = $(this).parent().parent().index();
+ var id = $(this).attr('term-list');
+ that.treatmentIndex = null;
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ if (!$('.police-container-distribute-details').is(':hidden')) {
+ $('.police-container-distribute-details').stop().hide();
+ }
+ $('.police-container-distribute-details .content table tbody').empty();
+ var str = '';
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ var result = data.data[0];
+ var t = result.galarmTime.substr(0, 10);
+ var e = result.galarmTime.substr(11);
+ var time = t + ' ' + e;
+
+ str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
+
+ str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+
+ str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+
+ str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
+
+ str += "<tr> <td>处理方式:</td> <td class='treatment-method'> <input type='radio' name='treatmentMethod' value='派发保安' lgtd=" + result.jd + " lttd=" + result.wd + "> <span>派发保安</span> <input type='radio' name='treatmentMethod' value='提示业主'> <span>提示业主</span> </td> <td>处理人:</td> <td class='securityname'></td> </tr>";
+
+ str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + result.deviceNumber + "</td> </tr>";
+ $('.police-container-distribute-details .content table tbody').append(str);
+ $('.police-container-distribute-details .handle-button .confirm').attr('police-id', result.id);
+ $('.police-container-distribute-details .handle-button').stop().show();
+ $('.police-container-distribute-details .header h4').text('警情分发');
+ $('.police-container-distribute-details').stop().show();
+ $('.police-container-distribute-details .content table tbody').off('click', '.treatment-method input').on('click', '.treatment-method input', function() {
+ if (that.treatmentIndex != $(this).val()) {
+ if ($(this).val() == '派发保安') {
+ var str = '';
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').empty();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/position/position/selectry',
+ type: 'POST',
+ data: {
+ coordinate: "point(" + $(this).attr('lgtd') + "," + $(this).attr('lttd') + ")"
+ },
+ dataType: 'JSON',
+ success: function(data) {
+
+ var result = data.data;
+
+ for (var i = 0; i < result.length; i++) {
+ str += "<tr> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].sname + "</td> <td>" + result[i].distance.toFixed(2) + "</td> <td><input type='radio' name='securityStaff' securityid=" + result[i].snumber + " securityname=" + result[i].sname + "> </td> </tr>"
+ }
+
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').append(str);
+ }
+ })
+ $('.police-container-distribute-details .security-guard-nearby').stop().show();
+ } else {
+ $('.police-container-distribute-details .content table tbody .securityname').text('');
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ that.treatmentIndex = $(this).val();
+ }
+ })
+ }
+ })
+ })
+ // 警情分发中的详情的确认按钮
+ $('.police-container-distribute-details .handle-button .confirm').off('click').click(function() {
+ var self = this;
+ layui.use('layer', function() {
+ var layer = layui.layer;
+ if (that.treatmentIndex == null) {
+ layer.msg('请选择处理方式', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ return
+ } else {
+ if (that.treatmentIndex == '派发保安') {
+ if (that.securityFlag == false) {
+ layer.msg('请选取保安', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ return
+ }
+ }
+
+ }
+ var id = $(self).attr('police-id');
+ var handletype = null;
+ if (that.treatmentIndex != null) {
+ if (that.treatmentIndex == '派发保安') {
+ handletype = '0';
+ } else {
+ handletype = '1';
+ }
+ }
+ // 发送请求修改警单数据
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/updateInfo',
+ type: 'POST',
+ data: {
+ id: id,
+ // handleP: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').attr('people-id'),
+ // handName: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').text(),
+ handleP: $('.police-container-distribute-details .content table tbody .securityname').attr('id'),
+ handName: $('.police-container-distribute-details .content table tbody .securityname').text(),
+ handletype: handletype,
+ type: '2'
+ },
+ dataType: 'JSON',
+ success: function(data) {
+ if (data.code == 200) {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+
+ $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(2)').text('处理中');
+
+ $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(4)').html("<input class='follow-up' type='button' value='跟进' >");
+ }
+ }
+ })
+ });
+ })
+ // 警情分发中的跟进按钮的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.follow-up').on('click', '.follow-up', function() {
+ var id = $(this).attr('term-list');
+
+ if (!$('.police-container-distribute-details').is(':hidden')) {
+ $('.police-container-distribute-details').stop().hide();
+ }
+
+ $('.police-container-distribute-details .content table tbody').empty();
+
+ var str = '';
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ var result = data.data[0];
+
+ var t = result.galarmTime.substr(0, 10);
+ var e = result.galarmTime.substr(11);
+ var time = t + ' ' + e;
+
+
+ str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
+
+ str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+
+ str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+
+ str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
+
+ str += "<tr> <td>处理方式:</td> <td class='treatment-method'> " + (result.type == 2 ? '处理中' : '待处理') + " </td> <td>处理人:</td> <td class='securityname'> " + result.handName + " </td> </tr>";
+
+ str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + 1111 + "</td> </tr>";
+ $('.police-container-distribute-details .content table tbody').append(str);
+ $('.police-container-distribute-details .header h4').text('警情跟进');
+ $('.police-container-distribute-details .handle-button').stop().hide();
+ $('.police-container-distribute-details').stop().show();
+
+
+ }
+ })
+
+
+ })
+ // 警情分发中的详情的取消按钮
+ $('.police-container-distribute-details .handle-button .cancel').off('click').click(function() {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+ })
+ // 警情分发中详情的关闭按钮
+ $('.police-container-distribute-details .header .close').off('click').click(function() {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+ })
+ // 派发保安的确认按钮
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-confirm input').off('click').click(function() {
+ var list = $('.police-container-distribute-details .security-guard-nearby .security-staff-content input');
+ that.securityFlag = false;
+ var id = null;
+ var securityname = null;
+ for (var i = 0; i < list.length; i++) {
+ if ($(list[i]).prop('checked') == true) {
+ that.securityFlag = true;
+ id = $(list[i]).attr('securityid');
+ securityname = $(list[i]).attr('securityname');
+ break;
+ }
+ }
+
+ if (that.securityFlag == false) {
+ layui.use('layer', function() {
+ var layer = layui.layer;
+ layer.msg('请选取保安', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ });
+ } else {
+
+ $('.police-container-distribute-details .content table tbody .securityname').attr('id', id).text(securityname);
+
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+
+ })
+ // 警情信息中类别移入事件
+ $('#distributeCategory').mouseenter(function() {
+ if ($('#distributeCategory .select-list').is(':hidden')) {
+ $('#distributeCategory .select-list').stop().slideDown(0);
+ }
+ })
+ // 警情信息中得类别移出事件
+ $('#distributeCategory').mouseleave(function() {
+ if (!$('#distributeCategory .select-list').is(':hidden')) {
+ $('#distributeCategory .select-list').stop().slideUp(0);
+ }
+ })
+ // 警情信息中类别移入事件
+ $('#distributeState').mouseenter(function() {
+ if ($('#distributeState .select-list').is(':hidden')) {
+ $('#distributeState .select-list').stop().slideDown(0);
+ }
+ })
+ // 警情信息中得类别移出事件
+ $('#distributeState').mouseleave(function() {
+ if (!$('#distributeState .select-list').is(':hidden')) {
+ $('#distributeState .select-list').stop().slideUp(0);
+ }
+ })
+ // 警情信息类,业主信息类,设备信息类别,具体项的点击事件
+ $('.police-container > div .select-list').off('click', 'li').on('click', 'li', function(event) {
+
+ var text = $(this).text();
+ $(this).parent().parent().prev().html(text + '<i></i>');
+ $(this).parent().parent().stop().slideUp(0);
+
+ if (text == '全部') text = '';
+
+ var textOrr = '';
+ var textList = '';
+ var stateType = '';
+ if (that.tabIndex == 0) {
+ // that.getPoliceTable($('.analysis-container-police').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), text);
+ if ($(this).attr('key')) {
+ textOrr = $('#distributeState div:eq(0)').text().trim();
+ textList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
+
+ for (var i = 0; i < textList.length; i++) {
+ if (textOrr == $(textList[i]).text()) {
+ stateType = $(textList[i]).attr('statetype');
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', $(this).attr('addvcd'), stateType);
+
+ } else {
+ textOrr = $('#distributeCategory div:eq(0)').text().trim();
+ textList = $('.police-dispatching .police-container .distribute-district .select-list ul li');
+
+ for (var i = 0; i < textList.length; i++) {
+ if (textOrr == $(textList[i]).text()) {
+ stateType = $(textList[i]).attr('addvcd');
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', stateType, $(this).attr('stateType'));
+
+ }
+ }
+
+ })
+ // 时间查询
+ $('#dispatchingSelectTime').off('click').click(function() {
+ var times = $(this).prevAll();
+ // 开始时间
+ var startTime = $(times[1]).val();
+ // 结束时间
+ var endTime = $(times[0]).val();
+
+
+ var textOne = $('#distributeCategory div:eq(0)').text().trim();
+ var addvcd = '';
+ var list = $('.police-dispatching .police-container .distribute-district .select-list ul li');
+ if (textOne == '全部') {
+ addvcd = '';
+ } else {
+ if (list.length > 0) {
+ for (var i = 0; i < list.length; i++) {
+ if (textOne == $(list[i]).text()) {
+ addvcd = $(list[i]).attr('addvcd')
+ }
+ }
+ }
+ }
+
+ var textTwo = $('#distributeState div:eq(0)').text().trim();
+ var stateType = '';
+ var stateList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
+ if (textTwo == '全部') {
+ stateType = '';
+ } else {
+ if (stateList.length > 0) {
+ for (var i = 0; i < stateList.length; i++) {
+ if (textTwo == $(stateList[i]).text()) {
+ stateType = $(stateList[i]).attr('statetype')
+ }
+ }
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), startTime, endTime, '', addvcd, stateType);
+ })
+ // 巡逻区域中的行点击事件
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .table .tbody').off('click', 'tr').on('click', 'tr', function() {
+
+
+ var flyid = $(this).attr('flyid');
+ var flyname = $(this).attr('flyname');
+ var extent = null;
+
+ for (var i = 0; i < that.currentDrawing.length; i++) {
+ if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].regionName) {
+ extent = that.currentDrawing[i].extent;
+ }
+ }
+ // debugger
+ that._map.setExtent(extent.expand(1.5));
+
+ // var myFeatureExtent = new Extent(extent.)
+ // thisObj._map.setExtent(myFeatureExtent.expand(2));
+
+ // var lgtd = Number($(this).attr('lgtd'));
+ // var lttd = Number($(this).attr('lttd'));
+
+ // var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
+ // that._map.centerAndZoom(position, 14);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+ })
+ // 巡逻区域的新增按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .add').off('click').click(function() {
+ var url = './popup/html/region-name.html';
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/region-name.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '区域名称',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '206px'],
+ offset: 'auto',
+ skin: 'region-name',
+ content: url,
+ closeBtn: 1,
+ success: function(layero, index) {
+ layero.find('iframe').contents().find(".start-editing").off('click').click(function() {
+ // 区域名称
+ var regionName = layero.find('iframe').contents().find('.region-name-input').val();
+ var regionDescribe = layero.find('iframe').contents().find('.region-name-textarea').val();
+ if (regionName == '') {
+ that.layuiLayer.msg('请填写区域名称', {
+ time: 1000
+ })
+ return
+ }
+
+ if (regionDescribe == '') {
+ that.layuiLayer.msg('请填写区域描述', {
+ time: 1000
+ })
+ return
+ }
+
+ that.globalRegionName = regionName;
+ that.routeOrRegionDescribe = regionDescribe;
+
+ // 开启,可以勾选线段
+ that.polygonFlag = true;
+ that.layuiLayer.close(index);
+
+ })
+ }
+ });
+ })
+
+ })
+ // 查找按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .query').off('click').click(function() {
+ var routerName = $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val();
+ // if (routerName == '') {
+ // layui.use('layer', function () {
+ // layui.layer.msg('请填写区域名称', {
+ // time: 1000
+ // })
+ // })
+ // return
+ // }
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), routerName);
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val('');
+
+ })
+
+ // 保安出警管理表格中点击事件
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'input').on('click', 'input', function(event) {
+ event.stopPropagation();
+ var lgtd = Number($(this).parent().parent().attr('lgtd'));
+ var lttd = Number($(this).parent().parent().attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ })); //根据输入坐标信息找地图上的点
+ that.newElectronicFenceId = null;
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+ var graphic = that.entityPolygonAll.graphics;
+ for (var i = 0; i < graphic.length; i++) {
+ if (graphic[i].objId.id == $(this).attr('resultid')) {
+ if (graphic[i].geometry.rings[0].length > 0) {
+ that.polygonFlag = false;
+ that.electronicFence();
+ that.activateToolbar(graphic[i]);
+ } else {
+ layui.use('layer', function() {
+ layui.layer.msg('请开始划分电子围栏');
+ })
+ that.polygonFlag = true;
+ that.newElectronicFenceId = graphic[i].objId;
+ }
+ }
+ }
+ })
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr').on('click', 'tr', function(event) {
+ event.stopPropagation();
+ var lgtd = Number($(this).attr('lgtd'));
+ var lttd = Number($(this).attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ })); //根据输入坐标信息找地图上的点
+
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+ var snumber = $(this).attr('term-snumber');
+
+ var url = './popup/html/personnel-information-management.html?id=' + snumber;
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/personnel-information-management.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '保安人员信息',
+ type: 2,
+ shadeClose: true,
+ shade: false,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['400px', '220px'],
+ offset: 'auto',
+ skin: 'personnel-information-management',
+ content: url,
+ closeBtn: 1,
+ });
+ })
+ })
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr td').on('click', 'tr td', function(event) {
+ if ($(this).index() == 4) {
+ event.stopPropagation();
+ return;
+
+ }
+ })
+
+ // 巡逻管理中,巡逻路线和巡逻区域的切换换
+ $('.police-dispatching .police-container .police-container-patrol .tab-header li').off('click').click(function() {
+ if (that.patrolIndex == $(this).index()) return;
+ $(this).addClass('on').siblings().removeClass('on');
+ $(".police-dispatching .police-container .police-container-patrol .main-content li:eq(" + $(this).index() + ")").stop().show().siblings().stop().hide();
+
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+ if ($(this).index() == 1) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ var result = res.data;
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ for (var i = 0; i < result.length; i++) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ }
+ }
+ })
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+ } else {
+
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
+ }
+
+ that.patrolIndex = $(this).index();
+ })
+ // 巡逻管理下面的巡逻路线中的select选择框的移入事件
+ $('#patrolRoute').mouseenter(function() {
+ if ($('#patrolRoute .select-list').is(':hidden')) {
+ $('#patrolRoute .select-list').stop().slideDown(0);
+ }
+ })
+ // 巡逻管理下面的巡逻路线中的select选择框的移出事件
+ $('#patrolRoute').mouseleave(function() {
+ if (!$('#patrolRoute .select-list').is(':hidden')) {
+ $('#patrolRoute .select-list').stop().slideUp(0);
+ }
+ })
+ // 巡逻路线中区域选择的具体项的点击事件
+ $('.police-dispatching .police-container .police-container-patrol .select-list').off('click', 'li').on('click', 'li', function(event) {
+ var text = $(this).text();
+ $(this).parent().parent().prev().html(text + '<i></i>').attr('regionId', $(this).attr('regionId'));
+ $(this).parent().parent().stop().slideUp(0);
+ })
+ // 巡逻路线中的新增按钮的点击事件
+ $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .add').off('click').click(function() {
+ var url = './popup/html/route-name-layer.html';
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/route-name-layer.css'
+ });
+ that.layuiLayer.closeAll();
+ that.layuiLayer.open({
+ title: '路线名称及描述',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '216px'],
+ offset: 'auto',
+ skin: 'route-name-layer',
+ content: url,
+ closeBtn: 1,
+ resize: false,
+ success: function(layero, index) {
+ layero.find('iframe').contents().find(".start-editing").off('click').click(function() {
+ // 区域名称 or 路线名称
+ var routeName = layero.find('iframe').contents().find('.route-name-layer-input').val();
+ var routeDescribe = layero.find('iframe').contents().find('.route-name-layer-textarea').val();
+ var peopleRealName = layero.find('iframe').contents().find('.route-personnel').val();
+ var pepleRealId = layero.find('iframe').contents().find('.route-personnel').attr('peopleid');
+ if (routeName == '') {
+ that.layuiLayer.msg('请填写路线名称', {
+ time: 1000
+ })
+ return
+ }
+
+ if (routeDescribe == '') {
+ that.layuiLayer.msg('请填写路线描述', {
+ time: 1000
+ })
+ return
+ }
+
+ // if (pepleRealId == '') {
+ // that.layuiLayer.msg('请选择人员', {
+ // time: 1000
+ // })
+ // return
+ // }
+ that.peopleRealName = peopleRealName;
+ that.pepleRealId = '485';
+
+ that.globalRegionName = routeName;
+ that.routeOrRegionDescribe = routeDescribe;
+ // // 开启,可以勾选线段
+ that.polygonFlag = true;
+ that.layuiLayer.close(index);
+
+ })
+ }
+ });
+ })
+
+ })
+ // 巡逻路线行点击事件
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr').on('click', 'tr', function() {
+ var flyid = $(this).attr('flyid');
+ var flyname = $(this).attr('flyname');
+ var extent = null;
+ for (var i = 0; i < that.currentDrawing.length; i++) {
+ if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].routeName) {
+ extent = that.currentDrawing[i].extent;
+ }
+ }
+ that._map.setExtent(extent.expand(1.5));
+ })
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr td').on('click', 'tr td', function(event) {
+ if ($(this).index() == 4) {
+ event.stopPropagation();
+ return;
+
+ }
+ })
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'input').on('click', 'input', function(event) {
+ event.stopPropagation();
+ var routeName = $(this).parent().parent().children('td:eq(2)').text();
+ var routeId = $(this).parent().parent().attr('flyid');
+ var peopleName = $(this).parent().parent().children('td:eq(1)').text();
+ var self = this;
+
+
+ var url = './popup/html/routename-and-peoplename.html?routeName=' + routeName + '&routeId=' + routeId + '&peopleName=' + peopleName;
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/routename-and-peoplename.css'
+ });
+ that.layuiLayer.closeAll();
+ that.layuiLayer.open({
+ title: '路线巡逻人员',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '132px'],
+ offset: 'auto',
+ skin: 'routename-and-peoplename',
+ content: url,
+ closeBtn: 1,
+ resize: false,
+ success: function(layero, index) {
+ layero.find('iframe').contents().find(".confirm-update").off('click').click(function() {
+
+ // 区域名称 or 路线名称
+ var peoplelayerName = layero.find('iframe').contents().find('.peoplename-update').val();
+ var peoplelayerId = layero.find('iframe').contents().find('.peoplename-update').attr('peopleid');
+
+ console.log(peoplelayerName, peoplelayerId);
+
+ // if (peoplelayerName == peopleName) {
+ // that.layuiLayer.close(index);
+ // that.layuiLayer.msg('人员未更改!');
+ // } else {
+
+
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/duty/duty/updatedtInfo',
+ type: 'POST',
+ data: {
+ rid: routeId,
+ snumber: peoplelayerId,
+ sname: '张三'
+ },
+ dataType: 'JSON',
+ success: function(res) {
+ if (res.code == 200) {
+ that.layuiLayer.close(index);
+ $(self).parent().parent().children('td:eq(1)').text(peoplelayerName);
+ that.layuiLayer.msg('人员已更改!');
+ }
+ }
+ })
+
+
+ // }
+
+ })
+ }
+ });
})
- // that.peopleRealName = peopleRealName;
- // that.pepleRealId = pepleRealId;
- } else {
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/regions/regions/insterqy',
- type: 'POST',
- dataType: 'JSON',
- data: {
- regionName: that.globalRegionName,
- coordinate: dataStr,
- remarks: that.routeOrRegionDescribe
- },
- success: function (result) {
- if (result.code == 200) {
- that.addPolygonEntitys.clear();
- that.polygonData = [];
- that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
+ })
+
+
+ // 查找按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .operation .query').off('click').click(function() {
+ var routerName = $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val();
+ // if (routerName == '') {
+ // layui.use('layer', function () {
+ // layui.layer.msg('请填写区域名称', {
+ // time: 1000
+ // })
+ // })
+ // return
+ // }
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), routerName);
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val('');
+ })
+
+ },
+ open: function() {
+ var that = this;
+
+ $("#tabcontainer").css("width", "360px");
+ $('#mapcontentClass').addClass('client-max-map'); //追加样式
+ AppEvent.dispatchAppEvent(AppEvent.APPLICATION_RESIZE, {});
+
+
+ document.oncontextmenu = function(event) {
+ event.preventDefault();
+ };
+
+ document.getElementById('mainMapWidget').onmousedown = function(event) {
+ if (event.button == 2) {
+ if (that.polygonData.length < 2) {
+ layui.use('layer', function() {
+ layui.layer.msg('不能形成区域,请继续划分!!!')
+ })
+ return;
}
- }
- })
- }
- } else if (that.tabIndex == 2) {
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/insertes',
+ if (that.polygonFlag == true) {
+ // 勾画最后一个点
+ var normalizedVal = webMercatorUtils.xyToLngLat(event.mapPoint.x, event.mapPoint.y);
+ that.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ // 声明空字符串,存储数据
+ var dataStr = '';
+ var data = null;
+ if (that.patrolIndex == 1) {
+ that.addPolyline(that.addPolygonEntitys, that.polygonData);
+ // 获取数据
+ data = that.addPolygonEntitys.graphics[0].geometry.paths[0];
+ } else {
+ that.addPolygon(that.addPolygonEntitys, that.polygonData);
+ // 获取数据
+ data = that.addPolygonEntitys.graphics[0].geometry.rings[0];
+ }
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ if (that.tabIndex == 1) {
+ if (that.patrolIndex == 1) {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/insertlx',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ routeName: that.globalRegionName,
+ regionId: that.node,
+ routeInfo: dataStr,
+ remarks: that.routeOrRegionDescribe,
+ creatName: ''
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ layui.use('layer', function() {
+ layui.layer.msg('新增巡逻路线成功!')
+ })
+ //清除点信息
+ that.polygonData = [];
+ //新增按钮颜色改回
+ $("#insertEngineeringMap").css("color", "#757575");
+ //清空线图层信息
+ that.addLineEntitys.clear();
+ //修改电子围栏数据状态
+ that.isEngineer = true;
+ //修改电子围栏选中状态
+ that.isChecked = false;
+ //修改电子围栏编辑状态
+ that.polygonFlag = false;
+
+ }
+ }
+ })
+
+
+ // that.peopleRealName = peopleRealName;
+ // that.pepleRealId = pepleRealId;
+ } else {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/insterqy',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ regionName: that.globalRegionName,
+ coordinate: dataStr,
+ remarks: that.routeOrRegionDescribe
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
+ }
+ }
+ })
+ }
+ } else if (that.tabIndex == 2) {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/insertes',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ anumber: that.newElectronicFenceId.anumber,
+ aname: that.newElectronicFenceId.aname,
+ routeInfo: dataStr
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
+ }
+ }
+ })
+ }
+
+
+ }
+ that.polygonFlag = false;
+
+ // that.polygonData = [];
+
+
+ }
+ }
+
+
+
+ // $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
+ // $.ajax({
+ // url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ // type: 'GET',
+ // dataType: 'JSON',
+ // success: function (res) {
+ // var result = res.data;
+ // $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ // for (var i = 0; i < result.length; i++) {
+ // $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ // }
+ // }
+ // })
+ // that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+ that.treatmentIndex = null;
+ that.tabIndex = 1;
+ that.patrolIndex = 1;
+
+ $('.police-dispatching-tab li:eq(1)').addClass('on').siblings().removeClass('on');
+ $($('.police-container > div')[1]).stop().show().siblings().stop().hide();
+
+
+ $('.police-dispatching .police-container .distribute-district .select-list ul').empty();
+ $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=''>全部</li>");
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function(res) {
+ var result = res.data;
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ for (var i = 0; i < result.length; i++) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ }
+ }
+ })
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+ // $.ajax({
+ // url: 'http://s16s652780.51mypc.cn/api/district/district/selectList',
+ // type: 'POST',
+ // dataType: 'JSON',
+ // success: function (data) {
+ // for (var i = 0; i < data.data.length; i++) {
+ // $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=" + data.data[i].addvcd + ">" + data.data[i].addvnm + "</li>");
+ // }
+ // }
+ // })
+
+
+ layui.use('laydate', function() {
+ that.layuiLadate = layui.laydate;
+ //执行一个laydate实例 开始
+ that.layuiLadate.render({
+ elem: '#dispatchingStartTime', //指定元素
+ type: "datetime",
+ format: 'yyyy-MM-dd HH:mm',
+ btns: ['confirm'],
+ trigger: 'click',
+ });
+ // 结束
+ that.layuiLadate.render({
+ elem: '#dispatchingEndTime', //指定元素
+ type: "datetime",
+ format: 'yyyy-MM-dd HH:mm',
+ btns: ['confirm'],
+ trigger: 'click',
+ });
+ });
+
+ // that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
+ that.clickHand();
+
+
+
+
+
+
+
+ $('.police-dispatching-tab li:eq(1)').trigger('click');
+ },
+ close: function() {
+
+ $("#tabcontainer").css("width", "66%");
+ $('#mapcontentClass').removeClass('client-max-map'); //删除样式
+
+ this.entitysData = [];
+
+ this.addEntitys.clear();
+
+ this.entityPolygonAll.clear();
+
+ this.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ this.polygonData = [];
+ this.addPolygonEntitys.clear();
+ },
+ // 鼠标点击事件
+ clickHand: function() {
+ var self = this;
+
+ var that = this;
+
+
+ self._map.onClick = mapClick;
+
+ // $('#mainMapWidget')[0].ondblclick = function (event) {
+ // event.preventDefault();
+ // // if ()
+ // self.activateToolbar(event.graphic);
+ // return false;
+ // };
+
+
+ function mapClick(evt) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+
+
+ var y = self._map.toMap({
+ spatialReference: '4326',
+ type: "point",
+ x: evt.screenPoint.x,
+ y: evt.screenPoint.y,
+
+ });
+ // debugger;
+
+ if (self.tabIndex == 0) {
+ if (evt.graphic) {
+ var result = evt.graphic.geometry.entityData;
+ // var liText = evt.graphic.symbol.name;
+ self.policeDetails(result.id);
+ }
+ } else if (self.tabIndex == 1) {
+ if (self.patrolIndex == 1) {
+ // 编辑中的
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ }
+ } else { // 不在编辑中
+ if (that.isEdit) {
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+
+ self.modifyPolygon();
+ self.activateToolbar(evt.graphic);
+
+
+
+ } else { // 点击不在图形上
+
+ self.modifyPolygon()
+ }
+ }
+ }
+ } else {
+ // 编辑中的
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else if (self.polygonData.length == 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ } else if (self.polygonData.length > 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolygon(self.addPolygonEntitys, self.polygonData);
+ }
+ } else { // 不在编辑中
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.modifyPolygon();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.modifyPolygon()
+ }
+ }
+ }
+ } else if (self.tabIndex == 2) {
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else if (self.polygonData.length == 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ } else if (self.polygonData.length > 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolygon(self.addPolygonEntitys, self.polygonData);
+ }
+ } else {
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.electronicFence();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.electronicFence()
+ }
+ }
+
+
+ // self.equipmentDetails(result.id);
+ }
+
+ }
+
+
+ // 提示信息
+ $(document).off('mousemove').mousemove(function(e) {
+ var y = e.clientY + 10;
+ var x = e.clientX + 20;
+
+ if (e.clientX < 40) {
+ var x = 40;
+ }
+
+ if (e.clientY < 42) {
+ y = 42;
+ }
+
+ if (e.clientY > ($(window).height() - 82)) {
+ y = ($(window).height() - 66);
+ }
+
+ if (e.clientX > ($(window).width() - 184)) {
+ x = ($(window).width() - 184);
+ }
+
+ if (self.tabIndex == 1 || self.tabIndex == 2) {
+
+ if (self.polygonFlag == true) {
+ $('.police-dispatching .tips').stop().show();
+
+ if (self.polygonData.length == 0) {
+ $('.police-dispatching .tips').text('单击左键开始绘制。');
+ } else {
+ if (e.clientY > ($(window).height() - 98)) {
+ y = ($(window).height() - 88);
+ }
+ $('.police-dispatching .tips').text('单击左键新增加点。单击右键完成绘制。');
+ }
+
+ $('.police-dispatching .tips').css({
+ 'top': y,
+ 'left': x,
+ })
+ } else {
+ $('.police-dispatching .tips').stop().hide();
+ }
+
+ } else {
+ $('.police-dispatching .tips').stop().hide();
+ }
+ })
+ },
+ // 警情详情弹框
+ /**
+ *
+ * @param {number} id 警情ID
+ */
+ policeDetails: function(id) {
+ var that = this;
+ 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,
+ });
+ })
+ },
+ // 业主详情弹框
+ /**
+ *
+ * @param {number} id 警情ID
+ */
+ ownerDetails: function(id) {
+ var that = this;
+ 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,
+ });
+ })
+ },
+ // 设备详情弹框
+ /**
+ *
+ * @param {number} id 设备ID
+ */
+ equipmentDetails: function(id) {
+ var that = this;
+ var url = './popup/html/equipment-details.html?obj=' + id;
+ layui.use('layer', function() {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/equipment-details.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '警情详情',
+ type: 2,
+ shadeClose: true,
+ shade: false,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['520px', '320px'],
+ offset: 'auto',
+ skin: 'equipment-details',
+ content: url,
+ closeBtn: 1,
+ });
+ })
+ },
+ // 获取当前时间,以及昨天现在的时间
+ getTime: function getTime() {
+ var timestamp = Date.parse(new Date());
+
+ // 当前时间
+ var currentTime = new Date(timestamp);
+ // 年
+ var currentY = currentTime.getFullYear();
+ // 月
+ var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1;
+ // 日
+ var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
+ // 时
+ var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours();
+ // 分
+ var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes();
+ // 明天
+ var tomorrowTime = new Date(timestamp - 60 * 60 * 24 * 1000);
+ // 年
+ var tomorrowY = tomorrowTime.getFullYear();
+ // 月
+ var tomorrowM = tomorrowTime.getMonth() + 1 < 10 ? '0' + (tomorrowTime.getMonth() + 1) : tomorrowTime.getMonth() + 1;
+ // 日
+ var tomorrowD = tomorrowTime.getDate() < 10 ? '0' + tomorrowTime.getDate() : tomorrowTime.getDate();
+ // 时
+ var tomorrowH = tomorrowTime.getHours() < 10 ? '0' + tomorrowTime.getHours() : tomorrowTime.getHours();
+ // 分
+ var tomorrowDd = tomorrowTime.getMinutes() < 10 ? '0' + tomorrowTime.getMinutes() : tomorrowTime.getMinutes();
+ return {
+ current: currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd,
+ tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd,
+ month: currentM + currentD
+ };
+ },
+ // 获取警情信息列表
+ /**
+ *
+ * @param {object} dom jq对象
+ * @param {string} beginTime 开始时间
+ * @param {string} endTime 结束时间
+ * @param {*} waringType 警情的类别
+ */
+ getPoliceTable: function(dom, beginTime, endTime, waringType, addvcd, type) {
+ dom.empty();
+ var that = this;
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectList',
type: 'POST',
dataType: 'JSON',
data: {
- anumber: that.newElectronicFenceId.anumber,
- aname: that.newElectronicFenceId.aname,
- routeInfo: dataStr
+ beginTime: beginTime,
+ endTime: endTime,
+ waringType: waringType,
+ addvcd: addvcd,
+ type: type
},
- success: function (result) {
- if (result.code == 200) {
- that.addPolygonEntitys.clear();
- that.polygonData = [];
- that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
- }
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ that.entitysData = [];
+ that.addEntitys.clear();
+ for (var a, time, t, e, y, h, i = 0; i < result.length; i++) {
+
+ if (result[i].type != 1) {
+ that.createEntitys(that.addEntitys, that.entitysData, '警情信息', {
+ lgtd: result[i].jd,
+ lttd: result[i].wd,
+ id: result[i].id
+ }, result[i].jd, result[i].wd, './images/jingbaored.png');
+
+
+ t = result[i].galarmTime.substr(0, 10);
+ e = result[i].galarmTime.substr(11);
+ time = t + ' ' + e;
+ y = result[i].galarmTime.substr(5, 5);
+ h = result[i].galarmTime.substr(11, 5);
+ a = Number(i) + 1;
+ str += '<tr term-list=' + result[i].id + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + '>';
+ str += '<td>' + a + '</td>';
+ str += '<td title=' + result[i].addvnm + '>' + result[i].addvnm + '</td>';
+ str += '<td title=' + (result[i].type == 2 ? '处理中' : '待处理') + '>' + (result[i].type == 2 ? '处理中' : '待处理') + '</td>';
+ str += "<td><a href='javascript:;' title=" + time + ">" + y + ' ' + h + "</a></td>";
+ if (result[i].type == 2) {
+ str += "<td class='operation'> <input class='follow-up' type='button' value='跟进' term-list=" + result[i].id + "> </td>";
+ } else {
+ str += "<td class='operation'> <input class='edit' type='button' value='编辑' term-list=" + result[i].id + "> </td>";
+ }
+ str += '</tr>';
+ dom.append(str);
+ str = '';
+
+ }
+
+ }
+
+ for (var i = 0; i < 1000; i++) {
+ var dd = Math.random();
+ var cc = Math.random();
+ }
}
- })
- }
-
-
- }
- that.polygonFlag = false;
-
- // that.polygonData = [];
-
-
- }
- }
-
-
-
- // $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
- // $.ajax({
- // url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
- // type: 'GET',
- // dataType: 'JSON',
- // success: function (res) {
- // var result = res.data;
- // $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
- // for (var i = 0; i < result.length; i++) {
- // $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
- // }
- // }
- // })
- // that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
-
- that.polygonFlag = false;
- that.entityPolygonAll.clear();
- that.modifyPolygon();
-
- // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
- that.polygonData = [];
- that.addPolygonEntitys.clear();
-
- that.treatmentIndex = null;
- that.tabIndex = 1;
- that.patrolIndex = 1;
-
- $('.police-dispatching-tab li:eq(1)').addClass('on').siblings().removeClass('on');
- $($('.police-container > div')[1]).stop().show().siblings().stop().hide();
-
-
- $('.police-dispatching .police-container .distribute-district .select-list ul').empty();
- $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=''>全部</li>");
-
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
- type: 'GET',
- dataType: 'JSON',
- success: function (res) {
- var result = res.data;
- $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
- for (var i = 0; i < result.length; i++) {
- $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
- }
- }
- })
- that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
- // $.ajax({
- // url: 'http://s16s652780.51mypc.cn/api/district/district/selectList',
- // type: 'POST',
- // dataType: 'JSON',
- // success: function (data) {
- // for (var i = 0; i < data.data.length; i++) {
- // $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=" + data.data[i].addvcd + ">" + data.data[i].addvnm + "</li>");
- // }
- // }
- // })
-
-
- layui.use('laydate', function () {
- that.layuiLadate = layui.laydate;
- //执行一个laydate实例 开始
- that.layuiLadate.render({
- elem: '#dispatchingStartTime', //指定元素
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- btns: ['confirm'],
- trigger: 'click',
- });
- // 结束
- that.layuiLadate.render({
- elem: '#dispatchingEndTime', //指定元素
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- btns: ['confirm'],
- trigger: 'click',
- });
- });
-
- // that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
- that.clickHand();
-
-
-
-
-
-
-
- $('.police-dispatching-tab li:eq(1)').trigger('click');
- },
- close: function () {
-
- $("#tabcontainer").css("width", "66%");
- $('#mapcontentClass').removeClass('client-max-map'); //删除样式
-
- this.entitysData = [];
-
- this.addEntitys.clear();
-
- this.entityPolygonAll.clear();
-
- this.modifyPolygon();
-
- // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
- this.polygonData = [];
- this.addPolygonEntitys.clear();
- },
- // 鼠标点击事件
- clickHand: function () {
- var self = this;
-
-
- self._map.onClick = mapClick;
-
- // $('#mainMapWidget')[0].ondblclick = function (event) {
- // event.preventDefault();
- // // if ()
- // self.activateToolbar(event.graphic);
- // return false;
- // };
-
-
- function mapClick(evt) {
- var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
-
-
- var y = self._map.toMap({
- spatialReference: '4326',
- type: "point",
- x: evt.screenPoint.x,
- y: evt.screenPoint.y,
-
- });
-
- if (self.tabIndex == 0) {
- if (evt.graphic) {
- var result = evt.graphic.geometry.entityData;
- // var liText = evt.graphic.symbol.name;
- self.policeDetails(result.id);
- }
- } else if (self.tabIndex == 1) {
- if (self.patrolIndex == 1) {
- // 编辑中的
- if (self.polygonFlag == true) {
- var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
- if (self.polygonData.length == 0) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
- } else {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPolyline(self.addPolygonEntitys, self.polygonData);
- return;
- }
- } else { // 不在编辑中
- if (evt.graphic) { // 点击在图形上
- // 保存当前点击得图形
- // self.currentDrawing = evt.graphic;
-
- self.modifyPolygon();
-
- self.activateToolbar(evt.graphic);
- } else { // 点击不在图形上
-
- self.modifyPolygon()
- }
- }
- } else {
- // 编辑中的
- if (self.polygonFlag == true) {
- var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
- if (self.polygonData.length == 0) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
- } else if (self.polygonData.length == 1) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPolyline(self.addPolygonEntitys, self.polygonData);
- return;
- } else if (self.polygonData.length > 1) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPolygon(self.addPolygonEntitys, self.polygonData);
- }
- } else { // 不在编辑中
- if (evt.graphic) { // 点击在图形上
- // 保存当前点击得图形
- // self.currentDrawing = evt.graphic;
-
- self.modifyPolygon();
-
- self.activateToolbar(evt.graphic);
- } else { // 点击不在图形上
-
- self.modifyPolygon()
- }
- }
- }
- } else if (self.tabIndex == 2) {
- if (self.polygonFlag == true) {
- var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
- if (self.polygonData.length == 0) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
- } else if (self.polygonData.length == 1) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPolyline(self.addPolygonEntitys, self.polygonData);
- return;
- } else if (self.polygonData.length > 1) {
- self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
- self.addPolygon(self.addPolygonEntitys, self.polygonData);
- }
- } else {
- if (evt.graphic) { // 点击在图形上
- // 保存当前点击得图形
- // self.currentDrawing = evt.graphic;
-
- self.electronicFence();
-
- self.activateToolbar(evt.graphic);
- } else { // 点击不在图形上
-
- self.electronicFence()
- }
- }
-
-
- // self.equipmentDetails(result.id);
- }
-
- }
-
-
- // 提示信息
- $(document).off('mousemove').mousemove(function (e) {
- var y = e.clientY + 10;
- var x = e.clientX + 20;
-
- if (e.clientX < 40) {
- var x = 40;
- }
-
- if (e.clientY < 42) {
- y = 42;
- }
-
- if (e.clientY > ($(window).height() - 82)) {
- y = ($(window).height() - 66);
- }
-
- if (e.clientX > ($(window).width() - 184)) {
- x = ($(window).width() - 184);
- }
-
- if (self.tabIndex == 1 || self.tabIndex == 2) {
-
- if (self.polygonFlag == true) {
- $('.police-dispatching .tips').stop().show();
-
- if (self.polygonData.length == 0) {
- $('.police-dispatching .tips').text('单击左键开始绘制。');
- } else {
- if (e.clientY > ($(window).height() - 98)) {
- y = ($(window).height() - 88);
- }
- $('.police-dispatching .tips').text('单击左键新增加点。单击右键完成绘制。');
- }
-
- $('.police-dispatching .tips').css({
- 'top': y,
- 'left': x,
})
- } else {
- $('.police-dispatching .tips').stop().hide();
- }
-
- } else {
- $('.police-dispatching .tips').stop().hide();
- }
- })
- },
- // 警情详情弹框
- /**
- *
- * @param {number} id 警情ID
- */
- policeDetails: function (id) {
- var that = this;
- 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,
- });
- })
- },
- // 业主详情弹框
- /**
- *
- * @param {number} id 警情ID
- */
- ownerDetails: function (id) {
- var that = this;
- 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,
- });
- })
- },
- // 设备详情弹框
- /**
- *
- * @param {number} id 设备ID
- */
- equipmentDetails: function (id) {
- var that = this;
- var url = './popup/html/equipment-details.html?obj=' + id;
- layui.use('layer', function () {
- that.layuiLayer = layui.layer;
- that.layuiLayer.config({
- extend: 'myskin/equipment-details.css'
- });
- that.layuiLayer.close(that.layuiLayer.index);
- that.layuiLayer.open({
- title: '警情详情',
- type: 2,
- shadeClose: true,
- shade: false,
- maxmin: false, //开启最大化最小化按钮
- area: ['520px', '320px'],
- offset: 'auto',
- skin: 'equipment-details',
- content: url,
- closeBtn: 1,
- });
- })
- },
- // 获取当前时间,以及昨天现在的时间
- getTime: function getTime() {
- var timestamp = Date.parse(new Date());
-
- // 当前时间
- var currentTime = new Date(timestamp);
- // 年
- var currentY = currentTime.getFullYear();
- // 月
- var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1;
- // 日
- var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
- // 时
- var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours();
- // 分
- var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes();
- // 明天
- var tomorrowTime = new Date(timestamp - 60 * 60 * 24 * 1000);
- // 年
- var tomorrowY = tomorrowTime.getFullYear();
- // 月
- var tomorrowM = tomorrowTime.getMonth() + 1 < 10 ? '0' + (tomorrowTime.getMonth() + 1) : tomorrowTime.getMonth() + 1;
- // 日
- var tomorrowD = tomorrowTime.getDate() < 10 ? '0' + tomorrowTime.getDate() : tomorrowTime.getDate();
- // 时
- var tomorrowH = tomorrowTime.getHours() < 10 ? '0' + tomorrowTime.getHours() : tomorrowTime.getHours();
- // 分
- var tomorrowDd = tomorrowTime.getMinutes() < 10 ? '0' + tomorrowTime.getMinutes() : tomorrowTime.getMinutes();
- return {
- current: currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd,
- tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd,
- month: currentM + currentD
- };
- },
- // 获取警情信息列表
- /**
- *
- * @param {object} dom jq对象
- * @param {string} beginTime 开始时间
- * @param {string} endTime 结束时间
- * @param {*} waringType 警情的类别
- */
- getPoliceTable: function (dom, beginTime, endTime, waringType, addvcd, type) {
- dom.empty();
- var that = this;
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectList',
- type: 'POST',
- dataType: 'JSON',
- data: {
- beginTime: beginTime,
- endTime: endTime,
- waringType: waringType,
- addvcd: addvcd,
- type: type
},
- success: function (data) {
- var result = data.data;
- var str = '';
- that.entitysData = [];
- that.addEntitys.clear();
- for (var a, time, t, e, y, h, i = 0; i < result.length; i++) {
+ // 获取区域信息列表
+ patrolArea: function(dom, regionName) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ regionName: regionName
+ },
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var i = 0; i < result.length; i++) {
+ entityArr = [];
+ objId = {};
+ entityData = result[i].coordinate.match(/\(([^)]*)\)/);
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.regionId = result[i].regionId;
+ objId.regionName = result[i].regionName;
+ objId.remarks = result[i].remarks;
- if (result[i].type != 1) {
- that.createEntitys(that.addEntitys, that.entitysData, '警情信息', {
- lgtd: result[i].jd,
- lttd: result[i].wd,
- id: result[i].id
- }, result[i].jd, result[i].wd, './images/jingbaored.png');
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
-
- t = result[i].galarmTime.substr(0, 10);
- e = result[i].galarmTime.substr(11);
- time = t + ' ' + e;
- y = result[i].galarmTime.substr(5, 5);
- h = result[i].galarmTime.substr(11, 5);
- a = Number(i) + 1;
- str += '<tr term-list=' + result[i].id + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + '>';
- str += '<td>' + a + '</td>';
- str += '<td title=' + result[i].addvnm + '>' + result[i].addvnm + '</td>';
- str += '<td title=' + (result[i].type == 2 ? '处理中' : '待处理') + '>' + (result[i].type == 2 ? '处理中' : '待处理') + '</td>';
- str += "<td><a href='javascript:;' title=" + time + ">" + y + ' ' + h + "</a></td>";
- if (result[i].type == 2) {
- str += "<td class='operation'> <input class='follow-up' type='button' value='跟进' term-list=" + result[i].id + "> </td>";
- } else {
- str += "<td class='operation'> <input class='edit' type='button' value='编辑' term-list=" + result[i].id + "> </td>";
- }
- str += '</tr>';
- dom.append(str);
- str = '';
-
- }
-
- }
-
- for (var i = 0; i < 1000; i++) {
- var dd = Math.random();
- var cc = Math.random();
- }
- }
- })
- },
- // 获取区域信息列表
- patrolArea: function (dom, regionName) {
- dom.empty();
- var that = this;
- that.currentDrawing = [];
- that.entityPolygonAll.clear();
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectList',
- type: 'POST',
- dataType: 'JSON',
- data: {
- regionName: regionName
+ str += "<tr flyid=" + result[i].id + " flyname=" + result[i].regionName + "> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].regionName + "</td> <td>" + result[i].ttime + "</td> </tr>";
+ dom.append(str);
+ str = '';
+ }
+ }
+ })
},
- success: function (data) {
- var result = data.data;
- var str = '';
- var entityArr = [];
- var objId = {};
- var entityData = '';
- for (var i = 0; i < result.length; i++) {
- entityArr = [];
- objId = {};
- entityData = result[i].coordinate.match(/\(([^)]*)\)/);
- // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
- if (entityData && entityData != '') {
- entityData = entityData[1].split(',');
- for (var j = 0; j < entityData.length; j++) {
- entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
- }
- }
- objId.id = result[i].id;
- objId.regionId = result[i].regionId;
- objId.regionName = result[i].regionName;
- objId.remarks = result[i].remarks;
-
- that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
-
- str += "<tr flyid=" + result[i].id + " flyname=" + result[i].regionName + "> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].regionName + "</td> <td>" + result[i].ttime + "</td> </tr>";
- dom.append(str);
- str = '';
- }
- }
- })
- },
- // 获取路线信息列表
- getRouteInformation: function (dom, routeName) {
- dom.empty();
- var that = this;
- that.currentDrawing = [];
- that.entityPolygonAll.clear();
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/selectList',
- type: 'POST',
- dataType: 'JSON',
- data: {
- routeName: routeName
+ // 获取路线信息列表
+ getRouteInformation: function(dom, routeName) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ routeName: routeName
+ },
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var i = 0; i < result.length; i++) {
+ entityArr = [];
+ objId = {};
+ entityData = result[i].routeInfo.match(/\(([^)]*)\)/);
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.regionId = result[i].regionId;
+ objId.routeName = result[i].routeName;
+ objId.remarks = result[i].remarks;
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+ str += "<tr flyid=" + result[i].id + " flyname=" + result[i].routeName + "> <td>" + (Number(i) + 1) + "</td> <td style='display: none;'>" + result[i].sname + "</td> <td>" + result[i].routeName + "</td> <td> <a href='javascript:;' title=" + result[i].rtime + ">" + result[i].rtime.substr(5, 11) + "</a></td> <td><input type='button' value='编辑'></td> </tr>";
+ dom.append(str);
+ str = '';
+ }
+ }
+ })
},
- success: function (data) {
- var result = data.data;
- var str = '';
- var entityArr = [];
- var objId = {};
- var entityData = '';
- for (var i = 0; i < result.length; i++) {
- entityArr = [];
- objId = {};
- entityData = result[i].routeInfo.match(/\(([^)]*)\)/);
- // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
- if (entityData && entityData != '') {
- entityData = entityData[1].split(',');
- for (var j = 0; j < entityData.length; j++) {
- entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
- }
- }
- objId.id = result[i].id;
- objId.regionId = result[i].regionId;
- objId.routeName = result[i].routeName;
- objId.remarks = result[i].remarks;
- that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
- str += "<tr flyid=" + result[i].id + " flyname=" + result[i].routeName + "> <td>" + (Number(i) + 1) + "</td> <td style='display: none;'>" + result[i].sname + "</td> <td>" + result[i].routeName + "</td> <td> <a href='javascript:;' title=" + result[i].rtime + ">" + result[i].rtime.substr(5, 11) + "</a></td> <td><input type='button' value='编辑'></td> </tr>";
- dom.append(str);
- str = '';
- }
- }
- })
- },
- // 获取保安人员信息列表
- getSecurityPeople: function (dom, deviceType) {
- dom.empty();
- var that = this;
- that.currentDrawing = [];
- that.entityPolygonAll.clear();
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/security/security/selectList',
- type: 'POST',
- dataType: 'JSON',
- success: function (data) {
- var result = data.data;
- var str = '';
- that.entitysData = [];
- that.addEntitys.clear();
- var entityArr = [];
- var objId = {};
- var entityData = '';
- for (var a, i = 0; i < result.length; i++) {
+ // 获取保安人员信息列表
+ getSecurityPeople: function(dom, deviceType) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/security/security/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ success: function(data) {
+ var result = data.data;
+ var str = '';
+ that.entitysData = [];
+ that.addEntitys.clear();
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var a, i = 0; i < result.length; i++) {
- that.createEntitys(that.addEntitys, that.entitysData, '出警信息', {
- lgtd: result[i].jd,
- lttd: result[i].wd,
- id: result[i].id
- }, result[i].jd, result[i].wd, './images/security.png');
- entityArr = [];
- objId = {};
- entityData = result[i].coordinate.match(/\(([^)]*)\)/);
+ that.createEntitys(that.addEntitys, that.entitysData, '出警信息', {
+ lgtd: result[i].jd,
+ lttd: result[i].wd,
+ id: result[i].id
+ }, result[i].jd, result[i].wd, './images/security.png');
+ entityArr = [];
+ objId = {};
+ entityData = result[i].coordinate.match(/\(([^)]*)\)/);
- a = Number(i) + 1;
- str += "<tr term-snumber=" + snumber + " lgtd=" + result[i].jd + " lttd=" + result[i].wd + ">";
- str += '<td>' + a + '</td>';
- str += '<td title=' + result[i].snumber + '>' + result[i].snumber + '</td>';
- str += '<td title=' + result[i].sname + '>' + result[i].sname + '</td>';
- str += '<td title=' + result[i].phone + '>' + result[i].phone + '</td>';
- str += "<td> <input type='button' value='编辑' resultid=" + result[i].id + "> </td>";
- str += '</tr>';
- dom.append(str);
- str = '';
+ a = Number(i) + 1;
+ str += "<tr term-snumber=" + snumber + " lgtd=" + result[i].jd + " lttd=" + result[i].wd + ">";
+ str += '<td>' + a + '</td>';
+ str += '<td title=' + result[i].snumber + '>' + result[i].snumber + '</td>';
+ str += '<td title=' + result[i].sname + '>' + result[i].sname + '</td>';
+ str += '<td title=' + result[i].phone + '>' + result[i].phone + '</td>';
+ str += "<td> <input type='button' value='编辑' resultid=" + result[i].id + "> </td>";
+ str += '</tr>';
+ dom.append(str);
+ str = '';
- // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
- if (entityData && entityData != '') {
- entityData = entityData[1].split(',');
- for (var j = 0; j < entityData.length; j++) {
- entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
- }
- }
- objId.id = result[i].id;
- objId.anumber = result[i].snumber;
- objId.aname = result[i].sname;
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.anumber = result[i].snumber;
+ objId.aname = result[i].sname;
- that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
- }
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+ }
- }
- })
- },
- // 创建实体图层
- createEntitys: function (entitys, entityContent, name, item, lgtd, lttd, outlineColors) {
-
- var symbol = new esri.symbol.PictureMarkerSymbol(outlineColors, 26, 26);
- symbol.name = name;
- var pt = new Point(lgtd, lttd, new esri.SpatialReference({
- wkid: 4326
- }));
- pt.entityData = item;
- var graphic = new esri.Graphic(pt, symbol);
- entitys.add(graphic);
-
-
- entityContent.push(item);
- },
- addPoint: function (entitys, lgtd, lttd) {
- var symbol = new esri.symbol.PictureMarkerSymbol('./images/real-time-callPolice.png', 10, 10);
- var pt = new Point(lgtd, lttd, new SpatialReference({
- wkid: 4326
- }));
- var graphic = new esri.Graphic(pt, symbol);
- entitys.add(graphic);
- },
- addPolyline: function (entitys, path) {
- entitys.clear();
- var polylineSymbol = new SimpleLineSymbol();
- polylineSymbol.color = [255, 0, 0, 1];
- polylineSymbol.width = 4;
- var polyline = new Polyline({
- "paths": [path],
- "spatialReference": {
- "wkid": 4326
- }
- });
-
- entitys.add(new Graphic(polyline, polylineSymbol));
- },
- addPolygon: function (entitys, rings) {
- entitys.clear();
- var polygonSymbol = new SimpleFillSymbol();
- polygonSymbol.color = [24, 255, 243, 0.411];
- var polygon = new Polygon({
- "rings": [rings],
- "spatialReference": {
- "wkid": 4326
- }
- });
-
- entitys.add(new Graphic(polygon, polygonSymbol));
- },
-
- activateToolbar: function (graphic) {
- var tool = 0;
-
- this.editToolbar = new Edit(this._map);
-
- // if (registry.byId("tool_move").checked) {
- tool = tool | Edit.MOVE;
- // }
- // if (registry.byId("tool_vertices").checked) {
- tool = tool | Edit.EDIT_VERTICES;
- // }
- // if (registry.byId("tool_scale").checked) {
- tool = tool | Edit.SCALE;
- // }
- // if (registry.byId("tool_rotate").checked) {
- tool = tool | Edit.ROTATE;
- // }
- // enable text editing if a graphic uses a text symbol
- // if ( graphic.symbol.declaredClass === "esri.symbol.TextSymbol" ) {
- tool = tool | Edit.EDIT_TEXT;
- // }
-
- var options = {
- allowAddVertices: true,
- allowDeleteVertices: true,
- uniformScaling: true
- };
- this.editToolbar.activate(tool, graphic, options);
-
- },
-
- addPolygonAll: function (entitys, rings, objId) {
- // entitys.clear();
- var graphic = null;
- if (this.patrolIndex == 1) {
- var polylineSymbol = new SimpleLineSymbol();
- polylineSymbol.color = [255, 0, 0, 1];
- polylineSymbol.width = 4;
- var polyline = new Polyline({
- "paths": [rings],
- "spatialReference": {
- "wkid": 4326
- }
- });
-
- graphic = new Graphic(polyline, polylineSymbol)
-
- } else {
- var polygonSymbol = new SimpleFillSymbol();
- polygonSymbol.color = [24, 255, 243, 0.411];
-
- var polygon = new Polygon({
- "rings": [rings],
- "spatialReference": {
- "wkid": 4326
- }
- });
-
- graphic = new Graphic(polygon, polygonSymbol);
-
- }
-
- graphic.objId = objId;
-
- if (this.tabIndex == 1) {
- if (this.patrolIndex == 1) {
- this.currentDrawing.push({
- id: objId.id,
- regionId: objId.regionId,
- routeName: objId.routeName,
- remarks: objId.remarks,
- extent: graphic.geometry.getExtent()
- });
- } else {
- this.currentDrawing.push({
- id: objId.id,
- regionId: objId.regionId,
- regionName: objId.regionName,
- remarks: objId.remarks,
- extent: graphic.geometry.getExtent()
- });
- }
- } else {
- this.currentDrawing.push({
- id: objId.id,
- aname: objId.aname,
- anumber: objId.anumber,
- extent: graphic.geometry.getExtent()
- });
- }
-
-
- entitys.add(graphic);
- },
-
- modifyPolygon: function () {
- var self = this;
- if (self.editToolbar != null) {
-
- if (self.patrolIndex == 1) {
- var polygon = self.editToolbar.getCurrentState();
-
-
- for (var i = 0; i < self.currentDrawing.length; i++) {
-
- if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
- self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
- }
-
- }
-
-
- self.editToolbar.deactivate();
-
- self.editToolbar = null;
-
-
- // 声明空字符串,存储数据
- var dataStr = '';
-
- // 获取数据
- var data = polygon.graphic.geometry.paths[0];
-
-
- for (var i = 0; i < data.length; i++) {
- dataStr += (data[i][0] + ' ' + data[i][1] + ',');
- }
- // 组装数据
- dataStr = dataStr.substring(0, dataStr.length - 1);
-
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/updatelx',
- type: 'POST',
- dataType: 'JSON',
- data: {
- id: polygon.graphic.objId.id,
- regionId: polygon.graphic.objId.regionId,
- routeName: polygon.graphic.objId.routeName,
- routeInfo: dataStr,
- remarks: polygon.graphic.objId.remarks,
- },
- success: function (result) {
- if (result.code == 200) {
-
- }
- }
- })
- } else {
- var polygon = self.editToolbar.getCurrentState();
-
-
- for (var i = 0; i < self.currentDrawing.length; i++) {
-
- if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
- self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
- }
-
- }
-
-
- self.editToolbar.deactivate();
-
- self.editToolbar = null;
-
-
- // 声明空字符串,存储数据
- var dataStr = '';
-
- // 获取数据
- var data = polygon.graphic.geometry.rings[0];
-
-
- for (var i = 0; i < data.length; i++) {
- dataStr += (data[i][0] + ' ' + data[i][1] + ',');
- }
- // 组装数据
- dataStr = dataStr.substring(0, dataStr.length - 1);
-
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/regions/regions/updateqy',
- type: 'POST',
- dataType: 'JSON',
- data: {
- id: polygon.graphic.objId.id,
- regionId: polygon.graphic.objId.regionId,
- regionName: polygon.graphic.objId.regionName,
- coordinate: dataStr,
- remarks: polygon.graphic.objId.remarks
- },
- success: function (result) {
- if (result.code == 200) {
-
- }
- }
- })
- }
-
-
- }
- },
-
- electronicFence: function () {
- var self = this;
- if (self.editToolbar != null) {
- var polygon = self.editToolbar.getCurrentState();
-
-
- for (var i = 0; i < self.currentDrawing.length; i++) {
-
- if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
- self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
- }
-
- }
-
-
- self.editToolbar.deactivate();
-
- self.editToolbar = null;
-
-
- // 声明空字符串,存储数据
- var dataStr = '';
-
- // 获取数据
- var data = polygon.graphic.geometry.rings[0];
-
-
- for (var i = 0; i < data.length; i++) {
- dataStr += (data[i][0] + ' ' + data[i][1] + ',');
- }
- // 组装数据
- dataStr = dataStr.substring(0, dataStr.length - 1);
-
- $.ajax({
- url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/updatee',
- type: 'POST',
- dataType: 'JSON',
- data: {
- id: polygon.graphic.objId.id,
- aname: polygon.graphic.objId.aname,
- anumber: polygon.graphic.objId.anumber,
- routeInfo: dataStr
- },
- success: function (result) {
- if (result.code == 200) {
-
- }
- }
- })
- }
- },
-
- //聚合图层事件
- flareClusterLayer: function (datas) {
-
- var that = this;
-
- var preClustered = false;
- var displaySingleFlaresAtCount = 10;
- var areaDisplayMode = "";
- // var allData = JSON.parse(DATA);
- // DataManager.setData(allData);
-
- //init the layer, more options are available and explained in the cluster layer constructor
- that.clusterLayer = new FlareClusterLayer({
- id: "flare-cluster-layer",
- spatialReference: new esri.SpatialReference({
- "wkid": 4326
- }),
- subTypeFlareProperty: "facilityType",
- singleFlareTooltipProperty: "name",
- displaySubTypeFlares: true,
- displaySingleFlaresAtCount: displaySingleFlaresAtCount,
- flareShowMode: "mouse",
- preClustered: preClustered,
- clusterRatio: 75,
- clusterAreaDisplay: areaDisplayMode,
- clusteringBegin: function () {
- console.log("clustering begin");
+ }
+ })
},
- clusteringComplete: function () {
- console.log("clustering complete");
+ // 创建实体图层
+ createEntitys: function(entitys, entityContent, name, item, lgtd, lttd, outlineColors) {
+
+ var symbol = new esri.symbol.PictureMarkerSymbol(outlineColors, 26, 26);
+ symbol.name = name;
+ var pt = new Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ }));
+ pt.entityData = item;
+ var graphic = new esri.Graphic(pt, symbol);
+ entitys.add(graphic);
+
+
+ entityContent.push(item);
+ },
+ addPoint: function(entitys, lgtd, lttd) {
+ var symbol = new esri.symbol.PictureMarkerSymbol('./images/real-time-callPolice.png', 10, 10);
+ var pt = new Point(lgtd, lttd, new SpatialReference({
+ wkid: 4326
+ }));
+ var graphic = new esri.Graphic(pt, symbol);
+ entitys.add(graphic);
+ },
+ addPolyline: function(entitys, path) {
+ entitys.clear();
+ var polylineSymbol = new SimpleLineSymbol();
+ polylineSymbol.color = [255, 0, 0, 1];
+ polylineSymbol.width = 4;
+ var polyline = new Polyline({
+ "paths": [path],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ entitys.add(new Graphic(polyline, polylineSymbol));
+ },
+ addPolygon: function(entitys, rings) {
+ entitys.clear();
+ var polygonSymbol = new SimpleFillSymbol();
+ polygonSymbol.color = [24, 255, 243, 0.411];
+ var polygon = new Polygon({
+ "rings": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ entitys.add(new Graphic(polygon, polygonSymbol));
+ },
+
+ activateToolbar: function(graphic) {
+ var tool = 0;
+
+ this.editToolbar = new Edit(this._map);
+
+ // if (registry.byId("tool_move").checked) {
+ tool = tool | Edit.MOVE;
+ // }
+ // if (registry.byId("tool_vertices").checked) {
+ tool = tool | Edit.EDIT_VERTICES;
+ // }
+ // if (registry.byId("tool_scale").checked) {
+ tool = tool | Edit.SCALE;
+ // }
+ // if (registry.byId("tool_rotate").checked) {
+ tool = tool | Edit.ROTATE;
+ // }
+ // enable text editing if a graphic uses a text symbol
+ // if ( graphic.symbol.declaredClass === "esri.symbol.TextSymbol" ) {
+ tool = tool | Edit.EDIT_TEXT;
+ // }
+
+ var options = {
+ allowAddVertices: true,
+ allowDeleteVertices: true,
+ uniformScaling: true
+ };
+ this.editToolbar.activate(tool, graphic, options);
+
+ },
+
+ addPolygonAll: function(entitys, rings, objId) {
+ // entitys.clear();
+ var graphic = null;
+ if (this.patrolIndex == 1) {
+ var polylineSymbol = new SimpleLineSymbol();
+ polylineSymbol.color = [255, 0, 0, 1];
+ polylineSymbol.width = 4;
+ var polyline = new Polyline({
+ "paths": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ graphic = new Graphic(polyline, polylineSymbol)
+
+ } else {
+ var polygonSymbol = new SimpleFillSymbol();
+ polygonSymbol.color = [24, 255, 243, 0.411];
+
+ var polygon = new Polygon({
+ "rings": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ graphic = new Graphic(polygon, polygonSymbol);
+
+ }
+
+ graphic.objId = objId;
+
+ if (this.tabIndex == 1) {
+ if (this.patrolIndex == 1) {
+ this.currentDrawing.push({
+ id: objId.id,
+ regionId: objId.regionId,
+ routeName: objId.routeName,
+ remarks: objId.remarks,
+ extent: graphic.geometry.getExtent()
+ });
+ } else {
+ this.currentDrawing.push({
+ id: objId.id,
+ regionId: objId.regionId,
+ regionName: objId.regionName,
+ remarks: objId.remarks,
+ extent: graphic.geometry.getExtent()
+ });
+ }
+ } else {
+ this.currentDrawing.push({
+ id: objId.id,
+ aname: objId.aname,
+ anumber: objId.anumber,
+ extent: graphic.geometry.getExtent()
+ });
+ }
+
+
+ entitys.add(graphic);
+ },
+
+ modifyPolygon: function() {
+ var self = this;
+ if (self.editToolbar != null) {
+
+ if (self.patrolIndex == 1) {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.paths[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/updatelx',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ regionId: polygon.graphic.objId.regionId,
+ routeName: polygon.graphic.objId.routeName,
+ routeInfo: dataStr,
+ remarks: polygon.graphic.objId.remarks,
+ },
+ success: function(result) {
+ if (result.code == 200) {
+ layui.use('layer', function() {
+ layui.layer.msg('巡逻路线修改成功!');
+ })
+ //修改按钮颜色
+ $("#editEngineeringMap").css("color", "#757575");
+ // $("#securityMapTips4").css("display", "none");
+ self.isEdit = false;
+ self.editToolbarStatus = false;
+
+ }
+ }
+ })
+ } else {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.rings[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/updateqy',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ regionId: polygon.graphic.objId.regionId,
+ regionName: polygon.graphic.objId.regionName,
+ coordinate: dataStr,
+ remarks: polygon.graphic.objId.remarks
+ },
+ success: function(result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ }
+
+
+ }
+ },
+
+ electronicFence: function() {
+ var self = this;
+ if (self.editToolbar != null) {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.rings[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/updatee',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ aname: polygon.graphic.objId.aname,
+ anumber: polygon.graphic.objId.anumber,
+ routeInfo: dataStr
+ },
+ success: function(result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ }
+ },
+
+ //聚合图层事件
+ flareClusterLayer: function(datas) {
+
+ var that = this;
+
+ var preClustered = false;
+ var displaySingleFlaresAtCount = 10;
+ var areaDisplayMode = "";
+ // var allData = JSON.parse(DATA);
+ // DataManager.setData(allData);
+
+ //init the layer, more options are available and explained in the cluster layer constructor
+ that.clusterLayer = new FlareClusterLayer({
+ id: "flare-cluster-layer",
+ spatialReference: new esri.SpatialReference({
+ "wkid": 4326
+ }),
+ subTypeFlareProperty: "facilityType",
+ singleFlareTooltipProperty: "name",
+ displaySubTypeFlares: true,
+ displaySingleFlaresAtCount: displaySingleFlaresAtCount,
+ flareShowMode: "mouse",
+ preClustered: preClustered,
+ clusterRatio: 75,
+ clusterAreaDisplay: areaDisplayMode,
+ clusteringBegin: function() {
+ console.log("clustering begin");
+ },
+ clusteringComplete: function() {
+ console.log("clustering complete");
+ }
+ });
+
+ //set up a class breaks renderer to render different symbols based on the cluster count. Use the required clusterCount property to break on.
+ var defaultSym = new PictureMarkerSymbol("./images/ceshi.png", 32, 32).setOffset(0, 15);
+ var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
+ var xlSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 32, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([200, 52, 59, 0.8]), 1), new dojo.Color([250, 65, 74, 0.8]));
+ var lgSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 28, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([41, 163, 41, 0.8]), 1), new dojo.Color([51, 204, 51, 0.8]));
+ var mdSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 24, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([82, 163, 204, 0.8]), 1), new dojo.Color([102, 204, 255, 0.8]));
+ var smSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([230, 184, 92, 0.8]), 1), new dojo.Color([255, 204, 102, 0.8]));
+ renderer.addBreak(0, 19, smSymbol);
+ renderer.addBreak(20, 150, mdSymbol);
+ renderer.addBreak(151, 1000, lgSymbol);
+ renderer.addBreak(1001, Infinity, xlSymbol);
+
+ that.clusterLayer.setRenderer(renderer); //use standard setRenderer.
+
+ //set up a popup template
+ var template = new PopupTemplate({
+ title: "{name}",
+ fieldInfos: [{
+ fieldName: "facilityType",
+ label: "Facility Type",
+ visible: true
+ },
+ {
+ fieldName: "postcode",
+ label: "Post Code",
+ visible: true
+ },
+ {
+ fieldName: "isOpen",
+ label: "Opening Hours",
+ visible: true
+ }
+ ]
+ });
+
+ //clusterLayer.infoTemplate = template;
+ that._map.infoWindow.titleInBody = false;
+
+ that._map.addLayer(that.clusterLayer);
+
+ //var data = DataManager.getData();
+ that.clusterLayer.addData(datas);
+
+
+ },
+ clearLayer: function() {
+ var that = this;
+ that._map.removeLayer(that.clusterLayer);
+ that.clusterLayer = null;
}
- });
- //set up a class breaks renderer to render different symbols based on the cluster count. Use the required clusterCount property to break on.
- var defaultSym = new PictureMarkerSymbol("./images/ceshi.png", 32, 32).setOffset(0, 15);
- var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
- var xlSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 32, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([200, 52, 59, 0.8]), 1), new dojo.Color([250, 65, 74, 0.8]));
- var lgSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 28, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([41, 163, 41, 0.8]), 1), new dojo.Color([51, 204, 51, 0.8]));
- var mdSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 24, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([82, 163, 204, 0.8]), 1), new dojo.Color([102, 204, 255, 0.8]));
- var smSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([230, 184, 92, 0.8]), 1), new dojo.Color([255, 204, 102, 0.8]));
- renderer.addBreak(0, 19, smSymbol);
- renderer.addBreak(20, 150, mdSymbol);
- renderer.addBreak(151, 1000, lgSymbol);
- renderer.addBreak(1001, Infinity, xlSymbol);
-
- that.clusterLayer.setRenderer(renderer); //use standard setRenderer.
-
- //set up a popup template
- var template = new PopupTemplate({
- title: "{name}",
- fieldInfos: [{
- fieldName: "facilityType",
- label: "Facility Type",
- visible: true
- },
- {
- fieldName: "postcode",
- label: "Post Code",
- visible: true
- },
- {
- fieldName: "isOpen",
- label: "Opening Hours",
- visible: true
- }
- ]
- });
-
- //clusterLayer.infoTemplate = template;
- that._map.infoWindow.titleInBody = false;
-
- that._map.addLayer(that.clusterLayer);
-
- //var data = DataManager.getData();
- that.clusterLayer.addData(datas);
-
-
- },
- clearLayer: function () {
- var that = this;
- that._map.removeLayer(that.clusterLayer);
- that.clusterLayer = null;
- }
-
- });
- return Widget;
-});
+ });
+ return Widget;
+});
\ No newline at end of file
diff --git a/public/map/widgets/patrolManagement/PatrolManagement01.js b/public/map/widgets/patrolManagement/PatrolManagement01.js
new file mode 100644
index 0000000..c94831a
--- /dev/null
+++ b/public/map/widgets/patrolManagement/PatrolManagement01.js
@@ -0,0 +1,2116 @@
+/*
+ * @Description:
+ * @Version: 1.0
+ * @Author: yangsx
+ * @Date: 2019-12-09 19:01:40
+ * @LastEditors: yangsx
+ * @LastEditTime: 2019-12-14 14:44:57
+ */
+define([
+ "dojo",
+ "dojo/_base/declare",
+ "dojo/_base/lang",
+ "base/BaseWidget",
+ "dojo/text!widgets/patrolManagement/template.html",
+ "base/AppEvent",
+ "base/ConfigData",
+ "widgets/patrolManagement/config",
+ "dojo/dom",
+ "dojo/dom-construct",
+ "dojo/dom-attr",
+ "dojo/dom-style",
+ "dojo/on",
+ "esri/layers/ArcGISDynamicMapServiceLayer",
+ "esri/layers/ArcGISTiledMapServiceLayer",
+ "esri/layers/FeatureLayer",
+ "controls/tab/TabControl",
+ "esri/dijit/SymbolStyler",
+ "esri/styles/basic",
+ "dojo/_base/array",
+ "esri/InfoTemplate",
+ "esri/tasks/query",
+ "esri/tasks/QueryTask",
+ "esri/Color",
+ "esri/toolbars/edit",
+ "esri/graphic",
+ "esri/geometry/Point",
+ "esri/geometry/Polyline",
+ "esri/geometry/Polygon",
+ "esri/geometry/Extent",
+ "esri/tasks/FeatureSet",
+ "esri/renderers/HeatmapRenderer",
+ "esri/symbols/SimpleLineSymbol",
+ "esri/symbols/SimpleFillSymbol",
+ "esri/symbols/PictureMarkerSymbol",
+ "esri/symbols/SimpleMarkerSymbol",
+ "esri/SpatialReference",
+ "esri/tasks/GeometryService",
+ "esri/tasks/ProjectParameters",
+ "esri/layers/GraphicsLayer",
+ "esri/layers/LabelLayer",
+ "esri/symbols/TextSymbol",
+ "esri/renderers/SimpleRenderer",
+ "esri/renderers/ClassBreaksRenderer",
+ "esri/tasks/Geoprocessor",
+ "esri/tasks/DataFile",
+ "esri/geometry/webMercatorUtils",
+ "esri/symbols/Font",
+ "esri/geometry/ScreenPoint",
+ "esri/layers/ImageParameters",
+ "esri/geometry/geometryEngine",
+ "esri/dijit/PopupTemplate",
+ "widgets/clientManagement/FlareClusterLayer_v3",
+ "dojo/domReady!"
+], function (
+ dojo,
+ declare,
+ lang,
+ BaseWidget,
+ template,
+ AppEvent,
+ ConfigData,
+ config,
+ dom,
+ domConstruct,
+ domAttr,
+ domStyle,
+ on,
+ ArcGISDynamicMapServiceLayer,
+ ArcGISTiledMapServiceLayer,
+ FeatureLayer,
+ TabControl,
+ SymbolStyler,
+ basic,
+ arrayUtils,
+ InfoTemplate,
+ Query,
+ QueryTask,
+ Color,
+ Edit,
+ Graphic,
+ Point,
+ Polyline,
+ Polygon,
+ Extent,
+ FeatureSet,
+ HeatmapRenderer,
+ SimpleLineSymbol,
+ SimpleFillSymbol,
+ PictureMarkerSymbol,
+ SimpleMarkerSymbol,
+ SpatialReference,
+ GeometryService,
+ ProjectParameters,
+ GraphicsLayer,
+ LabelLayer,
+ TextSymbol,
+ SimpleRenderer,
+ ClassBreaksRenderer,
+ Geoprocessor,
+ DataFile,
+ webMercatorUtils,
+ Font,
+ ScreenPoint,
+ ImageParameters,
+ geometryEngine,
+ PopupTemplate,
+ FlareClusterLayer
+) {
+ var Widget = declare([BaseWidget], {
+ widgetName: "PatrolManagement",
+ label: "巡逻管理",
+ templateString: template,
+ _map: null,
+ objThis: null,
+ _siteLayer: new GraphicsLayer(),
+ layuiLayer: null,
+ layuiLadate: null,
+ tabIndex: 0,
+
+ // 保留添加实体图层的变量
+ addEntitys: null,
+ entitysData: [],
+
+ // 是否派发保安的 文字
+ treatmentIndex: null,
+ securityFlag: false,
+ editParentInd: null,
+
+ // 存储新增点,线,面,数据的地方
+ polygonData: [],
+ polygonFlag: false,
+ editToolbar: null,
+ addPolygonEntitys: null,
+
+ // 所有的面图层
+ entityPolygonAll: null,
+
+ // 用来存储区域名称
+ globalRegionName: null,
+
+ // 用来区域得最大最小经纬度
+ currentDrawing: [],
+
+ // 巡逻区域或者巡逻路线的描述
+ routeOrRegionDescribe: null,
+
+ // 用来记录巡逻区域或者巡逻路线的下标的
+ patrolIndex: 0,
+
+ // 拖拽
+ isDown: false,
+ x: 0,
+ y: 0,
+ offset: null,
+ moveThis: null,
+ // 电子围栏需要新增的Id
+ newElectronicFenceId: null,
+
+ // 新增路线时,派发人员,人员名称,以及人员id
+ peopleRealName: null,
+ pepleRealId: null,
+ constructor: function (options, srcRefNode) {
+ this._map = options.map;
+ objThis = this;
+
+
+ this.addEntitys = new GraphicsLayer({
+ id: 'addEntitys'
+ });
+
+ // 添加点面线的图层
+ this.addPolygonEntitys = new GraphicsLayer({
+ id: 'addPolygonEntitys'
+ });
+ // 添加所有图层的地方
+ this.entityPolygonAll = new GraphicsLayer({
+ id: 'entityPolygonAll'
+ });
+
+
+ this._map.addLayer(this.addEntitys);
+
+
+ this._map.addLayer(this.addPolygonEntitys);
+ this._map.addLayer(this.entityPolygonAll);
+
+
+ },
+
+ startup: function () {
+ objThis._map.addLayer(objThis._siteLayer);
+ var that = this;
+ // 顶部tab得切换事件
+ $('.police-dispatching-tab li').click(function () {
+ if (that.tabIndex == $(this).index()) return;
+ if (that.entitysData.length > 0) {
+ that.addEntitys.clear();
+ that.entitysData = [];
+ }
+
+ that.patrolIndex = 0;
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+
+ $(this).addClass('on').siblings().removeClass('on');
+ var ind = $(this).index();
+ $($('.police-container > div')[ind]).stop().show().siblings().stop().hide();
+ if (ind == 0) {
+ $('#distributeCategory div:eq(0)').html('全部' + '<i></i>');
+ $('#distributeState div:eq(0)').html('全部' + '<i></i>');
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
+ } else if (ind == 1) {
+ // that.getOwnerTable($($('.analysis-container > div')[ind]).find('.tbody tbody'), '', '');
+ $('.police-dispatching .police-container .police-container-patrol .tab-header li:eq(0)').addClass('on').siblings().removeClass('on');
+ $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0)').stop().show().siblings().hide();
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
+ } else if (ind == 2) {
+ that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
+ }
+ that.tabIndex = $(this).index();
+ })
+ // 警情分发中的行点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', 'tr').on('click', 'tr', function () {
+ var lgtd = Number($(this).attr('lgtd'));
+ var lttd = Number($(this).attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ })); //根据输入坐标信息找地图上的点
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+ })
+ // 编辑,跟进按钮元素的父元素的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.operation').on('click', '.operation', function (event) {
+ event.stopPropagation();
+ })
+ // 警情分发中的编辑按钮的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.edit').on('click', '.edit', function (event) {
+ event.stopPropagation();
+ that.editParentInd = null;
+ that.editParentInd = $(this).parent().parent().index();
+ var id = $(this).attr('term-list');
+ that.treatmentIndex = null;
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ if (!$('.police-container-distribute-details').is(':hidden')) {
+ $('.police-container-distribute-details').stop().hide();
+ }
+ $('.police-container-distribute-details .content table tbody').empty();
+ var str = '';
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
+ type: 'POST',
+ dataType: 'JSON',
+ success: function (data) {
+ var result = data.data[0];
+ var t = result.galarmTime.substr(0, 10);
+ var e = result.galarmTime.substr(11);
+ var time = t + ' ' + e;
+
+ str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
+
+ str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+
+ str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+
+ str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
+
+ str += "<tr> <td>处理方式:</td> <td class='treatment-method'> <input type='radio' name='treatmentMethod' value='派发保安' lgtd=" + result.jd + " lttd=" + result.wd + "> <span>派发保安</span> <input type='radio' name='treatmentMethod' value='提示业主'> <span>提示业主</span> </td> <td>处理人:</td> <td class='securityname'></td> </tr>";
+
+ str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + result.deviceNumber + "</td> </tr>";
+ $('.police-container-distribute-details .content table tbody').append(str);
+ $('.police-container-distribute-details .handle-button .confirm').attr('police-id', result.id);
+ $('.police-container-distribute-details .handle-button').stop().show();
+ $('.police-container-distribute-details .header h4').text('警情分发');
+ $('.police-container-distribute-details').stop().show();
+ $('.police-container-distribute-details .content table tbody').off('click', '.treatment-method input').on('click', '.treatment-method input', function () {
+ if (that.treatmentIndex != $(this).val()) {
+ if ($(this).val() == '派发保安') {
+ var str = '';
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').empty();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/position/position/selectry',
+ type: 'POST',
+ data: {
+ coordinate: "point(" + $(this).attr('lgtd') + "," + $(this).attr('lttd') + ")"
+ },
+ dataType: 'JSON',
+ success: function (data) {
+
+ var result = data.data;
+
+ for (var i = 0; i < result.length; i++) {
+ str += "<tr> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].sname + "</td> <td>" + result[i].distance.toFixed(2) + "</td> <td><input type='radio' name='securityStaff' securityid=" + result[i].snumber + " securityname=" + result[i].sname + "> </td> </tr>"
+ }
+
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-content tbody').append(str);
+ }
+ })
+ $('.police-container-distribute-details .security-guard-nearby').stop().show();
+ } else {
+ $('.police-container-distribute-details .content table tbody .securityname').text('');
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ that.treatmentIndex = $(this).val();
+ }
+ })
+ }
+ })
+ })
+ // 警情分发中的详情的确认按钮
+ $('.police-container-distribute-details .handle-button .confirm').off('click').click(function () {
+ var self = this;
+ layui.use('layer', function () {
+ var layer = layui.layer;
+ if (that.treatmentIndex == null) {
+ layer.msg('请选择处理方式', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ return
+ } else {
+ if (that.treatmentIndex == '派发保安') {
+ if (that.securityFlag == false) {
+ layer.msg('请选取保安', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ return
+ }
+ }
+
+ }
+ var id = $(self).attr('police-id');
+ var handletype = null;
+ if (that.treatmentIndex != null) {
+ if (that.treatmentIndex == '派发保安') {
+ handletype = '0';
+ } else {
+ handletype = '1';
+ }
+ }
+ // 发送请求修改警单数据
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/updateInfo',
+ type: 'POST',
+ data: {
+ id: id,
+ // handleP: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').attr('people-id'),
+ // handName: $('.police-container-distribute-details .content table tbody tr:eq(4) td:eq(3)').text(),
+ handleP: $('.police-container-distribute-details .content table tbody .securityname').attr('id'),
+ handName: $('.police-container-distribute-details .content table tbody .securityname').text(),
+ handletype: handletype,
+ type: '2'
+ },
+ dataType: 'JSON',
+ success: function (data) {
+ if (data.code == 200) {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+
+ $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(2)').text('处理中');
+
+ $('.police-container .police-container-distribute .table .tbody tr:eq(' + that.editParentInd + ') td:eq(4)').html("<input class='follow-up' type='button' value='跟进' >");
+ }
+ }
+ })
+ });
+ })
+ // 警情分发中的跟进按钮的点击事件
+ $('.police-container .police-container-distribute .table .tbody').off('click', '.follow-up').on('click', '.follow-up', function () {
+ var id = $(this).attr('term-list');
+
+ if (!$('.police-container-distribute-details').is(':hidden')) {
+ $('.police-container-distribute-details').stop().hide();
+ }
+
+ $('.police-container-distribute-details .content table tbody').empty();
+
+ var str = '';
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectdInfo?deviceNumber=&id=' + id,
+ type: 'POST',
+ dataType: 'JSON',
+ success: function (data) {
+ var result = data.data[0];
+
+ var t = result.galarmTime.substr(0, 10);
+ var e = result.galarmTime.substr(11);
+ var time = t + ' ' + e;
+
+
+ str += "<tr> <td>报警人姓名:</td> <td>" + result.galarmPeople + "</td> <td>联系方式:</td> <td>" + result.phoneNumber + "</td> </tr>";
+
+ str += "<tr> <td>事发地址:</td> <td>" + result.place + "</td> <td>行政区:</td> <td>" + result.addvnm + "</td> </>";
+
+ str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>报警内容:</td> <td>" + result.content + "</td> </tr>";
+
+ str += "<tr> <td>警情级别:</td> <td>" + result.level + "</td> <td>警情类别:</td> <td>" + result.waringType + "</td> </tr>";
+
+ str += "<tr> <td>处理方式:</td> <td class='treatment-method'> " + (result.type == 2 ? '处理中' : '待处理') + " </td> <td>处理人:</td> <td class='securityname'> " + result.handName + " </td> </tr>";
+
+ str += "<tr> <td>是否上报110:</td> <td class='report-oneonezero'> <input type='radio' name='callPhone' value='是'> <span>是</span> <input type='radio' name='callPhone' value='否'> <span>否</span> </td> <td>设备编号:</td> <td>" + 1111 + "</td> </tr>";
+ $('.police-container-distribute-details .content table tbody').append(str);
+ $('.police-container-distribute-details .header h4').text('警情跟进');
+ $('.police-container-distribute-details .handle-button').stop().hide();
+ $('.police-container-distribute-details').stop().show();
+
+
+ }
+ })
+
+
+ })
+ // 警情分发中的详情的取消按钮
+ $('.police-container-distribute-details .handle-button .cancel').off('click').click(function () {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+ })
+ // 警情分发中详情的关闭按钮
+ $('.police-container-distribute-details .header .close').off('click').click(function () {
+ if (!$('.police-container-distribute-details .security-guard-nearby').is(':hidden')) {
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+ $('.police-container-distribute-details').stop().hide();
+ })
+ // 派发保安的确认按钮
+ $('.police-container-distribute-details .security-guard-nearby .security-staff-confirm input').off('click').click(function () {
+ var list = $('.police-container-distribute-details .security-guard-nearby .security-staff-content input');
+ that.securityFlag = false;
+ var id = null;
+ var securityname = null;
+ for (var i = 0; i < list.length; i++) {
+ if ($(list[i]).prop('checked') == true) {
+ that.securityFlag = true;
+ id = $(list[i]).attr('securityid');
+ securityname = $(list[i]).attr('securityname');
+ break;
+ }
+ }
+
+ if (that.securityFlag == false) {
+ layui.use('layer', function () {
+ var layer = layui.layer;
+ layer.msg('请选取保安', {
+
+
+ shade: [0.8, '#393D49'],
+
+ time: 1000
+ })
+ });
+ } else {
+
+ $('.police-container-distribute-details .content table tbody .securityname').attr('id', id).text(securityname);
+
+ $('.police-container-distribute-details .security-guard-nearby').stop().hide();
+ }
+
+ })
+ // 警情信息中类别移入事件
+ $('#distributeCategory').mouseenter(function () {
+ if ($('#distributeCategory .select-list').is(':hidden')) {
+ $('#distributeCategory .select-list').stop().slideDown(0);
+ }
+ })
+ // 警情信息中得类别移出事件
+ $('#distributeCategory').mouseleave(function () {
+ if (!$('#distributeCategory .select-list').is(':hidden')) {
+ $('#distributeCategory .select-list').stop().slideUp(0);
+ }
+ })
+ // 警情信息中类别移入事件
+ $('#distributeState').mouseenter(function () {
+ if ($('#distributeState .select-list').is(':hidden')) {
+ $('#distributeState .select-list').stop().slideDown(0);
+ }
+ })
+ // 警情信息中得类别移出事件
+ $('#distributeState').mouseleave(function () {
+ if (!$('#distributeState .select-list').is(':hidden')) {
+ $('#distributeState .select-list').stop().slideUp(0);
+ }
+ })
+ // 警情信息类,业主信息类,设备信息类别,具体项的点击事件
+ $('.police-container > div .select-list').off('click', 'li').on('click', 'li', function (event) {
+
+ var text = $(this).text();
+ $(this).parent().parent().prev().html(text + '<i></i>');
+ $(this).parent().parent().stop().slideUp(0);
+
+ if (text == '全部') text = '';
+
+ var textOrr = '';
+ var textList = '';
+ var stateType = '';
+ if (that.tabIndex == 0) {
+ // that.getPoliceTable($('.analysis-container-police').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), text);
+ if ($(this).attr('key')) {
+ textOrr = $('#distributeState div:eq(0)').text().trim();
+ textList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
+
+ for (var i = 0; i < textList.length; i++) {
+ if (textOrr == $(textList[i]).text()) {
+ stateType = $(textList[i]).attr('statetype');
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', $(this).attr('addvcd'), stateType);
+
+ } else {
+ textOrr = $('#distributeCategory div:eq(0)').text().trim();
+ textList = $('.police-dispatching .police-container .distribute-district .select-list ul li');
+
+ for (var i = 0; i < textList.length; i++) {
+ if (textOrr == $(textList[i]).text()) {
+ stateType = $(textList[i]).attr('addvcd');
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', stateType, $(this).attr('stateType'));
+
+ }
+ }
+
+ })
+ // 时间查询
+ $('#dispatchingSelectTime').off('click').click(function () {
+ var times = $(this).prevAll();
+ // 开始时间
+ var startTime = $(times[1]).val();
+ // 结束时间
+ var endTime = $(times[0]).val();
+
+
+ var textOne = $('#distributeCategory div:eq(0)').text().trim();
+ var addvcd = '';
+ var list = $('.police-dispatching .police-container .distribute-district .select-list ul li');
+ if (textOne == '全部') {
+ addvcd = '';
+ } else {
+ if (list.length > 0) {
+ for (var i = 0; i < list.length; i++) {
+ if (textOne == $(list[i]).text()) {
+ addvcd = $(list[i]).attr('addvcd')
+ }
+ }
+ }
+ }
+
+ var textTwo = $('#distributeState div:eq(0)').text().trim();
+ var stateType = '';
+ var stateList = $('.police-dispatching .police-container .distribute-state .select-list ul li');
+ if (textTwo == '全部') {
+ stateType = '';
+ } else {
+ if (stateList.length > 0) {
+ for (var i = 0; i < stateList.length; i++) {
+ if (textTwo == $(stateList[i]).text()) {
+ stateType = $(stateList[i]).attr('statetype')
+ }
+ }
+ }
+ }
+
+ that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), startTime, endTime, '', addvcd, stateType);
+ })
+ // 巡逻区域中的行点击事件
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .table .tbody').off('click', 'tr').on('click', 'tr', function () {
+
+
+ var flyid = $(this).attr('flyid');
+ var flyname = $(this).attr('flyname');
+ var extent = null;
+
+ for (var i = 0; i < that.currentDrawing.length; i++) {
+ if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].regionName) {
+ extent = that.currentDrawing[i].extent;
+ }
+ }
+ // debugger
+ that._map.setExtent(extent.expand(1.5));
+
+ // var myFeatureExtent = new Extent(extent.)
+ // thisObj._map.setExtent(myFeatureExtent.expand(2));
+
+ // var lgtd = Number($(this).attr('lgtd'));
+ // var lttd = Number($(this).attr('lttd'));
+
+ // var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
+ // that._map.centerAndZoom(position, 14);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+ })
+ // 巡逻区域的新增按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .add').off('click').click(function () {
+ var url = './popup/html/region-name.html';
+ layui.use('layer', function () {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/region-name.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '区域名称',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '206px'],
+ offset: 'auto',
+ skin: 'region-name',
+ content: url,
+ closeBtn: 1,
+ success: function (layero, index) {
+ layero.find('iframe').contents().find(".start-editing").off('click').click(function () {
+ // 区域名称
+ var regionName = layero.find('iframe').contents().find('.region-name-input').val();
+ var regionDescribe = layero.find('iframe').contents().find('.region-name-textarea').val();
+ if (regionName == '') {
+ that.layuiLayer.msg('请填写区域名称', {
+ time: 1000
+ })
+ return
+ }
+
+ if (regionDescribe == '') {
+ that.layuiLayer.msg('请填写区域描述', {
+ time: 1000
+ })
+ return
+ }
+
+ that.globalRegionName = regionName;
+ that.routeOrRegionDescribe = regionDescribe;
+
+ // 开启,可以勾选线段
+ that.polygonFlag = true;
+ that.layuiLayer.close(index);
+
+ })
+ }
+ });
+ })
+
+ })
+ // 查找按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .operation .query').off('click').click(function () {
+ var routerName = $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val();
+ // if (routerName == '') {
+ // layui.use('layer', function () {
+ // layui.layer.msg('请填写区域名称', {
+ // time: 1000
+ // })
+ // })
+ // return
+ // }
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), routerName);
+ $('.police-container .police-container-patrol .main-content>li:eq(0) .distribute-table-content .route-name').val('');
+
+ })
+
+ // 保安出警管理表格中点击事件
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'input').on('click', 'input', function (event) {
+ event.stopPropagation();
+ var lgtd = Number($(this).parent().parent().attr('lgtd'));
+ var lttd = Number($(this).parent().parent().attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ })); //根据输入坐标信息找地图上的点
+ that.newElectronicFenceId = null;
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+ var graphic = that.entityPolygonAll.graphics;
+ for (var i = 0; i < graphic.length; i++) {
+ if (graphic[i].objId.id == $(this).attr('resultid')) {
+ if (graphic[i].geometry.rings[0].length > 0) {
+ that.polygonFlag = false;
+ that.electronicFence();
+ that.activateToolbar(graphic[i]);
+ } else {
+ layui.use('layer', function () {
+ layui.layer.msg('请开始划分电子围栏');
+ })
+ that.polygonFlag = true;
+ that.newElectronicFenceId = graphic[i].objId;
+ }
+ }
+ }
+ })
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr').on('click', 'tr', function (event) {
+ event.stopPropagation();
+ var lgtd = Number($(this).attr('lgtd'));
+ var lttd = Number($(this).attr('lttd'));
+ var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ })); //根据输入坐标信息找地图上的点
+
+ that._map.centerAndZoom(position, 18); //缩放,10是缩放级别,可以自定义,数值越大缩放越大
+
+ var snumber = $(this).attr('term-snumber');
+
+ var url = './popup/html/personnel-information-management.html?id=' + snumber;
+ layui.use('layer', function () {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/personnel-information-management.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '保安人员信息',
+ type: 2,
+ shadeClose: true,
+ shade: false,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['400px', '220px'],
+ offset: 'auto',
+ skin: 'personnel-information-management',
+ content: url,
+ closeBtn: 1,
+ });
+ })
+ })
+ $('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody').off('click', 'tr td').on('click', 'tr td', function (event) {
+ if ($(this).index() == 4) {
+ event.stopPropagation();
+ return;
+
+ }
+ })
+
+ // 巡逻管理中,巡逻路线和巡逻区域的切换换
+ $('.police-dispatching .police-container .police-container-patrol .tab-header li').off('click').click(function () {
+ if (that.patrolIndex == $(this).index()) return;
+ $(this).addClass('on').siblings().removeClass('on');
+ $(".police-dispatching .police-container .police-container-patrol .main-content li:eq(" + $(this).index() + ")").stop().show().siblings().stop().hide();
+
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+ if ($(this).index() == 1) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function (res) {
+ var result = res.data;
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ for (var i = 0; i < result.length; i++) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ }
+ }
+ })
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+ } else {
+
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(0) .table .tbody tbody'), '');
+ }
+
+ that.patrolIndex = $(this).index();
+ })
+ // 巡逻管理下面的巡逻路线中的select选择框的移入事件
+ $('#patrolRoute').mouseenter(function () {
+ if ($('#patrolRoute .select-list').is(':hidden')) {
+ $('#patrolRoute .select-list').stop().slideDown(0);
+ }
+ })
+ // 巡逻管理下面的巡逻路线中的select选择框的移出事件
+ $('#patrolRoute').mouseleave(function () {
+ if (!$('#patrolRoute .select-list').is(':hidden')) {
+ $('#patrolRoute .select-list').stop().slideUp(0);
+ }
+ })
+ // 巡逻路线中区域选择的具体项的点击事件
+ $('.police-dispatching .police-container .police-container-patrol .select-list').off('click', 'li').on('click', 'li', function (event) {
+ var text = $(this).text();
+ $(this).parent().parent().prev().html(text + '<i></i>').attr('regionId', $(this).attr('regionId'));
+ $(this).parent().parent().stop().slideUp(0);
+ })
+ // 巡逻路线中的新增按钮的点击事件
+ $('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .add').off('click').click(function () {
+ var url = './popup/html/route-name-layer.html';
+ layui.use('layer', function () {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/route-name-layer.css'
+ });
+ that.layuiLayer.closeAll();
+ that.layuiLayer.open({
+ title: '路线名称及描述',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '216px'],
+ offset: 'auto',
+ skin: 'route-name-layer',
+ content: url,
+ closeBtn: 1,
+ resize: false,
+ success: function (layero, index) {
+ layero.find('iframe').contents().find(".start-editing").off('click').click(function () {
+ // 区域名称 or 路线名称
+ var routeName = layero.find('iframe').contents().find('.route-name-layer-input').val();
+ var routeDescribe = layero.find('iframe').contents().find('.route-name-layer-textarea').val();
+ var peopleRealName = layero.find('iframe').contents().find('.route-personnel').val();
+ var pepleRealId = layero.find('iframe').contents().find('.route-personnel').attr('peopleid');
+ if (routeName == '') {
+ that.layuiLayer.msg('请填写路线名称', {
+ time: 1000
+ })
+ return
+ }
+
+ if (routeDescribe == '') {
+ that.layuiLayer.msg('请填写路线描述', {
+ time: 1000
+ })
+ return
+ }
+
+ // if (pepleRealId == '') {
+ // that.layuiLayer.msg('请选择人员', {
+ // time: 1000
+ // })
+ // return
+ // }
+ that.peopleRealName = peopleRealName;
+ that.pepleRealId = '485';
+
+ that.globalRegionName = routeName;
+ that.routeOrRegionDescribe = routeDescribe;
+ // // 开启,可以勾选线段
+ that.polygonFlag = true;
+ that.layuiLayer.close(index);
+
+ })
+ }
+ });
+ })
+
+ })
+ // 巡逻路线行点击事件
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr').on('click', 'tr', function () {
+ var flyid = $(this).attr('flyid');
+ var flyname = $(this).attr('flyname');
+ var extent = null;
+ for (var i = 0; i < that.currentDrawing.length; i++) {
+ if (flyid == that.currentDrawing[i].id && flyname == that.currentDrawing[i].routeName) {
+ extent = that.currentDrawing[i].extent;
+ }
+ }
+ that._map.setExtent(extent.expand(1.5));
+ })
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'tr td').on('click', 'tr td', function (event) {
+ if ($(this).index() == 4) {
+ event.stopPropagation();
+ return;
+
+ }
+ })
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .table .tbody').off('click', 'input').on('click', 'input', function (event) {
+ event.stopPropagation();
+ var routeName = $(this).parent().parent().children('td:eq(2)').text();
+ var routeId = $(this).parent().parent().attr('flyid');
+ var peopleName = $(this).parent().parent().children('td:eq(1)').text();
+ var self = this;
+
+
+ var url = './popup/html/routename-and-peoplename.html?routeName=' + routeName + '&routeId=' + routeId + '&peopleName=' + peopleName;
+ layui.use('layer', function () {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/routename-and-peoplename.css'
+ });
+ that.layuiLayer.closeAll();
+ that.layuiLayer.open({
+ title: '路线巡逻人员',
+ type: 2,
+ shadeClose: false,
+ shade: 0.3,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['320px', '132px'],
+ offset: 'auto',
+ skin: 'routename-and-peoplename',
+ content: url,
+ closeBtn: 1,
+ resize: false,
+ success: function (layero, index) {
+ layero.find('iframe').contents().find(".confirm-update").off('click').click(function () {
+
+ // 区域名称 or 路线名称
+ var peoplelayerName = layero.find('iframe').contents().find('.peoplename-update').val();
+ var peoplelayerId = layero.find('iframe').contents().find('.peoplename-update').attr('peopleid');
+
+ console.log(peoplelayerName, peoplelayerId);
+
+ // if (peoplelayerName == peopleName) {
+ // that.layuiLayer.close(index);
+ // that.layuiLayer.msg('人员未更改!');
+ // } else {
+
+
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/duty/duty/updatedtInfo',
+ type: 'POST',
+ data: {
+ rid: routeId,
+ snumber: peoplelayerId,
+ sname: '张三'
+ },
+ dataType: 'JSON',
+ success: function (res) {
+ if (res.code == 200) {
+ that.layuiLayer.close(index);
+ $(self).parent().parent().children('td:eq(1)').text(peoplelayerName);
+ that.layuiLayer.msg('人员已更改!');
+ }
+ }
+ })
+
+
+ // }
+
+ })
+ }
+ });
+ })
+
+
+ })
+
+
+ // 查找按钮
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .operation .query').off('click').click(function () {
+ var routerName = $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val();
+ // if (routerName == '') {
+ // layui.use('layer', function () {
+ // layui.layer.msg('请填写区域名称', {
+ // time: 1000
+ // })
+ // })
+ // return
+ // }
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), routerName);
+ $('.police-container .police-container-patrol .main-content>li:eq(1) .distribute-table-content .route-name').val('');
+ })
+
+ },
+ open: function () {
+ var that = this;
+
+ $("#tabcontainer").css("width", "360px");
+ $('#mapcontentClass').addClass('client-max-map'); //追加样式
+ AppEvent.dispatchAppEvent(AppEvent.APPLICATION_RESIZE, {});
+
+
+ document.oncontextmenu = function (event) {
+ event.preventDefault();
+ };
+
+ document.getElementById('mainMapWidget').onmousedown = function (event) {
+ if (event.button == 2) {
+ if (that.polygonData.length < 2) {
+ layui.use('layer', function () {
+ layui.layer.msg('不能形成区域,请继续划分!!!')
+ })
+ return;
+ }
+ if (that.polygonFlag == true) {
+ // 勾画最后一个点
+ var normalizedVal = webMercatorUtils.xyToLngLat(event.mapPoint.x, event.mapPoint.y);
+ that.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ // 声明空字符串,存储数据
+ var dataStr = '';
+ var data = null;
+ if (that.patrolIndex == 1) {
+ that.addPolyline(that.addPolygonEntitys, that.polygonData);
+ // 获取数据
+ data = that.addPolygonEntitys.graphics[0].geometry.paths[0];
+ } else {
+ that.addPolygon(that.addPolygonEntitys, that.polygonData);
+ // 获取数据
+ data = that.addPolygonEntitys.graphics[0].geometry.rings[0];
+ }
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ if (that.tabIndex == 1) {
+ if (that.patrolIndex == 1) {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/insertlx',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ routeName: that.globalRegionName,
+ regionId: $('#patrolRoute div:eq(0)').attr('regionid'),
+ routeInfo: dataStr,
+ remarks: that.routeOrRegionDescribe,
+ creatName: ''
+ },
+ success: function (result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/duty/duty/insertduty',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ sname: that.peopleRealName,
+ snumber: that.pepleRealId,
+ rid: result.data,
+ regionId: $('#patrolRoute div:eq(0)').attr('regionid'),
+ type: 0
+ },
+ success: function (data) {
+ if (data.code == 200) {
+ }
+ }
+ })
+ }
+ }
+ })
+
+
+ // that.peopleRealName = peopleRealName;
+ // that.pepleRealId = pepleRealId;
+ } else {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/insterqy',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ regionName: that.globalRegionName,
+ coordinate: dataStr,
+ remarks: that.routeOrRegionDescribe
+ },
+ success: function (result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.patrolArea($('.police-dispatching .police-container .police-container-patrol .table .tbody tbody'), '');
+ }
+ }
+ })
+ }
+ } else if (that.tabIndex == 2) {
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/insertes',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ anumber: that.newElectronicFenceId.anumber,
+ aname: that.newElectronicFenceId.aname,
+ routeInfo: dataStr
+ },
+ success: function (result) {
+ if (result.code == 200) {
+ that.addPolygonEntitys.clear();
+ that.polygonData = [];
+ that.getSecurityPeople($('.police-dispatching .police-container .police-container-policeforce .table .tbody tbody'), '');
+ }
+ }
+ })
+ }
+
+
+ }
+ that.polygonFlag = false;
+
+ // that.polygonData = [];
+
+
+ }
+ }
+
+
+
+ // $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').empty();
+ // $.ajax({
+ // url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ // type: 'GET',
+ // dataType: 'JSON',
+ // success: function (res) {
+ // var result = res.data;
+ // $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ // for (var i = 0; i < result.length; i++) {
+ // $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ // }
+ // }
+ // })
+ // that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+
+ that.polygonFlag = false;
+ that.entityPolygonAll.clear();
+ that.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ that.polygonData = [];
+ that.addPolygonEntitys.clear();
+
+ that.treatmentIndex = null;
+ that.tabIndex = 1;
+ that.patrolIndex = 1;
+
+ $('.police-dispatching-tab li:eq(1)').addClass('on').siblings().removeClass('on');
+ $($('.police-container > div')[1]).stop().show().siblings().stop().hide();
+
+
+ $('.police-dispatching .police-container .distribute-district .select-list ul').empty();
+ $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=''>全部</li>");
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectqy',
+ type: 'GET',
+ dataType: 'JSON',
+ success: function (res) {
+ var result = res.data;
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select>ul>li>div:eq(0)').html(result[0].regionName + '<i></i>').attr('regionId', result[0].regionId);
+ for (var i = 0; i < result.length; i++) {
+ $('.police-dispatching .police-container .police-container-patrol .main-content .select-list ul').append($("<li regionId='" + result[i].regionId + "'>" + result[i].regionName + "</li>"))
+ }
+ }
+ })
+ that.getRouteInformation($('.police-dispatching .police-container .police-container-patrol .main-content>li:eq(1) .table .tbody tbody'), '');
+ // $.ajax({
+ // url: 'http://s16s652780.51mypc.cn/api/district/district/selectList',
+ // type: 'POST',
+ // dataType: 'JSON',
+ // success: function (data) {
+ // for (var i = 0; i < data.data.length; i++) {
+ // $('.police-dispatching .police-container .distribute-district .select-list ul').append("<li key='addvcd' addvcd=" + data.data[i].addvcd + ">" + data.data[i].addvnm + "</li>");
+ // }
+ // }
+ // })
+
+
+ layui.use('laydate', function () {
+ that.layuiLadate = layui.laydate;
+ //执行一个laydate实例 开始
+ that.layuiLadate.render({
+ elem: '#dispatchingStartTime', //指定元素
+ type: "datetime",
+ format: 'yyyy-MM-dd HH:mm',
+ btns: ['confirm'],
+ trigger: 'click',
+ });
+ // 结束
+ that.layuiLadate.render({
+ elem: '#dispatchingEndTime', //指定元素
+ type: "datetime",
+ format: 'yyyy-MM-dd HH:mm',
+ btns: ['confirm'],
+ trigger: 'click',
+ });
+ });
+
+ // that.getPoliceTable($('.police-container-distribute').find('.tbody tbody'), $('#dispatchingStartTime').val(), $('#dispatchingEndTime').val(), '', '', '');
+ that.clickHand();
+
+
+
+
+
+
+
+ $('.police-dispatching-tab li:eq(1)').trigger('click');
+ },
+ close: function () {
+
+ $("#tabcontainer").css("width", "66%");
+ $('#mapcontentClass').removeClass('client-max-map'); //删除样式
+
+ this.entitysData = [];
+
+ this.addEntitys.clear();
+
+ this.entityPolygonAll.clear();
+
+ this.modifyPolygon();
+
+ // 切换时清除新增点线面数组中保存得数据,与清除地图上得实体
+ this.polygonData = [];
+ this.addPolygonEntitys.clear();
+ },
+ // 鼠标点击事件
+ clickHand: function () {
+ var self = this;
+
+
+ self._map.onClick = mapClick;
+
+ // $('#mainMapWidget')[0].ondblclick = function (event) {
+ // event.preventDefault();
+ // // if ()
+ // self.activateToolbar(event.graphic);
+ // return false;
+ // };
+
+
+ function mapClick(evt) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+
+
+ var y = self._map.toMap({
+ spatialReference: '4326',
+ type: "point",
+ x: evt.screenPoint.x,
+ y: evt.screenPoint.y,
+
+ });
+
+ if (self.tabIndex == 0) {
+ if (evt.graphic) {
+ var result = evt.graphic.geometry.entityData;
+ // var liText = evt.graphic.symbol.name;
+ self.policeDetails(result.id);
+ }
+ } else if (self.tabIndex == 1) {
+ if (self.patrolIndex == 1) {
+ // 编辑中的
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ }
+ } else { // 不在编辑中
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.modifyPolygon();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.modifyPolygon()
+ }
+ }
+ } else {
+ // 编辑中的
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else if (self.polygonData.length == 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ } else if (self.polygonData.length > 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolygon(self.addPolygonEntitys, self.polygonData);
+ }
+ } else { // 不在编辑中
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.modifyPolygon();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.modifyPolygon()
+ }
+ }
+ }
+ } else if (self.tabIndex == 2) {
+ if (self.polygonFlag == true) {
+ var normalizedVal = webMercatorUtils.xyToLngLat(evt.mapPoint.x, evt.mapPoint.y);
+ if (self.polygonData.length == 0) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPoint(self.addPolygonEntitys, normalizedVal[0], normalizedVal[1]);
+ } else if (self.polygonData.length == 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolyline(self.addPolygonEntitys, self.polygonData);
+ return;
+ } else if (self.polygonData.length > 1) {
+ self.polygonData.push([normalizedVal[0], normalizedVal[1]]);
+ self.addPolygon(self.addPolygonEntitys, self.polygonData);
+ }
+ } else {
+ if (evt.graphic) { // 点击在图形上
+ // 保存当前点击得图形
+ // self.currentDrawing = evt.graphic;
+
+ self.electronicFence();
+
+ self.activateToolbar(evt.graphic);
+ } else { // 点击不在图形上
+
+ self.electronicFence()
+ }
+ }
+
+
+ // self.equipmentDetails(result.id);
+ }
+
+ }
+
+
+ // 提示信息
+ $(document).off('mousemove').mousemove(function (e) {
+ var y = e.clientY + 10;
+ var x = e.clientX + 20;
+
+ if (e.clientX < 40) {
+ var x = 40;
+ }
+
+ if (e.clientY < 42) {
+ y = 42;
+ }
+
+ if (e.clientY > ($(window).height() - 82)) {
+ y = ($(window).height() - 66);
+ }
+
+ if (e.clientX > ($(window).width() - 184)) {
+ x = ($(window).width() - 184);
+ }
+
+ if (self.tabIndex == 1 || self.tabIndex == 2) {
+
+ if (self.polygonFlag == true) {
+ $('.police-dispatching .tips').stop().show();
+
+ if (self.polygonData.length == 0) {
+ $('.police-dispatching .tips').text('单击左键开始绘制。');
+ } else {
+ if (e.clientY > ($(window).height() - 98)) {
+ y = ($(window).height() - 88);
+ }
+ $('.police-dispatching .tips').text('单击左键新增加点。单击右键完成绘制。');
+ }
+
+ $('.police-dispatching .tips').css({
+ 'top': y,
+ 'left': x,
+ })
+ } else {
+ $('.police-dispatching .tips').stop().hide();
+ }
+
+ } else {
+ $('.police-dispatching .tips').stop().hide();
+ }
+ })
+ },
+ // 警情详情弹框
+ /**
+ *
+ * @param {number} id 警情ID
+ */
+ policeDetails: function (id) {
+ var that = this;
+ 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,
+ });
+ })
+ },
+ // 业主详情弹框
+ /**
+ *
+ * @param {number} id 警情ID
+ */
+ ownerDetails: function (id) {
+ var that = this;
+ 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,
+ });
+ })
+ },
+ // 设备详情弹框
+ /**
+ *
+ * @param {number} id 设备ID
+ */
+ equipmentDetails: function (id) {
+ var that = this;
+ var url = './popup/html/equipment-details.html?obj=' + id;
+ layui.use('layer', function () {
+ that.layuiLayer = layui.layer;
+ that.layuiLayer.config({
+ extend: 'myskin/equipment-details.css'
+ });
+ that.layuiLayer.close(that.layuiLayer.index);
+ that.layuiLayer.open({
+ title: '警情详情',
+ type: 2,
+ shadeClose: true,
+ shade: false,
+ maxmin: false, //开启最大化最小化按钮
+ area: ['520px', '320px'],
+ offset: 'auto',
+ skin: 'equipment-details',
+ content: url,
+ closeBtn: 1,
+ });
+ })
+ },
+ // 获取当前时间,以及昨天现在的时间
+ getTime: function getTime() {
+ var timestamp = Date.parse(new Date());
+
+ // 当前时间
+ var currentTime = new Date(timestamp);
+ // 年
+ var currentY = currentTime.getFullYear();
+ // 月
+ var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1;
+ // 日
+ var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
+ // 时
+ var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours();
+ // 分
+ var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes();
+ // 明天
+ var tomorrowTime = new Date(timestamp - 60 * 60 * 24 * 1000);
+ // 年
+ var tomorrowY = tomorrowTime.getFullYear();
+ // 月
+ var tomorrowM = tomorrowTime.getMonth() + 1 < 10 ? '0' + (tomorrowTime.getMonth() + 1) : tomorrowTime.getMonth() + 1;
+ // 日
+ var tomorrowD = tomorrowTime.getDate() < 10 ? '0' + tomorrowTime.getDate() : tomorrowTime.getDate();
+ // 时
+ var tomorrowH = tomorrowTime.getHours() < 10 ? '0' + tomorrowTime.getHours() : tomorrowTime.getHours();
+ // 分
+ var tomorrowDd = tomorrowTime.getMinutes() < 10 ? '0' + tomorrowTime.getMinutes() : tomorrowTime.getMinutes();
+ return {
+ current: currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd,
+ tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd,
+ month: currentM + currentD
+ };
+ },
+ // 获取警情信息列表
+ /**
+ *
+ * @param {object} dom jq对象
+ * @param {string} beginTime 开始时间
+ * @param {string} endTime 结束时间
+ * @param {*} waringType 警情的类别
+ */
+ getPoliceTable: function (dom, beginTime, endTime, waringType, addvcd, type) {
+ dom.empty();
+ var that = this;
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/jingdan/jingdan/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ beginTime: beginTime,
+ endTime: endTime,
+ waringType: waringType,
+ addvcd: addvcd,
+ type: type
+ },
+ success: function (data) {
+ var result = data.data;
+ var str = '';
+ that.entitysData = [];
+ that.addEntitys.clear();
+ for (var a, time, t, e, y, h, i = 0; i < result.length; i++) {
+
+ if (result[i].type != 1) {
+ that.createEntitys(that.addEntitys, that.entitysData, '警情信息', {
+ lgtd: result[i].jd,
+ lttd: result[i].wd,
+ id: result[i].id
+ }, result[i].jd, result[i].wd, './images/jingbaored.png');
+
+
+ t = result[i].galarmTime.substr(0, 10);
+ e = result[i].galarmTime.substr(11);
+ time = t + ' ' + e;
+ y = result[i].galarmTime.substr(5, 5);
+ h = result[i].galarmTime.substr(11, 5);
+ a = Number(i) + 1;
+ str += '<tr term-list=' + result[i].id + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + '>';
+ str += '<td>' + a + '</td>';
+ str += '<td title=' + result[i].addvnm + '>' + result[i].addvnm + '</td>';
+ str += '<td title=' + (result[i].type == 2 ? '处理中' : '待处理') + '>' + (result[i].type == 2 ? '处理中' : '待处理') + '</td>';
+ str += "<td><a href='javascript:;' title=" + time + ">" + y + ' ' + h + "</a></td>";
+ if (result[i].type == 2) {
+ str += "<td class='operation'> <input class='follow-up' type='button' value='跟进' term-list=" + result[i].id + "> </td>";
+ } else {
+ str += "<td class='operation'> <input class='edit' type='button' value='编辑' term-list=" + result[i].id + "> </td>";
+ }
+ str += '</tr>';
+ dom.append(str);
+ str = '';
+
+ }
+
+ }
+
+ for (var i = 0; i < 1000; i++) {
+ var dd = Math.random();
+ var cc = Math.random();
+ }
+ }
+ })
+ },
+ // 获取区域信息列表
+ patrolArea: function (dom, regionName) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ regionName: regionName
+ },
+ success: function (data) {
+ var result = data.data;
+ var str = '';
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var i = 0; i < result.length; i++) {
+ entityArr = [];
+ objId = {};
+ entityData = result[i].coordinate.match(/\(([^)]*)\)/);
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.regionId = result[i].regionId;
+ objId.regionName = result[i].regionName;
+ objId.remarks = result[i].remarks;
+
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+
+ str += "<tr flyid=" + result[i].id + " flyname=" + result[i].regionName + "> <td>" + (Number(i) + 1) + "</td> <td>" + result[i].regionName + "</td> <td>" + result[i].ttime + "</td> </tr>";
+ dom.append(str);
+ str = '';
+ }
+ }
+ })
+ },
+ // 获取路线信息列表
+ getRouteInformation: function (dom, routeName) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ routeName: routeName
+ },
+ success: function (data) {
+ var result = data.data;
+ var str = '';
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var i = 0; i < result.length; i++) {
+ entityArr = [];
+ objId = {};
+ entityData = result[i].routeInfo.match(/\(([^)]*)\)/);
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.regionId = result[i].regionId;
+ objId.routeName = result[i].routeName;
+ objId.remarks = result[i].remarks;
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+ str += "<tr flyid=" + result[i].id + " flyname=" + result[i].routeName + "> <td>" + (Number(i) + 1) + "</td> <td style='display: none;'>" + result[i].sname + "</td> <td>" + result[i].routeName + "</td> <td> <a href='javascript:;' title=" + result[i].rtime + ">" + result[i].rtime.substr(5, 11) + "</a></td> <td><input type='button' value='编辑'></td> </tr>";
+ dom.append(str);
+ str = '';
+ }
+ }
+ })
+ },
+ // 获取保安人员信息列表
+ getSecurityPeople: function (dom, deviceType) {
+ dom.empty();
+ var that = this;
+ that.currentDrawing = [];
+ that.entityPolygonAll.clear();
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/security/security/selectList',
+ type: 'POST',
+ dataType: 'JSON',
+ success: function (data) {
+ var result = data.data;
+ var str = '';
+ that.entitysData = [];
+ that.addEntitys.clear();
+ var entityArr = [];
+ var objId = {};
+ var entityData = '';
+ for (var a, i = 0; i < result.length; i++) {
+
+
+ that.createEntitys(that.addEntitys, that.entitysData, '出警信息', {
+ lgtd: result[i].jd,
+ lttd: result[i].wd,
+ id: result[i].id
+ }, result[i].jd, result[i].wd, './images/security.png');
+ entityArr = [];
+ objId = {};
+ entityData = result[i].coordinate.match(/\(([^)]*)\)/);
+
+ a = Number(i) + 1;
+ str += "<tr term-snumber=" + snumber + " lgtd=" + result[i].jd + " lttd=" + result[i].wd + ">";
+ str += '<td>' + a + '</td>';
+ str += '<td title=' + result[i].snumber + '>' + result[i].snumber + '</td>';
+ str += '<td title=' + result[i].sname + '>' + result[i].sname + '</td>';
+ str += '<td title=' + result[i].phone + '>' + result[i].phone + '</td>';
+ str += "<td> <input type='button' value='编辑' resultid=" + result[i].id + "> </td>";
+ str += '</tr>';
+ dom.append(str);
+ str = '';
+
+
+ // 此时result=["(dsfasjfj3124123)", "dsfasjfj3124123"];
+ if (entityData && entityData != '') {
+ entityData = entityData[1].split(',');
+ for (var j = 0; j < entityData.length; j++) {
+ entityArr.push([Number(entityData[j].split(' ')[0]), Number(entityData[j].split(' ')[1])]);
+ }
+ }
+ objId.id = result[i].id;
+ objId.anumber = result[i].snumber;
+ objId.aname = result[i].sname;
+
+ that.addPolygonAll(that.entityPolygonAll, entityArr, objId);
+ }
+
+
+ }
+ })
+ },
+ // 创建实体图层
+ createEntitys: function (entitys, entityContent, name, item, lgtd, lttd, outlineColors) {
+
+ var symbol = new esri.symbol.PictureMarkerSymbol(outlineColors, 26, 26);
+ symbol.name = name;
+ var pt = new Point(lgtd, lttd, new esri.SpatialReference({
+ wkid: 4326
+ }));
+ pt.entityData = item;
+ var graphic = new esri.Graphic(pt, symbol);
+ entitys.add(graphic);
+
+
+ entityContent.push(item);
+ },
+ addPoint: function (entitys, lgtd, lttd) {
+ var symbol = new esri.symbol.PictureMarkerSymbol('./images/real-time-callPolice.png', 10, 10);
+ var pt = new Point(lgtd, lttd, new SpatialReference({
+ wkid: 4326
+ }));
+ var graphic = new esri.Graphic(pt, symbol);
+ entitys.add(graphic);
+ },
+ addPolyline: function (entitys, path) {
+ entitys.clear();
+ var polylineSymbol = new SimpleLineSymbol();
+ polylineSymbol.color = [255, 0, 0, 1];
+ polylineSymbol.width = 4;
+ var polyline = new Polyline({
+ "paths": [path],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ entitys.add(new Graphic(polyline, polylineSymbol));
+ },
+ addPolygon: function (entitys, rings) {
+ entitys.clear();
+ var polygonSymbol = new SimpleFillSymbol();
+ polygonSymbol.color = [24, 255, 243, 0.411];
+ var polygon = new Polygon({
+ "rings": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ entitys.add(new Graphic(polygon, polygonSymbol));
+ },
+
+ activateToolbar: function (graphic) {
+ var tool = 0;
+
+ this.editToolbar = new Edit(this._map);
+
+ // if (registry.byId("tool_move").checked) {
+ tool = tool | Edit.MOVE;
+ // }
+ // if (registry.byId("tool_vertices").checked) {
+ tool = tool | Edit.EDIT_VERTICES;
+ // }
+ // if (registry.byId("tool_scale").checked) {
+ tool = tool | Edit.SCALE;
+ // }
+ // if (registry.byId("tool_rotate").checked) {
+ tool = tool | Edit.ROTATE;
+ // }
+ // enable text editing if a graphic uses a text symbol
+ // if ( graphic.symbol.declaredClass === "esri.symbol.TextSymbol" ) {
+ tool = tool | Edit.EDIT_TEXT;
+ // }
+
+ var options = {
+ allowAddVertices: true,
+ allowDeleteVertices: true,
+ uniformScaling: true
+ };
+ this.editToolbar.activate(tool, graphic, options);
+
+ },
+
+ addPolygonAll: function (entitys, rings, objId) {
+ // entitys.clear();
+ var graphic = null;
+ if (this.patrolIndex == 1) {
+ var polylineSymbol = new SimpleLineSymbol();
+ polylineSymbol.color = [255, 0, 0, 1];
+ polylineSymbol.width = 4;
+ var polyline = new Polyline({
+ "paths": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ graphic = new Graphic(polyline, polylineSymbol)
+
+ } else {
+ var polygonSymbol = new SimpleFillSymbol();
+ polygonSymbol.color = [24, 255, 243, 0.411];
+
+ var polygon = new Polygon({
+ "rings": [rings],
+ "spatialReference": {
+ "wkid": 4326
+ }
+ });
+
+ graphic = new Graphic(polygon, polygonSymbol);
+
+ }
+
+ graphic.objId = objId;
+
+ if (this.tabIndex == 1) {
+ if (this.patrolIndex == 1) {
+ this.currentDrawing.push({
+ id: objId.id,
+ regionId: objId.regionId,
+ routeName: objId.routeName,
+ remarks: objId.remarks,
+ extent: graphic.geometry.getExtent()
+ });
+ } else {
+ this.currentDrawing.push({
+ id: objId.id,
+ regionId: objId.regionId,
+ regionName: objId.regionName,
+ remarks: objId.remarks,
+ extent: graphic.geometry.getExtent()
+ });
+ }
+ } else {
+ this.currentDrawing.push({
+ id: objId.id,
+ aname: objId.aname,
+ anumber: objId.anumber,
+ extent: graphic.geometry.getExtent()
+ });
+ }
+
+
+ entitys.add(graphic);
+ },
+
+ modifyPolygon: function () {
+ var self = this;
+ if (self.editToolbar != null) {
+
+ if (self.patrolIndex == 1) {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.paths[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/routeIn/routein/updatelx',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ regionId: polygon.graphic.objId.regionId,
+ routeName: polygon.graphic.objId.routeName,
+ routeInfo: dataStr,
+ remarks: polygon.graphic.objId.remarks,
+ },
+ success: function (result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ } else {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.rings[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/regions/regions/updateqy',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ regionId: polygon.graphic.objId.regionId,
+ regionName: polygon.graphic.objId.regionName,
+ coordinate: dataStr,
+ remarks: polygon.graphic.objId.remarks
+ },
+ success: function (result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ }
+
+
+ }
+ },
+
+ electronicFence: function () {
+ var self = this;
+ if (self.editToolbar != null) {
+ var polygon = self.editToolbar.getCurrentState();
+
+
+ for (var i = 0; i < self.currentDrawing.length; i++) {
+
+ if (self.currentDrawing[i].id == polygon.graphic.objId.id) {
+ self.currentDrawing[i].extent = polygon.graphic.geometry.getExtent();
+ }
+
+ }
+
+
+ self.editToolbar.deactivate();
+
+ self.editToolbar = null;
+
+
+ // 声明空字符串,存储数据
+ var dataStr = '';
+
+ // 获取数据
+ var data = polygon.graphic.geometry.rings[0];
+
+
+ for (var i = 0; i < data.length; i++) {
+ dataStr += (data[i][0] + ' ' + data[i][1] + ',');
+ }
+ // 组装数据
+ dataStr = dataStr.substring(0, dataStr.length - 1);
+
+ $.ajax({
+ url: 'http://s16s652780.51mypc.cn/api/enclosure/enclosure/updatee',
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ id: polygon.graphic.objId.id,
+ aname: polygon.graphic.objId.aname,
+ anumber: polygon.graphic.objId.anumber,
+ routeInfo: dataStr
+ },
+ success: function (result) {
+ if (result.code == 200) {
+
+ }
+ }
+ })
+ }
+ },
+
+ //聚合图层事件
+ flareClusterLayer: function (datas) {
+
+ var that = this;
+
+ var preClustered = false;
+ var displaySingleFlaresAtCount = 10;
+ var areaDisplayMode = "";
+ // var allData = JSON.parse(DATA);
+ // DataManager.setData(allData);
+
+ //init the layer, more options are available and explained in the cluster layer constructor
+ that.clusterLayer = new FlareClusterLayer({
+ id: "flare-cluster-layer",
+ spatialReference: new esri.SpatialReference({
+ "wkid": 4326
+ }),
+ subTypeFlareProperty: "facilityType",
+ singleFlareTooltipProperty: "name",
+ displaySubTypeFlares: true,
+ displaySingleFlaresAtCount: displaySingleFlaresAtCount,
+ flareShowMode: "mouse",
+ preClustered: preClustered,
+ clusterRatio: 75,
+ clusterAreaDisplay: areaDisplayMode,
+ clusteringBegin: function () {
+ console.log("clustering begin");
+ },
+ clusteringComplete: function () {
+ console.log("clustering complete");
+ }
+ });
+
+ //set up a class breaks renderer to render different symbols based on the cluster count. Use the required clusterCount property to break on.
+ var defaultSym = new PictureMarkerSymbol("./images/ceshi.png", 32, 32).setOffset(0, 15);
+ var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
+ var xlSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 32, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([200, 52, 59, 0.8]), 1), new dojo.Color([250, 65, 74, 0.8]));
+ var lgSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 28, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([41, 163, 41, 0.8]), 1), new dojo.Color([51, 204, 51, 0.8]));
+ var mdSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 24, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([82, 163, 204, 0.8]), 1), new dojo.Color([102, 204, 255, 0.8]));
+ var smSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([230, 184, 92, 0.8]), 1), new dojo.Color([255, 204, 102, 0.8]));
+ renderer.addBreak(0, 19, smSymbol);
+ renderer.addBreak(20, 150, mdSymbol);
+ renderer.addBreak(151, 1000, lgSymbol);
+ renderer.addBreak(1001, Infinity, xlSymbol);
+
+ that.clusterLayer.setRenderer(renderer); //use standard setRenderer.
+
+ //set up a popup template
+ var template = new PopupTemplate({
+ title: "{name}",
+ fieldInfos: [{
+ fieldName: "facilityType",
+ label: "Facility Type",
+ visible: true
+ },
+ {
+ fieldName: "postcode",
+ label: "Post Code",
+ visible: true
+ },
+ {
+ fieldName: "isOpen",
+ label: "Opening Hours",
+ visible: true
+ }
+ ]
+ });
+
+ //clusterLayer.infoTemplate = template;
+ that._map.infoWindow.titleInBody = false;
+
+ that._map.addLayer(that.clusterLayer);
+
+ //var data = DataManager.getData();
+ that.clusterLayer.addData(datas);
+
+
+ },
+ clearLayer: function () {
+ var that = this;
+ that._map.removeLayer(that.clusterLayer);
+ that.clusterLayer = null;
+ }
+
+ });
+ return Widget;
+});
diff --git a/public/map/widgets/patrolManagement/template copy.html b/public/map/widgets/patrolManagement/template copy.html
new file mode 100644
index 0000000..f2352f9
--- /dev/null
+++ b/public/map/widgets/patrolManagement/template copy.html
@@ -0,0 +1,261 @@
+<div class='police-dispatching' open-li='police-dispatching'>
+ <ul class='police-dispatching-tab'>
+ <li class='on'>警情分发</li>
+ <li>巡逻管理</li>
+ <li>出警队伍管理</li>
+ </ul>
+ <!-- 展示警情调度 -->
+ <div class="police-container">
+ <!-- 警情分发 -->
+ <div class="police-container-distribute">
+ <div style='display: flex;'>
+ <div class="distribute-district" style='flex: 1'>
+ <ul>
+ <li id='distributeCategory'>
+ 行政区:
+ <div>
+ 全部
+
+ <i>
+
+ </i>
+ </div>
+ <div class='select-list'>
+ <ul>
+ <li>全部</li>
+ <li>治安警情</li>
+ <li>刑事警情</li>
+ <li>火警</li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </div>
+ <div class="distribute-state" style='flex: 1'>
+ <ul>
+ <li id='distributeState'>
+ 状态:
+ <div>
+ 全部
+
+ <i>
+
+ </i>
+ </div>
+ <div class='select-list'>
+ <ul>
+ <li statetype=''>全部</li>
+ <li statetype='0'>待处理</li>
+ <li statetype='2'>处理中</li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+ <div class='distribute-selection-criteria'>
+ <input type="text" id='dispatchingStartTime' readonly> - <input type="text" id='dispatchingEndTime' readonly>
+ <input type="button" value='查询' id='dispatchingSelectTime'>
+ </div>
+ <div class='distribute-table-content'>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>行政区</th>
+ <th>状态</th>
+ <th>日期</th>
+ <th>操作</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody></tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- 巡逻管理 -->
+ <div class="police-container-patrol">
+ <ul class='tab-header'>
+ <li class='on'>巡逻区域</li>
+ <li>巡逻路线</li>
+ </ul>
+ <ul class='main-content'>
+ <li>
+ <div class='distribute-table-content'>
+ <div class="operation">
+ <input type="text" placeholder="请输入区域名称" class='route-name'>
+ <input type="button" value='查询' class='query'>
+ <input type="button" value='新增' class='add'>
+ </div>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>区域名称</th>
+ <th>时间</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody></tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </li>
+ <li style="display: none;">
+ <div class='distribute-table-content'>
+ <div class="operation">
+ <div class='select'>
+ <ul>
+ <li id='patrolRoute'>
+ 区域:
+ <div>
+
+ </div>
+ <div class='select-list'>
+ <ul>
+
+ </ul>
+ </div>
+ </li>
+ </ul>
+
+ </div>
+ <input type="button" value='新增' class='add'>
+ </div>
+ <div class="operation">
+ <input type="text" placeholder="请输入路线名称" class='route-name'>
+ <input type="button" value='查询' class='query'>
+ </div>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>人员</th>
+ <th>路线名称</th>
+ <th>时间</th>
+ <th>操作</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody></tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </li>
+ </ul>
+
+ </div>
+ <!-- 出警队伍管理 -->
+ <div class="police-container-policeforce">
+ <div class='distribute-table-content'>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>人员编号</th>
+ <th>人员名称</th>
+ <th>联系电话</th>
+ <th>电子围栏</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody>
+ <tr>
+ <td>1</td>
+ <td>011</td>
+ <td>我是是</td>
+ <td>12233344455</td>
+ <td>
+ <input type="button" value='查看'>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- 用来显示警情分发的详细内容(编辑或查看) -->
+ <div class='police-container-distribute-details' style='display: none;'>
+ <div class="header">
+ <h4>
+
+ </h4>
+ <div class="close">
+
+ </div>
+ </div>
+ <div class="content">
+ <table>
+ <tbody>
+
+
+
+
+
+
+ </tbody>
+ </table>
+ </div>
+ <div class="handle-button" style='display: none;'>
+ <input type="button" value="确定" class="confirm"><input type="button" value="取消" class='cancel'>
+ </div>
+
+ <!-- 保安 -->
+ <div class='security-guard-nearby' style='display: none;'>
+ <div class="security-staff-header">
+ <h4>
+ 附近保安
+ </h4>
+ </div>
+ <div class="security-staff-content">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>保安名字</th>
+ <th>距离/km</th>
+ <th>操作</th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
+ </div>
+ <div class="security-staff-confirm">
+ <input type="button" value="确定">
+ </div>
+ </div>
+ </div>
+
+ <div class="tips">
+ 单击左键开始绘制。
+ </div>
+</div>
\ No newline at end of file
diff --git a/public/map/widgets/patrolManagement/template.html b/public/map/widgets/patrolManagement/template.html
index 895015a..4db846c 100644
--- a/public/map/widgets/patrolManagement/template.html
+++ b/public/map/widgets/patrolManagement/template.html
@@ -1,263 +1,35 @@
<div class='police-dispatching' open-li='police-dispatching'>
- <ul class='police-dispatching-tab'>
- <li class='on'>警情分发</li>
- <li>巡逻管理</li>
- <li>出警队伍管理</li>
- </ul>
- <!-- 展示警情调度 -->
<div class="police-container">
- <!-- 警情分发 -->
- <div class="police-container-distribute">
- <div style='display: flex;'>
- <div class="distribute-district" style='flex: 1'>
- <ul>
- <li id='distributeCategory'>
- 行政区:
- <div>
- 全部
-
- <i>
-
- </i>
- </div>
- <div class='select-list'>
- <ul>
- <li>全部</li>
- <li>治安警情</li>
- <li>刑事警情</li>
- <li>火警</li>
- </ul>
- </div>
- </li>
- </ul>
- </div>
- <div class="distribute-state" style='flex: 1'>
- <ul>
- <li id='distributeState'>
- 状态:
- <div>
- 全部
-
- <i>
-
- </i>
- </div>
- <div class='select-list'>
- <ul>
- <li statetype=''>全部</li>
- <li statetype='0'>待处理</li>
- <li statetype='2'>处理中</li>
- </ul>
- </div>
- </li>
- </ul>
- </div>
- </div>
-
- <div class='distribute-selection-criteria'>
- <input type="text" id='dispatchingStartTime' readonly> - <input type="text" id='dispatchingEndTime'
- readonly>
- <input type="button" value='查询' id='dispatchingSelectTime'>
- </div>
- <div class='distribute-table-content'>
- <div class="table">
- <div class="thead">
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th>行政区</th>
- <th>状态</th>
- <th>日期</th>
- <th>操作</th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="tbody">
- <table>
- <tbody></tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
<!-- 巡逻管理 -->
<div class="police-container-patrol">
<ul class='tab-header'>
- <li style="display: none !important;">巡逻区域</li>
- <li class='on' >巡逻路线</li>
+ <!-- <li class='on'>巡逻区域</li> -->
+ <li>巡逻路线</li>
</ul>
- <ul class='main-content'>
- <li style="display: none;">
- <div class='distribute-table-content'>
- <div class="operation">
- <input type="text" placeholder="请输入区域名称" class='route-name'>
- <input type="button" value='查询' class='query'>
- <input type="button" value='新增' class='add'>
- </div>
- <div class="table">
- <div class="thead">
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th>区域名称</th>
- <th>时间</th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="tbody">
- <table>
- <tbody></tbody>
- </table>
- </div>
- </div>
- </div>
- </li>
- <li>
- <div class='distribute-table-content'>
- <!-- <div class="operation">
- <div class='select'>
- <ul>
- <li id='patrolRoute'>
- 区域:
- <div>
-
- </div>
- <div class='select-list'>
- <ul>
-
- </ul>
- </div>
- </li>
- </ul>
-
- </div>
-
- </div> -->
- <div class="operation">
- <input type="text" placeholder="请输入路线名称" class='route-name'>
- <input type="button" value='查询' class='query'>
- <input type="button" value='新增' class='add'>
- </div>
- <div class="table">
- <div class="thead">
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th style="display: none;">人员</th>
- <th>路线名称</th>
- <th>时间</th>
- <th>操作</th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="tbody">
- <table>
- <tbody></tbody>
- </table>
- </div>
- </div>
- </div>
- </li>
- </ul>
-
+ <div id="region-tree"></div>
</div>
- <!-- 出警队伍管理 -->
- <div class="police-container-policeforce">
- <div class='distribute-table-content'>
- <div class="table">
- <div class="thead">
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th>人员编号</th>
- <th>人员名称</th>
- <th>联系电话</th>
- <th>电子围栏</th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="tbody">
- <table>
- <tbody>
- <tr>
- <td>1</td>
- <td>011</td>
- <td>我是是</td>
- <td>12233344455</td>
- <td>
- <input type="button" value='查看'>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
+
+
+ </div>
+
+ <!-- 按钮事件 -->
+ <div class="mapBtn" id="mapBtn" style="display: none;">
+ <div class="insBtn">
+ <img src="./images/add-0.png" style="width:14px;height:14px;">
+ <a class=" insert " id="insertEngineeringMap">新增 | </a>
+ </div>
+ <div class="editBtn">
+ <img src="./images/edit.png" style="width:14px;height:14px;">
+ <a class=" edit " id="editEngineeringMap">编辑 | </a>
+ </div>
+ <div class="delBtn">
+ <img src="./images/del.png" style="width:14px;height:14px;">
+ <a class="delete " id="securityMapClearMap">删除</a>
</div>
</div>
- <!-- 用来显示警情分发的详细内容(编辑或查看) -->
- <div class='police-container-distribute-details' style='display: none;'>
- <div class="header">
- <h4>
-
- </h4>
- <div class="close">
-
- </div>
- </div>
- <div class="content">
- <table>
- <tbody>
-
-
-
-
-
-
- </tbody>
- </table>
- </div>
- <div class="handle-button" style='display: none;'>
- <input type="button" value="确定" class="confirm"><input type="button" value="取消" class='cancel'>
- </div>
-
- <!-- 保安 -->
- <div class='security-guard-nearby' style='display: none;'>
- <div class="security-staff-header">
- <h4>
- 附近保安
- </h4>
- </div>
- <div class="security-staff-content">
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th>保安名字</th>
- <th>距离/km</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- <div class="security-staff-confirm">
- <input type="button" value="确定">
- </div>
- </div>
- </div>
<div class="tips">
单击左键开始绘制。
</div>
-</div>
+</div>
\ No newline at end of file
diff --git a/public/map/widgets/patrolManagement/template01.html b/public/map/widgets/patrolManagement/template01.html
new file mode 100644
index 0000000..d1390fa
--- /dev/null
+++ b/public/map/widgets/patrolManagement/template01.html
@@ -0,0 +1,262 @@
+<div class='police-dispatching' open-li='police-dispatching'>
+ <ul class='police-dispatching-tab'>
+ <li class='on'>警情分发</li>
+ <li>巡逻管理</li>
+ <li>出警队伍管理</li>
+ </ul>
+ <!-- 展示警情调度 -->
+ <div class="police-container">
+ <!-- 警情分发 -->
+ <div class="police-container-distribute">
+ <div style='display: flex;'>
+ <div class="distribute-district" style='flex: 1'>
+ <ul>
+ <li id='distributeCategory'>
+ 行政区:
+ <div>
+ 全部
+
+ <i>
+
+ </i>
+ </div>
+ <div class='select-list'>
+ <ul>
+ <li>全部</li>
+ <li>治安警情</li>
+ <li>刑事警情</li>
+ <li>火警</li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </div>
+ <div class="distribute-state" style='flex: 1'>
+ <ul>
+ <li id='distributeState'>
+ 状态:
+ <div>
+ 全部
+
+ <i>
+
+ </i>
+ </div>
+ <div class='select-list'>
+ <ul>
+ <li statetype=''>全部</li>
+ <li statetype='0'>待处理</li>
+ <li statetype='2'>处理中</li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+ <div class='distribute-selection-criteria'>
+ <input type="text" id='dispatchingStartTime' readonly> - <input type="text" id='dispatchingEndTime' readonly>
+ <input type="button" value='查询' id='dispatchingSelectTime'>
+ </div>
+ <div class='distribute-table-content'>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>行政区</th>
+ <th>状态</th>
+ <th>日期</th>
+ <th>操作</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody></tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- 巡逻管理 -->
+ <div class="police-container-patrol">
+ <ul class='tab-header'>
+ <li style="display: none !important;">巡逻区域</li>
+ <li class='on'>巡逻路线</li>
+ </ul>
+ <ul class='main-content'>
+ <li style="display: none;">
+ <div class='distribute-table-content'>
+ <div class="operation">
+ <input type="text" placeholder="请输入区域名称" class='route-name'>
+ <input type="button" value='查询' class='query'>
+ <input type="button" value='新增' class='add'>
+ </div>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>区域名称</th>
+ <th>时间</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody></tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </li>
+ <li>
+ <div class='distribute-table-content'>
+ <!-- <div class="operation">
+ <div class='select'>
+ <ul>
+ <li id='patrolRoute'>
+ 区域:
+ <div>
+
+ </div>
+ <div class='select-list'>
+ <ul>
+
+ </ul>
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+ </div> -->
+ <div class="operation">
+ <input type="text" placeholder="请输入路线名称" class='route-name'>
+ <input type="button" value='查询' class='query'>
+ <input type="button" value='新增' class='add'>
+ </div>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th style="display: none;">人员</th>
+ <th>路线名称</th>
+ <th>时间</th>
+ <th>操作</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody></tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </li>
+ </ul>
+
+ </div>
+ <!-- 出警队伍管理 -->
+ <div class="police-container-policeforce">
+ <div class='distribute-table-content'>
+ <div class="table">
+ <div class="thead">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>人员编号</th>
+ <th>人员名称</th>
+ <th>联系电话</th>
+ <th>电子围栏</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ <div class="tbody">
+ <table>
+ <tbody>
+ <tr>
+ <td>1</td>
+ <td>011</td>
+ <td>我是是</td>
+ <td>12233344455</td>
+ <td>
+ <input type="button" value='查看'>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- 用来显示警情分发的详细内容(编辑或查看) -->
+ <div class='police-container-distribute-details' style='display: none;'>
+ <div class="header">
+ <h4>
+
+ </h4>
+ <div class="close">
+
+ </div>
+ </div>
+ <div class="content">
+ <table>
+ <tbody>
+
+
+
+
+
+
+ </tbody>
+ </table>
+ </div>
+ <div class="handle-button" style='display: none;'>
+ <input type="button" value="确定" class="confirm"><input type="button" value="取消" class='cancel'>
+ </div>
+
+ <!-- 保安 -->
+ <div class='security-guard-nearby' style='display: none;'>
+ <div class="security-staff-header">
+ <h4>
+ 附近保安
+ </h4>
+ </div>
+ <div class="security-staff-content">
+ <table>
+ <thead>
+ <tr>
+ <th>序号</th>
+ <th>保安名字</th>
+ <th>距离/km</th>
+ <th>操作</th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
+ </div>
+ <div class="security-staff-confirm">
+ <input type="button" value="确定">
+ </div>
+ </div>
+ </div>
+
+ <div class="tips">
+ 单击左键开始绘制。
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/views/policeInformationDistribution/patrolManagement copy.vue b/src/views/policeInformationDistribution/patrolManagement copy.vue
new file mode 100644
index 0000000..137718f
--- /dev/null
+++ b/src/views/policeInformationDistribution/patrolManagement copy.vue
@@ -0,0 +1,1119 @@
+<template>
+ <el-row>
+ <!-- <el-col :span="5">
+ <div class="box">
+ <el-scrollbar>
+ <basic-container>
+ <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+ </basic-container>
+ </el-scrollbar>
+ </div>
+ </el-col> -->
+ <el-col>
+ <basic-container>
+ <avue-crud
+ :option="option"
+ :search.sync="search"
+ :table-loading="loading"
+ :data="data"
+ ref="crud"
+ v-model="form"
+ :permission="permissionList"
+ @row-del="rowDel"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ :before-open="beforeOpen"
+ :page.sync="page"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ <template slot="menuLeft">
+ <el-button
+ type="danger"
+ size="small"
+ style="display: none"
+ plain
+ icon="el-icon-delete"
+ v-if="permission.user_delete"
+ @click="handleDelete"
+ >删 除
+ </el-button>
+ <el-button
+ style="display: none"
+ type="info"
+ size="small"
+ plain
+ v-if="permission.user_reset"
+ icon="el-icon-refresh"
+ @click="handleReset"
+ >密码重置
+ </el-button>
+ </template>
+ <template slot-scope="{ row }" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="roleName">
+ <el-tag>{{ row.roleName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="deptName">
+ <el-tag>{{ row.deptName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="online_status">
+ <el-tag
+ >{{
+ row.online_status == "0"
+ ? "离线"
+ : row.online_status == "1"
+ ? "在线"
+ : "离线"
+ }}
+ </el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="sex">
+ <el-tag>{{ row.sex == 1 ? "男" : "女" }} </el-tag>
+ </template>
+
+ <template slot-scope="{ type, size, row }" slot="menu">
+ <el-button
+ icon="el-icon-location-outline"
+ :size="size"
+ :type="type"
+ @click.stop="handleMap(row, 1)"
+ >编辑巡逻区域
+ </el-button>
+ <el-button
+ icon="el-icon-location-outline"
+ style="display:none"
+ :size="size"
+ :type="type"
+ @click.stop="handleMap(row, 2)"
+ >编辑巡逻路线
+ </el-button>
+ </template>
+ </avue-crud>
+ <el-dialog
+ title="用户角色配置"
+ append-to-body
+ :visible.sync="roleBox"
+ width="345px"
+ >
+ <el-tree
+ :data="roleGrantList"
+ show-checkbox
+ check-strictly
+ default-expand-all
+ node-key="id"
+ ref="treeRole"
+ :default-checked-keys="roleTreeObj"
+ :props="props"
+ >
+ </el-tree>
+
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="roleBox = false">取 消</el-button>
+ <el-button type="primary" @click="submitRole">确 定</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="用户数据导入"
+ append-to-body
+ :visible.sync="excelBox"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption"
+ v-model="excelForm"
+ :upload-after="uploadAfter"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+ <el-dialog
+ title="用户平台配置"
+ append-to-body
+ :visible.sync="platformBox"
+ >
+ <avue-crud
+ :option="platformOption"
+ :table-loading="platformLoading"
+ :data="platformData"
+ ref="platformCrud"
+ v-model="platformForm"
+ :before-open="platformBeforeOpen"
+ :page.sync="platformPage"
+ :permission="platformPermissionList"
+ @row-update="platformRowUpdate"
+ @search-change="platformSearchChange"
+ @search-reset="platformSearchReset"
+ @selection-change="platformSelectionChange"
+ @current-change="platformCurrentChange"
+ @size-change="platformSizeChange"
+ @refresh-change="platformRefreshChange"
+ @on-load="platformOnLoad"
+ >
+ <template slot-scope="{ row }" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
+ </avue-crud>
+ </el-dialog>
+
+ <el-drawer
+ :title="tab == 1 ? '巡逻区域' : '巡逻路线'"
+ append-to-body="true"
+ :visible.sync="showMap"
+ >
+ <iframe
+ id="securityMap"
+ ref="securityMap"
+ :src="baseUrl"
+ frameborder="0"
+ width="100%"
+ height="100%"
+ name="securityMap"
+ ></iframe>
+ </el-drawer>
+ </basic-container>
+ </el-col>
+ </el-row>
+</template>
+
+<script>
+import {
+ getUser,
+ getUserPlatform,
+ remove,
+ update,
+ updatePlatform,
+ add,
+ grant,
+ resetPassword,
+} from "@/api/system/user";
+// import { getList } from "@/api/security/security";
+import { getList } from "@/api/system/examination";
+import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
+import { getRoleTree } from "@/api/system/role";
+import { getPostList } from "@/api/system/post";
+import { mapGetters } from "vuex";
+import website from "@/config/website";
+import { getToken } from "@/util/auth";
+
+export default {
+ data() {
+ const validatePass = (rule, value, callback) => {
+ if (value === "") {
+ callback(new Error("请输入密码"));
+ } else {
+ callback();
+ }
+ };
+ const validatePass2 = (rule, value, callback) => {
+ if (value === "") {
+ callback(new Error("请再次输入密码"));
+ } else if (value !== this.form.password) {
+ callback(new Error("两次输入密码不一致!"));
+ } else {
+ callback();
+ }
+ };
+ return {
+ baseUrl: "/map/index.html?ISinit=1",
+ form: {},
+ search: {},
+ roleBox: false,
+ excelBox: false,
+ platformBox: false,
+ showMap: false,
+ initFlag: true,
+ selectionList: [],
+ query: {},
+ loading: true,
+ roleId: "",
+ platformLoading: false,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ platformPage: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ init: {
+ roleTree: [],
+ deptTree: [],
+ },
+ props: {
+ label: "title",
+ value: "key",
+ },
+ roleGrantList: [],
+ roleTreeObj: [],
+ treeDeptId: "",
+ treeData: [],
+ treeOption: {
+ nodeKey: "id",
+ lazy: true,
+ treeLoad: function (node, resolve) {
+ const parentId = node.level === 0 ? 0 : node.data.id;
+ getDeptLazyTree(parentId).then((res) => {
+ resolve(
+ res.data.data.map((item) => {
+ return {
+ ...item,
+ leaf: !item.hasChildren,
+ };
+ })
+ );
+ });
+ },
+ addBtn: false,
+ menu: false,
+ size: "small",
+ props: {
+ labelText: "标题",
+ label: "title",
+ value: "value",
+ children: "children",
+ },
+ },
+ option: {
+ height: "auto",
+ calcHeight: 54,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: false,
+ //stripe:true,
+ index: true,
+ selection: true,
+ tab: null,
+ viewBtn: true,
+ menuWidth: 350,
+ //dialogType: 'drawer',
+ dialogClickModal: false,
+ column: [
+ {
+ label: "姓名",
+ prop: "realName",
+ search: true,
+ searchSpan: 4,
+ display: false,
+ },
+ {
+ label: "账号",
+ prop: "account",
+ searchSpan: 4,
+ search: true,
+ display: false,
+ },
+ {
+ label: "性别",
+ prop: "sex",
+ type: "select",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "联系方式",
+ prop: "phone",
+ display: false,
+ },
+ {
+ label: "所属角色",
+ prop: "roleName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "组织机构",
+ prop: "deptName",
+ slot: true,
+ display: false,
+ width: 260,
+ },
+ ],
+ group: [
+ {
+ label: "基础信息",
+ prop: "baseInfo",
+ icon: "el-icon-user-solid",
+ column: [
+ {
+ label: "所属客户",
+ prop: "tenantId",
+ type: "tree",
+ dicUrl: "/api/blade-system/tenant/select",
+ props: {
+ label: "tenantName",
+ value: "tenantId",
+ },
+ hide: !website.tenantMode,
+ addDisplay: website.tenantMode,
+ editDisplay: website.tenantMode,
+ viewDisplay: website.tenantMode,
+ rules: [
+ {
+ required: true,
+ message: "请输入所属租户",
+ trigger: "click",
+ },
+ ],
+ span: 24,
+ },
+ {
+ label: "登录账号",
+ prop: "account",
+ rules: [
+ {
+ required: true,
+ message: "请输入登录账号",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "用户平台",
+ type: "select",
+ dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ dataType: "number",
+ slot: true,
+ prop: "userType",
+ rules: [
+ {
+ required: true,
+ message: "请选择用户平台",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "密码",
+ prop: "password",
+ hide: true,
+ editDisplay: false,
+ viewDisplay: false,
+ rules: [
+ { required: true, validator: validatePass, trigger: "blur" },
+ ],
+ },
+ {
+ label: "确认密码",
+ prop: "password2",
+ hide: true,
+ editDisplay: false,
+ viewDisplay: false,
+ rules: [
+ { required: true, validator: validatePass2, trigger: "blur" },
+ ],
+ },
+ ],
+ },
+ {
+ label: "详细信息",
+ prop: "detailInfo",
+ icon: "el-icon-s-order",
+ column: [
+ {
+ label: "用户昵称",
+ prop: "name",
+ hide: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入用户昵称",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "用户姓名",
+ prop: "realName",
+ rules: [
+ {
+ required: true,
+ message: "请输入用户姓名",
+ trigger: "blur",
+ },
+ {
+ min: 2,
+ max: 5,
+ message: "姓名长度在2到5个字符",
+ },
+ ],
+ },
+ {
+ label: "手机号码",
+ prop: "phone",
+ overHidden: true,
+ },
+ {
+ label: "电子邮箱",
+ prop: "email",
+ hide: true,
+ overHidden: true,
+ },
+ {
+ label: "用户性别",
+ prop: "sex",
+ type: "select",
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ {
+ label: "未知",
+ value: 3,
+ },
+ ],
+ hide: true,
+ },
+ {
+ label: "用户生日",
+ type: "date",
+ prop: "birthday",
+ format: "yyyy-MM-dd hh:mm:ss",
+ valueFormat: "yyyy-MM-dd hh:mm:ss",
+ hide: true,
+ },
+ {
+ label: "账号状态",
+ prop: "statusName",
+ hide: true,
+ display: false,
+ },
+ ],
+ },
+ {
+ label: "职责信息",
+ prop: "dutyInfo",
+ icon: "el-icon-s-custom",
+ column: [
+ {
+ label: "用户编号",
+ prop: "code",
+ },
+ {
+ label: "所属角色",
+ prop: "roleId",
+ multiple: true,
+ type: "tree",
+ dicData: [],
+ props: {
+ label: "title",
+ },
+ checkStrictly: true,
+ slot: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: true,
+ // rules: [{
+ // required: true,
+ // message: "请选择所属角色",
+ // trigger: "click"
+ // }]
+ },
+ {
+ label: "所属部门",
+ prop: "deptId",
+ type: "cascader",
+ //multiple: true,
+ dicData: [],
+ props: {
+ label: "title",
+ },
+ checkStrictly: true,
+ slot: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择所属部门",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "所属岗位",
+ prop: "postId",
+ type: "tree",
+ multiple: true,
+ dicData: [],
+ props: {
+ label: "postName",
+ value: "id",
+ },
+ },
+ ],
+ },
+ ],
+ },
+ data: [],
+ platformQuery: {},
+ platformSelectionList: [],
+ platformData: [],
+ platformForm: {},
+ platformOption: {
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ dialogClickModal: false,
+ menuWidth: 120,
+ editBtnText: "配置",
+ column: [
+ {
+ label: "登录账号",
+ prop: "account",
+ search: true,
+ display: false,
+ },
+ {
+ label: "所属租户",
+ prop: "tenantName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "用户姓名",
+ prop: "realName",
+ search: true,
+ display: false,
+ },
+ {
+ label: "用户平台",
+ prop: "userTypeName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "用户平台",
+ type: "select",
+ dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ dataType: "number",
+ search: true,
+ hide: true,
+ display: false,
+ prop: "userType",
+ rules: [
+ {
+ required: true,
+ message: "请选择用户平台",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "用户拓展",
+ prop: "userExt",
+ type: "textarea",
+ minRows: 8,
+ span: 24,
+ overHidden: true,
+ row: true,
+ hide: true,
+ },
+ ],
+ },
+ excelForm: {},
+ excelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "模板上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "模板上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/blade-user/import-user",
+ },
+ {
+ label: "数据覆盖",
+ prop: "isCovered",
+ type: "switch",
+ align: "center",
+ width: 80,
+ dicData: [
+ {
+ label: "否",
+ value: 0,
+ },
+ {
+ label: "是",
+ value: 1,
+ },
+ ],
+ value: 0,
+ slot: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择是否覆盖",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ };
+ },
+ watch: {
+ "form.tenantId"() {
+ if (this.form.tenantId !== "" && this.initFlag) {
+ this.initData(this.form.tenantId);
+ }
+ },
+ "excelForm.isCovered"() {
+ if (this.excelForm.isCovered !== "") {
+ const column = this.findObject(this.excelOption.column, "excelFile");
+ column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
+ }
+ },
+ },
+ computed: {
+ ...mapGetters(["userInfo", "permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(null, false),
+ viewBtn: this.vaildData(null, false),
+ delBtn: this.vaildData(null, false),
+ editBtn: this.vaildData(null, false),
+ };
+ },
+ platformPermissionList() {
+ return {
+ addBtn: false,
+ viewBtn: false,
+ delBtn: false,
+ editBtn: this.vaildData(this.permission.user_edit, false),
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ mounted() {
+ // 非租户模式默认加载管理组数据
+ if (!website.tenantMode) {
+ this.initData(website.tenantId);
+ }
+ },
+ methods: {
+ nodeClick(data) {
+ this.treeDeptId = data.id;
+ this.page.currentPage = 1;
+ this.onLoad(this.page);
+ },
+ initData(tenantId) {
+ getRoleTree(tenantId).then((res) => {
+ var that = this;
+ const column = this.findObject(this.option.group, "roleId");
+ column.dicData = res.data.data;
+ //数组
+ var roleData = res.data.data;
+ //遍历
+ roleData.forEach((item) => {
+ if (item.title == "处警员") {
+ that.roleId = item.id;
+ }
+ if (item.hasChildren) {
+ //取出title对比
+ if (item.title == "处警员") {
+ that.roleId = item.id;
+ }
+ }
+ });
+ });
+ getDeptTree(tenantId).then((res) => {
+ const column = this.findObject(this.option.group, "deptId");
+ column.dicData = res.data.data;
+ });
+ getPostList(tenantId).then((res) => {
+ const column = this.findObject(this.option.group, "postId");
+ column.dicData = res.data.data;
+ });
+ },
+ submitRole() {
+ const roleList = this.$refs.treeRole.getCheckedKeys().join(",");
+ grant(this.ids, roleList).then(() => {
+ this.roleBox = false;
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.onLoad(this.page);
+ });
+ },
+ rowSave(row, done, loading) {
+ row.deptId = row.deptId.join(",");
+ row.roleId = this.roleId;
+ row.postId = row.postId.join(",");
+ add(row).then(
+ () => {
+ this.initFlag = false;
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ //打开巡逻区域地图
+ handleMap(row, index) {
+ var that = this;
+ this.tab = index;
+ this.showMap = true;
+ if (row.jd == "" || row.jd == "0.0") {
+ var rwjd = "115.862321";
+ var rwwd = "28.591108";
+ that.baseUrl = `/map/index.html?ISinit=1&openid=SecurityMap&jd=${rwjd}&wd=${rwwd}&code=${row.id}&name=${row.realName}&index=${index}`;
+ } else {
+ that.baseUrl = `/map/index.html?ISinit=1&openid=SecurityMap&jd=${row.jd}&wd=${row.wd}&code=${row.id}&name=${row.realName}&index=${index}`;
+ }
+
+ this.$nextTick(() => {
+ this.$refs.securityMap.onload = () => {
+ if (window.frames[0].init) {
+ if (row.jd == "" || row.jd == "0.0") {
+ //如果处警员无位置信息,则赋值一个默认数据,否则地图无法加载
+ window.frames[0].init("SecurityMap", {
+ x: rwjd,
+ y: rwwd,
+ code: row.code,
+ index: index,
+ });
+ } else {
+ window.frames[0].init("SecurityMap", {
+ x: row.jd,
+ y: row.wd,
+ code: row.code,
+ index: index,
+ });
+ }
+ } else {
+ console.log(`没有找到到window.frames[0].init`);
+ }
+ };
+ });
+ },
+ rowUpdate(row, index, done, loading) {
+ row.deptId = row.deptId.join(",");
+ row.roleId = row.roleId.join(",");
+ row.postId = row.postId.join(",");
+ update(row).then(
+ () => {
+ this.initFlag = false;
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ searchReset() {
+ this.query = {};
+ this.treeDeptId = "";
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ selectionClear() {
+ this.selectionList = [];
+ this.$refs.crud.toggleSelection();
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ handleReset() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择账号密码重置为123456?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return resetPassword(this.ids);
+ })
+ .then(() => {
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ handleGrant() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.roleTreeObj = [];
+ if (this.selectionList.length === 1) {
+ this.roleTreeObj = this.selectionList[0].roleId.split(",");
+ }
+ getRoleTree().then((res) => {
+ this.roleGrantList = res.data.data;
+ this.roleBox = true;
+ });
+ },
+ handlePlatform() {
+ this.platformBox = true;
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+ handleExport() {
+ this.$confirm("是否导出用户数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(
+ `/api/blade-user/export-user?${
+ this.website.tokenHeader
+ }=${getToken()}&account=${this.search.account}&realName=${
+ this.search.realName
+ }`
+ );
+ });
+ },
+ handleTemplate() {
+ window.open(
+ `/api/blade-user/export-template?${
+ this.website.tokenHeader
+ }=${getToken()}`
+ );
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getUser(this.form.id).then((res) => {
+ this.form = res.data.data;
+ if (this.form.hasOwnProperty("deptId")) {
+ this.form.deptId = this.form.deptId.split(",");
+ }
+ if (this.form.hasOwnProperty("roleId")) {
+ this.form.roleId = this.form.roleId.split(",");
+ }
+ if (this.form.hasOwnProperty("postId")) {
+ this.form.postId = this.form.postId.split(",");
+ }
+ });
+ }
+ this.initFlag = true;
+ done();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ this.loading = true;
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query),
+ this.treeDeptId
+ ).then((res) => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ },
+ platformRowUpdate(row, index, done, loading) {
+ updatePlatform(row.id, row.userType, row.userExt).then(
+ () => {
+ this.platformOnLoad(this.platformPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ platformBeforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getUserPlatform(this.platformForm.id).then((res) => {
+ this.platformForm = res.data.data;
+ });
+ }
+ done();
+ },
+ platformSearchReset() {
+ this.platformQuery = {};
+ this.platformOnLoad(this.platformPage);
+ },
+ platformSearchChange(params, done) {
+ this.platformQuery = params;
+ this.platformPage.currentPage = 1;
+ this.platformOnLoad(this.platformPage, params);
+ done();
+ },
+ platformSelectionChange(list) {
+ this.platformSelectionList = list;
+ },
+ platformSelectionClear() {
+ this.platformSelectionList = [];
+ this.$refs.platformCrud.toggleSelection();
+ },
+ platformCurrentChange(currentPage) {
+ this.platformPage.currentPage = currentPage;
+ },
+ platformSizeChange(pageSize) {
+ this.platformPage.pageSize = pageSize;
+ },
+ platformRefreshChange() {
+ this.platformOnLoad(this.platformPage, this.platformQuery);
+ },
+ platformOnLoad(page, params = {}) {
+ this.platformLoading = true;
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query),
+ this.treeDeptId
+ ).then((res) => {
+ const data = res.data.data;
+ this.platformPage.total = data.total;
+ this.platformData = data.records;
+ this.platformLoading = false;
+ this.selectionClear();
+ });
+ },
+ },
+};
+</script>
+
+<style>
+.box {
+ height: 800px;
+}
+
+.el-scrollbar {
+ height: 100%;
+}
+
+.box .el-scrollbar__wrap {
+ overflow: scroll;
+}
+</style>
diff --git a/src/views/policeInformationDistribution/patrolManagement.vue b/src/views/policeInformationDistribution/patrolManagement.vue
index d63508a..88a4dfc 100644
--- a/src/views/policeInformationDistribution/patrolManagement.vue
+++ b/src/views/policeInformationDistribution/patrolManagement.vue
@@ -1,5 +1,6 @@
<template>
-<iframe src="http://s16s652780.51mypc.cn/map/index.html?openid=PatrolManagement" style="width: 100%;height: 100%" frameborder="0"></iframe>
+<!-- <iframe src="http://s16s652780.51mypc.cn/map/index.html?openid=PatrolManagement" style="width: 100%;height: 100%" frameborder="0"></iframe> -->
+<iframe src="/map/index.html?openid=PatrolManagement" style="width: 100%;height: 100%" frameborder="0"></iframe>
</template>
<script>
--
Gitblit v1.9.3