| | |
| | | //开始查询数据 |
| | | changeQindexSelection(); |
| | | } |
| | | updateRegionSelect() |
| | | monitortype(); |
| | | reloadData(1); |
| | | |
| | |
| | | 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最大的索引值 |
| | | updateRegionSelect() |
| | | monitortype(); |
| | | reloadData(1); |
| | | |
| | |
| | | $("#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添加事件,当选择其中一项时触发 |
| | |
| | | current_selected_monitor_qindex = "tsp"; |
| | | } else { |
| | | options = Object.keys(qindex_range_list_1004_and_other); |
| | | } |
| | | if(current_selected_monitor_type == 1005 || current_selected_monitor_type ==100500) { |
| | | $("#newname_a").empty(); |
| | | $("#newname_a").html('名称-属性'); |
| | | } else { |
| | | $("#newname_a").empty(); |
| | | $("#newname_a").html('名称'); |
| | | } |
| | | options.forEach(element => $("#qindex_selection").append("<option value='" + element + "'>" + element + "</option>")); |
| | | } |
| | |
| | | html += '<li><a href="javascript:reloadData(' + (currpage < pageNum ? currpage + 1 : pageNum ) + ')" rel="external nofollow" >></a></li>'; |
| | | } |
| | | return html; |
| | | } |
| | | |
| | | function updateRegionSelect() { |
| | | let datatime_, querytype_ ; |
| | | if(current_selected_monitor_type == 1005 || current_selected_monitor_type ==100500) { |
| | | $("#regionSelect").empty(); |
| | | $("#regionSelect").append(`<option value="">上海市</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="黄浦区">黄浦区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="浦东新区">浦东新区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="静安区">静安区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="长宁区">长宁区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="徐汇区">徐汇区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="闵行区">闵行区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="虹口区">虹口区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="杨浦区">杨浦区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="宝山区">宝山区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="嘉定区">嘉定区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="青浦区">青浦区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="松江区">松江区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="金山区">金山区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="奉贤区">奉贤区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(`<option value="崇明区">崇明区</option>`); //为Select追加一个Option(下拉项) |
| | | $("#regionSelect").append(` <option value="普陀区">普陀区</option>`); //为Select追加一个Option(下拉项) |
| | | return; |
| | | } |
| | | if ($("#appDateHour")[0].style.display == 'none') { |
| | | datatime_ = document.getElementById("appDate").value + ' 00:00:00'; |
| | | querytype_ = 'day'; |
| | | } else { |
| | | datatime_ = document.getElementById("appDateHour").value; |
| | | querytype_ = 'hour'; |
| | | } |
| | | var backend_url = default_system_params.nodejs_url_predix + "dataapi/Bdata?bid=mobile_count_" + current_selected_monitor_type + "_by_district&datatype=" + querytype_ |
| | | + "&datatime=" + datatime_ |
| | | + "&userid="+localStorage.getItem('user_id_') |
| | | + "&pageno=1&pagesize=50"; |
| | | console.log(`current selected:${current_selected_monitor_street}`); |
| | | $.ajax({ |
| | | type: 'get', |
| | | dataType: 'json', |
| | | data: {}, |
| | | async: false,//同步 |
| | | url: backend_url, |
| | | success: function (data) { |
| | | let regionStat = data.data.result; |
| | | if (regionStat != null) { |
| | | $("#regionSelect").empty(); |
| | | for (var i = 0; i < regionStat.length; i++) { |
| | | let obj = regionStat[i]; |
| | | select_strict = current_selected_monitor_street.length >0 ? current_selected_monitor_street : '上海市'; |
| | | if(obj.region == select_strict) { |
| | | $("#regionSelect").prepend(`<option value='${obj.region !='' ? obj.region : ''}' selected>${obj.region}(${obj.region !='上海市' ? obj.num : ''})</option>`); //为Select插入一个Option(第一个位置) |
| | | } else { |
| | | $("#regionSelect").append(`<option value='${obj.region !='上海市' ? obj.region : ''}'>${obj.region}(${obj.region !='上海市' ? obj.num : ''})</option>`); //为Select追加一个Option(下拉项) |
| | | } |
| | | } |
| | | // $("#regionSelect").prepend("<option value='0'>请选择</option>"); //为Select插入一个Option(第一个位置) |
| | | // $("#regionSelect option:last").remove(); //删除Select中索引值最大Option(最后一个) |
| | | // $("#regionSelect option[index='0']").remove(); //删除Select中索引值为0的Option(第一个) |
| | | // $("#regionSelect option[value='3']").remove(); //删除Select中Value='3'的Optiona |
| | | // $("#regionSelect option[text='4']").remove(); //删除Select中Text='4'的Optiona |
| | | } |
| | | }, |
| | | error: function (request, textStatus) { |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | } |