From 6f469bafb8add6aac7ffb39c4ac88fff019641ba Mon Sep 17 00:00:00 2001
From: wr1207 <wyun001@163.com>
Date: 星期三, 26 七月 2023 09:27:22 +0800
Subject: [PATCH] 检测总览页面
---
mobile/js/datapage.js | 38 ++++++++++++
mobile/js/widget_search_view.js | 62 ++++++++++++++++----
mobile/index.html | 1
mobile/road_search.html | 39 ++++++++----
mobile/data.html | 14 ++--
5 files changed, 123 insertions(+), 31 deletions(-)
diff --git a/mobile/data.html b/mobile/data.html
index 5c8bbf3..972874c 100644
--- a/mobile/data.html
+++ b/mobile/data.html
@@ -20,6 +20,8 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="MarsGIS" />
+ <script type="text/javascript" src="../js/changable_params.js"></script>
+ <script type="text/javascript" src="js/datapage.js"></script>
<!--绗笁鏂筶ib-->
<script type="text/javascript" src="../lib/include-lib.js?time=20210803" libpath="../lib/"
include="jquery"></script>
@@ -36,26 +38,26 @@
<div class="main">
<div class="data">
<div class="data-top">
- <p class="data-title">2023骞�7鏈� 鏁版嵁鎬昏</p>
- <p class="data-number">1,700,820.34</p>
+ <p class="data-title" id="month_">2023骞�7鏈� 鏁版嵁鎬昏</p>
+ <p class="data-number" id="per_odometer">1,700,820.34</p>
<p class="data-name">琛岄┒鎬婚噷绋�(鍏噷)</p>
</div>
<div class="data-main">
<ul>
<li>
- <p class="data-number">700,820 / 82%</p>
+ <p class="data-number" id="road_coverage">700,820 / 82%</p>
<p class="data-name">瑕嗙洊閬撹矾鏁�/瑕嗙洊鐧惧垎姣�</p>
</li>
<li>
- <p class="data-number">820 / 25%</p>
+ <p class="data-number" id="section_coverage">820 / 25%</p>
<p class="data-name">璺鏁�/瑕嗙洊鐧惧垎姣�</p>
</li>
<li>
- <p class="data-number">120</p>
+ <p class="data-number" id="device_counts">120</p>
<p class="data-name">璁惧鎬绘暟</p>
</li>
<li>
- <p class="data-number">2,820</p>
+ <p class="data-number" id="alarm_counts">2,820</p>
<p class="data-name">鍛婅锛堢綉鏍兼暟鎹級</p>
</li>
</ul>
diff --git a/mobile/index.html b/mobile/index.html
index 51cda1f..d16479a 100644
--- a/mobile/index.html
+++ b/mobile/index.html
@@ -62,6 +62,7 @@
}
let record = data.result[0];
if(record.status == 0 && record.is_deleted ==0) {
+ localStorage.setItem("user_id_",record.id);
localStorage.setItem("name",record.name);
window.location = "../mobile/cars.html";
} else {
diff --git a/mobile/js/datapage.js b/mobile/js/datapage.js
new file mode 100644
index 0000000..92a7f3a
--- /dev/null
+++ b/mobile/js/datapage.js
@@ -0,0 +1,38 @@
+'use script'; //寮�鍙戠幆澧冨缓璁紑鍚弗鏍兼ā寮�
+
+var current_selected_monitor_type = "1005";
+var current_selected_monitor_name = "閬撹矾璺";
+var current_selected_monitor_keyword;
+var current_selected_monitor_qindex = "pm25";
+
+var tableData;
+
+
+function reloadData(month_) {
+ let date = new Date(),
+ year = date.getFullYear(), //鑾峰彇瀹屾暣鐨勫勾浠�(4浣�)
+ month = date.getMonth() + 1 //鑾峰彇褰撳墠鏈堜唤(0-11,0浠h〃1鏈�)
+ if (!month_) {
+ if (month < 10) month = `0${month}` // 濡傛灉鏈堜唤鏄釜浣嶆暟锛屽湪鍓嶉潰琛�0
+ month_ = `${year}-${month}`
+ }
+ let backend_url = default_system_params.nodejs_url_predix + "dataapi/Bdata?bid=get_stat_operator&month_=" + month_;
+ $('#month_').html(`${month_} 鏁版嵁鎬昏`);
+ $.ajax({
+ type: "GET",
+ url: backend_url,
+ dataType: "json",
+ success: function (data) {
+ tableData = data.data.result[0];
+ console.log(tableData);
+
+ $('#per_odometer').html(`${tableData.per_odometer}`);
+ $('#road_coverage').html(`${tableData.count_road_coverage} / ${tableData.rate_road_coverage}`);
+ $('#section_coverage').html(`${tableData.count_section_coverage} / ${tableData.rate_section_coverage}`);
+ $('#device_counts').html(`${tableData.devices_count}`);
+ $('#alarm_counts').html(`${tableData.alarm_count}`);
+ }
+ });
+ // $('div.title').html(`${tableData.stat_month}鏁版嵁鎬昏`);
+
+}
\ No newline at end of file
diff --git a/mobile/js/widget_search_view.js b/mobile/js/widget_search_view.js
index 5d6a323..5836a5e 100644
--- a/mobile/js/widget_search_view.js
+++ b/mobile/js/widget_search_view.js
@@ -1,9 +1,10 @@
'use script'; //寮�鍙戠幆澧冨缓璁紑鍚弗鏍兼ā寮�
-var current_selected_monitor_type = "1005";
-var current_selected_monitor_name = "閬撹矾璺";
+var current_selected_monitor_type = "1001";
+var current_selected_monitor_name = "鍥芥帶鐐�";
var current_selected_monitor_keyword;
var current_selected_monitor_qindex = "pm25";
+var current_selected_monitor_street = "";
var tableData;
@@ -23,11 +24,32 @@
//褰撳墠椤甸潰涓氬姟
function monitortype() {
//寮�濮嬫煡璇㈡暟鎹�
- current_selected_monitor_type = "1005";
- current_selected_monitor_name = "閬撹矾璺";
changeQindexSelection();
}
monitortype();
+
+
+$("#querySelect").change(function(){
+ //code...
+ current_selected_monitor_name=$("#querySelect").find("option:selected").text(); //鑾峰彇Select閫夋嫨鐨則ext
+ current_selected_monitor_type=$("#querySelect").val(); //鑾峰彇Select閫夋嫨鐨刅alue
+ // var checkIndex=$("#select_id ").get(0).selectedIndex; //鑾峰彇Select閫夋嫨鐨勭储寮曞��
+ // var maxIndex=$("#select_id option:last").attr("index"); //鑾峰彇Select鏈�澶х殑绱㈠紩鍊�
+ monitortype();
+
+}); //涓篠elect娣诲姞浜嬩欢锛屽綋閫夋嫨鍏朵腑涓�椤规椂瑙﹀彂
+
+regionSelect
+
+$("#regionSelect").change(function(){
+ //code...
+ current_selected_monitor_street=$("#regionSelect").val(); //鑾峰彇Select閫夋嫨鐨刅alue
+ // var checkIndex=$("#select_id ").get(0).selectedIndex; //鑾峰彇Select閫夋嫨鐨勭储寮曞��
+ // var maxIndex=$("#select_id option:last").attr("index"); //鑾峰彇Select鏈�澶х殑绱㈠紩鍊�
+ monitortype();
+ reloadData(1);
+}); //涓篠elect娣诲姞浜嬩欢锛屽綋閫夋嫨鍏朵腑涓�椤规椂瑙﹀彂
+
//鍔犺浇count
function loadCountByUserid() {
@@ -81,18 +103,25 @@
}
function reloadData(page) {
+ $("#pageID").append('');
+ $("#page").append('');
$("#searchInfo").empty();
- let datatime_, querytype_ ;
+ let datatime_, querytype_,endtime_ ;
if ($("#appDateHour")[0].style.display == 'none') {
- datatime_ = document.getElementById("appDate").value;
+ datatime_ = document.getElementById("appDate").value + ' 00:00:00';
querytype_ = 'day';
} else {
datatime_ = document.getElementById("appDateHour").value;
querytype_ = 'hour';
}
var avgnam = 50; //姣忛〉鏄剧ず涓暟
- var backend_url = default_system_params.nodejs_url_predix + "dataapi/Bdata?bid=get_" + current_selected_monitor_type + "_list_keyword&datatype=" + querytype_ + "&datatime=" + datatime_
- + "&qindex=" + current_selected_monitor_qindex + "&keyword=" + current_selected_monitor_keyword + "&pageno="+page+"&pagesize="+avgnam;
+ var backend_url = default_system_params.nodejs_url_predix + "dataapi/Bdata?bid=mobile_get_" + current_selected_monitor_type + "_list_keyword&datatype=" + querytype_
+ + "&datatime=" + datatime_
+ + "&qindex=" + current_selected_monitor_qindex
+ + "&keyword=" + current_selected_monitor_keyword
+ + "&pageno="+page+"&pagesize="+avgnam
+ + "&userid="+localStorage.getItem('user_id_')
+ + "®ion="+current_selected_monitor_street;
$.ajax({
type: "GET",
url: backend_url,
@@ -100,15 +129,18 @@
success: function (data) {
tableData = data.data.result;
if (current_selected_monitor_keyword == null) {
- haoutil.msg("璇疯緭鍏ュ叧閿瓧锛侊紒锛�")
+ // haoutil.msg("璇疯緭鍏ュ叧閿瓧锛侊紒锛�")
+ alert('璇疯緭鍏ュ叧閿瓧锛侊紒锛�')
return;
}
if (tableData == null) {
- haoutil.msg("璇烽�夋嫨鏌ヨ绫诲埆锛侊紒锛�")
+ // haoutil.msg("璇烽�夋嫨鏌ヨ绫诲埆锛侊紒锛�")
+ alert('璇烽�夋嫨鏌ヨ绫诲埆锛侊紒锛�')
return;
}
if (tableData.length == 0) {
- haoutil.msg("鏃犳煡璇㈢粨鏋滐紝璇锋洿鎹㈡煡璇㈡潯浠讹紒")
+ // haoutil.msg("鏃犳煡璇㈢粨鏋滐紝璇锋洿鎹㈡煡璇㈡潯浠讹紒")
+ alert('鏃犳煡璇㈢粨鏋滐紝璇锋洿鎹㈡煡璇㈡潯浠讹紒');
return;
}
var newsTotalNum = data.data.counter.counter; //璁板綍鐨勬�绘潯鏁�
@@ -121,7 +153,13 @@
topObj[key] = "/";
}
}
- var content = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.code + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.name + "</td><td><font color='" + getLayerPointColorByQindexandValue(current_selected_monitor_type, current_selected_monitor_qindex, topObj[current_selected_monitor_qindex]) + "'>" + topObj[current_selected_monitor_qindex] + "</font></td></tr>"
+ var content = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat
+ + "' onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>"
+ + topObj.region + "</td><td onclick='locateAndShowDetail(this)'>"
+ + topObj.name + "</td>"
+ + "<td><font color='"
+ + getLayerPointColorByQindexandValue(current_selected_monitor_type, current_selected_monitor_qindex, topObj[current_selected_monitor_qindex])
+ + "'>" + topObj[current_selected_monitor_qindex] + "</font></td></tr>"
$("#searchInfo").append(content);
}
$("#pageID").empty();
diff --git a/mobile/road_search.html b/mobile/road_search.html
index a165588..a6d493b 100644
--- a/mobile/road_search.html
+++ b/mobile/road_search.html
@@ -33,6 +33,7 @@
<script type="text/javascript" src="../js/changable_params.js"></script>
<script type="text/javascript" src="js/widget_search.js"></script>
+ <script type="text/javascript" src="js/widget_search_view.js"></script>
<script type="text/javascript" src="../js/function_1001.js"></script>
<style>
@@ -87,13 +88,14 @@
<!--閬撹矾鏌ヨ 寮�濮�-->
<div id="searchDiv" class="searchDiv">
- <select>
+ <select id="querySelect" >
<option value="1001">鍥芥帶鐐�</option>
- <option value="1001">鍥芥帶鐐�</option>
- <option value="1001">鍥芥帶鐐�</option>
- <option value="1001">鍥芥帶鐐�</option>
- <option value="1001">鍥芥帶鐐�</option>
- <option value="1001">鍥芥帶鐐�</option>
+ <option value="1002">寰珯</option>
+ <option value="1003">鐩戞祴鐐�</option>
+ <option value="1004">鐩戞祴杞﹁締</option>
+ <option value="100500">閬撹矾</option>
+ <option value="1005">閬撹矾璺</option>
+ <option value="1006">鐩戞祴鍖哄煙</option>
</select>
<input style="flex: 1;" type="text" id="search" class="input_keyword" placeholder="璇疯緭鍏ュ叧閿瓧锛屽彲涓虹┖">
<button type="button" id="btn" class="btn btn-primary">
@@ -108,13 +110,24 @@
<tr style="background:#304b80; color: #fff;">
<th width="50">搴忓彿</th>
<th width="80">
- <select style="width: 100%; background: #304b80; border: none;">
- <option>鍏ㄩ儴</option>
- <option>闀垮畞鍖�</option>
- <option>寰愭眹鍖�</option>
- <option>榛勬郸鍖�</option>
- <option>娴︿笢鏂板尯</option>
- <option>...</option>
+ <select id="regionSelect" style="width: 100%; background: #304b80; border: none;">
+ <option value="">涓婃捣甯�</option>
+ <option value="榛勬郸鍖�">榛勬郸鍖�</option>
+ <option value="娴︿笢鏂板尯">娴︿笢鏂板尯</option>
+ <option value="闈欏畨鍖�">闈欏畨鍖�</option>
+ <option value="闀垮畞鍖�">闀垮畞鍖�</option>
+ <option value="寰愭眹鍖�">寰愭眹鍖�</option>
+ <option value="闂佃鍖�">闂佃鍖�</option>
+ <option value="铏瑰彛鍖�">铏瑰彛鍖�</option>
+ <option value="鏉ㄦ郸鍖�">鏉ㄦ郸鍖�</option>
+ <option value="瀹濆北鍖�">瀹濆北鍖�</option>
+ <option value="鍢夊畾鍖�">鍢夊畾鍖�</option>
+ <option value="闈掓郸鍖�">闈掓郸鍖�</option>
+ <option value="鏉炬睙鍖�">鏉炬睙鍖�</option>
+ <option value="閲戝北鍖�">閲戝北鍖�</option>
+ <option value="濂夎搐鍖�">濂夎搐鍖�</option>
+ <option value="宕囨槑鍖�">宕囨槑鍖�</option>
+ <option value="鏅檧鍖�">鏅檧鍖�</option>
</select>
</th>
<th style="width: calc(100% - 212px); overflow: hidden; text-overflow: ellipsis;">鍚嶇О</th>
--
Gitblit v1.9.1