|
|
@ -1,179 +1,114 @@
|
|
|
|
|
|
|
|
//监控单元列表
|
|
|
|
$(() => {
|
|
|
|
$(() => {
|
|
|
|
var monitorUnitCharts = echarts.init(document.getElementById("monitorUnitCharts"));
|
|
|
|
|
|
|
|
let series = [];
|
|
|
|
$.ajax({
|
|
|
|
let pieDatas = [
|
|
|
|
url: '/iot/index/getMonitorUnitCharts',
|
|
|
|
{
|
|
|
|
type: 'GET',
|
|
|
|
"value": 30,
|
|
|
|
dataType: 'JSON',
|
|
|
|
"name": "隔离开关"
|
|
|
|
success: function (datas) {
|
|
|
|
},
|
|
|
|
pieChart(datas, document.getElementById("monitorUnitCharts"));
|
|
|
|
{
|
|
|
|
},
|
|
|
|
"value": 14,
|
|
|
|
error: function (e) {
|
|
|
|
"name": "电流互感器"
|
|
|
|
console.log("异常:" + e)
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"value": 26,
|
|
|
|
|
|
|
|
"name": "电压互感器"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"value": 20,
|
|
|
|
|
|
|
|
"name": "变压器"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"value": 10,
|
|
|
|
|
|
|
|
"name": "电容电抗器"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"value": 10,
|
|
|
|
|
|
|
|
"name": "避雷器"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
let maxRadius = 80,
|
|
|
|
|
|
|
|
barWidth = 5,
|
|
|
|
|
|
|
|
barGap = 5;
|
|
|
|
|
|
|
|
let sumValue = 0;
|
|
|
|
|
|
|
|
let showValue = true,showPercent = true;
|
|
|
|
|
|
|
|
pieDatas.map(item => {
|
|
|
|
|
|
|
|
sumValue += item.value;
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let barColor = [
|
|
|
|
|
|
|
|
{
|
|
|
|
$.ajax({
|
|
|
|
"color1": "rgba(222, 125, 255, 1)",
|
|
|
|
url: '/iot/index/getMonitorUnitInfo',
|
|
|
|
"color2": ""
|
|
|
|
type: 'GET',
|
|
|
|
},
|
|
|
|
dataType: 'JSON',
|
|
|
|
{
|
|
|
|
success: function (datas) {
|
|
|
|
"color1": "rgba(250, 118, 121, 1)",
|
|
|
|
listTable(datas, "#monitorUnitTable");
|
|
|
|
"color2": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
error: function (e) {
|
|
|
|
{
|
|
|
|
console.log("异常:" + e)
|
|
|
|
"color1": "rgba(53, 198, 215, 1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"color1": "rgba(101, 223, 138, 1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"color1": "rgba(253, 161, 79, 1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"color1": "rgba(68,165,255,1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
})
|
|
|
|
pieDatas.map((item, i) => {
|
|
|
|
})
|
|
|
|
series.push({
|
|
|
|
|
|
|
|
type: 'pie',
|
|
|
|
//传感器状态统计
|
|
|
|
clockWise: false, //顺时加载
|
|
|
|
$(() => {
|
|
|
|
hoverAnimation: false, //鼠标移入变大
|
|
|
|
|
|
|
|
radius: [(maxRadius - i * (barGap + barWidth)) + '%', (maxRadius - (i + 1) * barWidth - i * barGap) + '%'],
|
|
|
|
$.ajax({
|
|
|
|
center: [ "30%", "50%"],
|
|
|
|
url: '/iot/index/getSensorStateCharts',
|
|
|
|
label: {
|
|
|
|
type: 'GET',
|
|
|
|
show: false
|
|
|
|
dataType: 'JSON',
|
|
|
|
},
|
|
|
|
success: function (datas) {
|
|
|
|
itemStyle: {
|
|
|
|
barChats(datas, document.getElementById('monitorStateCharts'));
|
|
|
|
label: {
|
|
|
|
},
|
|
|
|
show: false,
|
|
|
|
error: function (e) {
|
|
|
|
},
|
|
|
|
console.log("异常:" + e)
|
|
|
|
labelLine: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
borderWidth: 5,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
data: [{
|
|
|
|
|
|
|
|
value: item.value,
|
|
|
|
|
|
|
|
name: item.name,
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
color: barColor[i]&&barColor[i].color1 || 'rgba(68,165,255,1)'
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
|
|
|
|
value: sumValue - item.value,
|
|
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
color: "transparent",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
hoverAnimation: false
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
series.push({
|
|
|
|
|
|
|
|
name: 'blank',
|
|
|
|
$.ajax({
|
|
|
|
type: 'pie',
|
|
|
|
url: '/iot/index/getSensorStateInfo',
|
|
|
|
silent: true,
|
|
|
|
type: 'GET',
|
|
|
|
z: 0,
|
|
|
|
dataType: 'JSON',
|
|
|
|
clockWise: false, //顺时加载
|
|
|
|
success: function (datas) {
|
|
|
|
hoverAnimation: false, //鼠标移入变大
|
|
|
|
listTable(datas, "#monitorStateTable");
|
|
|
|
radius: [(maxRadius - i * (barGap + barWidth)) + '%', (maxRadius - (i + 1) * barWidth - i * barGap) + '%'],
|
|
|
|
},
|
|
|
|
center: [ "30%", "50%"],
|
|
|
|
error: function (e) {
|
|
|
|
label: {
|
|
|
|
console.log("异常:" + e)
|
|
|
|
show: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
label: {
|
|
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
labelLine: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
borderWidth: 5,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
data: [{
|
|
|
|
|
|
|
|
value: 1,
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
color: "rgba(255, 255, 255,.13)",
|
|
|
|
|
|
|
|
borderWidth: 0
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
hoverAnimation: false
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
var monitorUnitOption = {
|
|
|
|
|
|
|
|
grid: {
|
|
|
|
|
|
|
|
left: 0,
|
|
|
|
|
|
|
|
right: 0,
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
trigger: "item",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
legend: {
|
|
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
left: '60%',
|
|
|
|
|
|
|
|
top: 'middle',
|
|
|
|
|
|
|
|
icon: "circle",
|
|
|
|
|
|
|
|
itemWidth: 10,
|
|
|
|
|
|
|
|
itemHeight: 10,
|
|
|
|
|
|
|
|
itemGap: 2,
|
|
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
formatter: (name) => {
|
|
|
|
|
|
|
|
var datas = pieDatas;
|
|
|
|
|
|
|
|
let total = 0;
|
|
|
|
|
|
|
|
datas.map(item => {
|
|
|
|
|
|
|
|
total += (item.value - 0)
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let valueIndex = datas.map(item => item.name).indexOf(name);
|
|
|
|
|
|
|
|
return name + " " + (showValue ? datas[valueIndex].value + (monitorUnitOption.legendValueUnit || '') + ' ' : '') ;
|
|
|
|
|
|
|
|
} ,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
series: series,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
monitorUnitCharts.setOption(monitorUnitOption);
|
|
|
|
//告警统计
|
|
|
|
$(window).resize(monitorUnitCharts.resize);
|
|
|
|
$(() => {
|
|
|
|
|
|
|
|
//告警数量
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
url: '/iot/index/getAlarmAmount',
|
|
|
|
|
|
|
|
type: 'GET',
|
|
|
|
|
|
|
|
dataType: 'JSON',
|
|
|
|
|
|
|
|
success: function (datas) {
|
|
|
|
|
|
|
|
barChats(datas, document.getElementById('alarmStatistics'));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function (e) {
|
|
|
|
|
|
|
|
console.log("异常:" + e)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
//告警趋势
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
url: '/iot/index/getAlarmTrend',
|
|
|
|
|
|
|
|
type: 'GET',
|
|
|
|
|
|
|
|
dataType: 'JSON',
|
|
|
|
|
|
|
|
success: function (datas) {
|
|
|
|
|
|
|
|
lineCharts(datas, document.getElementById("alarmTrend"));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function (e) {
|
|
|
|
|
|
|
|
console.log("异常:" + e)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
/*传感器状态统计*/
|
|
|
|
//自定义table
|
|
|
|
var monitorStateCharts = echarts.init(document.getElementById('monitorStateCharts'));
|
|
|
|
function listTable(datas, id) {
|
|
|
|
var colorArray = [
|
|
|
|
let info = '<table style="width: 100%;height: 100%;">';
|
|
|
|
|
|
|
|
info += '<thead><tr style="height: 20%;width: 100%;">';
|
|
|
|
|
|
|
|
datas.header.map(x => {
|
|
|
|
|
|
|
|
info += '<th style="text-align:center;color:#01F2F8;font-weight:bold">' + x + '</th>';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
info += '</tr></thead>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info += '<tbody>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
datas.data.map(x => {
|
|
|
|
|
|
|
|
info += '<tr style="height: 20%;width: 100%;">';
|
|
|
|
|
|
|
|
x.forEach(y => {
|
|
|
|
|
|
|
|
info += '<td style="text-align:center;color:#01F2F8;">' + y + '</td>';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
info += '</tr>';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
info += '</tbody>';
|
|
|
|
|
|
|
|
info += "</table>";
|
|
|
|
|
|
|
|
$(id).html(info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//柱状图表
|
|
|
|
|
|
|
|
function barChats(datas, id) {
|
|
|
|
|
|
|
|
let charts = echarts.init(id);
|
|
|
|
|
|
|
|
let colorArray = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
top: '#00F7FE', //黄
|
|
|
|
top: '#00F7FE', //黄
|
|
|
|
bottom: 'rgba(30,172,244)'
|
|
|
|
bottom: 'rgba(30,172,244)'
|
|
|
@ -189,7 +124,7 @@ $(()=>{
|
|
|
|
bottom: 'rgba(32,97,245)'
|
|
|
|
bottom: 'rgba(32,97,245)'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
var monitorStateOptions = {
|
|
|
|
let options = {
|
|
|
|
tooltip: {
|
|
|
|
tooltip: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
formatter: "{b}:{c}"
|
|
|
|
formatter: "{b}:{c}"
|
|
|
@ -245,7 +180,7 @@ $(()=>{
|
|
|
|
color: '#fff',
|
|
|
|
color: '#fff',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: ['异常', '测试', '故障', '正常']
|
|
|
|
data: datas.yAxis
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -315,171 +250,168 @@ $(()=>{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
barGap: '0%',
|
|
|
|
barGap: '0%',
|
|
|
|
barCategoryGap: '50%',
|
|
|
|
barCategoryGap: '50%',
|
|
|
|
data: [60, 132, 89, 100]
|
|
|
|
data: datas.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
charts.setOption(options);
|
|
|
|
|
|
|
|
$(window).resize(charts.resize);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
monitorStateCharts.setOption(monitorStateOptions);
|
|
|
|
//饼状图
|
|
|
|
$(window).resize(monitorStateCharts.resize);
|
|
|
|
function pieChart(pieDatas, id) {
|
|
|
|
|
|
|
|
let charts = echarts.init(id);
|
|
|
|
|
|
|
|
let series = [];
|
|
|
|
|
|
|
|
|
|
|
|
/*告警数量统计*/
|
|
|
|
let maxRadius = 80,
|
|
|
|
var alarmStatisticsCharts = echarts.init(document.getElementById('alarmStatistics'));
|
|
|
|
barWidth = 5,
|
|
|
|
var alarmColorArray = [
|
|
|
|
barGap = 5;
|
|
|
|
|
|
|
|
let sumValue = 0;
|
|
|
|
|
|
|
|
let showValue = true, showPercent = true;
|
|
|
|
|
|
|
|
pieDatas.map(item => {
|
|
|
|
|
|
|
|
sumValue += item.value;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
let barColor = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
top: '#00F7FE', //黄
|
|
|
|
"color1": "rgba(222, 125, 255, 1)",
|
|
|
|
bottom: 'rgba(30,172,244)'
|
|
|
|
"color2": ""
|
|
|
|
}, {
|
|
|
|
|
|
|
|
top: '#87FFD2', //绿
|
|
|
|
|
|
|
|
bottom: 'rgba(1,248,255)'
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
top: '#FE8A03', //蓝
|
|
|
|
"color1": "rgba(250, 118, 121, 1)",
|
|
|
|
bottom: 'rgba(247,67,30)'
|
|
|
|
"color2": ""
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
top: '#01B9FF', //深蓝
|
|
|
|
{
|
|
|
|
bottom: 'rgba(32,97,245)'
|
|
|
|
"color1": "rgba(53, 198, 215, 1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"color1": "rgba(101, 223, 138, 1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"color1": "rgba(253, 161, 79, 1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"color1": "rgba(68,165,255,1)",
|
|
|
|
|
|
|
|
"color2": ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
var alarmStatisticsOptions = {
|
|
|
|
pieDatas.map((item, i) => {
|
|
|
|
tooltip: {
|
|
|
|
series.push({
|
|
|
|
show: true,
|
|
|
|
type: 'pie',
|
|
|
|
formatter: "{b}:{c}"
|
|
|
|
clockWise: false, //顺时加载
|
|
|
|
|
|
|
|
hoverAnimation: false, //鼠标移入变大
|
|
|
|
|
|
|
|
radius: [(maxRadius - i * (barGap + barWidth)) + '%', (maxRadius - (i + 1) * barWidth - i * barGap) + '%'],
|
|
|
|
|
|
|
|
center: ["30%", "50%"],
|
|
|
|
|
|
|
|
label: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
grid: {
|
|
|
|
itemStyle: {
|
|
|
|
left: '3%',
|
|
|
|
label: {
|
|
|
|
top: '5%',
|
|
|
|
show: false,
|
|
|
|
right: '5%',
|
|
|
|
|
|
|
|
bottom: '5%',
|
|
|
|
|
|
|
|
containLabel: true
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
labelLine: {
|
|
|
|
xAxis: {
|
|
|
|
|
|
|
|
type: 'value',
|
|
|
|
|
|
|
|
show:true,
|
|
|
|
|
|
|
|
position: 'bottom',
|
|
|
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
axisLine: {
|
|
|
|
borderWidth: 5,
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
splitLine: {
|
|
|
|
data: [{
|
|
|
|
lineStyle: {
|
|
|
|
value: item.value,
|
|
|
|
type:'dashed',
|
|
|
|
name: item.name,
|
|
|
|
color: ['#315070'],
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
color: barColor[i] && barColor[i].color1 || 'rgba(68,165,255,1)'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
value: sumValue - item.value,
|
|
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
color: "transparent",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
show: true,
|
|
|
|
tooltip: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
hoverAnimation: false
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
series.push({
|
|
|
|
|
|
|
|
name: 'blank',
|
|
|
|
|
|
|
|
type: 'pie',
|
|
|
|
|
|
|
|
silent: true,
|
|
|
|
|
|
|
|
z: 0,
|
|
|
|
|
|
|
|
clockWise: false, //顺时加载
|
|
|
|
|
|
|
|
hoverAnimation: false, //鼠标移入变大
|
|
|
|
|
|
|
|
radius: [(maxRadius - i * (barGap + barWidth)) + '%', (maxRadius - (i + 1) * barWidth - i * barGap) + '%'],
|
|
|
|
|
|
|
|
center: ["30%", "50%"],
|
|
|
|
|
|
|
|
label: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
yAxis: [{
|
|
|
|
itemStyle: {
|
|
|
|
type: 'category',
|
|
|
|
label: {
|
|
|
|
axisTick: {
|
|
|
|
|
|
|
|
show: false,
|
|
|
|
show: false,
|
|
|
|
alignWithLabel: false,
|
|
|
|
|
|
|
|
length: 5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"splitLine": { //网格线
|
|
|
|
labelLine: {
|
|
|
|
lineStyle: {
|
|
|
|
show: false
|
|
|
|
type:'dashed',
|
|
|
|
|
|
|
|
color: ['#315070'],
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"show": true
|
|
|
|
borderWidth: 5,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inverse: 'true', //排序
|
|
|
|
data: [{
|
|
|
|
axisLine: {
|
|
|
|
value: 1,
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
color: "rgba(255, 255, 255,.13)",
|
|
|
|
|
|
|
|
borderWidth: 0
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
|
|
show: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
hoverAnimation: false
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
let option = {
|
|
|
|
|
|
|
|
grid: {
|
|
|
|
|
|
|
|
left: 0,
|
|
|
|
|
|
|
|
right: 0,
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tooltip: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
lineStyle: {
|
|
|
|
trigger: "item",
|
|
|
|
color: '#fff',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: ['设备高温', '设备振动', '烟雾火情', '环境大风']
|
|
|
|
legend: {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
series: [{
|
|
|
|
|
|
|
|
name: '数量',
|
|
|
|
|
|
|
|
type: 'bar',
|
|
|
|
|
|
|
|
label: {
|
|
|
|
|
|
|
|
normal: {
|
|
|
|
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
position: 'right',
|
|
|
|
left: '60%',
|
|
|
|
formatter: '{c}',
|
|
|
|
top: 'middle',
|
|
|
|
|
|
|
|
icon: "circle",
|
|
|
|
|
|
|
|
itemWidth: 10,
|
|
|
|
|
|
|
|
itemHeight: 10,
|
|
|
|
|
|
|
|
itemGap: 2,
|
|
|
|
textStyle: {
|
|
|
|
textStyle: {
|
|
|
|
color: 'white' //color of value
|
|
|
|
fontSize: 12,
|
|
|
|
}
|
|
|
|
color: '#fff',
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemStyle: {
|
|
|
|
formatter: (name) => {
|
|
|
|
normal: {
|
|
|
|
var datas = pieDatas;
|
|
|
|
show: true,
|
|
|
|
let total = 0;
|
|
|
|
color: function(params) {
|
|
|
|
datas.map(item => {
|
|
|
|
let num = colorArray.length;
|
|
|
|
total += (item.value - 0)
|
|
|
|
return {
|
|
|
|
})
|
|
|
|
type: 'linear',
|
|
|
|
let valueIndex = datas.map(item => item.name).indexOf(name);
|
|
|
|
colorStops: [{
|
|
|
|
return name + " " + (showValue ? datas[valueIndex].value + (option.legendValueUnit || '') + ' ' : '');
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].bottom
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].top
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].bottom
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].top
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].bottom
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].top
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].bottom
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].top
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].bottom
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].top
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].bottom
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: alarmColorArray[params.dataIndex % num].top
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
//globalCoord: false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
borderWidth: 0,
|
|
|
|
|
|
|
|
borderColor: '#333',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
barGap: '0%',
|
|
|
|
series: series,
|
|
|
|
barCategoryGap: '50%',
|
|
|
|
|
|
|
|
data: [60, 132, 89, 100]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
alarmStatisticsCharts.setOption(alarmStatisticsOptions);
|
|
|
|
charts.setOption(option);
|
|
|
|
$(window).resize(alarmStatisticsCharts.resize);
|
|
|
|
$(window).resize(charts.resize);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*告警趋势*/
|
|
|
|
//折线图
|
|
|
|
var alarmTrendCharts = echarts.init(document.getElementById("alarmTrend"));
|
|
|
|
function lineCharts(datas, id) {
|
|
|
|
var alarmTrendOptions = {
|
|
|
|
let charts = echarts.init(id);
|
|
|
|
|
|
|
|
let options = {
|
|
|
|
tooltip: {
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'axis',
|
|
|
|
trigger: 'axis',
|
|
|
|
axisPointer: {
|
|
|
|
axisPointer: {
|
|
|
@ -505,20 +437,11 @@ $(()=>{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// legend: {
|
|
|
|
|
|
|
|
// data: ['系统设备','报警装置'],
|
|
|
|
|
|
|
|
// textStyle: {
|
|
|
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
|
|
|
// color: 'rgb(0,253,255,0.6)'
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// right: '4%'
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
grid: {
|
|
|
|
grid: {
|
|
|
|
top: '10%',
|
|
|
|
top: '10%',
|
|
|
|
left: '14%',
|
|
|
|
left: '14%',
|
|
|
|
right: '10%',
|
|
|
|
right: '10%',
|
|
|
|
bottom: '15%',
|
|
|
|
bottom: '15%',
|
|
|
|
// containLabel: true
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
xAxis: [{
|
|
|
|
xAxis: [{
|
|
|
|
type: 'category',
|
|
|
|
type: 'category',
|
|
|
@ -535,7 +458,7 @@ $(()=>{
|
|
|
|
show: false
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
boundaryGap: false,
|
|
|
|
boundaryGap: false,
|
|
|
|
data: ["06-21","06-22","06-23","06-24","06-25","06-26","06-27"]//this.$moment(data.times).format("HH-mm") ,
|
|
|
|
data: datas.xAxis//this.$moment(data.times).format("HH-mm") ,
|
|
|
|
|
|
|
|
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
|
|
|
|
|
|
|
@ -604,11 +527,11 @@ $(()=>{
|
|
|
|
], false),
|
|
|
|
], false),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: [3,5,4,2,1,7,6]//data.values
|
|
|
|
data: datas.data//data.values
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
alarmTrendCharts.setOption(alarmTrendOptions);
|
|
|
|
charts.setOption(options);
|
|
|
|
$(window).resize(alarmTrendCharts.resize);
|
|
|
|
$(window).resize(charts.resize);
|
|
|
|
})
|
|
|
|
}
|