master
2022-03-21 1292f810644e422357734d1616761eb920903f45
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
var current_selected_monitor_type = 1006;
var current_selected_monitor_name = "国控点";
var current_selected_monitor_qindex = "pm25";
var base_msg = {
    base_url:"http://127.0.0.1:4500"
}
//对应widget.js中MyWidget实例化后的对象
var thisWidget
 
//当前页面业务
function initWidgetView(_thisWidget) {
    console.log(_thisWidget,"thisWidget")
    thisWidget = _thisWidget
    $(document).ready(function(){
        thisWidget.openTest()
    })
 
    $(".layui-breadcrumb").on("click", function () {
        console.log("先一步")
        // changeQindexSelection();
        // reloadData();
        thisWidget.openTest();
        console.log("后一步")
        
        });
 
}
    function finalHeight(h){
        let h1 = Number(h)/2.8
        let h2 = Math.floor(h1)
        let h3 = h2*3
        return h3
    }
    function reHeight(h){
        let h1 = Number(h)/2.8
        let h2 = Math.floor(h1)
        let h3 = h2*2.8
        return h3
    }
    $(".search_time_btn").on("click",function(){
        let time1 = $(".time1").val();
        let time2 = $(".time2").val(); 
        let floor = reHeight(Number(thisWidget.floor))
        console.log(time1,time2,thisWidget.taxi_sn,thisWidget.name,thisWidget.floor,floor )
        thisWidget.openTest("wwwww")
         // let backend_url = base_msg.base_url+`/dataservice/Bdata?bid=get_mr_router&time1_=${time1}&time2_=${time2}`&;
           $.ajax({
                 type: 'get',
                 dataType: 'json',
                 async: true,//同步
                 url: `http://localhost:4500/dataservice/Bdata?bid=get_mr_router&time1_=${time1}&time2_=${time2}&floor1=${floor}&floor2=${floor+2.8}&msisdn_name=${thisWidget.name}`,
                 success:function(data){
                   console.log(data.data.data,"data")
                   // thisWidget.clearReplayLayers();
                   if (data.data.data.length > 0) {
                     thisWidget.setSingleTaxiReplayData(data.data.data);
                     var points = [];
                     for (var i = 0, len = data.data.data.length; i < len; i++) {
                       let item = data.data.data[i];
                    let h = finalHeight(Number(item["y_pred_height"]))
                       points[points.length] = [item["y_pred_Longitude"], item["y_pred_Latitude"],h];
                     }
                     thisWidget.addTaxiReplayGraphic(points);
                     $("#route_box").show();
                   } else {
                   }
               },
               error: function (request, textStatus) {
               
               }
           });
         });
    
    function over(obj) {
        $('#top10Tb tr').removeClass("over_tr");
        $(obj).addClass("over_tr");
    }
    
    function out(obj) {
    
        $(obj).removeClass("over_tr");
    }
    function resetStartQueryTaxiDataText(taxi,name,floor) {
      $(".search_time_btn").text("轨迹查询");
      // $("#route_box").hide();
    }
    function locateAndShowDetail(obj) {
        $('#top10Tb tr').removeClass("select_tr");
        $(obj).addClass("select_tr");
        var siteId = $(obj).attr("_siteid");
        var lon = $(obj).attr("_lon");
        var lat = $(obj).attr("_lat");
    
        if (lon && lon != 'undefined') {
            thisWidget.locateAndHighlight(lon, lat);
        }
        thisWidget.showDetailedWindow({ "nodejs_url_predix": thisWidget.nodejs_url_predix, "datatype": thisWidget.datatype,"selected_qindex": current_selected_monitor_qindex,"datatime": thisWidget.datatime, "layerid": current_selected_monitor_type, "siteid": siteId });
    }