From 50e355f5da5c366c81a92cfdbce95b3c7ffdc1ae Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期五, 12 五月 2023 17:33:34 +0800
Subject: [PATCH] 能耗管理

---
 igds-app/js/admin/security-patrol.js |   97 +++++++++++++++++++++++-------------------------
 1 files changed, 46 insertions(+), 51 deletions(-)

diff --git a/igds-app/js/admin/security-patrol.js b/igds-app/js/admin/security-patrol.js
index 1b662e5..bf2dc53 100644
--- a/igds-app/js/admin/security-patrol.js
+++ b/igds-app/js/admin/security-patrol.js
@@ -1,11 +1,5 @@
 var url = null;
 var uploadUrl = null;
-var PatrolData = null;
-var ImgFile = null;
-var dateTime;
-var longitude = null; //鐧惧害鍦板浘(BD-09)缁忓害
-var latitude = null; //鐧惧害鍦板浘(BD-09)绾害
-//鐢靛瓙宸℃洿璁板綍
 var data = {
 	"interfaceId": "5601",
 	"outId": "10601",
@@ -16,6 +10,13 @@
 		"dataTime": "",
 	}
 };
+var PatrolList = null;
+var ImgFile = null;
+var dateTime;
+var longitude = null; //鐧惧害鍦板浘(BD-09)缁忓害
+var latitude = null; //鐧惧害鍦板浘(BD-09)绾害
+//鐢靛瓙宸℃洿璁板綍
+
 //鐢靛瓙宸℃洿鎵撳崱
 var data1 = {
 	"interfaceId": "5602",
@@ -51,7 +52,7 @@
 	data.data.deptId = selectDeptId;
 	data2.data.deptId = selectDeptId;
 	dateTime = getDate(new Date())
-	$('#date').val(dateTime)
+	document.getElementById("date").value = dateTime;
 	//鑾峰彇宸℃洿璁板綍
 	getPatrolList()
 
@@ -78,7 +79,7 @@
 	date = date.setDate(date.getDate() + tag);
 	date = new Date(date);
 	dateTime = getDate(date);
-	$('#date').val(dateTime);
+	document.getElementById("date").value = dateTime;
 	//鑾峰彇宸℃洿璁板綍
 	getPatrolList()
 }
@@ -91,12 +92,13 @@
 		// endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡 
 	})
 	dtpicker.show(function(e) {
+		dateTime = e.value;
 		document.getElementById("date").value = e.value
+		getPatrolList();
 	})
 }
 //鑾峰彇宸℃洿璁板綍
 function getPatrolList() {
-	PatrolData = null;
 	//璧嬪�煎弬鏁扮殑鏃ユ湡
 	data.data.dataTime = dateTime;
 	mui.ajax(url, {
@@ -107,7 +109,7 @@
 		data: JSON.stringify(data),
 		success: function(result) {
 			if (result.code == "0000") {
-				PatrolData = result.data;
+				PatrolList = result.data;
 				renderPatrol();
 			} else {
 				renderPatrol();
@@ -120,51 +122,44 @@
 		}
 	})
 
-	PatrolData = {
-		"data": [{
-				"id": "57",
-				"userName": "绋嬪",
-				"longitude": "34.585",
-				"latitude": "114.235",
-				"createTime": "1976-03-03 16:41:41"
-			},
-			{
-				"id": "1",
-				"userName": "鍐啗",
-				"longitude": "34.585",
-				"latitude": "114.235",
-				"createTime": "1981-01-06 17:40:24"
-			},
-			{
-				"id": "99",
-				"userName": "榛庢磱",
-				"longitude": "114.235",
-				"latitude": "34.585",
-				"createTime": "1991-04-04 23:06:09"
-			}
-		]
-	}
+	PatrolList = [{
+			"id": "57",
+			"userName": "绋嬪",
+			"longitude": "34.585",
+			"latitude": "114.235",
+			"createTime": "1976-03-03 16:41:41"
+		},
+		{
+			"id": "1",
+			"userName": "鍐啗",
+			"longitude": "34.585",
+			"latitude": "114.235",
+			"createTime": "1981-01-06 17:40:24"
+		},
+		{
+			"id": "99",
+			"userName": "榛庢磱",
+			"longitude": "114.235",
+			"latitude": "34.585",
+			"createTime": "1991-04-04 23:06:09"
+		}
+	]
+
 }
 
 function renderPatrol() {
 	var html = '';
-	if (PatrolData) {
-		var PatrolList = PatrolData.data;
-		if (PatrolList && PatrolList.length > 0) {
-			$.each(PatrolList, function(index, item) {
-				html += '<li><div class="item"><div class="top">'
-				html += '<div class="date">' + item.createTime + '</div><div class="r-btn" id = "' + item.id +
-					'">鏌ョ湅鐓х墖</div></div>';
-				html += '<div class="cards"><div class="cd"><div class="con user">'
-				html += '<div class="tit">鎵撳崱浜�</div><div class="txt">' + item.userName + '</div></div></div>';
-				html += '<div class="cd"><div class="con loc"><div class="tit">鍧愭爣</div>'
-				html += '<div class="txt">' + item.longitude + ', ' + item.latitude +
-					'</div></div></div></div></div></li>'
-			})
-		} else {
-			html +=
-				'<li><div class="item" style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 18px;">鏆傛棤宸℃洿淇℃伅</div></li>';
-		}
+	if (PatrolList && PatrolList.length > 0) {
+		$.each(PatrolList, function(index, item) {
+			html += '<li><div class="item"><div class="top">'
+			html += '<div class="date">' + item.createTime + '</div><div class="r-btn" id = "' + item.id +
+				'">鏌ョ湅鐓х墖</div></div>';
+			html += '<div class="cards"><div class="cd"><div class="con user">'
+			html += '<div class="tit">鎵撳崱浜�</div><div class="txt">' + item.userName + '</div></div></div>';
+			html += '<div class="cd"><div class="con loc"><div class="tit">鍧愭爣</div>'
+			html += '<div class="txt">' + item.longitude + ', ' + item.latitude +
+				'</div></div></div></div></div></li>'
+		})
 	} else {
 		html +=
 			'<li><div class="item" style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 18px;">鏆傛棤宸℃洿淇℃伅</div></li>';

--
Gitblit v1.9.3