' +
+ '
'
+ }else{
+ guideHtml+='
' +
+ '
'
+ }
+
+
+ var configs = data.configs;
+ if (configs) {
+ $.each(configs, function (index, item) {
+ //空余车位数
+ var freeNum = item.freeNum == undefined || item.freeNum == null ? 0 : item.freeNum;
+ var allBerthNum = item.allBerthNum == undefined || item.allBerthNum == null ? 1 : item.allBerthNum;
+ var rate = freeNum / allBerthNum * 100;
+ var classStyle;
+
+ if (rate < 1) {
+ //车位已满
+ classStyle = 'num-full';
+ } else if (rate <= 30) {
+ //车位不多
+ classStyle = 'num-few';
+ } else {
+ //车位充足
+ classStyle = 'num-free';
+ }
+
+ guideHtml += '
' + freeNum + ''
+
+ })
+ }
+ // '
280' +
+ // '
80' +
+ // '
20' +
+
+ guideHtml += '
' +
+ '
' +
+ '
';
+
+ var myLabel1 = new BMap.Label(guideHtml, {
+ offset: new BMap.Size(60, -180), //label的偏移量,为了让label的中心显示在点上
+ position: point
+ });
+ myLabel1.setStyle({
+ color: "#F0F0F0",
+ fontSize: "12px",
+ //height: "220px",
+ // width: "350px",
+ padding: "5px",
+ whiteSpace: "normal",
+ //fontFamily: "微软雅黑",
+ zIndex: "1000",
+ backgroundColor: "rgba(0, 0, 0, 0)",
+ border: "0px"
+ });
+ map.addOverlay(myLabel1, point);
+ map.panTo(point);
+}
+//弹出二级诱导信息
+function alertSecondLevelGuideInfo(data, point) {
+ var guideInfos = data.guideInfos;
+ var guideHtml = '
';
+ if (null != guideInfos) {
+ $.each(guideInfos, function (index, item) {
+ guideHtml += '
' +
+ '
' + item.plName + '
' +
+ '
';
+ if (item.guidePoint == 1) {
+ guideHtml += '
'
+ } else if (item.guidePoint == 2) {
+ guideHtml += '
'
+ } else if (item.guidePoint == 3) {
+ guideHtml += '
'
+ } else if (item.guidePoint == 4) {
+ guideHtml += '
'
+ }
+ guideHtml += '
' +
+ '
' + item.freeNum + '
'
+ })
+ }
+ guideHtml += '
';
+ var myLabel2 = new BMap.Label(guideHtml, {
+ offset: new BMap.Size(60, -180), //label的偏移量,为了让label的中心显示在点上
+ position: point
+ });
+ myLabel2.setStyle({
+ color: "#F0F0F0",
+ fontSize: "12px",
+ //height: "220px",
+ // width: "350px",
+ padding: "5px",
+ whiteSpace: "normal",
+ //fontFamily: "微软雅黑",
+ zIndex: "1000",
+ backgroundColor: "rgba(0, 0, 0, 0)",
+ border: "0px"
+ });
+ map.addOverlay(myLabel2, point);
+ map.panTo(point);
+}
+//弹出三级诱导信息
+function alertThridLevelGuideInfo(data, point) {
+ //是否有限高提示
+ var highLimitStatus = data.highLimitStatus;
+ //是否有急转弯提示
+ var sharpTurnStatus = data.sharpTurnStatus;
+ //是否有楼层指示
+ var floorStatus = data.floorStatus;
+ //时间制式
+ var timeSystem = data.timeSystem + '';
+
+ var guideHtml = '
' +
+ '
' +
+ '
' +
+ '
' +
+ '' +
+ '' +
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '
' + (data.floor == null ? '--' : data.floor ) + '层
' +
+ '
' +
+ '
空闲
' +
+ '
' + (data.freeNum == null ? '0' : data.freeNum ) + '
' +
+ '
'
+ //判断是否有楼层限高
+ if (highLimitStatus == 1) {
+ guideHtml += '
' + data.highLimitNum + '
'
+ }
+ //判断时间营业时间,
+ if (null != timeSystem) {
+ if (timeSystem.length > 6) {
+ guideHtml += '
'
+ } else {
+ guideHtml += '
'
+ }
+ }
+
+ if (sharpTurnStatus == 1) {
+ guideHtml += '
'
+ }
+
+ guideHtml += '
'
+
+ var myLabel3 = new BMap.Label(guideHtml, {
+ offset: new BMap.Size(60, -180), //label的偏移量,为了让label的中心显示在点上
+ position: point
+ });
+ myLabel3.setStyle({
+ color: "#F0F0F0",
+ fontSize: "12px",
+ //height: "220px",
+ // width: "350px",
+ padding: "5px",
+ whiteSpace: "normal",
+ zIndex: "1000",
+ backgroundColor: "rgba(0, 0, 0, 0)",
+ border: "0px"
+ });
+ map.addOverlay(myLabel3, point);
+ map.panTo(point);
+}
+
+
+//当前行政区域划分
+function getBoundary(name) {
+ var bdary = new BMap.Boundary();
+ map.clearOverlays();
+ bdary.get(name, function (rs) {
+ var count = rs.boundaries.length; //行政区域的点有多少个
+ if (count === 0) {
+ alert('未能获取当前输入行政区域');
+ return;
+ }
+ var pointArray = [];
+ for (var i = 0; i < count; i++) {
+
+ var ply = new BMap.Polygon(rs.boundaries[i], {
+ strokeWeight: 2,
+ strokeColor: "#ee07db",
+ fillColor: '',
+ fillOpacity: 0
+ }); //建立多边形覆盖物
+ map.addOverlay(ply); //添加覆盖物
+ pointArray = pointArray.concat(ply.getPath());
+ }
+ map.setViewport(pointArray); //调整视野
+ // map.setMaxZoom(13);
+ });
+
+}
+
+// 获取位置
+function theLocation(x, y, guideNo) {
+ //map.clearOverlays();
+ var new_point = new BMap.Point(x, y);
+ map.panTo(new_point);
+ map.centerAndZoom(new_point, 15);
+ addInfoWindow(guideNo, null, x, y);
+
+}
+//点击左侧列表显示相应诱导icon
+$(document).on('click', '#list_con >li', function () {
+ var x = $(this).find('.coordinate_x').text();
+ var y = $(this).find('.coordinate_y').text();
+ var guideNo = $(this).find('.coordinate_guideNo').text();
+ theLocation(x, y, guideNo)
+});
+
+
+//关闭弹窗
+$(document).delegate(".pop-close", 'click', function () {
+ $(".pop-common").css("display", "none");
+})
+
+//获取地图上诱导屏的信息
+function getGuideMapInfo(cond) {
+
+ $.ajax({
+ type: "post",
+ url: dataUrl.util.listGuideScreenForMap(),
+ data: JSON.stringify(cond),
+ contentType: 'application/json; charset=utf-8',
+ dataType: "json",
+ success: function (data) {
+ if (data.code == '8888') {
+ guidanceMapInfo(data.data.dataList);
+ }
+ else {
+ alert("服务请求报错:code=" + data.code + "errMsg=" + data.msg + "-" + data.errMsg);
+ }
+ }
+ });
+}
+
+//将诱导屏位置数据放入List中
+function guidanceMapInfo(data) {
+
+ //map.clearOverlays();
+ guideData = [];
+ // console.log(data)
+ $.each(data, function (index, domEle) {
+ var freeBerthNum = domEle.freeBerthNum;
+ var berthNum = domEle.berthNum;
+ if (freeBerthNum == null) {
+ freeBerthNum = 0;
+ }
+ if (berthNum == null || berthNum == 0) {
+ freeBerthNum = 0;
+ berthNum = 1;
+ }
+ guideData.push({
+ 'guideNo': domEle.guideNo, 'pointX': domEle.lonId, 'pointY': domEle.latId,
+ 'level': domEle.level, 'rule': freeBerthNum / berthNum
+ });
+ })
+ //console.log("地图上的数据" + JSON.stringify(guideData));
+ //加载地图位置气泡
+ drawMarker();
+};
+
diff --git a/js/pagejs/index.js b/js/pagejs/index.js
new file mode 100644
index 0000000..d5ab4ef
--- /dev/null
+++ b/js/pagejs/index.js
@@ -0,0 +1,1538 @@
+
+(function () {
+ //左上雷达图
+ var radarechart = echarts.init(document.getElementById('radar_echart'));
+ //停车位数量及占比
+ // var bar_l_echart = echarts.init(document.getElementById('bar_l_echart'));
+ //设备数量
+ // var bar_c_echart = echarts.init(document.getElementById('bar_c_echart'));
+ //中间地图
+ var map_c_echart = echarts.init(document.getElementById('map_c_echart'));
+ //右上线上线下排行榜图
+ var bar_r_echart = echarts.init(document.getElementById('bar_r_echart'));
+ //车位配比
+ var line_r_echart = echarts.init(document.getElementById('line_r_echart'));
+ //定义某个地市要显示的区县
+ var displayCountry = [];
+ //赤峰的省市区县
+ function ChiFengMapSeries(name){
+ var obj = {
+
+ // center:[118.361313,42.27018],//中心点
+ zoom:1.2,//当前视角的缩放比例。
+ // roam:'scale',//是否支持鼠标缩放
+ //selectedMode:true,//选中模式,表示是否支持多个选中,默认关闭
+ name:name,
+ type:'map',
+ map:'meishan',
+
+ // markPoint:{
+ // symbol:'circle'
+ // },
+ label: {
+ normal: {
+ show: true
+ },
+ emphasis: {
+ show: true,
+ }
+ },
+ mapLocation:{
+ y:60
+ },
+ itemStyle: {
+ normal: {
+ borderWidth: 1,
+ borderColor: 'rgba(147,191,245,.3)',
+
+ label: {
+ show: false,
+ textStyle: {
+ color: "#fff"
+ }
+ }
+ },
+ emphasis:{
+ areaColor: 'rgba(255,204,0,0.4)',
+ label: {
+ show: false,
+ textStyle: {
+ color: "#fff"
+ }
+ }
+ }
+ },
+ markPoint:{
+ symbol:'image://./../img/cf_map_icon.png',
+ silent:true,
+ symbolSize:[17, 17],
+ data: [
+
+ {
+ name: '',
+ coord: [103.729882,30.136356],
+ },
+ {
+ name: '',
+ coord: [103.789673,30.268198],
+ },
+ {
+ name: '',
+ coord: [103.806921,29.789424],
+ },
+ {
+ name: '',
+ coord: [104.164518,30.059866],
+ },
+ {
+ name: '',
+ coord: [103.383783,30.04186],
+ },
+ {
+ name: '',
+ coord: [103.26535,29.914721],
+ },
+
+ ],
+ label:{
+ normal:{
+ show:false,
+ },
+ emphasis:{
+ show:false,
+ },
+
+ }
+ },
+
+ data:[
+ {
+ name:'东坡区',
+ value:0,
+
+ },
+ {
+ name:'彭山区',
+ value:0
+ },
+ {
+ name:'青神县',
+ value:0
+ },
+ {
+ name:'仁寿县',
+ value:0
+ },
+ {
+ name:'丹棱县',
+ value:0
+ },
+ {
+ name:'洪雅县',
+ value:0
+ }
+ ],
+
+
+ };
+ return obj;
+
+ };
+ var map_c_option = {
+ tooltip: {
+ trigger: 'item',
+ formatter: function(params) {
+ var res = params.name+'
';
+ var myseries = map_c_option.series;
+ for (var i = 0; i < myseries.length; i++) {
+
+ var displayVal = 0;
+ for(var j=0;j
';
+ }
+ }
+ return res;
+ }
+ },
+
+ // dataRange:{
+ // show:false,
+ // },
+ visualMap: {
+ show: false,
+ min: 1,
+ max: 10000,
+ itemWidth: 0,//图形的宽度,即长条的宽度
+ itemHeight: 90,//图形的高度,即长条的高度
+ left: 5,
+ bottom: 0,
+ //text: ['High', 'Low'],
+ realtime: false,//拖拽时,是否实时更新
+ calculable: false,//是否显示拖拽用的手柄
+ inRange: {
+ color: ['rgba(29,71,193,.3)', 'rgba(33,77,203,.7)','rgba(29,71,193,.2)','rgba(33,77,203,.6)']
+ }
+ },
+ series:[
+ //前三项位置固定,后面的动态添加
+ new ChiFengMapSeries("停车场数"),
+ new ChiFengMapSeries("停车位数"),
+ new ChiFengMapSeries("空闲车位数")
+ /*new ChiFengMapSeries("地磁数")*/
+ ],
+ };
+
+ var fun = {
+ init:function () {
+ //左上雷达图
+ var radar_echart_option = {
+ animationDuration:2000,
+ animationDelay:500,
+ tooltip: {
+ trigger: 'item'
+ },
+ radar:
+ {
+ indicator: [
+ {text: '', max: 100},
+ {text: '', max: 100},
+ {text: '', max: 100},
+ {text: '', max: 100}
+ ],
+ name: {
+ textStyle: {
+ color: '#fff',
+ fontFamily:"Microsoft YaHei",
+ }
+ },
+ center: ['50%','50%'],
+ radius: '70%',
+
+ shape: 'circle',
+ splitNumber:3,
+ startAngle:60,
+ splitLine: {
+ lineStyle: {
+ color: '#1dc7ff'
+ }
+ },
+ axisLine: {
+ lineStyle: {
+ color: '#1dc7ff'
+ }
+ },
+ splitArea: {
+ show: false
+ },
+
+ },
+ series: [
+
+ {
+ label: {
+
+ normal: {
+ show:true,
+ position: 'left',
+ textStyle: {
+ color: '#fff',
+ fontSize: 12,
+ fontFamily:"Microsoft YaHei",
+ },
+ //formatter: '{c}个 占比{d}%\n{b}'
+ formatter:function (params) {
+ //alert(params)
+ }
+ }
+ },
+ animation:true,
+ type: 'radar',
+ tooltip: {
+ trigger: 'item'
+ },
+ itemStyle: {
+ normal: {
+ areaStyle:
+
+ {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [{
+ offset: 0, color: '#ee04e0' // 0% 处的颜色
+ }, {
+ offset: 1, color: '#f88d06' // 100% 处的颜色
+ }],
+ globalCoord: false // 缺省为 false
+ },
+ type: 'default'
+ }
+ },
+
+ },
+ data: [
+ {
+ value: [0,0,0,0],
+ name: '空闲车位数'
+ }
+ ],
+
+ }
+ ]
+ };
+ radarechart.setOption(radar_echart_option,true);
+
+
+ //左中柱图bar_l_echart
+
+ //中间地图
+ map_c_echart.setOption(map_c_option,true);
+ // map_c_echart.mapselected({
+ //
+ // });
+ currentIndex = -1;
+ var dataLen = map_c_option.series[0].data.length;
+ // 取消之前高亮的图形
+ map_c_echart.dispatchAction({
+ type: 'downplay',
+ seriesIndex: 0,
+ dataIndex: currentIndex
+ });
+ currentIndex = (currentIndex + 1) % dataLen;
+ // 高亮当前图形
+ map_c_echart.dispatchAction({
+ type: 'highlight',
+ seriesIndex: 0,
+ dataIndex:currentIndex
+ });
+ // 显示 tooltip
+ map_c_echart.dispatchAction({
+ type: 'showTip',
+ seriesIndex: 0,
+ dataIndex: currentIndex
+ });
+ // setTimeout(function () {
+ // currentIndex = -1;
+ // var dataLen = map_c_option.series[0].data.length;
+ // // 取消之前高亮的图形
+ // map_c_echart.dispatchAction({
+ // type: 'downplay',
+ // seriesIndex: 0,
+ // dataIndex: currentIndex
+ // });
+ // currentIndex = (currentIndex + 1) % dataLen;
+ // // 高亮当前图形
+ // map_c_echart.dispatchAction({
+ // type: 'highlight',
+ // seriesIndex: 0,
+ // dataIndex:currentIndex
+ // });
+ // // 显示 tooltip
+ // map_c_echart.dispatchAction({
+ // type: 'showTip',
+ // seriesIndex: 0,
+ // dataIndex: currentIndex
+ // });
+ // },1000);
+
+
+ // setInterval(function () {
+ // var dataLen = map_c_option.series[0].data.length;
+ // // 取消之前高亮的图形
+ // myChart.dispatchAction({
+ // type: 'downplay',
+ // seriesIndex: 0,
+ // dataIndex: currentIndex
+ // });
+ // currentIndex = (currentIndex + 1) % dataLen;
+ // // 高亮当前图形
+ // myChart.dispatchAction({
+ // type: 'highlight',
+ // seriesIndex: 0,
+ // dataIndex:currentIndex
+ // });
+ // // 显示 tooltip
+ // myChart.dispatchAction({
+ // type: 'showTip',
+ // seriesIndex: 0,
+ // dataIndex: currentIndex
+ // });
+ // }, 1000);
+
+ //右上线上线下排行榜图
+ var bar_r_option = {
+ // tooltip : {
+ // trigger: 'axis',
+ // axisPointer : { // 坐标轴指示器,坐标轴触发有效
+ // type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
+ // }
+ // },
+ animationDuration:2000,
+ // animationDelay:500,
+ legend: {
+ data:[
+ {
+ name:'线下服务次数',
+ // icon : 'image:////favicon.png',
+ // textStyle:{fontWeight:'bold', color:'green'}
+ },
+ {
+ name:'线上服务次数',
+ // icon : 'image:////favicon.png',
+ // textStyle:{fontWeight:'bold', color:'green'}
+ },
+ ],
+ bottom:0,
+
+ left:'29%',
+ selectedMode:false,
+ textStyle:{
+ color:'#fff',
+ fontFamily:"Microsoft YaHei",
+ },
+ },
+ tooltip : {
+ trigger: 'item',
+ // formatter: "{a}
{b} : {c} "
+ formatter:function (params) {
+ var val = Math.abs(params.value);
+ return params.seriesName +'
'+ params.name +':'+ val;
+
+ },
+ },
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '5%',
+ top:'2%',
+ containLabel: true
+ },
+ xAxis : [
+
+ {
+ show:false,
+ type : 'value',
+ // max:100,
+ // min:-100,
+ }
+ ],
+ yAxis : [
+ {
+ type : 'category',
+ axisTick : {show: false},
+ axisTick: {
+ show: false
+ },
+ axisLine: {
+ show: false
+ },
+ splitLine:{
+ show:false
+ },
+
+ axisLabel:{
+ textStyle: {
+ color: '#fff',
+ fontFamily:"Microsoft YaHei",
+ // fontSize:'10px'
+ },
+ formatter:function (value) {
+ if(value.length>7){
+ return value.substring(0,3)+'...'+value.substr(-3);
+ }else{
+ return value;
+ }
+
+ }
+ },
+
+ data : [],
+ nameTextStyle:{
+ color:'#fff',
+ fontFamily:"Microsoft YaHei",
+ },
+ }
+ ],
+ series : [
+
+
+ {
+ barGap:'20',
+ name:'线上服务次数',
+ type:'bar',
+ stack: '总量',
+ data:[],
+ itemStyle:{
+ normal:{
+ barBorderRadius: [0, 125, 125, 0],
+ color: {
+ type: 'linear',
+ x: 1,
+ y: 1,
+ x2: 0,
+ y2: 0,
+ colorStops: [{
+ offset: 0, color: '#00a2ff' // 0% 处的颜色
+ }, {
+ offset: 1, color: '#00c888' // 100% 处的颜色
+ }],
+ globalCoord: false // 缺省为 false
+ }
+ }
+ },
+ },
+ {
+ barGap:'20',
+ name:'线下服务次数',
+ type:'bar',
+ stack: '总量',
+ data:[],
+ itemStyle:{
+ normal:{
+ barBorderRadius: [125, 0, 0, 125],
+ color: {
+ type: 'linear',
+ x: 1,
+ y: 1,
+ x2: 0,
+ y2: 0,
+ colorStops: [{
+ offset: 0, color: '#ee04e0' // 0% 处的颜色
+ }, {
+ offset: 1, color: '#f88d06' // 100% 处的颜色
+ }],
+ globalCoord: false // 缺省为 false
+ }
+ }
+ },
+ }
+ ]
+ };
+ bar_r_echart.setOption(bar_r_option);
+
+
+ //右下图
+ var line_r_option = {
+ animationDuration:2000,
+ animationDelay:500,
+ backgroundColor: 'rgba(13,74,250,.08)',//背景色
+ tooltip : {
+ trigger: 'axis',
+ // axisPointer: {
+ // type: 'cross',
+ // label: {
+ // backgroundColor: '#6a7985'
+ // }
+ // }
+ },
+ legend: {
+ data:['红山区','松山区','元宝山区','其他']
+ },
+
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ top:'6%',
+ containLabel: true
+ },
+ xAxis : [
+ {
+ nameLocation:'middle',
+ axisTick: {
+ show: false,
+
+ },
+ axisLine: {
+ show: false
+ },
+ splitLine:{
+ show:false
+ },
+ axisLabel: {
+ textStyle: {
+ color: '#fff',
+ fontFamily:"Microsoft YaHei",
+ },
+ },
+ type : 'category',
+ boundaryGap : ['5%','2%'],
+ data:['红山区','松山区','元宝山区','其他']
+ }
+ ],
+ yAxis : [
+ {
+ axisTick: {
+ show: false
+ },
+ axisLine: {
+ show: false
+ },
+ splitLine:{
+ show:false
+ },
+ axisLabel: {
+ textStyle: {
+ color: '#fff',
+ fontFamily:"Microsoft YaHei",
+ },
+ },
+ // max:1.5,
+ // splitNumber:3,
+ type : 'value'
+ }
+ ],
+ series : [
+ {
+ smooth:true,
+ name:'车位配比',
+ type:'line',
+ stack: '总量',
+ // markPoint : {
+ // symbol:'image://../../img/line_r_option.png',
+ // },
+ symbol:'image://./../img/line_r_option.png',
+ symbolSize: 17,
+ data:[],
+ lineStyle:{
+ normal:{
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 1,
+ y2: 0,
+ colorStops: [{
+ offset: 0, color: '#f88d06' // 0% 处的颜色
+ },{
+ offset: 1, color: '#ee04e0' // 100% 处的颜色
+ }],
+ globalCoord: false // 缺省为 false
+ }
+ }
+ },
+ areaStyle:{
+ normal:{
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 1,
+ y2: 0,
+ colorStops: [{
+ offset: 0, color: 'rgba(248,141,6,.3)' // 0% 处的颜色
+ },{
+ offset: 1, color: 'rgba(238,4,224,.3)' // 100% 处的颜色
+ }],
+ // colorStops: [{
+ // offset: 0, color: '#f88d06' // 0% 处的颜色
+ // }, {
+ // offset: 0.2, color: '#f88907' // 100% 处的颜色
+ // }, {
+ // offset: 0.3, color: '#ffc600' // 100% 处的颜色
+ // }, {
+ // offset: 1, color: '#ee04e0' // 100% 处的颜色
+ // }],
+ globalCoord: false // 缺省为 false
+ }
+ }
+ }
+ }
+
+ ]
+ }
+ line_r_echart.setOption(line_r_option);
+
+ //自适应
+ window.onresize = function () {
+ radarechart.resize();
+ // bar_l_echart.resize();
+ // pie_l_echart.resize();
+ // bar_c_echart.resize();
+ map_c_echart.resize();
+ bar_r_echart.resize();
+ line_r_echart.resize();
+ }
+ },
+ requestData:function(){
+ fun.getFreeBerthsByAjax();
+ fun.getParkinglotBerthsColumnChartByAjax();
+ fun.getParkLotEqpCountChartByAjax();
+ fun.getQueryParkTransaction();
+ fun.getBerthSpaceRatioChart();
+ },
+ getFreeBerthsByAjax:function(){
+ var req= {
+ sysCode:sysComm.sysCode,
+ cityId:sysComm.cityId
+ };
+ var freeBerthRadarChart= {
+ method: "post",
+ url: dataUrl.util.getFreeBerthRadarChart(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ success: function(res){
+ fun.updateFreeBerths(res);
+ }
+ }
+ sysAjax(freeBerthRadarChart);
+ //1分钟调用1次
+ window.setInterval(function(){
+ sysAjax(freeBerthRadarChart);
+ },1000*60*5);
+ },
+ //获取停车场和停车位数据
+ getParkinglotBerthsColumnChartByAjax:function(){
+ //停车位数量
+ var bar_l_option = {
+ // animationDuration:2000,
+ // animationDelay:500,
+ xAxis: {
+ data: []
+ },
+ series: [
+ {data: []},
+ {data: []}
+ ]
+ };
+
+ //停车场数据
+// var pie_l_option = {
+// animationDuration:2000,
+// animationDelay:500,
+// series : [
+// {
+// // data:[
+// // {value:0, name:'其他'}
+// // ]
+// data:[
+// {name:'红山区',
+// y: 21.43,
+// sliced: true,
+// selected: true }
+//
+// // {name:'元宝山区', y: 18.57},
+// // {name:'松山区', y:20},
+// // {name:'其他', y: 40}
+// ]
+// }
+// ]
+// };
+// //先清空
+// bar_l_option.series[0].data=[];
+// bar_l_option.xAxis.data[i]=[];
+// pie_l_option.series[0].data=[];
+ var dataCount=[];
+ var dataCountnew = [];
+ //map类型,key:countryName,value:对应的数组下标
+ var countryIndex = {};
+ //根据要显示的区县初始化
+ for(var i = 0;i
{point.key}
',
+ pointFormatter: function() {
+ // console.log(this.series.name)
+
+ return '车位数:'+this.y+'
占比: '+((this.y/berthTotalNum)*100).toFixed(2)+'%'+''
+ }
+
+ },
+ plotOptions: {
+ column: {
+ stacking: 'normal',
+ depth: 40,
+ dataLabels:{
+ enabled:false, // dataLabels设为true
+ style:{
+ color:'#fff'
+ }
+ },
+ pointPadding:0.1,
+ }
+ },
+ xAxis: {
+ gridLineWidth: 0,
+ categories: bar_l_option.xAxis.data,
+ labels: {
+ style: {
+ color: '#fff',//颜色
+ fontSize:'12px' //字体
+ }
+ },
+ },
+ yAxis: {
+ gridLineWidth: 0,
+ title: {
+ text: null
+ },
+ labels: {
+ style: {
+ color: '#fff',//颜色
+ fontSize:'12px' //字体
+ }
+ },
+ },
+
+ series: [{
+ // name: 'none',
+ data: bar_l_option.series[0].data,
+ color:'rgba(8,220,128,0.8)'
+ }],
+
+ });
+
+
+ var serieData = {value:otherParkLotNum, name:"其他"};
+ dataCount.push(serieData);
+
+ for(var i=0;i{point.key}',
+ pointFormat: ' {point.percentage:.1f}%'
+ },
+ plotOptions : {
+ pie : {
+ allowPointSelect: true,
+ cursor: 'pointer',
+ depth: 30,
+ dataLabels: {
+ enabled: true,
+ format:'{point.name} {point.percentage:.2f}%',
+ style : {'fontSize' : '12px','color':'#fff','fontWeight':'normal'},
+ padding: 10,
+ distance: 5
+
+ }
+ }
+ },
+ series: [{
+ type: 'pie',
+ // name: '停车场数量及占比',
+ data:dataCountnew,
+ colors:['rgba(0,222,255,0.6)','rgba(1,178,102,0.6)','rgba(255,204,0,0.6)','rgba(248,21,139,0.6)']
+
+ }]
+ // });
+ });
+
+ $("#parkplace").html(0);
+ $("#parknum").html(0);
+ //设置全部停车位和停车场数
+ $("#parkplace").html(berthTotalNum);
+ $("#parknum").html(parkTotalNum);
+
+ //中间地图
+ //停车位
+ var seriesBerthData=new ChiFengMapSeries("停车位数");
+ //停车场
+ var seriesParkData=new ChiFengMapSeries("停车场数");
+ for (var i = 0; i < seriesBerthData.data.length; i++) {
+ var name = seriesBerthData.data[i].name;
+ //获取该区停车场个数
+ seriesParkData.data[i].value=pkVo[name]==null?0:pkVo[name];
+ //获取该区的停车位个数
+ seriesBerthData.data[i].value=berthsVo[name]==null?0:berthsVo[name];
+ }
+ map_c_option.series[0] = seriesParkData;
+ map_c_option.series[1] = seriesBerthData;
+ map_c_echart.setOption(map_c_option);
+
+ }else{
+
+ }
+ }
+ };
+ sysAjax(parkinglotColumnChart);
+ },
+ //更新空闲车位数
+ updateFreeBerths:function(resultData){
+ //空闲车位数网状图
+ var radar_echart_option = {
+ radar:
+ {
+ indicator: []
+ },
+ series: [
+ {
+ data: [{value: [0]}],
+ name:'空闲车位数',
+ }
+ ]
+ };
+ //先清空
+ radar_echart_option.radar.indicator=[];
+ radar_echart_option.series[0].data[0].value=[];
+ //map类型,key:countryName,value:对应的数组下标
+ var countryIndex = {};
+ //根据要显示的区县初始化
+ for(var i = 0;imaxDataVal?dataval[index]:maxDataVal;
+ }
+ //修改最大值
+ for(var i=0;imaxDataVa_l){
+ maxDataVa_l=dataval_l[i];
+ }
+ }
+ for (var i=0;imaxDataVal_r){
+ maxDataVal_r=-dataval_r[i];
+ }
+ }
+ if(parseInt(maxDataVa_l)>parseInt(maxDataVal_r)){
+
+ bar_r_option.xAxis[0].max=maxDataVa_l;
+ bar_r_option.xAxis[0].min=-maxDataVa_l;
+ }else{
+ bar_r_option.xAxis[0].max=maxDataVal_r;
+ bar_r_option.xAxis[0].min=-maxDataVal_r;
+ }
+
+ bar_r_echart.setOption(bar_r_option);
+ }
+ }
+ };
+ sysAjax(getParkLotEqpCountChart);
+ },
+ //设备
+ getParkLotEqpCountChartByAjax:function(){
+ var req= {
+ sysCode:sysComm.sysCode,
+ cityId:sysComm.cityId
+ };
+ var getParkLotEqpCountChart= {
+ method: "post",
+ url: dataUrl.util.getParkLotEqpCountChart(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ success: function(res){
+ if(res.code == '8888'){
+ var result = res.data;
+
+ var bar_c_option = {
+ animationDelay:500,
+ animationDuration:2000,
+ legend: {
+ data:[]
+ },
+ xAxis : [
+ {
+ data : []
+ }
+ ],
+ series : [
+
+ ]
+ };
+ //map类型,key:countryName,value:对应的数组下标
+ var countryIndex = {};
+ var iniData = [];
+ //根据要显示的区县初始化
+ for(var i = 0;i{point.key}
',
+ // pointFormat: '{series.name}: {point.y}',series.name
+ formatter: function() {
+ var s=this.series.name;
+ return ''+this.key+'
'+s.substring(0,s.length-2)+'总数:'+this.total+'
'+this.series.name+':'+this.y+''
+ }
+ },
+ plotOptions: {
+ column: {
+ stacking: 'normal',
+ depth: 40,
+ dataLabels:{
+ enabled:false, // dataLabels设为true
+ style:{
+ color:'#D7DEE9'
+ }
+ },
+ pointPadding:0.1,
+ },
+ series: {
+ events: {
+ legendItemClick: function(e) {
+ return false; // 直接 return false 即可禁用图例点击事件
+ }
+ },
+
+ }
+ },
+ series:bar_c_option.series,
+ /*series: [
+ {
+ name: '地磁离线',
+ data: [102, 186, 233, 144],
+ stack: 'male'
+ },
+ {
+ name: '地磁在线',
+ data: [500, 334, 433, 437],
+ stack: 'male'
+ },
+ {
+ name: 'pos机离线',
+ data: [130, 160, 174, 164],
+ stack: 'female'
+ },
+ {
+ name: 'pos机在线',
+ data: [289, 556, 676, 267],
+ stack: 'female'
+ }
+ ],*/
+
+ colors:['rgba(0,204,255,0.8)','rgba(8,220,128,0.8)','rgba(250,5,218,0.8)','rgba(255,204,0,0.8)']
+ });
+ //中间地图
+ //从第4个元素开始位设备
+ var equIndex = 3;
+ for(var equTypeName in result.totalEqpMap){
+ //中间地图
+ var seriesData=new ChiFengMapSeries(equTypeName);
+ //设置不同区县的值
+ for (var i = 0; i < seriesData.data.length; i++) {
+ var countryName = seriesData.data[i].name;
+ //获取该区的设备个数
+ var equCountryMap = result.totalEqpMap[equTypeName];
+ if(equCountryMap!=null){
+ var equCount = equCountryMap[countryName]==null?0:equCountryMap[countryName];
+ seriesData.data[i].value=equCount;
+ }
+ }
+ map_c_option.series[equIndex] = seriesData;
+ equIndex++;
+ }
+ map_c_echart.setOption(map_c_option);
+ }
+ }
+ };
+ sysAjax(getParkLotEqpCountChart);
+ },
+ getBerthSpaceRatioChart:function(){
+ var req= {
+ sysCode:sysComm.sysCode,
+ cityId:sysComm.cityId
+ };
+ var getBerthSpaceRatioChart= {
+ method: "post",
+ url: dataUrl.util.getBerthSpaceRatioChart(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ success: function(res){
+ if(res.code == '8888'){
+ var result = res.data;
+ var line_r_option = {
+ animationDuration:2000,
+ animationDelay:500,
+ legend: {
+ data:[]
+ },
+ xAxis : [
+ {
+ data:[]
+ }
+ ],
+ series : [
+ {
+ data:[]
+ }
+ ]
+ }
+ var data=result.berthSpaceRatio;
+ var dataRatio=0.0;
+ var j = 0;
+ for(var i=0; i< data.length; i++){
+ if(data[i].name=='总配比'){
+ dataRatio=data[i].data.toFixed(2);
+ }else{
+ line_r_option.legend.data[j]=data[i].name;
+ line_r_option.xAxis[0].data[j]=data[i].name;
+ line_r_option.series[0].data[j]=data[i].data.toFixed(2);
+ j++;
+ }
+ }
+ $("#matchnum").html(dataRatio);
+ line_r_echart.setOption(line_r_option);
+ }
+ }
+ };
+ sysAjax(getBerthSpaceRatioChart);
+ }
+ };
+ //获取某个城市要显示的区县
+ function getDisplayCountryByCity(){
+ var req = {
+ sysCode:sysComm.sysCode,
+ cityId:sysComm.cityId
+ };
+ if(displayCountry.length>0){
+ return displayCountry;
+ }
+ sysAjax({
+ method: "post",
+ url: dataUrl.util.getDisplayCountry(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ async:false,
+ success: function(res){
+ if(res.code == '8888'){
+ displayCountry = res.data;
+ }else{
+ }
+ }
+ });
+ }
+
+
+ var stompClient = null;
+
+ function connect() {
+ var socket = new SockJS(dataUrl.util.getParkWebSocketEndpoint());
+ stompClient = Stomp.over(socket);
+ stompClient.connect({}, function (frame) {
+ // console.log('Connected: ' + frame);
+ //订阅空闲车位数
+ stompClient.subscribe(dataUrl.util.subscribeFreeBerthRadarChartByWebSocket(), function (freeBerthsVo) {
+ //显示空闲车位数
+ updateFreeBerths(JSON.parse(greeting.body).content);
+ });
+ });
+ }
+
+ function disconnect() {
+ if (stompClient != null) {
+ stompClient.disconnect();
+ }
+ // console.log("Disconnected");
+ }
+
+ function queryfreeBerthsByWebSocket() {
+ stompClient.send(dataUrl.util.sendFreeBerthRadarChartByWebSocket(), {}, JSON.stringify({
+ sysCode:sysComm.sysCode,
+ cityId:sysComm.cityId
+ }));
+ }
+
+
+/* $(function () {
+ $("form").on('submit', function (e) {
+ e.preventDefault();
+ });
+ $( "#connect" ).click(function() { connect(); });
+ $( "#disconnect" ).click(function() { disconnect(); });
+ $( "#send" ).click(function() { sendName(); });
+ });*/
+
+ //connect();
+ //queryfreeBerthsByWebSocket();
+
+
+ fun.init();
+ getDisplayCountryByCity();
+ fun.requestData();
+
+
+
+
+
+})();
\ No newline at end of file
diff --git a/js/pagejs/parkheat.js b/js/pagejs/parkheat.js
new file mode 100644
index 0000000..dfc38da
--- /dev/null
+++ b/js/pagejs/parkheat.js
@@ -0,0 +1,348 @@
+(function () {
+ var fun = {
+ init : function () {
+ time_left_init_active:{
+ $('#time_ul_l').prev().addClass('time_line_active');
+ $('#time_ul_l li .time_date').addClass('time_date_all_active');
+ $('#time_ul_l li:last .time_date').addClass('time_date_active');
+ $('#time_ul_l li:last .time_circle').addClass('time_circle_l_active');
+ };
+ left_seven_time:{
+ //设置日期,当前日期的前七天
+ var myDate = new Date(); //获取今天日期
+ myDate.setDate(myDate.getDate() - 7);
+ var dateArray = [];
+ var dateTemp;
+ var flag = 1;
+ for (var i = 0; i < 7; i++) {
+ dateTemp = (myDate.getMonth()+1)+"月"+myDate.getDate()+'日';
+ dateArray.push(dateTemp);
+ myDate.setDate(myDate.getDate() + flag);
+
+ };
+ $.each($('#time_ul_l .time_date'),function (i,item) {
+ //console.log(dateArray[i])
+ $(this).text(dateArray[i])
+ })
+ };
+ },
+ time_left_init:function () {
+ $('#time_ul_l').prev().removeClass('time_line_active');
+ $('#time_ul_l li .time_date').removeClass('time_date_all_active');
+ $('#time_ul_l li .time_date').removeClass('time_date_active');
+ $('#time_ul_l li .time_circle').removeClass('time_circle_l_active');
+ },
+ time_left_active:function (obj) {
+ $('#time_ul_l').prev().addClass('time_line_active');
+ $('#time_ul_l').find('.time_date').addClass('time_date_all_active');
+ $(obj).find('.time_date').addClass('time_date_active');
+ $(obj).find('.time_circle').addClass('time_circle_l_active');
+ },
+ time_right_init:function () {
+ $('#time_ul_r').prev().removeClass('time_line_active');
+ $('#time_ul_r li .time_date_r').removeClass('time_date_all_active');
+ $('#time_ul_r li .time_date_r').removeClass('time_date_active');
+ $('#time_ul_r li .time_circle_r').removeClass('time_circle_r_active');
+ },
+ time_right_active:function (obj) {
+ $('#time_ul_r').prev().addClass('time_line_active');
+ $('#time_ul_r').find('.time_date_r').addClass('time_date_all_active');
+ $(obj).find('.time_date_r').addClass('time_date_active');
+ $(obj).find('.time_circle_r').addClass('time_circle_r_active');
+ },
+
+ };
+ fun.init();
+ //时间轴右侧点击事件
+ $('#time_ul_r li').on('click',function () {
+ var obj = $(this);
+ fun.time_left_init();
+ fun.time_right_init();
+ fun.time_right_active(obj);
+ var o=obj.find('.time_date_r').text().indexOf(':');
+ var o2=obj.find('.time_date_r').text().substr(o-2,o);
+ var hourTime='2017-07-12 '+o2;
+ console.log(hourTime);
+
+ //ajax
+ var req= {
+ sysCode:sysComm.sysCode,
+ cityId:sysComm.cityId,
+ provId:sysComm.provId,
+ queryDate:new Date(hourTime.replace(new RegExp(/-/gm) ,"/")),
+ };
+ var queryParkHeatmapByHour= {
+ method: "post",
+ url: dataUrl.util.queryParkHeatmapByHour(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ success: function(res){
+ if(res.code == '8888'){
+ var result = res.data;
+ console.log(JSON.stringify(result));
+ var points =[];
+ for(var i=0; i= 1 && month <= 9) {
+ month = "0" + month;
+ }
+ if (strDate >= 0 && strDate <= 9) {
+ strDate = "0" + strDate;
+ }
+ var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
+ + " " + date.getHours() + seperator2 + date.getMinutes()
+ + seperator2 + date.getSeconds();
+ return currentdate;
+}
\ No newline at end of file
diff --git a/js/pagejs/parkhotarea.js b/js/pagejs/parkhotarea.js
new file mode 100644
index 0000000..109003c
--- /dev/null
+++ b/js/pagejs/parkhotarea.js
@@ -0,0 +1,895 @@
+/**
+ * Created by mac on 17/7/11.
+ */
+
+//下拉框
+(function ($) {
+ var ser_object2;
+ var ser_object2_img;
+ var radius_v;
+ jQuery.fn.extend({
+ "M_select": function (options) {
+ var ojc_arr = this;
+ var ojc;
+ // select下拉框
+ for (i = 0; i < ojc_arr.length; i++) {
+ var ser_object = $(ojc_arr[i]);
+ $(ser_object).parent().addClass("select-con");
+ $(ser_object).parent().css("z-index", "1");
+ $(ser_object).wrap("");
+ $(ser_object).parent().parent().append('');
+ var w = $(ser_object).parent().parent().width();
+ $(ser_object).parent().parent().find(".sel-float-box").css("width", w);
+ var ojc = $(ser_object).children();
+ for (a = 0; a < ojc.length; a++) {
+ var t = $(ojc[a]).text();
+ var v = $(ojc[a]).attr("value");
+ $(ser_object).parent().parent().find(".sel-float-box").append('' + t + '
');
+ }
+ ;
+
+ for (a = 0; a < ojc.length; a++) {
+
+ var sel_disabled = $(ojc[a]).attr("disabled");
+
+ if (sel_disabled == "disabled" || sel_disabled == "true") {
+ var div_ojc = $(ser_object).parent().parent().find('.sel-float-box').children();
+ $(div_ojc[a]).removeClass("sel-float-div");
+ $(div_ojc[a]).addClass("sel-float-div-disabled");
+
+ }
+ }
+ ;
+
+ var sel_textFirst = $(ser_object).parent().parent().find(".sel-float-box").children().eq(0).text();
+
+
+ // 默认参数
+ var defaultOption = {
+
+ ico: 1,
+ Img: "",
+ Img2: "",
+ Title: "",
+ inputName: "sel_v",
+ selected: "0",
+ radius: "0",
+ Succee: function () {
+ }
+
+ };
+ // 合并自定义参数和默认参数,出现相同属性名时自定义参数会覆盖默认参数
+ options = $.extend({}, defaultOption, options);
+
+ // 判断Test是否为空
+ if (options.Title) {
+ sel_textFirst = options.Title;
+
+ }
+ ;
+ $(ser_object).parent().parent().find(".sel-title").text(sel_textFirst);
+
+ // 判断使用哪种ico样式
+ var Img, Img2;
+ if (!(options.Img) && !(options.Img2)) {
+
+ if (options.ico == 1) {
+ Img = "./js/M_select/down1.png";
+ Img2 = "./js/M_select/up1.png";
+ }
+ if (options.ico == 2) {
+ Img = "./js/M_select/down2.png";
+ Img2 = "./js/M_select/up2.png";
+ }
+ if (options.ico == 3) {
+ Img = "./js/M_select/down3.png";
+ Img2 = "./js/M_select/up3.png";
+ }
+ if (options.ico == 4) {
+ Img = "./js/M_select/down4.png";
+ Img2 = "./js/M_select/up4.png";
+ }
+ if (options.ico == 5) {
+ Img = "./js/M_select/down5.png";
+ Img2 = "./js/M_select/up5.png";
+ }
+ } else if (!(options.Img) && (options.Img2 != null)) {
+ Img = options.Img2;
+ Img2 = options.Img2;
+ } else if (!(options.Img2) && (options.Img != null)) {
+ Img = options.Img;
+ Img2 = options.Img;
+ } else if ((options.Img != null) && (options.Img2 != null)) {
+ Img = options.Img;
+ Img2 = options.Img2;
+ }
+
+ // 可传参css
+// $(ser_object).parent().parent().find(".sel-sign").css("background","url("+Img+")");
+// $(ser_object).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ $(ser_object).parent().parent().find(".sel-box").append('');
+ //$(ser_object).parent().parent().find(".sel-box").css("border-radius",options.radius);
+ //$(ser_object).parent().parent().find(".sel-float-box").css("border-radius","0 0 "+options.radius +" "+options.radius+" ");
+
+ // 获取图片的高
+ var ico_h = $(ser_object).parent().parent().find(".sel-title-box").height();
+ // 设置图片的宽高
+// $(ser_object).parent().parent().find(".sel-sign").css({'width':+ico_h+'px','height':+ico_h+'px'});
+ $(ser_object).parent().parent().find(".sel-title-box").css("padding-right", "10px");
+
+ // 获取有多少个选项
+ var selLength = $(ser_object).parent().parent().find(".sel-float-box").children().length;
+ var selListHeight = $(ser_object).parent().parent().find(".sel-float-box").children().height();
+ // 获取选项的高度
+
+ var selHeight = selListHeight * 10;
+ // 隐藏下拉框
+ $(".sel-float-box").hide();
+ if (selLength > 10) {
+ $(ser_object).parent().parent().find(".sel-float-box").css("height", selHeight);
+ $(ser_object).parent().parent().find(".sel-float-box").css("overflow-y", "scroll");
+ }
+
+ // 根据selected 的值选中(即input value)
+ var input_val = $(ser_object).parent().parent().find(".inputHidden").attr("value");
+ var div_objoct = $(ser_object).parent().parent().find(".sel-float-div");
+ for (a = 0; a < div_objoct.length; a++) {
+
+ var div_val = $(div_objoct[a]).attr("value");
+ if (div_val == input_val) {
+ var div_text = $(div_objoct[a]).text();
+ $(ser_object).parent().parent().find(".sel-title").text(div_text);
+ }
+ ;
+ }
+ ;
+
+
+ // 点击事件
+ $(ser_object).parent().parent().find(".sel-title-box").on("click", function () {
+ // 切换图片
+// $(ser_object2).parent().parent().find(".sel-sign").css("background","url("+ser_object2_img+")");
+// $(ser_object2).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ //$(ser_object2).parent().css("border-radius",radius_v);
+ $('.sel-box').removeClass("on");
+ ser_object2 = this;
+ ser_object2_img = Img;
+ // 圆角值
+ radius_v = options.radius;
+
+ var floatAttr = $(this).parent().find(".sel-float-box").css("display");
+ if (floatAttr == "block") {
+ $(".sel-float-box").hide();
+ $(this).parent().find(".sel-float-box").hide();
+
+ $(this).parent().removeClass("on");
+ $(this).parent().find(".sel-float-box").removeClass("on");
+
+ //$(this).parent().css("border-radius",options.radius);
+ // 切换图片
+// $(this).parent().parent().find(".sel-sign").css("background","url("+Img+")");
+// $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ } else if (floatAttr == "none") {
+ // 切换图片
+// $(this).parent().parent().find(".sel-sign").css("background","url("+Img2+")");
+// $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ $(".sel-float-box").hide();
+ $(this).parent().find(".sel-float-box").show();
+
+ $(this).parent().addClass("on");
+ $(this).parent().find(".sel-float-box").addClass("on");
+
+ //$(this).parent().css("border-radius",options.radius+" "+options.radius+" 0 0");
+ }
+
+ });
+
+ // 选项点击事件
+ $(ser_object).parent().parent().find(".sel-float-div").on("click", function () {
+ var sel_text = $(this).text();
+ var sel_value = $(this).attr("value");
+ // 切换图片
+// $(this).parent().parent().find(".sel-sign").css("background","url("+Img+")");
+// $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+
+ $(this).parent().hide();
+ $(this).parent().parent().find(".sel-title").text(sel_text);
+ //$(this).parent().parent().css("border-radius",options.radius);
+
+ $(this).parent().parent().find(".sel-title").attr("value", sel_value);
+ var selected_value = $(this).parent().parent().find(".sel-title").attr("value");
+ $(this).parent().parent().find(".inputHidden").attr("value", selected_value);
+ var v;
+ var ojc_option = $(this).parent().parent().parent().find("option");
+ for (a = 0; a < ojc_option.length; a++) {
+
+ v = $(ojc_option[a]).attr("value");
+
+ if (v == selected_value) {
+ $(ojc_option).attr("selected", false);
+ $(ojc_option[a]).attr("selected", true);
+
+ }
+ }
+ ;
+ // 判断函数是否为空
+ if (options.Succee != null) {
+ options.Succee(selected_value);
+ }
+
+
+ });
+ }// for循环语句结束
+
+ },
+
+ });
+ // 点击其他位置下拉消失
+
+ $(document).on('click', function (e) {
+ var parent = $(e.target).parents('.select-con').length;
+ if (!parent) {
+ // // 切换图片
+// $(ser_object2).parent().parent().find(".sel-sign").css("background","url("+ser_object2_img+")");
+// $(ser_object2).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ //$(ser_object2).parent().css("border-radius",radius_v);
+ // console.log(ser_object2);
+ $('.sel-float-box').hide();
+ $('.sel-box').removeClass("on");
+ }
+ ;
+
+ });
+
+})(jQuery);
+
+// 百度地图API功能
+var map; //Map实例
+
+//热点区域中心点
+var centerData=[
+ /*{
+ title:"维多利购物广场",
+ point:"118.967899,42.27983",
+ titkm:"3"
+ },
+ {
+ title:"万达广场",
+ point:"118.922316,42.25953",
+ titkm:"3"
+ },*/
+];
+//停车场数据,key:停车场编号,value:停车场信息
+var parkData={
+ "001":{
+ parkNo:"001",
+ pointX:"118.970907",
+ pointY:"42.27894",
+ allnum:"270",
+ free:"23"
+ },
+ "002":{
+ parkNo:"002",
+ pointX:"118.963558",
+ pointY:"42.278059",
+ allnum:"260"
+ }
+};
+
+//空闲车位数,key:停车场编号,value:空闲车位数
+var freeBerthData={
+ "001":"123",
+ "002":"33"
+}
+var marker ={};
+map = new BMap.Map('allmap',{enableMapClick:false}); // 创建Map实例
+var point = new BMap.Point(sysComm.centerpoint_lng,sysComm.centerpoint_lat);
+map.enableScrollWheelZoom();
+//第5步:设置地图风格
+map.setMapStyle({
+ styleJson:[
+ {
+ "featureType": "background",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#0a0906"
+ }
+ },
+ {
+ "featureType": "building",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#444444"
+ }
+ },
+ {
+ "featureType": "local",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#ff9900",
+ "weight": "0.1"
+ }
+ },
+ {
+ "featureType": "road",
+ "elementType": "all",
+ "stylers": {
+ "color": "#9b780e",
+ "weight": "0.1",
+ "saturation": -21,
+ "visibility": "on"
+ }
+ },
+ {
+ "featureType": "green",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#344222",
+ "saturation": -20
+ }
+ },
+ {
+ "featureType": "water",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#163e5a"
+ }
+ },
+ {
+ "featureType": "subway",
+ "elementType": "all",
+ "stylers": {
+ "color": "#ff9900",
+ "saturation": -39
+ }
+ },
+ {
+ "featureType": "railway",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#ff9900"
+ }
+ },
+ {
+ "featureType": "all",
+ "elementType": "labels.text.stroke",
+ "stylers": {
+ "color": "#313131"
+ }
+ },
+ {
+ "featureType": "all",
+ "elementType": "labels.text.fill",
+ "stylers": {
+ "color": "#8b8787"
+ }
+ },
+ {
+ "featureType": "manmade",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#1b1b1b"
+ }
+ },
+ {
+ "featureType": "highway",
+ "elementType": "geometry",
+ "stylers": {
+ "lightness": -75,
+ "saturation": -91
+ }
+ },
+ {
+ "featureType": "subway",
+ "elementType": "geometry",
+ "stylers": {
+ "lightness": -65
+ }
+ },
+ {
+ "featureType": "railway",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#000000",
+ "weight": "1",
+ "lightness": -40,
+ "saturation": 1
+ }
+ }
+ ]
+});
+map.centerAndZoom(point,15);
+//向地图中添加缩放控件
+var ctrlNav = new window.BMap.NavigationControl({
+ // 靠右上角位置
+ anchor: BMAP_ANCHOR_TOP_RIGHT,
+ // LARGE类型
+ type: BMAP_NAVIGATION_CONTROL_ZOOM,
+ //偏离值
+ offset: new BMap.Size(25, 80)
+});
+map.addControl(ctrlNav);
+//预警内容
+var warningCount = "";
+//热点区域
+function hotAreas(){
+ //请求热点区域
+ sysAjax({
+ method: "post",
+ url: dataUrl.util.getHotspotByCityId(),
+ data: "cityId="+sysComm.cityId+"&sysCode="+sysComm.sysCode,
+ contentType: 'application/x-www-form-urlencoded',
+ dataType:'json',
+ async:false,
+ success: function(res){
+ if(res.code=='8888'){
+ var resultData = res.data;
+ //清空
+ centerData = [];
+ if(resultData.length<=0){
+ return;
+ }
+ for(var index in resultData){
+ var hotareaitem = {
+ title:resultData[index].name,
+ point:resultData[index].longitude+","+resultData[index].latitude,
+ titkm:"3"
+ }
+ centerData.push(hotareaitem);
+ }
+ }
+ }
+ });
+
+
+ var hotTit=null;//热点区域中心店名称
+ var hotpoiX = null;//热点区域中心点
+ var hotpoiY = null;
+ var hotKm=null;//热点区域半径公里
+ var mPoint=null;
+ var marker=[];
+ for(var i = 0; i < centerData.length; i++){
+ hotTit=centerData[i].title;
+ hotpoiX=centerData[i].point.split(",")[0];
+ hotpoiY=centerData[i].point.split(",")[1];
+ hotKm=centerData[i].titkm;
+ mPoint = new BMap.Point(hotpoiX,hotpoiY);
+ // 创建标注
+ var myIcon = new BMap.Icon("../img/center-icon.png", new BMap.Size(30,30));
+ var marker2 = new BMap.Marker(mPoint,{icon:myIcon}); // 创建标注
+ map.addOverlay(marker2);
+ addCircle(hotTit,hotKm,hotpoiX,hotpoiY);
+ function addCircle(hotTit,hotKm,hotpoiX,hotpoiY) {
+ var hotTit=centerData[i].title;
+ var hotKm=centerData[i].titkm;
+ var hotpoiX=centerData[i].point.split(",")[0];
+ var hotpoiY=centerData[i].point.split(",")[1];
+ var mPoint = new BMap.Point(hotpoiX,hotpoiY);
+ //添加文字标注
+ var label = new BMap.Label(''+hotTit+'
',{offset:new BMap.Size(-74,-64),position:mPoint});
+ // 创建文本标注对象
+ label.setStyle({
+ color: "#F0F0F0",
+ fontSize: "12px",
+ padding: "5px",
+ whiteSpace: "normal",
+ backgroundColor: "rgba(0, 0, 0, 0)",
+ border: "0px"
+ });
+ var circle = new BMap.Circle(mPoint,1000,{fillColor:"#ee04e0", strokeWeight: 'hotKm-2' ,stroke:'#f8068f',fillOpacity: 0.2, strokeOpacity: 0.4});
+ map.addOverlay(circle);
+ map.addOverlay(label);
+ }
+
+ }
+ $('#select01').empty();
+ $.each(centerData,function(i,item){
+ $('#select01').append('')
+ });
+ //默认第一个
+ warningCount = centerData[0].title;
+ $("#select01").M_select({
+
+ "Title": centerData[0].title,
+ "inputName": "selected1_value",
+ // 默认选中的值(参数值写需要选中的select的value值)
+ "selected": "01",
+ Succee: function () {
+ warningCount = $("input[name='selected1_value']").attr('value');
+ //console.log($("input[name='selected1_value']").attr('value'));
+ }
+ });
+}
+//请求热点区域周边停车场
+function requestHotAreasParkLot(){
+ var req = [];
+ for(var i = 0; i < centerData.length; i++){
+ var hotpoiX=centerData[i].point.split(",")[0];
+ var hotpoiY=centerData[i].point.split(",")[1];
+ var hotKm=centerData[i].titkm;
+ var reqitem = {
+ sysCode:sysComm.sysCode,
+ radius:hotKm*1000,
+ longitude:hotpoiX,
+ latitude:hotpoiY
+ }
+ req.push(reqitem);
+ }
+
+ sysAjax({
+ method: "post",
+ url: dataUrl.util.getParkLotByHotSpot(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ async:false,
+ success: function(res){
+ if(res.code=='8888'){
+ var resultData = res.data;
+ //清空
+ parkData = {};
+ if(resultData.length<=0){
+ return;
+ }
+ for(var index in resultData){
+ var plNo = resultData[index].plNo;
+ var item = {
+ parkName:resultData[index].parkinglotName,
+ parkNo:resultData[index].plNo,
+ pointX:resultData[index].longitude,
+ pointY:resultData[index].latitude,
+ allnum:resultData[index].totalBerthNum
+ }
+ parkData[plNo]=item;
+ }
+ }
+ }
+ });
+}
+
+//请求热点区域周边停车场空闲车位
+function requestHotAreasFreeBerths(){
+ var plNos = [];
+ for(var plNo in parkData){
+ plNos.push(plNo);
+ }
+ var req= {
+ sysCode:sysComm.sysCode,
+ plNos:plNos
+ };
+
+ sysAjax({
+ method: "post",
+ url: dataUrl.util.queryParkFreeBerthsByPkNos(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ async:false,
+ success: function(res){
+ if(res.code=='8888'){
+ var resultData = res.data;
+ //清空
+ freeBerthData = {};
+ if(resultData.length<=0){
+ return;
+ }
+ for(var plNo in resultData){
+ freeBerthData[plNo]=resultData[plNo];
+ }
+ }
+ }
+ });
+
+
+ //第7步:绘制点
+ var newpoiX=null;//坐标
+ var newpoiY=null;
+ var parkNo=null;//编号
+ //修改颜色
+ for (var plNo in parkData) {
+ newpoiX=parkData[plNo].pointX;
+ newpoiY=parkData[plNo].pointY;
+ parkNo=parkData[plNo].parkNo;
+ var point = new BMap.Point(newpoiX,newpoiY);
+
+ var popAllnum =Number(parkData[plNo].allnum);
+ var popFree = Number(freeBerthData[plNo]);
+ var myIcon;
+ if( (popFree/popAllnum)== 0){
+ myIcon = new BMap.Icon("../img/parkicon_1.png",
+ new BMap.Size(24,28), {
+ offset: new BMap.Size(10, 28),
+ textColor: '#fff'
+ });
+ }else if((popFree/popAllnum)>0 && (popFree/popAllnum) <=0.3) {
+ myIcon = new BMap.Icon("../img/parkicon_2.png",
+ new BMap.Size(24,29), {
+ offset: new BMap.Size(10, 29),
+ textColor: '#fff'
+ });
+ }else if((popFree/popAllnum) > 0.3){
+ myIcon = new BMap.Icon("../img/parkicon_3.png",
+ new BMap.Size(24,29), {
+ offset: new BMap.Size(10, 29),
+ textColor: '#fff'
+ });
+ }
+ function parkiconBig(){
+ var popAllnum =Number(parkData[plNo].allnum);
+ var popFree = Number(freeBerthData[plNo]);
+ var that=this;
+ console.log(popAllnum+","+popFree);
+ if( (popFree/popAllnum)== 0){
+ myIcon = new BMap.Icon("../img/p-redbig.png",
+ new BMap.Size(30,36), {
+ offset: new BMap.Size(10, 36),
+ textColor: '#fff'
+ });
+ }else if((popFree/popAllnum)>0 && (popFree/popAllnum) <=0.3) {
+ myIcon = new BMap.Icon("../img/p-orangebig.png",
+ new BMap.Size(30,36), {
+ offset: new BMap.Size(10, 36),
+ textColor: '#fff'
+ });
+ }else if((popFree/popAllnum) > 0.3){
+ myIcon = new BMap.Icon("../img/p-greenbig.png",
+ new BMap.Size(30,36), {
+ offset: new BMap.Size(10, 36),
+ textColor: '#fff'
+ });
+ }
+ marker[plNo] = new BMap.Marker(point,{icon:myIcon});
+ map.addOverlay(marker[plNo]);
+ }
+ marker[plNo] = new BMap.Marker(point,{icon:myIcon});
+ map.addOverlay(marker[plNo]);
+
+ marker[plNo].parkNo=plNo;
+ marker[plNo].pointX=newpoiX;
+ marker[plNo].pointY=newpoiY;
+ marker[plNo].addEventListener("mouseover", function (n) {
+ var parkNo = n.target.parkNo;
+ var newpoiX=n.target.pointX;
+ var newpoiY=n.target.pointY;
+ addInfoWindow(parkNo,newpoiX,newpoiY);
+ //parkiconBig();
+ });
+ marker[plNo].addEventListener("mouseout", function () {
+ closeInfoWindow();
+ });
+ }
+}
+//判断是否已经点击过热点周边了,只点击一次
+var isClickedHotAreaParkLot = false;
+//热点周边
+function hotAreaParkLot(){
+ requestHotAreasFreeBerths();
+ if(isClickedHotAreaParkLot){
+ return;
+ }
+ isClickedHotAreaParkLot = true;
+ //查询空闲车位数
+ window.setInterval(function(){
+ requestHotAreasFreeBerths();
+ },1000*60*5);
+}
+
+
+function closeInfoWindow(){
+ $(".parkpop-content").css('display','none');
+}
+//停车场信息弹窗
+function addInfoWindow(parkNo,newpoiX,newpoiY) {
+ var parkNO=parkNo;
+ var poix=parkData[parkNO].pointX;
+ var poiy=parkData[parkNO].pointY;
+ var parkname = parkData[parkNO].parkName;
+ var freepop=Number(freeBerthData[parkNO]);
+ var allnumpop=Number(parkData[parkNO].allnum);
+ var point=new BMap.Point(poix,poiy);
+ $('.BMapLabel .parkpop-contenttop').empty();
+ var myLabel = new BMap.Label(''+
+ '
'+
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '
'+parkname+'
' +
+ '
',{offset:new BMap.Size(30,-85), //label的偏移量,为了让label的中心显示在点上
+ position:point});
+ myLabel.setStyle({
+ color: "#F0F0F0",
+ fontSize: "12px",
+ //height: "220px",
+ // width: "350px",
+ padding: "5px",
+ whiteSpace: "normal",
+ //fontFamily: "微软雅黑",
+ zIndex:"1000",
+ backgroundColor: "rgba(0, 0, 0, 0)",
+ border: "0px"
+ }
+
+ );
+ map.addOverlay(myLabel,point);
+ // map.panTo(new BMap.Point(poix,poiy));
+}
+//热点周边
+$("#opr_btn_t").on("click",function () {
+ hotAreaParkLot();
+});
+(function () {
+ //预警下发操作
+ $('#opr_btn_b').on('click',function () {
+ $('#dialog_wrap').show();
+ });
+ //弹窗关闭
+ $('#dialog_close').on('click',function () {
+ $('#inp_phohe_t').val('');
+ $('#inp_phohe_b').val('');
+ $('#inp_del').click();
+ $('#dialog_wrap').hide();
+ });
+
+ //添加
+ function add_fun() {
+ $('#hide_li').removeClass('hide_li');
+ $('#inp_add').hide();
+ };
+ $('#inp_add').on('click',function () {
+ add_fun();
+ });
+ //删除
+ function del_fun() {
+ $('#hide_li').addClass('hide_li');
+ $('#inp_add').show();
+ };
+ $('#inp_del').on('click',function () {
+ del_fun();
+ });
+
+ //确定事件
+ //失焦
+ $('#inp_phohe_t').on('blur',function () {
+ var mobile1 = $('#inp_phohe_t').val();
+ var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
+ if(mobile1){
+ if(!myreg.test(mobile1)){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('请输入正确的手机号');
+ }else {
+
+ $('#ifo_hint').text('');
+ }
+ }else{
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('');
+ return false;
+ }
+ });
+ $('#inp_phohe_b').on('blur',function () {
+ var mobile2 = $('#inp_phohe_b').val();
+ var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
+ if(mobile2){
+ if(!myreg.test(mobile2)){
+ $('#inp_phohe_b').focus();
+ $('#ifo_hint').text('请输入正确的手机号');
+ }else {
+
+ $('#ifo_hint').text('');
+ }
+ }else{
+ $('#inp_phohe_b').focus();
+ $('#ifo_hint').text('');
+ return false;
+ }
+ });
+ $('#sure_btn').on('click',function () {
+ var mobile1 = $('#inp_phohe_t').val();
+ var mobile2 = $('#inp_phohe_b').val();
+ var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
+ //判断第二个手机号是否出现
+ if($('#hide_li').hasClass('hide_li')){
+ //如果第二个手机号隐藏
+ //验证第一个手机号
+ if(mobile1){
+ if(!myreg.test(mobile1)){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('请输入正确的手机号');
+ }else {
+ $('#ifo_hint').text('');
+ //ajax mobile1
+
+ }
+ }else{
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('请输入手机号');
+ return false;
+ }
+ }else{
+ //如果第二个手机号出现
+
+ //都为空的情况
+ if(!mobile1&&!mobile2){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('请输入手机号');
+ return false;
+ };
+ //mobile1存在mobile2不存在
+ if(mobile1&&!mobile2){
+ if(!myreg.test(mobile1)){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('第一个手机号输入错误');
+ return false;
+ }else {
+ $('#ifo_hint').text('');
+ //ajax mobile1
+
+ }
+ };
+ //mobile2存在mobile1不存在
+ if(!mobile1&&mobile2){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('第一个手机号必须输入');
+ return false;
+ };
+ //mobile1和mobile2都存在
+ if(mobile1&&mobile2){
+ if(mobile1==mobile2){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('两个手机号不能相同');
+ return false;
+ }
+ if(!myreg.test(mobile1)){
+ $('#inp_phohe_t').focus();
+ $('#ifo_hint').text('第一个手机号输入错误');
+ return false;
+ }else if(!myreg.test(mobile2)){
+ $('#inp_phohe_b').focus();
+ $('#ifo_hint').text('第二个手机号输入错误');
+ return false;
+ }else{
+ $('#ifo_hint').text('');
+ //ajax mobile1 mobile2
+ }
+ };
+
+
+ };
+ if($('#ifo_hint').text()!=""){
+ return false;
+ }
+ //调用后台预警下发
+ var req= {
+ phones:[mobile1,mobile2],
+ content:warningCount+"附近停车拥挤,请前往疏导"
+ };
+ sysAjax({
+ method: "post",
+ url: dataUrl.util.smsWarningNotice(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType:'json',
+ success: function(res){
+ if(res.code=='8888'){
+ $('.dialog_wrap').css('display','none');
+ $('#myModal').modal('show');
+ setTimeout(function(){
+ $('#myModal').modal('hide');
+ },3000)
+ }
+ }
+ });
+
+ });
+
+ function init(){
+ //TODO 请求中心点
+ //请求热点区域
+ hotAreas();
+ //请求热点周边
+ requestHotAreasParkLot();
+ }
+
+ init();
+})();
diff --git a/js/pagejs/parkquery.js b/js/pagejs/parkquery.js
new file mode 100644
index 0000000..1d4b6d2
--- /dev/null
+++ b/js/pagejs/parkquery.js
@@ -0,0 +1,1212 @@
+/**
+ * Created by chenbiao on 2017/7/10.
+ */
+
+
+
+// 停车场查询
+$("#park-query").on("click", function () {
+ $(".park-query").addClass("park-active");
+ $(".parkquery-cont").css("display", "block");
+});
+
+//下拉框
+var clear_flag = false;
+(function ($) {
+ var ser_object2;
+ var ser_object2_img;
+ var radius_v;
+ jQuery.fn.extend({
+ "M_select": function (options) {
+ var ojc_arr = this;
+ var ojc;
+ // select下拉框
+ for (i = 0; i < ojc_arr.length; i++) {
+ var ser_object = $(ojc_arr[i]);
+ $(ser_object).parent().addClass("select-con");
+ $(ser_object).parent().css("z-index", "1");
+ $(ser_object).wrap("");
+ $(ser_object).parent().parent().append('');
+ var w = $(ser_object).parent().parent().width();
+ $(ser_object).parent().parent().find(".sel-float-box").css("width", w);
+ var ojc = $(ser_object).children();
+ for (a = 0; a < ojc.length; a++) {
+ var t = $(ojc[a]).text();
+ var v = $(ojc[a]).attr("value");
+ $(ser_object).parent().parent().find(".sel-float-box").append('' + t + '
');
+ }
+ ;
+
+ for (a = 0; a < ojc.length; a++) {
+
+ var sel_disabled = $(ojc[a]).attr("disabled");
+
+ if (sel_disabled == "disabled" || sel_disabled == "true") {
+ var div_ojc = $(ser_object).parent().parent().find('.sel-float-box').children();
+ $(div_ojc[a]).removeClass("sel-float-div");
+ $(div_ojc[a]).addClass("sel-float-div-disabled");
+
+ }
+ }
+ ;
+
+ var sel_textFirst = $(ser_object).parent().parent().find(".sel-float-box").children().eq(0).text();
+
+
+ // 默认参数
+ var defaultOption = {
+
+ ico: 1,
+ Img: "",
+ Img2: "",
+ Title: "",
+ inputName: "sel_v",
+ selected: "0",
+ radius: "0",
+ Succee: function () {
+ }
+
+ };
+ // 合并自定义参数和默认参数,出现相同属性名时自定义参数会覆盖默认参数
+ options = $.extend({}, defaultOption, options);
+
+ // 判断Test是否为空
+ if (options.Title) {
+ sel_textFirst = options.Title;
+
+ }
+ ;
+ $(ser_object).parent().parent().find(".sel-title").text(sel_textFirst);
+
+ // 判断使用哪种ico样式
+ var Img, Img2;
+ if (!(options.Img) && !(options.Img2)) {
+
+ if (options.ico == 1) {
+ Img = "./js/M_select/down1.png";
+ Img2 = "./js/M_select/up1.png";
+ }
+ if (options.ico == 2) {
+ Img = "./js/M_select/down2.png";
+ Img2 = "./js/M_select/up2.png";
+ }
+ if (options.ico == 3) {
+ Img = "./js/M_select/down3.png";
+ Img2 = "./js/M_select/up3.png";
+ }
+ if (options.ico == 4) {
+ Img = "./js/M_select/down4.png";
+ Img2 = "./js/M_select/up4.png";
+ }
+ if (options.ico == 5) {
+ Img = "./js/M_select/down5.png";
+ Img2 = "./js/M_select/up5.png";
+ }
+ } else if (!(options.Img) && (options.Img2 != null)) {
+ Img = options.Img2;
+ Img2 = options.Img2;
+ } else if (!(options.Img2) && (options.Img != null)) {
+ Img = options.Img;
+ Img2 = options.Img;
+ } else if ((options.Img != null) && (options.Img2 != null)) {
+ Img = options.Img;
+ Img2 = options.Img2;
+ }
+
+ // 可传参css
+// $(ser_object).parent().parent().find(".sel-sign").css("background","url("+Img+")");
+// $(ser_object).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ $(ser_object).parent().parent().find(".sel-box").append('');
+ //$(ser_object).parent().parent().find(".sel-box").css("border-radius",options.radius);
+ //$(ser_object).parent().parent().find(".sel-float-box").css("border-radius","0 0 "+options.radius +" "+options.radius+" ");
+
+ // 获取图片的高
+ var ico_h = $(ser_object).parent().parent().find(".sel-title-box").height();
+ // 设置图片的宽高
+// $(ser_object).parent().parent().find(".sel-sign").css({'width':+ico_h+'px','height':+ico_h+'px'});
+ $(ser_object).parent().parent().find(".sel-title-box").css("padding-right", "10px");
+
+ // 获取有多少个选项
+ var selLength = $(ser_object).parent().parent().find(".sel-float-box").children().length;
+ var selListHeight = $(ser_object).parent().parent().find(".sel-float-box").children().height();
+ // 获取选项的高度
+
+ var selHeight = selListHeight * 10;
+ // 隐藏下拉框
+ $(".sel-float-box").hide();
+ if (selLength > 10) {
+ $(ser_object).parent().parent().find(".sel-float-box").css("height", selHeight);
+ $(ser_object).parent().parent().find(".sel-float-box").css("overflow-y", "scroll");
+ }
+
+ // 根据selected 的值选中(即input value)
+ var input_val = $(ser_object).parent().parent().find(".inputHidden").attr("value");
+ var div_objoct = $(ser_object).parent().parent().find(".sel-float-div");
+ for (a = 0; a < div_objoct.length; a++) {
+
+ var div_val = $(div_objoct[a]).attr("value");
+ if (div_val == input_val) {
+ var div_text = $(div_objoct[a]).text();
+ $(ser_object).parent().parent().find(".sel-title").text(div_text);
+ }
+ ;
+ }
+ ;
+
+
+ // 点击事件
+ $(ser_object).parent().parent().find(".sel-title-box").on("click", function () {
+ // 切换图片
+// $(ser_object2).parent().parent().find(".sel-sign").css("background","url("+ser_object2_img+")");
+// $(ser_object2).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ //$(ser_object2).parent().css("border-radius",radius_v);
+ $('.sel-box').removeClass("on");
+ ser_object2 = this;
+ ser_object2_img = Img;
+ // 圆角值
+ radius_v = options.radius;
+
+ var floatAttr = $(this).parent().find(".sel-float-box").css("display");
+ if (floatAttr == "block") {
+ $(".sel-float-box").hide();
+ $(this).parent().find(".sel-float-box").hide();
+
+ $(this).parent().removeClass("on");
+ $(this).parent().find(".sel-float-box").removeClass("on");
+
+ //$(this).parent().css("border-radius",options.radius);
+ // 切换图片
+// $(this).parent().parent().find(".sel-sign").css("background","url("+Img+")");
+// $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ } else if (floatAttr == "none") {
+ // 切换图片
+// $(this).parent().parent().find(".sel-sign").css("background","url("+Img2+")");
+// $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ $(".sel-float-box").hide();
+ $(this).parent().find(".sel-float-box").show();
+
+ $(this).parent().addClass("on");
+ $(this).parent().find(".sel-float-box").addClass("on");
+
+ //$(this).parent().css("border-radius",options.radius+" "+options.radius+" 0 0");
+ }
+
+ });
+
+ // 选项点击事件
+ $(ser_object).parent().parent().find(".sel-float-div").on("click", function () {
+ var sel_text = $(this).text();
+ var sel_value = $(this).attr("value");
+ // 切换图片
+// $(this).parent().parent().find(".sel-sign").css("background","url("+Img+")");
+// $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+
+ $(this).parent().hide();
+ $(this).parent().parent().find(".sel-title").text(sel_text);
+ //$(this).parent().parent().css("border-radius",options.radius);
+
+ $(this).parent().parent().find(".sel-title").attr("value", sel_value);
+ var selected_value = $(this).parent().parent().find(".sel-title").attr("value");
+ $(this).parent().parent().find(".inputHidden").attr("value", selected_value);
+ var v;
+ var ojc_option = $(this).parent().parent().parent().find("option");
+ for (a = 0; a < ojc_option.length; a++) {
+
+ v = $(ojc_option[a]).attr("value");
+
+ if (v == selected_value) {
+ $(ojc_option).attr("selected", false);
+ $(ojc_option[a]).attr("selected", true);
+
+ }
+ }
+ ;
+ // 判断函数是否为空
+ if (options.Succee != null) {
+ options.Succee(selected_value);
+ }
+
+
+ });
+ }// for循环语句结束
+
+ },
+
+ });
+ // 点击其他位置下拉消失
+
+ $(document).on('click', function (e) {
+ var parent = $(e.target).parents('.select-con').length;
+ if (!parent) {
+ // // 切换图片
+// $(ser_object2).parent().parent().find(".sel-sign").css("background","url("+ser_object2_img+")");
+// $(ser_object2).parent().parent().find(".sel-sign").css("background-size","100% 100%");
+ //$(ser_object2).parent().css("border-radius",radius_v);
+ // console.log(ser_object2);
+ $('.sel-float-box').hide();
+ $('.sel-box').removeClass("on");
+ }
+ ;
+
+ });
+
+})(jQuery);
+//分页
+(function ($) {
+ $.fn.extendPagination = function (options) {
+ var defaults = {
+ //pageId:'',
+ totalCount: '',
+ showPage: '3',
+ limit: '5',
+ callback: function () {
+ return false;
+ }
+ };
+ $.extend(defaults, options || {});
+ if (defaults.totalCount == '') {
+ //alert('鎬绘暟涓嶈兘涓虹┖!');
+ $(this).empty();
+ return false;
+ } else if (Number(defaults.totalCount) <= 0) {
+ //alert('鎬绘暟瑕佸ぇ浜�0!');
+ $(this).empty();
+ return false;
+ }
+ if (defaults.showPage == '') {
+ defaults.showPage = '10';
+ } else if (Number(defaults.showPage) <= 0) defaults.showPage = '10';
+ if (defaults.limit == '') {
+ defaults.limit = '5';
+ } else if (Number(defaults.limit) <= 0) defaults.limit = '5';
+ var totalCount = Number(defaults.totalCount), showPage = Number(defaults.showPage),
+ limit = Number(defaults.limit), totalPage = Math.ceil(totalCount / limit);
+ if (totalPage > 0) {
+ var html = [];
+ html.push(' ');
+ $(this).html(html.join(''));
+ if (totalPage > showPage) $(this).find('ul.pagination li.next').prev().removeClass('hidden');
+
+ var pageObj = $(this).find('ul.pagination'), preObj = pageObj.find('li.previous'),
+ currentObj = pageObj.find('li').not('.previous,.disabled,.next'),
+ nextObj = pageObj.find('li.next');
+
+ function loopPageElement(minPage, maxPage) {
+ var tempObj = preObj.next();
+ for (var i = minPage; i <= maxPage; i++) {
+ if (minPage == 1 && (preObj.next().attr('class').indexOf('hidden')) < 0)
+ preObj.next().addClass('hidden');
+ else if (minPage > 1 && (preObj.next().attr('class').indexOf('hidden')) > 0)
+ preObj.next().removeClass('hidden');
+ if (maxPage == totalPage && (nextObj.prev().attr('class').indexOf('hidden')) < 0)
+ nextObj.prev().addClass('hidden');
+ else if (maxPage < totalPage && (nextObj.prev().attr('class').indexOf('hidden')) > 0)
+ nextObj.prev().removeClass('hidden');
+ var obj = tempObj.next().find('a');
+ if (!isNaN(obj.html())) obj.html(i);
+ tempObj = tempObj.next();
+ }
+ }
+
+ function callBack(curr) {
+ defaults.callback(curr, defaults.limit, totalCount);
+ }
+
+ currentObj.click(function (event) {
+ event.preventDefault();
+ var currPage = Number($(this).find('a').html()), activeObj = pageObj.find('li[class="active"]'),
+ activePage = Number(activeObj.find('a').html());
+ if (currPage == activePage) return false;
+ if (totalPage > showPage && currPage > 1) {
+ var maxPage = currPage, minPage = 1;
+ if (($(this).prev().attr('class'))
+ && ($(this).prev().attr('class').indexOf('disabled')) >= 0) {
+ minPage = currPage - 1;
+ maxPage = minPage + showPage - 1;
+ loopPageElement(minPage, maxPage);
+ } else if (($(this).next().attr('class'))
+ && ($(this).next().attr('class').indexOf('disabled')) >= 0) {
+ if (totalPage - currPage >= 1) maxPage = currPage + 1;
+ else maxPage = totalPage;
+ if (maxPage - showPage > 0) minPage = (maxPage - showPage) + 1;
+ loopPageElement(minPage, maxPage)
+ }
+ }
+ activeObj.removeClass('active');
+ $.each(currentObj, function (index, thiz) {
+ if ($(thiz).find('a').html() == currPage) {
+ $(thiz).addClass('active');
+ callBack(currPage);
+ }
+ });
+ });
+ preObj.click(function (event) {
+ event.preventDefault();
+ var activeObj = pageObj.find('li[class="active"]'), activePage = Number(activeObj.find('a').html());
+ if (activePage <= 1) return false;
+ if (totalPage > showPage) {
+ var maxPage = activePage, minPage = 1;
+ if ((activeObj.prev().prev().attr('class'))
+ && (activeObj.prev().prev().attr('class').indexOf('disabled')) >= 0) {
+ minPage = activePage - 1;
+ if (minPage > 1) minPage = minPage - 1;
+ maxPage = minPage + showPage - 1;
+ loopPageElement(minPage, maxPage);
+ }
+ }
+ $.each(currentObj, function (index, thiz) {
+ if ($(thiz).find('a').html() == (activePage - 1)) {
+ activeObj.removeClass('active');
+ $(thiz).addClass('active');
+ callBack(activePage - 1);
+ }
+ });
+ });
+ nextObj.click(function (event) {
+ event.preventDefault();
+ var activeObj = pageObj.find('li[class="active"]'), activePage = Number(activeObj.find('a').html());
+ if (activePage >= totalPage) return false;
+ if (totalPage > showPage) {
+ var maxPage = activePage, minPage = 1;
+ if ((activeObj.next().next().attr('class'))
+ && (activeObj.next().next().attr('class').indexOf('disabled')) >= 0) {
+ maxPage = activePage + 2;
+ if (maxPage > totalPage) maxPage = totalPage;
+ minPage = maxPage - showPage + 1;
+ loopPageElement(minPage, maxPage);
+ }
+ }
+ $.each(currentObj, function (index, thiz) {
+ if ($(thiz).find('a').html() == (activePage + 1)) {
+ activeObj.removeClass('active');
+ $(thiz).addClass('active');
+ callBack(activePage + 1);
+ }
+ });
+ });
+ }
+ };
+})(jQuery);
+var parkData = [
+
+];
+$(function () {
+ var checktext;
+ var checkText;
+ var fun = {
+ init: function () {
+ areapartition:{
+ // var data = ['1','2','3','4']
+
+ // $('#select01').empty();
+ // $.each(data,function(i,item){
+ // $('#select01').append('')
+ // });
+
+ var req = {
+ sysCode: sysComm.sysCode,
+ cityId: sysComm.cityId
+ };
+ var queryNextLowerLeverById = {
+ method: "post",
+ url: dataUrl.util.queryNextLowerLeverById(),
+ data: JSON.stringify(req),
+ contentType: 'application/json; charset=utf-8',
+ dataType: 'json',
+ success: function (res) {
+ if (res.code == '8888') {
+ var result = res.data;
+ // console.log(result);
+
+ $('#select01').empty();
+ $.each(result, function (i, item) {
+ for (var key in item) {
+ // console.log(key)
+ $('#select01').append('')
+ }
+ });
+ $("#select01").M_select({
+
+ "Title": "行政区划",
+ "inputName": "selected1_value",
+ // 默认选中的值(参数值写需要选中的select的value值)
+ "selected": "2703",
+ Succee: function () {
+ // console.log($("input[name='selected1_value']").attr('value'));
+ checkText = $(".sel-title").eq(0).text();
+ if (checkText == "全部") {
+ checktext = sysComm.cityName
+ } else if (checkText == "其他") {
+ //map.clearOverlays();
+ checktext = sysComm.cityName;
+ } else {
+ checktext = sysComm.cityName + checkText;
+ }
+ getBoundary(checktext);
+ serfun();
+ }
+ });
+ getBoundary(sysComm.areaName);
+ serfun();
+ map.centerAndZoom(point, 15);
+
+ }
+ }
+ };
+ sysAjax(queryNextLowerLeverById);
+
+
+ }
+ ;
+
+ leadlevel:{
+
+ // $('#select02').empty();
+ // $.each(data,function(i,item){
+ // $('#select02').append('')
+ // });
+
+ $("#select02").M_select({
+ "Title": "诱导级别",
+ "inputName": "selected2_value",
+ // 默认选中的值(参数值写需要选中的select的value值)
+ "selected": "",
+ Succee: function () {
+ // console.log($("input[name='selected2_value']").attr('value'));
+ serfun();
+ }
+ });
+ //alert($("input[name='selected_value']").attr('value'))
+ }
+
+ },
+ }
+ fun.init();
+ //动态计算高度
+ function list_wrap_height() {
+ var topHeight = $("#list_wrap").offset().top;
+ var clientHeight = $(window).height();
+ // console.log(clientHeight - topHeight);
+ var list_wrap_height = clientHeight - topHeight - 100 + 'px'
+ $("#list_wrap").css('height', list_wrap_height);
+ //$('#ascrail2000')
+ $('#list_wrap').perfectScrollbar('destroy');
+ $('#list_wrap').perfectScrollbar();
+ console.log('1111')
+ };
+ window.onresize = function () {
+ if ($('#list_con > li').length > 2) {
+ list_wrap_height();
+ }
+ };
+ //创建搜索html
+ function createHtml(data) {
+
+ //存在行政区划才会有诱导出现
+
+ $('#guide_con').show();
+
+ $('#list_wrap').show();
+ //计算 $('#list_wrap')自适应高度
+ if ($('#list_con >li').length > 2) {
+ // alert()
+
+ list_wrap_height();
+ } else {
+ $('#list_wrap').css('height', 'auto');
+ // $('#list_wrap').perfectScrollbar('destroy');
+ // $('#list_wrap').perfectScrollbar();
+ }
+
+ // console.log('请求数据ajax');
+ }
+
+ //默认加载数据
+ //serfun();
+ //搜索
+ //调接口后删除str
+ // list_wrap_height();
+ //调接口后删除end
+ function serfun() {
+ var total = 0;
+ $("#guide_total_number").html(total);
+ var ser_text = $.trim($('#ser_text').val());
+ var area_text = $("input[name='selected1_value']").attr('value');
+ // var level_text = $("input[name='selected2_value']").attr('value');
+ if (ser_text || area_text) {
+ var countryId = [];
+
+ if (area_text) {
+ countryId = area_text.split(',');
+ }
+ //绘制地图上的点
+ initMapPoint();
+ var req = {
+ sysCode: sysComm.sysCode,
+ cityId: sysComm.cityId,
+ parkNameOrAddress: ser_text,
+ countryId: countryId,
+ baseRequest: {
+ pageNum: 1,
+ pageSize: 10
+ }
+ }
+ var opt = {
+ method: "post",
+ data: JSON.stringify(req),
+ url: dataUrl.util.queryParkLotByCountryAndParkName(),
+ success: function (res, xhr, status) {
+ console.log(res)
+ //清空内容
+ $("#list_con").html('');
+ if (res.code == '8888') {
+
+ initParkListHtml(res.data);
+
+ total = res.data.pageTotals == undefined || null == res.data.pageTotals ? 0 : res.data.pageTotals;
+ createHtml();
+ //分页插件
+ $('#callBackPager').extendPagination({
+ totalCount: total,
+ limit: 10,
+ callback: function (curr, limit, totalCount) {
+ queryParkLotByCountryAndParkName(curr, limit, area_text, ser_text);
+ createHtml()
+
+ }
+ });
+
+
+ }
+ }
+ }
+ sysAjax(opt);
+ //createHtml();
+ }
+ }
+
+
+ function initMapPoint() {
+ parkData = [];
+ var ser_text = $.trim($('#ser_text').val());
+ var area_text = $("input[name='selected1_value']").attr('value');
+ // var level_text = $("input[name='selected2_value']").attr('value');
+ if (ser_text || area_text) {
+ var countryId = [];
+
+ if (area_text) {
+ countryId = area_text.split(',');
+ }
+
+ var req = {
+ sysCode: sysComm.sysCode,
+ parkNameOrAddress: ser_text,
+ countryId: countryId,
+ }
+
+ var opt = {
+ method: "post",
+ data: JSON.stringify(req),
+ url: dataUrl.util.queryParkingLotGeoByCountryAndParkName(),
+ success: function (res, xhr, status) {
+
+ if (res.code == '8888') {
+ var list = res.data;
+ if (null == list || list.length == 0) {
+ list = [];
+ }
+
+ $.each(list, function (index, item) {
+ var point = {};
+ point.parkNo = item.plNo;
+ point.pointX = item.lonId;
+ point.pointY = item.latId;
+ point.allnum = item.plBerthNum;
+ point.free = item.freeBrethNum;
+ point.parkName = item.plName;
+ parkData.push(point);
+ });
+ drawMarker();
+
+
+ }
+
+
+ }
+
+ }
+
+ sysAjax(opt)
+
+ }
+ }
+
+
+ //根据区县名称及搜索框查询停车场信息
+ function queryParkLotByCountryAndParkName(pageNum, pageSize, countryIds, searchText) {
+ pageNum = pageNum == undefined || null == pageNum ? 1 : pageNum;
+ pageSize = pageSize == undefined || null == pageSize ? 10 : pageSize;
+ var req = {
+ sysCode: sysComm.sysCode,
+ cityId: sysComm.cityId,
+ parkNameOrAddress: searchText,
+ countryId: countryIds.split(','),
+ baseRequest: {
+ pageNum: pageNum,
+ pageSize: pageSize
+ }
+ }
+
+ var opt = {
+ method: "post",
+ data: JSON.stringify(req),
+ url: dataUrl.util.queryParkLotByCountryAndParkName(),
+ success: function (res, xhr, status) {
+ if (res.code == '8888') {
+ initParkListHtml(res.data);
+ }
+ }
+ }
+ sysAjax(opt);
+ }
+
+ function initParkListHtml(data) {
+ //清空列表内容
+ $("#list_con").html('');
+ //清空详细信息内容
+ $(".parkquery-cont").find(".detail-cont").remove();
+ var total = data.pageTotals == undefined || null == data.pageTotals ? 0 : data.pageTotals;
+ var list = data.dataList == undefined || data.dataList == null ? [] : data.dataList;
+ $("#guide_total_number").html(total);
+
+ $('#guide_total').show();
+ //隐藏未查询到检索数据提示
+ $('#nodataInfo').hide();
+ $('#callBackPager').css({'border-top': '1px solid #1c83f6'})
+ if (0 == total) {
+ if (clear_flag) {
+ markerClusterer.clearMarkers(); //此步骤需要
+ }
+ //展示未查询到检索数据提示
+ $('#nodataInfo').show();
+ $('#guide_total').hide();
+ $('#callBackPager').css({'border-top': '0'})
+ }
+
+
+ var html = '';
+ var detailHtml = ''
+ $.each(list, function (index, item) {
+ var parkType;
+ if (1 == item.plType) {
+ parkType = '路内'
+ } else if (2 == item.plType) {
+ parkType = '路外'
+ } else {
+ parkType = '未知'
+ }
+ var plRate = parsePlRate(item.plRate);
+ html += '' +
+ '' + item.lonId + '' +
+ '' + item.latId + '' +
+ '' + item.plNo + '' +
+
+ '' + item.plName + '' +
+ '' + item.freeBrethNum + '' +
+ '' + item.plBerthNum + '' +
+ '' +
+ '- ' + (index + 1) + '.' + item.plName + '
' +
+ '- 类型:' + parkType + '
' +
+ '- 车位总数:' + item.plBerthNum + '
' +
+ '
';
+
+ detailHtml += '' +
+ '
' +
+ '
' +
+ '名称' + item.plName + '' +
+ '返回' +
+ '
' +
+ '
' +
+ '类型' + parkType + '' +
+ '
' +
+ '
' +
+ '车位总数' + item.plBerthNum + '' +
+ '
' +
+ '
' +
+ '商圈属性' +
+ '
' +
+ '
' +
+ '使用设备道闸、地磁' +
+ '
' +
+ '
' +
+ '出入口数' + item.plExitNum + '出' + item.plEntranceNum + '入' +
+ '
' +
+ '
' +
+ '
收费标准
' +
+ '
' +
+ '' +
+ '车型 | ' +
+ '小型车 | ' +
+ '大型车 | ' +
+ '
' +
+ '' +
+ '首小时 | ' +
+ '' + plRate[0].first + '元 | ' +
+ '' + plRate[1].first + '元 | ' +
+ '
' +
+ '' +
+ '1小时以上 | ' +
+ '' + plRate[0].second + '元/半小时 | ' +
+ '' + plRate[1].second + '元/半小时 | ' +
+ '
' +
+ '' +
+ '24小时最高 | ' +
+ '' + plRate[0].four + '元 | ' +
+ '' + plRate[1].four + '元 | ' +
+ '
'
+
+
+ detailHtml += '
';
+
+
+ })
+ $("#list_con").append(html);
+ $(".parkquery-cont").append(detailHtml);
+ createHtml();
+ }
+
+
+ function parsePlRate(plRate) {
+ if (null == plRate) {
+ return [];
+ }
+ var plRateData = JSON.parse(plRate);
+ var result = [];
+ var patrn = /\d+(\.\d+)?/g;
+ $.each(plRateData, function (index, item) {
+ var temp = item.standard;
+ var data = {};
+ data.carType = temp.substring(0, temp.indexOf(":"));
+ var nums = temp.match(patrn);
+ data.first = nums[0];//第一小时10元
+ data.second = nums[1];//后1.5元/半小时
+ temp = item.standardInfo;
+ nums = temp.match(patrn);
+ data.third = nums[0];//24小时
+ data.four = nums[1];//60元
+ result.push(data);
+ })
+
+
+ return result;
+ }
+
+ $(document).on('click','#ser_btn', function () {
+ checkText = $(".sel-title").eq(0).text();
+ var serText=$.trim($(".ser_text").val());
+ if (checkText == "全部") {
+ checktext = sysComm.cityName
+ } else if (checkText == "其他") {
+ //map.clearOverlays();
+ checktext = sysComm.cityName;
+ } else {
+ checktext = sysComm.cityName + checkText;
+ }
+ if(serText!=""&&serText!=null&&serText!=undefined){
+ serfun();
+
+ }else{
+ getBoundary(checktext);
+ serfun();
+
+ }
+
+ });
+
+
+ /*
+ * 初始化加载页面-默认展示红山区的信息。
+ */
+ //加载查询条件
+ $(".park-query").addClass("park-active");
+ $(".parkquery-cont").css("display", "block");
+ //加载查询
+ serfun();
+
+});
+
+
+$(document).on('click', '.cont-callback', function () {
+ $('.detail-cont').hide();
+ $('#list_wrap').show();
+})
+//地图调用部分
+var map; //Map实例
+//后台传过来
+
+map = new BMap.Map('allmap', {enableMapClick: false});
+//第1步:设置地图中心点,当前城市
+var point = new BMap.Point(sysComm.point_lng,sysComm.point_lat);
+//第2步:初始化地图,设置中心点坐标和地图级别。
+map.centerAndZoom(point, 13);
+//map.setCurrentCity(sysComm.cityName); // 设置地图显示的城市 此项是必须设置的
+//第3步:启用滚轮放大缩小
+map.enableScrollWheelZoom(true);
+//第4步:向地图中添加缩放控件
+var ctrlNav = new window.BMap.NavigationControl({
+ // 靠右上角位置
+ anchor: BMAP_ANCHOR_TOP_RIGHT,
+ // LARGE类型
+ type: BMAP_NAVIGATION_CONTROL_ZOOM,
+ //偏离值
+ offset: new BMap.Size(25, 80)
+});
+map.addControl(ctrlNav);
+//第5步:设置地图风格
+//第5步:设置地图风格
+map.setMapStyle({
+ styleJson: [
+ {
+ "featureType": "background",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#0a0906"
+ }
+ },
+ {
+ "featureType": "building",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#444444"
+ }
+ },
+ {
+ "featureType": "local",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#ff9900",
+ "weight": "0.1"
+ }
+ },
+ {
+ "featureType": "road",
+ "elementType": "all",
+ "stylers": {
+ "color": "#9b780e",
+ "weight": "0.1",
+ "saturation": -21,
+ "visibility": "on"
+ }
+ },
+ {
+ "featureType": "green",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#344222",
+ "saturation": -20
+ }
+ },
+ {
+ "featureType": "water",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#163e5a"
+ }
+ },
+ {
+ "featureType": "subway",
+ "elementType": "all",
+ "stylers": {
+ "color": "#ff9900",
+ "saturation": -39
+ }
+ },
+ {
+ "featureType": "railway",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#ff9900"
+ }
+ },
+ {
+ "featureType": "all",
+ "elementType": "labels.text.stroke",
+ "stylers": {
+ "color": "#313131"
+ }
+ },
+ {
+ "featureType": "all",
+ "elementType": "labels.text.fill",
+ "stylers": {
+ "color": "#8b8787"
+ }
+ },
+ {
+ "featureType": "manmade",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#1b1b1b"
+ }
+ },
+ {
+ "featureType": "highway",
+ "elementType": "geometry",
+ "stylers": {
+ "lightness": -75,
+ "saturation": -91
+ }
+ },
+ {
+ "featureType": "subway",
+ "elementType": "geometry",
+ "stylers": {
+ "lightness": -65
+ }
+ },
+ {
+ "featureType": "railway",
+ "elementType": "geometry",
+ "stylers": {
+ "color": "#000000",
+ "weight": "1",
+ "lightness": -40,
+ "saturation": 1
+ }
+ }
+ ]
+});
+
+//第6步:检测浏览器兼容
+function checkhHtml5() {
+ if (typeof(Worker) === "undefined") {
+ if (navigator.userAgent.indexOf("MSIE 9.0") <= 0) {
+ alert("定制个性地图示例:IE9以下不兼容,推荐使用百度浏览器、chrome、firefox、safari、IE10");
+ }
+
+ }
+}
+checkhHtml5();
+
+
+function drawMarker() {
+ //清除以前的点位
+ //map.clearOverlays();
+ //第7步:绘制点
+ var marker = [];
+ var newpoiX = null;//坐标
+ var newpoiY = null;
+ var parkNo = null;//编号
+ var popAllnum = null;//停车场车位总数
+ var popFree = null;//空闲车位
+ var parkName = null;//停车场名称
+
+ for (var i = 0; i < parkData.length; i++) {
+ newpoiX = parkData[i].pointX;
+ newpoiY = parkData[i].pointY;
+ parkNo = parkData[i].parkNo;
+ popAllnum = parkData[i].allnum;
+ popFree = parkData[i].free;
+ parkName = parkData[i].parkName;
+ var point = new BMap.Point(newpoiX, newpoiY);
+ if ((popFree / popAllnum) == 0) {
+ var myIcon = new BMap.Icon("../img/parkicon_1.png",
+ new BMap.Size(24, 28), {
+ offset: new BMap.Size(10, 28),
+ textColor: '#fff'
+ });
+ marker[i] = new BMap.Marker(point, {icon: myIcon});
+ map.addOverlay(marker[i]);
+ } else if ((popFree / popAllnum) > 0 && (popFree / popAllnum) <= 0.3) {
+ var myIcon2 = new BMap.Icon("../img/parkicon_2.png",
+ new BMap.Size(24, 29), {
+ offset: new BMap.Size(10, 29),
+ textColor: '#fff'
+ });
+ marker[i] = new BMap.Marker(point, {icon: myIcon2});
+ map.addOverlay(marker[i]);
+
+ } else if ((popFree / popAllnum) > 0.3) {
+ var myIcon3 = new BMap.Icon("../img/parkicon_3.png",
+ new BMap.Size(24, 29), {
+ offset: new BMap.Size(10, 29),
+ textColor: '#fff'
+ });
+ marker[i] = new BMap.Marker(point, {icon: myIcon3});
+ map.addOverlay(marker[i]);
+
+ }
+
+ marker[i].parkNo = parkData[i].parkNo;
+ marker[i].newpoiX = parkData[i].pointX;
+ marker[i].newpoiY = parkData[i].pointY;
+ marker[i].Allnum = parkData[i].allnum;
+ marker[i].Free = parkData[i].free;
+ marker[i].parkName = parkData[i].parkName;
+
+ marker[i].addEventListener("mouseover", function (n) {
+
+ var newpoiY = n.target.newpoiY;
+ var parkNo = n.target.parkNo;
+ var parkName = n.target.parkName;
+ var newpoiX = n.target.newpoiX;
+ var freepop = Number(n.target.Free);
+ var allnumpop = Number(n.target.Allnum);
+ var req = {
+ sysCode: sysComm.sysCode,
+ cityId: sysComm.cityId,
+ plNos: [parkNo]
+ }
+
+ var opt = {
+ method: "post",
+ data: JSON.stringify(req),
+ url: dataUrl.util.queryParkFreeBerthsByPkNos(),
+ success: function (res, xhr, status) {
+ if (res.code == '8888') {
+ freepop = res.data[parkNo];
+ addInfoWindow(parkNo, newpoiX, newpoiY,parkName, freepop, allnumpop)
+ }
+ }
+ }
+ sysAjax(opt);
+ });
+ marker[i].addEventListener("mouseout", function () {
+ closeInfoWindow();
+ })
+ }
+ removeCluster(marker);
+}
+function removeCluster(marker) {
+ if (clear_flag) {
+ markerClusterer.clearMarkers(); //此步骤需要
+ }
+ markerClusterer = new BMapLib.MarkerClusterer(map,
+ {
+ markers: marker,
+ styles: [{
+ url: '../img/parkicon_culter.png',
+ size: new BMap.Size(68, 67),
+ zIndex:0
+ }],
+ });
+ markerClusterer.setMaxZoom(13);
+ clear_flag = true;
+}
+
+
+function closeInfoWindow() {
+ $(".parkpop-content").css('display', 'none');
+}
+//停车场信息弹窗
+function addInfoWindow(parkNo, newpoiX, newpoiY, parkName, freepop, allnumpop) {
+
+ $('.BMapLabel').empty();
+ var parkNo = parkNo;
+ var poix = newpoiX;
+ var poiy = newpoiY;
+ var freepop = freepop;
+ var allnumpop = allnumpop;
+ var point = new BMap.Point(poix, poiy);
+ var myLabel = new BMap.Label('' +
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '
' + parkName + '
' +
+ '
', {
+ offset: new BMap.Size(30, -85), //label的偏移量,为了让label的中心显示在点上
+ position: point
+ });
+
+ myLabel.setStyle({
+ color: "#F0F0F0",
+ fontSize: "12px",
+ padding: "5px",
+ whiteSpace: "normal",
+ backgroundColor: "rgba(0, 0, 0, 0)",
+ border: "0px",
+ zIndex: "1000"
+ }
+ );
+ map.addOverlay(myLabel);
+ $('.parkpop-content').parent().parent().css('z-index',99999999)
+}
+drawMarker();
+//当前行政区域划分
+function getBoundary(name) {
+ var bdary = new BMap.Boundary();
+ map.clearOverlays();
+ bdary.get(name, function (rs) {
+ // console.log(name)//获取行政区域
+ // console.log(rs)
+ var count = rs.boundaries.length; //行政区域的点有多少个
+ if (count === 0) {
+ alert('未能获取当前输入行政区域');
+ return;
+ }
+ var pointArray = [];
+ for (var i = 0; i < count; i++) {
+
+ var ply = new BMap.Polygon(rs.boundaries[i], {
+ strokeWeight: 2,
+ strokeColor: "#ee07db",
+ fillColor: '',
+ fillOpacity: 0
+ }); //建立多边形覆盖物
+ map.addOverlay(ply); //添加覆盖物
+ pointArray = pointArray.concat(ply.getPath());
+ }
+ map.setViewport(pointArray); //调整视野
+
+ });
+}
+// 获取位置
+function theLocation(x, y, parkNo) {
+
+ var new_point = new BMap.Point(x, y);
+ map.centerAndZoom(new_point, 15);
+ map.panTo(new_point);
+ // console.log(x + "," + y + "," + parkNo)
+
+}
+//点击停车场列表跳转至停车场详情页
+$(document).on('click', '#list_con >li', function () {
+ // console.log($(this).parent().parent().css);
+ var x = $(this).find('.coordinate_x').text();
+ var y = $(this).find('.coordinate_y').text();
+ var parkNo = $(this).find(".coordinate_plNo").text();
+
+ var coordinate_plName = $(this).find(".coordinate_plName").text();
+ var coordinate_freeBrethNum = $(this).find(".coordinate_freeBrethNum").text();
+ var coordinate_plBerthNum = $(this).find(".coordinate_plBerthNum").text();
+ var dom = '#detail-cont_' + parkNo;
+ $('#list_wrap').hide();
+ $(dom).show();
+ theLocation(x, y, parkNo);
+ addInfoWindow(parkNo, x, y,coordinate_plName,coordinate_freeBrethNum,coordinate_plBerthNum);
+ //addInfoWindow(parkNo, newpoiX, newpoiY,parkName, freepop, allnumpop)
+})
+
+$('#cont-callback').on('click', function () {
+
+ $('#detail-cont').css("display", "none");
+ $('#list_wrap').css("display", "block");
+ drawMarker();
+})
+
diff --git a/pages/dataanalysis.html b/pages/dataanalysis.html
new file mode 100644
index 0000000..96aacac
--- /dev/null
+++ b/pages/dataanalysis.html
@@ -0,0 +1,366 @@
+
+
+
+
+ 数据分析
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 数据分析
+
+
+ - 停车轨迹
+ - 车主画像
+ - 车辆分析
+ - 套牌分析
+ - 违停分析
+
+
+