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 });
|
}
|