From a24e6ad3dd99b50e29af6f74c57fa646bca86d43 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期四, 02 一月 2025 17:15:48 +0800
Subject: [PATCH] 提交配置
---
igds-app/js/admin/security-patrol.js | 113 ++++++++++++++++++++++++++------------------------------
1 files changed, 52 insertions(+), 61 deletions(-)
diff --git a/igds-app/js/admin/security-patrol.js b/igds-app/js/admin/security-patrol.js
index 1b662e5..d03d23e 100644
--- a/igds-app/js/admin/security-patrol.js
+++ b/igds-app/js/admin/security-patrol.js
@@ -1,10 +1,14 @@
var url = null;
var uploadUrl = null;
-var PatrolData = null;
+var PatrolList = null;
var ImgFile = null;
var dateTime;
-var longitude = null; //鐧惧害鍦板浘(BD-09)缁忓害
-var latitude = null; //鐧惧害鍦板浘(BD-09)绾害
+var longitude; //鐧惧害鍦板浘(BD-09)缁忓害
+var latitude; //鐧惧害鍦板浘(BD-09)绾害
+var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
+var pi = 3.1415926535897932384626;
+var a = 6378245.0;
+var ee = 0.00669342162296594323;
//鐢靛瓙宸℃洿璁板綍
var data = {
"interfaceId": "5601",
@@ -13,7 +17,7 @@
"tokenAuth": "",
"data": {
"deptId": "",
- "dataTime": "",
+ "dateTime": "",
}
};
//鐢靛瓙宸℃洿鎵撳崱
@@ -27,6 +31,7 @@
"latitude": "",
"longitude": "",
"imgName": "",
+ "userName": ""
}
};
//宸℃洿鐓х墖鏌ョ湅
@@ -47,11 +52,12 @@
uploadUrl = user.url + "/api-phone/v35/upload-img"
data.tokenAuth = user.tokenAuth;
data1.tokenAuth = user.tokenAuth;
+ data1.data.userName = user.cname;
data2.tokenAuth = user.tokenAuth;
data.data.deptId = selectDeptId;
- data2.data.deptId = selectDeptId;
+ data1.data.deptId = selectDeptId;
dateTime = getDate(new Date())
- $('#date').val(dateTime)
+ document.getElementById("date").value = dateTime;
//鑾峰彇宸℃洿璁板綍
getPatrolList()
@@ -78,7 +84,7 @@
date = date.setDate(date.getDate() + tag);
date = new Date(date);
dateTime = getDate(date);
- $('#date').val(dateTime);
+ document.getElementById("date").value = dateTime;
//鑾峰彇宸℃洿璁板綍
getPatrolList()
}
@@ -89,16 +95,22 @@
type: "date", //璁剧疆鏃ュ巻鍒濆瑙嗗浘妯″紡
// beginDate: new Date(2015, 04, 25), //璁剧疆寮�濮嬫棩鏈�
// endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡
+ value: dateTime
})
+ var time = dateTime;
dtpicker.show(function(e) {
+ dateTime = e.value;
document.getElementById("date").value = e.value
+ if (time != dateTime) {
+ getPatrolList();
+ }
})
}
//鑾峰彇宸℃洿璁板綍
function getPatrolList() {
- PatrolData = null;
//璧嬪�煎弬鏁扮殑鏃ユ湡
- data.data.dataTime = dateTime;
+ data.data.dateTime = dateTime;
+ console.log(JSON.stringify(data.data), "鐢靛瓙宸℃洿璁板綍", "security-patrol")
mui.ajax(url, {
type: "POST",
dataType: "json",
@@ -107,12 +119,12 @@
data: JSON.stringify(data),
success: function(result) {
if (result.code == "0000") {
- PatrolData = result.data;
+ PatrolList = result.data;
renderPatrol();
} else {
renderPatrol();
mui.toast(result.msg);
- console.log(JSON.stringify(result))
+ // console.log(JSON.stringify(result))
}
},
error: function() {
@@ -120,60 +132,34 @@
}
})
- 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"
- }
- ]
- }
}
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>';
+ html += '<li><div class="item"><div class="top">'
+ html += '<div class="date">鏆傛棤宸℃洿璁板綍</div><div class="r-btn" id = "0">鏌ョ湅鐓х墖</div></div>';
+ html += '<div class="cards"><div class="cd"><div class="con user">'
+ html += '<div class="tit">鎵撳崱浜�</div><div class="txt">--</div></div></div>';
+ html += '<div class="cd"><div class="con loc"><div class="tit">鍧愭爣</div>'
+ html += '<div class="txt">0, 0</div></div></div></div></div></li>'
}
$("#recordList").html(html)
}
mui('.mui-scroll-wrapper').scroll({
- indicators: false, //鏄惁鏄剧ず婊氬姩鏉�
+ indicators: true, //鏄惁鏄剧ず婊氬姩鏉�
deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁�
bounce: false, //鏄惁鍚敤鍥炲脊
deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006
@@ -223,10 +209,13 @@
$('.m-pop').fadeOut();
});
-
-
//浣跨敤鐩告満鎷嶇収
function cameraImg() {
+ //鑾峰彇瀹氫綅淇℃伅
+ getLatLon();
+ if (latitude == null || longitude == null) {
+ return;
+ }
var cmr = plus.camera.getCamera();
cmr.captureImage(function(p) {
//鎴愬姛
@@ -251,7 +240,7 @@
},
function(t, status) { //涓婁紶瀹屾垚
if (status == 200) {
- var html = '';
+ // var html = '';
var obj = JSON.parse(t.responseText);
mui.toast("涓婁紶鎴愬姛锛�");
data1.data.imgName = obj.data.fileName;
@@ -276,6 +265,9 @@
//鐢靛瓙宸℃洿鎵撳崱
function patrolClock() {
+
+ console.log(latitude)
+ console.log(longitude)
data1.data.latitude = latitude;
data1.data.longitude = longitude
mui.ajax(url, {
@@ -286,7 +278,8 @@
data: JSON.stringify(data1),
success: function(result) {
if (result.code == "0000") {
- mui.toast(result.msg);
+ // mui.toast(result.msg);
+ setInterval(getPatrolList(), 500)
} else {
mui.toast(result.msg);
}
@@ -296,8 +289,6 @@
}
})
}
-
-
// function getLatLon() {
// plus.geolocation.getCurrentPosition(function(position) {
--
Gitblit v1.9.3