// 同步加载 markers.json 文件 function loadJSONSync(url) { var xhr = new XMLHttpRequest(); xhr.open('GET', url, false); // false 表示同步请求 try { xhr.send(null); if (xhr.status === 200) { return JSON.parse(xhr.responseText); } else { // console.error('请求失败,状态码:', xhr.status); return null; } } catch (e) { // console.error('请求过程中出错:', e); return null; } } // DOM元素 const elements = { htmlElement: document.documentElement, bodyElement: document.body }; var baseURL='https://dashboard-server.hesuu.com' // var baseURL='http://219.157.255.213:25505' var city_data; function addlist() { $('.citylist').liMarquee('destroy'); let html = "" for (i = 0; i < city_data.length; i++) { html += `
${city_data[i].brand}
${city_data[i].vin}
${city_data[i].model} ${city_data[i].status}
${data[i].brand}
${data[i].vin}
${data[i].model} ${data[i].status}
')}
if(langs=='ru'){$(".inner").html('
')}
if(langs=='ar'){$(".inner").html('
')}
if(langs=='zh'){$(".inner").html('
')}
}
$(".vin").html(data.vin)
$(".classify").html(data.location?data.location.name:'')
$(".model").html(data.model)
$(".destination").html(data.final_location!=null?data.final_location.name:'')
$(".fbo_destination").html(data.fbo_destination)
$(".departure_time").html(data.departure_time)
$(".status").html(data.status)
$(".arrival_time").html(data.arrival_time)
});
//初始化滚动
function listsc() {
$('.citylist').liMarquee({
direction: 'up',
runshort: false,
scrollamount: 20 ,//滚动速度
});
var $lis = $('.citylist li')
var index =5; // 当前li的索引
var $currentLi = $lis.eq(index); // 获取当前索引的li元素
$currentLi.trigger('click'); // 模拟点击事件
// setInterval(function() {
// var $currentLi = $lis.eq(index); // 获取当前索引的li元素
// $currentLi.trigger('click'); // 模拟点击事件
// index++; // 增加索引
// if (index >= $lis.length) { // 如果索引超出li的数量,重置为0
// index = 0;
// }
// }, 2000); // 每2秒执行一次
// $('.citylist li').off('click').on('click', function(){
// $(this).addClass('liactive').siblings().removeClass('liactive');
// });
var timer = setInterval(function() {
if(currentPage*50>count){
}else{
currentPage++
Vehiclefn1(currentPage,localStorage.getItem("lang"))
}
}, 1000); // 每2秒执行一次
}
function listsc1() {
$('.citylist').liMarquee({
direction: 'up',
runshort: false,
scrollamount: 20 ,//滚动速度
});
var timer = setInterval(function() {
if(currentPage*50>count){
}else{
currentPage++
Vehiclefn1(currentPage,localStorage.getItem("lang"))
}
}, 1000); // 每2秒执行一次
}
var count;
var currentPage=1;
var statusnew='';
function Vehiclefn1(currentPage,lang){
$.ajax({
url:baseURL+'/Vehicle',
type:'POST',
data:{
lang: lang,
page: currentPage,
pageSize: 50,
status:statusnew
},
success: function(result){
if(result.code==0){
var data= result.data.list
addlist1(data)
}else{
alert(result.message)
}
}
});
}
function Vehiclefn(lang,status){
statusnew = status
$.ajax({
url:baseURL+'/Vehicle',
type:'POST',
data:{
lang: lang,
page: currentPage,
pageSize: 50,
status:status
},
success: function(result){
if(result.code==0){
city_data= result.data.list
count=result.data.count;
var i=result.data.count;
let arr = Array.from(String(i), Number);
var v=''
for(var n = 0; n < arr.length; n++) {
v+=''+arr[n]+''
}
$(".all").html(v)
$(".cartitle").html('')
$(".inner").html('')
$(".vin").html('')
$(".classify").html('')
$(".model").html('')
$(".destination").html('')
$(".fbo_destination").html('')
$(".departure_time").html('')
$(".status").html('')
$(".arrival_time").html('')
addlist()
}else{
alert(result.message)
}
}
});
}
var myChart = echarts.init(document.getElementById('world'));
var lineDatas;
var shipListdatas;//运输中 船
var navigatedatas;//待发船
var production;//生产城市
function locationfn(lang,status){
$.ajax({
url:baseURL+'/location/production',
type:'POST',
async:false,
data:{lang:lang,status:status},
success: function(result){
production = result.data
}
});
$.ajax({
url:baseURL+'/Vehicle/shipList',
type:'POST',
async:false,
data:{lang:lang},
success: function(result){
navigatedatas = result.data.navigate
shipListdatas = result.data.pending
var navigatedatashtml=''
var shipListdatashtml=''
$.each(navigatedatas,function(){
navigatedatashtml+=`${this.ship_name} ${this.count}
DEST: ${this.port}
ETA:${this.last_time}
${this.ship_name} ${this.count}
DEST: ${this.port}
ETA:${this.last_time}