876 lines
41 KiB
Plaintext
876 lines
41 KiB
Plaintext
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>首页</title>
|
||
<meta name="renderer" content="webkit">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||
<link rel="stylesheet" href="~/lib/layui/css/layui.css?v=@HT.Cloud.Code.GlobalContext.GetVersion()" media="all">
|
||
<link rel="stylesheet" href="~/lib/font-awesome-4.7.0/css/font-awesome.min.css?v=@HT.Cloud.Code.GlobalContext.GetVersion()" media="all">
|
||
<link rel="stylesheet" href="~/css/public.css?v=@HT.Cloud.Code.GlobalContext.GetVersion()" media="all">
|
||
<script src="~/lib/jquery-3.4.1/jquery-3.4.1.min.js?v=@HT.Cloud.Code.GlobalContext.GetVersion()" charset="utf-8"></script>
|
||
<script type="text/javascript" src="~/lib/echarts-5.3.0/dist/echarts.js"></script>
|
||
<style>
|
||
|
||
.layui-card {
|
||
border: 1px solid #f2f2f2;
|
||
border-radius: 5px;
|
||
overflow: auto;
|
||
}
|
||
|
||
.icon {
|
||
margin-right: 10px;
|
||
color: #1aa094;
|
||
}
|
||
|
||
.icon-cray {
|
||
color: #ffb800 !important;
|
||
}
|
||
|
||
.icon-blue {
|
||
color: #1e9fff !important;
|
||
}
|
||
|
||
.icon-tip {
|
||
color: #ff5722 !important;
|
||
}
|
||
|
||
.layuimini-qiuck-module {
|
||
text-align: center;
|
||
margin-top: 10px
|
||
}
|
||
|
||
.layuimini-qiuck-module a i {
|
||
display: inline-block;
|
||
width: 100%;
|
||
height: 60px;
|
||
line-height: 60px;
|
||
text-align: center;
|
||
border-radius: 2px;
|
||
font-size: 30px;
|
||
background-color: #F8F8F8;
|
||
color: black;
|
||
transition: all .3s;
|
||
-webkit-transition: all .3s;
|
||
}
|
||
|
||
.layuimini-qiuck-module a cite {
|
||
position: relative;
|
||
top: 2px;
|
||
display: block;
|
||
color: black;
|
||
text-overflow: ellipsis;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.welcome-module {
|
||
width: 100%;
|
||
height: 210px;
|
||
}
|
||
|
||
.panel {
|
||
background-color: #fff;
|
||
border: 1px solid transparent;
|
||
border-radius: 3px;
|
||
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||
box-shadow: 0 1px 1px rgba(0,0,0,.05)
|
||
}
|
||
|
||
.panel-body {
|
||
padding: 10px
|
||
}
|
||
|
||
.panel-title {
|
||
margin-top: 0;
|
||
margin-bottom: 0;
|
||
font-size: 12px;
|
||
color: inherit
|
||
}
|
||
|
||
.label {
|
||
display: inline;
|
||
padding: .2em .6em .3em;
|
||
font-size: 75%;
|
||
font-weight: 700;
|
||
line-height: 1;
|
||
color: #fff;
|
||
text-align: center;
|
||
white-space: nowrap;
|
||
vertical-align: baseline;
|
||
border-radius: .25em;
|
||
margin-top: .3em;
|
||
}
|
||
|
||
.layui-red {
|
||
color: red
|
||
}
|
||
|
||
.main_btn > p {
|
||
height: 40px;
|
||
}
|
||
|
||
.layui-bg-number {
|
||
background-color: #F8F8F8;
|
||
}
|
||
|
||
.layuimini-notice:hover {
|
||
background: #f6f6f6;
|
||
}
|
||
|
||
.layuimini-notice {
|
||
padding: 7px 16px;
|
||
clear: both;
|
||
font-size: 12px !important;
|
||
cursor: pointer;
|
||
position: relative;
|
||
transition: background 0.2s ease-in-out;
|
||
}
|
||
|
||
.layuimini-notice-title, .layuimini-notice-label {
|
||
padding-right: 70px !important;
|
||
text-overflow: ellipsis !important;
|
||
overflow: hidden !important;
|
||
white-space: nowrap !important;
|
||
}
|
||
|
||
.layuimini-notice-title {
|
||
line-height: 28px;
|
||
font-size: 14px;
|
||
color: black;
|
||
}
|
||
|
||
.layuimini-notice-extra {
|
||
position: absolute;
|
||
top: 50%;
|
||
margin-top: -8px;
|
||
right: 16px;
|
||
display: inline-block;
|
||
height: 16px;
|
||
color: #999;
|
||
}
|
||
|
||
.layui-table {
|
||
width: 100%;
|
||
margin: 10px 0;
|
||
background-color: #fff;
|
||
color: black;
|
||
}
|
||
|
||
.layui-text {
|
||
line-height: 1.6;
|
||
font-size: 14px;
|
||
color: black;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="layuimini-container">
|
||
<div class="layuimini-main">
|
||
<div class="layui-row layui-col-space15">
|
||
<div class="layui-col-md12">
|
||
<div class="layui-row layui-col-space15">
|
||
<div class="layui-col-md12">
|
||
<div class="layui-card">
|
||
<div class="layui-card-header"><i class="fa fa-warning icon"></i>设备状态</div>
|
||
<div class="layui-card-body">
|
||
<div class="welcome-module">
|
||
<div class="layui-row layui-col-space10">
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="T1_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="T1"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id ="T2_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="T2"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="T3_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="T3"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="T4_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="T4"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="B1_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="B1"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="B2_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="B2"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="B3_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="B3"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="B4_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="B4"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S1_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S1"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S2_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S2"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S3_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S3"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S4_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S4"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S5_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S5"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S6_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S6"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S7_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S7"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-xs3">
|
||
<div class="panel layui-bg-number">
|
||
<div class="panel-body">
|
||
<div class="panel-title">
|
||
<h5 id="S8_Title"></h5>
|
||
</div>
|
||
<div class="panel-content">
|
||
<h1 class="no-margins" id="S8"></h1>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-md12">
|
||
<div class="layui-card">
|
||
<div class="layui-card-header"><i class="fa fa-line-chart icon"></i>生产统计</div>
|
||
<div class="layui-card-body">
|
||
<div id="echarts-records" style="width: 100%;min-height:400px"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@* <div class="layui-col-md3">
|
||
<div class="layui-col-md12">
|
||
<div class="layui-card">
|
||
<div class="layui-card-header"><i class="fa fa-warning icon"></i>最近重点告警</div>
|
||
<div class="layui-card-body">
|
||
<div class="layui-row layui-col-space10">
|
||
<table class="layui-table" id="tabletoday">
|
||
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="layui-card">
|
||
<div class="layui-card-header"><i class="fa fa-warning icon"></i>近期重点告警</div>
|
||
<div class="layui-card-body">
|
||
<div class="layui-row layui-col-space10">
|
||
<table class="layui-table" id="tableweek">
|
||
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div> *@
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script src="~/lib/layui/layui.js?v=@HT.Cloud.Code.GlobalContext.GetVersion()" charset="utf-8"></script>
|
||
<script src="~/js/lay-config.js?v=@HT.Cloud.Code.GlobalContext.GetVersion()" charset="utf-8"></script>
|
||
<script src="~/js/framework-ui.js?v=@HT.Cloud.Code.GlobalContext.GetVersion()"></script>
|
||
<script>
|
||
//// 公告赋值
|
||
//$(function () {
|
||
// noticeInfo();
|
||
// quickModuleInfo();
|
||
// loadInfo();
|
||
//});
|
||
|
||
|
||
|
||
//记录信息 更改为赋值实时数据初始值
|
||
loadInfo = async function () {
|
||
$.ajax({
|
||
url: "/ReportManage/MainPage/GetRtData",
|
||
Type: "Get",
|
||
success: function (redata) {
|
||
var data = JSON.parse(redata);
|
||
$('#T1').html(data.T1);
|
||
$('#T2').html(data.T2);
|
||
$('#T3').html(data.T3);
|
||
$('#T4').html(data.T4);
|
||
$('#B1').html(data.B1);
|
||
$('#B2').html(data.B2);
|
||
$('#B3').html(data.B3);
|
||
$('#B4').html(data.B4);
|
||
$('#S1').html(data.S1);
|
||
$('#S2').html(data.S2);
|
||
$('#S3').html(data.S3);
|
||
$('#S4').html(data.S4);
|
||
$('#S5').html(data.S5);
|
||
$('#S6').html(data.S6);
|
||
$('#S7').html(data.S7);
|
||
$('#S8').html(data.S8);
|
||
|
||
|
||
//var myChart = echarts.init(document.getElementById('echarts-records'));
|
||
//var option = myChart.getOption();
|
||
//let xData = data.RtTime;
|
||
//let yData = data.HT_GMJ_VP;
|
||
////option.series[0].data.push(yData);
|
||
//if (option.xAxis[0].data.length > 34) {
|
||
// option.xAxis[0].data.shift();
|
||
// option.series[0].data.shift();
|
||
|
||
//}
|
||
//option.xAxis[0].data.push(xData);
|
||
//option.series[0].data.push(yData);
|
||
|
||
|
||
//myChart.setOption(option);
|
||
}
|
||
});
|
||
$.ajax({
|
||
url: "/ReportManage/MainPage/GetRtChartData",
|
||
Type: "Get",
|
||
success: function (redata) {
|
||
var data = JSON.parse(redata);
|
||
|
||
|
||
|
||
var myChart = echarts.init(document.getElementById('echarts-records'));
|
||
var option = myChart.getOption();
|
||
//let xData = data.RtTime;
|
||
//let yData = data.HT_GMJ_VP;
|
||
//option.series[0].data.push(yData);
|
||
if (option.xAxis[0].data.length > 34) {
|
||
option.xAxis[0].data.shift();
|
||
for (var i = 0; i < data.length; i++) {
|
||
option.series[i].data.shift();
|
||
}
|
||
// option.series[0].data.shift();
|
||
|
||
}
|
||
//option.xAxis[0].data.push(xData);
|
||
//option.series[0].data.push(yData);
|
||
|
||
|
||
|
||
|
||
option.xAxis[0].data.push(data[0].RtTime);
|
||
//var yData = [];
|
||
for (var i = 0; i < data.length; i++) {
|
||
option.series[i].data.push(data[i].Value)
|
||
}
|
||
|
||
|
||
myChart.setOption(option);
|
||
}
|
||
});
|
||
}
|
||
|
||
layui.use(['layer', 'miniTab', 'common','table'], function () {
|
||
var $ = layui.jquery,
|
||
layer = layui.layer,
|
||
miniTab = layui.miniTab,
|
||
table = layui.table,
|
||
common = layui.common;
|
||
|
||
|
||
// var inst = table.render({
|
||
// elem: '#tabletoday',
|
||
// cols: [[ //标题栏
|
||
// { field: 'AlmName', title: '报警名称', minwidth: 150 },
|
||
// { field: 'AlmSys', title: '系统', width: 80 },
|
||
// { field: 'Frequency', title: '次数', width: 80 },
|
||
// ]],
|
||
// data: [
|
||
// {
|
||
// "AlmName": "煤气压力高高高三级报警",
|
||
// "AlmSys": "烟气",
|
||
// "Frequency": "8",
|
||
// },
|
||
// {
|
||
// "AlmName": "磨机进口压力高高高三级报警",
|
||
// "AlmSys": "磨机",
|
||
// "Frequency": "6",
|
||
// },
|
||
// {
|
||
// "AlmName": "磨机进口温度高高高三级报警",
|
||
// "AlmSys": "磨机",
|
||
// "Frequency": "5",
|
||
// },
|
||
// {
|
||
// "AlmName": "收粉器压差高高高三级报警",
|
||
// "AlmSys": "收粉",
|
||
// "Frequency": "3",
|
||
// },
|
||
// {
|
||
// "AlmName": "煤粉仓氧浓度高高高三级报警",
|
||
// "AlmSys": "收粉",
|
||
// "Frequency": "3",
|
||
// }
|
||
// ],
|
||
// //skin: 'line', // 表格风格
|
||
// //even: true,
|
||
// height:350,
|
||
// page: false, // 是否显示分页
|
||
// limits: [5, 10, 15],
|
||
// limit: 10 // 每页默认显示的数量
|
||
// });
|
||
// var inst2 = table.render({
|
||
// elem: '#tableweek',
|
||
// cols: [[ //标题栏
|
||
// { field: 'AlmName', title: '报警名称', minwidth: 150 },
|
||
// { field: 'AlmSys', title: '系统', width: 80 },
|
||
// { field: 'Frequency', title: '次数', width: 80 },
|
||
// ]],
|
||
// data: [
|
||
// {
|
||
// "AlmName": "煤气压力高高高三级报警",
|
||
// "AlmSys": "烟气",
|
||
// "Frequency": "21",
|
||
// },
|
||
// {
|
||
// "AlmName": "磨机进口压力高高高三级报警",
|
||
// "AlmSys": "磨机",
|
||
// "Frequency": "19",
|
||
// },
|
||
// {
|
||
// "AlmName": "磨机进口温度高高高三级报警",
|
||
// "AlmSys": "磨机",
|
||
// "Frequency": "16",
|
||
// },
|
||
// {
|
||
// "AlmName": "收粉器压差高高高三级报警",
|
||
// "AlmSys": "收粉",
|
||
// "Frequency": "14",
|
||
// },
|
||
// {
|
||
// "AlmName": "煤粉仓氧浓度高高高三级报警",
|
||
// "AlmSys": "收粉",
|
||
// "Frequency": "8",
|
||
// },
|
||
// {
|
||
// "AlmName": "原煤仓料位低低低三级报警",
|
||
// "AlmSys": "收粉",
|
||
// "Frequency": "4",
|
||
// }
|
||
// ],
|
||
// //skin: 'line', // 表格风格
|
||
// //even: true,
|
||
// height: 350,
|
||
// page: false, // 是否显示分页
|
||
// limits: [5, 10, 15],
|
||
// limit: 10 // 每页默认显示的数量
|
||
// });
|
||
|
||
|
||
var StaticChartList = new Array();
|
||
const CHARTSRGB = ["#8B2252", "#C65911", "#0000EE", "#00F5FF", "#00E5EE", "#27408B", "#FFD700", "#7FFFD4", "#B22222", "#EE7621", "#00C5CD", "#A0522D", "#1E90FF", "#00868B", "#8B4513", "#8B3A3A", "#CD6600", "#CD853F", "#EE7942"
|
||
, "#D2691E", "#8B008B", "#FFEC8B", "#8B4513", "#CDC673", "#EEEE00", "#FFA500", "#FFD966"];
|
||
//获取并初始化界面标题
|
||
$(function () {
|
||
$.ajax({
|
||
url: "/ReportManage/MainPage/GetMainPageInit",
|
||
Type: "Get",
|
||
success: function (redata) {
|
||
var dataInit = JSON.parse(redata);
|
||
loadInitTile(dataInit);
|
||
}
|
||
});
|
||
});
|
||
|
||
$(function () {
|
||
$.ajax({
|
||
url: "/ReportManage/MainPage/GetMainPageChartInit",
|
||
Type: "Get",
|
||
success: function (redata) {
|
||
var dataInit = JSON.parse(redata);
|
||
StaticChartList = dataInit;
|
||
loadChart(StaticChartList);
|
||
//loadChart(dataInit.RtTime, dataInit.HT_GMJ_VP);
|
||
}
|
||
});
|
||
});
|
||
miniTab.listen();
|
||
common.iframeInterval(function () {
|
||
loadInfo();
|
||
//noticeInfo();
|
||
//quickModuleInfo();
|
||
}, 1000); //指定1秒刷新一次
|
||
|
||
function loadInitTile(Tdata) {
|
||
$('#T1_Title').html(Tdata.T1_Title);
|
||
$('#T2_Title').html(Tdata.T2_Title);
|
||
$('#T3_Title').html(Tdata.T3_Title);
|
||
$('#T4_Title').html(Tdata.T4_Title);
|
||
$('#B1_Title').html(Tdata.B1_Title);
|
||
$('#B2_Title').html(Tdata.B2_Title);
|
||
$('#B3_Title').html(Tdata.B3_Title);
|
||
$('#B4_Title').html(Tdata.B4_Title);
|
||
$('#S1_Title').html(Tdata.S1_Title);
|
||
$('#S2_Title').html(Tdata.S2_Title);
|
||
$('#S3_Title').html(Tdata.S3_Title);
|
||
$('#S4_Title').html(Tdata.S4_Title);
|
||
$('#S5_Title').html(Tdata.S5_Title);
|
||
$('#S6_Title').html(Tdata.S6_Title);
|
||
$('#S7_Title').html(Tdata.S7_Title);
|
||
$('#S8_Title').html(Tdata.S8_Title);
|
||
}
|
||
/**
|
||
* 报表功能
|
||
*/
|
||
function loadChart(dataInit) {
|
||
var xData = [];
|
||
xData.push(dataInit[0].RtTime);
|
||
var yData = [];
|
||
for (var i = 0; i < dataInit.length ; i++)
|
||
{
|
||
var yAxisdata = [];
|
||
yAxisdata.push(dataInit[i].Value)
|
||
yData.push(yAxisdata);
|
||
}
|
||
var legendArr = [];
|
||
var colorArr = [];
|
||
var ySeries = [];
|
||
for (var ci = 0; ci < yData.length; ci++)
|
||
{
|
||
colorArr.push(CHARTSRGB[ci])
|
||
legendArr.push(StaticChartList[ci].Description);
|
||
ySeries.push(
|
||
{
|
||
// symbol: "none",
|
||
name: StaticChartList[ci].Description,
|
||
type: 'line',
|
||
data: yData[ci],
|
||
lineStyle: {
|
||
normal: {
|
||
width: 2
|
||
}
|
||
},
|
||
label: {
|
||
show: true, // 在折线拐点上显示数据
|
||
position: 'bottom',
|
||
textStyle: {
|
||
color: 'black',
|
||
fontSize: 10
|
||
}
|
||
},
|
||
smooth: true,
|
||
symbol: 'circle',
|
||
symbolSize: 1,
|
||
showAllSymbol: true,
|
||
color: colorArr[ci],
|
||
}
|
||
)
|
||
|
||
}
|
||
|
||
var myChart = echarts.init(document.getElementById('echarts-records'));
|
||
//var xData = [];
|
||
//var yData = [];
|
||
//xData.push(sxdata);
|
||
//yData.push(sydata);
|
||
//var cpuData = [];
|
||
//common.ajax({
|
||
// url: "/SystemSecurity/ServerMonitoring/GetServerData",
|
||
// dataType: "json",
|
||
// async: false,
|
||
// success: function (data) {
|
||
// var length = data.length;
|
||
// for (var i = 0; i < length; i++) {
|
||
// if (data[i]['F_Date'] !== null) {
|
||
// xData.push(new Date(data[i]['F_Date']).Format("yyyy-MM-dd"));
|
||
// }
|
||
// if (data[i]['F_ARM'] !== null) {
|
||
// armData.push(data[i]['F_ARM']);
|
||
// }
|
||
// if (data[i]['F_CPU'] !== null) {
|
||
// cpuData.push(data[i]['F_CPU']);
|
||
// }
|
||
// }
|
||
// }
|
||
//});
|
||
option = {
|
||
tooltip: {
|
||
trigger: 'axis'
|
||
},
|
||
legend: {
|
||
data: legendArr
|
||
},
|
||
toolbox: {
|
||
feature: {
|
||
myTool1: {
|
||
show: true,
|
||
title: '显示数据',
|
||
icon: 'path d="M698.71 301.02c-60.96-46.64-122.59-69.073-186.71-69.073S386.25 254.38 325.29 301.02c-60.699 46.44-120.173 116.59-177.696 210.747 57.534 94.323 117.022 164.595 177.732 211.115 60.956 46.707 122.573 69.17 186.674 69.17 64.1 0 125.718-22.463 186.674-69.17 60.71-46.52 120.198-116.792 177.732-211.115-57.523-94.157-116.997-164.307-177.696-210.747zM512 864c-161.102 0-307.306-112.03-438.613-336.088a31.959 31.959 0 0 1 0.01-32.338C204.702 271.858 350.903 160 512 160c161.097 0 307.298 111.858 438.603 335.574a31.959 31.959 0 0 1 0.01 32.338C819.306 751.971 673.102 864 512 864z m0-128c-123.712 0-224-100.288-224-224s100.288-224 224-224 224 100.288 224 224-100.288 224-224 224z"',
|
||
onclick: function (charts) {
|
||
// var myChart = echarts.init(document.getElementById('echarts-records'));
|
||
var option = charts.option;
|
||
for (var i = 0; i < option.series.length; i++) {
|
||
option.series[i].label.show = true;
|
||
}
|
||
}
|
||
},
|
||
myTool2: {
|
||
show: true,
|
||
title: '隐藏数据',
|
||
icon: 'path d="M359.854 561.713l-48.99 48.991C296.222 580.926 288 547.424 288 512c0-123.712 100.288-224 224-224 35.423 0 68.926 8.223 98.704 22.863l-48.99 48.991C545.864 354.681 529.154 352 512 352c-88.366 0-160 71.634-160 160 0 17.155 2.68 33.865 7.854 49.713z m303.99-100.342l48.89-48.89C727.626 442.46 736 476.253 736 512c0 123.712-100.288 224-224 224-35.747 0-69.538-8.374-99.52-23.266l48.89-48.89C477.49 669.214 494.515 672 512 672c88.366 0 160-71.634 160-160 0-17.486-2.785-34.51-8.156-50.63z m-402.7 201.719L210.222 714c-46.578-49.479-91.533-111.148-134.865-185.008a31.977 31.977 0 0 1 0-32.363C206.63 272.876 352.794 161 513.851 161c66.582 0 130.619 19.12 192.11 57.361l-52.539 52.529c-45.606-25.502-91.813-37.929-139.571-37.929-64.104 0-125.719 22.438-186.663 69.085-60.68 46.446-120.136 116.6-177.64 210.764 36.426 59.648 73.68 109.734 111.595 150.28z m503.674-301.18l50.92-50.91c46.578 49.479 91.533 111.148 134.866 185.008a31.977 31.977 0 0 1 0 32.363C819.332 752.124 673.168 864 512.11 864c-66.582 0-130.62-19.12-192.111-57.361l52.54-52.529c45.606 25.502 91.813 37.929 139.57 37.929 64.105 0 125.72-22.438 186.664-69.085 60.68-46.446 120.136-116.6 177.64-210.764-36.426-59.648-73.68-109.734-111.596-150.28z"',
|
||
onclick: function (charts) {
|
||
var option = charts.option;
|
||
for (var i = 0; i < option.series.length; i++) {
|
||
option.series[i].label.show = false;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
//legend:legendArr,
|
||
xAxis: {
|
||
type: 'category',
|
||
boundaryGap: false,
|
||
data: xData,
|
||
//axisTick: {
|
||
// show: true // 不显示坐标轴刻度线
|
||
//},
|
||
//axisLabel:{
|
||
// show:true
|
||
//},
|
||
splitLine: {
|
||
show: true, //想要不显示网格线,改为false
|
||
lineStyle: {
|
||
// 设置网格为虚线
|
||
type: 'dashed'
|
||
}
|
||
},
|
||
axisLine: {
|
||
show: true,
|
||
lineStyle: {
|
||
color: '#5470C6',
|
||
width: 3
|
||
}
|
||
},
|
||
axisTick: {
|
||
show: true,
|
||
inside: true
|
||
},
|
||
},
|
||
yAxis: {
|
||
name: '',
|
||
nameLocation: 'center',
|
||
axisTick: {
|
||
show:true,
|
||
inside: true
|
||
},
|
||
axisLabel: {
|
||
inside: true,
|
||
align: 'left',
|
||
verticalAlign: 'bottom',
|
||
},
|
||
axisLine: {
|
||
show: true,
|
||
lineStyle: {
|
||
color: '#EE6666',
|
||
width: 3
|
||
}
|
||
},
|
||
splitLine: {
|
||
show: true, //想要不显示网格线,改为false
|
||
lineStyle: {
|
||
// 设置网格为虚线
|
||
type: 'dashed'
|
||
}
|
||
},
|
||
itemStyle: {
|
||
normal: {
|
||
label: {
|
||
show: true // 在折线拐点上显示数据
|
||
},
|
||
}
|
||
},
|
||
//label: {
|
||
// show: true,
|
||
// position: 'top'
|
||
//},
|
||
type: 'value',
|
||
scale: true
|
||
},
|
||
scale:true,
|
||
series:ySeries,
|
||
//series: [
|
||
// {
|
||
// name: '给煤量(T)', type: 'line',
|
||
// data: yData,
|
||
// lineStyle: {
|
||
// normal: {
|
||
// width: 2
|
||
// }
|
||
// },
|
||
// label: {
|
||
// show: true, // 在折线拐点上显示数据
|
||
// position:'bottom',
|
||
// textStyle:{
|
||
// color:'black',
|
||
// fontSize:10
|
||
// }
|
||
// },
|
||
// smooth: true,
|
||
// symbol: 'circle',
|
||
// symbolSize: 6,
|
||
// showAllSymbol: true,
|
||
// color: '#EE6666',
|
||
// },
|
||
|
||
//]
|
||
};
|
||
myChart.setOption(option);
|
||
// echarts 窗口缩放自适应
|
||
window.onresize = function () {
|
||
myChart.resize();
|
||
}
|
||
}
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|