jjsp_web/bns/js/supplement/monitoring_coverage.js

143 lines
4.3 KiB
JavaScript
Raw Normal View History

2024-12-11 15:02:17 +08:00
let form, layer, table, laydate, tableIns, user = getUser();
let mapPointList = [],mainMapPointList = [];
layui.use(['form', 'layer', 'table', 'laydate'], function () {
form = layui.form;
layer = layui.layer;
table = layui.table;
laydate = layui.laydate;
initData();
})
/* 数据初始化 */
function initData(){
getHyd();
getFgd();
getMap();
getErrorNum();
getWatchNum();
getCoverRate();
getSpeedNum();
}
/* 获取监控活跃度分析 */
function getHyd(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getHyd";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
initEchartsOne(result.data);
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
/* 获取监控覆盖度分析 */
function getFgd(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getFgd";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
initEchartsTwo(result.data);
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
/* 获取地图球机 */
function getMap(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getMap";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
let dataList = [];
$.each(result.data,function(index,item){
item.coordinate = [parseFloat(item.lon), parseFloat(item.lat)]
dataList.push(item);
})
mainMapPointList = dataList;
loadMap(dataList);
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
/* 获取球机异常类型 */
function getErrorNum(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getErrorNum";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
$.each(result.data,function(index,item){
$('#num' + item.name).html(item.num);
})
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
/* 下行观看分析 */
function getWatchNum(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getWatchNum";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
console.error(result);
if (result.code === 200) {
initEchartsThree(result.data);
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
/* 风险球机覆盖度 */
function getCoverRate(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getCoverRate";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
console.error(result);
if (result.code === 200) {
initEchartsFour(result.data);
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
/* 球机速率正常/异常数量 */
function getSpeedNum(){
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getSpeedNum";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
$('#normalNum').html(result.data[0].normalNum);
$('#errorNum').html(result.data[0].errorNum);
} else if (result.code === 500) {
layer.alert(result.msg, { icon: 2 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}