| mobile/data.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| mobile/index.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| mobile/js/datapage.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| mobile/js/widget_search_view.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| mobile/road_search.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
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> <!--第三方lib--> <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> 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 { mobile/js/datapage.js
New file @@ -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代表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}数据总览`); } 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选择的text current_selected_monitor_type=$("#querySelect").val(); //获取Select选择的Value // var checkIndex=$("#select_id ").get(0).selectedIndex; //获取Select选择的索引值 // var maxIndex=$("#select_id option:last").attr("index"); //获取Select最大的索引值 monitortype(); }); //为Select添加事件,当选择其中一项时触发 regionSelect $("#regionSelect").change(function(){ //code... current_selected_monitor_street=$("#regionSelect").val(); //获取Select选择的Value // var checkIndex=$("#select_id ").get(0).selectedIndex; //获取Select选择的索引值 // var maxIndex=$("#select_id option:last").attr("index"); //获取Select最大的索引值 monitortype(); reloadData(1); }); //为Select添加事件,当选择其中一项时触发 //加载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(); 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>