liuzhen лет назад: 5
Родитель
Сommit
f42395159e

+ 11 - 11
WebChart/index.html

@@ -185,7 +185,7 @@
185 185
 									</div>
186 186
 									
187 187
 									
188
-									<div class="quanbgBox1 quan_SYQ ani map_click"  index="睢阳区" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
188
+									<div class="quanbgBox1 quan_SYQ ani map_click"  data_index='2' index="睢阳区" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
189 189
 										<div class="quanbg">
190 190
 											<span class="quan quan1 quan1a "></span>
191 191
 											<span class="quan quan2 quan2a "></span>
@@ -198,7 +198,7 @@
198 198
 										<span class="txt txt_SYQ">睢阳区</br><span class="SYQ_num"></span></span>
199 199
 									</div>
200 200
 									
201
-									<div class="quanbgBox1 quan_MQ ani map_click" index="民权县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
201
+									<div class="quanbgBox1 quan_MQ ani map_click" data_index='5' index="民权县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
202 202
 										<div class="quanbg">
203 203
 											<span class="quan quan1 quan1a "></span>
204 204
 											<span class="quan quan2 quan2a "></span>
@@ -211,7 +211,7 @@
211 211
 										<span class="txt txt_MQ">民权县</br><span class="MQ_num"></span></span>
212 212
 									</div>
213 213
 									
214
-									<div class="quanbgBox1 quan_SX ani map_click" index="睢县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
214
+									<div class="quanbgBox1 quan_SX ani map_click" data_index='6' index="睢县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
215 215
 										<div class="quanbg">
216 216
 											<span class="quan quan1 quan1a "></span>
217 217
 											<span class="quan quan2 quan2a "></span>
@@ -224,7 +224,7 @@
224 224
 										<span class="txt txt_SX">睢县</br><span class="SX_num"></span></span>
225 225
 									</div>
226 226
 									
227
-									<div class="quanbgBox1 quan_NL ani map_click" index="宁陵县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
227
+									<div class="quanbgBox1 quan_NL ani map_click" data_index='7' index="宁陵县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
228 228
 										<div class="quanbg">
229 229
 											<span class="quan quan1 quan1a "></span>
230 230
 											<span class="quan quan2 quan2a "></span>
@@ -237,7 +237,7 @@
237 237
 										<span class="txt txt_NL">宁陵县</br><span class="NL_num"></span></span>
238 238
 									</div>
239 239
 									
240
-									<div class="quanbgBox1 quan_LYQ ani map_click" index="梁园区" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
240
+									<div class="quanbgBox1 quan_LYQ ani map_click" data_index='3' index="梁园区" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
241 241
 										<div class="quanbg">
242 242
 											<span class="quan quan1 quan1a "></span>
243 243
 											<span class="quan quan2 quan2a "></span>
@@ -250,7 +250,7 @@
250 250
 										<span class="txt txt_LYQ">梁园区</br><span class="LYQ_num"></span></span>
251 251
 									</div>
252 252
 									
253
-									<div class="quanbgBox1 quan_KFQ ani map_click" index="城乡一体化示范区" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
253
+									<div class="quanbgBox1 quan_KFQ ani map_click" data_index='11' index="城乡一体化示范区" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
254 254
 										<div class="quanbg">
255 255
 											<span class="quan quan1 quan1a "></span>
256 256
 											<span class="quan quan2 quan2a "></span>
@@ -263,7 +263,7 @@
263 263
 										<span class="txt txt_KFQ">示范区</br><span class="KFQ_num"></span></span>
264 264
 									</div>
265 265
 									
266
-									<div class="quanbgBox1 quan_ZC ani map_click" index="柘城县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
266
+									<div class="quanbgBox1 quan_ZC ani map_click" data_index='8' index="柘城县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
267 267
 										<div class="quanbg">
268 268
 											<span class="quan quan1 quan1a "></span>
269 269
 											<span class="quan quan2 quan2a "></span>
@@ -276,7 +276,7 @@
276 276
 										<span class="txt txt_ZC">柘城县</br><span class="ZC_num"></span></span>
277 277
 									</div>
278 278
 									
279
-									<div class="quanbgBox1 quan_YCX ani map_click" index="虞城县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
279
+									<div class="quanbgBox1 quan_YCX ani map_click" data_index='9' index="虞城县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
280 280
 										<div class="quanbg">
281 281
 											<span class="quan quan1 quan1a "></span>
282 282
 											<span class="quan quan2 quan2a "></span>
@@ -289,7 +289,7 @@
289 289
 										<span class="txt txt_YCX">虞城县</br><span class="YCX_num"></span></span>
290 290
 									</div>
291 291
 									
292
-									<div class="quanbgBox1 quan_XYX ani map_click" index="夏邑县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
292
+									<div class="quanbgBox1 quan_XYX ani map_click" data_index='10' index="夏邑县" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
293 293
 										<div class="quanbg">
294 294
 											<span class="quan quan1 quan1a "></span>
295 295
 											<span class="quan quan2 quan2a "></span>
@@ -302,7 +302,7 @@
302 302
 										<span class="txt txt_XYX">夏邑县</br><span class="XYX_num"></span></span>
303 303
 									</div>
304 304
 									
305
-									<div class="quanbgBox1 quan_YCS ani map_click"  index="永城市" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
305
+									<div class="quanbgBox1 quan_YCS ani map_click"  data_index='4' index="永城市" swiper-animate-effect="showTxt" swiper-animate-duration=".5s" swiper-animate-delay="3.5s">
306 306
 										<div class="quanbg">
307 307
 											<span class="quan quan1 quan1a "></span>
308 308
 											<span class="quan quan2 quan2a "></span>
@@ -566,7 +566,7 @@
566 566
 		<script src="js/setItervalTime.js"></script>
567 567
 		<script src="js/pieChat.js"></script>
568 568
 		<script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
569
-		<script src="js/map.js"></script>
569
+		<script src="js/map1.js"></script>
570 570
 	</body>
571 571
 
572 572
 </html>

+ 51 - 23
WebChart/js/map1.js

@@ -1,4 +1,6 @@
1
-var mapAdree=""
1
+var mapAdree="";
2
+var data_index='';
3
+var pointArray=[];
2 4
 window.onload = function() {
3 5
 	
4 6
 	//键盘登录事件
@@ -30,9 +32,28 @@ window.onload = function() {
30 32
 	//市区选择控件
31 33
 	$('.map_click').click(function(obj) {
32 34
 		mapAdree=$(this).attr("index")
35
+		data_index=$(this).attr('data_index');
33 36
 		earth();
34 37
 	});
35
-	throungh()
38
+	//数据为空加载地图
39
+	function mapLoad(){
40
+		var city = '商丘市';
41
+		// 创建地址解析器实例
42
+		var address = '河南省商丘'+mapAdree;
43
+		var myGeo = new BMap.Geocoder();
44
+		myGeo.getPoint(address, function(point) {
45
+			if(point) {
46
+				//定位到区 ,级别显示12
47
+				map.centerAndZoom(point, 12);
48
+				map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
49
+				//删除选点
50
+				map.clearOverlays();
51
+			} else {
52
+				// alert("您选择地址没有解析到结果!");
53
+			}
54
+		}, city);
55
+	}
56
+//	throungh()
36 57
 	function throungh() {
37 58
 		$.ajax({
38 59
 			type: "get",
@@ -41,23 +62,27 @@ window.onload = function() {
41 62
 			dataType: 'json',
42 63
 			data: {
43 64
 				token: $.cookie("token"),
44
-				start:$('#starttime').val() && $('#starttime').val().split(' ~ ')[0], //=开始时间
45
-				end:$('#starttime').val() && $('#starttime').val().split(' ~ ')[1], //=结束时间
46
-				sourcearea:$('#sourceAreas').val()
65
+				start:$('#time1').val() && $('#time1').val().split(' ~ ')[0], //=开始时间
66
+				end:$('#time1').val() && $('#time1').val().split(' ~ ')[1], //=结束时间
67
+//				sourcearea:$('#sourceAreas').val()
68
+				sourcearea:data_index
47 69
 			},
48 70
 			success: function(result) {
49 71
 				if(result.state.toLowerCase() == "success") {
50 72
 					json_data = result.data;
51
-					for(var i = 0; i < json_data.length; i++) {
52
-						var marker = new BMap.Marker(new BMap.Point(json_data[i][0], json_data[i][1])); // 创建点
53
-						map.addOverlay(marker); //增加点
54
-						pointArray[i] = new BMap.Point(json_data[i][0], json_data[i][1]);
55
-						var content = json_data[i][2];
56
-						addClickHandler(content, marker);
57
-						//让所有点在视野范围内
58
-						map.setViewport(pointArray);
73
+					if(json_data.length==0){
74
+						mapLoad();
75
+					}else{
76
+						for(var i = 0; i < json_data.length; i++) {
77
+							var marker = new BMap.Marker(new BMap.Point(json_data[i][0], json_data[i][1])); // 创建点
78
+							map.addOverlay(marker); //增加点
79
+							pointArray[i] = new BMap.Point(json_data[i][0], json_data[i][1]);
80
+							var content = json_data[i][2];
81
+							addClickHandler(content, marker);
82
+							//让所有点在视野范围内
83
+							map.setViewport(pointArray);
84
+						}
59 85
 					}
60
-					console.log(json_data)
61 86
 				}
62 87
 			}
63 88
 		})
@@ -86,6 +111,7 @@ window.onload = function() {
86 111
 		//地图加载完成后加载数据
87 112
 		callback();
88 113
 	}
114
+//	var pointArray=[];
89 115
 	//市区下拉框选择事件
90 116
 	function earth() {
91 117
 		$(".map_bg").hide();
@@ -103,15 +129,16 @@ window.onload = function() {
103 129
 					map.centerAndZoom(point, 12);
104 130
 					//删除选点
105 131
 					map.clearOverlays();
106
-					for(var i = 0; i < json_data.length; i++) {
107
-						var marker = new BMap.Marker(new BMap.Point(json_data[i][0], json_data[i][1])); // 创建点
108
-						map.addOverlay(marker); //增加点
109
-						pointArray[i] = new BMap.Point(json_data[i][0], json_data[i][1]);
110
-						var content = json_data[i][2];
111
-						addClickHandler(content, marker);
112
-					}
132
+					throungh();
133
+//					for(var i = 0; i < json_data.length; i++) {
134
+//						var marker = new BMap.Marker(new BMap.Point(json_data[i][0], json_data[i][1])); // 创建点
135
+//						map.addOverlay(marker); //增加点
136
+//						pointArray[i] = new BMap.Point(json_data[i][0], json_data[i][1]);
137
+//						var content = json_data[i][2];
138
+//						addClickHandler(content, marker);
139
+//					}
113 140
 				} else {
114
-					// alert("您选择地址没有解析到结果!");
141
+					 alert("您选择地址没有解析到结果!");
115 142
 				}
116 143
 			}, city);
117 144
 		}
@@ -186,7 +213,8 @@ window.onload = function() {
186 213
 	function openInfo(content, e) {
187 214
 		var p = e.target;
188 215
 		var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
189
-		var infoWindow = new BMap.InfoWindow(content, opts); // 创建信息窗口对象 
216
+//		var infoWindow = new BMap.InfoWindow(content, opts); // 创建信息窗口对象 
217
+		var infoWindow = new BMap.InfoWindow(content); // 创建信息窗口对象 
190 218
 		map.openInfoWindow(infoWindow, point); //开启信息窗口
191 219
 	}
192 220
 

+ 1 - 1
WebUI/CallCenterWeb.UI/Appeal/AddAppeal.html

@@ -187,7 +187,7 @@
187 187
     <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
188 188
     <script src="../css/laydate/laydate.js"></script>
189 189
     <script src="../js/adjustHeight.js"></script>
190
-    <script src="../js/appeal/index.js"></script>
190
+    <script src="../js/appeal/index1.js"></script>
191 191
     <script>
192 192
         var submit;
193 193
         $(document).ready(function () {

+ 1 - 1
WebUI/CallCenterWeb.UI/Business/spotDist.html

@@ -210,7 +210,7 @@
210 210
 						<i class="syIcon"></i>位置:
211 211
 						<a href="javaScript:;" id="ReIndex">首页</a>&gt;
212 212
 						<a href="javaScript:;">业务统计</a>&gt;
213
-						<a class="nowPosition">工单报表</a>
213
+						<a class="nowPosition">工单热点分布</a>
214 214
 					</sapn>
215 215
 				</div>
216 216
 				<div class="dhRight">

Разница между файлами не показана из-за своего большого размера
+ 338 - 0
WebUI/CallCenterWeb.UI/js/appeal/index1.js


+ 19 - 5
WebUI/CallCenterWeb.UI/js/spotDist.js

@@ -17,6 +17,7 @@ $(document).ready(function () {
17 17
 	});    
18 18
 	QY();
19 19
 	LY();
20
+	mapLoad();
20 21
 	throungh();
21 22
 	tree();
22 23
 	$(".Seach").click(function() {
@@ -164,7 +165,6 @@ function depart() {
164 165
 
165 166
 
166 167
 function throungh() {
167
-	debugger
168 168
 	$.ajax({
169 169
 		type: "get",
170 170
 		url: huayi.config.callcenter_url + "WorkOrderReport/GetHotspotMap",
@@ -176,7 +176,7 @@ function throungh() {
176 176
 			end:$('#starttime').val() && $('#starttime').val().split(' ~ ')[1], //=结束时间
177 177
 			deptid: $("#Dpment").val(),
178 178
 			keyid:$("#key").val(),
179
-			sourcearea:$('#sourceAreas').val(),
179
+			sourcearea:$('#sourcearea').val(),
180 180
 			source:$("#source").val()
181 181
 		},
182 182
 		success: function(result) {
@@ -197,8 +197,23 @@ function throungh() {
197 197
 	})
198 198
 }
199 199
 function mapLoad(){
200
-	map.centerAndZoom(point, 15);
201
-	map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
200
+	var city = '商丘市';
201
+	// 创建地址解析器实例
202
+	var address = '河南省商丘睢阳区';
203
+	var myGeo = new BMap.Geocoder();
204
+	myGeo.getPoint(address, function(point) {
205
+		if(point) {
206
+			//定位到区 ,级别显示12
207
+			map.centerAndZoom(point, 12);
208
+			map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
209
+			//删除选点
210
+			map.clearOverlays();
211
+		} else {
212
+			// alert("您选择地址没有解析到结果!");
213
+		}
214
+	}, city);
215
+//	map.centerAndZoom(point, 15);
216
+//	map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
202 217
 }
203 218
 $('#sourcearea').change(function(obj) {
204 219
 	if($('#sourcearea').val() == "") {
@@ -245,7 +260,6 @@ function openInfo(content, e) {
245 260
 	var infoWindow = new BMap.InfoWindow(content, opts); // 创建信息窗口对象 
246 261
 	map.openInfoWindow(infoWindow, point); //开启信息窗口
247 262
 }
248
-
249 263
 //移动到某一坐标点
250 264
 function to(x, y) {
251 265
 	map.panTo(new BMap.Point(x, y));