-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
350 lines (343 loc) · 13.7 KB
/
map.html
File metadata and controls
350 lines (343 loc) · 13.7 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
<!DOCTYPE html>
<html lang="en">
<!--[if IE 9 ]>
<html lang="en" class="ie9">
<![endif]-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="format-detection" content="telephone=no">
<meta charset="UTF-8">
<title>地图信息</title>
<!-- CSS -->
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap/bootstrap-table.css">
<link rel="stylesheet" href="css/bootstrap/bootstrap-select.min.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="customcss/Linearicons.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="css/icons.css">
<link rel="stylesheet" href="css/generics.css">
<link rel="stylesheet" href="css/jedate-6.0.0/jedate.css">
<link rel="stylesheet" href="customcss/style.css">
<link rel="stylesheet" href="customcss/custjedate.css">
<link rel="stylesheet" href="customcss/bootstrap-table-self.css">
<link rel="stylesheet" href="customcss/alarm/alarm.css">
<link rel="stylesheet" href="customcss/jebox.css">
</head>
<body>
<header id="header">
</header>
<div class="clearfix"></div>
<section id="main" class="p-relative" role="main">
<aside id="sidebar" class="fixed">
<!-- Side Menu -->
<ul class="list-unstyled side-menu top0">
</ul>
</aside>
<section id="content" class="container">
<div class="block-area" style="height: 100%;">
<div class="row" style="height: 100%;">
<div id="cond_query" class="col-md-2">
<div class="mapTitle"></div>
<form id="search_form">
<div class="form-group m-t-10">
<label>开始时间</label> <input id="starttime" class="datainp inptime form-control" type="text">
</div>
<div class="form-group m-t-10">
<label>结束时间</label> <input id="endtime" class="datainp inptime form-control" type="text">
</div>
<div class="form-group m-t-10">
<label for="watchpoint">生成方式</label>
<select id="kpiName" class="selectpicker form-control" data-live-search="true"
data-style="form-control" data-size="10">
</select>
</div>
<div class="form-group m-t-10">
<label for="watchpoint">观察点</label>
<select id="watchpoint" class="selectpicker form-control" data-live-search="true"
data-style="form-control" data-size="10">
<!-- <option value="4001" selected = 'selected'>全部业务</option> -->
</select>
</div>
<div class="form-group m-t-10">
<label for="server">服务端</label>
<select id="server" class="selectpicker form-control" data-live-search="true"
data-style="form-control" data-size="10">
</select>
</div>
<button id="form_submit" onclick="query()" type="button"
class="btn m-t-10" style="float: right;">统计</button>
</form>
</div>
<div class="col-md-10" style="height: 100%;">
<div id="mapLoad">
<!-- <img src="images/gif.gif"> -->
请在左侧,选择生成数据方式。。。。。
</div>
<div style="display: none;" id="mapLoad123">
<img src="images/gif.gif">
数据加载中,请稍后。。。。。
</div>
<div id="map" class="table-responsive" style="height: 100%;">
</div>
<div class="mapother"><a id="otherArea" style="cursor: pointer;">中国以外地区</a></div>
</div>
</div>
</div>
</section>
</section>
<!-- jQuery -->
<script src="js/jQuery/jquery.min.js"></script>
<!-- jQuery Library -->
<!-- Bootstrap -->
<script src="js/bootstrap/bootstrap.min.js"></script>
<script src="customjs/header.js"></script>
<script src="js/fileupload.min.js"></script>
<!-- Bootstrap-table -->
<script src="js/bootstrap/bootstrap-table.js"></script>
<script src="js/bootstrap/bootstrap-table-zh-CN.js"></script>
<script src="js/bootstrap/bootstrap-table-export.js"></script>
<script src="customjs/table/bootstrap.table.util.js"></script>
<script src="js/bootstrap/bootstrap-select.min.js"></script>
<script src="js/bootstrap/bootstrap-select-zh_CN.min.js"></script>
<script src="js/bootstrap/tableExport.js"></script>
<script src="js/functions.js"></script>
<script src="js/jQuery/jedate-6.0.0/jquery.jedate.js"></script>
<script src="customjs/changeBackground.js"></script>
<script src="js/jQuery/tdrage/Tdrag.js"></script>
<script src="js/jQuery/timeStamp.js"></script>
<script src="customjs/alarm/alarm.js"></script>
<!--地图相关begin-->
<!-- 地图所需js -->
<script src="js/highcharts/code/highcharts.js"></script>
<!-- 地图所需js -->
<script src="js/highcharts/code/map.js"></script>
<!-- 地图下钻所需js -->
<script src="js/highcharts/code/drilldown.js"></script>
<!-- 加载所有省份所需js -->
<script src="js/highcharts/mapdata/countries/cn/china.js"></script>
<!-- 引用封装util -->
<script src="customjs/highchartUtil/highchart.util.js"></script>
<!--地图相关end-->
<script src="customjs/sidebar.js"></script>
<script src="customjs/number-format.js"></script>
<script src="customjs/search.js"></script>
<script src="js/jquery.jebox.min.js"></script>
<script src="customjs/colose.js"></script>
<script src="customjs/utils/shrink.js"></script>
</body>
<script type = "text/javascript">
$(function() {
$.customEleShrink({ domId: 'cond_query' });
});
//服务端下拉框赋值
function addOption(domId, data) {
var option = "";
$("#" + domId).append("<option selected value ="+0+">---请选择---</option>");
if(domId =="server"){
$("#" + domId).append("<option value="+4001+">全部业务</option>");
}
for(var i = 0; i < data.length; i++){
if(i == 0){
option += "<option value = " + data[i].id + ">" + data[i].name + "</option>";
} else {
option += "<option value = " + data[i].id + ">" + data[i].name + "</option>";
}
}
$("#" + domId).append(option);
}
/* kpi添加 */
$.ajax({
url:"/plot/getPlotByModuleId.do",
type:"post",
async:false,
data:{moduleId:12},
dataType:"json",
success : function(data) {
var options =null;
$("#kpiName").append("<option selected value =0>---请选择---</option>");
for(var i=0; i< data.length;i++ ){
plotId=data[i].id;
plotTypeId=data[i].types[0].id;
switch(data[i].name){
case "网络流量":
options ='<option id ='+ data[i].id +' value="flow" data-plotTypeId='+data[i].types[0].id+'>'+ data[i].name +'</option>';
$("#kpiName").append(options);
break;
case "会话数量":
options ='<option id ='+ data[i].id +' value="NumberSessions" data-plotTypeId='+data[i].types[0].id+'>'+ data[i].name +'</option>';
$("#kpiName").append(options);
break;
case "服务质量":
options ='<option id ='+ data[i].id +' value="qos" data-plotTypeId='+data[i].types[0].id+'>'+ data[i].name +'</option>';
$("#kpiName").append(options);
break;
case "网络丢包率":
options ='<option id ='+ data[i].id +' value="netPktLost" data-plotTypeId='+data[i].types[0].id+'>'+ data[i].name +'</option>';
$("#kpiName").append(options);
break;
}
}
}
});
//加载事件
$(function () {
var date =new Date();
// 当前十分钟,不保留小数点 取整
var start= parseInt(date.getTime() /1000) - 600 ;
//转换 年 月 日 十 分 秒
var startTime=new Date(start*1000).Format("yyyy-MM-dd hh:mm:ss");
//获取分钟数 new Date(startTime).getMinutes()
$("#starttime").jeDate({
isTime: true,
isClear: false,
isinitVal: true,
initDate:[{hh:new Date(startTime.replace(/-/g,"/")).getHours(), mm: new Date(startTime.replace(/-/g,"/")).getMinutes(), ss: 00 }, false],
format: 'YYYY-MM-DD hh:mm:ss'
});
$("#endtime").jeDate({
isTime: true,
isClear: false,
isinitVal: true,
initDate:[{ ss: 00 }, false],
format: 'YYYY-MM-DD hh:mm:ss'
});
//观察点业务
$.ajax({
url : "/watchpointController/getFindAll.do",
type : 'POST',
async : false,
timeout : 5000,
dataType : 'json',
success : function(data) {
addOption("watchpoint", data);
}
});
//服务端业务
$.ajax({
url : "/serverManagement/getAllServerSide.do",
type : 'POST',
async : false,
timeout : 5000,
dataType : 'json',
success : function(data) {
addOption("server", data);
}
});
querys();
})
//查询
function query(){
$("#mapLoad").show();
$("#form_submit").button('loading').delay(1000).queue(function() {
});
var serverId = $("#server").val();
var kpiName = $("#kpiName").val();
var watchpointId = $("#watchpoint").val();
if(kpiName == "0"){
jeBox.alert('请选择生成方式!!!');
$("#form_submit").button('reset');
return;
}
if(watchpointId == "0"){
jeBox.alert('请选择观察点!!!');
$("#form_submit").button('reset');
return;
}
if(serverId == "0"){
jeBox.alert('请选择服务端!! ! ');
$("#form_submit").button('reset');
return;
}
var startTime = "";
var endTime = "";
if("" != $("#starttime").val() && "" != $("#endtime").val()){
startTime = new Date($("#starttime").val().replace(/-/g,"/")).getTime()/1000;
endTime = new Date($("#endtime").val().replace(/-/g,"/")).getTime()/1000;
}
var params = {startTime:startTime,endTime:endTime,kpiName:kpiName,appBusinessId:serverId,watchpointId:watchpointId};
$.drawHMap("map",$("#kpiName>option:selected").text().trim() + "地图统计","/map/getMapData.do",params);
$(".mapTitle").html($("#kpiName>option:selected").text().trim() + "地图统计");
$("#mapLoad123").show();
}
//显示蒙版
function querys(){
$("#mapLoad").show();
}
//中国以外地区跳转到通信对页面
$("#otherArea").click(function(){
var chartUrl = "/serverManagement/getServerSideGraphical.do";
var start = Date.parse(new Date($("#starttime").val())) /1000;
var end = Date.parse(new Date($("#endtime").val())) /1000;
var watchpointId = $("#watchpoint").val();
var plotTypeId =$("#kpiName>option:selected").attr("data-plotTypeId");
var kpi = $("#kpiName>option:selected").attr("id");
var server = $("#server").val();
var otherCountry = 1;
var ipmCenterId = 1;
if(server == "4001"){
/*观察点kpi业务*/
$.ajax({
url:"/plot/getPlotByModuleId.do",
type:"post",
async:false,
data:{moduleId:10},
dataType:"json",
success : function(data) {
chartUrl="/watchpointController/getWatchpointGraphical.do";
for(var i =0; i<data.length;i++){
if(data[i].name == name){ //网络流量 会话数量 数据包速录 链路时延RTT
plotId=data[i].id;
plotTypeId=data[i].types[0].id;
}
}
}
});
location.href = 'commun_queue.html?' +
'mapData='+encodeURI('地图')+'&' +
'otherCountry='+otherCountry+'&' +
'ipmCenterId='+ipmCenterId+'&' +
'chartUrl='+chartUrl+'&' +
'starttime='+start+'&' +
'endtime='+end+'&' +
'plotId='+kpi+'&' +
'plotTypeId='+plotTypeId+'&' +
'watchpointId='+watchpointId;
}else{
location.href = 'commun_queue.html?' +
'mapData='+encodeURI('地图')+'&' +
'chartUrl='+chartUrl+'&' +
'otherCountry='+otherCountry+'&' +
'ipmCenterId='+ipmCenterId+'&' +
'starttime='+start+'&' +
'endtime='+end+'&' +
'plotId='+kpi+'&' +
'plotTypeId='+plotTypeId+'&' +
'watchpointId='+watchpointId+'&' +
'serverId='+server;
}
});
// 对Date的扩展,将 Date 转化为指定格式的String
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
// 例子:
// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
Date.prototype.Format = function (fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
</script>
</html>