runStatus.jsp
12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
<fmt:message key="menu.bigdata.runStatus"/>
</h3>
<div class="row">
<div class="col-md-12">
<form method="post" action="${ctx}/system/runStatus.html">
<div class="form-group">
<div class="col-md-4" style="padding-left:0px;">
<div class="input-group input-large date-picker input-daterange" data-date="2017-05-10" data-date-format="${datePatten}">
<input type="text" class="form-control" name="startDay" value="${startDay}">
<span class="input-group-addon">
to </span>
<input type="text" class="form-control" name="endDay" value="${endDay}">
</div>
<!-- /input-group -->
<span class="help-block"> </span>
</div>
<div class="col-md-6">
<div class="btn-group">
<button class="btn yellow" type="submit">
<i class="fa fa-sign-out"></i><fmt:message key="btn.view"/></button>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- BEGIN CHART PORTLET-->
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption">
<i class="icon-bar-chart font-green-haze"></i>
<span class="caption-subject bold uppercase font-green-haze"><fmt:message key="runStatus.throughput"/></span>
</div>
<div class="tools">
</div>
</div>
<div class="portlet-body">
<div id="inOutChart" class="chart" style="height: 350px; overflow: hidden;">
</div>
</div>
</div>
<!-- END CHART PORTLET-->
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- BEGIN CHART PORTLET-->
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption">
<i class="icon-bar-chart font-green-haze"></i>
<span class="caption-subject bold uppercase font-green-haze"><fmt:message key="runStatus.alarmInfo"/></span>
</div>
<div class="tools">
</div>
</div>
<div class="portlet-body">
<div class="row">
<div class="col-md-12">
<div id="alarmChart" class="chart" style="height: 350px; overflow: hidden;">
</div>
</div>
<div class="col-md-6">
<div id="alarmTypeChart" class="chart col-md-6" style="height: 250px; overflow: hidden;">
</div>
</div>
<div class="col-md-6">
<div id="alarmBoxChart" class="chart col-md-6" style="height: 250px; overflow: hidden;">
</div>
</div>
</div>
</div>
</div>
<!-- END CHART PORTLET-->
</div>
</div>
<fmt:message key="runStatus.throughput" var="label_throughput"/>
<fmt:message key="runStatus.alarmTimes" var="label_alarmTimes"/>
<fmt:message key="runStatus.alarmLastTime" var="label_alarmLastTime"/>
<fmt:message key="runStatus.minutes" var="label_minutes"/>
<input id="jsondata" type="hidden" value='${inOutChartJsonData}' />
<c:set var="scripts" scope="request">
<script src="${ctx}/scripts/echarts.min.js"></script>
<script type="text/javascript">
var days = new Array();
var alarms = new Array();
var lastTimes = new Array();
<c:forEach items="${inOutData}" var="inOutItem">
days.push("${inOutItem.label}");
//putIns.push("${inOutItem.value}");
//checkOuts.push("${inOutItem.value2}");
alarms.push("${inOutItem.value3}");
lastTimes.push("${inOutItem.value4}");
</c:forEach>
var inOutChart = echarts.init(document.getElementById("inOutChart"));
var inOutJsonData = $('#jsondata').val();
var inOutData =eval('('+inOutJsonData+')');//jsonObj就是一个json对象了。
inOutOption = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
//dataView: {show: true, readOnly: true},
//saveAsImage: {show: true}
}
},
legend: {
data:inOutData.legend
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data : inOutData.xAxis,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '${label_throughput}',
axisLabel: {
formatter: '{value}'
}
}
],
series: inOutData.series
};
inOutChart.setOption(inOutOption);
alarmOption = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
crossStyle: {
color: '#999'
}
}
},
legend: {
data:['${label_alarmTimes}','${label_alarmLastTime}']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: days,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '${label_alarmTimes}',
min: 0,
max: 500,
//interval: 5,
minInterval: 1,
axisLabel: {
formatter: '{value} ${label_times}'
}
},
{
type: 'value',
name: '${label_alarmLastTime}(${label_minutes})',
min: 0,
max: 1000,
//interval: 50,
minInterval: 1,
axisLabel: {
formatter: '{value} ${label_minutes}'
}
}
],
series: [
{
name:'${label_alarmTimes}',
type:'line',
symbol: 'emptyCircle',
symbolSize: 10,
itemStyle:{
normal: {
color: '#F3565D'
}
},
data:alarms
}
,
{
name:'${label_alarmLastTime}',
type:'line',
symbol: 'emptyCircle',
stack: '总量',
symbolSize: 10,
itemStyle:{
normal: {
color: '#4b77be'
}
},
areaStyle: {normal: {}},
smooth:true,
symbol: 'none',
sampling: 'average',
yAxisIndex: 1,
data:lastTimes
}
]
};
var alarmChart = echarts.init(document.getElementById("alarmChart"));
alarmChart.setOption(alarmOption);
//报警类型
var types = new Array();
var typeCount = new Array();
var typeLastTimes = new Array();
<c:forEach items="${alarmTypeData}" var="alarmTypeItem">
types.push("${alarmTypeItem.label}");
typeCount.push({name:"${alarmTypeItem.label}",value:${alarmTypeItem.value}});
typeLastTimes.push({name:"${alarmTypeItem.label}",value:${alarmTypeItem.value2}});
</c:forEach>
alarmTypeOption = {
tooltip: {
trigger: 'item',
formatter: "{b} <br/>{a}: {c} ({d}%)"
},
legend: {
orient: 'vertical',
x: 'left',
data:types
},
color: ['#4b8df8','#4da74d','#edc240','#cb4b4b', '#afd8f8','#9440ed','#36d7b7','#b074ff','#749f83','#91c7ae','#d48265','#61a0a8', '#2f4554', '#c23531'],
series: [
{
name:'报警次数',
type:'pie',
selectedMode: 'single',
radius: [0, '40%'],
label: {
normal: {
show: false
}
},
data:typeCount
},
{
name:'报警持续时间',
type:'pie',
radius: ['55%', '75%'],
label: {
normal: {
show: false
}
},
data:typeLastTimes
}
]
};
var alarmTypeChart = echarts.init(document.getElementById("alarmTypeChart"));
alarmTypeChart.setOption(alarmTypeOption);
//报警BOX
var boxs = new Array();
var boxCount = new Array();
var boxLastTimes = new Array();
<c:forEach items="${alarmBoxData}" var="alarmBoxItem">
boxs.push("${alarmBoxItem.label}");
boxCount.push({name:"${alarmBoxItem.label}",value:${alarmBoxItem.value}});
boxLastTimes.push({name:"${alarmBoxItem.label}",value:${alarmBoxItem.value2}});
</c:forEach>
alarmBoxOption = {
tooltip: {
trigger: 'item',
formatter: "{b} <br/>{a}: {c} ({d}%)"
},
legend: {
orient: 'vertical',
x: 'left',
data:boxs
},
series: [
{
name:'报警次数',
type:'pie',
selectedMode: 'single',
radius: [0, '40%'],
label: {
normal: {
show: false
}
},
data:boxCount
},
{
name:'报警持续时间',
type:'pie',
radius: ['55%', '75%'],
label: {
normal: {
show: false
}
},
data:boxLastTimes
}
]
};
var alarmBoxChart = echarts.init(document.getElementById("alarmBoxChart"));
alarmBoxChart.setOption(alarmBoxOption);
$.fn.datepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
today: "今天",
suffix: [],
meridiem: ["上午", "下午"]
};
$('.date-picker').datepicker({
rtl: Metronic.isRTL(),
orientation: "left",
autoclose: true,
language:'zh-CN'
});
</script>
</c:set>