/*
|
* @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/realTimePolice/template.html",
|
"base/AppEvent",
|
"base/ConfigData",
|
"widgets/realTimePolice/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/graphic",
|
"esri/geometry/Point",
|
"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!",
|
"widgets/realTimePolice/LayUIDataTable"
|
], 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,
|
Graphic,
|
Point,
|
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: "RealTimePolice",
|
label: "实时报警",
|
templateString: template,
|
_map: null,
|
objThis: null,
|
_siteLayer: new GraphicsLayer(),
|
layuiLayer: null,
|
layuiLadate: null,
|
tabIndex: 0,
|
|
// 保留添加实体图层的变量
|
realTimeAddEntitys: null,
|
entitysData: [],
|
realTimeEquipment: [],
|
layerIndex: null,
|
historyPoliceData: [],
|
historyPoliceId: null,
|
realTimeQuery: null,
|
|
|
// 存放表格用于表格数据刷新
|
updateRealTable: null,
|
|
//存放聚合实体
|
clusterLayer: null,
|
|
//存放地图是否隐藏参数
|
mapShow: 1,
|
// 存放行政区编码
|
realTimeAddvcd: '',
|
|
// 存放警情类型
|
realTimeWringType: '',
|
|
// 是否开启存储列表最后一个ID
|
flagPoliceId: true,
|
|
flagPoliceLength: 0,
|
|
|
// 开始时间与结束时间
|
realBeginTime: '',
|
realEndTime: '',
|
|
|
constructor: function (options, srcRefNode) {
|
this._map = options.map;
|
|
objThis = this;
|
|
this.realTimeAddEntitys = new GraphicsLayer({ id: 'realTimeAddEntitys' });
|
this.addOneEntitys = new GraphicsLayer({ id: 'addOneEntitys' });
|
this.addTwoEntitys = new GraphicsLayer({ id: 'addTwoEntitys' });
|
this.addThreeEntitys = new GraphicsLayer({ id: 'addThreeEntitys' });
|
|
this._map.addLayer(this.realTimeAddEntitys);
|
this._map.addLayer(this.addOneEntitys);
|
|
},
|
startup: function () {
|
objThis._map.addLayer(objThis._siteLayer);
|
var that = this;
|
|
// 接警信息中类别移入事件
|
$('#realtimeDistrict').mouseenter(function () {
|
if ($('#realtimeDistrict .select-list').is(':hidden')) {
|
$('#realtimeDistrict .select-list').stop().slideDown(0);
|
}
|
})
|
|
// 接警信息中得类别移出事件
|
$('#realtimeDistrict').mouseleave(function () {
|
if (!$('#realtimeDistrict .select-list').is(':hidden')) {
|
$('#realtimeDistrict .select-list').stop().slideUp(0);
|
}
|
})
|
|
// 接警信息中的等级移入事件
|
$('#realtimeLevel').mouseenter(function () {
|
if ($('#realtimeLevel .select-list').is(':hidden')) {
|
$('#realtimeLevel .select-list').stop().slideDown(0);
|
}
|
})
|
|
// 接警信息中的等级移出事件
|
$('#realtimeLevel').mouseleave(function () {
|
if (!$('#realtimeLevel .select-list').is(':hidden')) {
|
$('#realtimeLevel .select-list').stop().slideUp(0);
|
}
|
})
|
|
// 音频的播放关闭
|
$('.real-time-police .layer-realtime-police .audio').off('click').click(function () {
|
var audio = $(this).children('audio');
|
if ($(this).hasClass('open')) {
|
audio[0].pause();
|
$(this).removeClass('open').addClass('close');
|
} else {
|
audio[0].play()
|
$(this).removeClass('close').addClass('open');
|
|
}
|
|
// $(this).children('audio').$('div').hasClass('redColor')
|
})
|
|
// 报警的切换 向上
|
$('.real-time-police .layer-realtime-police .bottom-tab .up-tab').off('click').click(function () {
|
|
var list = $('.real-time-police .layer-realtime-police ul li');
|
if ($(this).hasClass('on')) {
|
if ($('.real-time-police .bottom-tab .down-tab').hasClass('off')) {
|
$('.real-time-police .bottom-tab .down-tab').removeClass('off').addClass('on');
|
}
|
if (list.length > 0) {
|
for (var i = 0; i < list.length; i++) {
|
if ($(list[i]).hasClass('on')) {
|
$(list[i]).removeClass('on').prev().addClass('on');
|
|
var channelNumber = $(list[i]).prev().attr('channelNumber');
|
var serialNumber = $(list[i]).prev().attr('serialNumber');
|
|
that.getStartVideoSite($('.real-time-police .layer-realtime-police-parent video')[0], channelNumber, serialNumber);
|
|
if (i - 1 == 0) {
|
$(this).removeClass('on').addClass('off');
|
break;
|
} else {
|
break
|
}
|
}
|
}
|
}
|
}
|
|
})
|
|
// 报警的切换 向下
|
$('.real-time-police .layer-realtime-police .bottom-tab .down-tab').off('click').click(function () {
|
var list = $('.real-time-police .layer-realtime-police ul li');
|
if ($(this).hasClass('on')) {
|
if ($('.real-time-police .bottom-tab .up-tab').hasClass('off')) {
|
$('.real-time-police .bottom-tab .up-tab').removeClass('off').addClass('on');
|
}
|
if (list.length > 0) {
|
for (var i = 0; i < list.length; i++) {
|
if ($(list[i]).hasClass('on')) {
|
$(list[i]).removeClass('on').next().addClass('on');
|
|
var channelNumber = $(list[i]).next().attr('channelNumber');
|
var serialNumber = $(list[i]).next().attr('serialNumber');
|
|
that.getStartVideoSite($('.real-time-police .layer-realtime-police-parent video')[0], channelNumber, serialNumber);
|
|
if (i == list.length - 2) {
|
$(this).removeClass('on').addClass('off');
|
break;
|
} else {
|
break
|
}
|
}
|
}
|
}
|
}
|
})
|
|
// 实时提醒的关闭
|
$('.real-time-police .layer-realtime-police .layer-header .close').click(function () {
|
|
$('.real-time-police .layer-realtime-police-parent').stop().hide();
|
$('.real-time-police .layer-realtime-police .audio audio')[0].pause();
|
$('.real-time-police .layer-realtime-police .layer-realtime-video video')[0].pause();
|
$('.real-time-police .layer-realtime-police .layer-realtime-video video').attr('src', '');
|
|
$("#realtimeDistrict > div:eq(0)").html("全部" + "<i></i>");
|
$("#realtimeLevel > div:eq(0)").html("全部" + "<i></i>");
|
|
that.realTimeAddvcd = "";
|
that.realTimeWringType = "";
|
|
that.realEndTime = that.getTime().current;
|
$("#realTimeEnd").val(that.realEndTime);
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime);
|
|
// that.layerRealtime();
|
})
|
|
// 实时报警中得行政区选择点击事件
|
$('.real-time-select-condition #realtimeDistrict .select-list').off('click', 'li').on('click', 'li', function (event) {
|
|
if (that.entitysData.length > 0) {
|
that.realTimeAddEntitys.clear();
|
that.entitysData = [];
|
}
|
|
var text = $(this).text();
|
|
$(this).parent().parent().prev().html(text + '<i></i>');
|
$(this).parent().parent().stop().slideUp(0);
|
|
that.realTimeAddvcd = $(this).attr('addvcd');
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
|
})
|
|
// 实时报警中得警情类型选择点击事件
|
$('.real-time-select-condition #realtimeLevel .select-list').off('click', 'li').on('click', 'li', function (event) {
|
|
if (that.entitysData.length > 0) {
|
that.realTimeAddEntitys.clear();
|
that.entitysData = [];
|
}
|
|
var text = $(this).text();
|
|
$(this).parent().parent().prev().html(text + '<i></i>');
|
$(this).parent().parent().stop().slideUp(0);
|
|
that.realTimeWringType = (text == "全部" ? "" : text).trim();
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
|
})
|
|
// 时间选择后得查询按钮
|
$("#realTimeQuilckQuery").off('click').click(function () {
|
|
that.realBeginTime = $("#realTimeBegin").val();
|
that.realEndTime = $("#realTimeEnd").val();
|
|
layui.use('layer', function () {
|
|
var layer = layui.layer;
|
|
if (that.realBeginTime == '') {
|
|
layer.msg('请选择开始时间!', {
|
icon: 5,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
|
} else {
|
|
if (that.realEndTime == '') {
|
layer.msg('请选择结束时间!', {
|
icon: 5,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
} else {
|
|
$("#realTimeBegin").val('');
|
|
$("#realTimeEnd").val('');
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
}
|
|
}
|
|
})
|
|
|
})
|
|
// 本周本月全部,切换事件
|
$(".realtime-quick").off('click', 'button').on('click', 'button', function () {
|
|
var text = $(this).text();
|
|
var time = that.getThisWeekTime();
|
|
$("#realtimeDistrict > div:eq(0)").html("全部" + "<i></i>");
|
$("#realtimeLevel > div:eq(0)").html("全部" + "<i></i>");
|
|
that.realTimeAddvcd = "";
|
that.realTimeWringType = "";
|
|
|
$("#realTimeBegin").val(that.realBeginTime);
|
$("#realTimeEnd").val(that.realEndTime);
|
|
|
switch (text) {
|
|
case '本周':
|
|
that.realBeginTime = time.week.beginTime;
|
that.realEndTime = time.week.endTime;
|
|
$("#realTimeBegin").val(that.realBeginTime);
|
$("#realTimeEnd").val(that.realEndTime);
|
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
|
break;
|
|
case '本月':
|
|
that.realBeginTime = time.month.beginTime;
|
that.realEndTime = time.month.endTime;
|
|
$("#realTimeBegin").val(that.realBeginTime);
|
$("#realTimeEnd").val(that.realEndTime);
|
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
|
break;
|
|
case '全部':
|
|
that.flagPoliceId == true
|
|
that.realBeginTime = '';
|
that.realEndTime = '';
|
|
$("#realTimeBegin").val('');
|
$("#realTimeEnd").val('');
|
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
|
break;
|
|
}
|
|
})
|
|
// 撤销警情
|
$('.layer-realtime-police-parent').off('click', 'table .revoke').on('click', '.revoke', function () {
|
that.clearPoliceDetail($(this).data('id'));
|
|
})
|
|
// 生成警单
|
$('.layer-realtime-police-parent').off('click', 'table .generate').on('click', '.generate', function () {
|
|
var _self = this;
|
var inpVal = $('.layer-realtime-police-parent .layer-content ul li.on tbody tr:eq(5) input').val();
|
var textareaVal = $('.layer-realtime-police-parent .layer-content ul li.on tbody tr:eq(5) textarea').val();
|
|
var liPrev = $('.layer-realtime-police-parent .layer-content ul li.on').prev();
|
var liNextAll = $('.layer-realtime-police-parent .layer-content ul li.on').nextAll();
|
var liNext = $('.layer-realtime-police-parent .layer-content ul li.on').next();
|
var liSiblings = $('.layer-realtime-police-parent .layer-content ul li.on').siblings();
|
var liSelect = $('.layer-realtime-police-parent .layer-content ul li.on');
|
|
layui.use('layer', function () {
|
|
var layer = layui.layer;
|
|
if (inpVal == '') {
|
|
layer.msg("请选择要求处置时间");
|
|
return
|
}
|
|
$.ajax({
|
url: 'http://61.131.136.25:2082/api/jingdan/jingdan/saves',
|
type: 'POST',
|
data: {
|
rName: $(_self).data('rname'),
|
galarmPeople: $(_self).data('galarmpeople'),
|
phoneNumber: $(_self).data('phonenumber'),
|
place: $(_self).data('place'),
|
content: $(_self).data('content'),
|
galarmTime: $(_self).data('alarmtime'),
|
waringType: $(_self).data('waringtype'),
|
deviceNumber: $(_self).data('devicenumber'),
|
type: "0",
|
handleP: null,
|
handleTime: null,
|
handName: null,
|
level: $(_self).data('level'),
|
coordinate: null,
|
jd: $(_self).data('jd'),
|
wd: $(_self).data('wd'),
|
addvcd: $(_self).data('addvcd'),
|
jjTime: that.getTime().current,
|
czTime: inpVal,
|
bz: textareaVal
|
},
|
dataType: 'JSON',
|
success: function (data) {
|
layui.use('layer', function () {
|
var layer = layui.layer;
|
if (data.code == 200) {
|
layer.msg('成功生成警单');
|
that.updateJType($(_self).data('id'), inpVal, textareaVal);
|
|
if (liSiblings.length == 0) {
|
$('.real-time-police .layer-realtime-police .layer-header .close').trigger('click')
|
} else if (liSiblings.length == 1) {
|
|
$('.layer-realtime-police-parent .layer-content .bottom-tab').stop().hide();
|
|
liSelect.removeClass('on').remove().siblings().addClass('on');
|
|
} else if (liSiblings.length > 1) {
|
|
if (liNextAll.length > 0) {
|
liSelect.removeClass('on').remove();
|
liNext.addClass('on');
|
|
if (liNextAll.length == 1) {
|
$('.layer-realtime-police-parent .layer-content .bottom-tab .down-tab').removeClass('on').addClass('off');
|
}
|
|
} else {
|
liSelect.removeClass('on').remove();
|
liPrev.addClass('on');
|
}
|
|
}
|
|
} else {
|
layer.msg('警单生成失败');
|
}
|
})
|
}
|
})
|
|
|
|
})
|
|
})
|
|
|
// 清空时间按钮
|
$("#realTimeClearQuery").off('click').click(function () {
|
|
$("#realTimeBegin").val('');
|
$("#realTimeEnd").val('');
|
|
})
|
},
|
|
|
open: function () {
|
var that = this;
|
that.realBeginTime = that.getTime().currentEight;
|
that.realEndTime = that.getTime().current;
|
$("#realTimeBegin").val(that.realBeginTime);
|
$("#realTimeEnd").val(that.realEndTime);
|
|
// $('#mapcontentClass').addClass('client-left-map'); //追加样式
|
$('#tabcontainer').css('width', '0%');
|
$("#client-sh-map i").html('');
|
|
//右侧地图拖动
|
$("#realTime-sh-map").off('click').click("click", () => {
|
|
if (that.mapShow == 1) {
|
$('#tabcontainer').css('width', '66%');
|
$("#realTime-sh-map i").html('');
|
that.updateRealTable.reload({});
|
that.mapShow = 0;
|
} else {
|
$('#tabcontainer').css('width', '100%');
|
$("#realTime-sh-map i").html('');
|
that.updateRealTable.reload({});
|
that.mapShow = 1;
|
}
|
|
});
|
|
|
// 行政区
|
// $.ajax({
|
// url: 'http://61.131.136.25:2082/api/district/district/selectList',
|
// type: 'POST',
|
// dataType: 'JSON',
|
// success: function (data) {
|
|
// $('.real-time-police .real-time-select-condition .realtime-district .select-list ul').empty();
|
|
// $('.real-time-police .real-time-select-condition .realtime-district .select-list ul').append("<li addvcd=''>全部</li>");
|
|
// for (var i = 0; i < data.data.length; i++) {
|
// $('.real-time-police .real-time-select-condition .realtime-district .select-list ul').append("<li addvcd=" + data.data[i].addvcd + ">" + data.data[i].addvnm + "</li>");
|
// }
|
// }
|
// })
|
|
// // 警情类型下拉
|
// $.ajax({
|
// url: 'http://61.131.136.25:2082/api/alarm/alarm/selectScount',
|
// type: 'GET',
|
// dataType: 'JSON',
|
// success: function (data) {
|
|
// var res = data.data[0].type;
|
|
// console.log(res);
|
|
// $('.real-time-police .real-time-select-condition .realtime-level .select-list ul').empty();
|
|
// $('.real-time-police .real-time-select-condition .realtime-level .select-list ul').append("<li addvcd=''>全部</li>");
|
|
// for (var i = 0; i < res.length; i++) {
|
// $('.real-time-police .real-time-select-condition .realtime-level .select-list ul').append("<li>" + res[i] + "</li>");
|
// }
|
// }
|
// })
|
|
|
var layerTabHei = $(".real-time-police .real-time-information-list").height();
|
|
layui.use(['table', 'laydate'], function () {
|
var table = layui.table;
|
|
|
//第一个实例
|
that.updateRealTable = table.render({
|
elem: '#real_time_table'
|
, height: (layerTabHei - 20)
|
, url: 'http://61.131.136.25:2082/api/alarm/alarm/selectList' //数据接口
|
, method: "post"
|
, where: { jtype: '', beginTime: that.realBeginTime, endTime: that.realEndTime }
|
, parseData: function (res) { //res 即为原始返回的数据
|
if (res.data.length > 0) {
|
|
if (that.flagPoliceId == false) {
|
that.flagPoliceLength <= res.data.length ? that.flagPoliceId = true : that.flagPoliceId = false
|
}
|
|
if (that.flagPoliceId == true) {
|
that.historyPoliceId = res.data[res.data.length - 1].id;
|
// that.historyPoliceId = 60;
|
that.flagPoliceLength = res.data.length;
|
that.flagPoliceId = false;
|
}
|
|
res.data = res.data.sort(function (a, b) {
|
var x = a['alarmTime'];
|
var y = b['alarmTime'];
|
return x > y ? -1 : x < y ? 1 : 0;
|
});
|
|
var a = 0;
|
for (var i = 0; i < res.data.length; i++) {
|
a = i;
|
res.data[i].num = (a += 1);
|
res.data[i].yorn = (res.data[i].jtype == 1 ? '是' : '否');
|
|
|
res.data[i].x = Number(res.data[i].jd);
|
res.data[i].y = Number(res.data[i].wd);
|
|
// that.createEntitys(that.realTimeAddEntitys, that.entitysData, '实时报警', {
|
// lgtd: res.data[i].jd,
|
// lttd: res.data[i].wd,
|
// id: res.data[i].id,
|
// deviceNumber: res.data[i].deviceNumber
|
// }, res.data[i].jd, res.data[i].wd, '/images/real-time-callPolice.png');
|
}
|
if (that.clusterLayer != null) {
|
that.clearLayer();
|
}
|
that.flareClusterLayer(res.data);
|
|
var result;
|
|
if (this.page.curr) {
|
|
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
|
|
} else {
|
|
result = res.data.slice(0, this.limit);
|
|
}
|
|
return {
|
"code": res.code, //解析接口状态
|
"msg": res.msg, //解析提示文本
|
"count": res.data.length, //解析数据长度
|
"data": result //解析数据列表
|
}
|
} else {
|
return {
|
"code": res.code, //解析接口状态
|
"msg": res.msg, //解析提示文本
|
"count": res.data.length, //解析数据长度
|
"data": res.data //解析数据列表
|
}
|
}
|
}
|
, page: { //分页设置
|
limit: 16, //默认每一页显示数量
|
theme: 'real_time'
|
}
|
, cellMinWidth: 100
|
, cols: [[ //表头
|
{ field: 'num', title: '序号', width: 76, fixed: 'left', align: 'center' }
|
, { field: 'waringType', title: '警情类型', align: 'center' }
|
, { field: 'alarmTime', title: '报警时间', width: 164, align: 'center' }
|
, { field: 'rname', title: '报警内容', align: 'center' }
|
, { field: 'alarmPeople', title: '报警人', align: 'center' }
|
, { field: 'phoneNumber', title: '联系电话', width: 120, align: 'center' }
|
, { field: 'galarmPeople', title: '接警人', align: 'center' }
|
, { field: 'jjTime', title: '接警时间', width: 164, align: 'center' }
|
|
, { field: 'addvnm', title: '行政区', width: 94, align: 'center' }
|
, { field: 'place', title: '事发地址', width: 240, align: 'center' }
|
|
, { field: 'deviceNumber', title: '设备编号', width: 140, align: 'center' }
|
, { field: 'yorn', title: "是否生成警单", width: 120, align: 'center' }
|
|
|
|
, { field: 'jd', title: "经度", width: 0, hide: true, align: 'center' }
|
, { field: 'wd', title: "纬度", width: 0, hide: true, align: 'center' }
|
, { field: 'channelNumber', title: "通道号", width: 0, hide: true, align: 'center' }
|
, { field: 'serialNumber', title: "序列号", width: 0, hide: true, align: 'center' }
|
, { field: 'jtype', title: "是否生成警单", width: 0, hide: true, align: 'center' }
|
|
|
|
|
, {
|
field: '',
|
title: '操作',
|
toolbar: "#real_time_table_btn",
|
width: 164,
|
fixed: 'right',
|
align: 'center'
|
}
|
]]
|
, response: {
|
statusName: 'code' //规定数据状态的字段名称,默认:code
|
, statusCode: 200 //规定成功的状态码,默认:0
|
, msgName: 'msg' //规定状态信息的字段名称,默认:msg
|
, countName: 'count' //规定数据总数的字段名称,默认:count
|
, dataName: 'data' //规定数据列表的字段名称,默认:data
|
}
|
, done: function (res, curr, count, a, b, c, d) {
|
|
|
//如果是异步请求数据方式,res即为你接口返回的信息。
|
//如果是直接赋值的方式,res即为:{data: [], count: 99} data为当前页数据、count为数据总长度
|
// $(".layui-table th").css("font-weight", "bold");// 设定表格标题字体加粗
|
|
LayUIDataTable.SetJqueryObj($);// 第一步:设置jQuery对象
|
|
var currentRowDataList = LayUIDataTable.ParseDataTable(function (index, currentData, rowData) {
|
})
|
|
LayUIDataTable.HideField('jd');// 隐藏列-单列模式
|
LayUIDataTable.HideField('wd');// 隐藏列-单列模式
|
LayUIDataTable.HideField('jtype');// 隐藏列-单列模式
|
// 对相关数据进行判断处理--此处对mk2大于30的进行高亮显示
|
$.each(currentRowDataList, function (index, obj) {
|
|
if (obj['jtype'] && obj['jtype'].value == '0') {
|
obj['jtype'].row.css({ "color": "#ff7627" });
|
$('.layui-table-fixed.layui-table-fixed-l .layui-table-body tbody tr:eq(' + index + ')').css({ "color": "#ff7627" });
|
|
}
|
if (obj['jtype'] && obj['jtype'].value == '1') {
|
obj['jtype'].row.css({ "color": "#15a2fe" });
|
$('.layui-table-fixed.layui-table-fixed-l .layui-table-body tbody tr:eq(' + index + ')').css({ "color": "#15a2fe" });
|
|
}
|
})
|
|
}
|
});
|
|
table.on('tool(test)', function (obj) {
|
|
switch (obj.event) {
|
case 'realDispose': // 处
|
|
that.realTimePoliceDetails(obj.data.id, obj.data.deviceNumber, obj.data.channelNumber, obj.data.serialNumber, obj.data.jtype)
|
|
break;
|
case 'realHistory': // 设备历史
|
|
that.realTimeHistorySee(obj.data.deviceNumber)
|
|
break;
|
case 'realVideo': // 视频查看
|
|
that.realTimeVideoSee(obj.data.channelNumber, obj.data.serialNumber)
|
|
break;
|
case 'realLocation': // 定位
|
if (that.mapShow == 1) {
|
$('#tabcontainer').css('width', '66%');
|
$("#realTime-sh-map i").html('');
|
that.updateRealTable.reload({});
|
that.mapShow = 0;
|
}
|
that.viewsGoTo(obj.data.jd, obj.data.wd)
|
break;
|
}
|
;
|
});
|
|
var laydate = layui.laydate;
|
|
//开始时间时间
|
var start_a = laydate.render({
|
elem: '#realTimeBegin',
|
type: 'datetime',
|
trigger: 'click', //采用click弹出
|
theme: '#3278F0',
|
done: function (value, date, endDate) {
|
end.config.min = {
|
date: date.date,
|
hours: date.hours,
|
minutes: date.minutes,
|
month: date.month - 1,
|
seconds: date.seconds,
|
year: date.year
|
|
}; //开始日选好后,重置结束日的最小日期
|
end.config.value = {
|
date: date.date,
|
hours: date.hours,
|
minutes: date.minutes,
|
month: date.month - 1,
|
seconds: date.seconds,
|
year: date.year
|
}; //将结束日的初始值设定为开始日
|
}
|
});
|
|
//结束时间
|
var end = laydate.render({
|
elem: '#realTimeEnd',
|
type: 'datetime',
|
trigger: 'click', //采用click弹出
|
theme: '#3278F0',
|
done: function (value, date, endDate) {
|
start_a.config.max = {
|
date: date.date,
|
hours: date.hours,
|
minutes: date.minutes,
|
month: date.month - 1,
|
seconds: date.seconds,
|
year: date.year
|
}; //结束日选好后,重置开始日的最大日期
|
}
|
});
|
|
});
|
|
// that.layerRealtime();
|
|
window.deleteRealtimePolice = function (id) {
|
|
|
layui.use('layer', function () {
|
layui.layer.closeAll();
|
})
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
|
}
|
|
},
|
|
close: function () {
|
var that = this;
|
|
if (that.clusterLayer != null) {
|
that.clearLayer();
|
}
|
|
$('#mapcontentClass').removeClass('client-left-map'); //移除样式
|
$('#tabcontainer').css('width', '66%');
|
|
window.clearTimeout(that.realTimeQuery);
|
if (that.layuiLayer != null) {
|
that.layuiLayer.closeAll();
|
|
that.layerIndex = null;
|
|
}
|
if (that.entitysData.length > 0) {
|
that.realTimeAddEntitys.clear();
|
that.entitysData = [];
|
}
|
if (!$('.real-time-police .layer-realtime-police').is(':hidden')) {
|
$('.real-time-police .layer-realtime-police').stop().hide();
|
}
|
if (!$('.real-time-police .layer-realtime-equipment').is(':hidden')) {
|
$('.real-time-police .layer-realtime-equipment .close').trigger('click');
|
}
|
},
|
|
// 实时警情详情
|
realTimePoliceDetails: function (id, deviceNumber, channelNumber, serialNumber, jtype) {
|
var that = this;
|
var url = './popup/html/realtime-police-details.html?obj=' + id + '&deviceNumber=' + deviceNumber + "&channelNumber=" + channelNumber + "&serialNumber=" + serialNumber + "&jtype=" + jtype;
|
|
layui.use('layer', function () {
|
that.layuiLayer = layui.layer;
|
that.layuiLayer.config({
|
extend: 'myskin/realtime-police-details.css'
|
});
|
|
that.layuiLayer.closeAll();
|
that.layerIndex = null;
|
|
that.layerIndex = that.layuiLayer.open({
|
title: '警情详情',
|
type: 2,
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['860px', '406px'],
|
offset: 'auto',
|
skin: 'realtime-police-details',
|
content: url,
|
closeBtn: 1,
|
resize: false
|
});
|
})
|
},
|
|
// 设备历史查看
|
realTimeHistorySee: function (deviceNumber) {
|
var url = './popup/html/realtime-equipment-history.html?deviceNumber=' + deviceNumber;
|
|
layui.use('layer', function () {
|
var layer = layui.layer;
|
|
layer.closeAll();
|
|
layer.config({
|
extend: 'myskin/realtime-equipment-history.css'
|
});
|
|
layer.open({
|
title: '设备历史警情',
|
type: 2,
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['820px', '460px'],
|
offset: 'auto',
|
skin: 'realtime-equipment-history',
|
content: url,
|
closeBtn: 1,
|
resize: false
|
});
|
})
|
},
|
|
// 视频查看
|
realTimeVideoSee: function (channelNumber, serialNumber) {
|
|
var url = './popup/html/realtime-view-video.html?channelNumber=' + channelNumber + '&serialNumber=' + serialNumber;
|
|
layui.use('layer', function () {
|
|
var layer = layui.layer;
|
|
layer.closeAll();
|
|
layer.config({
|
extend: 'myskin/realtime-view-video.css'
|
});
|
|
layer.open({
|
title: '视屏查看',
|
type: 2,
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['820px', '460px'],
|
offset: 'auto',
|
skin: 'realtime-view-video',
|
content: url,
|
closeBtn: 1,
|
resize: false
|
});
|
})
|
|
},
|
|
// 定位
|
viewsGoTo: function (jd, wd) {
|
|
var lgtd = Number(jd);
|
var lttd = Number(wd);
|
|
var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
|
this._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
|
},
|
|
// 视频播放
|
realStartVideo: function (dom, url) {
|
|
if ($(dom).attr('src') != '') dom.pause();
|
|
if (window.parent.Hls.isSupported()) {
|
dom.volume = 1.0;
|
var hls = new window.parent.Hls();
|
var m3u8Url = decodeURIComponent(url)
|
hls.loadSource(m3u8Url);
|
hls.attachMedia(dom);
|
hls.on(window.parent.Hls.Events.MANIFEST_PARSED, function () {
|
dom.play();
|
});
|
}
|
},
|
|
// 获取视频播放地址
|
getStartVideoSite: function (dom, channelNumber, serialNumber) {
|
var that = this;
|
$.ajax({
|
type: 'GET',
|
dataType: 'JSON',
|
url: "https://web.byisf.com:18000/GetPlayUrl?deviceCode=" + serialNumber + "&chl=" + channelNumber,
|
success: function (data) {
|
|
that.realStartVideo(dom, data.data.m3u8)
|
|
}
|
})
|
},
|
|
// 定时器,定时发送请求,监听是否有新的报警
|
layerRealtime: function () {
|
var that = this;
|
that.realTimeQuery = setInterval(function () {
|
if (that.historyPoliceId != null) {
|
$.ajax({
|
url: 'http://61.131.136.25:2082/api/alarm/alarm/selecttx',
|
type: 'POST',
|
dataType: 'JSON',
|
data: {
|
id: that.historyPoliceId
|
},
|
success: function (data) {
|
if (data.data.length > 0) {
|
layui.use('layer', function () {
|
layui.layer.closeAll();
|
})
|
// 清除页面中的其他弹框
|
if (that.layuiLayer != null) {
|
that.layuiLayer.closeAll();
|
|
that.layerIndex = null;
|
|
}
|
// 清除定时器
|
window.clearTimeout(that.realTimeQuery);
|
// 清除ul中内容(存储新增的报警信息)
|
$('.real-time-police .layer-realtime-police ul').empty();
|
// 新增警情的面板
|
|
// 检测audio标签父元素的类名
|
if (!$('.real-time-police .layer-realtime-police .audio').hasClass('open')) {
|
$('.real-time-police .layer-realtime-police .audio').removeClass().addClass('audio open')
|
}
|
|
// 判断数据长度是否大于1,如果是,则显示上下页切换
|
if (data.data.length > 1) {
|
$('.real-time-police .layer-realtime-police .bottom-tab').stop().show();
|
}
|
// audio标签播放
|
$('.real-time-police .layer-realtime-police .audio audio')[0].play();
|
// 获取警情列表的dom用来更行警情列表
|
// 保存返回的数据,方便操作
|
var result = data.data;
|
var str = '';
|
// 记录最新的一个id
|
that.historyPoliceId = result[result.length - 1].id;
|
|
var addvnmList = $('.real-time-police .real-time-select-condition .realtime-district .select-list ul li');
|
for (var time, t, e, y, h, gt, i = 0; i < result.length; i++) {
|
|
var li = $("<li channelNumber='" + result[i].channelNumber + "' serialNumber='" + result[i].serialNumber + "'></li>");
|
var table = $('<table></table>');
|
var tbody = $('<tbody></tbody>');
|
|
result[i].x = Number(result[i].jd);
|
result[i].y = Number(result[i].wd);
|
|
that.historyPoliceData.unshift(result[i]);
|
// that.createEntitys(that.realTimeAddEntitys, that.entitysData, '实时报警', {
|
// lgtd: result[i].jd,
|
// lttd: result[i].wd,
|
// id: result[i].id,
|
// deviceNumber: result[i].deviceNumber
|
// }, result[i].jd, result[i].wd, '/images/real-time-callPolice.png');
|
|
t = result[i].alarmTime.substr(0, 10);
|
e = result[i].alarmTime.substr(11);
|
time = t + ' ' + e;
|
y = result[i].alarmTime.substr(0, 10);
|
h = result[i].alarmTime.substr(11);
|
gt = y + ' ' + h;
|
|
|
str += "<tr> <td>报警人:</td> <td>" + result[i].galarmPeople + "</td> <td>性别:</td> <td>" + (result[i].sex == 1 ? '女' : '男') + "</td> </tr>";
|
str += "<tr> <td>联系电话:</td> <td>" + result[i].phoneNumber + "</td> <td>事发地址:</td> <td>" + result[i].place + "</td> </tr>";
|
str += "<tr> <td>警情类别:</td> <td>" + result[i].waringType + "</td> <td>设备编号:</td> <td>" + result[i].deviceNumber + "</td> </tr>";
|
str += "<tr> <td>接警人:</td> <td>" + result[i].alarmPeople + "</td> <td>接警时间:</td> <td>" + result[i].jjTime + "</td> </tr>";
|
str += "<tr> <td>报警时间:</td> <td>" + time + "</td> <td>行政区:</td> <td>" + result[i].addvnm + "</td> </tr>";
|
str += "<tr> <td>要求处置时间:</td> <td> <input autocomplete='off' type='input' placeholder='选取处置时间' id='parent_required_disposal_time" + i + "'> </td> <td>备注:</td> <td> <textarea name='' id='the_disposal_of_note' placeholder='请填写处置备注'></textarea> </td> </tr>";
|
str += "<tr> <td>报警内容:</td> <td>" + result[i].content + "</td> </tr>";
|
str += "<tr> <td>功能:</td> <td> <button class='a-key-to-call' type='button'>一键呼叫</button> <button class='parent_video-intercom' type='button'>视频对讲</button> <button class='generate' type='button' value='生成警单'>生成警单</button> <button class='revoke' type='button' value='撤销警情'>警情撤销</button> <button class='push-number-one' type='button'>推送110</button> </td> </tr>";
|
|
|
li.append(table.append(tbody.append(str)));
|
|
for (key in result[i]) {
|
var str = 'data-' + key;
|
li.find('.generate').attr(str, result[i][key]);
|
li.find('.revoke').attr(str, result[i][key])
|
|
}
|
|
$('.real-time-police .layer-realtime-police ul').append(li);
|
if (i == 0) {
|
li.addClass('on');
|
}
|
|
if (addvnmList.length > 0) {
|
for (var j = 0; j < addvnmList.length; j++) {
|
if (result[i].addvnm != $(addvnmList[j]).text()) {
|
if (j == addvnmList.length - 1) {
|
$('.real-time-police .realtime-container .realtime-district .select-list ul').append("<li addvcd=" + result[i].addvcd + ">" + result[i].addvnm + "</li>");
|
}
|
}
|
}
|
} else {
|
$('.real-time-police .realtime-container .realtime-district .select-list ul').append("<li addvcd=" + result[i].addvcd + ">" + result[i].addvnm + "</li>");
|
}
|
|
str = '';
|
|
layui.use('laydate', function () {
|
var laydate = layui.laydate;
|
laydate.render({
|
elem: ('#parent_required_disposal_time' + i),
|
type: 'datetime',
|
position: 'fixed',
|
trigger: 'click', //采用click弹出
|
theme: '#3278F0',
|
min: that.minDate()
|
});
|
})
|
|
}
|
|
if (that.clusterLayer != null) {
|
that.clearLayer();
|
}
|
that.flareClusterLayer(result);
|
|
that.getStartVideoSite($('.real-time-police .layer-realtime-police-parent video')[0], result[0].channelNumber, result[0].serialNumber);
|
|
$('.real-time-police .layer-realtime-police-parent').stop().show();
|
|
}
|
|
}
|
})
|
}
|
|
}, 5000)
|
},
|
|
//热力图渲染器,加载热力图
|
heatmFeaLayers: function () {
|
|
var layerDefinition = {
|
"geometryType": "esriGeometryPoint",
|
"fields": [{
|
"num": "num",
|
editable: true,
|
nullable: true,
|
"type": "esriFieldTypeInteger",
|
"alias": "数量"
|
}]
|
};
|
var featureCollection = {
|
layerDefinition: layerDefinition,
|
featureSet: null
|
};
|
//创建 FeatureLayer 图层
|
var featureLayer = new esri.layers.FeatureLayer(featureCollection, {
|
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
|
outFields: ["*"],
|
opacity: .8
|
});
|
//设置渲染方式
|
|
return featureLayer;
|
},
|
|
// 获取当前时间,以及昨天现在的时间
|
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 + ':00',
|
currentEight: currentY + '-' + currentM + '-' + currentD + ' 00:00:00',
|
tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd + ':00',
|
month: currentM + currentD
|
};
|
},
|
|
// 获取本周的时间
|
getThisWeekTime: function () {
|
// 当前时间
|
var timestamp = Date.parse(new Date());
|
var serverDate = new Date(timestamp);
|
|
// 本周周一的时间
|
var mondayTime = timestamp - ((serverDate.getDay() - 1) * 24 * 60 * 60 * 1000)
|
var mondayData = new Date(mondayTime);
|
//年
|
var mondayY = mondayData.getFullYear();
|
//月
|
var mondayM = (mondayData.getMonth() + 1 < 10 ? '0' + (mondayData.getMonth() + 1) : mondayData.getMonth() + 1);
|
//日
|
var mondayD = mondayData.getDate() < 10 ? '0' + mondayData.getDate() : mondayData.getDate();
|
// 当前时间
|
var currentData = new Date(timestamp);
|
//年
|
var currentY = currentData.getFullYear();
|
//月
|
var currentM = (currentData.getMonth() + 1 < 10 ? '0' + (currentData.getMonth() + 1) : currentData.getMonth() + 1);
|
//日
|
var currentD = currentData.getDate() < 10 ? '0' + currentData.getDate() : currentData.getDate();
|
//时
|
var currenH = currentData.getHours() < 10 ? '0' + currentData.getHours() : currentData.getHours();
|
//分
|
var currenM = currentData.getMinutes() < 10 ? '0' + currentData.getMinutes() : currentData.getMinutes();
|
|
return {
|
week: {
|
beginTime: mondayY + '-' + mondayM + '-' + mondayD + ' 00:00:00',
|
endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00',
|
},
|
month: {
|
beginTime: mondayY + '-' + mondayM + '-01 00:00:00',
|
endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00',
|
},
|
year: {
|
beginTime: mondayY + '-01-01 00:00:00',
|
endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00',
|
}
|
}
|
|
},
|
|
// 获取警情信息列表
|
getRealTimePoliceTable: function (addvcd, waringType, beginTime, endTime) {
|
var that = this;
|
|
that.updateRealTable.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
jtype: '',
|
addvcd: addvcd,
|
waringType: waringType,
|
beginTime: beginTime,
|
endTime: endTime
|
}
|
, page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
|
|
},
|
|
// 创建实体图层
|
createEntitys: function (entitys, entityContent, name, item, lgtd, lttd, outlineColors) {
|
|
var symbol = new esri.symbol.PictureMarkerSymbol(outlineColors, 16, 16);
|
symbol.name = name;
|
var pt = new Point(lgtd, lttd, new SpatialReference({ wkid: 4326 }));
|
pt.entityData = item;
|
var graphic = new esri.Graphic(pt, symbol);
|
entitys.add(graphic);
|
|
entityContent.push(item);
|
},
|
|
clearPoliceDetail: function (id) {
|
var that = this;
|
|
layui.use('layer', function () {
|
|
var layer = layui.layer;
|
|
layer.confirm('确定撤销该警情?', { icon: 3, title: '提示' }, function (index) {
|
|
$.ajax({
|
url: 'http://61.131.136.25:2082/api/alarm/alarm/deletejj',
|
type: 'POST',
|
data: {
|
id: id
|
},
|
success: function (data) {
|
|
|
if (data.code == 200) {
|
layer.msg("警情撤销成功", {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
|
$('.real-time-police .layer-realtime-police-parent').stop().hide();
|
$('.real-time-police .layer-realtime-police .audio audio')[0].pause();
|
|
that.getRealTimePoliceTable(that.realTimeAddvcd, that.realTimeWringType, that.realBeginTime, that.realEndTime)
|
});
|
}
|
|
}
|
})
|
|
});
|
})
|
|
},
|
|
//聚合图层事件
|
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/real-time-callPolice.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;
|
},
|
|
updateJType: function (id, czTime, bz, jjTime) {
|
$.ajax({
|
url: 'http://61.131.136.25:2082/api/alarm/alarm/updateJtype',
|
type: 'POST',
|
data: {
|
id: id,
|
czTime: czTime,
|
jjTime: jjTime,
|
bz: bz
|
|
},
|
success: function (data) {
|
|
if (data.code == 200) {
|
}
|
|
}
|
})
|
},
|
|
minDate: function () {
|
var now = new Date();
|
return now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
|
}
|
});
|
return Widget;
|
});
|