jjsp_web/bns/js/supplement/monitoring_coverage.js

152 lines
4.5 KiB
JavaScript
Raw Normal View History

2024-12-11 15:02:17 +08:00
let form, layer, table, laydate, tableIns, user = getUser();
2024-12-11 17:37:03 +08:00
let mapPointList = [], mainMapPointList = [];
2024-12-11 15:02:17 +08:00
layui.use(['form', 'layer', 'table', 'laydate'], function () {
form = layui.form;
layer = layui.layer;
table = layui.table;
laydate = layui.laydate;
initData();
})
/* 数据初始化 */
2024-12-11 17:37:03 +08:00
function initData() {
2024-12-11 15:02:17 +08:00
getHyd();
getFgd();
getMap();
getErrorNum();
getWatchNum();
getCoverRate();
getSpeedNum();
}
/* 获取监控活跃度分析 */
2024-12-11 17:37:03 +08:00
function getHyd() {
2024-12-11 15:02:17 +08:00
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);
}
/* 获取监控覆盖度分析 */
2024-12-11 17:37:03 +08:00
function getFgd() {
2024-12-11 15:02:17 +08:00
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);
}
/* 获取地图球机 */
2024-12-11 17:37:03 +08:00
function getMap() {
2024-12-11 15:02:17 +08:00
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getMap";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
let dataList = [];
2024-12-11 17:37:03 +08:00
$.each(result.data, function (index, item) {
2024-12-11 15:02:17 +08:00
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);
}
/* 获取球机异常类型 */
2024-12-11 17:37:03 +08:00
function getErrorNum() {
2024-12-11 15:02:17 +08:00
let params = {};
let url = dataUrl + "proteam/pot/monitoringCoverage/getErrorNum";
ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
if (result.code === 200) {
2024-12-11 17:37:03 +08:00
$.each(result.data, function (index, item) {
2024-12-11 15:02:17 +08:00
$('#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);
}
/* 下行观看分析 */
2024-12-11 17:37:03 +08:00
function getWatchNum() {
2024-12-11 15:02:17 +08:00
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);
}
/* 风险球机覆盖度 */
2024-12-11 17:37:03 +08:00
function getCoverRate() {
2024-12-11 15:02:17 +08:00
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);
}
/* 球机速率正常/异常数量 */
2024-12-11 17:37:03 +08:00
function getSpeedNum() {
2024-12-11 15:02:17 +08:00
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);
2024-12-11 17:37:03 +08:00
}
function openHyd() {
let obj = {
type: 1,
title: '监控活跃度分析',
id: ''
}
openIframeByParamObj3("hyd_detail", "监控活跃度分析", "../supplement/child/monitoring_hyd_list.html", "62%", "85%", obj);
2024-12-11 15:02:17 +08:00
}