//设置最早时间-早于这个时间之前数据库内无数据,查询会报错
var initDate = new Date("2017/11/01 00:00:00");
//停车时长区间
var parkDuration = [[0,365*24*60*60],[0,10],[10,30],[30,60],[60,3*60],[3*60,5*60],[5*60,30*60],[30*60,60*60],
[60*60,2*60*60],[2*60*60,5*60*60],[5*60*60,10*60*60],[10*60*60,365*24*60*60]];
var secondAreas = ["所有时长","0-10s","10-30s","30s-1min","1-3min","3-5min", "5-30min","30min-1h","1-2h", "2-5h","5-10h","10h 以上"];
//停车周转次数
var parkTurnOver = ['所有次数','0次','1次','2-5次','5-10次','10-20次','20-50次','50次以上'];
var turnOverTimes = [[null,null],[0,0],[1,1],[2,5],[5,10],[10,20],[20,50],[50,2147483647]];
//定义泊位区间缓存区
var berthRangeCache = {};
//导出功能
window.downloadFile = function (sUrl) {
//iOS devices do not support downloading. We have to inform user about this.
if (/(iP)/g.test(navigator.userAgent)) {
alert('Your device does not support files downloading. Please try again in desktop browser.');
return false;
}
//If in Chrome or Safari - download via virtual link click
if (window.downloadFile.isChrome || window.downloadFile.isSafari) {
//Creating new link node.
var link = document.createElement('a');
link.href = sUrl;
if (link.download !== undefined) {
//Set HTML5 download attribute. This will prevent file from opening if supported.
var fileName = sUrl.substring(sUrl.lastIndexOf('/') + 1, sUrl.length);
link.download = fileName;
}
//Dispatching click event.
if (document.createEvent) {
var e = document.createEvent('MouseEvents');
e.initEvent('click', true, true);
link.dispatchEvent(e);
return true;
}
}
// Force file download (whether supported by server).
if (sUrl.indexOf('?') === -1) {
sUrl += '?download';
}
window.open(sUrl, '_self');
return true;
}
window.downloadFile.isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
window.downloadFile.isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
$("#queryBtn").click(function () {
if(!validDateForDuration()){
return;
}
funinit.queryGeoDurationDatas();
funinit.queryGeoDurationDetailDatas();
});
var funinit = {
init:function () {
//初始化块下拉框
funinit.initParkBlock(-1);
//块下拉框变化,停车场下拉框变化
funinit.queryBlockChange();
//初始化状态
$('#inType').selectpicker('refresh');
//日历插件 停车时长
$('#daterange-btn input').val(moment().subtract('days', 1).format('YYYY-MM-DD') + ' - ' + moment().subtract('days',1).format('YYYY-MM-DD'));
$('#daterange-btn').daterangepicker({
startDate: moment().subtract('days', 1),
endDate: moment().subtract('days', 1),
opens: 'right', //日期选择框的弹出位置
dateLimit : {
days : 30
}, //起止时间的最大间隔
locale: {
applyLabel: '确定',
cancelLabel: '取消',
customRangeLabel: '自定义',
daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月'
],
},
ranges: {
'昨天': [moment().subtract('days', 1), moment().subtract('days', 1)],
'最近一周': [moment().subtract('days', 7), moment().subtract('days', 1)],
'最近一个月': [moment().subtract('months', 1), moment().subtract('days', 1)],
},
maxDate: moment().subtract('days',1), //最大时间
},
function(start, end) {
$('#daterange-btn input').val(start.format('YYYY-MM-DD ') + ' - ' + end.format('YYYY-MM-DD '));
//alert(start.format('YYYYMMDD') + " " + end.format('YYYYMMDD'));
}
);
},
//查询并过滤没有地磁的办事处
getParkBlockFilter:function(datas){
var data = [];
var blockIdsFilter = [];
var blockIds = [];
$.each(datas, function(index,item) {
blockIds.push(item.code);
});
var req = {
sysCode:sysComm.sysCode,
areaBlockIds:blockIds
};
var opt = {
async: false,
data: JSON.stringify(req),
method: "POST",
url: dataUrl.util.getBlockIdListByBlockIds(),
success: function (res) {
if (res.code == '8888') {
blockIdsFilter = res.data;
$.each(datas, function(index,item) {
$.each(blockIdsFilter, function(_index,_item) {
if(item.code == _item){
data.push(item);
}
});
});
}
}
}
sysAjax(opt);
return data;
},
//停车区域-块 flag:-1加载所有的,0-加载第一个 1-加载第二个 2-加载第三个
initParkBlock: function (flag) {
var datas = fn.getParkBlock();
var data = funinit.getParkBlockFilter(datas);
var html = '';
var htmls = '';
var blockIds = [-1];
for (var i = 0; i < data.length; i++) {
blockIds.push(data[i].code);
html += "";
}
var blockIdsStr = JSON.stringify(blockIds);
htmls = '' + html;
if(flag == -1){
$("#plAreaBlockIds").empty();
$("#plAreaBlockIds1").empty();
$("#plAreaBlockIds2").empty();
$("#plAreaBlockIds").append(htmls);
$('#plAreaBlockIds').selectpicker('render');
//加载周转次数页面的街道办事处
//右上角
$("#plAreaBlockIds1").append(htmls);
$('#plAreaBlockIds1').selectpicker('render');
//单个停车场的街道办事处
//$("#plAreaBlockIds2").append(''+html);
$("#plAreaBlockIds2").append(htmls);
$('#plAreaBlockIds2').selectpicker('render');
//加载下拉框
funinit.initParkSelect(-1);
}
else if(flag == 0){
$("#plAreaBlockIds").empty();
$("#plAreaBlockIds").append(htmls);
$('#plAreaBlockIds').selectpicker('render');
funinit.initParkSelect(0);
}
else if(flag == 1){
$("#plAreaBlockIds1").empty();
$("#plAreaBlockIds1").append(htmls);
$('#plAreaBlockIds1').selectpicker('render');
funinit.initParkSelect(1);
}
else if(flag == 2){
$("#plAreaBlockIds2").empty();
$("#plAreaBlockIds2").append(''+html);
$('#plAreaBlockIds2').selectpicker('render');
funinit.initParkSelect(2);
}
else{
return;
}
},
//根据块信息查询停车场信息
initParkSelect:function(flag){
//停车场下拉框
var data = funinit.getParkingLotMsg(flag);
var htmls = '';
var html = '';
var plNos = [];
for (var i = 0; i < data.length; i++) {
plNos.push(data[i].plNo);
html += "";
}
var plnosStr = JSON.stringify(plNos);
htmls = '' + html;
if(flag == -1){
$("#parkIds").empty();
$("#parkIds").append(htmls);
$('#parkIds').selectpicker('render');
$("#parkIds1").empty();
$("#parkIds1").append(htmls);
$('#parkIds1').selectpicker('render');
$("#parkIds2").empty();
$("#parkIds2").append(htmls);
$('#parkIds2').selectpicker('render');
$("#parkIds3").empty();
$("#parkIds3").append(htmls);
$('#parkIds3').selectpicker('render');
}
else if (flag ==0){
$("#parkIds").empty();
$("#parkIds").append(htmls);
$('#parkIds').selectpicker('refresh');
$("#parkIds3").empty();
$("#parkIds3").append(htmls);
$('#parkIds3').selectpicker('refresh');
}
else if (flag ==1){
$("#parkIds1").empty();
$("#parkIds1").append(htmls);
$('#parkIds1').selectpicker('refresh');
}
else if (flag ==2){
$("#parkIds2").empty();
//$("#parkIds2").append(""+html);
$("#parkIds2").append(htmls);
$('#parkIds2').selectpicker('refresh');
}
else{
return;
}
},
getParkingLotMsg:function(flag){
var plAreaBlockIds;
if(flag == -1){
plAreaBlockIds = JSON.parse($("#plAreaBlockIds").val());
}
else if(flag == 0){
plAreaBlockIds = JSON.parse($("#plAreaBlockIds").val());
}
else if(flag == 1){
plAreaBlockIds = JSON.parse($("#plAreaBlockIds1").val());
}
else if(flag == 2){
plAreaBlockIds = JSON.parse($("#plAreaBlockIds2").val());
}
else{
return;
}
var parkLot = "";
var req = {
sysCode:sysComm.sysCode,
areaBlockIds: plAreaBlockIds
};
var opt = {
async: false,
data:JSON.stringify(req),
method: "POST",
//contentType:"application/x-www-form-urlencoded; charset=UTF-8",
url: dataUrl.util.getParkListByBlockIds(),
success: function (res) {
if (res.code == '8888') {
parkLot = JSON.stringify(res.data);
}
}
}
sysAjax(opt);
return JSON.parse(parkLot);
},
//块改变查询停车场
queryBlockChange:function(){
/*$("#plAreaBlockIds").change(function(){
funinit.initParkSelect(-1);
});*/
$("#plAreaBlockIds").change(function(){
funinit.initParkSelect(0);
});
$("#plAreaBlockIds1").change(function(){
funinit.initParkSelect(1);
//重新加载地磁厂商统计图
factoryTurnOverAjax();
});
$("#plAreaBlockIds2").change(function(){
funinit.initParkSelect(2);
});
},
//详细-停车场下拉框初始化
initParkIdsSelect:function(){
var plno = $("#parkIds").val();
$("#parkIds3").selectpicker('val',plno);
},
//详细-分布区间初始化
initSecondArea:function(name){
var html;
$.each(secondAreas,function(index,item){
html+='';
});
$("#secondArea").empty();
$("#secondArea").append(html);
$("#secondArea").selectpicker('refresh');
if(name == null || name == undefined){
return;
}
$("#secondArea").selectpicker('val',secondAreas.indexOf(name));
},
//详细-选择时间初始化
initDurationDate:function(dates){
//日历插件 停车时长
$('#daterangeedit-btngeo input').val(moment().subtract('days', 0).format('YYYY-MM-DD') + ' - ' + moment().subtract('days',0).format('YYYY-MM-DD'));
$('#daterangeedit-btngeo').daterangepicker({
// startDate: moment().subtract('days', 1),
endDate: moment().subtract('days',0),
opens: 'left', //日期选择框的弹出位置
dateLimit : {
days : 30
}, //起止时间的最大间隔
locale: {
applyLabel: '确定',
cancelLabel: '取消',
customRangeLabel: '自定义',
daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月'
],
},
ranges: {
'昨天': [moment().subtract('days', 1), moment().subtract('days', 1)],
'最近一周': [moment().subtract('days', 7), moment().subtract('days', 1)],
'最近一个月': [moment().subtract('months', 1), moment().subtract('days', 1)],
'最近三个月': [moment().subtract('months', 3), moment().subtract('days', 1)],
},
maxDate: moment().subtract('days', 0), //最大时间
},
function(start, end) {
$('#daterangeedit-btngeo input').val(start.format('YYYY-MM-DD ') + ' - ' + end.format('YYYY-MM-DD '));
}
);
$('#daterangeedit-btngeo input').val(dates);
},
getQueryParams:function(){
var plBlockIds = JSON.parse($("#plAreaBlockIds").val());
var plNos = JSON.parse($("#parkIds").val());
if(plNos.length<1){
plNos.push("-1X");
}
var inType = $("#inType").val();
var dateValue = $("#daterange-btn input").val();
var dates=dateValue.split(" - ");
var beginTime = dates[0]+" 00:00:00";
var endTime = dates[1]+" 23:59:59";
var req= {
sysCode:sysComm.sysCode,
plBlockIds: plBlockIds,
plNos: plNos,
inType: inType,
beginTime: new Date(beginTime.replace(new RegExp(/-/gm) ,"/")),
endTime: new Date(endTime.replace(new RegExp(/-/gm) ,"/")),
};
return req;
},
getDetailQueryParams:function(){
var plNos = JSON.parse($("#parkIds3").val());
if(plNos.length<1){
plNos.push("-1X");
}
var secondArea = $("#secondArea").val();
var inType = $("#inType").val();
var eqpStayBegin = parkDuration[secondArea][0];
var eqpStayEnd = parkDuration[secondArea][1];
var dateValue = $("#daterangeedit-btngeo input").val();
var dates=dateValue.split(" - ");
var beginTime = dates[0]+" 00:00:00";
var endTime = dates[1]+" 23:59:59";
var req= {
sysCode:sysComm.sysCode,
plNos: plNos,
inType: inType,
eqpStayBegin: eqpStayBegin,
eqpStayEnd: eqpStayEnd,
beginTime: new Date(beginTime.replace(new RegExp(/-/gm) ,"/")),
endTime: new Date(endTime.replace(new RegExp(/-/gm) ,"/")),
};
return req;
},
//查询地磁停车时长数据
queryGeoDurationDatas:function(){
var req = funinit.getQueryParams();
var opt= {
method: 'POST',
url: dataUrl.util.queryEqpInOutPark(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType:'json',
success: function(res){
console.log("图01 02:",res);
if(res.code = "8888"){
var data = res.data;
funinit.drawGeoDurationCharts(data);
}else{
}
}
};
sysAjax(opt);
},
//查询地磁平均停车时长数据
queryGeoDurationDetailDatas:function(){
var req = funinit.getQueryParams();
var opt= {
method: 'POST',
url: dataUrl.util.queryEqpDurByTime(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType:'json',
success: function(res){
console.log("图03:",res);
if(res.code = "8888"){
var data = res.data;
funinit.drawDurationDetailChart(data);
}else{
}
}
};
sysAjax(opt);
},
//填充两个停车时长扇形图
drawGeoDurationCharts:function(data){
var normalDatas = [{value:0, name:'5-30min'},{value:0, name:'30min-1h'},{value:0, name:'1-2h'},
{value:0, name:'2-5h'},{value:0, name:'5-10h'},{value:0, name:'10h 以上'}];
var nonormalDatas = [{value:0, name:'0-10s'},{value:0, name:'10-30s'},{value:0, name:'30s-1min'},
{value:0, name:'1-3min'},{value:0, name:'3-5min'}];
normalDatas[0].value=data.normalNum1;
normalDatas[1].value=data.normalNum2;
normalDatas[2].value=data.normalNum3;
normalDatas[3].value=data.normalNum4;
normalDatas[4].value=data.normalNum5;
normalDatas[5].value=data.normalNum6;
nonormalDatas[0].value=data.nuNum1;
nonormalDatas[1].value=data.nuNum2;
nonormalDatas[2].value=data.nuNum3;
nonormalDatas[3].value=data.nuNum4;
nonormalDatas[4].value=data.nuNum5;
// 地磁正常
var nomalmainoption = {
color:['#1e95cd','#5fe98f','#fdc94d','#50c0f5','#5ed8a6','#2bb97f','#50c0f5','#fd714b','#a5dff3'],
tooltip: {
trigger: 'item',
formatter: "{a}
{b}: {c} ({d}%)"
},
legend: {
orient: 'vertical',
right:'15%',
top:'10%',
selectedMode:false,
hoverAnimation: false,
avoidLabelOverlap: false,
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize:'12px',
fontFamily:'微软雅黑'
},
itemWidth:16,
itemHeight:10,
data:['5-30min','30min-1h','1-2h','2-5h','5-10h','10h 以上']
},
series: [
{
name:'地磁正常',
type:'pie',
radius: ['60%', '70%'],
center:['30%', '50%'],
avoidLabelOverlap: false,
hoverAnimation: false,
legendHoverLink: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: false,
textStyle: {
fontSize: '12',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data:normalDatas
}
]
};
nomalmain.setOption(nomalmainoption,true);
// nomalmain.dispatchAction({
// type: 'downplay',
// seriesIndex: 0,
// dataIndex: 0
// });
// nomalmain.dispatchAction({
// type: 'highlight',
// seriesIndex: 0,
// dataIndex: 0
// });
// nomalmain.resize();
// 地磁异常
var anomalmainoption = {
color:['#1e95cd','#5fe98f','#fdc94d','#50c0f5','#5ed8a6','#2bb97f','#50c0f5','#fd714b','#a5dff3'],
tooltip: {
trigger: 'item',
formatter: "{a}
{b}: {c} ({d}%)"
},
legend: {
orient: 'vertical',
right:'15%',
top:'10%',
selectedMode:false,
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize:'12px',
fontFamily:'微软雅黑'
},
itemWidth:16,
itemHeight:10,
data:['0-10s','10-30s','30s-1min','1-3min','3-5min',]
},
series: [
{
name:'地磁异常',
type:'pie',
// radius: ['50%', '70%'],
center:['30%', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: false,
textStyle: {
fontSize: '20',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data:nonormalDatas
}
]
};
anomalmain.setOption(anomalmainoption);
// anomalmain.dispatchAction({
// type: 'downplay',
// seriesIndex: 0,
// dataIndex: 0
// });
// anomalmain.dispatchAction({
// type: 'highlight',
// seriesIndex: 0,
// dataIndex: 0
// });
// anomalmain.resize();
},
//渲染平均停车时长趋势图
drawDurationDetailChart:function(data){
//data = [{avgTime:1111,queryDate:"2017-11-22",tatolNum:3456,tatolTime:365},{avgTime:111,queryDate:"2017-11-23",tatolNum:345,tatolTime:36},{avgTime:580,queryDate:"2017-11-24",tatolNum:500,tatolTime:79}];
var dates = new Array();
var avgTimes = new Array();
if(data != null && data.length>0){
$.each(data, function(index,item) {
dates.push(item.queryDate);
avgTimes.push(((item.avgTime)/(60*60)).toFixed(1));//秒->小时
});
}
console.log(dates)
var MeantimeEchartsoption = {
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '1%',
right: '4%',
bottom: '3%',
top:'14%',
containLabel: true
},
xAxis : [
{
type : 'category',
data : dates,
axisLabel: {
// interval:2,
show: true,
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize:'12px',
fontFamily:'微软雅黑'
}
},
// splitNumber:10,
// minInterval:2,
axisTick: {
show: false,
},
splitLine:{
lineStyle:{
color:'rgba(0,0,0,0.1)',
}
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(0,0,0,0.1)',
// width: 1,//这里是为了突出显示加上的
}
},
}
],
yAxis : [
{
type : 'value',
// name:"(小时)",
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize:'12px',
fontFamily:'微软雅黑'
},
axisLabel: {
show: true,
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize:'12px',
fontFamily:'微软雅黑'
}
},
axisTick: {
show: false,
},
splitLine:{
lineStyle:{
color:'rgba(0,0,0,0.1)',
}
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(0,0,0,0.1)',
// width: 1,//这里是为了突出显示加上的
}
},
}
],
series : [
{
name:'平均停车时长',
type:'bar',
barWidth : 20,
data:avgTimes,
itemStyle: {
normal: {
color:'#5cb3d8',
/* color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#2abb9b'},
{offset: 1, color: '#57cbf6'}
]
)*/
},
emphasis: {
color:'#5cb3d8',
/*color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#2abb9b'},
{offset: 1, color: '#57cbf6'}
]
)*/
}
},
markLine: {
symbolSize:0,
lineStyle:{
normal:{
color:'#5fe890'
}
},
data: [
{type: 'average', name: '平均值',},
]
}
}
]
};
MeantimeEcharts.setOption(MeantimeEchartsoption,true);
MeantimeEcharts.resize();
},
//加载停车时长详细表信息
createDurationTableData: function() {
$('#turnoveroentabgeo').bootstrapTable('destroy').bootstrapTable({
striped: true, //表格显示条纹
pagination: true, //启动分页
pageNumber: 1, //当前第几页
// showColumns: true,
pageSize: 10, //每页显示的记录数
pageList: [10, 15, 20], //记录数可选列表
sidePagination: 'server', //表示服务端分页
queryParamsType: 'limit',
method: 'POST', //请求方法
// fixedColumns:true,
// fixedNumber:1,
// leftFixedColumns: true,
// leftFixedNumber: 2,
// selectItemName: 'personCustName',
paginationPreText: '<',
paginationNextText: '>',
ajax: loadDurationDetailRequest, //自定义ajax加载数据
uniqueId: 'id',
columns: [
{
field: 'plAreaBlockName',
title: '街道办事处',
width: '10%',
visible: true,
align: 'left'
},
{
field: 'plName',
title: '车场名称',
width: '10%',
align: 'left'
},
{
field: 'parkAreaName',
title: '泊位区间',
width: '10%',
align: 'left',
},
{
field: 'berthNo',
title: '泊位编号',
width: '8%',
align: 'left',
},
{
field: 'eqpNo',
title: '地磁编号',
width: '8%',
align: 'left',
},
{
field: 'eqpInTime',
title: '进场时间',
width: '10%',
align: 'left',
formatter:funinit.dateTimeFormatter
},
{
field: 'eqpOutTime',
title: '出场时间',
width: '10%',
align: 'left',
formatter:funinit.dateTimeFormatter
},
{
field: 'eqpParkingDuration',
title: '停车时长',
width: '10%',
align: 'left',
formatter:funinit.timeFormatter
},
{
field: 'pdaInType',
title: 'PDA是否录入',
width: '8%',
align: 'left',
formatter:funinit.pdaInTipeFormatter
},
{
field: 'inChargerCode',
title: '入场收费员编号',
width: '8%',
align: 'left'
},
{
field: 'inType',
title: '入场录入状态',
width: '8%',
align: 'left',
formatter:funinit.inTipeFormatter
},
{
field: 'outChargerCode',
title: '出场收费员编号',
width: '8%',
align: 'left'
},
{
field: 'outType',
title: '出场录入状态',
width: '8%',
align: 'left',
formatter:funinit.inTipeFormatter
},
]
});
$("#geopopmodel").modal('show');
},
timeFormatter:function(value) {
var theTime = parseInt(value);// 秒
var theTime1 = 0;// 分
var theTime2 = 0;// 小时
var theTime3 = 0;//天
if(theTime<60){
return theTime+'秒';
}
if (theTime >= 60) {
theTime1 = parseInt(theTime / 60);
theTime = parseInt(theTime % 60);
if (theTime1 >= 60) {
theTime2 = parseInt(theTime1 / 60);
theTime1 = parseInt(theTime1 % 60);
if(theTime2 >= 24){
theTime3 = parseInt(theTime2/24);
theTime2 = parseInt(theTime2%24);
}
}
}
var result = '';
if (theTime1 > 0) {
result = "" + parseInt(theTime1) + "分钟" + result;
}
if (theTime2 > 0) {
result = "" + parseInt(theTime2) + "小时" + result;
}
if (theTime3 > 0) {
result = "" + parseInt(theTime3) + "天" + result;
}
return result;
},
dateTimeFormatter: function(value, row, index) {
if(value == null) {
return "";
} else {
return DateUtils.long2String(value, 7);
}
},
inTipeFormatter:function(value){
if(value==null){
return "";
}
else if(value == "0"){
return "不一致";
}
else if(value == "1"){
return "一致";
}
else{
return "未知";
}
},
pdaInTipeFormatter:function(value){
if(value==null){
return "";
}
else if(value == "0"){
return "否";
}
else if(value == "1"){
return "是";
}
else{
return "未知";
}
}
};
funinit.init();
//绑定下拉框的change事件
documentBindFunc.on('change', '#plAreaBlockIds1', function () {
funinit.initParkSelect(1);
//重新加载地磁厂商统计图
factoryTurnOverAjax();
});
/**
* 自定义table AJAX请求
* @param {Object} params
*/
function loadDurationDetailRequest(params) {
var req = funinit.getDetailQueryParams();
//设置请求参数
var pageNum = (params.data.offset / params.data.limit) + 1;
//条件查询
req.baseRequest = {
pageNum: pageNum,
pageSize: params.data.limit
};
req.sysCode = sysComm.sysCode;
var opt = {
method: 'post',
url: dataUrl.util.queryEqpInOutParkForList(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function(res) {
console.log("图04:",res);
if(res.code == '8888') {
params.success(res.data);
}
else{
}
}
};
sysAjax(opt);
}
function durationsClickFun(param){
console.log(param)
//初始化弹窗表格查询条件
funinit.initParkIdsSelect();
var name = "所有时长";//param.data.name;
funinit.initSecondArea(name);
var dates = $("#daterange-btn input").val();
funinit.initDurationDate(dates);
funinit.createDurationTableData();
}
// 地磁正常 弹窗
documentBindFunc.on('click','#geopopnormalBtn',function () {
if(!validDateForDuration()){
return;
}
durationsClickFun();
})
var nomalmain = echarts.init(document.getElementById('nomalmain'));
/*nomalmain.on('click',function(param){
if(!validDateForDuration()){
return;
}
durationsClickFun(param);
});*/
//地磁异常 弹窗
documentBindFunc.on('click','#geopopabnormalBtn',function () {
if(!validDateForDuration()){
return;
}
durationsClickFun();
})
var anomalmain = echarts.init(document.getElementById('anomalmain'));
/*anomalmain.on('click',function(param){
if(!validDateForDuration()){
return;
}
durationsClickFun(param);
});*/
documentBindFunc.on('click', '#queryBtngeo', function() {
var dateValue = $("#daterangeedit-btngeo input").val();
var dates=dateValue.split(" - ");
var beginTime = dates[0]+" 00:00:00";
beginTime = new Date(beginTime.replace(new RegExp(/-/gm) ,"/"));
if(beginTime