zhaoxing
2023-12-07 6f4d8199423dfc0bb6701341bc9b8785d50d2315
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;
reloadData();
 
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_;
 
    $.ajax({
        type: "GET",
        url: backend_url,
        dataType: "json",
        success: function (data) {
            tableData = data.data.result[0];
            // console.log(tableData);
            $('#month_').html(`${tableData.stat_month} 数据总览`);
            $('#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_counts}`);
        }
    });
    // $('div.title').html(`${tableData.stat_month}数据总览`);
 
}