Quellcode durchsuchen

热点地图修改

miaofuhao vor 6 Jahren
Ursprung
Commit
f8a749da61
2 geänderte Dateien mit 25 neuen und 6 gelöschten Zeilen
  1. 4 4
      WebUI/CallCenterWeb.UI/Business/spotDist.html
  2. 21 2
      WebUI/CallCenterWeb.UI/js/spotDist.js

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

217
 					<a href="" title="刷新"><i class="fa fa-refresh"></i></a>
217
 					<a href="" title="刷新"><i class="fa fa-refresh"></i></a>
218
 				</div>
218
 				</div>
219
 			</div>
219
 			</div>
220
-
220
+			
221
 			<div class="Content_box">
221
 			<div class="Content_box">
222
 				<div class="complain Shows">
222
 				<div class="complain Shows">
223
 					<div class="tab-content">
223
 					<div class="tab-content">
241
 					                        </td>
241
 					                        </td>
242
 					                        <th>时间:</th>
242
 					                        <th>时间:</th>
243
 			                                <td >
243
 			                                <td >
244
-			                                    <input type="text" id="starttime" class="" placeholder="请选择时间" style="height: 32px;" />
244
+			                                    <input type="text" id="starttime" placeholder="请选择7天内的时间" style="height: 32px; width: 200px;" />
245
 			                                </td>
245
 			                                </td>
246
 			                                <th>主办单位:</th>
246
 			                                <th>主办单位:</th>
247
 			                                <td style="position: relative; width: 220px;">
247
 			                                <td style="position: relative; width: 220px;">
265
 		                           	</table>
265
 		                           	</table>
266
 								</div>
266
 								</div>
267
 							</div>
267
 							</div>
268
-							<div style="width:1000px">
269
-				                <div id="allmap" style="width:100%;height:400px;"></div>
268
+							<div style="width:90%">
269
+				                <div id="allmap" style="width:100%;height:600px;"></div>
270
 				                <input type="hidden" class="store_Lng" value="115.659773"/>
270
 				                <input type="hidden" class="store_Lng" value="115.659773"/>
271
         						<input type="hidden" class="store_Lat" value="34.395449" />
271
         						<input type="hidden" class="store_Lat" value="34.395449" />
272
 				            	<input type="hidden" id="PID" />
272
 				            	<input type="hidden" id="PID" />

+ 21 - 2
WebUI/CallCenterWeb.UI/js/spotDist.js

20
 	throungh();
20
 	throungh();
21
 	tree();
21
 	tree();
22
 	$(".Seach").click(function() {
22
 	$(".Seach").click(function() {
23
-		throungh();
23
+		var time1=$('#starttime').val() && $('#starttime').val().split(' ~ ')[1];
24
+		var time2=$('#starttime').val() && $('#starttime').val().split(' ~ ')[0];
25
+		var aDate, oDate1, oDate2, iDays
26
+		DateDiff(time1, time2)
27
+		function DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式
28
+			aDate = sDate1.split("-")
29
+			oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
30
+			aDate = sDate2.split("-")
31
+			oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
32
+			iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
33
+			console.log(iDays);
34
+		}
35
+		if (iDays>=7) {
36
+			layer.msg("您选择时间大于7天,数据无法加载");
37
+			throungh();
38
+		}else {
39
+			throungh();
40
+		}
41
+		
24
 	})
42
 	})
25
 });
43
 });
26
 
44
 
147
 
165
 
148
 
166
 
149
 function throungh() {
167
 function throungh() {
168
+	debugger
150
 	$.ajax({
169
 	$.ajax({
151
 		type: "get",
170
 		type: "get",
152
 		url: huayi.config.callcenter_url + "WorkOrderReport/GetHotspotMap",
171
 		url: huayi.config.callcenter_url + "WorkOrderReport/GetHotspotMap",
153
-		async: false,
172
+		async: true,
154
 		dataType: 'json',
173
 		dataType: 'json',
155
 		data: {
174
 		data: {
156
 			token: $.cookie("token"),
175
 			token: $.cookie("token"),